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.
453 lines
1.5 MiB
453 lines
1.5 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[215,3,5,7,8,20],{"++UQ":function(Be,le,D){},"+NIl":function(Be,le,D){(function(Q){Q(D("VrN/"))})(function(Q){"use strict";Q.defineMode("stex",function(z,M){"use strict";function X(u,o){u.cmdState.push(o)}function F(u){return u.cmdState.length>0?u.cmdState[u.cmdState.length-1]:null}function I(u){var o=u.cmdState.pop();o&&o.closeBracket()}function H(u){for(var o=u.cmdState,h=o.length-1;h>=0;h--){var r=o[h];if(r.name=="DEFAULT")continue;return r}return{styleIdentifier:function(){return null}}}function N(u,o,h){return function(){this.name=u,this.bracketNo=0,this.style=o,this.styles=h,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=N("importmodule","tag",["string","builtin"]),n.documentclass=N("documentclass","tag",["","atom"]),n.usepackage=N("usepackage","tag",["atom"]),n.begin=N("begin","tag",["atom"]),n.end=N("end","tag",["atom"]),n.label=N("label","tag",["atom"]),n.ref=N("ref","tag",["atom"]),n.eqref=N("eqref","tag",["atom"]),n.cite=N("cite","tag",["atom"]),n.bibitem=N("bibitem","tag",["atom"]),n.Bibitem=N("Bibitem","tag",["atom"]),n.RBibitem=N("RBibitem","tag",["atom"]),n.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function P(u,o){u.f=o}function p(u,o){var h;if(u.match(/^\\[a-zA-Z@]+/)){var r=u.current().slice(1);return h=n.hasOwnProperty(r)?n[r]:n.DEFAULT,h=new h,X(o,h),P(o,d),h.style}if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/\\]/))return"tag";if(u.match("\\["))return P(o,function(i,s){return m(i,s,"\\]")}),"keyword";if(u.match("\\("))return P(o,function(i,s){return m(i,s,"\\)")}),"keyword";if(u.match("$$"))return P(o,function(i,s){return m(i,s,"$$")}),"keyword";if(u.match("$"))return P(o,function(i,s){return m(i,s,"$")}),"keyword";var a=u.next();if(a=="%")return u.skipToEnd(),"comment";if(a=="}"||a=="]"){if(h=F(o),h)h.closeBracket(a),P(o,d);else return"error";return"bracket"}else return a=="{"||a=="["?(h=n.DEFAULT,h=new h,X(o,h),"bracket"):/\d/.test(a)?(u.eatWhile(/[\w.%]/),"atom"):(u.eatWhile(/[\w\-_]/),h=H(o),h.name=="begin"&&(h.argument=u.current()),h.styleIdentifier())}function m(u,o,h){if(u.eatSpace())return null;if(h&&u.match(h))return P(o,p),"keyword";if(u.match(/^\\[a-zA-Z@]+/))return"tag";if(u.match(/^[a-zA-Z]+/))return"variable-2";if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/]/))return"tag";if(u.match(/^[\^_&]/))return"tag";if(u.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(u.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var r=u.next();return r=="{"||r=="}"||r=="["||r=="]"||r=="("||r==")"?"bracket":r=="%"?(u.skipToEnd(),"comment"):"error"}function d(u,o){var h=u.peek(),r;return h=="{"||h=="["?(r=F(o),r.openBracket(h),u.eat(h),P(o,p),"bracket"):/[ \t\r]/.test(h)?(u.eat(h),null):(P(o,p),I(o),p(u,o))}return{startState:function(){var u=M.inMathMode?function(o,h){return m(o,h)}:p;return{cmdState:[],f:u}},copyState:function(u){return{cmdState:u.cmdState.slice(),f:u.f}},token:function(u,o){return o.f(u,o)},blankLine:function(u){u.f=p,u.cmdState.length=0},lineComment:"%"}}),Q.defineMIME("text/x-stex","stex"),Q.defineMIME("text/x-latex","stex")})},"+QRC":function(Be,le,D){"use strict";var Q=D("E9nw"),z={"text/plain":"Text","text/html":"Url",default:"Text"},M="Copy to clipboard: #{key}, Enter";function X(I){var H=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return I.replace(/#{\s*key\s*}/g,H)}function F(I,H){var N,n,P,p,m,d,u=!1;H||(H={}),N=H.debug||!1;try{P=Q(),p=document.createRange(),m=document.getSelection(),d=document.createElement("span"),d.textContent=I,d.style.all="unset",d.style.position="fixed",d.style.top=0,d.style.clip="rect(0, 0, 0, 0)",d.style.whiteSpace="pre",d.style.webkitUserSelect="text",d.style.MozUserSelect="text",d.style.msUserSelect="text",d.style.userSelect="text",d.addEventListener("copy",function(h){if(h.stopPropagation(),H.format)if(h.preventDefault(),typeof h.clipboardData=="undefined"){N&&console.warn("unable to use e.clipboardData"),N&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var r=z[H.format]||z.default;window.clipboardData.setData(r,I)}else h.clipboardData.clearData(),h.clipboardData.setData(H.format,I);H.onCopy&&(h.preventDefault(),H.onCopy(h.clipboardData))}),document.body.appendChild(d),p.selectNodeContents(d),m.addRange(p);var o=document.execCommand("copy");if(!o)throw new Error("copy command was unsuccessful");u=!0}catch(h){N&&console.error("unable to copy using execCommand: ",h),N&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(H.format||"text",I),H.onCopy&&H.onCopy(window.clipboardData),u=!0}catch(r){N&&console.error("unable to copy using clipboardData: ",r),N&&console.error("falling back to prompt"),n=X("message"in H?H.message:M),window.prompt(n,I)}}finally{m&&(typeof m.removeRange=="function"?m.removeRange(p):m.removeAllRanges()),d&&document.body.removeChild(d),P()}return u}Be.exports=F},"+aKw":function(Be,le,D){"use strict";var Q=D("tJVT"),z=D("q1tI"),M=D.n(z),X=function(H){return String(H).length===1?"0".concat(H):H},F=function(H){var N=H.className,n=N===void 0?"":N,P=H.onChange,p=H.defaultValue,m=p===void 0?0:p,d=Object(z.useState)(m),u=Object(Q.a)(d,2),o=u[0],h=u[1];Object(z.useEffect)(function(){var s=setTimeout(function(){h(o+1e3)},1e3);return P(o+1e3),function(){clearInterval(s)}},[o]);var r=parseInt(o/(60*6e4))||"00",a=parseInt(o%(60*6e4)/6e4)||"00",i=parseInt(o%6e4/1e3)||"00";return M.a.createElement("div",{className:n},X(r),":",X(a),":",X(i))};le.a=F},"+ua5":function(Be,le,D){},"/cxE":function(Be,le,D){"use strict";D.d(le,"f",function(){return M}),D.d(le,"g",function(){return X}),D.d(le,"h",function(){return F}),D.d(le,"e",function(){return H}),D.d(le,"b",function(){return N}),D.d(le,"c",function(){return n}),D.d(le,"d",function(){return P}),D.d(le,"a",function(){return p});class Q{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(m){setTimeout(()=>{throw m.stack?new Error(m.message+`
|
|
|
|
`+m.stack):m},0)}}emit(m){this.listeners.forEach(d=>{d(m)})}onUnexpectedError(m){this.unexpectedErrorHandler(m),this.emit(m)}onUnexpectedExternalError(m){this.unexpectedErrorHandler(m)}}const z=new Q;function M(m){H(m)||z.onUnexpectedError(m);return}function X(m){H(m)||z.onUnexpectedExternalError(m);return}function F(m){if(m instanceof Error){let{name:d,message:u}=m;const o=m.stacktrace||m.stack;return{$isError:!0,name:d,message:u,stack:o}}return m}const I="Canceled";function H(m){return m instanceof Error&&m.name===I&&m.message===I}function N(){const m=new Error(I);return m.name=m.message,m}function n(m){return m?new Error(`Illegal argument: ${m}`):new Error("Illegal argument")}function P(m){return m?new Error(`Illegal state: ${m}`):new Error("Illegal state")}class p extends Error{constructor(m){super("NotSupported");m&&(this.message=m)}}},"07cG":function(Be,le,D){Be.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"0r65":function(Be,le){var D=arguments[3],Q=arguments[4],z=arguments[5],M=JSON.stringify;Be.exports=function(X,F){for(var I,H=Object.keys(z),N=0,n=H.length;N<n;N++){var P=H[N],p=z[P].exports;if(p===X||p&&p.default===X){I=P;break}}if(!I){I=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var m={},N=0,n=H.length;N<n;N++){var P=H[N];m[P]=P}Q[I]=["function(require,module,exports){"+X+"(self); }",m]}var d=Math.floor(Math.pow(16,8)*Math.random()).toString(16),u={};u[I]=I,Q[d]=["function(require,module,exports){var f = require("+M(I)+");(f.default ? f.default : f)(self);}",u];var o={};h(d);function h(x){o[x]=!0;for(var T in Q[x][1]){var A=Q[x][1][T];o[A]||h(A)}}var r="("+D+")({"+Object.keys(o).map(function(x){return M(x)+":["+Q[x][0]+","+M(Q[x][1])+"]"}).join(",")+"},{},["+M(d)+"])",a=window.URL||window.webkitURL||window.mozURL||window.msURL,i=new Blob([r],{type:"text/javascript"});if(F&&F.bare)return i;var s=a.createObjectURL(i),S=new Worker(s);return S.objectURL=s,S}},"19Vz":function(Be,le,D){(function(Q){Q(D("VrN/"))})(function(Q){Q.defineOption("placeholder","",function(N,n,P){var p=P&&P!=Q.Init;if(n&&!p)N.on("blur",F),N.on("change",I),N.on("swapDoc",I),Q.on(N.getInputField(),"compositionupdate",N.state.placeholderCompose=function(){X(N)}),I(N);else if(!n&&p){N.off("blur",F),N.off("change",I),N.off("swapDoc",I),Q.off(N.getInputField(),"compositionupdate",N.state.placeholderCompose),z(N);var m=N.getWrapperElement();m.className=m.className.replace(" CodeMirror-empty","")}n&&!N.hasFocus()&&F(N)});function z(N){N.state.placeholder&&(N.state.placeholder.parentNode.removeChild(N.state.placeholder),N.state.placeholder=null)}function M(N){z(N);var n=N.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=N.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var P=N.getOption("placeholder");typeof P=="string"&&(P=document.createTextNode(P)),n.appendChild(P),N.display.lineSpace.insertBefore(n,N.display.lineSpace.firstChild)}function X(N){setTimeout(function(){var n=!1,P=N.getInputField();P.nodeName=="TEXTAREA"?n=!P.value:N.lineCount()==1&&(n=!/[^\u200b]/.test(P.querySelector(".CodeMirror-line").textContent)),n?M(N):z(N)},20)}function F(N){H(N)&&M(N)}function I(N){var n=N.getWrapperElement(),P=H(N);n.className=n.className.replace(" CodeMirror-empty","")+(P?" CodeMirror-empty":""),P?M(N):z(N)}function H(N){return N.lineCount()===1&&N.getLine(0)===""}})},"1FX+":function(Be,le,D){Be.exports={flex_box_center:"flex_box_center___t3HuD",flex_space_between:"flex_space_between___3eY6W",flex_box_vertical_center:"flex_box_vertical_center___SMD2f",flex_box_center_end:"flex_box_center_end___1qy96",flex_box_column:"flex_box_column___1iEso",wrap:"wrap___3Vyua",head:"head___HUi2n",sort:"sort___1UPxB",btn:"btn___2b6SJ",listWarp:"listWarp___1pNnP",pagination:"pagination___3I0F3",fixedRight:"fixedRight___527Xj","oj-width-input":"oj-width-input___QQMFK"}},"1eCo":function(Be,le,D){(function(Q){Q(D("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},M={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};Q.defineMode("xml",function(X,F){var I=X.indentUnit,H={},N=F.htmlMode?z:M;for(var n in N)H[n]=N[n];for(var n in F)H[n]=F[n];var P,p;function m(f,C){function E(j){return C.tokenize=j,j(f,C)}var _=f.next();if(_=="<")return f.eat("!")?f.eat("[")?f.match("CDATA[")?E(o("atom","]]>")):null:f.match("--")?E(o("comment","-->")):f.match("DOCTYPE",!0,!0)?(f.eatWhile(/[\w\._\-]/),E(h(1))):null:f.eat("?")?(f.eatWhile(/[\w\._\-]/),C.tokenize=o("meta","?>"),"meta"):(P=f.eat("/")?"closeTag":"openTag",C.tokenize=d,"tag bracket");if(_=="&"){var U;return f.eat("#")?f.eat("x")?U=f.eatWhile(/[a-fA-F\d]/)&&f.eat(";"):U=f.eatWhile(/[\d]/)&&f.eat(";"):U=f.eatWhile(/[\w\.\-:]/)&&f.eat(";"),U?"atom":"error"}else return f.eatWhile(/[^&<]/),null}m.isInText=!0;function d(f,C){var E=f.next();if(E==">"||E=="/"&&f.eat(">"))return C.tokenize=m,P=E==">"?"endTag":"selfcloseTag","tag bracket";if(E=="=")return P="equals",null;if(E=="<"){C.tokenize=m,C.state=s,C.tagName=C.tagStart=null;var _=C.tokenize(f,C);return _?_+" tag error":"tag error"}else return/[\'\"]/.test(E)?(C.tokenize=u(E),C.stringStartCol=f.column(),C.tokenize(f,C)):(f.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function u(f){var C=function(E,_){for(;!E.eol();)if(E.next()==f){_.tokenize=d;break}return"string"};return C.isInAttribute=!0,C}function o(f,C){return function(E,_){for(;!E.eol();){if(E.match(C)){_.tokenize=m;break}E.next()}return f}}function h(f){return function(C,E){for(var _;(_=C.next())!=null;){if(_=="<")return E.tokenize=h(f+1),E.tokenize(C,E);if(_==">")if(f==1){E.tokenize=m;break}else return E.tokenize=h(f-1),E.tokenize(C,E)}return"meta"}}function r(f,C,E){this.prev=f.context,this.tagName=C,this.indent=f.indented,this.startOfLine=E,(H.doNotIndent.hasOwnProperty(C)||f.context&&f.context.noIndent)&&(this.noIndent=!0)}function a(f){f.context&&(f.context=f.context.prev)}function i(f,C){for(var E;;){if(!f.context)return;if(E=f.context.tagName,!H.contextGrabbers.hasOwnProperty(E)||!H.contextGrabbers[E].hasOwnProperty(C))return;a(f)}}function s(f,C,E){return f=="openTag"?(E.tagStart=C.column(),S):f=="closeTag"?x:s}function S(f,C,E){return f=="word"?(E.tagName=C.current(),p="tag",w):H.allowMissingTagName&&f=="endTag"?(p="tag bracket",w(f,C,E)):(p="error",S)}function x(f,C,E){if(f=="word"){var _=C.current();return E.context&&E.context.tagName!=_&&H.implicitlyClosed.hasOwnProperty(E.context.tagName)&&a(E),E.context&&E.context.tagName==_||H.matchClosing===!1?(p="tag",T):(p="tag error",A)}else return H.allowMissingTagName&&f=="endTag"?(p="tag bracket",T(f,C,E)):(p="error",A)}function T(f,C,E){return f!="endTag"?(p="error",T):(a(E),s)}function A(f,C,E){return p="error",T(f,C,E)}function w(f,C,E){if(f=="word")return p="attribute",v;if(f=="endTag"||f=="selfcloseTag"){var _=E.tagName,U=E.tagStart;return E.tagName=E.tagStart=null,f=="selfcloseTag"||H.autoSelfClosers.hasOwnProperty(_)?i(E,_):(i(E,_),E.context=new r(E,_,U==E.indented)),s}return p="error",w}function v(f,C,E){return f=="equals"?b:(H.allowMissing||(p="error"),w(f,C,E))}function b(f,C,E){return f=="string"?g:f=="word"&&H.allowUnquoted?(p="string",w):(p="error",w(f,C,E))}function g(f,C,E){return f=="string"?g:w(f,C,E)}return{startState:function(f){var C={tokenize:m,state:s,indented:f||0,tagName:null,tagStart:null,context:null};return f!=null&&(C.baseIndent=f),C},token:function(f,C){if(!C.tagName&&f.sol()&&(C.indented=f.indentation()),f.eatSpace())return null;P=null;var E=C.tokenize(f,C);return(E||P)&&E!="comment"&&(p=null,C.state=C.state(P||E,f,C),p&&(E=p=="error"?E+" error":p)),E},indent:function(f,C,E){var _=f.context;if(f.tokenize.isInAttribute)return f.tagStart==f.indented?f.stringStartCol+1:f.indented+I;if(_&&_.noIndent)return Q.Pass;if(f.tokenize!=d&&f.tokenize!=m)return E?E.match(/^(\s*)/)[0].length:0;if(f.tagName)return H.multilineTagIndentPastTag!==!1?f.tagStart+f.tagName.length+2:f.tagStart+I*(H.multilineTagIndentFactor||1);if(H.alignCDATA&&/<!\[CDATA\[/.test(C))return 0;var U=C&&/^<(\/)?([\w_:\.-]*)/.exec(C);if(U&&U[1])for(;_;)if(_.tagName==U[2]){_=_.prev;break}else if(H.implicitlyClosed.hasOwnProperty(_.tagName))_=_.prev;else break;else if(U)for(;_;){var j=H.contextGrabbers[_.tagName];if(j&&j.hasOwnProperty(U[2]))_=_.prev;else break}for(;_&&_.prev&&!_.startOfLine;)_=_.prev;return _?_.indent+I:f.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:H.htmlMode?"html":"xml",helperType:H.htmlMode?"html":"xml",skipAttribute:function(f){f.state==b&&(f.state=w)},xmlCurrentTag:function(f){return f.tagName?{name:f.tagName,close:f.type=="closeTag"}:null},xmlCurrentContext:function(f){for(var C=[],E=f.context;E;E=E.prev)E.tagName&&C.push(E.tagName);return C.reverse()}}}),Q.defineMIME("text/xml","xml"),Q.defineMIME("application/xml","xml"),Q.mimeModes.hasOwnProperty("text/html")||Q.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(Be,le,D){"use strict";D.d(le,"d",function(){return We}),D.d(le,"b",function(){return Le}),D.d(le,"c",function(){return ut}),D.d(le,"a",function(){return jt});var Q=D("VTBJ"),z=D("1OyB"),M=D("vuIU"),X=D("JX7q"),F=D("Ji7U"),I=D("LK+K"),H=D("q1tI"),N=D("I8Z2"),n=D("BGR+"),P=D("wx14"),p=D("rePB"),m=D("4IlW"),d=D("2GS6"),u=D("Gytx"),o=D.n(u),h=D("TSYQ"),r=D.n(h),a=D("U8pU"),i=D("ODXe"),s=/iPhone/i,S=/iPod/i,x=/iPad/i,T=/\bAndroid(?:.+)Mobile\b/i,A=/Android/i,w=/\bAndroid(?:.+)SD4930UR\b/i,v=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,b=/Windows Phone/i,g=/\bWindows(?:.+)ARM\b/i,f=/BlackBerry/i,C=/BB10/i,E=/Opera Mini/i,_=/\b(CriOS|Chrome)(?:.+)Mobile/i,U=/Mobile(?:.+)Firefox\b/i;function j(Ct,et){return Ct.test(et)}function L(Ct){var et=Ct||(typeof navigator!="undefined"?navigator.userAgent:""),st=et.split("[FBAN");if(typeof st[1]!="undefined"){var He=st,pe=Object(i.a)(He,1);et=pe[0]}if(st=et.split("Twitter"),typeof st[1]!="undefined"){var Re=st,lt=Object(i.a)(Re,1);et=lt[0]}var Ye={apple:{phone:j(s,et)&&!j(b,et),ipod:j(S,et),tablet:!j(s,et)&&j(x,et)&&!j(b,et),device:(j(s,et)||j(S,et)||j(x,et))&&!j(b,et)},amazon:{phone:j(w,et),tablet:!j(w,et)&&j(v,et),device:j(w,et)||j(v,et)},android:{phone:!j(b,et)&&j(w,et)||!j(b,et)&&j(T,et),tablet:!j(b,et)&&!j(w,et)&&!j(T,et)&&(j(v,et)||j(A,et)),device:!j(b,et)&&(j(w,et)||j(v,et)||j(T,et)||j(A,et))||j(/\bokhttp\b/i,et)},windows:{phone:j(b,et),tablet:j(g,et),device:j(b,et)||j(g,et)},other:{blackberry:j(f,et),blackberry10:j(C,et),opera:j(E,et),firefox:j(U,et),chrome:j(_,et),device:j(f,et)||j(C,et)||j(E,et)||j(U,et)||j(_,et)},any:null,phone:null,tablet:null};return Ye.any=Ye.apple.device||Ye.android.device||Ye.windows.device||Ye.other.device,Ye.phone=Ye.apple.phone||Ye.android.phone||Ye.windows.phone,Ye.tablet=Ye.apple.tablet||Ye.android.tablet||Ye.windows.tablet,Ye}var G=Object(Q.a)(Object(Q.a)({},L()),{},{isMobile:L}),B=G;function O(){}function V(Ct,et,st){var He=et||"";return Ct.key||"".concat(He,"item_").concat(st)}function te(Ct){return"".concat(Ct,"-menu-")}function re(Ct,et){var st=-1;H.Children.forEach(Ct,function(He){st+=1,He&&He.type&&He.type.isMenuItemGroup?H.Children.forEach(He.props.children,function(pe){st+=1,et(pe,st)}):et(He,st)})}function ge(Ct,et,st){if(!Ct||st.find)return;H.Children.forEach(Ct,function(He){if(He){var pe=He.type;if(!pe||!(pe.isSubMenu||pe.isMenuItem||pe.isMenuItemGroup))return;et.indexOf(He.key)!==-1?st.find=!0:He.props.children&&ge(He.props.children,et,st)}})}var Ae=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],Oe=function(et){var st=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,He=et&&typeof et.getBoundingClientRect=="function"&&et.getBoundingClientRect().width;if(He){if(st){var pe=getComputedStyle(et),Re=pe.marginLeft,lt=pe.marginRight;He+=+Re.replace("px","")+ +lt.replace("px","")}He=+He.toFixed(6)}return He||0},Ce=function(et,st,He){et&&Object(a.a)(et.style)==="object"&&(et.style[st]=He)},je=function(){return B.any},Ue=D("KQm4"),xe=D("Ff2n"),be=D("i8i4"),Ve=D("bdgK"),mt=D("uciX"),yt=D("8XRh"),_t={adjustX:1,adjustY:1},xt={topLeft:{points:["bl","tl"],overflow:_t,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:_t,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:_t,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:_t,offset:[4,0]}},nt={topLeft:{points:["bl","tl"],overflow:_t,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:_t,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:_t,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:_t,offset:[4,0]}},ct=xt,wt=0,_e={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Me=function(et,st,He){var pe=te(st),Re=et.getState();et.setState({defaultActiveFirst:Object(Q.a)(Object(Q.a)({},Re.defaultActiveFirst),{},Object(p.a)({},pe,He))})},ve=function(Ct){Object(F.a)(st,Ct);var et=Object(I.a)(st);function st(He){var pe;Object(z.a)(this,st),pe=et.call(this,He),pe.onDestroy=function(Ke){pe.props.onDestroy(Ke)},pe.onKeyDown=function(Ke){var gt=Ke.keyCode,bt=pe.menuInstance,Tt=pe.props,Wt=Tt.isOpen,fe=Tt.store;if(gt===m.a.ENTER)return pe.onTitleClick(Ke),Me(fe,pe.props.eventKey,!0),!0;if(gt===m.a.RIGHT)return Wt?bt.onKeyDown(Ke):(pe.triggerOpenChange(!0),Me(fe,pe.props.eventKey,!0)),!0;if(gt===m.a.LEFT){var se;if(Wt)se=bt.onKeyDown(Ke);else return;return se||(pe.triggerOpenChange(!1),se=!0),se}return Wt&&(gt===m.a.UP||gt===m.a.DOWN)?bt.onKeyDown(Ke):void 0},pe.onOpenChange=function(Ke){pe.props.onOpenChange(Ke)},pe.onPopupVisibleChange=function(Ke){pe.triggerOpenChange(Ke,Ke?"mouseenter":"mouseleave")},pe.onMouseEnter=function(Ke){var gt=pe.props,bt=gt.eventKey,Tt=gt.onMouseEnter,Wt=gt.store;Me(Wt,pe.props.eventKey,!1),Tt({key:bt,domEvent:Ke})},pe.onMouseLeave=function(Ke){var gt=pe.props,bt=gt.parentMenu,Tt=gt.eventKey,Wt=gt.onMouseLeave;bt.subMenuInstance=Object(X.a)(pe),Wt({key:Tt,domEvent:Ke})},pe.onTitleMouseEnter=function(Ke){var gt=pe.props,bt=gt.eventKey,Tt=gt.onItemHover,Wt=gt.onTitleMouseEnter;Tt({key:bt,hover:!0}),Wt({key:bt,domEvent:Ke})},pe.onTitleMouseLeave=function(Ke){var gt=pe.props,bt=gt.parentMenu,Tt=gt.eventKey,Wt=gt.onItemHover,fe=gt.onTitleMouseLeave;bt.subMenuInstance=Object(X.a)(pe),Wt({key:Tt,hover:!1}),fe({key:Tt,domEvent:Ke})},pe.onTitleClick=function(Ke){var gt=Object(X.a)(pe),bt=gt.props;if(bt.onTitleClick({key:bt.eventKey,domEvent:Ke}),bt.triggerSubMenuAction==="hover")return;pe.triggerOpenChange(!bt.isOpen,"click"),Me(bt.store,pe.props.eventKey,!1)},pe.onSubMenuClick=function(Ke){typeof pe.props.onClick=="function"&&pe.props.onClick(pe.addKeyPath(Ke))},pe.onSelect=function(Ke){pe.props.onSelect(Ke)},pe.onDeselect=function(Ke){pe.props.onDeselect(Ke)},pe.getPrefixCls=function(){return"".concat(pe.props.rootPrefixCls,"-submenu")},pe.getActiveClassName=function(){return"".concat(pe.getPrefixCls(),"-active")},pe.getDisabledClassName=function(){return"".concat(pe.getPrefixCls(),"-disabled")},pe.getSelectedClassName=function(){return"".concat(pe.getPrefixCls(),"-selected")},pe.getOpenClassName=function(){return"".concat(pe.props.rootPrefixCls,"-submenu-open")},pe.saveMenuInstance=function(Ke){pe.menuInstance=Ke},pe.addKeyPath=function(Ke){return Object(Q.a)(Object(Q.a)({},Ke),{},{keyPath:(Ke.keyPath||[]).concat(pe.props.eventKey)})},pe.triggerOpenChange=function(Ke,gt){var bt=pe.props.eventKey,Tt=function(){pe.onOpenChange({key:bt,item:Object(X.a)(pe),trigger:gt,open:Ke})};gt==="mouseenter"?pe.mouseenterTimeout=setTimeout(function(){Tt()},0):Tt()},pe.isChildrenSelected=function(){var Ke={find:!1};return ge(pe.props.children,pe.props.selectedKeys,Ke),Ke.find},pe.isOpen=function(){return pe.props.openKeys.indexOf(pe.props.eventKey)!==-1},pe.adjustWidth=function(){if(!pe.subMenuTitle||!pe.menuInstance)return;var Ke=be.findDOMNode(pe.menuInstance);if(Ke.offsetWidth>=pe.subMenuTitle.offsetWidth)return;Ke.style.minWidth="".concat(pe.subMenuTitle.offsetWidth,"px")},pe.saveSubMenuTitle=function(Ke){pe.subMenuTitle=Ke},pe.getBaseProps=function(){var Ke=Object(X.a)(pe),gt=Ke.props;return{mode:gt.mode==="horizontal"?"vertical":gt.mode,visible:pe.props.isOpen,level:gt.level+1,inlineIndent:gt.inlineIndent,focusable:!1,onClick:pe.onSubMenuClick,onSelect:pe.onSelect,onDeselect:pe.onDeselect,onDestroy:pe.onDestroy,selectedKeys:gt.selectedKeys,eventKey:"".concat(gt.eventKey,"-menu-"),openKeys:gt.openKeys,motion:gt.motion,onOpenChange:pe.onOpenChange,subMenuOpenDelay:gt.subMenuOpenDelay,parentMenu:Object(X.a)(pe),subMenuCloseDelay:gt.subMenuCloseDelay,forceSubMenuRender:gt.forceSubMenuRender,triggerSubMenuAction:gt.triggerSubMenuAction,builtinPlacements:gt.builtinPlacements,defaultActiveFirst:gt.store.getState().defaultActiveFirst[te(gt.eventKey)],multiple:gt.multiple,prefixCls:gt.rootPrefixCls,id:pe.internalMenuId,manualRef:pe.saveMenuInstance,itemIcon:gt.itemIcon,expandIcon:gt.expandIcon,direction:gt.direction}},pe.getMotion=function(Ke,gt){var bt=Object(X.a)(pe),Tt=bt.haveRendered,Wt=pe.props,fe=Wt.motion,se=Wt.rootPrefixCls,W=Object(Q.a)(Object(Q.a)({},fe),{},{leavedClassName:"".concat(se,"-hidden"),removeOnLeave:!1,motionAppear:Tt||!gt||Ke!=="inline"});return W};var Re=He.store,lt=He.eventKey,Ye=Re.getState(),Pt=Ye.defaultActiveFirst;pe.isRootMenu=!1;var Nt=!1;return Pt&&(Nt=Pt[lt]),Me(Re,lt,Nt),pe}return Object(M.a)(st,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var pe=this,Re=this.props,lt=Re.mode,Ye=Re.parentMenu,Pt=Re.manualRef;if(Pt&&Pt(this),lt!=="horizontal"||!Ye.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return pe.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var pe=this.props,Re=pe.onDestroy,lt=pe.eventKey;Re&&Re(lt),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(pe){var Re=this,lt=this.getBaseProps(),Ye=this.getMotion(lt.mode,lt.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||lt.visible||lt.forceSubMenuRender,!this.haveOpened)return H.createElement("div",null);var Pt=lt.direction;return H.createElement(yt.default,Object.assign({visible:lt.visible},Ye),function(Nt){var Ke=Nt.className,gt=Nt.style,bt=r()("".concat(lt.prefixCls,"-sub"),Ke,Object(p.a)({},"".concat(lt.prefixCls,"-rtl"),Pt==="rtl"));return H.createElement(we,Object.assign({},lt,{id:Re.internalMenuId,className:bt,style:gt}),pe)})}},{key:"render",value:function(){var pe,Re=Object(Q.a)({},this.props),lt=Re.isOpen,Ye=this.getPrefixCls(),Pt=Re.mode==="inline",Nt=r()(Ye,"".concat(Ye,"-").concat(Re.mode),(pe={},Object(p.a)(pe,Re.className,!!Re.className),Object(p.a)(pe,this.getOpenClassName(),lt),Object(p.a)(pe,this.getActiveClassName(),Re.active||lt&&!Pt),Object(p.a)(pe,this.getDisabledClassName(),Re.disabled),Object(p.a)(pe,this.getSelectedClassName(),this.isChildrenSelected()),pe));this.internalMenuId||(Re.eventKey?this.internalMenuId="".concat(Re.eventKey,"$Menu"):(wt+=1,this.internalMenuId="$__$".concat(wt,"$Menu")));var Ke={},gt={},bt={};Re.disabled||(Ke={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},gt={onClick:this.onTitleClick},bt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Tt={},Wt=Re.direction;Pt&&(Wt==="rtl"?Tt.paddingRight=Re.inlineIndent*Re.level:Tt.paddingLeft=Re.inlineIndent*Re.level);var fe={};this.props.isOpen&&(fe={"aria-owns":this.internalMenuId});var se=null;Re.mode!=="horizontal"&&(se=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(se=H.createElement(this.props.expandIcon,Object(Q.a)({},this.props))));var W=H.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:Tt,className:"".concat(Ye,"-title"),role:"button"},bt,gt,{"aria-expanded":lt},fe,{"aria-haspopup":"true",title:typeof Re.title=="string"?Re.title:void 0}),Re.title,se||H.createElement("i",{className:"".concat(Ye,"-arrow")})),$=this.renderChildren(Re.children),Z=Re.parentMenu.isRootMenu?Re.parentMenu.props.getPopupContainer:function(pn){return pn.parentNode},ne=_e[Re.mode],he=Re.popupOffset?{offset:Re.popupOffset}:{},Pe=Re.mode==="inline"?"":Re.popupClassName;Pe+=Wt==="rtl"?" ".concat(Ye,"-rtl"):"";var ze=Re.disabled,Rt=Re.triggerSubMenuAction,Mt=Re.subMenuOpenDelay,Ze=Re.forceSubMenuRender,kt=Re.subMenuCloseDelay,an=Re.builtinPlacements;Ae.forEach(function(pn){return delete Re[pn]}),delete Re.onClick;var At=Wt==="rtl"?Object.assign({},nt,an):Object.assign({},xt,an);return delete Re.direction,H.createElement("li",Object.assign({},Re,Ke,{className:Nt,role:"menuitem"}),Pt&&W,Pt&&$,!Pt&&H.createElement(mt.a,{prefixCls:Ye,popupClassName:r()("".concat(Ye,"-popup"),Pe),getPopupContainer:Z,builtinPlacements:At,popupPlacement:ne,popupVisible:lt,popupAlign:he,popup:$,action:ze?[]:[Rt],mouseEnterDelay:Mt,mouseLeaveDelay:kt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Ze},W))}}]),st}(H.Component);ve.defaultProps={onMouseEnter:O,onMouseLeave:O,onTitleMouseEnter:O,onTitleMouseLeave:O,onTitleClick:O,manualRef:O,mode:"vertical",title:""};var Te=Object(N.b)(function(Ct,et){var st=Ct.openKeys,He=Ct.activeKey,pe=Ct.selectedKeys,Re=et.eventKey,lt=et.subMenuKey;return{isOpen:st.indexOf(Re)>-1,active:He[lt]===Re,selectedKeys:pe}})(ve);Te.isSubMenu=!0;var We=Te,Je="menuitem-overflowed",at=.5,dt=function(Ct){Object(F.a)(st,Ct);var et=Object(I.a)(st);function st(){var He;return Object(z.a)(this,st),He=et.apply(this,arguments),He.resizeObserver=null,He.mutationObserver=null,He.originalTotalWidth=0,He.overflowedItems=[],He.menuItemSizes=[],He.cancelFrameId=null,He.state={lastVisibleIndex:void 0},He.getMenuItemNodes=function(){var pe=He.props.prefixCls,Re=be.findDOMNode(Object(X.a)(He));return Re?[].slice.call(Re.children).filter(function(lt){return lt.className.split(" ").indexOf("".concat(pe,"-overflowed-submenu"))<0}):[]},He.getOverflowedSubMenuItem=function(pe,Re,lt){var Ye=He.props,Pt=Ye.overflowedIndicator,Nt=Ye.level,Ke=Ye.mode,gt=Ye.prefixCls,bt=Ye.theme;if(Nt!==1||Ke!=="horizontal")return null;var Tt=He.props.children[0],Wt=Tt.props,fe=Wt.children,se=Wt.title,W=Wt.style,$=Object(xe.a)(Wt,["children","title","style"]),Z=Object(Q.a)({},W),ne="".concat(pe,"-overflowed-indicator"),he="".concat(pe,"-overflowed-indicator");Re.length===0&<!==!0?Z=Object(Q.a)(Object(Q.a)({},Z),{},{display:"none"}):lt&&(Z=Object(Q.a)(Object(Q.a)({},Z),{},{visibility:"hidden",position:"absolute"}),ne="".concat(ne,"-placeholder"),he="".concat(he,"-placeholder"));var Pe=bt?"".concat(gt,"-").concat(bt):"",ze={};return Ae.forEach(function(Rt){$[Rt]!==void 0&&(ze[Rt]=$[Rt])}),H.createElement(We,Object.assign({title:Pt,className:"".concat(gt,"-overflowed-submenu"),popupClassName:Pe},ze,{key:ne,eventKey:he,disabled:!1,style:Z}),Re)},He.setChildrenWidthAndResize=function(){if(He.props.mode!=="horizontal")return;var pe=be.findDOMNode(Object(X.a)(He));if(!pe)return;var Re=pe.children;if(!Re||Re.length===0)return;var lt=pe.children[Re.length-1];Ce(lt,"display","inline-block");var Ye=He.getMenuItemNodes(),Pt=Ye.filter(function(Nt){return Nt.className.split(" ").indexOf(Je)>=0});Pt.forEach(function(Nt){Ce(Nt,"display","inline-block")}),He.menuItemSizes=Ye.map(function(Nt){return Oe(Nt,!0)}),Pt.forEach(function(Nt){Ce(Nt,"display","none")}),He.overflowedIndicatorWidth=Oe(pe.children[pe.children.length-1],!0),He.originalTotalWidth=He.menuItemSizes.reduce(function(Nt,Ke){return Nt+Ke},0),He.handleResize(),Ce(lt,"display","none")},He.handleResize=function(){if(He.props.mode!=="horizontal")return;var pe=be.findDOMNode(Object(X.a)(He));if(!pe)return;var Re=Oe(pe);He.overflowedItems=[];var lt=0,Ye;He.originalTotalWidth>Re+at&&(Ye=-1,He.menuItemSizes.forEach(function(Pt){lt+=Pt,lt+He.overflowedIndicatorWidth<=Re&&(Ye+=1)})),He.setState({lastVisibleIndex:Ye})},He}return Object(M.a)(st,[{key:"componentDidMount",value:function(){var pe=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Re=be.findDOMNode(this);if(!Re)return;this.resizeObserver=new Ve.default(function(lt){lt.forEach(function(){var Ye=pe.cancelFrameId;cancelAnimationFrame(Ye),pe.cancelFrameId=requestAnimationFrame(pe.setChildrenWidthAndResize)})}),[].slice.call(Re.children).concat(Re).forEach(function(lt){pe.resizeObserver.observe(lt)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){pe.resizeObserver.disconnect(),[].slice.call(Re.children).concat(Re).forEach(function(lt){pe.resizeObserver.observe(lt)}),pe.setChildrenWidthAndResize()}),this.mutationObserver.observe(Re,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(pe){var Re=this,lt=this.state.lastVisibleIndex;return(pe||[]).reduce(function(Ye,Pt,Nt){var Ke=Pt;if(Re.props.mode==="horizontal"){var gt=Re.getOverflowedSubMenuItem(Pt.props.eventKey,[]);lt!==void 0&&Re.props.className.indexOf("".concat(Re.props.prefixCls,"-root"))!==-1&&(Nt>lt&&(Ke=H.cloneElement(Pt,{style:{display:"none"},eventKey:"".concat(Pt.props.eventKey,"-hidden"),className:"".concat(Je)})),Nt===lt+1&&(Re.overflowedItems=pe.slice(lt+1).map(function(Tt){return H.cloneElement(Tt,{key:Tt.props.eventKey,mode:"vertical-left"})}),gt=Re.getOverflowedSubMenuItem(Pt.props.eventKey,Re.overflowedItems)));var bt=[].concat(Object(Ue.a)(Ye),[gt,Ke]);return Nt===pe.length-1&&bt.push(Re.getOverflowedSubMenuItem(Pt.props.eventKey,[],!0)),bt}return[].concat(Object(Ue.a)(Ye),[Ke])},[])}},{key:"render",value:function(){var pe=this.props,Re=pe.visible,lt=pe.prefixCls,Ye=pe.overflowedIndicator,Pt=pe.mode,Nt=pe.level,Ke=pe.tag,gt=pe.children,bt=pe.theme,Tt=Object(xe.a)(pe,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Wt=Ke;return H.createElement(Wt,Object.assign({},Tt),this.renderChildren(gt))}}]),st}(H.Component);dt.defaultProps={tag:"div",className:""};var Lt=dt;function It(Ct){return Ct.length?Ct.every(function(et){return!!et.props.disabled}):!0}function Ne(Ct,et,st){var He=Ct.getState();Ct.setState({activeKey:Object(Q.a)(Object(Q.a)({},He.activeKey),{},Object(p.a)({},et,st))})}function ke(Ct){return Ct.eventKey||"0-menu-"}function it(Ct,et){var st=et,He=Ct.children,pe=Ct.eventKey;if(st){var Re;if(re(He,function(lt,Ye){lt&<.props&&!lt.props.disabled&&st===V(lt,pe,Ye)&&(Re=!0)}),Re)return st}return st=null,Ct.defaultActiveFirst&&re(He,function(lt,Ye){!st&<&&!lt.props.disabled&&(st=V(lt,pe,Ye))}),st}function ot(Ct){if(Ct){var et=this.instanceArray.indexOf(Ct);et!==-1?this.instanceArray[et]=Ct:this.instanceArray.push(Ct)}}var Ge=function(Ct){Object(F.a)(st,Ct);var et=Object(I.a)(st);function st(He){var pe;return Object(z.a)(this,st),pe=et.call(this,He),pe.onKeyDown=function(Re,lt){var Ye=Re.keyCode,Pt;if(pe.getFlatInstanceArray().forEach(function(Ke){Ke&&Ke.props.active&&Ke.onKeyDown&&(Pt=Ke.onKeyDown(Re))}),Pt)return 1;var Nt=null;return(Ye===m.a.UP||Ye===m.a.DOWN)&&(Nt=pe.step(Ye===m.a.UP?-1:1)),Nt?(Re.preventDefault(),Ne(pe.props.store,ke(pe.props),Nt.props.eventKey),typeof lt=="function"&<(Nt),1):void 0},pe.onItemHover=function(Re){var lt=Re.key,Ye=Re.hover;Ne(pe.props.store,ke(pe.props),Ye?lt:null)},pe.onDeselect=function(Re){pe.props.onDeselect(Re)},pe.onSelect=function(Re){pe.props.onSelect(Re)},pe.onClick=function(Re){pe.props.onClick(Re)},pe.onOpenChange=function(Re){pe.props.onOpenChange(Re)},pe.onDestroy=function(Re){pe.props.onDestroy(Re)},pe.getFlatInstanceArray=function(){return pe.instanceArray},pe.step=function(Re){var lt=pe.getFlatInstanceArray(),Ye=pe.props.store.getState().activeKey[ke(pe.props)],Pt=lt.length;if(!Pt)return null;Re<0&&(lt=lt.concat().reverse());var Nt=-1;if(lt.every(function(Tt,Wt){return Tt&&Tt.props.eventKey===Ye?(Nt=Wt,!1):!0}),!pe.props.defaultActiveFirst&&Nt!==-1&&It(lt.slice(Nt,Pt-1)))return;var Ke=(Nt+1)%Pt,gt=Ke;do{var bt=lt[gt];if(!bt||bt.props.disabled)gt=(gt+1)%Pt;else return bt}while(gt!==Ke);return null},pe.renderCommonMenuItem=function(Re,lt,Ye){var Pt=pe.props.store.getState(),Nt=Object(X.a)(pe),Ke=Nt.props,gt=V(Re,Ke.eventKey,lt),bt=Re.props;if(!bt||typeof Re.type=="string")return Re;var Tt=gt===Pt.activeKey,Wt=Object(Q.a)(Object(Q.a)({mode:bt.mode||Ke.mode,level:Ke.level,inlineIndent:Ke.inlineIndent,renderMenuItem:pe.renderMenuItem,rootPrefixCls:Ke.prefixCls,index:lt,parentMenu:Ke.parentMenu,manualRef:bt.disabled?void 0:Object(d.a)(Re.ref,ot.bind(Object(X.a)(pe))),eventKey:gt,active:!bt.disabled&&Tt,multiple:Ke.multiple,onClick:function(se){(bt.onClick||O)(se),pe.onClick(se)},onItemHover:pe.onItemHover,motion:Ke.motion,subMenuOpenDelay:Ke.subMenuOpenDelay,subMenuCloseDelay:Ke.subMenuCloseDelay,forceSubMenuRender:Ke.forceSubMenuRender,onOpenChange:pe.onOpenChange,onDeselect:pe.onDeselect,onSelect:pe.onSelect,builtinPlacements:Ke.builtinPlacements,itemIcon:bt.itemIcon||pe.props.itemIcon,expandIcon:bt.expandIcon||pe.props.expandIcon},Ye),{},{direction:Ke.direction});return(Ke.mode==="inline"||je())&&(Wt.triggerSubMenuAction="click"),H.cloneElement(Re,Wt)},pe.renderMenuItem=function(Re,lt,Ye){if(!Re)return null;var Pt=pe.props.store.getState(),Nt={openKeys:Pt.openKeys,selectedKeys:Pt.selectedKeys,triggerSubMenuAction:pe.props.triggerSubMenuAction,subMenuKey:Ye};return pe.renderCommonMenuItem(Re,lt,Nt)},He.store.setState({activeKey:Object(Q.a)(Object(Q.a)({},He.store.getState().activeKey),{},Object(p.a)({},He.eventKey,it(He,He.activeKey)))}),pe.instanceArray=[],pe}return Object(M.a)(st,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(pe){return this.props.visible||pe.visible||this.props.className!==pe.className||!o()(this.props.style,pe.style)}},{key:"componentDidUpdate",value:function(pe){var Re=this.props,lt="activeKey"in Re?Re.activeKey:Re.store.getState().activeKey[ke(Re)],Ye=it(Re,lt);if(Ye!==lt)Ne(Re.store,ke(Re),Ye);else if("activeKey"in pe){var Pt=it(pe,pe.activeKey);Ye!==Pt&&Ne(Re.store,ke(Re),Ye)}}},{key:"render",value:function(){var pe=this,Re=Object(P.a)({},this.props);this.instanceArray=[];var lt=r()(Re.prefixCls,Re.className,"".concat(Re.prefixCls,"-").concat(Re.mode)),Ye={className:lt,role:Re.role||"menu"};Re.id&&(Ye.id=Re.id),Re.focusable&&(Ye.tabIndex=0,Ye.onKeyDown=this.onKeyDown);var Pt=Re.prefixCls,Nt=Re.eventKey,Ke=Re.visible,gt=Re.level,bt=Re.mode,Tt=Re.overflowedIndicator,Wt=Re.theme;return Ae.forEach(function(fe){return delete Re[fe]}),delete Re.onClick,H.createElement(Lt,Object.assign({},Re,{prefixCls:Pt,mode:bt,tag:"ul",level:gt,theme:Wt,visible:Ke,overflowedIndicator:Tt},Ye),H.Children.map(Re.children,function(fe,se){return pe.renderMenuItem(fe,se,Nt||"0-menu-")}))}}]),st}(H.Component);Ge.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:O};var $e=Object(N.b)()(Ge),we=$e,Se=D("Kwbf");function Ee(Ct,et,st){var He=Ct.prefixCls,pe=Ct.motion,Re=Ct.defaultMotions,lt=Re===void 0?{}:Re,Ye=Ct.openAnimation,Pt=Ct.openTransitionName,Nt=et.switchingModeFromInline;if(pe)return pe;if(Object(a.a)(Ye)==="object"&&Ye)Object(Se.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Ye=="string")return{motionName:"".concat(He,"-open-").concat(Ye)};if(Pt)return{motionName:Pt};var Ke=lt[st];return Ke||(Nt?null:lt.other)}var ue=function(Ct){Object(F.a)(st,Ct);var et=Object(I.a)(st);function st(He){var pe;Object(z.a)(this,st),pe=et.call(this,He),pe.inlineOpenKeys=[],pe.onSelect=function(Ye){var Pt=Object(X.a)(pe),Nt=Pt.props;if(Nt.selectable){var Ke=pe.store.getState(),gt=Ke.selectedKeys,bt=Ye.key;Nt.multiple?gt=gt.concat([bt]):gt=[bt],"selectedKeys"in Nt||pe.store.setState({selectedKeys:gt}),Nt.onSelect(Object(Q.a)(Object(Q.a)({},Ye),{},{selectedKeys:gt}))}},pe.onClick=function(Ye){var Pt=pe.getRealMenuMode(),Nt=Object(X.a)(pe),Ke=Nt.store,gt=Nt.props.onOpenChange;Pt!=="inline"&&!("openKeys"in pe.props)&&(Ke.setState({openKeys:[]}),gt([])),pe.props.onClick(Ye)},pe.onKeyDown=function(Ye,Pt){pe.innerMenu.getWrappedInstance().onKeyDown(Ye,Pt)},pe.onOpenChange=function(Ye){var Pt=Object(X.a)(pe),Nt=Pt.props,Ke=pe.store.getState().openKeys.concat(),gt=!1,bt=function(Wt){var fe=!1;if(Wt.open)fe=Ke.indexOf(Wt.key)===-1,fe&&Ke.push(Wt.key);else{var se=Ke.indexOf(Wt.key);fe=se!==-1,fe&&Ke.splice(se,1)}gt=gt||fe};Array.isArray(Ye)?Ye.forEach(bt):bt(Ye),gt&&("openKeys"in pe.props||pe.store.setState({openKeys:Ke}),Nt.onOpenChange(Ke))},pe.onDeselect=function(Ye){var Pt=Object(X.a)(pe),Nt=Pt.props;if(Nt.selectable){var Ke=pe.store.getState().selectedKeys.concat(),gt=Ye.key,bt=Ke.indexOf(gt);bt!==-1&&Ke.splice(bt,1),"selectedKeys"in Nt||pe.store.setState({selectedKeys:Ke}),Nt.onDeselect(Object(Q.a)(Object(Q.a)({},Ye),{},{selectedKeys:Ke}))}},pe.onMouseEnter=function(Ye){pe.restoreModeVerticalFromInline();var Pt=pe.props.onMouseEnter;Pt&&Pt(Ye)},pe.onTransitionEnd=function(Ye){var Pt=Ye.propertyName==="width"&&Ye.target===Ye.currentTarget,Nt=Ye.target.className,Ke=Object.prototype.toString.call(Nt)==="[object SVGAnimatedString]"?Nt.animVal:Nt,gt=Ye.propertyName==="font-size"&&Ke.indexOf("anticon")>=0;(Pt||gt)&&pe.restoreModeVerticalFromInline()},pe.setInnerMenu=function(Ye){pe.innerMenu=Ye},pe.isRootMenu=!0;var Re=He.defaultSelectedKeys,lt=He.defaultOpenKeys;return"selectedKeys"in He&&(Re=He.selectedKeys||[]),"openKeys"in He&&(lt=He.openKeys||[]),pe.store=Object(N.c)({selectedKeys:Re,openKeys:lt,activeKey:{"0-menu-":it(He,He.activeKey)}}),pe.state={switchingModeFromInline:!1},pe}return Object(M.a)(st,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(pe){this.updateOpentKeysWhenSwitchMode(pe),this.updateMiniStore();var Re=this.props,lt=Re.siderCollapsed,Ye=Re.inlineCollapsed,Pt=Re.onOpenChange;(!pe.inlineCollapsed&&Ye||!pe.siderCollapsed&<)&&Pt([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(pe){var Re=this.props,lt=this.store,Ye=this.inlineOpenKeys,Pt=lt.getState(),Nt={};pe.mode==="inline"&&Re.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in Re||((Re.inlineCollapsed&&!pe.inlineCollapsed||Re.siderCollapsed&&!pe.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=Pt.openKeys.concat(),Nt.openKeys=[]),(!Re.inlineCollapsed&&pe.inlineCollapsed||!Re.siderCollapsed&&pe.siderCollapsed)&&(Nt.openKeys=Ye,this.inlineOpenKeys=[])),Object.keys(Nt).length&<.setState(Nt)}},{key:"updateMenuDisplay",value:function(){var pe=this.props.collapsedWidth,Re=this.store,lt=this.prevOpenKeys,Ye=this.getInlineCollapsed()&&(pe===0||pe==="0"||pe==="0px");Ye?(this.prevOpenKeys=Re.getState().openKeys.concat(),this.store.setState({openKeys:[]})):lt&&(this.store.setState({openKeys:lt}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var pe=this.props.mode,Re=this.state.switchingModeFromInline,lt=this.getInlineCollapsed();return Re&<?"inline":lt?"vertical":pe}},{key:"getInlineCollapsed",value:function(){var pe=this.props,Re=pe.inlineCollapsed,lt=pe.siderCollapsed;return lt!==void 0?lt:Re}},{key:"restoreModeVerticalFromInline",value:function(){var pe=this.state.switchingModeFromInline;pe&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var pe=Object(Q.a)({},Object(n.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Re=this.getRealMenuMode();return pe.className+=" ".concat(pe.prefixCls,"-root"),pe.direction==="rtl"&&(pe.className+=" ".concat(pe.prefixCls,"-rtl")),pe=Object(Q.a)(Object(Q.a)({},pe),{},{mode:Re,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Ee(this.props,this.state,Re)}),delete pe.openAnimation,delete pe.openTransitionName,H.createElement(N.a,{store:this.store},H.createElement(we,Object.assign({},pe,{ref:this.setInnerMenu}),this.props.children))}}]),st}(H.Component);ue.defaultProps={selectable:!0,onClick:O,onSelect:O,onOpenChange:O,onDeselect:O,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:H.createElement("span",null,"\xB7\xB7\xB7")};var de=ue,ye=function(Ct){Object(F.a)(st,Ct);var et=Object(I.a)(st);function st(){var He;return Object(z.a)(this,st),He=et.apply(this,arguments),He.onKeyDown=function(pe){var Re=pe.keyCode;return Re===m.a.ENTER?(He.onClick(pe),!0):void 0},He.onMouseLeave=function(pe){var Re=He.props,lt=Re.eventKey,Ye=Re.onItemHover,Pt=Re.onMouseLeave;Ye({key:lt,hover:!1}),Pt({key:lt,domEvent:pe})},He.onMouseEnter=function(pe){var Re=He.props,lt=Re.eventKey,Ye=Re.onItemHover,Pt=Re.onMouseEnter;Ye({key:lt,hover:!0}),Pt({key:lt,domEvent:pe})},He.onClick=function(pe){var Re=He.props,lt=Re.eventKey,Ye=Re.multiple,Pt=Re.onClick,Nt=Re.onSelect,Ke=Re.onDeselect,gt=Re.isSelected,bt={key:lt,keyPath:[lt],item:Object(X.a)(He),domEvent:pe};Pt(bt),Ye?gt?Ke(bt):Nt(bt):gt||Nt(bt)},He.saveNode=function(pe){He.node=pe},He}return Object(M.a)(st,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var pe=this.props;pe.onDestroy&&pe.onDestroy(pe.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var pe,Re=Object(Q.a)({},this.props),lt=r()(this.getPrefixCls(),Re.className,(pe={},Object(p.a)(pe,this.getActiveClassName(),!Re.disabled&&Re.active),Object(p.a)(pe,this.getSelectedClassName(),Re.isSelected),Object(p.a)(pe,this.getDisabledClassName(),Re.disabled),pe)),Ye=Object(Q.a)(Object(Q.a)({},Re.attribute),{},{title:typeof Re.title=="string"?Re.title:void 0,className:lt,role:Re.role||"menuitem","aria-disabled":Re.disabled});Re.role==="option"?Ye=Object(Q.a)(Object(Q.a)({},Ye),{},{role:"option","aria-selected":Re.isSelected}):(Re.role===null||Re.role==="none")&&(Ye.role="none");var Pt={onClick:Re.disabled?null:this.onClick,onMouseLeave:Re.disabled?null:this.onMouseLeave,onMouseEnter:Re.disabled?null:this.onMouseEnter},Nt=Object(Q.a)({},Re.style);Re.mode==="inline"&&(Re.direction==="rtl"?Nt.paddingRight=Re.inlineIndent*Re.level:Nt.paddingLeft=Re.inlineIndent*Re.level),Ae.forEach(function(gt){return delete Re[gt]}),delete Re.direction;var Ke=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ke=H.createElement(this.props.itemIcon,this.props)),H.createElement("li",Object.assign({},Object(n.default)(Re,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Ye,Pt,{style:Nt,ref:this.saveNode}),Re.children,Ke)}}]),st}(H.Component);ye.isMenuItem=!0,ye.defaultProps={onSelect:O,onMouseEnter:O,onMouseLeave:O,manualRef:O};var me=Object(N.b)(function(Ct,et){var st=Ct.activeKey,He=Ct.selectedKeys,pe=et.eventKey,Re=et.subMenuKey;return{active:st[Re]===pe,isSelected:He.indexOf(pe)!==-1}})(ye),Le=me,Xe=function(Ct){Object(F.a)(st,Ct);var et=Object(I.a)(st);function st(){var He;return Object(z.a)(this,st),He=et.apply(this,arguments),He.renderInnerMenuItem=function(pe){var Re=He.props,lt=Re.renderMenuItem,Ye=Re.index;return lt(pe,Ye,He.props.subMenuKey)},He}return Object(M.a)(st,[{key:"render",value:function(){var pe=Object(P.a)({},this.props),Re=pe.className,lt=Re===void 0?"":Re,Ye=pe.rootPrefixCls,Pt="".concat(Ye,"-item-group-title"),Nt="".concat(Ye,"-item-group-list"),Ke=pe.title,gt=pe.children;return Ae.forEach(function(bt){return delete pe[bt]}),delete pe.onClick,delete pe.direction,H.createElement("li",Object.assign({},pe,{className:"".concat(lt," ").concat(Ye,"-item-group")}),H.createElement("div",{className:Pt,title:typeof Ke=="string"?Ke:void 0},Ke),H.createElement("ul",{className:Nt},H.Children.map(gt,this.renderInnerMenuItem)))}}]),st}(H.Component);Xe.isMenuItemGroup=!0,Xe.defaultProps={disabled:!0};var ut=Xe,Dt=function(et){var st=et.className,He=et.rootPrefixCls,pe=et.style;return H.createElement("li",{className:"".concat(st," ").concat(He,"-item-divider"),style:pe})};Dt.defaultProps={disabled:!0,className:"",style:{}};var jt=Dt,Ut=le.e=de},"24hK":function(Be,le,D){"use strict";D.d(le,"a",function(){return z});class Q{constructor(M){this.element=M,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 M=this._first;for(;M!==Q.Undefined;){const X=M.next;M.prev=Q.Undefined,M.next=Q.Undefined,M=X}this._first=Q.Undefined,this._last=Q.Undefined,this._size=0}unshift(M){return this._insert(M,!1)}push(M){return this._insert(M,!0)}_insert(M,X){const F=new Q(M);if(this._first===Q.Undefined)this._first=F,this._last=F;else if(X){const H=this._last;this._last=F,F.prev=H,H.next=F}else{const H=this._first;this._first=F,F.next=H,H.prev=F}this._size+=1;let I=!1;return()=>{I||(I=!0,this._remove(F))}}shift(){if(this._first===Q.Undefined)return;{const M=this._first.element;return this._remove(this._first),M}}pop(){if(this._last===Q.Undefined)return;{const M=this._last.element;return this._remove(this._last),M}}_remove(M){if(M.prev!==Q.Undefined&&M.next!==Q.Undefined){const X=M.prev;X.next=M.next,M.next.prev=X}else M.prev===Q.Undefined&&M.next===Q.Undefined?(this._first=Q.Undefined,this._last=Q.Undefined):M.next===Q.Undefined?(this._last=this._last.prev,this._last.next=Q.Undefined):M.prev===Q.Undefined&&(this._first=this._first.next,this._first.prev=Q.Undefined);this._size-=1}*[Symbol.iterator](){let M=this._first;for(;M!==Q.Undefined;)yield M.element,M=M.next}}},"3/fG":function(Be,le,D){"use strict";D.d(le,"a",function(){return z});function Q(M,X){let F;return X.length===0?F=M:F=M.replace(/\{(\d+)\}/g,function(I,H){const N=H[0];return typeof X[N]!="undefined"?X[N]:I}),F}function z(M,X,...F){return Q(X,F)}},"3tLw":function(Be,le,D){Be.exports=D.p+"static/a.5b9b2825.svg"},"4xil":function(Be,le,D){Be.exports={watermark:"watermark___2DVjg",videovideo:"videovideo___3jScv",animate__loop:"animate__loop___36IZ1",upDown:"upDown___3FGkz",container:"container___GV_Ds","video-container":"video-container___35tqx","video-controls":"video-controls___u99fM",hide:"hide___2GDit","video-progress":"video-progress___2LKQJ",seek:"seek___3b-US","seek-tooltip":"seek-tooltip___bZ9sZ","bottom-controls":"bottom-controls___74sQw","left-controls":"left-controls___2kBb3","right-controls":"right-controls___3oxDi","volume-controls":"volume-controls___QLaWH","fullscreen-button":"fullscreen-button___2nHzc","fullscreen-button1":"fullscreen-button1___1murk","pip-button":"pip-button___18qQG","playback-animation":"playback-animation___gCL6X",volume:"volume___10eUe",hidden:"hidden___2JBJW"}},"55Ip":function(Be,le,D){"use strict";D.d(le,"a",function(){return i});var Q=D("Ty5D"),z=D("dI71"),M=D("q1tI"),X=D.n(M),F=D("YS25"),I=D("17x9"),H=D.n(I),N=D("wx14"),n=D("zLVn"),P=D("9R94"),p=function(b){Object(z.a)(g,b);function g(){for(var C,E=arguments.length,_=new Array(E),U=0;U<E;U++)_[U]=arguments[U];return C=b.call.apply(b,[this].concat(_))||this,C.history=Object(F.a)(C.props),C}var f=g.prototype;return f.render=function(){return X.a.createElement(Q.c,{history:this.history,children:this.props.children})},g}(X.a.Component),m=function(b){Object(z.a)(g,b);function g(){for(var C,E=arguments.length,_=new Array(E),U=0;U<E;U++)_[U]=arguments[U];return C=b.call.apply(b,[this].concat(_))||this,C.history=Object(F.b)(C.props),C}var f=g.prototype;return f.render=function(){return X.a.createElement(Q.c,{history:this.history,children:this.props.children})},g}(X.a.Component),d=function(g,f){return typeof g=="function"?g(f):g},u=function(g,f){return typeof g=="string"?Object(F.c)(g,null,null,f):g},o=function(g){return g},h=X.a.forwardRef;typeof h=="undefined"&&(h=o);function r(b){return!!(b.metaKey||b.altKey||b.ctrlKey||b.shiftKey)}var a=h(function(b,g){var f=b.innerRef,C=b.navigate,E=b.onClick,_=Object(n.a)(b,["innerRef","navigate","onClick"]),U=_.target,j=Object(N.a)({},_,{onClick:function(G){try{E&&E(G)}catch(B){throw G.preventDefault(),B}!G.defaultPrevented&&G.button===0&&(!U||U==="_self")&&!r(G)&&(G.preventDefault(),C())}});return o!==h?j.ref=g||f:j.ref=f,X.a.createElement("a",j)}),i=h(function(b,g){var f=b.component,C=f===void 0?a:f,E=b.replace,_=b.to,U=b.innerRef,j=Object(n.a)(b,["component","replace","to","innerRef"]);return X.a.createElement(Q.e.Consumer,null,function(L){L||Object(P.a)(!1);var G=L.history,B=u(d(_,L.location),L.location),O=B?G.createHref(B):"",V=Object(N.a)({},j,{href:O,navigate:function(){var re=d(_,L.location),ge=E?G.replace:G.push;ge(re)}});return o!==h?V.ref=g||U:V.innerRef=U,X.a.createElement(C,V)})});if(!1)var s,S;var x=function(g){return g},T=X.a.forwardRef;typeof T=="undefined"&&(T=x);function A(){for(var b=arguments.length,g=new Array(b),f=0;f<b;f++)g[f]=arguments[f];return g.filter(function(C){return C}).join(" ")}var w=T(function(b,g){var f=b["aria-current"],C=f===void 0?"page":f,E=b.activeClassName,_=E===void 0?"active":E,U=b.activeStyle,j=b.className,L=b.exact,G=b.isActive,B=b.location,O=b.sensitive,V=b.strict,te=b.style,re=b.to,ge=b.innerRef,Ae=Object(n.a)(b,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return X.a.createElement(Q.e.Consumer,null,function(Oe){Oe||Object(P.a)(!1);var Ce=B||Oe.location,je=u(d(re,Ce),Ce),Ue=je.pathname,xe=Ue&&Ue.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),be=xe?Object(Q.f)(Ce.pathname,{path:xe,exact:L,sensitive:O,strict:V}):null,Ve=!!(G?G(be,Ce):be),mt=Ve?A(j,_):j,yt=Ve?Object(N.a)({},te,{},U):te,_t=Object(N.a)({"aria-current":Ve&&C||null,className:mt,style:yt,to:je},Ae);return x!==T?_t.ref=g||ge:_t.innerRef=ge,X.a.createElement(i,_t)})});if(!1)var v},"5VLF":function(Be,le,D){"use strict";var Q,z;function M(X,F,I){var H=function(N,n){return X.js_beautify(N,n)};return H.js=X.js_beautify,H.css=F.css_beautify,H.html=I.html_beautify,H.js_beautify=X.js_beautify,H.css_beautify=F.css_beautify,H.html_beautify=I.html_beautify,H}!(Q=[D("6UM0"),D("TXwP"),D("psGv")],z=function(X,F,I){return M(X,F,I)}.apply(le,Q),z!==void 0&&(Be.exports=z))},"5Y4S":function(Be,le,D){"use strict";D.d(le,"a",function(){return M});var Q=D("MNsG");const z=Q.b.performance&&typeof Q.b.performance.now=="function";class M{constructor(X){this._highResolution=z&&X,this._startTime=this._now(),this._stopTime=-1}static create(X=!0){return new M(X)}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(Be,le,D){var Q=D("MFOe"),z=Q.slice,M=Q.pluck,X=Q.each,F=Q.bind,I=Q.create,H=Q.isList,N=Q.isFunction,n=Q.isObject;Be.exports={createStore:m};var P={version:"2.0.12",enabled:!1,get:function(d,u){var o=this.storage.read(this._namespacePrefix+d);return this._deserialize(o,u)},set:function(d,u){return u===void 0?this.remove(d):(this.storage.write(this._namespacePrefix+d,this._serialize(u)),u)},remove:function(d){this.storage.remove(this._namespacePrefix+d)},each:function(d){var u=this;this.storage.each(function(o,h){d.call(u,u._deserialize(o),(h||"").replace(u._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(d){return this._namespacePrefix=="__storejs_"+d+"_"},createStore:function(){return m.apply(this,arguments)},addPlugin:function(d){this._addPlugin(d)},namespace:function(d){return m(this.storage,this.plugins,d)}};function p(){var d=typeof console=="undefined"?null:console;if(!d)return;var u=d.warn?d.warn:d.log;u.apply(d,arguments)}function m(d,u,o){o||(o=""),d&&!H(d)&&(d=[d]),u&&!H(u)&&(u=[u]);var h=o?"__storejs_"+o+"_":"",r=o?new RegExp("^"+h):null,a=/^[a-zA-Z0-9_\-]*$/;if(!a.test(o))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var i={_namespacePrefix:h,_namespaceRegexp:r,_testStorage:function(S){try{var x="__storejs__test__";S.write(x,x);var T=S.read(x)===x;return S.remove(x),T}catch(A){return!1}},_assignPluginFnProp:function(S,x){var T=this[x];this[x]=function(){var w=z(arguments,0),v=this;function b(){return T?(X(arguments,function(f,C){w[C]=f}),T.apply(v,w)):void 0}var g=[b].concat(w);return S.apply(v,g)}},_serialize:function(S){return JSON.stringify(S)},_deserialize:function(S,x){if(!S)return x;var T="";try{T=JSON.parse(S)}catch(A){T=S}return T!==void 0?T:x},_addStorage:function(S){if(this.enabled)return;this._testStorage(S)&&(this.storage=S,this.enabled=!0)},_addPlugin:function(S){var x=this;if(H(S)){X(S,function(w){x._addPlugin(w)});return}var T=M(this.plugins,function(w){return S===w});if(T)return;if(this.plugins.push(S),!N(S))throw new Error("Plugins must be function values that return objects");var A=S.call(this);if(!n(A))throw new Error("Plugins must return an object of function properties");X(A,function(w,v){if(!N(w))throw new Error("Bad plugin property: "+v+" from plugin "+S.name+". Plugins should only return functions.");x._assignPluginFnProp(w,v)})},addStorage:function(S){p("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(S)}},s=I(i,P,{plugins:[]});return s.raw={},X(s,function(S,x){N(S)&&(s.raw[x]=F(s,S))}),X(d,function(S){s._addStorage(S)}),X(u,function(S){s._addPlugin(S)}),s}},"6+eU":function(Be,le,D){"use strict";D.d(le,"a",function(){return T});var Q=D("wx14"),z=D("rePB"),M=D("VTBJ"),X=D("1OyB"),F=D("vuIU"),I=D("Ji7U"),H=D("LK+K"),N=D("q1tI"),n=D.n(N),P=D("TSYQ"),p=D.n(P),m=function(w){var v,b="".concat(w.rootPrefixCls,"-item"),g=p()(b,"".concat(b,"-").concat(w.page),(v={},Object(z.a)(v,"".concat(b,"-active"),w.active),Object(z.a)(v,w.className,!!w.className),Object(z.a)(v,"".concat(b,"-disabled"),!w.page),v)),f=function(){w.onClick(w.page)},C=function(_){w.onKeyPress(_,w.onClick,w.page)};return n.a.createElement("li",{title:w.showTitle?w.page:null,className:g,onClick:f,onKeyPress:C,tabIndex:"0"},w.itemRender(w.page,"page",n.a.createElement("a",{rel:"nofollow"},w.page)))},d=m,u={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},o=function(A){Object(I.a)(v,A);var w=Object(H.a)(v);function v(){var b;Object(X.a)(this,v);for(var g=arguments.length,f=new Array(g),C=0;C<g;C++)f[C]=arguments[C];return b=w.call.apply(w,[this].concat(f)),b.state={goInputText:""},b.buildOptionText=function(E){return"".concat(E," ").concat(b.props.locale.items_per_page)},b.changeSize=function(E){b.props.changeSize(Number(E))},b.handleChange=function(E){b.setState({goInputText:E.target.value})},b.handleBlur=function(E){var _=b.props,U=_.goButton,j=_.quickGo,L=_.rootPrefixCls,G=b.state.goInputText;if(U||G==="")return;if(E.relatedTarget&&(E.relatedTarget.className.indexOf("".concat(L,"-prev"))>=0||E.relatedTarget.className.indexOf("".concat(L,"-next"))>=0))return;b.setState({goInputText:""}),j(b.getValidValue())},b.go=function(E){var _=b.state.goInputText;if(_==="")return;(E.keyCode===u.ENTER||E.type==="click")&&(b.setState({goInputText:""}),b.props.quickGo(b.getValidValue()))},b}return Object(F.a)(v,[{key:"getValidValue",value:function(){var g=this.state,f=g.goInputText,C=g.current;return!f||isNaN(f)?C:Number(f)}},{key:"getPageSizeOptions",value:function(){var g=this.props,f=g.pageSize,C=g.pageSizeOptions;return C.some(function(E){return E.toString()===f.toString()})?C:C.concat([f.toString()]).sort(function(E,_){var U=isNaN(Number(E))?0:Number(E),j=isNaN(Number(_))?0:Number(_);return U-j})}},{key:"render",value:function(){var g=this,f=this.props,C=f.pageSize,E=f.locale,_=f.rootPrefixCls,U=f.changeSize,j=f.quickGo,L=f.goButton,G=f.selectComponentClass,B=f.buildOptionText,O=f.selectPrefixCls,V=f.disabled,te=this.state.goInputText,re="".concat(_,"-options"),ge=G,Ae=null,Oe=null,Ce=null;if(!U&&!j)return null;var je=this.getPageSizeOptions();if(U&&ge){var Ue=je.map(function(xe,be){return n.a.createElement(ge.Option,{key:be,value:xe.toString()},(B||g.buildOptionText)(xe))});Ae=n.a.createElement(ge,{disabled:V,prefixCls:O,showSearch:!1,className:"".concat(re,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(C||je[0]).toString(),onChange:this.changeSize,getPopupContainer:function(be){return be.parentNode}},Ue)}return j&&(L&&(Ce=typeof L=="boolean"?n.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:V,className:"".concat(re,"-quick-jumper-button")},E.jump_to_confirm):n.a.createElement("span",{onClick:this.go,onKeyUp:this.go},L)),Oe=n.a.createElement("div",{className:"".concat(re,"-quick-jumper")},E.jump_to,n.a.createElement("input",{disabled:V,type:"text",value:te,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),E.page,Ce)),n.a.createElement("li",{className:"".concat(re)},Ae,Oe)}}]),v}(n.a.Component);o.defaultProps={pageSizeOptions:["10","20","50","100"]};var h=o,r=D("N2Kk");function a(){}function i(A){return typeof A=="number"&&isFinite(A)&&Math.floor(A)===A}function s(A,w,v){return v}function S(A,w,v){var b=typeof A=="undefined"?w.pageSize:A;return Math.floor((v.total-1)/b)+1}var x=function(A){Object(I.a)(v,A);var w=Object(H.a)(v);function v(b){var g;Object(X.a)(this,v),g=w.call(this,b),g.getJumpPrevPage=function(){return Math.max(1,g.state.current-(g.props.showLessItems?3:5))},g.getJumpNextPage=function(){return Math.min(S(void 0,g.state,g.props),g.state.current+(g.props.showLessItems?3:5))},g.getItemIcon=function(U,j){var L=g.props.prefixCls,G=U||n.a.createElement("button",{type:"button","aria-label":j,className:"".concat(L,"-item-link")});return typeof U=="function"&&(G=n.a.createElement(U,Object(M.a)({},g.props))),G},g.savePaginationNode=function(U){g.paginationNode=U},g.isValid=function(U){return i(U)&&U!==g.state.current},g.shouldDisplayQuickJumper=function(){var U=g.props,j=U.showQuickJumper,L=U.pageSize,G=U.total;return G<=L?!1:j},g.handleKeyDown=function(U){(U.keyCode===u.ARROW_UP||U.keyCode===u.ARROW_DOWN)&&U.preventDefault()},g.handleKeyUp=function(U){var j=g.getValidValue(U),L=g.state.currentInputValue;j!==L&&g.setState({currentInputValue:j}),U.keyCode===u.ENTER?g.handleChange(j):U.keyCode===u.ARROW_UP?g.handleChange(j-1):U.keyCode===u.ARROW_DOWN&&g.handleChange(j+1)},g.changePageSize=function(U){var j=g.state.current,L=S(U,g.state,g.props);j=j>L?L:j,L===0&&(j=g.state.current),typeof U=="number"&&("pageSize"in g.props||g.setState({pageSize:U}),"current"in g.props||g.setState({current:j,currentInputValue:j})),g.props.onShowSizeChange(j,U),"onChange"in g.props&&g.props.onChange&&g.props.onChange(j,U)},g.handleChange=function(U){var j=g.props.disabled,L=U;if(g.isValid(L)&&!j){var G=S(void 0,g.state,g.props);L>G?L=G:L<1&&(L=1),"current"in g.props||g.setState({current:L,currentInputValue:L});var B=g.state.pageSize;return g.props.onChange(L,B),L}return g.state.current},g.prev=function(){g.hasPrev()&&g.handleChange(g.state.current-1)},g.next=function(){g.hasNext()&&g.handleChange(g.state.current+1)},g.jumpPrev=function(){g.handleChange(g.getJumpPrevPage())},g.jumpNext=function(){g.handleChange(g.getJumpNextPage())},g.hasPrev=function(){return g.state.current>1},g.hasNext=function(){return g.state.current<S(void 0,g.state,g.props)},g.runIfEnter=function(U,j){if(U.key==="Enter"||U.charCode===13){for(var L=arguments.length,G=new Array(L>2?L-2:0),B=2;B<L;B++)G[B-2]=arguments[B];j.apply(void 0,G)}},g.runIfEnterPrev=function(U){g.runIfEnter(U,g.prev)},g.runIfEnterNext=function(U){g.runIfEnter(U,g.next)},g.runIfEnterJumpPrev=function(U){g.runIfEnter(U,g.jumpPrev)},g.runIfEnterJumpNext=function(U){g.runIfEnter(U,g.jumpNext)},g.handleGoTO=function(U){(U.keyCode===u.ENTER||U.type==="click")&&g.handleChange(g.state.currentInputValue)};var f=b.onChange!==a,C="current"in b;C&&!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 E=b.defaultCurrent;"current"in b&&(E=b.current);var _=b.defaultPageSize;return"pageSize"in b&&(_=b.pageSize),E=Math.min(E,S(_,void 0,b)),g.state={current:E,currentInputValue:E,pageSize:_},g}return Object(F.a)(v,[{key:"componentDidUpdate",value:function(g,f){var C=this.props.prefixCls;if(f.current!==this.state.current&&this.paginationNode){var E=this.paginationNode.querySelector(".".concat(C,"-item-").concat(f.current));E&&document.activeElement===E&&E.blur()}}},{key:"getValidValue",value:function(g){var f=g.target.value,C=S(void 0,this.state,this.props),E=this.state.currentInputValue,_;return f===""?_=f:isNaN(Number(f))?_=E:f>=C?_=C:_=Number(f),_}},{key:"getShowSizeChanger",value:function(){var g=this.props,f=g.showSizeChanger,C=g.total,E=g.totalBoundaryShowSizeChanger;return typeof f!="undefined"?f:C>E}},{key:"renderPrev",value:function(g){var f=this.props,C=f.prevIcon,E=f.itemRender,_=E(g,"prev",this.getItemIcon(C,"prev page")),U=!this.hasPrev();return Object(N.isValidElement)(_)?Object(N.cloneElement)(_,{disabled:U}):_}},{key:"renderNext",value:function(g){var f=this.props,C=f.nextIcon,E=f.itemRender,_=E(g,"next",this.getItemIcon(C,"next page")),U=!this.hasNext();return Object(N.isValidElement)(_)?Object(N.cloneElement)(_,{disabled:U}):_}},{key:"render",value:function(){var g=this,f=this.props,C=f.prefixCls,E=f.className,_=f.style,U=f.disabled,j=f.hideOnSinglePage,L=f.total,G=f.locale,B=f.showQuickJumper,O=f.showLessItems,V=f.showTitle,te=f.showTotal,re=f.simple,ge=f.itemRender,Ae=f.showPrevNextJumpers,Oe=f.jumpPrevIcon,Ce=f.jumpNextIcon,je=f.selectComponentClass,Ue=f.selectPrefixCls,xe=f.pageSizeOptions,be=this.state,Ve=be.current,mt=be.pageSize,yt=be.currentInputValue;if(j===!0&&L<=mt)return null;var _t=S(void 0,this.state,this.props),xt=[],nt=null,ct=null,wt=null,_e=null,Me=null,ve=B&&B.goButton,Te=O?1:2,We=Ve-1>0?Ve-1:0,Je=Ve+1<_t?Ve+1:_t,at=Object.keys(this.props).reduce(function(ue,de){return(de.substr(0,5)==="data-"||de.substr(0,5)==="aria-"||de==="role")&&(ue[de]=g.props[de]),ue},{});if(re)return ve&&(typeof ve=="boolean"?Me=n.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},G.jump_to_confirm):Me=n.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},ve),Me=n.a.createElement("li",{title:V?"".concat(G.jump_to).concat(Ve,"/").concat(_t):null,className:"".concat(C,"-simple-pager")},Me)),n.a.createElement("ul",Object(Q.a)({className:p()(C,"".concat(C,"-simple"),Object(z.a)({},"".concat(C,"-disabled"),U),E),style:_,ref:this.savePaginationNode},at),n.a.createElement("li",{title:V?G.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:p()("".concat(C,"-prev"),Object(z.a)({},"".concat(C,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(We)),n.a.createElement("li",{title:V?"".concat(Ve,"/").concat(_t):null,className:"".concat(C,"-simple-pager")},n.a.createElement("input",{type:"text",value:yt,disabled:U,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),n.a.createElement("span",{className:"".concat(C,"-slash")},"/"),_t),n.a.createElement("li",{title:V?G.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:p()("".concat(C,"-next"),Object(z.a)({},"".concat(C,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Je)),Me);if(_t<=3+Te*2){var dt={locale:G,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:V,itemRender:ge};_t||xt.push(n.a.createElement(d,Object(Q.a)({},dt,{key:"noPager",page:_t,className:"".concat(C,"-disabled")})));for(var Lt=1;Lt<=_t;Lt+=1){var It=Ve===Lt;xt.push(n.a.createElement(d,Object(Q.a)({},dt,{key:Lt,page:Lt,active:It})))}}else{var Ne=O?G.prev_3:G.prev_5,ke=O?G.next_3:G.next_5;Ae&&(nt=n.a.createElement("li",{title:V?Ne:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:p()("".concat(C,"-jump-prev"),Object(z.a)({},"".concat(C,"-jump-prev-custom-icon"),!!Oe))},ge(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Oe,"prev page"))),ct=n.a.createElement("li",{title:V?ke:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:p()("".concat(C,"-jump-next"),Object(z.a)({},"".concat(C,"-jump-next-custom-icon"),!!Ce))},ge(this.getJumpNextPage(),"jump-next",this.getItemIcon(Ce,"next page")))),_e=n.a.createElement(d,{locale:G,last:!0,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:_t,page:_t,active:!1,showTitle:V,itemRender:ge}),wt=n.a.createElement(d,{locale:G,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:V,itemRender:ge});var it=Math.max(1,Ve-Te),ot=Math.min(Ve+Te,_t);Ve-1<=Te&&(ot=1+Te*2),_t-Ve<=Te&&(it=_t-Te*2);for(var Ge=it;Ge<=ot;Ge+=1){var $e=Ve===Ge;xt.push(n.a.createElement(d,{locale:G,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ge,page:Ge,active:$e,showTitle:V,itemRender:ge}))}Ve-1>=Te*2&&Ve!==1+2&&(xt[0]=Object(N.cloneElement)(xt[0],{className:"".concat(C,"-item-after-jump-prev")}),xt.unshift(nt)),_t-Ve>=Te*2&&Ve!==_t-2&&(xt[xt.length-1]=Object(N.cloneElement)(xt[xt.length-1],{className:"".concat(C,"-item-before-jump-next")}),xt.push(ct)),it!==1&&xt.unshift(wt),ot!==_t&&xt.push(_e)}var we=null;te&&(we=n.a.createElement("li",{className:"".concat(C,"-total-text")},te(L,[L===0?0:(Ve-1)*mt+1,Ve*mt>L?L:Ve*mt])));var Se=!this.hasPrev()||!_t,Ee=!this.hasNext()||!_t;return n.a.createElement("ul",Object(Q.a)({className:p()(C,E,Object(z.a)({},"".concat(C,"-disabled"),U)),style:_,unselectable:"unselectable",ref:this.savePaginationNode},at),we,n.a.createElement("li",{title:V?G.prev_page:null,onClick:this.prev,tabIndex:Se?null:0,onKeyPress:this.runIfEnterPrev,className:p()("".concat(C,"-prev"),Object(z.a)({},"".concat(C,"-disabled"),Se)),"aria-disabled":Se},this.renderPrev(We)),xt,n.a.createElement("li",{title:V?G.next_page:null,onClick:this.next,tabIndex:Ee?null:0,onKeyPress:this.runIfEnterNext,className:p()("".concat(C,"-next"),Object(z.a)({},"".concat(C,"-disabled"),Ee)),"aria-disabled":Ee},this.renderNext(Je)),n.a.createElement(h,{disabled:U,locale:G,rootPrefixCls:C,selectComponentClass:je,selectPrefixCls:Ue,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Ve,pageSize:mt,pageSizeOptions:xe,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:ve}))}}],[{key:"getDerivedStateFromProps",value:function(g,f){var C={};if("current"in g&&(C.current=g.current,g.current!==f.current&&(C.currentInputValue=C.current)),"pageSize"in g&&g.pageSize!==f.pageSize){var E=f.current,_=S(g.pageSize,f,g);E=E>_?_:E,"current"in g||(C.current=E,C.currentInputValue=E),C.pageSize=g.pageSize}return C}}]),v}(n.a.Component);x.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:a,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:a,locale:r.a,style:{},itemRender:s,totalBoundaryShowSizeChanger:50};var T=x},"6RRn":function(Be,le,D){"use strict";var Q=D("wCXF"),z=D("n6Qo");D.d(le,"b",function(){return z.a});var M=D("IBYe"),X=D("6eGT"),F=D("hW8S");D.d(le,"a",function(){return F.a}),le.c=Q.b},"6UM0":function(Be,le,D){var Q,z;(function(){var M;(function(){"use strict";var F=[function(n,P,p){var m=p(1).Beautifier,d=p(5).Options;function u(o,h){var r=new m(o,h);return r.beautify()}n.exports=u,n.exports.defaultOptions=function(){return new d}},function(n,P,p){var m=p(2).Output,d=p(3).Token,u=p(4),o=p(5).Options,h=p(7).Tokenizer,r=p(7).line_starters,a=p(7).positionable_operators,i=p(7).TOKEN;function s(O,V){return V.indexOf(O)!==-1}function S(O){return O.replace(/^\s+/g,"")}function x(O){for(var V={},te=0;te<O.length;te++)V[O[te].replace(/-/g,"_")]=O[te];return V}function T(O,V){return O&&O.type===i.RESERVED&&O.text===V}function A(O,V){return O&&O.type===i.RESERVED&&s(O.text,V)}var w=["case","return","do","if","throw","else","await","break","continue","async"],v=["before-newline","after-newline","preserve-newline"],b=x(v),g=[b.before_newline,b.preserve_newline],f={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function C(O,V){if(V.multiline_frame||V.mode===f.ForInitializer||V.mode===f.Conditional)return;O.remove_indent(V.start_line_index)}function E(O){O=O.replace(u.allLineBreaks,`
|
|
`);for(var V=[],te=O.indexOf(`
|
|
`);te!==-1;)V.push(O.substring(0,te)),O=O.substring(te+1),te=O.indexOf(`
|
|
`);return O.length&&V.push(O),V}function _(O){return O===f.ArrayLiteral}function U(O){return s(O,[f.Expression,f.ForInitializer,f.Conditional])}function j(O,V){for(var te=0;te<O.length;te++){var re=O[te].trim();if(re.charAt(0)!==V)return!1}return!0}function L(O,V){for(var te=0,re=O.length,ge;te<re;te++)if(ge=O[te],ge&&ge.indexOf(V)!==0)return!1;return!0}function G(O,V){V=V||{},this._source_text=O||"",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 o(V)}G.prototype.create_flags=function(O,V){var te=0;O&&(te=O.indentation_level,!this._output.just_added_newline()&&O.line_indent_level>te&&(te=O.line_indent_level));var re={mode:V,parent:O,last_token:O?O.last_token:new d(i.START_BLOCK,""),last_word:O?O.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:te,alignment:0,line_indent_level:O?O.line_indent_level:te,start_line_index:this._output.get_line_number(),ternary_depth:0};return re},G.prototype._reset=function(O){var V=O.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,V),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(f.BlockStatement);var te=new h(O,this._options);return this._tokens=te.tokenize(),O},G.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var O,V=this._reset(this._source_text),te=this._options.eol;this._options.eol==="auto"&&(te=`
|
|
`,V&&u.lineBreak.test(V||"")&&(te=V.match(u.lineBreak)[0]));for(var re=this._tokens.next();re;)this.handle_token(re),this._last_last_text=this._flags.last_token.text,this._flags.last_token=re,re=this._tokens.next();return O=this._output.get_code(te),O},G.prototype.handle_token=function(O,V){O.type===i.START_EXPR?this.handle_start_expr(O):O.type===i.END_EXPR?this.handle_end_expr(O):O.type===i.START_BLOCK?this.handle_start_block(O):O.type===i.END_BLOCK?this.handle_end_block(O):O.type===i.WORD?this.handle_word(O):O.type===i.RESERVED?this.handle_word(O):O.type===i.SEMICOLON?this.handle_semicolon(O):O.type===i.STRING?this.handle_string(O):O.type===i.EQUALS?this.handle_equals(O):O.type===i.OPERATOR?this.handle_operator(O):O.type===i.COMMA?this.handle_comma(O):O.type===i.BLOCK_COMMENT?this.handle_block_comment(O,V):O.type===i.COMMENT?this.handle_comment(O,V):O.type===i.DOT?this.handle_dot(O):O.type===i.EOF?this.handle_eof(O):O.type===i.UNKNOWN?this.handle_unknown(O,V):this.handle_unknown(O,V)},G.prototype.handle_whitespace_and_comments=function(O,V){var te=O.newlines,re=this._options.keep_array_indentation&&_(this._flags.mode);if(O.comments_before)for(var ge=O.comments_before.next();ge;)this.handle_whitespace_and_comments(ge,V),this.handle_token(ge,V),ge=O.comments_before.next();if(re)for(var Ae=0;Ae<te;Ae+=1)this.print_newline(Ae>0,V);else if(this._options.max_preserve_newlines&&te>this._options.max_preserve_newlines&&(te=this._options.max_preserve_newlines),this._options.preserve_newlines&&te>1){this.print_newline(!1,V);for(var Oe=1;Oe<te;Oe+=1)this.print_newline(!0,V)}};var B=["async","break","continue","return","throw","yield"];G.prototype.allow_wrap_or_preserved_newline=function(O,V){if(V=V===void 0?!1:V,this._output.just_added_newline())return;var te=this._options.preserve_newlines&&O.newlines||V,re=s(this._flags.last_token.text,a)||s(O.text,a);if(re){var ge=s(this._flags.last_token.text,a)&&s(this._options.operator_position,g)||s(O.text,a);te=te&&ge}if(te)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(A(this._flags.last_token,B))return;this._output.set_wrap_point()}},G.prototype.print_newline=function(O,V){if(!V&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var te=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&T(te,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(O)&&(this._flags.multiline_frame=!0)},G.prototype.print_token_line_indentation=function(O){this._output.just_added_newline()&&(this._options.keep_array_indentation&&O.newlines&&(O.text==="["||_(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(O.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))},G.prototype.print_token=function(O){if(this._output.raw){this._output.add_raw_token(O);return}if(this._options.comma_first&&O.previous&&O.previous.type===i.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var V=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(V),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(O),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(O),this._output.non_breaking_space=!0,this._output.add_token(O.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},G.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},G.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))},G.prototype.set_mode=function(O){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,O),this._flags=this.create_flags(this._previous_flags,O),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},G.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===f.Statement&&C(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},G.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||A(this._flags.last_token,["get","set"]))},G.prototype.start_of_statement=function(O){var V=!1;return V=V||A(this._flags.last_token,["var","let","const"])&&O.type===i.WORD,V=V||T(this._flags.last_token,"do"),V=V||!(this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement)&&A(this._flags.last_token,B)&&!O.newlines,V=V||T(this._flags.last_token,"else")&&!(T(O,"if")&&!O.comments_before),V=V||this._flags.last_token.type===i.END_EXPR&&(this._previous_flags.mode===f.ForInitializer||this._previous_flags.mode===f.Conditional),V=V||this._flags.last_token.type===i.WORD&&this._flags.mode===f.BlockStatement&&!this._flags.in_case&&!(O.text==="--"||O.text==="++")&&this._last_last_text!=="function"&&O.type!==i.WORD&&O.type!==i.RESERVED,V=V||this._flags.mode===f.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||A(this._flags.last_token,["get","set"])),V?(this.set_mode(f.Statement),this.indent(),this.handle_whitespace_and_comments(O,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O,A(O,["do","for","if","while"])),!0):!1},G.prototype.handle_start_expr=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O);var V=f.Expression;if(O.text==="["){if(this._flags.last_token.type===i.WORD||this._flags.last_token.text===")"){A(this._flags.last_token,r)&&(this._output.space_before_token=!0),this.print_token(O),this.set_mode(V),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}V=f.ArrayLiteral,_(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),s(this._flags.last_token.type,[i.START_EXPR,i.END_EXPR,i.WORD,i.OPERATOR,i.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===i.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,V=f.ForInitializer):s(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,V=f.Conditional):s(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&O.whitespace_before===""?this._output.space_before_token=!1:(s(this._flags.last_token.text,r)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O);else if(this._flags.last_token.type===i.WORD){this._output.space_before_token=!1;var te=this._tokens.peek(-3);if(this._options.space_after_named_function&&te){var re=this._tokens.peek(-4);A(te,["async","function"])||te.text==="*"&&A(re,["async","function"])?this._output.space_before_token=!0:this._flags.mode===f.ObjectLiteral?(te.text==="{"||te.text===","||te.text==="*"&&(re.text==="{"||re.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(O);(this._flags.last_token.type===i.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(s(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&s(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===i.START_BLOCK?this.print_newline():(this._flags.last_token.type===i.END_EXPR||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===i.COMMA)&&this.allow_wrap_or_preserved_newline(O,O.newlines),this.print_token(O),this.set_mode(V),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},G.prototype.handle_end_expr=function(O){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(O),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(O,O.text==="]"&&_(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===i.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(O),this.restore_mode(),C(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===f.Conditional&&(this._previous_flags.mode=f.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},G.prototype.handle_start_block=function(O){this.handle_whitespace_and_comments(O);var V=this._tokens.peek(),te=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===i.END_EXPR?(this.set_mode(f.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(f.BlockStatement):te&&(s(te.text,[":",","])&&s(V.type,[i.STRING,i.WORD,i.RESERVED])||s(V.text,["get","set","..."])&&s(te.type,[i.WORD,i.RESERVED]))?s(this._last_last_text,["class","interface"])&&!s(te.text,[":",","])?this.set_mode(f.BlockStatement):this.set_mode(f.ObjectLiteral):this._flags.last_token.type===i.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(f.BlockStatement):s(this._flags.last_token.type,[i.EQUALS,i.START_EXPR,i.COMMA,i.OPERATOR])||A(this._flags.last_token,["return","throw","import","default"])?this.set_mode(f.ObjectLiteral):this.set_mode(f.BlockStatement),this._flags.last_token&&(A(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var re=!V.comments_before&&V.text==="}",ge=re&&this._flags.last_word==="function"&&this._flags.last_token.type===i.END_EXPR;if(this._options.brace_preserve_inline){var Ae=0,Oe=null;this._flags.inline_frame=!0;do if(Ae+=1,Oe=this._tokens.peek(Ae-1),Oe.newlines){this._flags.inline_frame=!1;break}while(Oe.type!==i.EOF&&!(Oe.type===i.END_BLOCK&&Oe.opened===O))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&O.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==i.OPERATOR&&(ge||this._flags.last_token.type===i.EQUALS||A(this._flags.last_token,w)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(_(this._previous_flags.mode)&&(this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.COMMA)&&((this._flags.last_token.type===i.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(O),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==i.OPERATOR&&this._flags.last_token.type!==i.START_EXPR&&(this._flags.last_token.type===i.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(O),this.indent(),!re&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},G.prototype.handle_end_block=function(O){for(this.handle_whitespace_and_comments(O);this._flags.mode===f.Statement;)this.restore_mode();var V=this._flags.last_token.type===i.START_BLOCK;this._flags.inline_frame&&!V?this._output.space_before_token=!0:this._options.brace_style==="expand"?V||this.print_newline():V||(_(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(O)},G.prototype.handle_word=function(O){if(O.type===i.RESERVED){if(s(O.text,["set","get"])&&this._flags.mode!==f.ObjectLiteral)O.type=i.WORD;else if(O.text==="import"&&s(this._tokens.peek().text,["(","."]))O.type=i.WORD;else if(s(O.text,["as","from"])&&!this._flags.import_block)O.type=i.WORD;else if(this._flags.mode===f.ObjectLiteral){var V=this._tokens.peek();V.text===":"&&(O.type=i.WORD)}}if(this.start_of_statement(O)?A(this._flags.last_token,["var","let","const"])&&O.type===i.WORD&&(this._flags.declaration_statement=!0):O.newlines&&!U(this._flags.mode)&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==i.EQUALS&&(this._options.preserve_newlines||!A(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(O),this.print_newline()):this.handle_whitespace_and_comments(O),this._flags.do_block&&!this._flags.do_while)if(T(O,"while")){this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&T(O,"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&&A(O,["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(O),this._flags.in_case=!0;return}if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O)),T(O,"function")){(s(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(s(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===i.OPERATOR))&&(!this._output.just_added_blankline()&&!O.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD?A(this._flags.last_token,["get","set","new","export"])||A(this._flags.last_token,B)?this._output.space_before_token=!0:T(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===i.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(U(this._flags.mode)||_(this._flags.mode))||this.print_newline(),this.print_token(O),this._flags.last_word=O.text;return}var te="NONE";if(this._flags.last_token.type===i.END_BLOCK?this._previous_flags.inline_frame?te="SPACE":A(O,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&O.newlines?te="NEWLINE":(te="SPACE",this._output.space_before_token=!0):te="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&this._flags.mode===f.BlockStatement?te="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&U(this._flags.mode)?te="SPACE":this._flags.last_token.type===i.STRING?te="NEWLINE":this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.last_token.text==="*"&&(s(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&s(this._last_last_text,["{",","]))?te="SPACE":this._flags.last_token.type===i.START_BLOCK?this._flags.inline_frame?te="SPACE":te="NEWLINE":this._flags.last_token.type===i.END_EXPR&&(this._output.space_before_token=!0,te="NEWLINE"),A(O,r)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?te="SPACE":te="NEWLINE"),A(O,["else","catch","finally"]))if((!(this._flags.last_token.type===i.END_BLOCK&&this._previous_flags.mode===f.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&O.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var re=this._output.current_line;re.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else te==="NEWLINE"?A(this._flags.last_token,w)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&A(O,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==i.END_EXPR?(this._flags.last_token.type!==i.START_EXPR||!A(O,["var","let","const"]))&&this._flags.last_token.text!==":"&&(T(O,"if")&&T(O.previous,"else")?this._output.space_before_token=!0:this.print_newline()):A(O,r)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&_(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():te==="SPACE"&&(this._output.space_before_token=!0);O.previous&&(O.previous.type===i.WORD||O.previous.type===i.RESERVED)&&(this._output.space_before_token=!0),this.print_token(O),this._flags.last_word=O.text,O.type===i.RESERVED&&(O.text==="do"?this._flags.do_block=!0:O.text==="if"?this._flags.if_block=!0:O.text==="import"?this._flags.import_block=!0:this._flags.import_block&&T(O,"from")&&(this._flags.import_block=!1))},G.prototype.handle_semicolon=function(O){this.start_of_statement(O)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(O);for(var V=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&T(V,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(O)},G.prototype.handle_string=function(O){O.text.startsWith("`")&&O.newlines===0&&O.whitespace_before===""&&(O.previous.text===")"||this._flags.last_token.type===i.WORD)||(this.start_of_statement(O)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(O),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O):O.text.startsWith("`")&&this._flags.last_token.type===i.END_EXPR&&(O.previous.text==="]"||O.previous.text===")")&&O.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(O)},G.prototype.handle_equals=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0},G.prototype.handle_comma=function(O){this.handle_whitespace_and_comments(O,!0),this.print_token(O),this._output.space_before_token=!0,this._flags.declaration_statement?(U(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(O)):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(O)},G.prototype.handle_operator=function(O){var V=O.text==="*"&&(A(this._flags.last_token,["function","yield"])||s(this._flags.last_token.type,[i.START_BLOCK,i.COMMA,i.END_BLOCK,i.SEMICOLON])),te=s(O.text,["-","+"])&&(s(this._flags.last_token.type,[i.START_BLOCK,i.START_EXPR,i.EQUALS,i.OPERATOR])||s(this._flags.last_token.text,r)||this._flags.last_token.text===",");if(!this.start_of_statement(O)){var re=!V;this.handle_whitespace_and_comments(O,re)}if(O.text==="*"&&this._flags.last_token.type===i.DOT){this.print_token(O);return}if(O.text==="::"){this.print_token(O);return}if(this._flags.last_token.type===i.OPERATOR&&s(this._options.operator_position,g)&&this.allow_wrap_or_preserved_newline(O),O.text===":"&&this._flags.in_case){this.print_token(O),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==i.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 ge=!0,Ae=!0,Oe=!1;if(O.text===":"?this._flags.ternary_depth===0?ge=!1:(this._flags.ternary_depth-=1,Oe=!0):O.text==="?"&&(this._flags.ternary_depth+=1),!te&&!V&&this._options.preserve_newlines&&s(O.text,a)){var Ce=O.text===":",je=Ce&&Oe,Ue=Ce&&!Oe;switch(this._options.operator_position){case b.before_newline:this._output.space_before_token=!Ue,this.print_token(O),(!Ce||je)&&this.allow_wrap_or_preserved_newline(O),this._output.space_before_token=!0;return;case b.after_newline:this._output.space_before_token=!0,!Ce||je?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(O):this._output.space_before_token=!1,this.print_token(O),this._output.space_before_token=!0;return;case b.preserve_newline:Ue||this.allow_wrap_or_preserved_newline(O),ge=!(this._output.just_added_newline()||Ue),this._output.space_before_token=ge,this.print_token(O),this._output.space_before_token=!0;return}}if(V){this.allow_wrap_or_preserved_newline(O),ge=!1;var xe=this._tokens.peek();Ae=xe&&s(xe.type,[i.WORD,i.RESERVED])}else if(O.text==="...")this.allow_wrap_or_preserved_newline(O),ge=this._flags.last_token.type===i.START_BLOCK,Ae=!1;else if(s(O.text,["--","++","!","~"])||te){if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR)&&this.allow_wrap_or_preserved_newline(O),ge=!1,Ae=!1,O.newlines&&(O.text==="--"||O.text==="++"||O.text==="~")){var be=A(this._flags.last_token,w)&&O.newlines;be&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(be,!0)}this._flags.last_token.text===";"&&U(this._flags.mode)&&(ge=!0),this._flags.last_token.type===i.RESERVED?ge=!0:this._flags.last_token.type===i.END_EXPR?ge=!(this._flags.last_token.text==="]"&&(O.text==="--"||O.text==="++")):this._flags.last_token.type===i.OPERATOR&&(ge=s(O.text,["--","-","++","+"])&&s(this._flags.last_token.text,["--","-","++","+"]),s(O.text,["+","-"])&&s(this._flags.last_token.text,["--","++"])&&(Ae=!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||ge,this.print_token(O),this._output.space_before_token=Ae},G.prototype.handle_block_comment=function(O,V){if(this._output.raw){this._output.add_raw_token(O),O.directives&&O.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(O.directives){this.print_newline(!1,V),this.print_token(O),O.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!u.newline.test(O.text)&&!O.newlines){this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0;return}else this.print_block_commment(O,V)},G.prototype.print_block_commment=function(O,V){var te=E(O.text),re,ge=!1,Ae=!1,Oe=O.whitespace_before,Ce=Oe.length;if(this.print_newline(!1,V),this.print_token_line_indentation(O),this._output.add_token(te[0]),this.print_newline(!1,V),te.length>1){for(te=te.slice(1),ge=j(te,"*"),Ae=L(te,Oe),ge&&(this._flags.alignment=1),re=0;re<te.length;re++)ge?(this.print_token_line_indentation(O),this._output.add_token(S(te[re]))):Ae&&te[re]?(this.print_token_line_indentation(O),this._output.add_token(te[re].substring(Ce))):(this._output.current_line.set_indent(-1),this._output.add_token(te[re])),this.print_newline(!1,V);this._flags.alignment=0}},G.prototype.handle_comment=function(O,V){O.newlines?this.print_newline(!1,V):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(O),this.print_newline(!1,V)},G.prototype.handle_dot=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),A(this._flags.last_token,w)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(O,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(O)},G.prototype.handle_unknown=function(O,V){this.print_token(O),O.text[O.text.length-1]===`
|
|
`&&this.print_newline(!1,V)},G.prototype.handle_eof=function(O){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(O)},n.exports.Beautifier=G},function(n){function P(d){this.__parent=d,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 d=new P(this.__parent);return d.set_indent(this.__indent_count,this.__alignment_count),d},P.prototype.item=function(d){return d<0?this.__items[this.__items.length+d]:this.__items[d]},P.prototype.has_match=function(d){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(d))return!0;return!1},P.prototype.set_indent=function(d,u){this.is_empty()&&(this.__indent_count=d||0,this.__alignment_count=u||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 d=this.__parent.current_line;return d.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),d.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),d.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,d.__items[0]===" "&&(d.__items.splice(0,1),d.__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(d){this.__items.push(d);var u=d.lastIndexOf(`
|
|
`);u!==-1?this.__character_count=d.length-u:this.__character_count+=d.length},P.prototype.pop=function(){var d=null;return this.is_empty()||(d=this.__items.pop(),this.__character_count-=d.length),d},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 d="";return this.is_empty()?this.__parent.indent_empty_lines&&(d=this.__parent.get_indent_string(this.__indent_count)):(d=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),d+=this.__items.join("")),d};function p(d,u){this.__cache=[""],this.__indent_size=d.indent_size,this.__indent_string=d.indent_char,d.indent_with_tabs||(this.__indent_string=new Array(d.indent_size+1).join(d.indent_char)),u=u||"",d.indent_level>0&&(u=new Array(d.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}p.prototype.get_indent_size=function(d,u){var o=this.__base_string_length;return u=u||0,d<0&&(o=0),o+=d*this.__indent_size,o+=u,o},p.prototype.get_indent_string=function(d,u){var o=this.__base_string;return u=u||0,d<0&&(d=0,o=""),u+=d*this.__indent_size,this.__ensure_cache(u),o+=this.__cache[u],o},p.prototype.__ensure_cache=function(d){for(;d>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var d=this.__cache.length,u=0,o="";this.__indent_size&&d>=this.__indent_size&&(u=Math.floor(d/this.__indent_size),d-=u*this.__indent_size,o=new Array(u+1).join(this.__indent_string)),d&&(o+=new Array(d+1).join(" ")),this.__cache.push(o)};function m(d,u){this.__indent_cache=new p(d,u),this.raw=!1,this._end_with_newline=d.end_with_newline,this.indent_size=d.indent_size,this.wrap_line_length=d.wrap_line_length,this.indent_empty_lines=d.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()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(d,u){return this.__indent_cache.get_indent_string(d,u)},m.prototype.get_indent_size=function(d,u){return this.__indent_cache.get_indent_size(d,u)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(d){return this.is_empty()||!d&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(d){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
|
|
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
|
|
`);return d!==`
|
|
`&&(o=o.replace(/[\n]/g,d)),o},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(d,u){return d=d||0,u=u||0,this.next_line.set_indent(d,u),this.__lines.length>1?(this.current_line.set_indent(d,u),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(d){for(var u=0;u<d.newlines;u++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(d.whitespace_before),this.current_line.push(d.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(d){this.__add_space_before_token(),this.current_line.push(d),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},m.prototype.remove_indent=function(d){for(var u=this.__lines.length;d<u;)this.__lines[d]._remove_indent(),d++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(d){for(d=d===void 0?!1:d,this.current_line.trim();d&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(d,u){for(var o=this.__lines.length-2;o>=0;){var h=this.__lines[o];if(h.is_empty())break;if(h.item(0).indexOf(d)!==0&&h.item(-1)!==u){this.__lines.splice(o+1,0,new P(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},n.exports.Output=m},function(n){function P(p,m,d,u){this.type=p,this.text=m,this.comments_before=null,this.newlines=d||0,this.whitespace_before=u||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}n.exports.Token=P},function(n,P){var p="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",d="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",u="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",o="(?:\\\\u[0-9a-fA-F]{4}|["+p+d+"])",h="(?:\\\\u[0-9a-fA-F]{4}|["+m+d+u+"])*";P.identifier=new RegExp(o+h,"g"),P.identifierStart=new RegExp(o),P.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+d+u+"])+");var r=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;P.newline=/[\n\r\u2028\u2029]/,P.lineBreak=new RegExp(`\r
|
|
|`+P.newline.source),P.allLineBreaks=new RegExp(P.lineBreak.source,"g")},function(n,P,p){var m=p(6).Options,d=["before-newline","after-newline","preserve-newline"];function u(o){m.call(this,o,"js");var h=this.raw_options.brace_style||null;h==="expand-strict"?this.raw_options.brace_style="expand":h==="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 r=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var a=0;a<r.length;a++)r[a]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=r[a];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",d),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}u.prototype=new m,n.exports.Options=u},function(n){function P(d,u){this.raw_options=p(d,u),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(d,u){var o=this.raw_options[d],h=u||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(h=o.concat()):typeof o=="string"&&(h=o.split(/[^a-zA-Z0-9_\/\-]+/)),h},P.prototype._get_boolean=function(d,u){var o=this.raw_options[d],h=o===void 0?!!u:!!o;return h},P.prototype._get_characters=function(d,u){var o=this.raw_options[d],h=u||"";return typeof o=="string"&&(h=o.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),h},P.prototype._get_number=function(d,u){var o=this.raw_options[d];u=parseInt(u,10),isNaN(u)&&(u=0);var h=parseInt(o,10);return isNaN(h)&&(h=u),h},P.prototype._get_selection=function(d,u,o){var h=this._get_selection_list(d,u,o);if(h.length!==1)throw new Error("Invalid Option Value: The option '"+d+`' can only be one of the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[d]+"'");return h[0]},P.prototype._get_selection_list=function(d,u,o){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[u[0]],!this._is_valid_selection(o,u))throw new Error("Invalid Default Value!");var h=this._get_array(d,o);if(!this._is_valid_selection(h,u))throw new Error("Invalid Option Value: The option '"+d+`' can contain only the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[d]+"'");return h},P.prototype._is_valid_selection=function(d,u){return d.length&&u.length&&!d.some(function(o){return u.indexOf(o)===-1})};function p(d,u){var o={};d=m(d);var h;for(h in d)h!==u&&(o[h]=d[h]);if(u&&d[u])for(h in d[u])o[h]=d[u][h];return o}function m(d){var u={},o;for(o in d){var h=o.replace(/-/g,"_");u[h]=d[o]}return u}n.exports.Options=P,n.exports.normalizeOpts=m,n.exports.mergeOpts=p},function(n,P,p){var m=p(8).InputScanner,d=p(9).Tokenizer,u=p(9).TOKEN,o=p(13).Directives,h=p(4),r=p(12).Pattern,a=p(14).TemplatablePattern;function i(j,L){return L.indexOf(j)!==-1}var s={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:u.START,RAW:u.RAW,EOF:u.EOF},S=new o(/\/\*/,/\*\//),x=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,T=/[0-9]/,A=/[^\d\.]/,w=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),v=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";v=v.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),v="\\?\\.(?!\\d) "+v,v=v.replace(/ /g,"|");var b=new RegExp(v),g="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),f=g.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),C=new RegExp("^(?:"+f.join("|")+")$"),E,_=function(j,L){d.call(this,j,L),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var G=new r(this._input),B=new a(this._input).read_options(this._options);this.__patterns={template:B,identifier:B.starting_with(h.identifier).matching(h.identifierMatch),number:G.matching(x),punct:G.matching(b),comment:G.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:G.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:G.matching(/<!--/),html_comment_end:G.matching(/-->/),include:G.starting_with(/#include/).until_after(h.lineBreak),shebang:G.starting_with(/#!/).until_after(h.lineBreak),xml:G.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:B.until(/['\\\n\r\u2028\u2029]/),double_quote:B.until(/["\\\n\r\u2028\u2029]/),template_text:B.until(/[`\\$]/),template_expression:B.until(/[`}\\]/)}};_.prototype=new d,_.prototype._is_comment=function(j){return j.type===s.COMMENT||j.type===s.BLOCK_COMMENT||j.type===s.UNKNOWN},_.prototype._is_opening=function(j){return j.type===s.START_BLOCK||j.type===s.START_EXPR},_.prototype._is_closing=function(j,L){return(j.type===s.END_BLOCK||j.type===s.END_EXPR)&&L&&(j.text==="]"&&L.text==="["||j.text===")"&&L.text==="("||j.text==="}"&&L.text==="{")},_.prototype._reset=function(){E=!1},_.prototype._get_next_token=function(j,L){var G=null;this._readWhitespace();var B=this._input.peek();return B===null?this._create_token(s.EOF,""):(G=G||this._read_non_javascript(B),G=G||this._read_string(B),G=G||this._read_word(j),G=G||this._read_singles(B),G=G||this._read_comment(B),G=G||this._read_regexp(B,j),G=G||this._read_xml(B,j),G=G||this._read_punctuation(),G=G||this._create_token(s.UNKNOWN,this._input.next()),G)},_.prototype._read_word=function(j){var L;if(L=this.__patterns.identifier.read(),L!=="")return L=L.replace(h.allLineBreaks,`
|
|
`),!(j.type===s.DOT||j.type===s.RESERVED&&(j.text==="set"||j.text==="get"))&&C.test(L)?(L==="in"||L==="of")&&(j.type===s.WORD||j.type===s.STRING)?this._create_token(s.OPERATOR,L):this._create_token(s.RESERVED,L):this._create_token(s.WORD,L);if(L=this.__patterns.number.read(),L!=="")return this._create_token(s.WORD,L)},_.prototype._read_singles=function(j){var L=null;return j==="("||j==="["?L=this._create_token(s.START_EXPR,j):j===")"||j==="]"?L=this._create_token(s.END_EXPR,j):j==="{"?L=this._create_token(s.START_BLOCK,j):j==="}"?L=this._create_token(s.END_BLOCK,j):j===";"?L=this._create_token(s.SEMICOLON,j):j==="."&&A.test(this._input.peek(1))?L=this._create_token(s.DOT,j):j===","&&(L=this._create_token(s.COMMA,j)),L&&this._input.next(),L},_.prototype._read_punctuation=function(){var j=this.__patterns.punct.read();if(j!=="")return j==="="?this._create_token(s.EQUALS,j):j==="?."?this._create_token(s.DOT,j):this._create_token(s.OPERATOR,j)},_.prototype._read_non_javascript=function(j){var L="";if(j==="#"){if(this._is_first_token()&&(L=this.__patterns.shebang.read(),L))return this._create_token(s.UNKNOWN,L.trim()+`
|
|
`);if(L=this.__patterns.include.read(),L)return this._create_token(s.UNKNOWN,L.trim()+`
|
|
`);j=this._input.next();var G="#";if(this._input.hasNext()&&this._input.testChar(T)){do j=this._input.next(),G+=j;while(this._input.hasNext()&&j!=="#"&&j!=="=");return j==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(G+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(G+="{}",this._input.next(),this._input.next())),this._create_token(s.WORD,G)}this._input.back()}else if(j==="<"&&this._is_first_token()){if(L=this.__patterns.html_comment_start.read(),L){for(;this._input.hasNext()&&!this._input.testChar(h.newline);)L+=this._input.next();return E=!0,this._create_token(s.COMMENT,L)}}else if(E&&j==="-"&&(L=this.__patterns.html_comment_end.read(),L))return E=!1,this._create_token(s.COMMENT,L);return null},_.prototype._read_comment=function(j){var L=null;if(j==="/"){var G="";if(this._input.peek(1)==="*"){G=this.__patterns.block_comment.read();var B=S.get_directives(G);B&&B.ignore==="start"&&(G+=S.readIgnored(this._input)),G=G.replace(h.allLineBreaks,`
|
|
`),L=this._create_token(s.BLOCK_COMMENT,G),L.directives=B}else this._input.peek(1)==="/"&&(G=this.__patterns.comment.read(),L=this._create_token(s.COMMENT,G))}return L},_.prototype._read_string=function(j){if(j==="`"||j==="'"||j==='"'){var L=this._input.next();return this.has_char_escapes=!1,j==="`"?L+=this._read_string_recursive("`",!0,"${"):L+=this._read_string_recursive(j),this.has_char_escapes&&this._options.unescape_strings&&(L=U(L)),this._input.peek()===j&&(L+=this._input.next()),L=L.replace(h.allLineBreaks,`
|
|
`),this._create_token(s.STRING,L)}return null},_.prototype._allow_regexp_or_xml=function(j){return j.type===s.RESERVED&&i(j.text,["return","case","throw","else","do","typeof","yield"])||j.type===s.END_EXPR&&j.text===")"&&j.opened.previous.type===s.RESERVED&&i(j.opened.previous.text,["if","while","for"])||i(j.type,[s.COMMENT,s.START_EXPR,s.START_BLOCK,s.START,s.END_BLOCK,s.OPERATOR,s.EQUALS,s.EOF,s.SEMICOLON,s.COMMA])},_.prototype._read_regexp=function(j,L){if(j==="/"&&this._allow_regexp_or_xml(L)){for(var G=this._input.next(),B=!1,O=!1;this._input.hasNext()&&(B||O||this._input.peek()!==j)&&!this._input.testChar(h.newline);)G+=this._input.peek(),B?B=!1:(B=this._input.peek()==="\\",this._input.peek()==="["?O=!0:this._input.peek()==="]"&&(O=!1)),this._input.next();return this._input.peek()===j&&(G+=this._input.next(),G+=this._input.read(h.identifier)),this._create_token(s.STRING,G)}return null},_.prototype._read_xml=function(j,L){if(this._options.e4x&&j==="<"&&this._allow_regexp_or_xml(L)){var G="",B=this.__patterns.xml.read_match();if(B){for(var O=B[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),V=O.indexOf("{")===0,te=0;B;){var re=!!B[1],ge=B[2],Ae=!!B[B.length-1]||ge.slice(0,8)==="![CDATA[";if(!Ae&&(ge===O||V&&ge.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(re?--te:++te),G+=B[0],te<=0)break;B=this.__patterns.xml.read_match()}return B||(G+=this._input.match(/[\s\S]*/g)[0]),G=G.replace(h.allLineBreaks,`
|
|
`),this._create_token(s.STRING,G)}}return null};function U(j){for(var L="",G=0,B=new m(j),O=null;B.hasNext();)if(O=B.match(/([\s]|[^\\]|\\\\)+/g),O&&(L+=O[0]),B.peek()==="\\"){if(B.next(),B.peek()==="x")O=B.match(/x([0-9A-Fa-f]{2})/g);else if(B.peek()==="u")O=B.match(/u([0-9A-Fa-f]{4})/g);else{L+="\\",B.hasNext()&&(L+=B.next());continue}if(!O)return j;if(G=parseInt(O[1],16),G>126&&G<=255&&O[0].indexOf("x")===0)return j;if(G>=0&&G<32){L+="\\"+O[0];continue}else G===34||G===39||G===92?L+="\\"+String.fromCharCode(G):L+=String.fromCharCode(G)}return L}_.prototype._read_string_recursive=function(j,L,G){var B,O;j==="'"?O=this.__patterns.single_quote:j==='"'?O=this.__patterns.double_quote:j==="`"?O=this.__patterns.template_text:j==="}"&&(O=this.__patterns.template_expression);for(var V=O.read(),te="";this._input.hasNext();){if(te=this._input.next(),te===j||!L&&h.newline.test(te)){this._input.back();break}else te==="\\"&&this._input.hasNext()?(B=this._input.peek(),B==="x"||B==="u"?this.has_char_escapes=!0:B==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),te+=this._input.next()):G&&(G==="${"&&te==="$"&&this._input.peek()==="{"&&(te+=this._input.next()),G===te&&(j==="`"?te+=this._read_string_recursive("}",L,"`"):te+=this._read_string_recursive("`",L,"${"),this._input.hasNext()&&(te+=this._input.next())));te+=O.read(),V+=te}return V},n.exports.Tokenizer=_,n.exports.TOKEN=s,n.exports.positionable_operators=w.slice(),n.exports.line_starters=g.slice()},function(n){var P=RegExp.prototype.hasOwnProperty("sticky");function p(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position<this.__input_length},p.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},p.prototype.peek=function(m){var d=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(d=this.__input.charAt(m)),d},p.prototype.__match=function(m,d){m.lastIndex=d;var u=m.exec(this.__input);return u&&!(P&&m.sticky)&&(u.index!==d&&(u=null)),u},p.prototype.test=function(m,d){return d=d||0,d+=this.__position,d>=0&&d<this.__input_length?!!this.__match(m,d):!1},p.prototype.testChar=function(m,d){var u=this.peek(d);return m.lastIndex=0,u!==null&&m.test(u)},p.prototype.match=function(m){var d=this.__match(m,this.__position);return d?this.__position+=d[0].length:d=null,d},p.prototype.read=function(m,d,u){var o="",h;return m&&(h=this.match(m),h&&(o+=h[0])),d&&(h||!m)&&(o+=this.readUntil(d,u)),o},p.prototype.readUntil=function(m,d){var u="",o=this.__position;m.lastIndex=this.__position;var h=m.exec(this.__input);return h?(o=h.index,d&&(o+=h[0].length)):o=this.__input_length,u=this.__input.substring(this.__position,o),this.__position=o,u},p.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},p.prototype.get_regexp=function(m,d){var u=null,o="g";return d&&P&&(o="y"),typeof m=="string"&&m!==""?u=new RegExp(m,o):m&&(u=new RegExp(m.source,o)),u},p.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(m){var d=this.__position,u=this.readUntilAfter(m);return this.__position=d,u},p.prototype.lookBack=function(m){var d=this.__position-1;return d>=m.length&&this.__input.substring(d-m.length,d).toLowerCase()===m},n.exports.InputScanner=p},function(n,P,p){var m=p(8).InputScanner,d=p(3).Token,u=p(10).TokenStream,o=p(11).WhitespacePattern,h={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},r=function(a,i){this._input=new m(a),this._options=i||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};r.prototype.tokenize=function(){this._input.restart(),this.__tokens=new u,this._reset();for(var a,i=new d(h.START,""),s=null,S=[],x=new u;i.type!==h.EOF;){for(a=this._get_next_token(i,s);this._is_comment(a);)x.add(a),a=this._get_next_token(i,s);x.isEmpty()||(a.comments_before=x,x=new u),a.parent=s,this._is_opening(a)?(S.push(s),s=a):s&&this._is_closing(a,s)&&(a.opened=s,s.closed=a,s=S.pop(),a.parent=s),a.previous=i,i.next=a,this.__tokens.add(a),i=a}return this.__tokens},r.prototype._is_first_token=function(){return this.__tokens.isEmpty()},r.prototype._reset=function(){},r.prototype._get_next_token=function(a,i){this._readWhitespace();var s=this._input.read(/.+/g);return s?this._create_token(h.RAW,s):this._create_token(h.EOF,"")},r.prototype._is_comment=function(a){return!1},r.prototype._is_opening=function(a){return!1},r.prototype._is_closing=function(a,i){return!1},r.prototype._create_token=function(a,i){var s=new d(a,i,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return s},r.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},n.exports.Tokenizer=r,n.exports.TOKEN=h},function(n){function P(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}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 p=null;return this.hasNext()&&(p=this.__tokens[this.__position],this.__position+=1),p},P.prototype.peek=function(p){var m=null;return p=p||0,p+=this.__position,p>=0&&p<this.__tokens_length&&(m=this.__tokens[p]),m},P.prototype.add=function(p){this.__parent_token&&(p.parent=this.__parent_token),this.__tokens.push(p),this.__tokens_length+=1},n.exports.TokenStream=P},function(n,P,p){var m=p(12).Pattern;function d(u,o){m.call(this,u,o),o?this._line_regexp=this._input.get_regexp(o._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}d.prototype=new m,d.prototype.__set_whitespace_patterns=function(u,o){u+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+u+o+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+o+"]")},d.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var u=this._input.read(this._match_pattern);if(u===" ")this.whitespace_before_token=" ";else if(u){var o=this.__split(this._newline_regexp,u);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return u},d.prototype.matching=function(u,o){var h=this._create();return h.__set_whitespace_patterns(u,o),h._update(),h},d.prototype._create=function(){return new d(this._input,this)},d.prototype.__split=function(u,o){u.lastIndex=0;for(var h=0,r=[],a=u.exec(o);a;)r.push(o.substring(h,a.index)),h=a.index+a[0].length,a=u.exec(o);return h<o.length?r.push(o.substring(h,o.length)):r.push(""),r},n.exports.WhitespacePattern=d},function(n){function P(p,m){this._input=p,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,m&&(this._starting_pattern=this._input.get_regexp(m._starting_pattern,!0),this._match_pattern=this._input.get_regexp(m._match_pattern,!0),this._until_pattern=this._input.get_regexp(m._until_pattern),this._until_after=m._until_after)}P.prototype.read=function(){var p=this._input.read(this._starting_pattern);return(!this._starting_pattern||p)&&(p+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),p},P.prototype.read_match=function(){return this._input.match(this._match_pattern)},P.prototype.until_after=function(p){var m=this._create();return m._until_after=!0,m._until_pattern=this._input.get_regexp(p),m._update(),m},P.prototype.until=function(p){var m=this._create();return m._until_after=!1,m._until_pattern=this._input.get_regexp(p),m._update(),m},P.prototype.starting_with=function(p){var m=this._create();return m._starting_pattern=this._input.get_regexp(p,!0),m._update(),m},P.prototype.matching=function(p){var m=this._create();return m._match_pattern=this._input.get_regexp(p,!0),m._update(),m},P.prototype._create=function(){return new P(this._input,this)},P.prototype._update=function(){},n.exports.Pattern=P},function(n){function P(p,m){p=typeof p=="string"?p:p.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+m,"g")}P.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var d=this.__directive_pattern.exec(p);d;)m[d[1]]=d[2],d=this.__directive_pattern.exec(p);return m},P.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=P},function(n,P,p){var m=p(12).Pattern,d={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function u(o,h){m.call(this,o,h),this.__template_pattern=null,this._disabled=Object.assign({},d),this._excluded=Object.assign({},d),h&&(this.__template_pattern=this._input.get_regexp(h.__template_pattern),this._excluded=Object.assign(this._excluded,h._excluded),this._disabled=Object.assign(this._disabled,h._disabled));var r=new m(o);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}/)}}u.prototype=new m,u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){this.__set_templated_pattern()},u.prototype.disable=function(o){var h=this._create();return h._disabled[o]=!0,h._update(),h},u.prototype.read_options=function(o){var h=this._create();for(var r in d)h._disabled[r]=o.templating.indexOf(r)===-1;return h._update(),h},u.prototype.exclude=function(o){var h=this._create();return h._excluded[o]=!0,h._update(),h},u.prototype.read=function(){var o="";this._match_pattern?o=this._input.read(this._starting_pattern):o=this._input.read(this._starting_pattern,this.__template_pattern);for(var h=this._read_template();h;)this._match_pattern?h+=this._input.read(this._match_pattern):h+=this._input.readUntil(this.__template_pattern),o+=h,h=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},u.prototype.__set_templated_pattern=function(){var o=[];this._disabled.php||o.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||o.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||o.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(o.push(this.__patterns.django._starting_pattern.source),o.push(this.__patterns.django_value._starting_pattern.source),o.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||o.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&o.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+o.join("|")+")")},u.prototype._read_template=function(){var o="",h=this._input.peek();if(h==="<"){var r=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&r==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&r==="%"&&(o=o||this.__patterns.erb.read())}else h==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(o=o||this.__patterns.handlebars_comment.read(),o=o||this.__patterns.handlebars_unescaped.read(),o=o||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(o=o||this.__patterns.django_value.read()),this._excluded.django||(o=o||this.__patterns.django_comment.read(),o=o||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(o=o||this.__patterns.smarty_comment.read(),o=o||this.__patterns.smarty_literal.read(),o=o||this.__patterns.smarty.read()));return o},n.exports.TemplatablePattern=u}],I={};function H(n){var P=I[n];if(P!==void 0)return P.exports;var p=I[n]={exports:{}};return F[n](p,p.exports,H),p.exports}var N=H(0);M=N})();var X=M;!(Q=[],z=function(){return{js_beautify:X}}.apply(le,Q),z!==void 0&&(Be.exports=z))})()},"6eGT":function(Be,le,D){"use strict";function Q(z){return null}le.a=Q},"7+5b":function(Be,le,D){Be.exports=D.p+"static/v.54a31e96.svg"},"746U":function(Be,le,D){"use strict";D.d(le,"f",function(){return Q}),D.d(le,"l",function(){return z}),D.d(le,"k",function(){return M}),D.d(le,"j",function(){return X}),D.d(le,"g",function(){return F}),D.d(le,"m",function(){return I}),D.d(le,"h",function(){return H}),D.d(le,"n",function(){return N}),D.d(le,"c",function(){return n}),D.d(le,"a",function(){return P}),D.d(le,"i",function(){return p}),D.d(le,"o",function(){return m}),D.d(le,"e",function(){return o}),D.d(le,"d",function(){return h}),D.d(le,"p",function(){return r}),D.d(le,"b",function(){return a});function Q(i){return Array.isArray(i)}function z(i){return typeof i=="string"}function M(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function X(i){return typeof i=="number"&&!isNaN(i)}function F(i){return i===!0||i===!1}function I(i){return typeof i=="undefined"}function H(i){return!N(i)}function N(i){return I(i)||i===null}function n(i,s){if(!i)throw new Error(s?`Unexpected type, expected '${s}'`:"Unexpected type")}function P(i){if(N(i))throw new Error("Assertion Failed: argument is undefined or null");return i}function p(i){return typeof i=="function"}function m(i,s){const S=Math.min(i.length,s.length);for(let x=0;x<S;x++)d(i[x],s[x])}function d(i,s){if(z(s)){if(typeof i!==s)throw new Error(`argument does not match constraint: typeof ${s}`)}else if(p(s)){try{if(i instanceof s)return}catch(S){}if(!N(i)&&i.constructor===s)return;if(s.length===1&&s.call(void 0,i)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function u(i){let s=[],S=Object.getPrototypeOf(i);for(;Object.prototype!==S;)s=s.concat(Object.getOwnPropertyNames(S)),S=Object.getPrototypeOf(S);return s}function o(i){const s=[];for(const S of u(i))typeof i[S]=="function"&&s.push(S);return s}function h(i,s){const S=T=>function(){const A=Array.prototype.slice.call(arguments,0);return s(T,A)};let x={};for(const T of i)x[T]=S(T);return x}function r(i){return i===null?void 0:i}function a(i,s="Unreachable"){throw new Error(s)}},"7Cbv":function(Be,le,D){"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 M(){if(!Q)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Q(z)}var X=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function F(d){return typeof d=="string"&&X.test(d)}for(var I=F,H=[],N=0;N<256;++N)H.push((N+256).toString(16).substr(1));function n(d){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=(H[d[u+0]]+H[d[u+1]]+H[d[u+2]]+H[d[u+3]]+"-"+H[d[u+4]]+H[d[u+5]]+"-"+H[d[u+6]]+H[d[u+7]]+"-"+H[d[u+8]]+H[d[u+9]]+"-"+H[d[u+10]]+H[d[u+11]]+H[d[u+12]]+H[d[u+13]]+H[d[u+14]]+H[d[u+15]]).toLowerCase();if(!I(o))throw TypeError("Stringified UUID is invalid");return o}var P=n;function p(d,u,o){d=d||{};var h=d.random||(d.rng||M)();if(h[6]=h[6]&15|64,h[8]=h[8]&63|128,u){o=o||0;for(var r=0;r<16;++r)u[o+r]=h[r];return u}return P(h)}var m=le.a=p},"7ahc":function(Be,le,D){"use strict";D.d(le,"a",function(){return S});var Q=D("k1fw"),z=D("0Owb"),M=D("+L6B"),X=D("2/Rp"),F=D("y8nQ"),I=D("Vl3Y"),H=D("tJVT"),N=D("OaEy"),n=D("2fM7"),P=D("q1tI"),p=D.n(P),m=D("VrN/"),d=D.n(m),u=D("p77/"),o=D.n(u),h=D("c5Ni"),r=D.n(h),a=n.a.Option,i={labelCol:{span:4},wrapperCol:{span:20}},s={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"]};le.b=function(x){var T=x.callback,A=x.onCancel,w=Object(P.useState)("python"),v=Object(H.a)(w,2),b=v[0],g=v[1];function f(E){g(s[E][1])}function C(E){T(E)}return p.a.createElement(I.a,Object(z.a)({},i,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:C}),p.a.createElement(I.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},p.a.createElement(n.a,{onChange:f},Object.keys(s).map(function(E){return p.a.createElement(a,{key:E,value:E},s[E][0])}))),p.a.createElement(I.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},p.a.createElement(S,{mode:b})),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(X.a,{type:"ghost",onClick:A},"\u53D6\u6D88")))};function S(x){var T=x.value,A=x.onChange,w=x.mode,v=x.options,b=v===void 0?{}:v,g=Object(P.useRef)(),f=Object(P.useState)(),C=Object(H.a)(f,2),E=C[0],_=C[1];return Object(P.useEffect)(function(){if(E){function U(j){var L=j.getValue();A&&A(L)}return E.on("change",U),function(){E.off("change",U)}}},[E,A]),Object(P.useEffect)(function(){E&&E.setOption("mode",w)},[E,w]),Object(P.useEffect)(function(){E&&((T!==E.getValue()||T==="")&&setTimeout(function(){E.setValue(T||" ")},300))},[E,T]),Object(P.useEffect)(function(){if(g.current&&!E){var U=d.a.fromTextArea(g.current,Object(Q.a)({mode:w,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},b));_(U)}},[g.current,E]),p.a.createElement("div",{className:"my-codemirror-container"},p.a.createElement("textarea",{ref:g}))}},"7ixt":function(Be,le,D){"use strict";D.d(le,"a",function(){return M});var Q={adjustX:1,adjustY:1},z=[0,0],M={left:{points:["cr","cl"],overflow:Q,offset:[-4,0],targetOffset:z},right:{points:["cl","cr"],overflow:Q,offset:[4,0],targetOffset:z},top:{points:["bc","tc"],overflow:Q,offset:[0,-4],targetOffset:z},bottom:{points:["tc","bc"],overflow:Q,offset:[0,4],targetOffset:z},topLeft:{points:["bl","tl"],overflow:Q,offset:[0,-4],targetOffset:z},leftTop:{points:["tr","tl"],overflow:Q,offset:[-4,0],targetOffset:z},topRight:{points:["br","tr"],overflow:Q,offset:[0,-4],targetOffset:z},rightTop:{points:["tl","tr"],overflow:Q,offset:[4,0],targetOffset:z},bottomRight:{points:["tr","br"],overflow:Q,offset:[0,4],targetOffset:z},rightBottom:{points:["bl","br"],overflow:Q,offset:[4,0],targetOffset:z},bottomLeft:{points:["tl","bl"],overflow:Q,offset:[0,4],targetOffset:z},leftBottom:{points:["br","bl"],overflow:Q,offset:[-4,0],targetOffset:z}},X=M},"7qur":function(Be,le,D){"use strict";D.d(le,"m",function(){return z}),D.d(le,"s",function(){return M}),D.d(le,"h",function(){return X}),D.d(le,"o",function(){return F}),D.d(le,"n",function(){return I}),D.d(le,"l",function(){return H}),D.d(le,"b",function(){return N}),D.d(le,"q",function(){return n}),D.d(le,"t",function(){return P}),D.d(le,"v",function(){return p}),D.d(le,"w",function(){return m}),D.d(le,"u",function(){return d}),D.d(le,"p",function(){return u}),D.d(le,"f",function(){return o}),D.d(le,"a",function(){return h}),D.d(le,"j",function(){return r}),D.d(le,"k",function(){return a}),D.d(le,"d",function(){return i}),D.d(le,"g",function(){return s}),D.d(le,"c",function(){return S}),D.d(le,"e",function(){return x}),D.d(le,"i",function(){return T}),D.d(le,"r",function(){return A});var Q=D("ErOA");function z(w){return Object(Q.c)("mypractices/".concat(w,".json"),{hidePopLogin:!0})}function M(w,v){return Object(Q.f)("mypractices/".concat(w,"/code_submit.json"),v)}function X(w,v){return Object(Q.c)("mypractices/".concat(w,"/code_debug.json"),v)}function F(w,v){return Object(Q.c)("mypractices/".concat(w,"/submit_records.json"),v)}function I(w){return Object(Q.c)("mypractices/record_detail.json",{id:w})}function H(w,v){return Object(Q.c)("mypractices/".concat(w,"/result.json"),{mode:v})}function N(w,v){return Object(Q.f)("mypractices/".concat(w,"/add_notes.json"),v)}function n(w,v){return Object(Q.f)("mypractices/".concat(w,"/restore_initial_code.json"),v)}function P(w,v){return Object(Q.f)("mypractices/".concat(w,"/sync_code.json"),v)}function p(w,v){return Object(Q.f)("mypractices/".concat(w,"/update_code.json"),v)}function m(w){return Object(Q.f)("mypractices/".concat(w,"/initial_codes.json"))}function d(w,v){return Object(Q.f)("discusses/".concat(w,"/plus.json"),v)}function u(w){return Object(Q.c)("practices/practices_list.json",w)}function o(w,v){return Object(Q.c)("practices/".concat(w,"/question_solution_articles"),v)}function h(w,v){return Object(Q.f)("practices/".concat(w,"/question_solution_articles"),v)}function r(w,v){return Object(Q.g)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active),v)}function a(w,v){return Object(Q.c)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active,"/edit"),v)}function i(w,v){return Object(Q.c)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active),v)}function s(w,v){return Object(Q.f)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active,"/set_authority_or_excellent"),v)}function S(w,v){return Object(Q.f)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active,"/praise_or_treads"),v)}function x(w,v){return Object(Q.f)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active,"/hide"))}function T(w,v){return Object(Q.b)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active),v)}function A(w,v){return Object(Q.f)("mypractices/".concat(w,"/update_practice_time_sum"),v)}},"815F":function(Be,le,D){"use strict";D.d(le,"e",function(){return H}),D.d(le,"c",function(){return n}),D.d(le,"d",function(){return P}),D.d(le,"a",function(){return m}),D.d(le,"f",function(){return d}),D.d(le,"b",function(){return u});var Q=D("KQm4"),z=D("VTBJ"),M=D("Ff2n"),X=D("Zm9Q"),F=D("Kwbf"),I=D("OZM5");function H(o,h){return o!=null?o:h}function N(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],h=new Map;function r(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(a||[]).forEach(function(s){var S=s.key,x=s.children;Object(F.a)(S!=null,"Tree node must have a certain key: [".concat(i).concat(S,"]"));var T=String(S);Object(F.a)(!h.has(T)||S===null||S===void 0,"Same 'key' exist in the Tree: ".concat(T)),h.set(T,!0),r(x,"".concat(i).concat(T," > "))})}r(o)}function n(o){function h(r){var a=Object(X.a)(r);return a.map(function(i){if(!Object(I.i)(i))return Object(F.a)(!i,"Tree/TreeNode can only accept TreeNode as children."),null;var s=i.key,S=i.props,x=S.children,T=Object(M.a)(S,["children"]),A=Object(z.a)({key:s},T),w=h(x);return w.length&&(A.children=w),A}).filter(function(i){return i})}return h(o)}function P(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=new Set(h===!0?[]:h),a=[];function i(s){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return s.map(function(x,T){var A=Object(I.h)(S?S.pos:"0",T),w=H(x.key,A),v=Object(z.a)(Object(z.a)({},x),{},{parent:S,pos:A,children:null,data:x,isStart:[].concat(Object(Q.a)(S?S.isStart:[]),[T===0]),isEnd:[].concat(Object(Q.a)(S?S.isEnd:[]),[T===s.length-1])});return a.push(v),h===!0||r.has(w)?v.children=i(x.children||[],v):v.children=[],v})}return i(o),a}function p(o,h,r){var a;r?typeof r=="string"?a=function(S){return S[r]}:typeof r=="function"&&(a=function(S){return r(S)}):a=function(S,x){return H(S.key,x)};function i(s,S,x){var T=s?s.children:o,A=s?Object(I.h)(x.pos,S):"0";if(s){var w=a(s,A),v={node:s,index:S,pos:A,key:w,parentPos:x.node?x.pos:null,level:x.level+1};h(v)}T&&T.forEach(function(b,g){i(b,g,{node:s,pos:A,level:x?x.level+1:-1})})}i(null)}function m(o){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=h.initWrapper,a=h.processEntity,i=h.onProcessFinished,s=arguments.length>2?arguments[2]:void 0,S={},x={},T={posEntities:S,keyEntities:x};return r&&(T=r(T)||T),p(o,function(A){var w=A.node,v=A.index,b=A.pos,g=A.key,f=A.parentPos,C=A.level,E={node:w,index:v,key:g,pos:b,level:C},_=H(g,b);S[b]=E,x[_]=E,E.parent=S[f],E.parent&&(E.parent.children=E.parent.children||[],E.parent.children.push(E)),a&&a(E,T)},s),i&&i(T),T}function d(o,h){var r=h.expandedKeys,a=h.selectedKeys,i=h.loadedKeys,s=h.loadingKeys,S=h.checkedKeys,x=h.halfCheckedKeys,T=h.dragOverNodeKey,A=h.dropPosition,w=h.keyEntities,v=w[o],b={eventKey:o,expanded:r.indexOf(o)!==-1,selected:a.indexOf(o)!==-1,loaded:i.indexOf(o)!==-1,loading:s.indexOf(o)!==-1,checked:S.indexOf(o)!==-1,halfChecked:x.indexOf(o)!==-1,pos:String(v?v.pos:""),dragOver:T===o&&A===0,dragOverGapTop:T===o&&A===-1,dragOverGapBottom:T===o&&A===1};return b}function u(o){var h=o.data,r=o.expanded,a=o.selected,i=o.checked,s=o.loaded,S=o.loading,x=o.halfChecked,T=o.dragOver,A=o.dragOverGapTop,w=o.dragOverGapBottom,v=o.pos,b=o.active,g=Object(z.a)(Object(z.a)({},h),{},{expanded:r,selected:a,checked:i,loaded:s,loading:S,halfChecked:x,dragOver:T,dragOverGapTop:A,dragOverGapBottom:w,pos:v,active:b});return"props"in g||Object.defineProperty(g,"props",{get:function(){return Object(F.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),o}}),g}},"8EBN":function(Be,le,D){(function(Q){Q(D("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 M=Q.modeInfo[z];M.mimes&&(M.mime=M.mimes[0])}Q.findModeByMIME=function(X){X=X.toLowerCase();for(var F=0;F<Q.modeInfo.length;F++){var I=Q.modeInfo[F];if(I.mime==X)return I;if(I.mimes){for(var H=0;H<I.mimes.length;H++)if(I.mimes[H]==X)return I}}if(/\+xml$/.test(X))return Q.findModeByMIME("application/xml");if(/\+json$/.test(X))return Q.findModeByMIME("application/json")},Q.findModeByExtension=function(X){X=X.toLowerCase();for(var F=0;F<Q.modeInfo.length;F++){var I=Q.modeInfo[F];if(I.ext){for(var H=0;H<I.ext.length;H++)if(I.ext[H]==X)return I}}},Q.findModeByFileName=function(X){for(var F=0;F<Q.modeInfo.length;F++){var I=Q.modeInfo[F];if(I.file&&I.file.test(X))return I}var H=X.lastIndexOf("."),N=H>-1&&X.substring(H+1,X.length);if(N)return Q.findModeByExtension(N)},Q.findModeByName=function(X){X=X.toLowerCase();for(var F=0;F<Q.modeInfo.length;F++){var I=Q.modeInfo[F];if(I.name.toLowerCase()==X)return I;if(I.alias){for(var H=0;H<I.alias.length;H++)if(I.alias[H].toLowerCase()==X)return I}}}})},"8HAY":function(Be,le,D){"use strict";D.d(le,"a",function(){return F}),D.d(le,"b",function(){return I}),D.d(le,"d",function(){return H}),D.d(le,"e",function(){return N}),D.d(le,"c",function(){return n});var Q=D("MI8n"),z=D("pmY6"),M=D("3/fG"),X=function(P,p,m,d){function u(o){return o instanceof m?o:new m(function(h){h(o)})}return new(m||(m=Promise))(function(o,h){function r(s){try{i(d.next(s))}catch(S){h(S)}}function a(s){try{i(d.throw(s))}catch(S){h(S)}}function i(s){s.done?o(s.value):u(s.value).then(r,a)}i((d=d.apply(P,p||[])).next())})};class F extends z.a{constructor(P,p="",m="",d=!0,u){super();this._onDidChange=this._register(new Q.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=P,this._label=p,this._cssClass=m,this._enabled=d,this._actionCallback=u}get id(){return this._id}get label(){return this._label}set label(P){this._setLabel(P)}_setLabel(P){this._label!==P&&(this._label=P,this._onDidChange.fire({label:P}))}get tooltip(){return this._tooltip||""}set tooltip(P){this._setTooltip(P)}_setTooltip(P){this._tooltip!==P&&(this._tooltip=P,this._onDidChange.fire({tooltip:P}))}get class(){return this._cssClass}set class(P){this._setClass(P)}_setClass(P){this._cssClass!==P&&(this._cssClass=P,this._onDidChange.fire({class:P}))}get enabled(){return this._enabled}set enabled(P){this._setEnabled(P)}_setEnabled(P){this._enabled!==P&&(this._enabled=P,this._onDidChange.fire({enabled:P}))}get checked(){return this._checked}set checked(P){this._setChecked(P)}_setChecked(P){this._checked!==P&&(this._checked=P,this._onDidChange.fire({checked:P}))}run(P,p){return X(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(P))})}}class I 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(P,p){return X(this,void 0,void 0,function*(){if(!P.enabled)return;this._onBeforeRun.fire({action:P});let m;try{yield this.runAction(P,p)}catch(d){m=d}this._onDidRun.fire({action:P,error:m})})}runAction(P,p){return X(this,void 0,void 0,function*(){yield P.run(p)})}}class H extends F{constructor(P){super(H.ID,P,P?"separator text":"separator");this.checked=!1,this.enabled=!1}}H.ID="vs.actions.separator";class N{constructor(P,p,m,d){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=P,this.label=p,this.class=d,this._actions=m}get actions(){return this._actions}dispose(){}run(){return X(this,void 0,void 0,function*(){})}}class n extends F{constructor(){super(n.ID,M.a("submenu.empty","(empty)"),void 0,!1)}}n.ID="vs.actions.empty"},"8hTe":function(Be,le,D){Be.exports={button:"button___1wy9m"}},"9+Du":function(Be,le,D){"use strict";var Q=D("k1fw"),z=D("9og8"),M=D("tJVT"),X=D("WmNS"),F=D.n(X),I=D("q1tI"),H=D.n(I),N=D("ErOA"),n=D("7Cbv"),P=D("TSYQ"),p=D.n(P),m=D("vef1"),d=D.n(m),u=function(h,r){var a=h.chunkSize,i=a===void 0?1024*1024*2:a,s=h.options,S=s===void 0?{}:s,x=h.onCancel,T=h.onComplete,A=h.onError,w=h.onProgress,v=h.onBefore,b=h.onBeginInitFile,g=h.children,f=h.accept,C=h.className,E=h.style,_=E===void 0?{}:E,U=h.concurrency,j=U===void 0?4:U,L=Object(I.useState)("ready"),G=Object(M.a)(L,2),B=G[0],O=G[1],V=Object(I.useState)(0),te=Object(M.a)(V,2),re=te[0],ge=te[1],Ae=Object(I.useState)(""),Oe=Object(M.a)(Ae,2),Ce=Oe[0],je=Oe[1],Ue=Object(I.useState)(null),xe=Object(M.a)(Ue,2),be=xe[0],Ve=xe[1],mt=Object(I.useRef)(null),yt=Object(I.useRef)(Object(n.a)()),_t=Object(I.useRef)(!1);Object(I.useImperativeHandle)(r,function(){return{cancel:ct,file:be,uploadStatus:B}});var xt=function(){var Me=document.getElementById(yt.current);Me&&(Me.value="")},nt=function(){var _e=Object(z.a)(F.a.mark(function Me(ve){var Te,We;return F.a.wrap(function(at){for(;;)switch(at.prev=at.next){case 0:if(!(B==="uploading")){at.next=2;break}return at.abrupt("return");case 2:return b&&b(ve),Te=ve.size,We=Math.ceil(Te/i),_t.current=!1,O("uploading"),ge(0),je(""),at.prev=9,at.delegateYield(F.a.mark(function dt(){var Lt,It,Ne,ke,it,ot,Ge,$e,we,Se,Ee,ue;return F.a.wrap(function(ye){for(;;)switch(ye.prev=ye.next){case 0:return ye.next=2,Object(N.a)("/api/attachments/multipart_upload_start",{method:"POST",body:Object(Q.a)({fileName:ve.name,chunkCount:We},S)});case 2:if(Lt=ye.sent,!(_t.current||(Lt==null?void 0:Lt.status)!==0)){ye.next=5;break}throw new Error;case 5:for(It=Lt.upload_id,mt.current=new AbortController,Ne=[],ke=0,it=function(Le){var Xe=Le*i,ut=Math.min(Xe+i,Te),Dt=ve.slice(Xe,ut),jt=new FormData;jt.append("chunk",Dt),jt.append("fileName",ve.name),jt.append("chunkIndex",(Le+1).toString()),jt.append("uploadId",It);for(var Ut in S)Object.prototype.hasOwnProperty.call(S,Ut)&&jt.append(Ut,S[Ut]);Ne.push(function(){return Object(N.a)("/api/attachments/multipart_upload",{method:"POST",body:jt,signal:mt.current.signal},!0).then(function(Ct){ke++;var et=Math.round(ke/We*100);ge(et),w&&w(Object(Q.a)(Object(Q.a)({},Ct),{},{file:ve,percent:et}))})})},ot=0;ot<We;ot++)it(ot);Ge=0,$e=j;case 13:if(!(Ge<Ne.length)){ye.next=22;break}if(Se=(we=Ne.slice(Ge,Ge+$e))===null||we===void 0?void 0:we.map(function(me){return me()}),!(Se.length>0)){ye.next=20;break}return ye.next=18,Promise.all(Se);case 18:Ee=ye.sent,Ge+=$e;case 20:ye.next=13;break;case 22:return ye.next=24,Object(N.a)("/api/attachments/multipart_upload_end",{method:"POST",body:Object(Q.a)({fileName:ve.name,chunkCount:We,uploadId:It},S)});case 24:ue=ye.sent,ue.object?(O("success"),xt(),T&&T(Object(Q.a)(Object(Q.a)({},ue),{},{file:ve,percent:100}))):(O("error"),je("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"),xt(),A&&A(ve.name));case 26:case"end":return ye.stop()}},dt)})(),"t0",11);case 11:at.next=19;break;case 13:at.prev=13,at.t1=at.catch(9),O("error"),je("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"),xt(),A&&A(ve.name);case 19:case"end":return at.stop()}},Me,null,[[9,13]])}));return function(ve){return _e.apply(this,arguments)}}(),ct=Object(I.useCallback)(function(){_t.current=!0,mt.current&&(mt.current.abort(),x&&x())},[x]),wt=function(Me){var ve,Te,We=Me==null||((ve=Me.target)===null||ve===void 0||((Te=ve.files)===null||Te===void 0))?void 0:Te[0];if(Ve(We),B="ready",!We)return;if(v){var Je=v(We);Je||nt(We),xt();return}nt(We)};return H.a.createElement(I.Fragment,null,H.a.createElement("input",{type:"file",id:yt.current,style:{display:"none"},onChange:wt,accept:f}),H.a.createElement("label",{className:p()(d.a.upload,C),htmlFor:yt.current,style:_},g))};le.a=Object(I.forwardRef)(u)},"9Bee":function(Be,le,D){"use strict";var Q=D("DYRE"),z=D("zeV3"),M=D("+L6B"),X=D("2/Rp"),F=D("k1fw"),I=D("9og8"),H=D("tJVT"),N=D("WmNS"),n=D.n(N),P=D("q1tI"),p=D.n(P),m=D("vg9a"),d=D("DlQD"),u=D.n(d),o=D("rUJ1");function h(J,R){var k=J.match(/^(\s+)(?:```)/);if(k===null)return R;var Y=k[1];return R.split(`
|
|
`).map(function(ae){var q=ae.match(/^\s+/);if(q===null)return ae;var Ie=Object(H.a)(q,1),ht=Ie[0];return ht.length>=Y.length?ae.slice(Y.length):ae}).join(`
|
|
`)}var r=[],a=["<ul>"],i=new u.a.Renderer,s=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function S(){r.length=0,a=["<ul>"]}var x={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function T(J,R,k,Y){if(R>=J.length||J[R].level<=k)return R;var ae=J[R];Y.push("<li><a href='#"+ae.anchor+"'>"+ae.text+"</a>"),R++;var q=[];return R=T(J,R,ae.level,q),q.length>0&&(Y.push("<ul>"),q.forEach(function(Ie){Y.push(Ie)}),Y.push("</ul>")),Y.push("</li>"),R=T(J,R,k,Y),R}function A(){return T(r,0,0,a),a.push("</ul>"),a.join("")}var w={heading:function(R){var k=s.exec(R);if(k)return{type:"heading",raw:k[0],depth:k[1].length,text:k[2]}},fences:function(R){var k=this.rules.block.fences.exec(R);if(k){var Y=k[0],ae=h(Y,k[3]||""),q=k[2]?k[2].trim():k[2];if(["latex","katex","math"].indexOf(q)>=0){var Ie=g(),ht=ae;ae=Ie,f[Ie]={type:"block",expression:ht}}return{type:"code",raw:Y,lang:q,text:ae}}}},v=/(?:\${2})([^\n`]+?)(?:\${2})/gi,b=0,g=function(){return"__special_katext_id_".concat(b++,"__")},f={};function C(){return f}function E(){b=0,f={}}function _(J){return J=J.replace(v,function(R,k){var Y=g();return f[Y]={type:"inline",expression:k},Y}),J}var U=i.listitem;i.listitem=function(J){return U(_(J))};var j=i.paragraph;i.paragraph=function(J){return j(_(J))};var L=i.tablecell;i.tablecell=function(J,R){return L(_(J),R)},i.code=function(J,R,k){var Y=(R||"").match(/\S*/)[0];return Y?["latex","katex","math"].indexOf(Y)>=0?"<p class='editormd-tex'>".concat(J,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(R,'">').concat(k?J:Object(o.escape)(J,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(k?J:Object(o.escape)(J,!0))+"</code></pre>"},i.heading=function(J,R,k){var Y=this.options.headerPrefix+k.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return r.push({anchor:Y,level:R,text:J}),"<h"+R+' id="'+Y+'">'+J+"</h"+R+">"},u.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),u.a.use({tokenizer:w,renderer:i});var G=u.a,B=D("SJMd"),O=D("ulZh"),V=D.n(O),te=D("m3rI"),re=D("Oy/b"),ge=D("p5ED"),Ae=D("ErOA");/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var Oe=function(J,R){return(Oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,Y){k.__proto__=Y}||function(k,Y){for(var ae in Y)Object.prototype.hasOwnProperty.call(Y,ae)&&(k[ae]=Y[ae])})(J,R)};function Ce(J,R){function k(){this.constructor=J}Oe(J,R),J.prototype=R===null?Object.create(R):(k.prototype=R.prototype,new k)}function je(J,R,k,Y){return new(k||(k=Promise))(function(ae,q){function Ie($t){try{Ot(Y.next($t))}catch(ft){q(ft)}}function ht($t){try{Ot(Y.throw($t))}catch(ft){q(ft)}}function Ot($t){var ft;$t.done?ae($t.value):(ft=$t.value,ft instanceof k?ft:new k(function(zt){zt(ft)})).then(Ie,ht)}Ot((Y=Y.apply(J,R||[])).next())})}function Ue(J,R){var k,Y,ae,q,Ie={label:0,sent:function(){if(1&ae[0])throw ae[1];return ae[1]},trys:[],ops:[]};return q={next:ht(0),throw:ht(1),return:ht(2)},typeof Symbol=="function"&&(q[Symbol.iterator]=function(){return this}),q;function ht(Ot){return function($t){return function(ft){if(k)throw new TypeError("Generator is already executing.");for(;Ie;)try{if(k=1,Y&&(ae=2&ft[0]?Y.return:ft[0]?Y.throw||((ae=Y.return)&&ae.call(Y),0):Y.next)&&!(ae=ae.call(Y,ft[1])).done)return ae;switch(Y=0,ae&&(ft=[2&ft[0],ae.value]),ft[0]){case 0:case 1:ae=ft;break;case 4:return Ie.label++,{value:ft[1],done:!1};case 5:Ie.label++,Y=ft[1],ft=[0];continue;case 7:ft=Ie.ops.pop(),Ie.trys.pop();continue;default:if(!(ae=Ie.trys,(ae=ae.length>0&&ae[ae.length-1])||ft[0]!==6&&ft[0]!==2)){Ie=0;continue}if(ft[0]===3&&(!ae||ft[1]>ae[0]&&ft[1]<ae[3])){Ie.label=ft[1];break}if(ft[0]===6&&Ie.label<ae[1]){Ie.label=ae[1],ae=ft;break}if(ae&&Ie.label<ae[2]){Ie.label=ae[2],Ie.ops.push(ft);break}ae[2]&&Ie.ops.pop(),Ie.trys.pop();continue}ft=R.call(J,Ie)}catch(zt){ft=[6,zt],Y=0}finally{k=ae=0}if(5&ft[0])throw ft[1];return{value:ft[0]?ft[1]:void 0,done:!0}}([Ot,$t])}}}function xe(){for(var J=0,R=0,k=arguments.length;R<k;R++)J+=arguments[R].length;var Y=Array(J),ae=0;for(R=0;R<k;R++)for(var q=arguments[R],Ie=0,ht=q.length;Ie<ht;Ie++,ae++)Y[ae]=q[Ie];return Y}var be=function(){function J(){}return J.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},J.setAttributes=function(R,k){for(var Y=0,ae=k;Y<ae.length;Y++){var q=ae[Y],Ie=q[0],ht=q[1];R.setAttribute(Ie,ht)}},J.createRect=function(R,k,Y){var ae=document.createElementNS("http://www.w3.org/2000/svg","rect");return ae.setAttribute("width",R.toString()),ae.setAttribute("height",k.toString()),Y&&J.setAttributes(ae,Y),ae},J.createLine=function(R,k,Y,ae,q){var Ie=document.createElementNS("http://www.w3.org/2000/svg","line");return Ie.setAttribute("x1",R.toString()),Ie.setAttribute("y1",k.toString()),Ie.setAttribute("x2",Y.toString()),Ie.setAttribute("y2",ae.toString()),q&&J.setAttributes(Ie,q),Ie},J.createPolygon=function(R,k){var Y=document.createElementNS("http://www.w3.org/2000/svg","polygon");return Y.setAttribute("points",R),k&&J.setAttributes(Y,k),Y},J.createCircle=function(R,k){var Y=document.createElementNS("http://www.w3.org/2000/svg","circle");return Y.setAttribute("cx",(R/2).toString()),Y.setAttribute("cy",(R/2).toString()),Y.setAttribute("r",R.toString()),k&&J.setAttributes(Y,k),Y},J.createEllipse=function(R,k,Y){var ae=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ae.setAttribute("cx",(R/2).toString()),ae.setAttribute("cy",(k/2).toString()),ae.setAttribute("rx",(R/2).toString()),ae.setAttribute("ry",(k/2).toString()),Y&&J.setAttributes(ae,Y),ae},J.createGroup=function(R){var k=document.createElementNS("http://www.w3.org/2000/svg","g");return R&&J.setAttributes(k,R),k},J.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},J.createMarker=function(R,k,Y,ae,q,Ie,ht){var Ot=document.createElementNS("http://www.w3.org/2000/svg","marker");return J.setAttributes(Ot,[["id",R],["orient",k],["markerWidth",Y.toString()],["markerHeight",ae.toString()],["refX",q.toString()],["refY",Ie.toString()]]),Ot.appendChild(ht),Ot},J.createText=function(R){var k=document.createElementNS("http://www.w3.org/2000/svg","text");return k.setAttribute("x","0"),k.setAttribute("y","0"),R&&J.setAttributes(k,R),k},J.createTSpan=function(R,k){var Y=document.createElementNS("http://www.w3.org/2000/svg","tspan");return Y.textContent=R,k&&J.setAttributes(Y,k),Y},J.createImage=function(R){var k=document.createElementNS("http://www.w3.org/2000/svg","image");return R&&J.setAttributes(k,R),k},J.createPoint=function(R,k){var Y=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return Y.x=R,Y.y=k,Y},J.createPath=function(R,k){var Y=document.createElementNS("http://www.w3.org/2000/svg","path");return Y.setAttribute("d",R),k&&J.setAttributes(Y,k),Y},J}(),Ve=function(){function J(){}return J.addKey=function(R){J.key=R},Object.defineProperty(J,"isLicensed",{get:function(){return!!J.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(J.key)},enumerable:!1,configurable:!0}),J}(),mt=function(){function J(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return J.prototype.rasterize=function(R,k,Y){var ae=this;return new Promise(function(q){var Ie=Y!==void 0?Y:document.createElement("canvas");R===null&&(ae.markersOnly=!0,ae.naturalSize=!1);var ht=document.createElementNS("http://www.w3.org/2000/svg","svg");ht.setAttribute("xmlns","http://www.w3.org/2000/svg"),ht.setAttribute("width",k.width.baseVal.valueAsString),ht.setAttribute("height",k.height.baseVal.valueAsString),ht.setAttribute("viewBox","0 0 "+k.viewBox.baseVal.width.toString()+" "+k.viewBox.baseVal.height.toString()),ht.innerHTML=k.innerHTML,ae.naturalSize===!0?(ht.width.baseVal.value=R.naturalWidth,ht.height.baseVal.value=R.naturalHeight):ae.width!==void 0&&ae.height!==void 0&&(ht.width.baseVal.value=ae.width,ht.height.baseVal.value=ae.height),Ie.width=ht.width.baseVal.value,Ie.height=ht.height.baseVal.value;var Ot=ht.outerHTML,$t=Ie.getContext("2d");ae.markersOnly!==!0&&$t.drawImage(R,0,0,Ie.width,Ie.height);var ft=window.URL,zt=new Image(Ie.width,Ie.height);zt.setAttribute("crossOrigin","anonymous");var on=new Blob([Ot],{type:"image/svg+xml"}),Wn=ft.createObjectURL(on);zt.onload=function(){$t.drawImage(zt,0,0),ft.revokeObjectURL(Wn);var Si=Ie.toDataURL(ae.imageType,ae.imageQuality);q(Si)},zt.src=Wn})},J}(),yt=function(){},_t=function(){function J(R){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+R+"_"}return Object.defineProperty(J.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(J.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(J.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),J.prototype.addClass=function(R){return this.styleSheet===void 0&&this.addStyleSheet(),R.name=""+this.classNamePrefix+R.localName,this.classes.push(R),this.styleSheet.sheet.insertRule("."+R.name+" {"+R.style+"}",this.styleSheet.sheet.cssRules.length),R},J.prototype.addRule=function(R){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(R),this.styleSheet.sheet.insertRule(R.selector+" {"+R.style+"}",this.styleSheet.sheet.cssRules.length)},J.prototype.addStyleSheet=function(){var R;this.styleSheet=document.createElement("style"),((R=this.styleSheetRoot)!==null&&R!==void 0?R:document.head).appendChild(this.styleSheet),this.addRule(new xt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new xt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new xt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new nt("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new nt("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},J.prototype.removeStyleSheet=function(){var R;this.styleSheet&&(((R=this.styleSheetRoot)!==null&&R!==void 0?R:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},J}(),xt=function(J,R){this.selector=J,this.style=R},nt=function(J,R){this.localName=J,this.style=R},ct=function(){function J(R,k,Y,ae,q){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=R,this.displayMode=k,this.markerItems=Y,this.uiStyleSettings=ae,this.styles=q,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return J.prototype.show=function(R){var k=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=R,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var Y=document.createElement("div");Y.className=this.toolbarBlockStyleClass.name,Y.style.whiteSpace="nowrap",this.uiContainer.appendChild(Y),this.addActionButton(Y,'<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(Y,'<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(Y,'<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(Y,'<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(Y,'<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(Y,'<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(Y,'<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(Y,'<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(q){var Ie=document.createElement("div");Ie.className=""+k.toolbarButtonStyleClass.name,Ie.setAttribute("data-type-name",q.typeName),Ie.innerHTML=q.icon,Ie.addEventListener("click",function(){k.markerToolbarButtonClicked(Ie,q)}),k.buttons.push(Ie),k.markerButtons.push(Ie)}),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 ae=document.createElement("div");ae.className=this.toolbarBlockStyleClass.name,ae.style.whiteSpace="nowrap",ae.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ae),this.addActionButton(ae,'<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(ae,'<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()},J.prototype.addButtonClickListener=function(R){this.buttonClickListeners.push(R)},J.prototype.removeButtonClickListener=function(R){this.buttonClickListeners.indexOf(R)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(R),1)},J.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},J.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var R=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var k=0;k<this.markerButtons.length;k++)k<R||k===R&&this.markerButtons.length-1===R?this.markerButtonBlock.appendChild(this.markerButtons[k]):(k===R&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[k]))}},J.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")},J.prototype.resetButtonStyles=function(){var R=this;this.buttons.forEach(function(k){k.className=k.className.replace(R.uiStyleSettings.toolbarButtonStyleColorsClassName?R.uiStyleSettings.toolbarButtonStyleColorsClassName:R.toolbarButtonStyleColorsClass.name,"").trim(),k.className=k.className.replace(R.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?R.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:R.toolbarActiveButtonStyleColorsClass.name,"").trim(),k.className+=" "+(R.uiStyleSettings.toolbarButtonStyleColorsClassName?R.uiStyleSettings.toolbarButtonStyleColorsClassName:R.toolbarButtonStyleColorsClass.name)})},J.prototype.addActionButton=function(R,k,Y){var ae=this,q=document.createElement("div");switch(q.className=""+this.toolbarButtonStyleClass.name,q.innerHTML=k,q.setAttribute("data-action",Y),q.addEventListener("click",function(){ae.actionToolbarButtonClicked(q,Y)}),Y){case"select":q.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":q.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":q.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":q.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":q.style.fill=this.uiStyleSettings.closeButtonColor}R.appendChild(q),this.buttons.push(q)},J.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new nt("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 nt("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new nt("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new nt("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 nt("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var R=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new nt("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*R)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*R)+`px;
|
|
padding: `+R+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new nt("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new nt("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new xt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new xt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},J.prototype.markerToolbarButtonClicked=function(R,k){this.setActiveButton(R),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Y){return Y("marker",k)}),this.markerButtonOverflowBlock.style.display="none"},J.prototype.actionToolbarButtonClicked=function(R,k){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Y){return Y("action",k)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},J.prototype.setActiveButton=function(R){this.resetButtonStyles(),R.className=R.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),R.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},J.prototype.setActiveMarkerButton=function(R){var k=this.markerButtons.find(function(Y){return Y.getAttribute("data-type-name")===R});k&&this.setActiveButton(k)},J.prototype.setCurrentMarker=function(R){var k=this;this.currentMarker=R,this.buttons.filter(function(Y){return/delete|notes/.test(Y.getAttribute("data-action"))}).forEach(function(Y){k.currentMarker===void 0?(Y.style.fillOpacity="0.4",Y.style.pointerEvents="none"):(Y.style.fillOpacity="1",Y.style.pointerEvents="all")})},J}(),wt=function(){function J(R,k,Y,ae){this.panels=[],this.panelButtons=[],this.markerjsContainer=R,this.displayMode=k,this.uiStyleSettings=Y,this.styles=ae,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return J.prototype.addStyles=function(){var R;this.toolboxStyleClass=this.styles.addClass(new nt("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 nt("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var k=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new nt("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new nt("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new nt("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 nt("toolbox-panel-row_colors",`
|
|
background-color: `+((R=this.uiStyleSettings.toolboxBackgroundColor)!==null&&R!==void 0?R:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new nt("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
|
|
padding: `+k+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new nt("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new nt("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new xt("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new xt("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},J.prototype.show=function(R){var k;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=R,this.uiContainer.className=this.toolboxStyleClass.name+" "+((k=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},J.prototype.setPanelButtons=function(R){var k,Y,ae=this;this.panels=R,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((k=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((Y=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&Y!==void 0?Y:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(q){var Ie;q.uiStyleSettings=ae.uiStyleSettings;var ht=document.createElement("div");ht.className=ae.toolboxButtonStyleClass.name+" "+((Ie=ae.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ie!==void 0?Ie:ae.toolboxButtonStyleColorsClass.name),ht.innerHTML=q.icon,ht.title=q.title,ht.addEventListener("click",function(){ae.panelButtonClick(q)}),ae.panelButtons.push(ht),ae.buttonRow.appendChild(ht)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},J.prototype.panelButtonClick=function(R){var k=this,Y=-1;if(R!==this.activePanel){Y=this.panels.indexOf(R),this.panelRow.innerHTML="";var ae=R.getUi();ae.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ae),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=R}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){k.displayMode==="inline"?k.panelRow.style.display="none":k.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(q,Ie){var ht,Ot;q.className=k.toolboxButtonStyleClass.name+" "+(Ie===Y?""+((ht=k.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&ht!==void 0?ht:k.toolboxActiveButtonStyleColorsClass.name):""+((Ot=k.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ot!==void 0?Ot:k.toolboxButtonStyleColorsClass.name))})},J}(),_e=function(J,R){this.title=J,this.icon=R},Me=function(J){function R(k,Y,ae,q){var Ie=J.call(this,k,q||'<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 Ie.colors=[],Ie.addTransparent=!1,Ie.colorBoxes=[],Ie.colors=Y,Ie.currentColor=ae,Ie.setCurrentColor=Ie.setCurrentColor.bind(Ie),Ie.getColorBox=Ie.getColorBox.bind(Ie),Ie}return Ce(R,J),R.prototype.getUi=function(){var k=this,Y=document.createElement("div");return Y.style.overflow="hidden",Y.style.whiteSpace="nowrap",this.colors.forEach(function(ae){var q=k.getColorBox(ae);Y.appendChild(q),k.colorBoxes.push(q)}),Y},R.prototype.getColorBox=function(k){var Y=this,ae=this.uiStyleSettings.toolbarHeight/4,q=this.uiStyleSettings.toolbarHeight-ae,Ie=document.createElement("div");Ie.style.display="inline-block",Ie.style.boxSizing="content-box",Ie.style.width=q-2+"px",Ie.style.height=q-2+"px",Ie.style.padding="1px",Ie.style.marginRight="2px",Ie.style.marginBottom="2px",Ie.style.borderWidth="2px",Ie.style.borderStyle="solid",Ie.style.borderRadius=(q+2)/2+"px",Ie.style.borderColor=k===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ie.addEventListener("click",function(){Y.setCurrentColor(k,Ie)});var ht=document.createElement("div");return ht.style.display="inline-block",ht.style.width=q-2+"px",ht.style.height=q-2+"px",ht.style.backgroundColor=k,ht.style.borderRadius=q/2+"px",k==="transparent"&&(ht.style.fill=this.uiStyleSettings.toolboxAccentColor,ht.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>`),Ie.appendChild(ht),Ie},R.prototype.setCurrentColor=function(k,Y){var ae=this;this.currentColor=k,this.colorBoxes.forEach(function(q){q.style.borderColor=q===Y?ae.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(k)},R}(_e),ve=function(){function J(R,k,Y){this._state="new",this._isSelected=!1,this._container=R,this._overlayContainer=k,this.globalSettings=Y,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(J.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),J.prototype.ownsTarget=function(R){return!1},Object.defineProperty(J.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),J.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},J.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},J.prototype.pointerDown=function(R,k){},J.prototype.dblClick=function(R,k){},J.prototype.manipulate=function(R){},J.prototype.pointerUp=function(R){this.stateChanged()},J.prototype.dispose=function(){},J.prototype.addMarkerVisualToContainer=function(R){this.container.childNodes.length>0?this.container.insertBefore(R,this.container.childNodes[0]):this.container.appendChild(R)},J.prototype.getState=function(){return{typeName:J.typeName,state:this.state,notes:this.notes}},J.prototype.restoreState=function(R){this._state=R.state,this.notes=R.notes},J.prototype.scale=function(R,k){},J.prototype.colorChanged=function(R){this.onColorChanged&&this.onColorChanged(R),this.stateChanged()},J.prototype.fillColorChanged=function(R){this.onFillColorChanged&&this.onFillColorChanged(R),this.stateChanged()},J.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var R=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),R.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(R)&&this.onStateChanged(this)}},J.typeName="MarkerBase",J}(),Te=function(){function J(){this.findGripByVisual=this.findGripByVisual.bind(this)}return J.prototype.findGripByVisual=function(R){return this.topLeft.ownsTarget(R)?this.topLeft:this.topCenter.ownsTarget(R)?this.topCenter:this.topRight.ownsTarget(R)?this.topRight:this.centerLeft.ownsTarget(R)?this.centerLeft:this.centerRight.ownsTarget(R)?this.centerRight:this.bottomLeft.ownsTarget(R)?this.bottomLeft:this.bottomCenter.ownsTarget(R)?this.bottomCenter:this.bottomRight.ownsTarget(R)?this.bottomRight:void 0},J}(),We=function(){function J(){this.GRIP_SIZE=10,this.visual=be.createGroup(),this.visual.appendChild(be.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(be.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return J.prototype.ownsTarget=function(R){return R===this.visual||R===this.visual.childNodes[0]||R===this.visual.childNodes[1]},J}(),Je=function(){function J(){}return J.toITransformMatrix=function(R){return{a:R.a,b:R.b,c:R.c,d:R.d,e:R.e,f:R.f}},J.toSVGMatrix=function(R,k){return R.a=k.a,R.b=k.b,R.c=k.c,R.d=k.d,R.e=k.e,R.f=k.f,R},J}(),at=function(J){function R(k,Y,ae){var q=J.call(this,k,Y,ae)||this;return q.left=0,q.top=0,q.width=0,q.height=0,q.defaultSize={x:50,y:20},q.offsetX=0,q.offsetY=0,q.rotationAngle=0,q.CB_DISTANCE=10,q._suppressMarkerCreateEvent=!1,q.container.transform.baseVal.appendItem(be.createTransform()),q.setupControlBox(),q}return Ce(R,J),Object.defineProperty(R.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"visual",{get:function(){return this._visual},set:function(k){this._visual=k;var Y=be.createTransform();this._visual.transform.baseVal.appendItem(Y)},enumerable:!1,configurable:!0}),R.prototype.ownsTarget=function(k){return!!J.prototype.ownsTarget.call(this,k)||!!(this.controlGrips.findGripByVisual(k)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(k))},R.prototype.pointerDown=function(k,Y){J.prototype.pointerDown.call(this,k,Y),this.state==="new"&&(this.left=k.x,this.top=k.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ae=this.unrotatePoint(k);if(this.manipulationStartX=ae.x,this.manipulationStartY=ae.y,this.offsetX=ae.x-this.left,this.offsetY=ae.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(Y),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Y)){this.activeGrip=this.rotatorGrip;var q=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=q.x-this.width/2,this.top=q.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Ie=this.container.transform.baseVal.getItem(0);Ie.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ie,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},R.prototype.pointerUp=function(k){var Y=this.state;J.prototype.pointerUp.call(this,k),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(k),this._state="select",Y==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},R.prototype.moveVisual=function(k){this.visual.style.transform="translate("+k.x+"px, "+k.y+"px)"},R.prototype.manipulate=function(k){var Y=this.unrotatePoint(k);this.state==="creating"?this.resize(k):this.state==="move"?(this.left=this.manipulationStartLeft+(Y.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(Y.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(Y):this.state==="rotate"&&this.rotate(k)},R.prototype.resize=function(k){var Y=this.manipulationStartLeft,ae=this.manipulationStartWidth,q=this.manipulationStartTop,Ie=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:Y=this.manipulationStartLeft+k.x-this.manipulationStartX,ae=this.manipulationStartWidth+this.manipulationStartLeft-Y;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ae=this.manipulationStartWidth+k.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:q=this.manipulationStartTop+k.y-this.manipulationStartY,Ie=this.manipulationStartHeight+this.manipulationStartTop-q;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ie=this.manipulationStartHeight+k.y-this.manipulationStartY}ae>=0?(this.left=Y,this.width=ae):(this.left=Y+ae,this.width=-ae),Ie>=0?(this.top=q,this.height=Ie):(this.top=q+Ie,this.height=-Ie),this.setSize()},R.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},R.prototype.rotate=function(k){if(Math.abs(k.x-this.centerX)>.1){var Y=Math.sign(k.x-this.centerX);this.rotationAngle=180*Math.atan((k.y-this.centerY)/(k.x-this.centerX))/Math.PI+90*Y,this.applyRotation()}},R.prototype.applyRotation=function(){var k=this.container.transform.baseVal.getItem(0);k.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(k,0)},R.prototype.rotatePoint=function(k){if(this.rotationAngle===0)return k;var Y=this.container.getCTM(),ae=be.createPoint(k.x,k.y);return{x:(ae=ae.matrixTransform(Y)).x,y:ae.y}},R.prototype.unrotatePoint=function(k){if(this.rotationAngle===0)return k;var Y=this.container.getCTM();Y=Y.inverse();var ae=be.createPoint(k.x,k.y);return{x:(ae=ae.matrixTransform(Y)).x,y:ae.y}},R.prototype.select=function(){J.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},R.prototype.deselect=function(){J.prototype.deselect.call(this),this.controlBox.style.display="none"},R.prototype.setupControlBox=function(){this.controlBox=be.createGroup();var k=be.createTransform();k.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(k),this.container.appendChild(this.controlBox),this.controlRect=be.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=be.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 Te,this.addControlGrips(),this.controlBox.style.display="none"},R.prototype.adjustControlBox=function(){var k=this.controlBox.transform.baseVal.getItem(0);k.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(k,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},R.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()},R.prototype.createGrip=function(){var k=new We;return k.visual.transform.baseVal.appendItem(be.createTransform()),this.controlBox.appendChild(k.visual),k},R.prototype.positionGrips=function(){var k=this.controlGrips.topLeft.GRIP_SIZE,Y=-k/2,ae=Y,q=(this.width+this.CB_DISTANCE)/2-k/2,Ie=(this.height+this.CB_DISTANCE)/2-k/2,ht=this.height+this.CB_DISTANCE-k/2,Ot=this.width+this.CB_DISTANCE-k/2;this.positionGrip(this.controlGrips.topLeft.visual,Y,ae),this.positionGrip(this.controlGrips.topCenter.visual,q,ae),this.positionGrip(this.controlGrips.topRight.visual,Ot,ae),this.positionGrip(this.controlGrips.centerLeft.visual,Y,Ie),this.positionGrip(this.controlGrips.centerRight.visual,Ot,Ie),this.positionGrip(this.controlGrips.bottomLeft.visual,Y,ht),this.positionGrip(this.controlGrips.bottomCenter.visual,q,ht),this.positionGrip(this.controlGrips.bottomRight.visual,Ot,ht),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,q,ae-3*this.CB_DISTANCE)},R.prototype.positionGrip=function(k,Y,ae){var q=k.transform.baseVal.getItem(0);q.setTranslate(Y,ae),k.transform.baseVal.replaceItem(q,0)},R.prototype.hideControlBox=function(){this.controlBox.style.display="none"},R.prototype.showControlBox=function(){this.controlBox.style.display=""},R.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Je.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Je.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},J.prototype.getState.call(this))},R.prototype.restoreState=function(k){J.prototype.restoreState.call(this,k);var Y=k;this.left=Y.left,this.top=Y.top,this.width=Y.width,this.height=Y.height,this.rotationAngle=Y.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Je.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,Y.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Je.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,Y.containerTransformMatrix))},R.prototype.scale=function(k,Y){J.prototype.scale.call(this,k,Y);var ae=this.rotatePoint({x:this.left,y:this.top}),q=this.unrotatePoint({x:ae.x*k,y:ae.y*Y});this.left=q.x,this.top=q.y,this.width=this.width*k,this.height=this.height*Y,this.adjustControlBox()},R}(ve),dt=function(J){function R(k,Y,ae){var q=J.call(this,k,Y,ae)||this;return q.fillColor="transparent",q.strokeColor="transparent",q.strokeWidth=0,q.strokeDasharray="",q.opacity=1,q.setStrokeColor=q.setStrokeColor.bind(q),q.setFillColor=q.setFillColor.bind(q),q.setStrokeWidth=q.setStrokeWidth.bind(q),q.setStrokeDasharray=q.setStrokeDasharray.bind(q),q.createVisual=q.createVisual.bind(q),q}return Ce(R,J),R.prototype.ownsTarget=function(k){return!(!J.prototype.ownsTarget.call(this,k)&&k!==this.visual)},R.prototype.createVisual=function(){this.visual=be.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)},R.prototype.pointerDown=function(k,Y){J.prototype.pointerDown.call(this,k,Y),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},R.prototype.manipulate=function(k){J.prototype.manipulate.call(this,k)},R.prototype.resize=function(k){J.prototype.resize.call(this,k),this.setSize()},R.prototype.setSize=function(){J.prototype.setSize.call(this),be.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},R.prototype.pointerUp=function(k){J.prototype.pointerUp.call(this,k),this.setSize()},R.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&be.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},R.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&be.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},R.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&be.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},R.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&be.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},R.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},J.prototype.getState.call(this))},R.prototype.restoreState=function(k){var Y=k;this.fillColor=Y.fillColor,this.strokeColor=Y.strokeColor,this.strokeWidth=Y.strokeWidth,this.strokeDasharray=Y.strokeDasharray,this.opacity=Y.opacity,this.createVisual(),J.prototype.restoreState.call(this,k),this.setSize()},R.prototype.scale=function(k,Y){J.prototype.scale.call(this,k,Y),this.setSize()},R.title="Rectangle marker",R}(at),Lt=function(J){function R(k,Y,ae,q){var Ie=J.call(this,k,q||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Ie.widths=[],Ie.widthBoxes=[],Ie.widths=Y,Ie.currentWidth=ae,Ie.setCurrentWidth=Ie.setCurrentWidth.bind(Ie),Ie}return Ce(R,J),R.prototype.getUi=function(){var k=this,Y=document.createElement("div");return Y.style.display="flex",Y.style.overflow="hidden",Y.style.flexGrow="2",this.widths.forEach(function(ae){var q=document.createElement("div");q.style.display="flex",q.style.flexGrow="2",q.style.alignItems="center",q.style.justifyContent="space-between",q.style.padding="5px",q.style.borderWidth="2px",q.style.borderStyle="solid",q.style.borderColor=ae===k.currentWidth?k.uiStyleSettings.toolboxAccentColor:"transparent",q.addEventListener("click",function(){k.setCurrentWidth(ae,q)}),Y.appendChild(q);var Ie=document.createElement("div");Ie.innerText=ae.toString(),Ie.style.marginRight="5px",q.appendChild(Ie);var ht=document.createElement("div");ht.style.minHeight="20px",ht.style.flexGrow="2",ht.style.display="flex",ht.style.alignItems="center";var Ot=document.createElement("hr");Ot.style.minWidth="20px",Ot.style.border="0px",Ot.style.borderTop=ae+"px solid "+k.uiStyleSettings.toolboxColor,Ot.style.flexGrow="2",ht.appendChild(Ot),q.appendChild(ht),k.widthBoxes.push(q)}),Y},R.prototype.setCurrentWidth=function(k,Y){var ae=this;this.currentWidth=k,this.widthBoxes.forEach(function(q){q.style.borderColor=q===Y?ae.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},R}(_e),It=function(J){function R(k,Y,ae,q){var Ie=J.call(this,k,q||'<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 Ie.styles=[],Ie.styleBoxes=[],Ie.styles=Y,Ie.currentStyle=ae,Ie.setCurrentStyle=Ie.setCurrentStyle.bind(Ie),Ie}return Ce(R,J),R.prototype.getUi=function(){var k=this,Y=document.createElement("div");return Y.style.display="flex",Y.style.overflow="hidden",Y.style.flexGrow="2",this.styles.forEach(function(ae){var q=document.createElement("div");q.style.display="flex",q.style.alignItems="center",q.style.justifyContent="space-between",q.style.padding="5px",q.style.borderWidth="2px",q.style.borderStyle="solid",q.style.overflow="hidden",q.style.maxWidth=100/k.styles.length-5+"%",q.style.borderColor=ae===k.currentStyle?k.uiStyleSettings.toolboxAccentColor:"transparent",q.addEventListener("click",function(){k.setCurrentStyle(ae,q)}),Y.appendChild(q);var Ie=document.createElement("div");Ie.style.minHeight="20px",Ie.style.flexGrow="2",Ie.style.overflow="hidden";var ht=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+k.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ae!==""?'stroke-dasharray="'+ae+'"':"")+` />
|
|
</svg>`;Ie.innerHTML=ht,q.appendChild(Ie),k.styleBoxes.push(q)}),Y},R.prototype.setCurrentStyle=function(k,Y){var ae=this;this.currentStyle=k,this.styleBoxes.forEach(function(q){q.style.borderColor=q===Y?ae.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},R}(_e),Ne=function(J){function R(k,Y,ae){var q=J.call(this,k,Y,ae)||this;return q.strokeColor=ae.defaultColor,q.strokeWidth=ae.defaultStrokeWidth,q.strokeDasharray=ae.defaultStrokeDasharray,q.strokePanel=new Me("Line color",ae.defaultColorSet,ae.defaultColor),q.strokePanel.onColorChanged=q.setStrokeColor,q.strokeWidthPanel=new Lt("Line width",ae.defaultStrokeWidths,ae.defaultStrokeWidth),q.strokeWidthPanel.onWidthChanged=q.setStrokeWidth,q.strokeStylePanel=new It("Line style",ae.defaultStrokeDasharrays,ae.defaultStrokeDasharray),q.strokeStylePanel.onStyleChanged=q.setStrokeDasharray,q}return Ce(R,J),Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var k=J.prototype.getState.call(this);return k.typeName=R.typeName,k},R.typeName="FrameMarker",R.title="Frame marker",R.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',R}(dt),ke=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},it=function(J){function R(k,Y,ae){var q=J.call(this,k,Y,ae)||this;return q.x1=0,q.y1=0,q.x2=0,q.y2=0,q.defaultLength=50,q.manipulationStartX=0,q.manipulationStartY=0,q.manipulationStartX1=0,q.manipulationStartY1=0,q.manipulationStartX2=0,q.manipulationStartY2=0,q.setupControlBox(),q}return Ce(R,J),R.prototype.ownsTarget=function(k){return!!J.prototype.ownsTarget.call(this,k)||!(!this.grip1.ownsTarget(k)&&!this.grip2.ownsTarget(k))},R.prototype.pointerDown=function(k,Y){J.prototype.pointerDown.call(this,k,Y),this.manipulationStartX=k.x,this.manipulationStartY=k.y,this.state==="new"&&(this.x1=k.x,this.y1=k.y,this.x2=k.x,this.y2=k.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(Y)?this.activeGrip=this.grip1:this.grip2.ownsTarget(Y)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},R.prototype.pointerUp=function(k){var Y=this.state;J.prototype.pointerUp.call(this,k),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(k),this._state="select",Y==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},R.prototype.adjustVisual=function(){},R.prototype.manipulate=function(k){this.state==="creating"?this.resize(k):this.state==="move"?(this.x1=this.manipulationStartX1+k.x-this.manipulationStartX,this.y1=this.manipulationStartY1+k.y-this.manipulationStartY,this.x2=this.manipulationStartX2+k.x-this.manipulationStartX,this.y2=this.manipulationStartY2+k.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(k)},R.prototype.resize=function(k){switch(this.activeGrip){case this.grip1:this.x1=k.x,this.y1=k.y;break;case this.grip2:case void 0:this.x2=k.x,this.y2=k.y}this.adjustVisual(),this.adjustControlBox()},R.prototype.select=function(){J.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},R.prototype.deselect=function(){J.prototype.deselect.call(this),this.controlBox.style.display="none"},R.prototype.setupControlBox=function(){this.controlBox=be.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},R.prototype.adjustControlBox=function(){this.positionGrips()},R.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},R.prototype.createGrip=function(){var k=new We;return k.visual.transform.baseVal.appendItem(be.createTransform()),this.controlBox.appendChild(k.visual),k},R.prototype.positionGrips=function(){var k=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-k/2,this.y1-k/2),this.positionGrip(this.grip2.visual,this.x2-k/2,this.y2-k/2)},R.prototype.positionGrip=function(k,Y,ae){var q=k.transform.baseVal.getItem(0);q.setTranslate(Y,ae),k.transform.baseVal.replaceItem(q,0)},R.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},J.prototype.getState.call(this))},R.prototype.restoreState=function(k){J.prototype.restoreState.call(this,k);var Y=k;this.x1=Y.x1,this.y1=Y.y1,this.x2=Y.x2,this.y2=Y.y2},R.prototype.scale=function(k,Y){J.prototype.scale.call(this,k,Y),this.x1=this.x1*k,this.y1=this.y1*Y,this.x2=this.x2*k,this.y2=this.y2*Y,this.adjustVisual(),this.adjustControlBox()},R}(ve),ot=function(J){function R(k,Y,ae){var q=J.call(this,k,Y,ae)||this;return q.strokeColor="transparent",q.strokeWidth=0,q.strokeDasharray="",q.setStrokeColor=q.setStrokeColor.bind(q),q.setStrokeWidth=q.setStrokeWidth.bind(q),q.setStrokeDasharray=q.setStrokeDasharray.bind(q),q.strokeColor=ae.defaultColor,q.strokeWidth=ae.defaultStrokeWidth,q.strokeDasharray=ae.defaultStrokeDasharray,q.strokePanel=new Me("Line color",ae.defaultColorSet,ae.defaultColor),q.strokePanel.onColorChanged=q.setStrokeColor,q.strokeWidthPanel=new Lt("Line width",ae.defaultStrokeWidths,ae.defaultStrokeWidth),q.strokeWidthPanel.onWidthChanged=q.setStrokeWidth,q.strokeStylePanel=new It("Line style",ae.defaultStrokeDasharrays,ae.defaultStrokeDasharray),q.strokeStylePanel.onStyleChanged=q.setStrokeDasharray,q}return Ce(R,J),R.prototype.ownsTarget=function(k){return!(!J.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorLine&&k!==this.visibleLine)},R.prototype.createVisual=function(){this.visual=be.createGroup(),this.selectorLine=be.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=be.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)},R.prototype.pointerDown=function(k,Y){J.prototype.pointerDown.call(this,k,Y),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},R.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()),be.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),be.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),be.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},R.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},R.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},R.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},J.prototype.getState.call(this));return k.typeName=R.typeName,k},R.prototype.restoreState=function(k){J.prototype.restoreState.call(this,k);var Y=k;this.strokeColor=Y.strokeColor,this.strokeWidth=Y.strokeWidth,this.strokeDasharray=Y.strokeDasharray,this.createVisual(),this.adjustVisual()},R.typeName="LineMarker",R.title="Line marker",R.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',R}(it),Ge=function(J){function R(k,Y,ae,q){var Ie=J.call(this,k,q||'<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 Ie.fonts=[],Ie.fontBoxes=[],Ie.fonts=Y,Ie.currentFont=ae,Ie.setCurrentFont=Ie.setCurrentFont.bind(Ie),Ie}return Ce(R,J),R.prototype.getUi=function(){var k=this,Y=document.createElement("div");return Y.style.overflow="hidden",Y.style.flexGrow="2",this.fonts.forEach(function(ae){var q=document.createElement("div");q.style.display="inline-block",q.style.alignItems="center",q.style.justifyContent="space-between",q.style.padding="5px",q.style.borderWidth="2px",q.style.borderStyle="solid",q.style.overflow="hidden",q.style.maxWidth=100/k.fonts.length-5+"%",q.style.borderColor=ae===k.currentFont?k.uiStyleSettings.toolboxAccentColor:"transparent",q.addEventListener("click",function(){k.setCurrentFont(ae,q)}),Y.appendChild(q);var Ie=document.createElement("div");Ie.style.display="flex",Ie.style.minHeight="20px",Ie.style.flexGrow="2",Ie.style.fontFamily=ae,Ie.style.overflow="hidden";var ht=document.createElement("div");ht.style.whiteSpace="nowrap",ht.style.overflow="hidden",ht.style.textOverflow="ellipsis",ht.innerHTML="The quick brown fox jumps over the lazy dog",Ie.appendChild(ht),q.appendChild(Ie),k.fontBoxes.push(q)}),Y},R.prototype.setCurrentFont=function(k,Y){var ae=this;this.currentFont=k,this.fontBoxes.forEach(function(q){q.style.borderColor=q===Y?ae.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},R}(_e),$e=function(J){function R(k,Y,ae){var q=J.call(this,k,Y,ae)||this;return q.color="transparent",q.padding=5,q.DEFAULT_TEXT="your text here",q.text=q.DEFAULT_TEXT,q.isMoved=!1,q.color=ae.defaultColor,q.fontFamily=ae.defaultFontFamily,q.defaultSize={x:100,y:30},q.setColor=q.setColor.bind(q),q.setFont=q.setFont.bind(q),q.renderText=q.renderText.bind(q),q.sizeText=q.sizeText.bind(q),q.textEditDivClicked=q.textEditDivClicked.bind(q),q.showTextEditor=q.showTextEditor.bind(q),q.setSize=q.setSize.bind(q),q.positionTextEditor=q.positionTextEditor.bind(q),q.colorPanel=new Me("Color",ae.defaultColorSet,ae.defaultColor),q.colorPanel.onColorChanged=q.setColor,q.fontFamilyPanel=new Ge("Font",ae.defaultFontFamilies,ae.defaultFontFamily),q.fontFamilyPanel.onFontChanged=q.setFont,q}return Ce(R,J),R.prototype.ownsTarget=function(k){if(J.prototype.ownsTarget.call(this,k)||k===this.visual||k===this.textElement||k===this.bgRectangle)return!0;var Y=!1;return this.textElement.childNodes.forEach(function(ae){ae===k&&(Y=!0)}),Y},R.prototype.createVisual=function(){this.visual=be.createGroup(),this.bgRectangle=be.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=be.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(be.createTransform()),this.textElement.transform.baseVal.appendItem(be.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},R.prototype.pointerDown=function(k,Y){J.prototype.pointerDown.call(this,k,Y),this.isMoved=!1,this.pointerDownPoint=k,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},R.prototype.renderText=function(){var k=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(Y){k.textElement.appendChild(be.createTSpan(Y.trim()===""?" ":Y.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},R.prototype.getTextScale=function(){var k=this.textElement.getBBox(),Y=1;if(k.width>0&&k.height>0){var ae=(1*this.width-this.width*this.padding*2/100)/k.width,q=(1*this.height-this.height*this.padding*2/100)/k.height;Y=Math.min(ae,q)}return Y},R.prototype.getTextPosition=function(k){var Y=this.textElement.getBBox(),ae=0,q=0;return Y.width>0&&Y.height>0&&(ae=(this.width-Y.width*k)/2,q=this.height/2-Y.height*k/2),{x:ae,y:q}},R.prototype.sizeText=function(){var k=this.textElement.getBBox(),Y=this.getTextScale(),ae=this.getTextPosition(Y);ae.y-=k.y*Y,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ae.x+"px, "+ae.y+"px) scale("+Y+", "+Y+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ae.x,ae.y),this.textElement.transform.baseVal.getItem(1).setScale(Y,Y))},R.prototype.manipulate=function(k){J.prototype.manipulate.call(this,k),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(k.x-this.pointerDownPoint.x)>5||Math.abs(k.y-this.pointerDownPoint.y)>5)},R.prototype.resize=function(k){J.prototype.resize.call(this,k),this.isMoved=!0,this.setSize(),this.sizeText()},R.prototype.setSize=function(){J.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(be.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),be.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},R.prototype.pointerUp=function(k){var Y=this.state;Y==="creating"&&(this._suppressMarkerCreateEvent=!0),J.prototype.pointerUp.call(this,k),this.setSize(),(Y==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},R.prototype.showTextEditor=function(){var k=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(Y){Y.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var Y=Number.parseFloat(k.textEditor.style.fontSize);k.textEditor.clientWidth>=Number.parseInt(k.textEditor.style.maxWidth)&&Y>.9;)Y-=.1,k.textEditor.style.fontSize=Math.max(Y,.9)+"em"}),this.textEditor.addEventListener("keyup",function(Y){Y.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(Y){if(Y.clipboardData){var ae=Y.clipboardData.getData("text"),q=window.getSelection();if(!q.rangeCount)return!1;q.deleteFromDocument(),q.getRangeAt(0).insertNode(document.createTextNode(ae)),Y.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){k.textEditDivClicked(k.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},R.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var k=this.getTextScale(),Y=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ae=this.textElement.getBBox(),q={x:ae.width*k,y:ae.height*k};Y.x-=q.x/2,Y.y-=q.y/2,this.textEditor.style.top=Y.y+"px",this.textEditor.style.left=Y.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-Y.x+"px",this.textEditor.style.fontSize=Math.max(16*k,12)+"px",this.textElement.style.display="none"}},R.prototype.textEditDivClicked=function(k){this.text=k.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},R.prototype.select=function(){J.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},R.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),J.prototype.deselect.call(this)},R.prototype.dblClick=function(k,Y){J.prototype.dblClick.call(this,k,Y),this.showTextEditor()},R.prototype.setColor=function(k){this.textElement&&be.setAttributes(this.textElement,[["fill",k]]),this.color=k,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(k)},R.prototype.setFont=function(k){this.textElement&&be.setAttributes(this.textElement,[["font-family",k]]),this.fontFamily=k,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},R.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},R.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var k=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},J.prototype.getState.call(this));return k.typeName=R.typeName,k},R.prototype.restoreState=function(k){var Y=k;this.color=Y.color,this.fontFamily=Y.fontFamily,this.padding=Y.padding,this.text=Y.text,this.createVisual(),J.prototype.restoreState.call(this,k),this.setSize()},R.prototype.scale=function(k,Y){J.prototype.scale.call(this,k,Y),this.setSize(),this.sizeText(),this.positionTextEditor()},R.typeName="TextMarker",R.title="Text marker",R.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>',R}(at),we=function(J){function R(k,Y,ae){var q=J.call(this,k,Y,ae)||this;return q.color="transparent",q.lineWidth=3,q.drawing=!1,q.pixelRatio=1,q.color=ae.defaultColor,q.lineWidth=ae.defaultStrokeWidth,q.pixelRatio=ae.freehandPixelRatio,q.setColor=q.setColor.bind(q),q.addCanvas=q.addCanvas.bind(q),q.finishCreation=q.finishCreation.bind(q),q.setLineWidth=q.setLineWidth.bind(q),q.colorPanel=new Me("Color",ae.defaultColorSet,ae.defaultColor),q.colorPanel.onColorChanged=q.setColor,q.lineWidthPanel=new Lt("Line width",ae.defaultStrokeWidths,ae.defaultStrokeWidth),q.lineWidthPanel.onWidthChanged=q.setLineWidth,q}return Ce(R,J),R.prototype.ownsTarget=function(k){return!(!J.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.drawingImage)},R.prototype.createVisual=function(){this.visual=be.createGroup(),this.drawingImage=be.createImage(),this.visual.appendChild(this.drawingImage);var k=be.createTransform();this.visual.transform.baseVal.appendItem(k),this.addMarkerVisualToContainer(this.visual)},R.prototype.pointerDown=function(k,Y){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(k.x,k.y),this.drawing=!0):J.prototype.pointerDown.call(this,k,Y)},R.prototype.manipulate=function(k){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(k.x,k.y),this.canvasContext.stroke()):J.prototype.manipulate.call(this,k)},R.prototype.resize=function(k){J.prototype.resize.call(this,k),be.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),be.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},R.prototype.pointerUp=function(k){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):J.prototype.pointerUp.call(this,k)},R.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)},R.prototype.select=function(){this.state==="creating"&&this.finishCreation(),J.prototype.select.call(this)},R.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),J.prototype.deselect.call(this)},R.prototype.finishCreation=function(){for(var k=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),Y=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ae=Y[0],q=Y[1],Ie=Y[2],ht=Y[3],Ot=!1,$t=0;$t<this.canvasElement.height;$t++)for(var ft=0;ft<this.canvasElement.width;ft++)k.data[$t*this.canvasElement.width*4+4*ft+3]>0&&(Ot=!0,$t<q&&(q=$t),ft<ae&&(ae=ft),$t>ht&&(ht=$t),ft>Ie&&(Ie=ft));if(Ot){this.left=ae/this.pixelRatio,this.top=q/this.pixelRatio,this.width=(Ie-ae)/this.pixelRatio,this.height=(ht-q)/this.pixelRatio;var zt=document.createElement("canvas");zt.width=Ie-ae,zt.height=ht-q,zt.getContext("2d").putImageData(this.canvasContext.getImageData(ae,q,Ie-ae,ht-q),0,0),this.drawingImgUrl=zt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},R.prototype.setDrawingImage=function(){be.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),be.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},R.prototype.setColor=function(k){this.color=k,this.colorChanged(k)},R.prototype.setLineWidth=function(k){this.lineWidth=k},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var k=Object.assign({drawingImgUrl:this.drawingImgUrl},J.prototype.getState.call(this));return k.typeName=R.typeName,k},R.prototype.restoreState=function(k){this.createVisual(),J.prototype.restoreState.call(this,k),this.drawingImgUrl=k.drawingImgUrl,this.setDrawingImage()},R.prototype.scale=function(k,Y){J.prototype.scale.call(this,k,Y),this.setDrawingImage()},R.typeName="FreehandMarker",R.title="Freehand marker",R.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>',R}(at),Se=function(J){function R(k,Y,ae){var q=J.call(this,k,ae||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return q.typeBoxes=[],q.currentType=Y,q.setCurrentType=q.setCurrentType.bind(q),q}return Ce(R,J),R.prototype.getUi=function(){var k=this,Y=document.createElement("div");Y.style.display="flex",Y.style.overflow="hidden",Y.style.flexGrow="2";for(var ae=function(ht){var Ot="both";switch(ht){case 0:Ot="both";break;case 1:Ot="start";break;case 2:Ot="end";break;case 3:Ot="none"}var $t=document.createElement("div");if($t.style.display="flex",$t.style.flexGrow="2",$t.style.alignItems="center",$t.style.justifyContent="space-between",$t.style.padding="5px",$t.style.borderWidth="2px",$t.style.borderStyle="solid",$t.style.borderColor=Ot===q.currentType?q.uiStyleSettings.toolboxAccentColor:"transparent",$t.addEventListener("click",function(){k.setCurrentType(Ot,$t)}),Y.appendChild($t),Ot==="both"||Ot==="start"){var ft=document.createElement("div");ft.style.display="flex",ft.style.alignItems="center",ft.style.minHeight="20px",ft.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="`+(q.uiStyleSettings!==void 0?q.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,ft.style.marginLeft="5px",$t.appendChild(ft)}var zt=document.createElement("div");zt.style.display="flex",zt.style.alignItems="center",zt.style.minHeight="20px",zt.style.flexGrow="2";var on=document.createElement("hr");if(on.style.minWidth="20px",on.style.border="0px",on.style.borderTop="3px solid "+(q.uiStyleSettings!==void 0?q.uiStyleSettings.toolboxColor:"#eeeeee"),on.style.flexGrow="2",zt.appendChild(on),$t.appendChild(zt),Ot==="both"||Ot==="end"){var Wn=document.createElement("div");Wn.style.display="flex",Wn.style.alignItems="center",Wn.style.minHeight="20px",Wn.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="`+(q.uiStyleSettings!==void 0?q.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Wn.style.marginRight="5px",$t.appendChild(Wn)}q.typeBoxes.push($t)},q=this,Ie=0;Ie<4;Ie++)ae(Ie);return Y},R.prototype.setCurrentType=function(k,Y){var ae=this;this.currentType=k,this.typeBoxes.forEach(function(q){q.style.borderColor=q===Y?ae.uiStyleSettings!==void 0?ae.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},R}(_e),Ee=function(J){function R(k,Y,ae){var q=J.call(this,k,Y,ae)||this;return q.arrowType="end",q.arrowBaseHeight=10,q.arrowBaseWidth=10,q.getArrowPoints=q.getArrowPoints.bind(q),q.setArrowType=q.setArrowType.bind(q),q.arrowTypePanel=new Se("Arrow type","end"),q.arrowTypePanel.onArrowTypeChanged=q.setArrowType,q}return Ce(R,J),R.prototype.ownsTarget=function(k){return!(!J.prototype.ownsTarget.call(this,k)&&k!==this.arrow1&&k!==this.arrow2)},R.prototype.getArrowPoints=function(k,Y){var ae=this.arrowBaseWidth+2*this.strokeWidth,q=this.arrowBaseHeight+2*this.strokeWidth;return k-ae/2+","+(Y+q/2)+" "+k+","+(Y-q/2)+" "+(k+ae/2)+","+(Y+q/2)},R.prototype.createTips=function(){this.arrow1=be.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(be.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=be.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(be.createTransform()),this.visual.appendChild(this.arrow2)},R.prototype.pointerDown=function(k,Y){J.prototype.pointerDown.call(this,k,Y),this.state==="creating"&&this.createTips()},R.prototype.adjustVisual=function(){if(J.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",be.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),be.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),Y=this.arrow1.transform.baseVal.getItem(0);Y.setRotate(k,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(Y,0);var ae=this.arrow2.transform.baseVal.getItem(0);ae.setRotate(k+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ae,0)}},R.prototype.setArrowType=function(k){this.arrowType=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var k=Object.assign({arrowType:this.arrowType},J.prototype.getState.call(this));return k.typeName=R.typeName,k},R.prototype.restoreState=function(k){J.prototype.restoreState.call(this,k);var Y=k;this.arrowType=Y.arrowType,this.createTips(),this.adjustVisual()},R.typeName="ArrowMarker",R.title="Arrow marker",R.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',R}(ot),ue=function(J){function R(k,Y,ae){var q=J.call(this,k,Y,ae)||this;return q.fillColor=ae.defaultFillColor,q.strokeWidth=0,q.fillPanel=new Me("Color",ae.defaultColorSet,ae.defaultFillColor),q.fillPanel.onColorChanged=q.setFillColor,q}return Ce(R,J),Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var k=J.prototype.getState.call(this);return k.typeName=R.typeName,k},R.typeName="CoverMarker",R.title="Cover marker",R.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',R}(dt),de=function(J){function R(k,Y,ae,q){var Ie=J.call(this,k,q||'<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 Ie.opacities=[],Ie.opacityBoxes=[],Ie.opacities=Y,Ie.currentOpacity=ae,Ie.setCurrentOpacity=Ie.setCurrentOpacity.bind(Ie),Ie}return Ce(R,J),R.prototype.getUi=function(){var k=this,Y=document.createElement("div");return Y.style.display="flex",Y.style.overflow="hidden",Y.style.flexGrow="2",Y.style.justifyContent="space-between",this.opacities.forEach(function(ae){var q=document.createElement("div");q.style.display="flex",q.style.alignItems="center",q.style.justifyContent="center",q.style.padding="5px",q.style.borderWidth="2px",q.style.borderStyle="solid",q.style.borderColor=ae===k.currentOpacity?k.uiStyleSettings.toolboxAccentColor:"transparent",q.addEventListener("click",function(){k.setCurrentOpacity(ae,q)}),Y.appendChild(q);var Ie=document.createElement("div");Ie.innerText=100*ae+"%",q.appendChild(Ie),k.opacityBoxes.push(q)}),Y},R.prototype.setCurrentOpacity=function(k,Y){var ae=this;this.currentOpacity=k,this.opacityBoxes.forEach(function(q){q.style.borderColor=q===Y?ae.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},R}(_e),ye=function(J){function R(k,Y,ae){var q=J.call(this,k,Y,ae)||this;return q.setOpacity=q.setOpacity.bind(q),q.fillColor=ae.defaultHighlightColor,q.strokeWidth=0,q.opacity=ae.defaultHighlightOpacity,q.fillPanel=new Me("Color",ae.defaultColorSet,q.fillColor),q.fillPanel.onColorChanged=q.setFillColor,q.opacityPanel=new de("Opacity",ae.defaultOpacitySteps,q.opacity),q.opacityPanel.onOpacityChanged=q.setOpacity,q}return Ce(R,J),R.prototype.setOpacity=function(k){this.opacity=k,this.visual&&be.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var k=J.prototype.getState.call(this);return k.typeName=R.typeName,k},R.typeName="HighlightMarker",R.title="Highlight marker",R.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>',R}(ue),me='<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>',Le=function(J){function R(k,Y,ae){var q=J.call(this,k,Y,ae)||this;return q.bgColor="transparent",q.tipPosition={x:0,y:0},q.tipBase1Position={x:0,y:0},q.tipBase2Position={x:0,y:0},q.tipMoving=!1,q.color=ae.defaultStrokeColor,q.bgColor=ae.defaultFillColor,q.fontFamily=ae.defaultFontFamily,q.defaultSize={x:100,y:30},q.setBgColor=q.setBgColor.bind(q),q.getTipPoints=q.getTipPoints.bind(q),q.positionTip=q.positionTip.bind(q),q.setTipPoints=q.setTipPoints.bind(q),q.colorPanel=new Me("Text color",ae.defaultColorSet,q.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>'),q.colorPanel.onColorChanged=q.setColor,q.bgColorPanel=new Me("Fill color",ae.defaultColorSet,q.bgColor,me),q.bgColorPanel.onColorChanged=q.setBgColor,q.fontFamilyPanel=new Ge("Font",ae.defaultFontFamilies,ae.defaultFontFamily),q.fontFamilyPanel.onFontChanged=q.setFont,q.tipGrip=new We,q.tipGrip.visual.transform.baseVal.appendItem(be.createTransform()),q.controlBox.appendChild(q.tipGrip.visual),q}return Ce(R,J),R.prototype.ownsTarget=function(k){return J.prototype.ownsTarget.call(this,k)||this.tipGrip.ownsTarget(k)||this.tip===k},R.prototype.createTip=function(){be.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=be.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},R.prototype.pointerDown=function(k,Y){this.state==="new"&&J.prototype.pointerDown.call(this,k,Y),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(Y)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):J.prototype.pointerDown.call(this,k,Y)},R.prototype.pointerUp=function(k){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,J.prototype.pointerUp.call(this,k);else{var Y=this.state==="creating";J.prototype.pointerUp.call(this,k),this.setTipPoints(Y),this.positionTip()}},R.prototype.manipulate=function(k){if(this.tipMoving){var Y=this.unrotatePoint(k);this.tipPosition={x:Y.x-this.manipulationStartLeft,y:Y.y-this.manipulationStartTop},this.positionTip()}else J.prototype.manipulate.call(this,k)},R.prototype.setBgColor=function(k){this.bgRectangle&&this.tip&&(be.setAttributes(this.bgRectangle,[["fill",k]]),be.setAttributes(this.tip,[["fill",k]])),this.bgColor=k,this.fillColorChanged(k)},R.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},R.prototype.setTipPoints=function(k){k===void 0&&(k=!1);var Y=Math.min(this.height/2,15),ae=this.height/5;k&&(this.tipPosition={x:Y+ae/2,y:this.height+20});var q=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?q<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ae=this.width/5,Y=Math.min(this.width/2,15),this.tipBase1Position={x:Y,y:0},this.tipBase2Position={x:Y+ae,y:0}):(this.tipBase1Position={x:0,y:Y},this.tipBase2Position={x:0,y:Y+ae}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?q<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ae=this.width/5,Y=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Y-ae,y:0},this.tipBase2Position={x:this.width-Y,y:0}):(this.tipBase1Position={x:this.width,y:Y},this.tipBase2Position={x:this.width,y:Y+ae}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?q<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ae=this.width/5,Y=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Y-ae,y:this.height},this.tipBase2Position={x:this.width-Y,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-Y-ae},this.tipBase2Position={x:this.width,y:this.height-Y}):q<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ae=this.width/5,Y=Math.min(this.width/2,15),this.tipBase1Position={x:Y,y:this.height},this.tipBase2Position={x:Y+ae,y:this.height}):(this.tipBase1Position={x:0,y:this.height-Y},this.tipBase2Position={x:0,y:this.height-Y-ae})},R.prototype.resize=function(k){J.prototype.resize.call(this,k),this.positionTip()},R.prototype.positionTip=function(){be.setAttributes(this.tip,[["points",this.getTipPoints()]]);var k=this.tipGrip.visual.transform.baseVal.getItem(0);k.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(k,0)},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),R.prototype.select=function(){this.positionTip(),J.prototype.select.call(this)},R.prototype.getState=function(){var k=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},J.prototype.getState.call(this));return k.typeName=R.typeName,k},R.prototype.restoreState=function(k){var Y=k;this.bgColor=Y.bgColor,this.tipPosition=Y.tipPosition,J.prototype.restoreState.call(this,k),this.createTip(),this.setTipPoints()},R.prototype.scale=function(k,Y){J.prototype.scale.call(this,k,Y),this.tipPosition={x:this.tipPosition.x*k,y:this.tipPosition.y*Y},this.positionTip()},R.typeName="CalloutMarker",R.title="Callout marker",R.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>',R}($e),Xe=function(J){function R(k,Y,ae){var q=J.call(this,k,Y,ae)||this;return q.fillColor="transparent",q.strokeColor="transparent",q.strokeWidth=0,q.strokeDasharray="",q.opacity=1,q.strokeColor=ae.defaultColor,q.strokeWidth=ae.defaultStrokeWidth,q.strokeDasharray=ae.defaultStrokeDasharray,q.fillColor=ae.defaultFillColor,q.setStrokeColor=q.setStrokeColor.bind(q),q.setFillColor=q.setFillColor.bind(q),q.setStrokeWidth=q.setStrokeWidth.bind(q),q.setStrokeDasharray=q.setStrokeDasharray.bind(q),q.setOpacity=q.setOpacity.bind(q),q.createVisual=q.createVisual.bind(q),q.strokePanel=new Me("Line color",xe(ae.defaultColorSet,["transparent"]),ae.defaultColor),q.strokePanel.onColorChanged=q.setStrokeColor,q.fillPanel=new Me("Fill color",xe(ae.defaultColorSet,["transparent"]),q.fillColor,me),q.fillPanel.onColorChanged=q.setFillColor,q.strokeWidthPanel=new Lt("Line width",ae.defaultStrokeWidths,ae.defaultStrokeWidth),q.strokeWidthPanel.onWidthChanged=q.setStrokeWidth,q.strokeStylePanel=new It("Line style",ae.defaultStrokeDasharrays,ae.defaultStrokeDasharray),q.strokeStylePanel.onStyleChanged=q.setStrokeDasharray,q.opacityPanel=new de("Opacity",ae.defaultOpacitySteps,q.opacity),q.opacityPanel.onOpacityChanged=q.setOpacity,q}return Ce(R,J),R.prototype.ownsTarget=function(k){return!(!J.prototype.ownsTarget.call(this,k)&&k!==this.visual)},R.prototype.createVisual=function(){this.visual=be.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)},R.prototype.pointerDown=function(k,Y){J.prototype.pointerDown.call(this,k,Y),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},R.prototype.manipulate=function(k){J.prototype.manipulate.call(this,k)},R.prototype.resize=function(k){J.prototype.resize.call(this,k),this.setSize()},R.prototype.setSize=function(){J.prototype.setSize.call(this),be.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},R.prototype.pointerUp=function(k){J.prototype.pointerUp.call(this,k),this.setSize()},R.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&be.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},R.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&be.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(k),this.stateChanged()},R.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&be.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},R.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&be.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},R.prototype.setOpacity=function(k){this.opacity=k,this.visual&&be.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var k=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},J.prototype.getState.call(this));return k.typeName=R.typeName,k},R.prototype.restoreState=function(k){var Y=k;this.fillColor=Y.fillColor,this.strokeColor=Y.strokeColor,this.strokeWidth=Y.strokeWidth,this.strokeDasharray=Y.strokeDasharray,this.opacity=Y.opacity,this.createVisual(),J.prototype.restoreState.call(this,k),this.setSize()},R.prototype.scale=function(k,Y){J.prototype.scale.call(this,k,Y),this.setSize()},R.typeName="EllipseMarker",R.title="Ellipse marker",R.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>',R}(at),ut=function(J){function R(k,Y,ae){return J.call(this,k,Y,ae)||this}return Ce(R,J),Object.defineProperty(R.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),R.prototype.ownsTarget=function(k){return!(!J.prototype.ownsTarget.call(this,k)&&k!==this.tip1&&k!==this.tip2)},R.prototype.createTips=function(){this.tip1=be.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(be.createTransform()),this.visual.appendChild(this.tip1),this.tip2=be.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(be.createTransform()),this.visual.appendChild(this.tip2)},R.prototype.pointerDown=function(k,Y){J.prototype.pointerDown.call(this,k,Y),this.state==="creating"&&this.createTips()},R.prototype.adjustVisual=function(){if(J.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(be.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()]]),be.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),Y=this.tip1.transform.baseVal.getItem(0);Y.setRotate(k,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(Y,0);var ae=this.tip2.transform.baseVal.getItem(0);ae.setRotate(k+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ae,0)}},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var k=J.prototype.getState.call(this);return k.typeName=R.typeName,k},R.prototype.restoreState=function(k){J.prototype.restoreState.call(this,k),this.createTips(),this.adjustVisual()},R.typeName="MeasurementMarker",R.title="Measurement marker",R.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>',R}(ot),Dt=function(J){function R(k,Y,ae){var q=J.call(this,k,Y,ae)||this;return q.strokePanel.colors=ae.defaultColorSet,q.fillColor="transparent",q}return Ce(R,J),Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var k=J.prototype.getState.call(this);return k.typeName=R.typeName,k},R.typeName="EllipseFrameMarker",R.title="Ellipse frame marker",R.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>',R}(Xe),jt=function(){function J(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(J.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),J.prototype.addUndoStep=function(R){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(R)||(this.undoStack.push(R),JSON.stringify(this.lastRedoStep)!==JSON.stringify(R)&&this.redoStack.splice(0,this.redoStack.length))},J.prototype.replaceLastUndoStep=function(R){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=R)},J.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},J.prototype.undo=function(){if(this.undoStack.length>1){var R=this.undoStack.pop();return R!==void 0&&this.redoStack.push(R),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},J.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},J}(),Ut=function(J){function R(k,Y,ae){var q=J.call(this,k,Y,ae)||this;return q.strokeColor="transparent",q.strokeWidth=0,q.strokeDasharray="",q.curveX=0,q.curveY=0,q.manipulationStartCurveX=0,q.manipulationStartCurveY=0,q.setStrokeColor=q.setStrokeColor.bind(q),q.setStrokeWidth=q.setStrokeWidth.bind(q),q.setStrokeDasharray=q.setStrokeDasharray.bind(q),q.positionGrips=q.positionGrips.bind(q),q.addControlGrips=q.addControlGrips.bind(q),q.adjustVisual=q.adjustVisual.bind(q),q.setupControlBox=q.setupControlBox.bind(q),q.resize=q.resize.bind(q),q.strokeColor=ae.defaultColor,q.strokeWidth=ae.defaultStrokeWidth,q.strokeDasharray=ae.defaultStrokeDasharray,q.strokePanel=new Me("Line color",ae.defaultColorSet,ae.defaultColor),q.strokePanel.onColorChanged=q.setStrokeColor,q.strokeWidthPanel=new Lt("Line width",ae.defaultStrokeWidths,ae.defaultStrokeWidth),q.strokeWidthPanel.onWidthChanged=q.setStrokeWidth,q.strokeStylePanel=new It("Line style",ae.defaultStrokeDasharrays,ae.defaultStrokeDasharray),q.strokeStylePanel.onStyleChanged=q.setStrokeDasharray,q}return Ce(R,J),R.prototype.ownsTarget=function(k){return!(!J.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorCurve&&k!==this.visibleCurve&&!this.curveGrip.ownsTarget(k))},R.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},R.prototype.createVisual=function(){this.visual=be.createGroup(),this.selectorCurve=be.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=be.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)},R.prototype.pointerDown=function(k,Y){J.prototype.pointerDown.call(this,k,Y),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=k.x,this.curveY=k.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(Y)&&(this.activeGrip=this.curveGrip,this._state="resize")},R.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),be.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),be.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),be.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},R.prototype.setupControlBox=function(){J.prototype.setupControlBox.call(this),this.curveControlLine1=be.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=be.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)},R.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,J.prototype.addControlGrips.call(this)},R.prototype.positionGrips=function(){J.prototype.positionGrips.call(this);var k=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-k/2,this.curveY-k/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},R.prototype.manipulate=function(k){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+k.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+k.y-this.manipulationStartY),J.prototype.manipulate.call(this,k)},R.prototype.resize=function(k){this.activeGrip===this.curveGrip&&(this.curveX=k.x,this.curveY=k.y),J.prototype.resize.call(this,k),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},R.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},R.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},R.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual()},R.prototype.scale=function(k,Y){this.curveX=this.curveX*k,this.curveY=this.curveY*Y,J.prototype.scale.call(this,k,Y)},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},J.prototype.getState.call(this));return k.typeName=R.typeName,k},R.prototype.restoreState=function(k){J.prototype.restoreState.call(this,k);var Y=k;this.strokeColor=Y.strokeColor,this.strokeWidth=Y.strokeWidth,this.strokeDasharray=Y.strokeDasharray,this.curveX=Y.curveX,this.curveY=Y.curveY,this.createVisual(),this.adjustVisual()},R.typeName="CurveMarker",R.title="Curve marker",R.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>',R}(it),Ct=function(){function J(R,k){k===void 0&&(k=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=R,this.cancelable=k}return Object.defineProperty(J.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),J.prototype.preventDefault=function(){this._defaultPrevented=!0},J}(),et=function(J){function R(k,Y,ae){var q=J.call(this,k,!1)||this;return q.dataUrl=Y,q.state=ae,q}return Ce(R,J),R}(Ct),st=function(J){function R(k,Y,ae){ae===void 0&&(ae=!1);var q=J.call(this,k,ae)||this;return q.marker=Y,q}return Ce(R,J),R}(Ct),He=function(){function J(){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 J.prototype.addEventListener=function(R,k){this[R].push(k)},J.prototype.removeEventListener=function(R,k){var Y=this[R].indexOf(k);Y>-1&&this[R].splice(Y,1)},J}(),pe=function(){function J(R){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new ke,this._isOpen=!1,this.undoRedoManager=new jt,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 He,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=J.instanceCounter++,this.styles=new _t(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=R,this.targetRoot=document.body,this.width=R.clientWidth,this.height=R.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(J.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ne,we,Ee,$e,Dt,Xe,ye,Le,ut,ue,ot,Ut]},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ne,we,Ee,$e,Xe,ye,Le]},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ne,we,Ee,$e,ye]},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(R){var k=this;this._availableMarkerTypes.splice(0),R.forEach(function(Y){if(typeof Y=="string"){var ae=k.ALL_MARKER_TYPES.find(function(q){return q.typeName===Y});ae!==void 0&&k._availableMarkerTypes.push(ae)}else k._availableMarkerTypes.push(Y)})},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(R){this._zoomLevel=R,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(J.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),J.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Ve.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},J.prototype.show=function(){var R=this;this.styles.styleSheetRoot===void 0&&yt.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=yt.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(k){return k(new Ct(R))})},J.prototype.render=function(){return je(this,void 0,void 0,function(){var R;return Ue(this,function(k){switch(k.label){case 0:return this.setCurrentMarker(),(R=new mt).naturalSize=this.renderAtNaturalSize,R.imageType=this.renderImageType,R.imageQuality=this.renderImageQuality,R.markersOnly=this.renderMarkersOnly,R.width=this.renderWidth,R.height=this.renderHeight,[4,R.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return k.sent(),[4,R.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,k.sent()]}})})},J.prototype.close=function(R){var k=this;if(R===void 0&&(R=!1),this.isOpen){var Y=!1;R||this.eventListeners.beforeclose.forEach(function(ae){var q=new Ct(k,!0);ae(q),q.defaultPrevented&&(Y=!0)}),Y||(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(ae){return ae(new Ct(k))}),this.detachEvents(),this._isOpen=!1)}},J.prototype.addMarkersToToolbar=function(){for(var R,k=[],Y=0;Y<arguments.length;Y++)k[Y]=arguments[Y];(R=this._availableMarkerTypes).push.apply(R,k)},J.prototype.addRenderEventListener=function(R){this.addEventListener("render",function(k){R(k.dataUrl,k.state)})},J.prototype.removeRenderEventListener=function(R){},J.prototype.addCloseEventListener=function(R){this.addEventListener("close",function(){R()})},J.prototype.removeCloseEventListener=function(R){},J.prototype.setupResizeObserver=function(){var R=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){R.resize(R.target.clientWidth,R.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return R.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},J.prototype.onPopupTargetResize=function(){var R=1*this.target.clientWidth/this.target.clientHeight,k=this.editorCanvas.clientWidth/R>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*R:this.editorCanvas.clientWidth,Y=k<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/R;this.resize(k,Y)},J.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},J.prototype.resize=function(R,k){this._isResizing=!0;var Y=R/this.imageWidth,ae=k/this.imageHeight;this.imageWidth=Math.round(R),this.imageHeight=Math.round(k),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(Y,ae),this._isResizing=!1},J.prototype.scaleMarkers=function(R,k){var Y,ae=this;this._currentMarker&&this._currentMarker instanceof $e?this._currentMarker.scale(R,k):(Y=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(q){q!==ae._currentMarker&&q.scale(R,k)}),Y!==void 0&&this.setCurrentMarker(Y)},J.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"},J.prototype.setTopLeft=function(){var R=this.editingTarget.getBoundingClientRect(),k=this.editorCanvas.getBoundingClientRect();this.left=R.left-k.left,this.top=R.top-k.top},J.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)},J.prototype.addDefs=function(){for(var R,k=[],Y=0;Y<arguments.length;Y++)k[Y]=arguments[Y];this.defs=be.createDefs(),this.addDefsToImage(),(R=this.defs).append.apply(R,k)},J.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},J.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)},J.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},J.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},J.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)},J.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},J.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)},J.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 R=document.createElement("a");R.href="https://markerjs.com/",R.target="_blank",R.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>',R.title="Powered by marker.js",R.style.display="grid",R.style.alignItems="center",R.style.justifyItems="center",R.style.padding="3px",R.style.width="20px",R.style.height="20px",this.logoUI.appendChild(R),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},J.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")},J.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"},J.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},J.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 R=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=R+"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 ct(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 wt(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},J.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},J.prototype.removeMarker=function(R){this.markerImage.removeChild(R.container),this.markers.indexOf(R)>-1&&this.markers.splice(this.markers.indexOf(R),1),R.dispose()},J.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())},J.prototype.toolbarButtonClicked=function(R,k){if(R==="marker"&&k!==void 0)this.createNewMarker(k);else if(R==="action")switch(k){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},J.prototype.deleteSelectedMarker=function(){var R=this;if(this._currentMarker!==void 0){var k=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ae){var q=new st(R,R._currentMarker,!0);ae(q),q.defaultPrevented&&(k=!0)}),!k){var Y=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(ae){return ae(new st(R,Y))})}}},J.prototype.clear=function(){var R=this,k=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ie){var ht=new st(R,void 0,!0);Ie(ht),ht.defaultPrevented&&(k=!0)}),!k)){this.setCurrentMarker();for(var Y=function(Ie){var ht=ae.markers[Ie];ae.setCurrentMarker(ae.markers[Ie]),ae._currentMarker.dispose(),ae.markerImage.removeChild(ae._currentMarker.container),ae.markers.splice(ae.markers.indexOf(ae._currentMarker),1),ae.eventListeners.markerdelete.forEach(function(Ot){return Ot(new st(R,ht))})},ae=this,q=this.markers.length-1;q>=0;q--)Y(q);this.addUndoStep()}},Object.defineProperty(J.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),J.prototype.showNotesEditor=function(){var R;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=(R=this._currentMarker.notes)!==null&&R!==void 0?R:"",this.overlayContainer.appendChild(this.notesArea))},J.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)},J.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},J.prototype.addUndoStep=function(){var R=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var k=this.getState(),Y=this.undoRedoManager.getLastUndoStep();if(!Y||Y.width===k.width&&Y.height===k.height){var ae=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(k),ae<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(q){return q(new Ct(R))})}else this.undoRedoManager.replaceLastUndoStep(k),this.eventListeners.statechange.forEach(function(q){return q(new Ct(R))})}},J.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},J.prototype.undoStep=function(){var R=this,k=this.undoRedoManager.undo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Y){return Y(new Ct(R))}))},J.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},J.prototype.redoStep=function(){var R=this,k=this.undoRedoManager.redo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Y){return Y(new Ct(R))}))},J.prototype.stepZoom=function(){var R=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=R<this.zoomSteps.length-1?this.zoomSteps[R+1]:this.zoomSteps[0]},J.prototype.panTo=function(R){this.contentDiv.scrollBy({left:this.prevPanPoint.x-R.x,top:this.prevPanPoint.y-R.y}),this.prevPanPoint=R},J.prototype.startRenderAndClose=function(){return je(this,void 0,void 0,function(){var R,k,Y=this;return Ue(this,function(ae){switch(ae.label){case 0:return[4,this.render()];case 1:return R=ae.sent(),k=this.getState(),this.eventListeners.render.forEach(function(q){return q(new et(Y,R,k))}),this.close(!0),[2]}})})},J.prototype.getState=function(R){R===!0&&this.setCurrentMarker();var k={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(Y){return k.markers.push(Y.getState())}),k},J.prototype.restoreState=function(R){var k=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);R.markers.forEach(function(Y){var ae=k._availableMarkerTypes.find(function(Ie){return Ie.typeName===Y.typeName});if(ae!==void 0){var q=k.addNewMarker(ae);q.restoreState(Y),k.markers.push(q)}}),R.width&&R.height&&(R.width!==this.imageWidth||R.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/R.width,this.imageHeight/R.height),this.eventListeners.restorestate.forEach(function(Y){return Y(new Ct(k))})},J.prototype.addNewMarker=function(R){var k=be.createGroup();return this.markerImage.appendChild(k),new R(k,this.overlayContainer,this.settings)},J.prototype.createNewMarker=function(R){var k,Y=this;(k=typeof R=="string"?this._availableMarkerTypes.find(function(ae){return ae.typeName===R}):R)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(k),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(k.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ae){return ae(new st(Y,Y._currentMarker))}))},J.prototype.markerCreated=function(R){var k=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(R),this.setCurrentMarker(R),R instanceof we&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(we):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(Y){return Y(new st(k,k._currentMarker))})},J.prototype.colorChanged=function(R){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=R,this.settings.defaultStrokeColor=R)},J.prototype.fillColorChanged=function(R){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=R)},J.prototype.markerStateChanged=function(R){var k=this;this.eventListeners.markerchange.forEach(function(Y){return Y(new st(k,R))})},J.prototype.setCurrentMarker=function(R){var k=this;this._currentMarker!==R&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(Y){return Y(new st(k,k._currentMarker))})),this._currentMarker=R,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(Y){return Y(new st(k,k._currentMarker))}))},J.prototype.onPointerDown=function(R){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||R.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var k=this.markers.find(function(Y){return Y.ownsTarget(R.target)});k!==void 0?(this.setCurrentMarker(k),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(R.clientX,R.clientY),R.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:R.clientX,y:R.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(R.clientX,R.clientY))},J.prototype.onDblClick=function(R){if(this._isFocused||this.focus(),this.mode==="select"){var k=this.markers.find(function(Y){return Y.ownsTarget(R.target)});k!==void 0&&k!==this._currentMarker&&this.setCurrentMarker(k),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(R.clientX,R.clientY),R.target):this.setCurrentMarker()}},J.prototype.onPointerMove=function(R){this.touchPoints!==1&&R.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||R.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(R.clientX,R.clientY)):this.zoomLevel>1&&this.panTo({x:R.clientX,y:R.clientY}))},J.prototype.onPointerUp=function(R){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(R.clientX,R.clientY)),this.isDragging=!1,this.addUndoStep()},J.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},J.prototype.onKeyUp=function(R){this._currentMarker===void 0||this.notesArea!==void 0||R.key!=="Delete"&&R.key!=="Backspace"||this.deleteSelectedMarker()},J.prototype.clientToLocalCoordinates=function(R,k){var Y=this.markerImage.getBoundingClientRect();return{x:(R-Y.left)/this.zoomLevel,y:(k-Y.top)/this.zoomLevel}},J.prototype.onWindowResize=function(){this.positionUI()},J.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var R=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=R+"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()},J.prototype.addLicenseKey=function(R){Ve.addKey(R)},J.prototype.addEventListener=function(R,k){this.eventListeners.addEventListener(R,k)},J.prototype.removeEventListener=function(R,k){this.eventListeners.removeEventListener(R,k)},J.prototype.renderState=function(R){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(R),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(J.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),J.prototype.focus=function(){var R=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(k){return k(new Ct(R))}))},J.prototype.blur=function(){var R=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(k){return k(new Ct(R))}))},J.instanceCounter=0,J}();/* **********************************
|
|
cropro version 1.2.0
|
|
@license SEE LICENSE IN LICENSE
|
|
|
|
copyright Alan Mendelevich
|
|
see README and LICENSE for details
|
|
********************************** *//*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var Re=function(J,R){return(Re=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,Y){k.__proto__=Y}||function(k,Y){for(var ae in Y)Object.prototype.hasOwnProperty.call(Y,ae)&&(k[ae]=Y[ae])})(J,R)};function lt(J,R){if(typeof R!="function"&&R!==null)throw new TypeError("Class extends value "+String(R)+" is not a constructor or null");function k(){this.constructor=J}Re(J,R),J.prototype=R===null?Object.create(R):(k.prototype=R.prototype,new k)}function Ye(J,R,k,Y){return new(k||(k=Promise))(function(ae,q){function Ie($t){try{Ot(Y.next($t))}catch(ft){q(ft)}}function ht($t){try{Ot(Y.throw($t))}catch(ft){q(ft)}}function Ot($t){var ft;$t.done?ae($t.value):(ft=$t.value,ft instanceof k?ft:new k(function(zt){zt(ft)})).then(Ie,ht)}Ot((Y=Y.apply(J,R||[])).next())})}function Pt(J,R){var k,Y,ae,q,Ie={label:0,sent:function(){if(1&ae[0])throw ae[1];return ae[1]},trys:[],ops:[]};return q={next:ht(0),throw:ht(1),return:ht(2)},typeof Symbol=="function"&&(q[Symbol.iterator]=function(){return this}),q;function ht(Ot){return function($t){return function(ft){if(k)throw new TypeError("Generator is already executing.");for(;Ie;)try{if(k=1,Y&&(ae=2&ft[0]?Y.return:ft[0]?Y.throw||((ae=Y.return)&&ae.call(Y),0):Y.next)&&!(ae=ae.call(Y,ft[1])).done)return ae;switch(Y=0,ae&&(ft=[2&ft[0],ae.value]),ft[0]){case 0:case 1:ae=ft;break;case 4:return Ie.label++,{value:ft[1],done:!1};case 5:Ie.label++,Y=ft[1],ft=[0];continue;case 7:ft=Ie.ops.pop(),Ie.trys.pop();continue;default:if(!(ae=Ie.trys,(ae=ae.length>0&&ae[ae.length-1])||ft[0]!==6&&ft[0]!==2)){Ie=0;continue}if(ft[0]===3&&(!ae||ft[1]>ae[0]&&ft[1]<ae[3])){Ie.label=ft[1];break}if(ft[0]===6&&Ie.label<ae[1]){Ie.label=ae[1],ae=ft;break}if(ae&&Ie.label<ae[2]){Ie.label=ae[2],Ie.ops.push(ft);break}ae[2]&&Ie.ops.pop(),Ie.trys.pop();continue}ft=R.call(J,Ie)}catch(zt){ft=[6,zt],Y=0}finally{k=ae=0}if(5&ft[0])throw ft[1];return{value:ft[0]?ft[1]:void 0,done:!0}}([Ot,$t])}}}var Nt=function(){function J(){}return J.addKey=function(R){J.key=R},Object.defineProperty(J,"isLicensed",{get:function(){return!!J.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(J.key)},enumerable:!1,configurable:!0}),J}(),Ke=function(){function J(){}return J.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},J.setAttributes=function(R,k){for(var Y=0,ae=k;Y<ae.length;Y++){var q=ae[Y],Ie=q[0],ht=q[1];R.setAttribute(Ie,ht)}},J.createRect=function(R,k,Y){var ae=document.createElementNS("http://www.w3.org/2000/svg","rect");return ae.setAttribute("width",R.toString()),ae.setAttribute("height",k.toString()),Y&&J.setAttributes(ae,Y),ae},J.createLine=function(R,k,Y,ae,q){var Ie=document.createElementNS("http://www.w3.org/2000/svg","line");return Ie.setAttribute("x1",R.toString()),Ie.setAttribute("y1",k.toString()),Ie.setAttribute("x2",Y.toString()),Ie.setAttribute("y2",ae.toString()),q&&J.setAttributes(Ie,q),Ie},J.createPolygon=function(R,k){var Y=document.createElementNS("http://www.w3.org/2000/svg","polygon");return Y.setAttribute("points",R),k&&J.setAttributes(Y,k),Y},J.createCircle=function(R,k){var Y=document.createElementNS("http://www.w3.org/2000/svg","circle");return Y.setAttribute("cx",(R/2).toString()),Y.setAttribute("cy",(R/2).toString()),Y.setAttribute("r",R.toString()),k&&J.setAttributes(Y,k),Y},J.createEllipse=function(R,k,Y){var ae=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ae.setAttribute("cx",(R/2).toString()),ae.setAttribute("cy",(k/2).toString()),ae.setAttribute("rx",(R/2).toString()),ae.setAttribute("ry",(k/2).toString()),Y&&J.setAttributes(ae,Y),ae},J.createGroup=function(R){var k=document.createElementNS("http://www.w3.org/2000/svg","g");return R&&J.setAttributes(k,R),k},J.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},J.createMarker=function(R,k,Y,ae,q,Ie,ht){var Ot=document.createElementNS("http://www.w3.org/2000/svg","marker");return J.setAttributes(Ot,[["id",R],["orient",k],["markerWidth",Y.toString()],["markerHeight",ae.toString()],["refX",q.toString()],["refY",Ie.toString()]]),Ot.appendChild(ht),Ot},J.createText=function(R){var k=document.createElementNS("http://www.w3.org/2000/svg","text");return k.setAttribute("x","0"),k.setAttribute("y","0"),R&&J.setAttributes(k,R),k},J.createTSpan=function(R,k){var Y=document.createElementNS("http://www.w3.org/2000/svg","tspan");return Y.textContent=R,k&&J.setAttributes(Y,k),Y},J.createImage=function(R){var k=document.createElementNS("http://www.w3.org/2000/svg","image");return R&&J.setAttributes(k,R),k},J.createPoint=function(R,k){var Y=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return Y.x=R,Y.y=k,Y},J.createPath=function(R,k){var Y=document.createElementNS("http://www.w3.org/2000/svg","path");return Y.setAttribute("d",R),k&&J.setAttributes(Y,k),Y},J.createElement=function(R,k){var Y=document.createElementNS("http://www.w3.org/2000/svg",R);return k&&J.setAttributes(Y,k),Y},J.getHollowRectanglePath=function(R,k,Y,ae,q,Ie,ht,Ot){return"M"+R+","+k+"V"+(k+ae)+"H"+(R+Y)+"V"+k+"H"+q+"V"+Ie+"H"+(q+ht)+"V"+(Ie+Ot)+"H"+q+"V"+k+"Z"},J}(),gt=function(){function J(R){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+R+"_"}return Object.defineProperty(J.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(J.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(J.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),J.prototype.addClass=function(R){return this.styleSheet===void 0&&this.addStyleSheet(),R.name=""+this.classNamePrefix+R.localName,this.classes.push(R),this.styleSheet.sheet.insertRule("."+R.name+" {"+R.style+"}",this.styleSheet.sheet.cssRules.length),R},J.prototype.addRule=function(R){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(R),this.styleSheet.sheet.insertRule(R.selector+" {"+R.style+"}",this.styleSheet.sheet.cssRules.length)},J.prototype.addStyleSheet=function(){var R;this.styleSheet=document.createElement("style"),((R=this.styleSheetRoot)!==null&&R!==void 0?R:document.head).appendChild(this.styleSheet),this.addRule(new bt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new bt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new bt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Tt("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Tt("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},J.prototype.removeStyleSheet=function(){var R;this.styleSheet&&(((R=this.styleSheetRoot)!==null&&R!==void 0?R:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},J}(),bt=function(J,R){this.selector=J,this.style=R},Tt=function(J,R){this.localName=J,this.style=R},Wt=function(){function J(){this.blocks=[],this.display=""}return J.prototype.addButtonBlock=function(R){R.className=this.blockClassName,R.buttonClassName=this.buttonClassName,R.buttonColorsClassName=this.buttonColorsClassName,R.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(R)},J.prototype.addElementBlock=function(R){R.className===void 0&&(R.className=this.blockClassName),this.blocks.push(R)},J.prototype.getUI=function(){var R=document.createElement("div");return R.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,R.style.display=this.display,this.blocks.forEach(function(k){return R.appendChild(k.getUI())}),R},J}(),fe=function(){function J(){}return J.prototype.getUI=function(){var R=document.createElement("div");if(R.className=this.className,this.minWidth!==void 0&&(R.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":R.style.justifyContent="flex-start";break;case"center":R.style.justifyContent="center";break;case"end":R.style.justifyContent="flex-end"}return R.style.whiteSpace="nowrap",R},J}(),se=function(J){function R(){var k=J!==null&&J.apply(this,arguments)||this;return k.buttons=[],k}return lt(R,J),R.prototype.addButton=function(k){k.className=this.buttonClassName,k.colorsClassName=this.buttonColorsClassName,k.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(k)},R.prototype.getUI=function(){var k=J.prototype.getUI.call(this);return this.buttons.forEach(function(Y){return k.appendChild(Y.getUI())}),k},R}(fe),W=function(){function J(R,k){this._isActive=!1,this._isHidden=!1,this._icon=R,this.title=k,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(J.prototype,"icon",{get:function(){return this._icon},set:function(R){this._icon=R,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isActive",{get:function(){return this._isActive},set:function(R){this._isActive=R,this.adjustClassName()},enumerable:!1,configurable:!0}),J.prototype.getUI=function(){var R=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 R.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},J.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,"")))},J.prototype.hide=function(){this._isHidden=!0},J}(),$=function(J){function R(){var k=J!==null&&J.apply(this,arguments)||this;return k.elements=[],k}return lt(R,J),R.prototype.addElement=function(k){this.elements.push(k)},R.prototype.getUI=function(){var k=J.prototype.getUI.call(this);return this.elements.forEach(function(Y){return k.appendChild(Y)}),k},R}(fe),Z=function(){function J(R,k){this.horizontal=R,this.vertical=k}return Object.defineProperty(J.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),J.prototype.getVerticalLength=function(R){return R/this.ratio},J.prototype.getHorizontalLength=function(R){return R*this.ratio},J}(),ne=function(){function J(){}return J.getIcon=function(R,k){if(R>0&&k>0){var Y=new Z(R,k),ae=Y.ratio>=1?20:Y.getHorizontalLength(20),q=Y.ratio<1?20:Y.getVerticalLength(20),Ie=document.createElementNS("http://www.w3.org/2000/svg","svg");Ie.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ie.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Ie);var ht=Ke.createDefs();Ie.appendChild(ht);var Ot=Ke.createElement("clipPath",[["id","text-bg-clip"]]);ht.appendChild(Ot);var $t=Ke.createPath(Ke.getHollowRectanglePath((24-ae)/2,(24-q)/2,ae,q,(24-ae)/2+2,(24-q)/2+2,ae-4,q-4));Ie.appendChild($t);var ft=Ke.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ft.appendChild(Ke.createTSpan(R+":"+k)),Ie.appendChild(ft);var zt=ft.getBBox();Ke.setAttributes(ft,[["x",((24-zt.width)/2).toString()],["y",((24-zt.height)/2-zt.y).toString()]]);var on=Ke.createPath(Ke.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(zt.width))/2,(24-Math.ceil(zt.height))/2,Math.ceil(zt.width),Math.ceil(zt.height)));return Ot.appendChild(on),Ke.setAttributes($t,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Ie),Ie.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>'},J}(),he=function(J){function R(k,Y,ae){var q=J.call(this,k,Y)||this;return q.isDropdownOpen=!1,q.onClick=q.dropdownButtonClicked,q.dropdownButtons=ae,q}return lt(R,J),R.prototype.setupDropdown=function(){var k=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(Y){Y.className=k.className,Y.colorsClassName=k.colorsClassName,k.dropdownBlock.appendChild(Y.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},R.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},R.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},R.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},R.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},R.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},R}(W),Pe=function(){function J(R,k){this.GRIP_SIZE=10,this.color=R,this.fillColor=k,this.visual=Ke.createGroup(),this.visual.appendChild(Ke.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ke.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return J.prototype.ownsTarget=function(R){return R===this.visual||R===this.visual.childNodes[0]||R===this.visual.childNodes[1]},J.prototype.setCenter=function(R,k){this.visual.childNodes.forEach(function(Y){return Ke.setAttributes(Y,[["cx",R.toString()],["cy",k.toString()]])})},J}(),ze=function(){function J(R,k,Y,ae){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=R,this.canvasHeight=k,this.margin=Y,this.container=ae,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(J.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(R){this._aspectRatio=R,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(R){this._isGridVisible=R,this.gridContainer&&Ke.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(R){this._zoomFactor=R,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),J.prototype.open=function(){var R=this;this.cropShadeElement=Ke.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Ke.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var k=0;k<this.numberOfGridLines;k++)this.horizontalGridLines.push(Ke.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Ke.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(Y){return R.gridContainer.appendChild(Y)}),this.verticalGridLines.forEach(function(Y){return R.gridContainer.appendChild(Y)}),this.cropRectElement=Ke.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Pe(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Pe(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Pe(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Pe(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},J.prototype.setCropRectangle=function(R){this.cropRect=R;var k=Object.assign({},this.cropRect);this.zoomFactor!==1&&(k.width=this.cropRect.width*this.zoomFactor,k.height=this.cropRect.height*this.zoomFactor,k.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-k.width/2,k.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-k.height/2),Ke.setAttributes(this.cropRectElement,[["x",k.x.toString()],["y",k.y.toString()],["width",k.width.toString()],["height",k.height.toString()]]);var Y=k.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(q,Ie){var ht=k.y+Y*(Ie+1);Ke.setAttributes(q,[["x1",""+k.x],["y1",""+ht],["x2",""+(k.x+k.width)],["y2",""+ht]])});var ae=k.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(q,Ie){var ht=k.x+ae*(Ie+1);Ke.setAttributes(q,[["x1",""+ht],["y1",""+k.y],["x2",""+ht],["y2",""+(k.y+k.height)]])}),Ke.setAttributes(this.cropShadeElement,[["d",Ke.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,k.x,k.y,k.width,k.height)]]),this.topLeftGrip.setCenter(k.x,k.y),this.topRightGrip.setCenter(k.x+k.width,k.y),this.bottomLeftGrip.setCenter(k.x,k.y+k.height),this.bottomRightGrip.setCenter(k.x+k.width,k.y+k.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},J.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)},J.prototype.clientToLocalCoordinates=function(R,k){var Y=this.container.getBoundingClientRect();return{x:R-Y.left+this.margin,y:k-Y.top+this.margin}},J.prototype.onPointerDown=function(R){this.container.setPointerCapture(R.pointerId),this.previousPoint=this.clientToLocalCoordinates(R.clientX,R.clientY),this.cropRectElement===R.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(R.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(R.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(R.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(R.target)&&(this.activeGrip=this.bottomRightGrip)},J.prototype.onPointerMove=function(R){if(this.isMoving)this.move(this.clientToLocalCoordinates(R.clientX,R.clientY));else if(this.activeGrip){var k=this.clientToLocalCoordinates(R.clientX,R.clientY);this.resize(k)}R.preventDefault()},J.prototype.onPointerUp=function(R){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(R.pointerId)},J.prototype.move=function(R){var k=R.x-this.previousPoint.x,Y=R.y-this.previousPoint.y;this.zoomFactor!==1&&(k=-k/this.zoomFactor,Y=-Y/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+k),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+Y),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=R},J.prototype.resize=function(R){var k=Object.assign({},this.cropRect),Y=R.x-this.previousPoint.x,ae=R.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:k.x+Y<this.margin&&(Y=this.margin-k.x),k.x+=Y,k.width=this.cropRect.x+this.cropRect.width-k.x;break;case this.bottomRightGrip:case this.topRightGrip:k.width+Y>this.canvasWidth*this.zoomFactor&&(Y=this.canvasWidth*this.zoomFactor-k.width),k.width+=Y}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(k.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(Y),k.height=this.aspectRatio.getVerticalLength(k.width)):(k.y+=ae,k.height=this.cropRect.y+this.cropRect.height-k.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?k.height=this.aspectRatio.getVerticalLength(k.width):k.height+=ae}k.width<10&&(k.x=this.cropRect.x,k.width=10),k.height<10&&(k.y=this.cropRect.y,k.height=10),this.previousPoint=R,k.x>=this.margin&&k.y>=this.margin&&k.x-this.margin+k.width<=this.canvasWidth&&k.y-this.margin+k.height<=this.canvasHeight&&(this.cropRect=k,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},J.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var R=this.cropRect.x+this.cropRect.width/2,k=this.cropRect.y+this.cropRect.height/2,Y=this.aspectRatio.getHorizontalLength(this.cropRect.height),ae=this.aspectRatio.getVerticalLength(this.cropRect.width);Y/this.canvasWidth<ae/this.canvasHeight?this.cropRect.width=Y:this.cropRect.height=ae,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=R-this.cropRect.width/2,this.cropRect.y=k-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},J.prototype.getRescaledRect=function(R,k,Y,ae,q,Ie){var ht=Y/R,Ot=ae/k;return{x:(q.x-Ie)*ht+Ie,y:(q.y-Ie)*Ot+Ie,width:q.width*ht,height:q.height*Ot}},J.prototype.scaleCanvas=function(R,k){var Y=this.getRescaledRect(this.canvasWidth,this.canvasHeight,R,k,this.cropRect,this.margin);this.canvasWidth=R,this.canvasHeight=k,this.onCropChange&&this.onCropChange(Y),this.setCropRectangle(Y)},J}(),Rt=function(){function J(R){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=R,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(J.prototype,"angle",{get:function(){return this._angle},set:function(R){this._angle=R,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),J.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},J.prototype.onPointerDown=function(R){this.controlContainer.setPointerCapture(R.pointerId),this.isDragging=!0,this.previousPoint={x:R.clientX,y:R.clientY}},J.prototype.onPointerMove=function(R){this.isDragging&&(this.onAngleChange&&this.onAngleChange((R.clientX-this.previousPoint.x)/5),this.previousPoint.x=R.clientX)},J.prototype.onPointerUp=function(R){this.isDragging&&this.onAngleChange&&this.onAngleChange((R.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(R.pointerId)},J.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var R=this.angleLabelText.getBBox();Ke.setAttributes(this.angleLabelElement,[["x",((this.width-R.width)/2).toString()],["y",(this.height/2).toString()]])}},J.prototype.positionScaleShape=function(){if(this.scaleShape){var R=this.scaleShape.transform.baseVal.getItem(0);R.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(R,0)}},J.prototype.getVisual=function(){var R=document.createElementNS("http://www.w3.org/2000/svg","svg");R.setAttribute("xmlns","http://www.w3.org/2000/svg"),R.setAttribute("width",this.width+"px"),R.setAttribute("height",this.height+"px"),R.setAttribute("viewBox","0 0 "+this.width+" "+this.height),R.style.flexShrink="0",document.body.appendChild(R);for(var k="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,Y=1;Y<=this.width/5+10;Y++){var ae=Y%5==0?this.height/3:this.height/6;k+="h4v"+-ae+"h1v"+ae}k+="v1H0Z",this.scaleShape=Ke.createPath(k);var q=Ke.createTransform();this.scaleShape.transform.baseVal.appendItem(q),R.appendChild(this.scaleShape),this.angleLabelElement=Ke.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Ke.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Ie=Ke.createTSpan("");return Ie.innerHTML="°",this.angleLabelElement.appendChild(Ie),R.appendChild(this.angleLabelElement),document.body.removeChild(R),R},J}(),Mt=function(){function J(){this.naturalSize=!1,this.imageType="image/png"}return J.prototype.rasterize=function(R,k,Y,ae,q,Ie,ht){var Ot=this;return new Promise(function($t){var ft=document.createElement("canvas");ft.width=R.width.baseVal.value-2*ae,ft.height=R.height.baseVal.value-2*ae;var zt=1,on=1;Ot.naturalSize===!0?(zt=k.naturalWidth/(R.width.baseVal.value-2*ae)/Ie,on=k.naturalHeight/(R.height.baseVal.value-2*ae)/ht,ft.width=k.naturalWidth/Ie,ft.height=k.naturalHeight/ht):Ot.width!==void 0&&Ot.height!==void 0&&(zt=Ot.width/Y.width,on=Ot.height/Y.height,ft.width*=zt,ft.height*=on);var Wn=ft.getContext("2d");Wn.translate(ft.width/2,ft.height/2),Wn.rotate(q*Math.PI/180),Wn.scale(Ie,ht),Wn.translate(-ft.width/2,-ft.height/2),Wn.drawImage(k,0,0,ft.width,ft.height);var Si=document.createElement("canvas");Si.width=Y.width*zt,Si.height=Y.height*on,Si.getContext("2d").putImageData(Wn.getImageData((Y.x-ae)*zt,(Y.y-ae)*on,Y.width*zt,Y.height*on),0,0),$t(Si.toDataURL(Ot.imageType,Ot.imageQuality))})},J}(),Ze=function(){function J(R){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=J.instanceCounter++,this.styles=new gt(this.instanceNo),this.target=R,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(J.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(R){this._zoomToCropEnabled=R,R?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(R){this._isGridVisible=R,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"gridLines",{get:function(){return this._gridLines},set:function(R){this._gridLines=R,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(R){this._rotationAngle=R,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"aspectRatio",{get:function(){var R;return(R=this._aspectRatio)!==null&&R!==void 0?R:this.aspectRatios[0]},set:function(R){this._aspectRatio=R},enumerable:!1,configurable:!0}),J.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},J.prototype.show=function(){this.showUI(),this.open()},J.prototype.close=function(R){R===void 0&&(R=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),R||this.closeEventListeners.forEach(function(k){return k()}),this._isOpen=!1)},J.prototype.addRenderEventListener=function(R){this.renderEventListeners.push(R)},J.prototype.removeRenderEventListener=function(R){this.renderEventListeners.indexOf(R)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(R),1)},J.prototype.addCloseEventListener=function(R){this.closeEventListeners.push(R)},J.prototype.removeCloseEventListener=function(R){this.closeEventListeners.indexOf(R)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(R),1)},J.prototype.setupResizeObserver=function(){var R=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){R.resize(R.target.clientWidth,R.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))},J.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var R=1*this.target.clientWidth/this.target.clientHeight,k=this.contentDiv.clientWidth/R>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*R:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,Y=k+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/R;this.resize(k,Y)}},J.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},J.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",Ke.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},J.prototype.resize=function(R,k){this.imageWidth=Math.round(R),this.imageHeight=Math.round(k),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()},J.prototype.setEditingTarget=function(){var R=document.createElement("canvas");R.width=this.target.naturalWidth,R.height=this.target.naturalHeight,R.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var k=R.toDataURL();Ke.setAttributes(this.editingTarget,[["href",k]]),this.setEditingTargetSize()},J.prototype.setTopLeft=function(){var R=this.target.getBoundingClientRect(),k=this.editorCanvas.getBoundingClientRect();this.left=R.left-k.left-this.CANVAS_MARGIN,this.top=R.top-k.top-this.CANVAS_MARGIN},J.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=Ke.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Ke.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Ke.createGroup(),this.editingTargetRotationScaleContainer=Ke.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var R=Ke.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(R);var k=Ke.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(k),this.editingTargetContainer=Ke.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)},J.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},J.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Ke.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()},J.prototype.zoomToCrop=function(){if(this.cropRect){var R=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,k=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=R+"px "+k+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-R+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-k+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},J.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)},J.prototype.cropRectChanged=function(R){this.cropRect=R,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},J.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},J.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"},J.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},J.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 R=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,k=this.target.offsetTop>R+this.CANVAS_MARGIN?this.target.offsetTop-(R+this.CANVAS_MARGIN):0;this.coverDiv.style.top=k+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},J.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},J.prototype.addTopToolbar=function(){var R=this;this.topToolbar=new Wt,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var k=new se;k.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(k);var Y=[];this.aspectRatios.forEach(function(on){var Wn=new W(ne.getIcon(on.horizontal,on.vertical),on.horizontal===0&&on.vertical===0?"FREE":on.horizontal+":"+on.vertical);Wn.onClick=function(){return R.ratioButtonClicked(on)},Y.push(Wn)}),this.aspectRatioButton=new he(ne.getIcon(0,0),"Aspect ratio",Y),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,k.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ae=new W('<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");ae.isActive=this.isGridVisible,ae.onClick=function(){R.isGridVisible=!R.isGridVisible,ae.isActive=R.isGridVisible},k.addButton(ae);var q=new W('<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(q.isActive=this.zoomToCropEnabled,q.onClick=function(){R.zoomToCropEnabled=!R.zoomToCropEnabled,q.isActive=R.zoomToCropEnabled},k.addButton(q),!Nt.isLicensed){var Ie=new $;this.topToolbar.addElementBlock(Ie);var ht=document.createElement("div");ht.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Ot=document.createElement("a");Ot.style.color="currentColor",Ot.href="https://markerjs.com/products/cropro",Ot.target="_blank",Ot.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>',ht.appendChild(Ot),Ie.addElement(ht)}var $t=new se;$t.minWidth=3*this.toolbarHeight+"px",$t.contentAlign="end",this.topToolbar.addButtonBlock($t);var ft=new W('<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");ft.onClick=this.startRenderAndClose,$t.addButton(ft),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ft.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var zt=new W('<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");zt.onClick=this.close,$t.addButton(zt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(zt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},J.prototype.addBottomToolbar=function(){var R=this;this.bottomToolbar=new Wt,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var k=new se;k.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(k);var Y=new W('<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");Y.onClick=this.rotateLeftButtonClicked,k.addButton(Y);var ae=new W('<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");ae.onClick=this.rotateRightButtonClicked,k.addButton(ae);var q=new $;q.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(q),this.straightener=new Rt("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($t){R.rotateBy($t),R.straightener.angle=R.rotationAngle},q.addElement(this.straightener.getUI());var Ie=new se;Ie.minWidth=2*this.toolbarHeight+"px",Ie.contentAlign="end",this.bottomToolbar.addButtonBlock(Ie);var ht=new W('<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");ht.onClick=this.flipHorizontallyButtonClicked,Ie.addButton(ht);var Ot=new W('<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");Ot.onClick=this.flipVerticallyButtonClicked,Ie.addButton(Ot)},J.prototype.ratioButtonClicked=function(R){this.aspectRatio=R,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},J.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ne.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},J.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Z(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},J.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},J.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},J.prototype.restoreState=function(R){if(R){var k=this.cropLayer.getRescaledRect(R.width,R.height,this.imageWidth,this.imageHeight,R.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(k),this.cropRectChanged(k),this.flippedHorizontally=R.flippedHorizontally,this.flippedVertically=R.flippedVertically,this.applyFlip(),this.rotationAngle=R.rotationAngle,this.applyRotation()}},J.prototype.clientToLocalCoordinates=function(R,k){var Y=this.cropImage.getBoundingClientRect();return{x:R-Y.left,y:k-Y.top}},J.prototype.onWindowResize=function(){this.positionUI()},J.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var R=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=R+"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()},J.prototype.rotateLeftButtonClicked=function(){var R=this.rotationAngle-90;this.rotationAngle%90!=0&&(R+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(R)},J.prototype.rotateRightButtonClicked=function(){var R=this.rotationAngle+90;this.rotationAngle%90!=0&&(R-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(R)},J.prototype.rotateTo=function(R){R=(R=R>180?R-360:R)<=-180?R+360:R,this.rotationAngle=R,this.applyRotation()},J.prototype.rotateBy=function(R){this.rotateTo((this.rotationAngle+R)%360)},J.prototype.applyRotation=function(){var R=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var k=this.editingTargetRotationContainer.transform.baseVal.getItem(0);k.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(k,0);var Y=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/Y.width,this.imageHeight/Y.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=R},J.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},J.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},J.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},J.prototype.startRenderAndClose=function(){return Ye(this,void 0,void 0,function(){var R,k;return Pt(this,function(Y){switch(Y.label){case 0:return[4,this.render()];case 1:return R=Y.sent(),k=this.getState(),this.renderEventListeners.forEach(function(ae){return ae(R,k)}),this.close(!0),[2]}})})},J.prototype.render=function(){return Ye(this,void 0,void 0,function(){var R;return Pt(this,function(k){switch(k.label){case 0:return(R=new Mt).naturalSize=this.renderAtNaturalSize,R.imageType=this.renderImageType,R.imageQuality=this.renderImageQuality,R.width=this.renderWidth,R.height=this.renderHeight,this.unzoomFromCrop(),Ke.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,R.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return k.sent(),[4,R.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,k.sent()]}})})},J.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Tt("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 Tt("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Tt("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var R=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Tt("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*R)+`px;
|
|
height: `+(this.toolbarHeight-2*R)+`px;
|
|
padding: `+R+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Tt("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Tt("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new bt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new bt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Tt("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 Tt("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Tt("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 Tt("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*R)+`px;
|
|
padding: `+R+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Tt("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},J.instanceCounter=0,J}(),kt=D("8hTe"),an=D.n(kt),At=/<pre[^>]*>/g;function pn(J){var R=document.createElement("div");return R.innerHTML=J,R.childNodes.length===0?"":R.childNodes[0].nodeValue}var nn=le.a=function(J){var R=J.value,k=R===void 0?"":R,Y=J.edit,ae=Y===void 0?!1:Y,q=J.className,Ie=J.showTextOnly,ht=J.showLines,Ot=J.replaces,$t=J.zoomImg,ft=J.hasMask,zt=J.style,on=zt===void 0?{}:zt,Wn=J.stylesPrev,Si=Wn===void 0?{}:Wn,hi=String(k),Fn=Object(P.useRef)(),ci=Object(P.useRef)(),Zi=Object(P.useState)(""),yi=Object(H.a)(Zi,2),ri=yi[0],Ci=yi[1],Di=Object(P.useState)("office"),Oi=Object(H.a)(Di,2),Ri=Oi[0],Vi=Oi[1],dr=function(){var wn=new Ze(ci.current);wn.displayMode="popup",wn.addRenderEventListener(function(){var _i=Object(I.a)(n.a.mark(function Nn(Ti){var ii;return n.a.wrap(function(Ni){for(;;)switch(Ni.prev=Ni.next){case 0:return Fn.current.style.display="none",Ni.next=3,Object(Ae.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Ti}});case 3:ii=Ni.sent,ii!=null&&ii.id&&Ot(ci.current.getAttribute("src").replace(te.a.API_SERVER,""),"/api/attachments/".concat(ii==null?void 0:ii.id,"?type=").concat(ii.content_type));case 5:case"end":return Ni.stop()}},Nn)}));return function(Nn){return _i.apply(this,arguments)}}()),wn.show()},rr=function(){var wn=new pe(ci.current);wn.settings.displayMode="popup",wn.addEventListener("render",function(){var _i=Object(I.a)(n.a.mark(function Nn(Ti){var ii;return n.a.wrap(function(Ni){for(;;)switch(Ni.prev=Ni.next){case 0:if(Fn.current.style.display="none",!ci.current){Ni.next=6;break}return Ni.next=4,Object(Ae.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Ti.dataUrl}});case 4:ii=Ni.sent,ii!=null&&ii.id&&Ot(ci.current.getAttribute("src").replace(te.a.API_SERVER,""),"/api/attachments/".concat(ii==null?void 0:ii.id,"?type=").concat(ii.content_type));case 6:case"end":return Ni.stop()}},Nn)}));return function(Nn){return _i.apply(this,arguments)}}()),wn.show(),window.markerArea=wn},ji=Object(P.useMemo)(function(){Fn.current&&(Fn.current.style.zIndex=-1);try{var Hn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,wn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,_i=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;hi=hi.replace(Hn,"("+te.a.API_SERVER+"/api/attachments/").replace(wn,'"'+te.a.API_SERVER+"/api/attachments/").replace(_i,'"'+te.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(wr){}var Nn=G(hi),Ti=C();if(hi.match(/\[TOC\]/)&&(Nn=Nn.replace("<p>[TOC]</p>",A()),S()),Nn=Nn.replace(/(__special_katext_id_\d+__)/g,function(wr,Ni){var Xi=Ti[Ni],lr=Xi.type,gr=Xi.expression;return Object(re.renderToString)(pn(gr)||"",{displayMode:lr==="block",throwOnError:!1,output:"html"})}),Nn=Nn.replace(/▁/g,"\u2581\u2581\u2581"),E(),Ie){var ii=document.createElement("div");return ii.innerHTML=Nn,ii.innerText}return setTimeout(function(){return Tr()},500),Nn},[hi]),Wi=Object(P.useRef)();x.WebkitLineClamp=ht,ht&&(on=Object(F.a)(Object(F.a)({},on),x));function hr(Hn){var wn=Hn.target;if(wn.tagName.toUpperCase()==="IMG"){if($t){var _i=wn.getAttribute("src");Ci(_i),Vi("image")}}else if(wn.tagName.toUpperCase()==="A"){var Nn=wn.getAttribute("href");if(Nn.indexOf("office")>-1)Hn.preventDefault(),Ci(Nn),Vi("office");else if(Nn.indexOf("application/pdf")>-1)Hn.preventDefault(),Ci(Nn),Vi("pdf");else if(Nn.indexOf("text/html")>-1)Hn.preventDefault(),Ci(Nn),Vi("html");else if(Nn.startsWith("#")){Hn.preventDefault();var Ti=document.getElementById(Nn.replace("#",""));Ti&&Ti.scrollIntoView(!0)}}}var Tr=function(){var wn,_i=(wn=Wi.current)===null||wn===void 0?void 0:wn.querySelectorAll("video");_i==null||_i.forEach(function(Nn){if(Nn.oncontextmenu=function(){return!1},Nn.src.indexOf(".m3u8")>-1&&!Nn.canPlayType("application/vnd.apple.mpegurl")){if(V.a.isSupported()){var Ti=new V.a;Ti.loadSource(Nn.src),Ti.attachMedia(Nn)}}})};Object(P.useEffect)(function(){if(Wi.current&&ji&&(ji.match(At)&&window.PR.prettyPrint()),Wi.current)return Wi.current.addEventListener("click",hr),function(){Wi.current.removeEventListener("click",hr),E(),S()}},[ji,Wi.current,hr]);var ar=function(wn){if(!ae)return;wn.target.nodeName==="IMG"?(Fn.current.style.zIndex=1,Fn.current.style.display="flex",Fn.current.style.width=wn.target.clientWidth+"px",Fn.current.style.height=wn.target.clientHeight+"px",Fn.current.style.top=wn.target.offsetTop+"px",Fn.current.style.left=wn.target.offsetLeft+"px",ci.current.src=wn.target.getAttribute("src")):Fn.current.style.display="none"};return p.a.createElement("div",{style:{position:"relative"}},p.a.createElement("div",{ref:Wi,style:Object(F.a)({},on),className:"".concat(q||""," markdown-body ").concat(an.a.mdBody),onMouseOver:ar,dangerouslySetInnerHTML:{__html:ji}}),p.a.createElement("div",{ref:Fn,className:an.a.button},p.a.createElement(z.a,null,p.a.createElement(X.a,{onClick:function(){return dr()}},"\u88C1\u526A"),p.a.createElement(X.a,{onClick:function(){return rr()}},"\u7F16\u8F91"))),p.a.createElement("img",{ref:ci,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),p.a.createElement(ge.a,{close:!0,data:ri,type:ri!=null&&ri.length?Ri:"",style:Object(F.a)({},Si),onClose:function(){return Ci("")}}))}},"9VGf":function(Be,le,D){"use strict";D.d(le,"a",function(){return M});var Q=D("q1tI"),z=D.n(Q);function M(X,F){var I=Object(Q.useRef)();Object(Q.useEffect)(function(){I.current=X}),Object(Q.useEffect)(function(){function H(){I.current()}if(F!==null){var N=setInterval(H,F);return function(){return clearInterval(N)}}},[F])}},AMnG:function(Be,le,D){"use strict";var Q=D("miYZ"),z=D("tsqr"),M=D("tJVT"),X=D("q1tI"),F=D.n(X),I=D("nWbc"),H=D.n(I),N=D("Ot1p");le.a=function(n){var P=n.id,p=n.activeDiscussIndex,m=n.onReplyDiscuss,d=Object(X.useState)(""),u=Object(M.a)(d,2),o=u[0],h=u[1];function r(i){h(i)}function a(){if(!o){z.b.info("\u56DE\u590D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A!");return}m(P,o),h("")}return F.a.createElement("div",{key:P,className:"discuss-item-editor",style:{display:p===P?"block":"none",width:"100%"}},F.a.createElement(N.a,{miniToolbar:!0,startInit:p===P,defaultValue:o,id:P,noStorage:!0,watch:!1,height:155,placeholder:"\u6211\u8981\u56DE\u590D",showResizeBar:!0,onChange:r}),F.a.createElement("a",{onClick:a,className:"btn-send"},"\u53D1\u9001"))}},BU3w:function(Be,le,D){"use strict";D.d(le,"a",function(){return I});var Q=D("MNnm"),z="rc-util-key";function M(H){if(H.attachTo)return H.attachTo;var N=document.querySelector("head");return N||document.body}function X(H){var N,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(Q.a)())return null;var P=document.createElement("style");if((N=n.csp)===null||N===void 0?void 0:N.nonce){var p;P.nonce=(p=n.csp)===null||p===void 0?void 0:p.nonce}P.innerHTML=H;var m=M(n),d=m.firstChild;return n.prepend&&m.prepend?m.prepend(P):n.prepend&&d?m.insertBefore(P,d):m.appendChild(P),P}var F=new Map;function I(H,N){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},P=M(n);if(!F.has(P)){var p=X("",n),m=p.parentNode;F.set(P,m),m.removeChild(p)}var d=Array.from(F.get(P).children).find(function(a){return a.tagName==="STYLE"&&a[z]===N});if(d){var u,o;if(((u=n.csp)===null||u===void 0?void 0:u.nonce)&&d.nonce!==((o=n.csp)===null||o===void 0?void 0:o.nonce)){var h;d.nonce=(h=n.csp)===null||h===void 0?void 0:h.nonce}return d.innerHTML!==H&&(d.innerHTML=H),d}var r=X(H,n);return r[z]=N,r}},Bd2K:function(Be,le,D){(function(Q){Q(D("VrN/"),D("osHv"))})(function(Q){Q.defineOption("autoCloseTags",!1,function(n,P,p){if(p!=Q.Init&&p&&n.removeKeyMap("autoCloseTags"),!P)return;var m={name:"autoCloseTags"};(typeof P!="object"||P.whenClosing!==!1)&&(m["'/'"]=function(d){return I(d)}),(typeof P!="object"||P.whenOpening!==!1)&&(m["'>'"]=function(d){return X(d)}),n.addKeyMap(m)});var z=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],M=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function X(n){if(n.getOption("disableInput"))return Q.Pass;for(var P=n.listSelections(),p=[],m=n.getOption("autoCloseTags"),d=0;d<P.length;d++){if(!P[d].empty())return Q.Pass;var u=P[d].head,o=n.getTokenAt(u),h=Q.innerMode(n.getMode(),o.state),r=h.state,a=h.mode.xmlCurrentTag&&h.mode.xmlCurrentTag(r),i=a&&a.name;if(!i)return Q.Pass;var s=h.mode.configuration=="html",S=typeof m=="object"&&m.dontCloseTags||s&&z,x=typeof m=="object"&&m.indentTags||s&&M;o.end>u.ch&&(i=i.slice(0,i.length-o.end+u.ch));var T=i.toLowerCase();if(!i||o.type=="string"&&(o.end!=u.ch||!/[\"\']/.test(o.string.charAt(o.string.length-1))||o.string.length==1)||o.type=="tag"&&a.close||o.string.indexOf("/")==u.ch-o.start-1||S&&H(S,T)>-1||N(n,h.mode.xmlCurrentContext&&h.mode.xmlCurrentContext(r)||[],i,u,!0))return Q.Pass;var A=typeof m=="object"&&m.emptyTags;if(A&&H(A,i)>-1){p[d]={text:"/>",newPos:Q.Pos(u.line,u.ch+2)};continue}var w=x&&H(x,T)>-1;p[d]={indent:w,text:">"+(w?`
|
|
|
|
`:"")+"</"+i+">",newPos:w?Q.Pos(u.line+1,0):Q.Pos(u.line,u.ch+1)}}for(var v=typeof m=="object"&&m.dontIndentOnAutoClose,d=P.length-1;d>=0;d--){var b=p[d];n.replaceRange(b.text,P[d].head,P[d].anchor,"+insert");var g=n.listSelections().slice(0);g[d]={head:b.newPos,anchor:b.newPos},n.setSelections(g),!v&&b.indent&&(n.indentLine(b.newPos.line,null,!0),n.indentLine(b.newPos.line+1,null,!0))}}function F(n,P){for(var p=n.listSelections(),m=[],d=P?"/":"</",u=n.getOption("autoCloseTags"),o=typeof u=="object"&&u.dontIndentOnSlash,h=0;h<p.length;h++){if(!p[h].empty())return Q.Pass;var r=p[h].head,a=n.getTokenAt(r),i=Q.innerMode(n.getMode(),a.state),s=i.state;if(P&&(a.type=="string"||a.string.charAt(0)!="<"||a.start!=r.ch-1))return Q.Pass;var S,x=i.mode.name!="xml"&&n.getMode().name=="htmlmixed";if(x&&i.mode.name=="javascript")S=d+"script";else if(x&&i.mode.name=="css")S=d+"style";else{var T=i.mode.xmlCurrentContext&&i.mode.xmlCurrentContext(s);if(!T||T.length&&N(n,T,T[T.length-1],r))return Q.Pass;S=d+T[T.length-1]}n.getLine(r.line).charAt(a.end)!=">"&&(S+=">"),m[h]=S}if(n.replaceSelections(m),p=n.listSelections(),!o)for(var h=0;h<p.length;h++)(h==p.length-1||p[h].head.line<p[h+1].head.line)&&n.indentLine(p[h].head.line)}function I(n){return n.getOption("disableInput")?Q.Pass:F(n,!0)}Q.commands.closeTag=function(n){return F(n)};function H(n,P){if(n.indexOf)return n.indexOf(P);for(var p=0,m=n.length;p<m;++p)if(n[p]==P)return p;return-1}function N(n,P,p,m,d){if(!Q.scanForClosingTag)return!1;var u=Math.min(n.lastLine()+1,m.line+500),o=Q.scanForClosingTag(n,m,null,u);if(!o||o.tag!=p)return!1;for(var h=d?1:0,r=P.length-1;r>=0&&P[r]==p;r--)++h;m=o.to;for(var r=1;r<h;r++){var a=Q.scanForClosingTag(n,m,null,u);if(!a||a.tag!=p)return!1;m=a.to}return!0}})},BdwD:function(Be,le,D){"use strict";var Q=D("+L6B"),z=D("2/Rp"),M=D("0Owb"),X=D("k1fw"),F=D("q1tI"),I=D.n(F),H=D("FOrL"),N=D.n(H),n=function(p){var m=p.buttonProps,d=m===void 0?{}:m,u=p.styles,o=u===void 0?{}:u,h=p.customText,r=p.ButtonText,a=p.ButtonClick,i=p.Buttonclass,s=p.ButtonTwo;return I.a.createElement("section",{className:"tc animated fadeIn",style:Object(X.a)(Object(X.a)({},{color:"#999",margin:"200px auto"}),o)},I.a.createElement("img",{src:N.a}),I.a.createElement("p",{className:"mt20 font14"},h||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),r&&I.a.createElement(z.a,Object(M.a)({className:i,onClick:a},d),r),s&&s)};le.a=n},BjJ7:function(Be,le,D){"use strict";D.d(le,"d",function(){return z}),D.d(le,"c",function(){return M}),D.d(le,"e",function(){return X}),D.d(le,"b",function(){return F}),D.d(le,"a",function(){return H});var Q=D("m3rI");function z(N){var n=!0;if(N.length>0){for(var P=0;P<N.length;P++)if(N[P].compile_success==0||!N[P].compile_success){n=!1;break}}else n=!1;return n}function M(N){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",P=[],p=0;p<N.length;p++){var m=N[p],d=n?"".concat(n,"/").concat(m.name):"".concat(m.name);P.push({title:m.name,isLeaf:!(m.type==="tree"),key:d})}return P}function X(N,n,P){for(var p=0;p<N.length;p++){var m=N[p];if(m.key===n){m.children=P;break}m.children&&X(m.children,n,P)}return N}function F(N,n,P){var p;return function(){var m=this,d=arguments,u=function(){p=null,P||N.apply(m,d)},o=P&&!p;clearTimeout(p),p=setTimeout(u,n),o&&N.apply(m,d)}}var I=!0,H=Q.a.API_SERVER},"C+DQ":function(Be,le,D){},"C/vA":function(Be,le,D){"use strict";D.d(le,"a",function(){return Q});function Q(z){const M=this;let X=!1,F;return function(){return X||(X=!0,F=z.apply(M,arguments)),F}}},CNDd:function(Be,le,D){Be.exports=D.p+"static/c1.517fc2f6.svg"},CaVn:function(Be,le,D){Be.exports={flex_box_center:"flex_box_center___2wZ0h",flex_space_between:"flex_space_between___3MVWH",flex_box_vertical_center:"flex_box_vertical_center___O0jNB",flex_box_center_end:"flex_box_center_end___2q4xj",flex_box_column:"flex_box_column___13R-8",listDetails:"listDetails___3lMam",head:"head___2jzWe",name:"name___3xIfG",title:"title___3-ce8",a:"a___1ZME1",b:"b___oiiqU",tag:"tag___32Ulf",btn:"btn___lJ5fA",scroll:"scroll___anvih",video:"video___1gujl",html:"html___z0BU7",g:"g___3sfQf",btns:"btns___OWbut"}},"Cg/j":function(Be,le,D){"use strict";D.d(le,"b",function(){return Q}),D.d(le,"a",function(){return z}),D.d(le,"c",function(){return X}),D.d(le,"d",function(){return F});var Q;(function(I){I.serviceIds=new Map,I.DI_TARGET="$di$target",I.DI_DEPENDENCIES="$di$dependencies";function H(N){return N[I.DI_DEPENDENCIES]||[]}I.getServiceDependencies=H})(Q||(Q={}));const z=X("instantiationService");function M(I,H,N,n){H[Q.DI_TARGET]===H?H[Q.DI_DEPENDENCIES].push({id:I,index:N,optional:n}):(H[Q.DI_DEPENDENCIES]=[{id:I,index:N,optional:n}],H[Q.DI_TARGET]=H)}function X(I){if(Q.serviceIds.has(I))return Q.serviceIds.get(I);const H=function(N,n,P){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");M(H,N,P,!1)};return H.toString=()=>I,Q.serviceIds.set(I,H),H}function F(I){return function(H,N,n){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");M(I,H,n,!0)}}},CrYA:function(Be,le,D){var Q=D("MFOe"),z=Q.Global;Be.exports={name:"sessionStorage",read:X,write:F,each:I,remove:H,clearAll:N};function M(){return z.sessionStorage}function X(n){return M().getItem(n)}function F(n,P){return M().setItem(n,P)}function I(n){for(var P=M().length-1;P>=0;P--){var p=M().key(P);n(X(p),p)}}function H(n){return M().removeItem(n)}function N(){return M().clear()}},DlQD:function(Be,le,D){(function(Q,z){Be.exports=z()})(this,function(){"use strict";function Q(we,Se){for(var Ee=0;Ee<Se.length;Ee++){var ue=Se[Ee];ue.enumerable=ue.enumerable||!1,ue.configurable=!0,"value"in ue&&(ue.writable=!0),Object.defineProperty(we,ue.key,ue)}}function z(we,Se,Ee){return Se&&Q(we.prototype,Se),Ee&&Q(we,Ee),we}function M(we,Se){if(!we)return;if(typeof we=="string")return X(we,Se);var Ee=Object.prototype.toString.call(we).slice(8,-1);if(Ee==="Object"&&we.constructor&&(Ee=we.constructor.name),Ee==="Map"||Ee==="Set")return Array.from(we);if(Ee==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ee))return X(we,Se)}function X(we,Se){(Se==null||Se>we.length)&&(Se=we.length);for(var Ee=0,ue=new Array(Se);Ee<Se;Ee++)ue[Ee]=we[Ee];return ue}function F(we,Se){var Ee;if(typeof Symbol=="undefined"||we[Symbol.iterator]==null){if(Array.isArray(we)||(Ee=M(we))||Se&&we&&typeof we.length=="number"){Ee&&(we=Ee);var ue=0;return function(){return ue>=we.length?{done:!0}:{done:!1,value:we[ue++]}}}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 Ee=we[Symbol.iterator](),Ee.next.bind(Ee)}function I(we,Se){return Se={exports:{}},we(Se,Se.exports),Se.exports}var H=I(function(we){function Se(){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 Ee(ue){we.exports.defaults=ue}we.exports={defaults:Se(),getDefaults:Se,changeDefaults:Ee}}),N=H.defaults,n=H.getDefaults,P=H.changeDefaults,p=/[&<>"']/,m=/[&<>"']/g,d=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,o={"&":"&","<":"<",">":">",'"':""","'":"'"},h=function(Se){return o[Se]};function r(we,Se){if(Se){if(p.test(we))return we.replace(m,h)}else if(d.test(we))return we.replace(u,h);return we}var a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function i(we){return we.replace(a,function(Se,Ee){return Ee=Ee.toLowerCase(),Ee==="colon"?":":Ee.charAt(0)==="#"?Ee.charAt(1)==="x"?String.fromCharCode(parseInt(Ee.substring(2),16)):String.fromCharCode(+Ee.substring(1)):""})}var s=/(^|[^\[])\^/g;function S(we,Se){we=we.source||we,Se=Se||"";var Ee={replace:function(de,ye){return ye=ye.source||ye,ye=ye.replace(s,"$1"),we=we.replace(de,ye),Ee},getRegex:function(){return new RegExp(we,Se)}};return Ee}var x=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function A(we,Se,Ee){if(we){var ue;try{ue=decodeURIComponent(i(Ee)).replace(x,"").toLowerCase()}catch(de){return null}if(ue.indexOf("javascript:")===0||ue.indexOf("vbscript:")===0||ue.indexOf("data:")===0)return null}Se&&!T.test(Ee)&&(Ee=f(Se,Ee));try{Ee=encodeURI(Ee).replace(/%25/g,"%")}catch(de){return null}return Ee}var w={},v=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,g=/^([^:]+:\/*[^/]*)[\s\S]*$/;function f(we,Se){w[" "+we]||(v.test(we)?w[" "+we]=we+"/":w[" "+we]=U(we,"/",!0)),we=w[" "+we];var Ee=we.indexOf(":")===-1;return Se.substring(0,2)==="//"?Ee?Se:we.replace(b,"$1")+Se:Se.charAt(0)==="/"?Ee?Se:we.replace(g,"$1")+Se:we+Se}var C={exec:function(){}};function E(we){for(var Se=1,Ee,ue;Se<arguments.length;Se++){Ee=arguments[Se];for(ue in Ee)Object.prototype.hasOwnProperty.call(Ee,ue)&&(we[ue]=Ee[ue])}return we}function _(we,Se){var Ee=we.replace(/\|/g,function(ye,me,Le){for(var Xe=!1,ut=me;--ut>=0&&Le[ut]==="\\";)Xe=!Xe;return Xe?"|":" |"}),ue=Ee.split(/ \|/),de=0;if(ue.length>Se)ue.splice(Se);else for(;ue.length<Se;)ue.push("");for(;de<ue.length;de++)ue[de]=ue[de].trim().replace(/\\\|/g,"|");return ue}function U(we,Se,Ee){var ue=we.length;if(ue===0)return"";for(var de=0;de<ue;){var ye=we.charAt(ue-de-1);if(ye===Se&&!Ee)de++;else if(ye!==Se&&Ee)de++;else break}return we.substr(0,ue-de)}function j(we,Se){if(we.indexOf(Se[1])===-1)return-1;for(var Ee=we.length,ue=0,de=0;de<Ee;de++)if(we[de]==="\\")de++;else if(we[de]===Se[0])ue++;else if(we[de]===Se[1]&&(ue--,ue<0))return de;return-1}function L(we){we&&we.sanitize&&!we.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 G={escape:r,unescape:i,edit:S,cleanUrl:A,resolveUrl:f,noopTest:C,merge:E,splitCells:_,rtrim:U,findClosingBracket:j,checkSanitizeDeprecation:L},B=H.defaults,O=G.rtrim,V=G.splitCells,te=G.escape,re=G.findClosingBracket;function ge(we,Se,Ee){var ue=Se.href,de=Se.title?te(Se.title):null,ye=we[1].replace(/\\([\[\]])/g,"$1");return we[0].charAt(0)!=="!"?{type:"link",raw:Ee,href:ue,title:de,text:ye}:{type:"image",raw:Ee,href:ue,title:de,text:te(ye)}}function Ae(we,Se){var Ee=we.match(/^(\s+)(?:```)/);if(Ee===null)return Se;var ue=Ee[1];return Se.split(`
|
|
`).map(function(de){var ye=de.match(/^\s+/);if(ye===null)return de;var me=ye[0];return me.length>=ue.length?de.slice(ue.length):de}).join(`
|
|
`)}var Oe=function(){function we(Ee){this.options=Ee||B}var Se=we.prototype;return Se.space=function(ue){var de=this.rules.block.newline.exec(ue);if(de)return de[0].length>1?{type:"space",raw:de[0]}:{raw:`
|
|
`}},Se.code=function(ue,de){var ye=this.rules.block.code.exec(ue);if(ye){var me=de[de.length-1];if(me&&me.type==="paragraph")return{raw:ye[0],text:ye[0].trimRight()};var Le=ye[0].replace(/^ {4}/gm,"");return{type:"code",raw:ye[0],codeBlockStyle:"indented",text:this.options.pedantic?Le:O(Le,`
|
|
`)}}},Se.fences=function(ue){var de=this.rules.block.fences.exec(ue);if(de){var ye=de[0],me=Ae(ye,de[3]||"");return{type:"code",raw:ye,lang:de[2]?de[2].trim():de[2],text:me}}},Se.heading=function(ue){var de=this.rules.block.heading.exec(ue);if(de)return{type:"heading",raw:de[0],depth:de[1].length,text:de[2]}},Se.nptable=function(ue){var de=this.rules.block.nptable.exec(ue);if(de){var ye={type:"table",header:V(de[1].replace(/^ *| *\| *$/g,"")),align:de[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:de[3]?de[3].replace(/\n$/,"").split(`
|
|
`):[],raw:de[0]};if(ye.header.length===ye.align.length){var me=ye.align.length,Le;for(Le=0;Le<me;Le++)/^ *-+: *$/.test(ye.align[Le])?ye.align[Le]="right":/^ *:-+: *$/.test(ye.align[Le])?ye.align[Le]="center":/^ *:-+ *$/.test(ye.align[Le])?ye.align[Le]="left":ye.align[Le]=null;for(me=ye.cells.length,Le=0;Le<me;Le++)ye.cells[Le]=V(ye.cells[Le],ye.header.length);return ye}}},Se.hr=function(ue){var de=this.rules.block.hr.exec(ue);if(de)return{type:"hr",raw:de[0]}},Se.blockquote=function(ue){var de=this.rules.block.blockquote.exec(ue);if(de){var ye=de[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:de[0],text:ye}}},Se.list=function(ue){var de=this.rules.block.list.exec(ue);if(de){for(var ye=de[0],me=de[2],Le=me.length>1,Xe=me[me.length-1]===")",ut={type:"list",raw:ye,ordered:Le,start:Le?+me.slice(0,-1):"",loose:!1,items:[]},Dt=de[0].match(this.rules.block.item),jt=!1,Ut,Ct,et,st,He,pe,Re,lt=Dt.length,Ye=0;Ye<lt;Ye++)Ut=Dt[Ye],ye=Ut,Ct=Ut.length,Ut=Ut.replace(/^ *([*+-]|\d+[.)]) */,""),~Ut.indexOf(`
|
|
`)&&(Ct-=Ut.length,Ut=this.options.pedantic?Ut.replace(/^ {1,4}/gm,""):Ut.replace(new RegExp("^ {1,"+Ct+"}","gm"),"")),Ye!==lt-1&&(et=this.rules.block.bullet.exec(Dt[Ye+1])[0],(Le?et.length===1||!Xe&&et[et.length-1]===")":et.length>1||this.options.smartLists&&et!==me)&&(st=Dt.slice(Ye+1).join(`
|
|
`),ut.raw=ut.raw.substring(0,ut.raw.length-st.length),Ye=lt-1)),He=jt||/\n\n(?!\s*$)/.test(Ut),Ye!==lt-1&&(jt=Ut.charAt(Ut.length-1)===`
|
|
`,He||(He=jt)),He&&(ut.loose=!0),pe=/^\[[ xX]\] /.test(Ut),Re=void 0,pe&&(Re=Ut[1]!==" ",Ut=Ut.replace(/^\[[ xX]\] +/,"")),ut.items.push({type:"list_item",raw:ye,task:pe,checked:Re,loose:He,text:Ut});return ut}},Se.html=function(ue){var de=this.rules.block.html.exec(ue);if(de)return{type:this.options.sanitize?"paragraph":"html",raw:de[0],pre:!this.options.sanitizer&&(de[1]==="pre"||de[1]==="script"||de[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(de[0]):te(de[0]):de[0]}},Se.def=function(ue){var de=this.rules.block.def.exec(ue);if(de){de[3]&&(de[3]=de[3].substring(1,de[3].length-1));var ye=de[1].toLowerCase().replace(/\s+/g," ");return{tag:ye,raw:de[0],href:de[2],title:de[3]}}},Se.table=function(ue){var de=this.rules.block.table.exec(ue);if(de){var ye={type:"table",header:V(de[1].replace(/^ *| *\| *$/g,"")),align:de[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:de[3]?de[3].replace(/\n$/,"").split(`
|
|
`):[]};if(ye.header.length===ye.align.length){ye.raw=de[0];var me=ye.align.length,Le;for(Le=0;Le<me;Le++)/^ *-+: *$/.test(ye.align[Le])?ye.align[Le]="right":/^ *:-+: *$/.test(ye.align[Le])?ye.align[Le]="center":/^ *:-+ *$/.test(ye.align[Le])?ye.align[Le]="left":ye.align[Le]=null;for(me=ye.cells.length,Le=0;Le<me;Le++)ye.cells[Le]=V(ye.cells[Le].replace(/^ *\| *| *\| *$/g,""),ye.header.length);return ye}}},Se.lheading=function(ue){var de=this.rules.block.lheading.exec(ue);if(de)return{type:"heading",raw:de[0],depth:de[2].charAt(0)==="="?1:2,text:de[1]}},Se.paragraph=function(ue){var de=this.rules.block.paragraph.exec(ue);if(de)return{type:"paragraph",raw:de[0],text:de[1].charAt(de[1].length-1)===`
|
|
`?de[1].slice(0,-1):de[1]}},Se.text=function(ue,de){var ye=this.rules.block.text.exec(ue);if(ye){var me=de[de.length-1];return me&&me.type==="text"?{raw:ye[0],text:ye[0]}:{type:"text",raw:ye[0],text:ye[0]}}},Se.escape=function(ue){var de=this.rules.inline.escape.exec(ue);if(de)return{type:"escape",raw:de[0],text:te(de[1])}},Se.tag=function(ue,de,ye){var me=this.rules.inline.tag.exec(ue);if(me)return!de&&/^<a /i.test(me[0])?de=!0:de&&/^<\/a>/i.test(me[0])&&(de=!1),!ye&&/^<(pre|code|kbd|script)(\s|>)/i.test(me[0])?ye=!0:ye&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(me[0])&&(ye=!1),{type:this.options.sanitize?"text":"html",raw:me[0],inLink:de,inRawBlock:ye,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):te(me[0]):me[0]}},Se.link=function(ue){var de=this.rules.inline.link.exec(ue);if(de){var ye=re(de[2],"()");if(ye>-1){var me=de[0].indexOf("!")===0?5:4,Le=me+de[1].length+ye;de[2]=de[2].substring(0,ye),de[0]=de[0].substring(0,Le).trim(),de[3]=""}var Xe=de[2],ut="";if(this.options.pedantic){var Dt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Xe);Dt?(Xe=Dt[1],ut=Dt[3]):ut=""}else ut=de[3]?de[3].slice(1,-1):"";Xe=Xe.trim().replace(/^<([\s\S]*)>$/,"$1");var jt=ge(de,{href:Xe&&Xe.replace(this.rules.inline._escapes,"$1"),title:ut&&ut.replace(this.rules.inline._escapes,"$1")},de[0]);return jt}},Se.reflink=function(ue,de){var ye;if((ye=this.rules.inline.reflink.exec(ue))||(ye=this.rules.inline.nolink.exec(ue))){var me=(ye[2]||ye[1]).replace(/\s+/g," ");if(me=de[me.toLowerCase()],!me||!me.href){var Le=ye[0].charAt(0);return{type:"text",raw:Le,text:Le}}var Xe=ge(ye,me,ye[0]);return Xe}},Se.strong=function(ue,de,ye){ye===void 0&&(ye="");var me=this.rules.inline.strong.start.exec(ue);if(me&&(!me[1]||me[1]&&(ye===""||this.rules.inline.punctuation.exec(ye)))){de=de.slice(-1*ue.length);var Le=me[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Le.lastIndex=0;for(var Xe;(me=Le.exec(de))!=null;)if(Xe=this.rules.inline.strong.middle.exec(de.slice(0,me.index+3)),Xe)return{type:"strong",raw:ue.slice(0,Xe[0].length),text:ue.slice(2,Xe[0].length-2)}}},Se.em=function(ue,de,ye){ye===void 0&&(ye="");var me=this.rules.inline.em.start.exec(ue);if(me&&(!me[1]||me[1]&&(ye===""||this.rules.inline.punctuation.exec(ye)))){de=de.slice(-1*ue.length);var Le=me[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Le.lastIndex=0;for(var Xe;(me=Le.exec(de))!=null;)if(Xe=this.rules.inline.em.middle.exec(de.slice(0,me.index+2)),Xe)return{type:"em",raw:ue.slice(0,Xe[0].length),text:ue.slice(1,Xe[0].length-1)}}},Se.codespan=function(ue){var de=this.rules.inline.code.exec(ue);if(de){var ye=de[2].replace(/\n/g," "),me=/[^ ]/.test(ye),Le=ye.startsWith(" ")&&ye.endsWith(" ");return me&&Le&&(ye=ye.substring(1,ye.length-1)),ye=te(ye,!0),{type:"codespan",raw:de[0],text:ye}}},Se.br=function(ue){var de=this.rules.inline.br.exec(ue);if(de)return{type:"br",raw:de[0]}},Se.del=function(ue){var de=this.rules.inline.del.exec(ue);if(de)return{type:"del",raw:de[0],text:de[1]}},Se.autolink=function(ue,de){var ye=this.rules.inline.autolink.exec(ue);if(ye){var me,Le;return ye[2]==="@"?(me=te(this.options.mangle?de(ye[1]):ye[1]),Le="mailto:"+me):(me=te(ye[1]),Le=me),{type:"link",raw:ye[0],text:me,href:Le,tokens:[{type:"text",raw:me,text:me}]}}},Se.url=function(ue,de){var ye;if(ye=this.rules.inline.url.exec(ue)){var me,Le;if(ye[2]==="@")me=te(this.options.mangle?de(ye[0]):ye[0]),Le="mailto:"+me;else{var Xe;do Xe=ye[0],ye[0]=this.rules.inline._backpedal.exec(ye[0])[0];while(Xe!==ye[0]);me=te(ye[0]),ye[1]==="www."?Le="http://"+me:Le=me}return{type:"link",raw:ye[0],text:me,href:Le,tokens:[{type:"text",raw:me,text:me}]}}},Se.inlineText=function(ue,de,ye){var me=this.rules.inline.text.exec(ue);if(me){var Le;return de?Le=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):te(me[0]):me[0]:Le=te(this.options.smartypants?ye(me[0]):me[0]),{type:"text",raw:me[0],text:Le}}},we}(),Ce=G.noopTest,je=G.edit,Ue=G.merge,xe={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:Ce,table:Ce,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};xe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,xe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,xe.def=je(xe.def).replace("label",xe._label).replace("title",xe._title).getRegex(),xe.bullet=/(?:[*+-]|\d{1,9}[.)])/,xe.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,xe.item=je(xe.item,"gm").replace(/bull/g,xe.bullet).getRegex(),xe.list=je(xe.list).replace(/bull/g,xe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+xe.def.source+")").getRegex(),xe._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",xe._comment=/<!--(?!-?>)[\s\S]*?-->/,xe.html=je(xe.html,"i").replace("comment",xe._comment).replace("tag",xe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),xe.paragraph=je(xe._paragraph).replace("hr",xe.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",xe._tag).getRegex(),xe.blockquote=je(xe.blockquote).replace("paragraph",xe.paragraph).getRegex(),xe.normal=Ue({},xe),xe.gfm=Ue({},xe.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*|$)"}),xe.gfm.nptable=je(xe.gfm.nptable).replace("hr",xe.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",xe._tag).getRegex(),xe.gfm.table=je(xe.gfm.table).replace("hr",xe.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",xe._tag).getRegex(),xe.pedantic=Ue({},xe.normal,{html:je(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",xe._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:Ce,paragraph:je(xe.normal._paragraph).replace("hr",xe.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",xe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var be={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ce,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:Ce,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};be._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",be.punctuation=je(be.punctuation).replace(/punctuation/g,be._punctuation).getRegex(),be._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",be._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",be.em.start=je(be.em.start).replace(/punctuation/g,be._punctuation).getRegex(),be.em.middle=je(be.em.middle).replace(/punctuation/g,be._punctuation).replace(/overlapSkip/g,be._overlapSkip).getRegex(),be.em.endAst=je(be.em.endAst,"g").replace(/punctuation/g,be._punctuation).getRegex(),be.em.endUnd=je(be.em.endUnd,"g").replace(/punctuation/g,be._punctuation).getRegex(),be.strong.start=je(be.strong.start).replace(/punctuation/g,be._punctuation).getRegex(),be.strong.middle=je(be.strong.middle).replace(/punctuation/g,be._punctuation).replace(/blockSkip/g,be._blockSkip).getRegex(),be.strong.endAst=je(be.strong.endAst,"g").replace(/punctuation/g,be._punctuation).getRegex(),be.strong.endUnd=je(be.strong.endUnd,"g").replace(/punctuation/g,be._punctuation).getRegex(),be.blockSkip=je(be._blockSkip,"g").getRegex(),be.overlapSkip=je(be._overlapSkip,"g").getRegex(),be._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,be._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,be._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])?)+(?![-_])/,be.autolink=je(be.autolink).replace("scheme",be._scheme).replace("email",be._email).getRegex(),be._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,be.tag=je(be.tag).replace("comment",xe._comment).replace("attribute",be._attribute).getRegex(),be._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,be._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,be._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,be.link=je(be.link).replace("label",be._label).replace("href",be._href).replace("title",be._title).getRegex(),be.reflink=je(be.reflink).replace("label",be._label).getRegex(),be.reflinkSearch=je(be.reflinkSearch,"g").replace("reflink",be.reflink).replace("nolink",be.nolink).getRegex(),be.normal=Ue({},be),be.pedantic=Ue({},be.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:je(/^!?\[(label)\]\((.*?)\)/).replace("label",be._label).getRegex(),reflink:je(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",be._label).getRegex()}),be.gfm=Ue({},be.normal,{escape:je(be.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),be.gfm.url=je(be.gfm.url,"i").replace("email",be.gfm._extended_email).getRegex(),be.breaks=Ue({},be.gfm,{br:je(be.br).replace("{2,}","*").getRegex(),text:je(be.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Ve={block:xe,inline:be},mt=H.defaults,yt=Ve.block,_t=Ve.inline;function xt(we){return we.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 nt(we){var Se="",Ee,ue,de=we.length;for(Ee=0;Ee<de;Ee++)ue=we.charCodeAt(Ee),Math.random()>.5&&(ue="x"+ue.toString(16)),Se+="&#"+ue+";";return Se}var ct=function(){function we(Ee){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ee||mt,this.options.tokenizer=this.options.tokenizer||new Oe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ue={block:yt.normal,inline:_t.normal};this.options.pedantic?(ue.block=yt.pedantic,ue.inline=_t.pedantic):this.options.gfm&&(ue.block=yt.gfm,this.options.breaks?ue.inline=_t.breaks:ue.inline=_t.gfm),this.tokenizer.rules=ue}we.lex=function(ue,de){var ye=new we(de);return ye.lex(ue)};var Se=we.prototype;return Se.lex=function(ue){return ue=ue.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(ue,this.tokens,!0),this.inline(this.tokens),this.tokens},Se.blockTokens=function(ue,de,ye){de===void 0&&(de=[]),ye===void 0&&(ye=!0),ue=ue.replace(/^ +$/gm,"");for(var me,Le,Xe,ut;ue;){if(me=this.tokenizer.space(ue)){ue=ue.substring(me.raw.length),me.type&&de.push(me);continue}if(me=this.tokenizer.code(ue,de)){ue=ue.substring(me.raw.length),me.type?de.push(me):(ut=de[de.length-1],ut.raw+=`
|
|
`+me.raw,ut.text+=`
|
|
`+me.text);continue}if(me=this.tokenizer.fences(ue)){ue=ue.substring(me.raw.length),de.push(me);continue}if(me=this.tokenizer.heading(ue)){ue=ue.substring(me.raw.length),de.push(me);continue}if(me=this.tokenizer.nptable(ue)){ue=ue.substring(me.raw.length),de.push(me);continue}if(me=this.tokenizer.hr(ue)){ue=ue.substring(me.raw.length),de.push(me);continue}if(me=this.tokenizer.blockquote(ue)){ue=ue.substring(me.raw.length),me.tokens=this.blockTokens(me.text,[],ye),de.push(me);continue}if(me=this.tokenizer.list(ue)){for(ue=ue.substring(me.raw.length),Xe=me.items.length,Le=0;Le<Xe;Le++)me.items[Le].tokens=this.blockTokens(me.items[Le].text,[],!1);de.push(me);continue}if(me=this.tokenizer.html(ue)){ue=ue.substring(me.raw.length),de.push(me);continue}if(ye&&(me=this.tokenizer.def(ue))){ue=ue.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(ue)){ue=ue.substring(me.raw.length),de.push(me);continue}if(me=this.tokenizer.lheading(ue)){ue=ue.substring(me.raw.length),de.push(me);continue}if(ye&&(me=this.tokenizer.paragraph(ue))){ue=ue.substring(me.raw.length),de.push(me);continue}if(me=this.tokenizer.text(ue,de)){ue=ue.substring(me.raw.length),me.type?de.push(me):(ut=de[de.length-1],ut.raw+=`
|
|
`+me.raw,ut.text+=`
|
|
`+me.text);continue}if(ue){var Dt="Infinite loop on byte: "+ue.charCodeAt(0);if(this.options.silent){console.error(Dt);break}else throw new Error(Dt)}}return de},Se.inline=function(ue){var de,ye,me,Le,Xe,ut,Dt=ue.length;for(de=0;de<Dt;de++){ut=ue[de];switch(ut.type){case"paragraph":case"text":case"heading":{ut.tokens=[],this.inlineTokens(ut.text,ut.tokens);break}case"table":{for(ut.tokens={header:[],cells:[]},Le=ut.header.length,ye=0;ye<Le;ye++)ut.tokens.header[ye]=[],this.inlineTokens(ut.header[ye],ut.tokens.header[ye]);for(Le=ut.cells.length,ye=0;ye<Le;ye++)for(Xe=ut.cells[ye],ut.tokens.cells[ye]=[],me=0;me<Xe.length;me++)ut.tokens.cells[ye][me]=[],this.inlineTokens(Xe[me],ut.tokens.cells[ye][me]);break}case"blockquote":{this.inline(ut.tokens);break}case"list":{for(Le=ut.items.length,ye=0;ye<Le;ye++)this.inline(ut.items[ye].tokens);break}}}return ue},Se.inlineTokens=function(ue,de,ye,me,Le){de===void 0&&(de=[]),ye===void 0&&(ye=!1),me===void 0&&(me=!1),Le===void 0&&(Le="");var Xe,ut=ue,Dt;if(this.tokens.links){var jt=Object.keys(this.tokens.links);if(jt.length>0)for(;(Dt=this.tokenizer.rules.inline.reflinkSearch.exec(ut))!=null;)jt.includes(Dt[0].slice(Dt[0].lastIndexOf("[")+1,-1))&&(ut=ut.slice(0,Dt.index)+"["+"a".repeat(Dt[0].length-2)+"]"+ut.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Dt=this.tokenizer.rules.inline.blockSkip.exec(ut))!=null;)ut=ut.slice(0,Dt.index)+"["+"a".repeat(Dt[0].length-2)+"]"+ut.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ue;){if(Xe=this.tokenizer.escape(ue)){ue=ue.substring(Xe.raw.length),de.push(Xe);continue}if(Xe=this.tokenizer.tag(ue,ye,me)){ue=ue.substring(Xe.raw.length),ye=Xe.inLink,me=Xe.inRawBlock,de.push(Xe);continue}if(Xe=this.tokenizer.link(ue)){ue=ue.substring(Xe.raw.length),Xe.type==="link"&&(Xe.tokens=this.inlineTokens(Xe.text,[],!0,me)),de.push(Xe);continue}if(Xe=this.tokenizer.reflink(ue,this.tokens.links)){ue=ue.substring(Xe.raw.length),Xe.type==="link"&&(Xe.tokens=this.inlineTokens(Xe.text,[],!0,me)),de.push(Xe);continue}if(Xe=this.tokenizer.strong(ue,ut,Le)){ue=ue.substring(Xe.raw.length),Xe.tokens=this.inlineTokens(Xe.text,[],ye,me),de.push(Xe);continue}if(Xe=this.tokenizer.em(ue,ut,Le)){ue=ue.substring(Xe.raw.length),Xe.tokens=this.inlineTokens(Xe.text,[],ye,me),de.push(Xe);continue}if(Xe=this.tokenizer.codespan(ue)){ue=ue.substring(Xe.raw.length),de.push(Xe);continue}if(Xe=this.tokenizer.br(ue)){ue=ue.substring(Xe.raw.length),de.push(Xe);continue}if(Xe=this.tokenizer.del(ue)){ue=ue.substring(Xe.raw.length),Xe.tokens=this.inlineTokens(Xe.text,[],ye,me),de.push(Xe);continue}if(Xe=this.tokenizer.autolink(ue,nt)){ue=ue.substring(Xe.raw.length),de.push(Xe);continue}if(!ye&&(Xe=this.tokenizer.url(ue,nt))){ue=ue.substring(Xe.raw.length),de.push(Xe);continue}if(Xe=this.tokenizer.inlineText(ue,me,xt)){ue=ue.substring(Xe.raw.length),Le=Xe.raw.slice(-1),de.push(Xe);continue}if(ue){var Ut="Infinite loop on byte: "+ue.charCodeAt(0);if(this.options.silent){console.error(Ut);break}else throw new Error(Ut)}}return de},z(we,null,[{key:"rules",get:function(){return{block:yt,inline:_t}}}]),we}(),wt=H.defaults,_e=G.cleanUrl,Me=G.escape,ve=function(){function we(Ee){this.options=Ee||wt}var Se=we.prototype;return Se.code=function(ue,de,ye){var me=(de||"").match(/\S*/)[0];if(this.options.highlight){var Le=this.options.highlight(ue,me);Le!=null&&Le!==ue&&(ye=!0,ue=Le)}return me?'<pre><code class="'+this.options.langPrefix+Me(me,!0)+'">'+(ye?ue:Me(ue,!0))+`</code></pre>
|
|
`:"<pre><code>"+(ye?ue:Me(ue,!0))+`</code></pre>
|
|
`},Se.blockquote=function(ue){return`<blockquote>
|
|
`+ue+`</blockquote>
|
|
`},Se.html=function(ue){return ue},Se.heading=function(ue,de,ye,me){return this.options.headerIds?"<h"+de+' id="'+this.options.headerPrefix+me.slug(ye)+'">'+ue+"</h"+de+`>
|
|
`:"<h"+de+">"+ue+"</h"+de+`>
|
|
`},Se.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},Se.list=function(ue,de,ye){var me=de?"ol":"ul",Le=de&&ye!==1?' start="'+ye+'"':"";return"<"+me+Le+`>
|
|
`+ue+"</"+me+`>
|
|
`},Se.listitem=function(ue){return"<li>"+ue+`</li>
|
|
`},Se.checkbox=function(ue){return"<input "+(ue?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Se.paragraph=function(ue){return"<p>"+ue+`</p>
|
|
`},Se.table=function(ue,de){return de&&(de="<tbody>"+de+"</tbody>"),`<table>
|
|
<thead>
|
|
`+ue+`</thead>
|
|
`+de+`</table>
|
|
`},Se.tablerow=function(ue){return`<tr>
|
|
`+ue+`</tr>
|
|
`},Se.tablecell=function(ue,de){var ye=de.header?"th":"td",me=de.align?"<"+ye+' align="'+de.align+'">':"<"+ye+">";return me+ue+"</"+ye+`>
|
|
`},Se.strong=function(ue){return"<strong>"+ue+"</strong>"},Se.em=function(ue){return"<em>"+ue+"</em>"},Se.codespan=function(ue){return"<code>"+ue+"</code>"},Se.br=function(){return this.options.xhtml?"<br/>":"<br>"},Se.del=function(ue){return"<del>"+ue+"</del>"},Se.link=function(ue,de,ye){if(ue=_e(this.options.sanitize,this.options.baseUrl,ue),ue===null)return ye;var me='<a href="'+Me(ue)+'"';return de&&(me+=' title="'+de+'"'),me+=">"+ye+"</a>",me},Se.image=function(ue,de,ye){if(ue=_e(this.options.sanitize,this.options.baseUrl,ue),ue===null)return ye;var me='<img src="'+ue+'" alt="'+ye+'"';return de&&(me+=' title="'+de+'"'),me+=this.options.xhtml?"/>":">",me},Se.text=function(ue){return ue},we}(),Te=function(){function we(){}var Se=we.prototype;return Se.strong=function(ue){return ue},Se.em=function(ue){return ue},Se.codespan=function(ue){return ue},Se.del=function(ue){return ue},Se.html=function(ue){return ue},Se.text=function(ue){return ue},Se.link=function(ue,de,ye){return""+ye},Se.image=function(ue,de,ye){return""+ye},Se.br=function(){return""},we}(),We=function(){function we(){this.seen={}}var Se=we.prototype;return Se.slug=function(ue){var de=ue.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(de)){var ye=de;do this.seen[ye]++,de=ye+"-"+this.seen[ye];while(this.seen.hasOwnProperty(de))}return this.seen[de]=0,de},we}(),Je=H.defaults,at=G.unescape,dt=function(){function we(Ee){this.options=Ee||Je,this.options.renderer=this.options.renderer||new ve,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Te,this.slugger=new We}we.parse=function(ue,de){var ye=new we(de);return ye.parse(ue)};var Se=we.prototype;return Se.parse=function(ue,de){de===void 0&&(de=!0);var ye="",me,Le,Xe,ut,Dt,jt,Ut,Ct,et,st,He,pe,Re,lt,Ye,Pt,Nt,Ke,gt=ue.length;for(me=0;me<gt;me++){st=ue[me];switch(st.type){case"space":continue;case"hr":{ye+=this.renderer.hr();continue}case"heading":{ye+=this.renderer.heading(this.parseInline(st.tokens),st.depth,at(this.parseInline(st.tokens,this.textRenderer)),this.slugger);continue}case"code":{ye+=this.renderer.code(st.text,st.lang,st.escaped);continue}case"table":{for(Ct="",Ut="",ut=st.header.length,Le=0;Le<ut;Le++)Ut+=this.renderer.tablecell(this.parseInline(st.tokens.header[Le]),{header:!0,align:st.align[Le]});for(Ct+=this.renderer.tablerow(Ut),et="",ut=st.cells.length,Le=0;Le<ut;Le++){for(jt=st.tokens.cells[Le],Ut="",Dt=jt.length,Xe=0;Xe<Dt;Xe++)Ut+=this.renderer.tablecell(this.parseInline(jt[Xe]),{header:!1,align:st.align[Xe]});et+=this.renderer.tablerow(Ut)}ye+=this.renderer.table(Ct,et);continue}case"blockquote":{et=this.parse(st.tokens),ye+=this.renderer.blockquote(et);continue}case"list":{for(He=st.ordered,pe=st.start,Re=st.loose,ut=st.items.length,et="",Le=0;Le<ut;Le++)Ye=st.items[Le],Pt=Ye.checked,Nt=Ye.task,lt="",Ye.task&&(Ke=this.renderer.checkbox(Pt),Re?Ye.tokens.length>0&&Ye.tokens[0].type==="text"?(Ye.tokens[0].text=Ke+" "+Ye.tokens[0].text,Ye.tokens[0].tokens&&Ye.tokens[0].tokens.length>0&&Ye.tokens[0].tokens[0].type==="text"&&(Ye.tokens[0].tokens[0].text=Ke+" "+Ye.tokens[0].tokens[0].text)):Ye.tokens.unshift({type:"text",text:Ke}):lt+=Ke),lt+=this.parse(Ye.tokens,Re),et+=this.renderer.listitem(lt,Nt,Pt);ye+=this.renderer.list(et,He,pe);continue}case"html":{ye+=this.renderer.html(st.text);continue}case"paragraph":{ye+=this.renderer.paragraph(this.parseInline(st.tokens));continue}case"text":{for(et=st.tokens?this.parseInline(st.tokens):st.text;me+1<gt&&ue[me+1].type==="text";)st=ue[++me],et+=`
|
|
`+(st.tokens?this.parseInline(st.tokens):st.text);ye+=de?this.renderer.paragraph(et):et;continue}default:{var bt='Token with "'+st.type+'" type was not found.';if(this.options.silent){console.error(bt);return}else throw new Error(bt)}}}return ye},Se.parseInline=function(ue,de){de=de||this.renderer;var ye="",me,Le,Xe=ue.length;for(me=0;me<Xe;me++){Le=ue[me];switch(Le.type){case"escape":{ye+=de.text(Le.text);break}case"html":{ye+=de.html(Le.text);break}case"link":{ye+=de.link(Le.href,Le.title,this.parseInline(Le.tokens,de));break}case"image":{ye+=de.image(Le.href,Le.title,Le.text);break}case"strong":{ye+=de.strong(this.parseInline(Le.tokens,de));break}case"em":{ye+=de.em(this.parseInline(Le.tokens,de));break}case"codespan":{ye+=de.codespan(Le.text);break}case"br":{ye+=de.br();break}case"del":{ye+=de.del(this.parseInline(Le.tokens,de));break}case"text":{ye+=de.text(Le.text);break}default:{var ut='Token with "'+Le.type+'" type was not found.';if(this.options.silent){console.error(ut);return}else throw new Error(ut)}}}return ye},we}(),Lt=G.merge,It=G.checkSanitizeDeprecation,Ne=G.escape,ke=H.getDefaults,it=H.changeDefaults,ot=H.defaults;function Ge(we,Se,Ee){if(typeof we=="undefined"||we===null)throw new Error("marked(): input parameter is undefined or null");if(typeof we!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(we)+", string expected");if(typeof Se=="function"&&(Ee=Se,Se=null),Se=Lt({},Ge.defaults,Se||{}),It(Se),Ee){var ue=Se.highlight,de;try{de=ct.lex(we,Se)}catch(Xe){return Ee(Xe)}var ye=function(ut){var Dt;if(!ut)try{Dt=dt.parse(de,Se)}catch(jt){ut=jt}return Se.highlight=ue,ut?Ee(ut):Ee(null,Dt)};if(!ue||ue.length<3)return ye();if(delete Se.highlight,!de.length)return ye();var me=0;Ge.walkTokens(de,function(Xe){Xe.type==="code"&&(me++,setTimeout(function(){ue(Xe.text,Xe.lang,function(ut,Dt){if(ut)return ye(ut);Dt!=null&&Dt!==Xe.text&&(Xe.text=Dt,Xe.escaped=!0),me--,me===0&&ye()})},0))}),me===0&&ye();return}try{var Le=ct.lex(we,Se);return Se.walkTokens&&Ge.walkTokens(Le,Se.walkTokens),dt.parse(Le,Se)}catch(Xe){if(Xe.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,Se.silent)return"<p>An error occurred:</p><pre>"+Ne(Xe.message+"",!0)+"</pre>";throw Xe}}Ge.options=Ge.setOptions=function(we){return Lt(Ge.defaults,we),it(Ge.defaults),Ge},Ge.getDefaults=ke,Ge.defaults=ot,Ge.use=function(we){var Se=Lt({},we);if(we.renderer&&function(){var ue=Ge.defaults.renderer||new ve,de=function(Le){var Xe=ue[Le];ue[Le]=function(){for(var ut=arguments.length,Dt=new Array(ut),jt=0;jt<ut;jt++)Dt[jt]=arguments[jt];var Ut=we.renderer[Le].apply(ue,Dt);return Ut===!1&&(Ut=Xe.apply(ue,Dt)),Ut}};for(var ye in we.renderer)de(ye);Se.renderer=ue}(),we.tokenizer&&function(){var ue=Ge.defaults.tokenizer||new Oe,de=function(Le){var Xe=ue[Le];ue[Le]=function(){for(var ut=arguments.length,Dt=new Array(ut),jt=0;jt<ut;jt++)Dt[jt]=arguments[jt];var Ut=we.tokenizer[Le].apply(ue,Dt);return Ut===!1&&(Ut=Xe.apply(ue,Dt)),Ut}};for(var ye in we.tokenizer)de(ye);Se.tokenizer=ue}(),we.walkTokens){var Ee=Ge.defaults.walkTokens;Se.walkTokens=function(ue){we.walkTokens(ue),Ee&&Ee(ue)}}Ge.setOptions(Se)},Ge.walkTokens=function(we,Se){for(var Ee=F(we),ue;!(ue=Ee()).done;){var de=ue.value;Se(de);switch(de.type){case"table":{for(var ye=F(de.tokens.header),me;!(me=ye()).done;){var Le=me.value;Ge.walkTokens(Le,Se)}for(var Xe=F(de.tokens.cells),ut;!(ut=Xe()).done;)for(var Dt=ut.value,jt=F(Dt),Ut;!(Ut=jt()).done;){var Ct=Ut.value;Ge.walkTokens(Ct,Se)}break}case"list":{Ge.walkTokens(de.items,Se);break}default:de.tokens&&Ge.walkTokens(de.tokens,Se)}}},Ge.Parser=dt,Ge.parser=dt.parse,Ge.Renderer=ve,Ge.TextRenderer=Te,Ge.Lexer=ct,Ge.lexer=ct.lex,Ge.Tokenizer=Oe,Ge.Slugger=We,Ge.parse=Ge;var $e=Ge;return $e})},"DlR+":function(Be,le,D){var Q=D("MFOe"),z=Q.Global,M=Q.trim;Be.exports={name:"cookieStorage",read:F,write:H,each:I,remove:N,clearAll:n};var X=z.document;function F(p){if(!p||!P(p))return null;var m="(?:^|.*;\\s*)"+escape(p).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(X.cookie.replace(new RegExp(m),"$1"))}function I(p){for(var m=X.cookie.split(/; ?/g),d=m.length-1;d>=0;d--){if(!M(m[d]))continue;var u=m[d].split("="),o=unescape(u[0]),h=unescape(u[1]);p(h,o)}}function H(p,m){if(!p)return;X.cookie=escape(p)+"="+escape(m)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function N(p){if(!p||!P(p))return;X.cookie=escape(p)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function n(){I(function(p,m){N(m)})}function P(p){return new RegExp("(?:^|;\\s*)"+escape(p).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(X.cookie)}},E2g8:function(Be,le,D){(function(Q,z){/*!
|
|
* @overview es6-promise - a tiny implementation of Promises/A+.
|
|
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
|
|
* @license Licensed under MIT license
|
|
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
|
|
* @version v4.2.8+1e68dce6
|
|
*/(function(M,X){Be.exports=X()})(this,function(){"use strict";function M(ve){var Te=typeof ve;return ve!==null&&(Te==="object"||Te==="function")}function X(ve){return typeof ve=="function"}var F=void 0;Array.isArray?F=Array.isArray:F=function(ve){return Object.prototype.toString.call(ve)==="[object Array]"};var I=F,H=0,N=void 0,n=void 0,P=function(Te,We){T[H]=Te,T[H+1]=We,H+=2,H===2&&(n?n(A):v())};function p(ve){n=ve}function m(ve){P=ve}var d=typeof window!="undefined"?window:void 0,u=d||{},o=u.MutationObserver||u.WebKitMutationObserver,h=typeof self=="undefined"&&typeof Q!="undefined"&&{}.toString.call(Q)==="[object process]",r=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function a(){return function(){return Q.nextTick(A)}}function i(){return typeof N!="undefined"?function(){N(A)}:x()}function s(){var ve=0,Te=new o(A),We=document.createTextNode("");return Te.observe(We,{characterData:!0}),function(){We.data=ve=++ve%2}}function S(){var ve=new MessageChannel;return ve.port1.onmessage=A,function(){return ve.port2.postMessage(0)}}function x(){var ve=setTimeout;return function(){return ve(A,1)}}var T=new Array(1e3);function A(){for(var ve=0;ve<H;ve+=2){var Te=T[ve],We=T[ve+1];Te(We),T[ve]=void 0,T[ve+1]=void 0}H=0}function w(){try{var ve=Function("return this")().require("vertx");return N=ve.runOnLoop||ve.runOnContext,i()}catch(Te){return x()}}var v=void 0;h?v=a():o?v=s():r?v=S():d===void 0&&!0?v=w():v=x();function b(ve,Te){var We=this,Je=new this.constructor(C);Je[f]===void 0&&Ve(Je);var at=We._state;if(at){var dt=arguments[at-1];P(function(){return je(at,Je,dt,We._result)})}else Oe(We,Je,ve,Te);return Je}function g(ve){var Te=this;if(ve&&typeof ve=="object"&&ve.constructor===Te)return ve;var We=new Te(C);return te(We,ve),We}var f=Math.random().toString(36).substring(2);function C(){}var E=void 0,_=1,U=2;function j(){return new TypeError("You cannot resolve a promise with itself")}function L(){return new TypeError("A promises callback cannot return that same promise.")}function G(ve,Te,We,Je){try{ve.call(Te,We,Je)}catch(at){return at}}function B(ve,Te,We){P(function(Je){var at=!1,dt=G(We,Te,function(Lt){if(at)return;at=!0,Te!==Lt?te(Je,Lt):ge(Je,Lt)},function(Lt){if(at)return;at=!0,Ae(Je,Lt)},"Settle: "+(Je._label||" unknown promise"));!at&&dt&&(at=!0,Ae(Je,dt))},ve)}function O(ve,Te){Te._state===_?ge(ve,Te._result):Te._state===U?Ae(ve,Te._result):Oe(Te,void 0,function(We){return te(ve,We)},function(We){return Ae(ve,We)})}function V(ve,Te,We){Te.constructor===ve.constructor&&We===b&&Te.constructor.resolve===g?O(ve,Te):We===void 0?ge(ve,Te):X(We)?B(ve,Te,We):ge(ve,Te)}function te(ve,Te){if(ve===Te)Ae(ve,j());else if(M(Te)){var We=void 0;try{We=Te.then}catch(Je){Ae(ve,Je);return}V(ve,Te,We)}else ge(ve,Te)}function re(ve){ve._onerror&&ve._onerror(ve._result),Ce(ve)}function ge(ve,Te){if(ve._state!==E)return;ve._result=Te,ve._state=_,ve._subscribers.length!==0&&P(Ce,ve)}function Ae(ve,Te){if(ve._state!==E)return;ve._state=U,ve._result=Te,P(re,ve)}function Oe(ve,Te,We,Je){var at=ve._subscribers,dt=at.length;ve._onerror=null,at[dt]=Te,at[dt+_]=We,at[dt+U]=Je,dt===0&&ve._state&&P(Ce,ve)}function Ce(ve){var Te=ve._subscribers,We=ve._state;if(Te.length===0)return;for(var Je=void 0,at=void 0,dt=ve._result,Lt=0;Lt<Te.length;Lt+=3)Je=Te[Lt],at=Te[Lt+We],Je?je(We,Je,at,dt):at(dt);ve._subscribers.length=0}function je(ve,Te,We,Je){var at=X(We),dt=void 0,Lt=void 0,It=!0;if(at){try{dt=We(Je)}catch(Ne){It=!1,Lt=Ne}if(Te===dt){Ae(Te,L());return}}else dt=Je;Te._state!==E||(at&&It?te(Te,dt):It===!1?Ae(Te,Lt):ve===_?ge(Te,dt):ve===U&&Ae(Te,dt))}function Ue(ve,Te){try{Te(function(Je){te(ve,Je)},function(Je){Ae(ve,Je)})}catch(We){Ae(ve,We)}}var xe=0;function be(){return xe++}function Ve(ve){ve[f]=xe++,ve._state=void 0,ve._result=void 0,ve._subscribers=[]}function mt(){return new Error("Array Methods must be provided an Array")}var yt=function(){function ve(Te,We){this._instanceConstructor=Te,this.promise=new Te(C),this.promise[f]||Ve(this.promise),I(We)?(this.length=We.length,this._remaining=We.length,this._result=new Array(this.length),this.length===0?ge(this.promise,this._result):(this.length=this.length||0,this._enumerate(We),this._remaining===0&&ge(this.promise,this._result))):Ae(this.promise,mt())}return ve.prototype._enumerate=function(We){for(var Je=0;this._state===E&&Je<We.length;Je++)this._eachEntry(We[Je],Je)},ve.prototype._eachEntry=function(We,Je){var at=this._instanceConstructor,dt=at.resolve;if(dt===g){var Lt=void 0,It=void 0,Ne=!1;try{Lt=We.then}catch(it){Ne=!0,It=it}if(Lt===b&&We._state!==E)this._settledAt(We._state,Je,We._result);else if(typeof Lt!="function")this._remaining--,this._result[Je]=We;else if(at===_e){var ke=new at(C);Ne?Ae(ke,It):V(ke,We,Lt),this._willSettleAt(ke,Je)}else this._willSettleAt(new at(function(it){return it(We)}),Je)}else this._willSettleAt(dt(We),Je)},ve.prototype._settledAt=function(We,Je,at){var dt=this.promise;dt._state===E&&(this._remaining--,We===U?Ae(dt,at):this._result[Je]=at),this._remaining===0&&ge(dt,this._result)},ve.prototype._willSettleAt=function(We,Je){var at=this;Oe(We,void 0,function(dt){return at._settledAt(_,Je,dt)},function(dt){return at._settledAt(U,Je,dt)})},ve}();function _t(ve){return new yt(this,ve).promise}function xt(ve){var Te=this;return I(ve)?new Te(function(We,Je){for(var at=ve.length,dt=0;dt<at;dt++)Te.resolve(ve[dt]).then(We,Je)}):new Te(function(We,Je){return Je(new TypeError("You must pass an array to race."))})}function nt(ve){var Te=this,We=new Te(C);return Ae(We,ve),We}function ct(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function wt(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var _e=function(){function ve(Te){this[f]=be(),this._result=this._state=void 0,this._subscribers=[],C!==Te&&(typeof Te!="function"&&ct(),this instanceof ve?Ue(this,Te):wt())}return ve.prototype.catch=function(We){return this.then(null,We)},ve.prototype.finally=function(We){var Je=this,at=Je.constructor;return X(We)?Je.then(function(dt){return at.resolve(We()).then(function(){return dt})},function(dt){return at.resolve(We()).then(function(){throw dt})}):Je.then(We,We)},ve}();_e.prototype.then=b,_e.all=_t,_e.race=xt,_e.resolve=g,_e.reject=nt,_e._setScheduler=p,_e._setAsap=m,_e._asap=P;function Me(){var ve=void 0;if(typeof z!="undefined")ve=z;else if(typeof self!="undefined")ve=self;else try{ve=Function("return this")()}catch(Je){throw new Error("polyfill failed because global object is unavailable in this environment")}var Te=ve.Promise;if(Te){var We=null;try{We=Object.prototype.toString.call(Te.resolve())}catch(Je){}if(We==="[object Promise]"&&!Te.cast)return}ve.Promise=_e}return _e.polyfill=Me,_e.Promise=_e,_e})}).call(this,D("Q2Ig"),D("IyRk"))},E9nw:function(Be,le){Be.exports=function(){var D=document.getSelection();if(!D.rangeCount)return function(){};for(var Q=document.activeElement,z=[],M=0;M<D.rangeCount;M++)z.push(D.getRangeAt(M));switch(Q.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":Q.blur();break;default:Q=null;break}return D.removeAllRanges(),function(){D.type==="Caret"&&D.removeAllRanges(),D.rangeCount||z.forEach(function(X){D.addRange(X)}),Q&&Q.focus()}}},EHPI:function(Be,le,D){"use strict";var Q=D("bbsP"),z=D("/wGt"),M=D("tJVT"),X=D("k1fw"),F=D("q1tI"),I=D.n(F),H=D("ZW9T"),N=D("ZD9Y"),n=D("M8RZ"),P=D("bCnd"),p=D("fcyK"),m=D.n(p),d={theme:Object(P.a)("cmCodeMode","vs-dark"),fontSize:Object(P.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(P.a)("cmTabToSpace",!0)},u;(function(r){r[r.set_font_size=0]="set_font_size",r[r.set_theme=1]="set_theme",r[r.on_tab_to_space=2]="on_tab_to_space",r[r.set_show_editor_setting=3]="set_show_editor_setting"})(u||(u={}));function o(r,a){switch(a.type){case u.set_show_editor_setting:return Object(X.a)(Object(X.a)({},r),{},{showEditorSetting:a.payload});case u.set_theme:return Object(X.a)(Object(X.a)({},r),{},{theme:a.payload});case u.set_font_size:return Object(X.a)(Object(X.a)({},r),{},{fontSize:a.payload});case u.on_tab_to_space:return Object(X.a)(Object(X.a)({},r),{},{tabToSpace:a.payload});default:throw new Error}}le.a=function(r){var a=r.isLoading,i=r.value,s=r.onChange,S=r.language,x=r.ActionBarRender,T=x===void 0?function(G){return I.a.createElement(h,{onShowCodeSetting:G})}:x,A=Object(F.useReducer)(o,d),w=Object(M.a)(A,2),v=w[0],b=w[1],g=v.theme,f=v.fontSize,C=v.showEditorSetting,E=v.tabToSpace,_={onFontSizeChange:function(B){b({type:u.set_font_size,payload:B}),Object(P.b)("cmFontSize",B)},tabToSpace:E,cmFontSize:f,className:"oj",cmCodeMode:g,onTabToSpace:function(B){b({type:u.on_tab_to_space,payload:B}),Object(P.b)("cmTabToSpace",B)},onCodeModeChange:function(B){b({type:u.set_theme,payload:B}),Object(P.b)("cmCodeMode",B)}};function U(){b({type:u.set_show_editor_setting,payload:!1})}function j(){b({type:u.set_show_editor_setting,payload:!0})}var L={value:i,language:S,onChange:s,theme:g,height:"calc(100% - 56px)",options:{fontSize:f,insertSpaces:E}};return I.a.createElement(F.Fragment,null,I.a.createElement("div",{className:"code-panel-container"},T(j),!a&&I.a.createElement(H.b,L)),I.a.createElement(n.a,null,I.a.createElement(z.a,{className:"oj",title:null,placement:"right",closable:!1,visible:C,onClose:U},I.a.createElement(N.a,_))))};function h(r){var a=r.onShowCodeSetting;return I.a.createElement("div",{className:"action-bar"},I.a.createElement("span",null,"\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"),I.a.createElement("a",{onClick:a},I.a.createElement("i",{className:"iconfont icon-shezhi"})))}},ELLl:function(Be,le,D){(function(Q){Q(D("VrN/"))})(function(Q){var z={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},M=Q.Pos;Q.defineOption("autoCloseBrackets",!1,function(o,h,r){r&&r!=Q.Init&&(o.removeKeyMap(F),o.state.closeBrackets=null),h&&(I(X(h,"pairs")),o.state.closeBrackets=h,o.addKeyMap(F))});function X(o,h){return h=="pairs"&&typeof o=="string"?o:typeof o=="object"&&o[h]!=null?o[h]:z[h]}var F={Backspace:n,Enter:P};function I(o){for(var h=0;h<o.length;h++){var r=o.charAt(h),a="'"+r+"'";F[a]||(F[a]=H(r))}}I(z.pairs+"`");function H(o){return function(h){return m(h,o)}}function N(o){var h=o.state.closeBrackets;if(!h||h.override)return h;var r=o.getModeAt(o.getCursor());return r.closeBrackets||h}function n(o){var h=N(o);if(!h||o.getOption("disableInput"))return Q.Pass;for(var r=X(h,"pairs"),a=o.listSelections(),i=0;i<a.length;i++){if(!a[i].empty())return Q.Pass;var s=d(o,a[i].head);if(!s||r.indexOf(s)%2!=0)return Q.Pass}for(var i=a.length-1;i>=0;i--){var S=a[i].head;o.replaceRange("",M(S.line,S.ch-1),M(S.line,S.ch+1),"+delete")}}function P(o){var h=N(o),r=h&&X(h,"explode");if(!r||o.getOption("disableInput"))return Q.Pass;for(var a=o.listSelections(),i=0;i<a.length;i++){if(!a[i].empty())return Q.Pass;var s=d(o,a[i].head);if(!s||r.indexOf(s)%2!=0)return Q.Pass}o.operation(function(){var S=o.lineSeparator()||`
|
|
`;o.replaceSelection(S+S,null),o.execCommand("goCharLeft"),a=o.listSelections();for(var x=0;x<a.length;x++){var T=a[x].head.line;o.indentLine(T,null,!0),o.indentLine(T+1,null,!0)}})}function p(o){var h=Q.cmpPos(o.anchor,o.head)>0;return{anchor:new M(o.anchor.line,o.anchor.ch+(h?-1:1)),head:new M(o.head.line,o.head.ch+(h?1:-1))}}function m(o,h){var r=N(o);if(!r||o.getOption("disableInput"))return Q.Pass;var a=X(r,"pairs"),i=a.indexOf(h);if(i==-1)return Q.Pass;for(var s=X(r,"closeBefore"),S=X(r,"triples"),x=a.charAt(i+1)==h,T=o.listSelections(),A=i%2==0,w,v=0;v<T.length;v++){var b=T[v],g=b.head,f,C=o.getRange(g,M(g.line,g.ch+1));if(A&&!b.empty())f="surround";else if((x||!A)&&C==h)x&&u(o,g)?f="both":S.indexOf(h)>=0&&o.getRange(g,M(g.line,g.ch+3))==h+h+h?f="skipThree":f="skip";else if(x&&g.ch>1&&S.indexOf(h)>=0&&o.getRange(M(g.line,g.ch-2),g)==h+h){if(g.ch>2&&/\bstring/.test(o.getTokenTypeAt(M(g.line,g.ch-2))))return Q.Pass;f="addFour"}else if(x){var E=g.ch==0?" ":o.getRange(M(g.line,g.ch-1),g);if(!Q.isWordChar(C)&&E!=h&&!Q.isWordChar(E))f="both";else return Q.Pass}else if(A&&(C.length===0||/\s/.test(C)||s.indexOf(C)>-1))f="both";else return Q.Pass;if(!w)w=f;else if(w!=f)return Q.Pass}var _=i%2?a.charAt(i-1):h,U=i%2?h:a.charAt(i+1);o.operation(function(){if(w=="skip")o.execCommand("goCharRight");else if(w=="skipThree")for(var j=0;j<3;j++)o.execCommand("goCharRight");else if(w=="surround"){for(var L=o.getSelections(),j=0;j<L.length;j++)L[j]=_+L[j]+U;o.replaceSelections(L,"around"),L=o.listSelections().slice();for(var j=0;j<L.length;j++)L[j]=p(L[j]);o.setSelections(L)}else w=="both"?(o.replaceSelection(_+U,null),o.triggerElectric(_+U),o.execCommand("goCharLeft")):w=="addFour"&&(o.replaceSelection(_+_+_+_,"before"),o.execCommand("goCharRight"))})}function d(o,h){var r=o.getRange(M(h.line,h.ch-1),M(h.line,h.ch+1));return r.length==2?r:null}function u(o,h){var r=o.getTokenAt(M(h.line,h.ch+1));return/\bstring/.test(r.type)&&r.start==h.ch&&(h.ch==0||!/\bstring/.test(o.getTokenTypeAt(h)))}})},FOrL:function(Be,le,D){Be.exports=D.p+"static/nodata.a6b3f948.png"},FWmy:function(Be,le,D){"use strict";D.d(le,"a",function(){return Q});function Q(z,M){if(!z)throw new Error(M?`Assertion failed (${M})`:"Assertion Failed")}},GUcZ:function(Be,le,D){"use strict";var Q=D("fWQN"),z=D("mtLc"),M=function(){function fe(){Object(Q.a)(this,fe)}return Object(z.a)(fe,null,[{key:"install",value:function(){Object.setPrototypeOf=Object.setPrototypeOf||function(W,$){return W.__proto__=$,W},Object.assign=Object.assign||function(W){if(W==null)throw new TypeError("Cannot convert undefined or null to object");for(var $=Object(W),Z=1;Z<arguments.length;Z++){var ne=arguments[Z];if(ne!=null)for(var he in ne)ne.hasOwnProperty(he)&&($[he]=ne[he])}return $},typeof self.Promise!="function"&&D("E2g8").polyfill()}}]),fe}();M.install();var X=M,F=D("+qE3"),I=D.n(F),H=function(){function fe(){Object(Q.a)(this,fe)}return Object(z.a)(fe,null,[{key:"e",value:function(W,$){(!W||fe.FORCE_GLOBAL_TAG)&&(W=fe.GLOBAL_TAG);var Z="[".concat(W,"] > ").concat($);if(fe.ENABLE_CALLBACK&&fe.emitter.emit("log","error",Z),!fe.ENABLE_ERROR)return;console.error?console.error(Z):console.warn?console.warn(Z):console.log(Z)}},{key:"i",value:function(W,$){(!W||fe.FORCE_GLOBAL_TAG)&&(W=fe.GLOBAL_TAG);var Z="[".concat(W,"] > ").concat($);if(fe.ENABLE_CALLBACK&&fe.emitter.emit("log","info",Z),!fe.ENABLE_INFO)return;console.info?console.info(Z):console.log(Z)}},{key:"w",value:function(W,$){(!W||fe.FORCE_GLOBAL_TAG)&&(W=fe.GLOBAL_TAG);var Z="[".concat(W,"] > ").concat($);if(fe.ENABLE_CALLBACK&&fe.emitter.emit("log","warn",Z),!fe.ENABLE_WARN)return;console.warn?console.warn(Z):console.log(Z)}},{key:"d",value:function(W,$){(!W||fe.FORCE_GLOBAL_TAG)&&(W=fe.GLOBAL_TAG);var Z="[".concat(W,"] > ").concat($);if(fe.ENABLE_CALLBACK&&fe.emitter.emit("log","debug",Z),!fe.ENABLE_DEBUG)return;console.debug?console.debug(Z):console.log(Z)}},{key:"v",value:function(W,$){(!W||fe.FORCE_GLOBAL_TAG)&&(W=fe.GLOBAL_TAG);var Z="[".concat(W,"] > ").concat($);if(fe.ENABLE_CALLBACK&&fe.emitter.emit("log","verbose",Z),!fe.ENABLE_VERBOSE)return;console.log(Z)}}]),fe}();H.GLOBAL_TAG="flv.js",H.FORCE_GLOBAL_TAG=!1,H.ENABLE_ERROR=!0,H.ENABLE_INFO=!0,H.ENABLE_WARN=!0,H.ENABLE_DEBUG=!0,H.ENABLE_VERBOSE=!0,H.ENABLE_CALLBACK=!1,H.emitter=new I.a;var N=H,n=function(){function fe(){Object(Q.a)(this,fe),this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return Object(z.a)(fe,[{key:"reset",value:function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}},{key:"addBytes",value:function(W){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=W,this._totalBytes+=W):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=W,this._totalBytes+=W):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=W,this._totalBytes+=W,this._lastCheckpoint=this._now())}},{key:"currentKBps",get:function(){this.addBytes(0);var W=(this._now()-this._lastCheckpoint)/1e3;return W==0&&(W=1),this._intervalBytes/W/1024}},{key:"lastSecondKBps",get:function(){return this.addBytes(0),this._lastSecondBytes!==0?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}},{key:"averageKBps",get:function(){var W=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/W/1024}}]),fe}(),P=n,p=D("yKVA"),m=D("879j"),d=function(){function fe(se){Object(Q.a)(this,fe),this._message=se}return Object(z.a)(fe,[{key:"name",get:function(){return"RuntimeException"}},{key:"message",get:function(){return this._message}},{key:"toString",value:function(){return this.name+": "+this.message}}]),fe}(),u=function(fe){Object(p.a)(W,fe);var se=Object(m.a)(W);function W($){return Object(Q.a)(this,W),se.call(this,$)}return Object(z.a)(W,[{key:"name",get:function(){return"IllegalStateException"}}]),W}(d),o=function(fe){Object(p.a)(W,fe);var se=Object(m.a)(W);function W($){return Object(Q.a)(this,W),se.call(this,$)}return Object(z.a)(W,[{key:"name",get:function(){return"InvalidArgumentException"}}]),W}(d),h=function(fe){Object(p.a)(W,fe);var se=Object(m.a)(W);function W($){return Object(Q.a)(this,W),se.call(this,$)}return Object(z.a)(W,[{key:"name",get:function(){return"NotImplementedException"}}]),W}(d),r={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},a={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},i=function(){function fe(se){Object(Q.a)(this,fe),this._type=se||"undefined",this._status=r.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return Object(z.a)(fe,[{key:"destroy",value:function(){this._status=r.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}},{key:"isWorking",value:function(){return this._status===r.kConnecting||this._status===r.kBuffering}},{key:"type",get:function(){return this._type}},{key:"status",get:function(){return this._status}},{key:"needStashBuffer",get:function(){return this._needStash}},{key:"onContentLengthKnown",get:function(){return this._onContentLengthKnown},set:function(W){this._onContentLengthKnown=W}},{key:"onURLRedirect",get:function(){return this._onURLRedirect},set:function(W){this._onURLRedirect=W}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(W){this._onDataArrival=W}},{key:"onError",get:function(){return this._onError},set:function(W){this._onError=W}},{key:"onComplete",get:function(){return this._onComplete},set:function(W){this._onComplete=W}},{key:"open",value:function(W,$){throw new h("Unimplemented abstract function!")}},{key:"abort",value:function(){throw new h("Unimplemented abstract function!")}}]),fe}(),s=D("oZsa");function S(fe,se){for(;!Object.prototype.hasOwnProperty.call(fe,se)&&!(fe=Object(s.a)(fe),fe===null););return fe}function x(fe,se,W){return typeof Reflect!="undefined"&&Reflect.get?x=Reflect.get:x=function(Z,ne,he){var Pe=S(Z,ne);if(!Pe)return;var ze=Object.getOwnPropertyDescriptor(Pe,ne);return ze.get?ze.get.call(he):ze.value},x(fe,se,W||fe)}var T={};function A(){var fe=self.navigator.userAgent.toLowerCase(),se=/(edge)\/([\w.]+)/.exec(fe)||/(opr)[\/]([\w.]+)/.exec(fe)||/(chrome)[ \/]([\w.]+)/.exec(fe)||/(iemobile)[\/]([\w.]+)/.exec(fe)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(fe)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(fe)||/(webkit)[ \/]([\w.]+)/.exec(fe)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(fe)||/(msie) ([\w.]+)/.exec(fe)||fe.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(fe)||fe.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(fe)||[],W=/(ipad)/.exec(fe)||/(ipod)/.exec(fe)||/(windows phone)/.exec(fe)||/(iphone)/.exec(fe)||/(kindle)/.exec(fe)||/(android)/.exec(fe)||/(windows)/.exec(fe)||/(mac)/.exec(fe)||/(linux)/.exec(fe)||/(cros)/.exec(fe)||[],$={browser:se[5]||se[3]||se[1]||"",version:se[2]||se[4]||"0",majorVersion:se[4]||se[2]||"0",platform:W[0]||""},Z={};if($.browser){Z[$.browser]=!0;var ne=$.majorVersion.split(".");Z.version={major:parseInt($.majorVersion,10),string:$.version},ne.length>1&&(Z.version.minor=parseInt(ne[1],10)),ne.length>2&&(Z.version.build=parseInt(ne[2],10))}if($.platform&&(Z[$.platform]=!0),(Z.chrome||Z.opr||Z.safari)&&(Z.webkit=!0),Z.rv||Z.iemobile){Z.rv&&delete Z.rv;var he="msie";$.browser=he,Z[he]=!0}if(Z.edge){delete Z.edge;var Pe="msedge";$.browser=Pe,Z[Pe]=!0}if(Z.opr){var ze="opera";$.browser=ze,Z[ze]=!0}if(Z.safari&&Z.android){var Rt="android";$.browser=Rt,Z[Rt]=!0}Z.name=$.browser,Z.platform=$.platform;for(var Mt in T)T.hasOwnProperty(Mt)&&delete T[Mt];Object.assign(T,Z)}A();var w=T,v=function(fe){Object(p.a)(W,fe);var se=Object(m.a)(W);function W($,Z){var ne;return Object(Q.a)(this,W),ne=se.call(this,"fetch-stream-loader"),ne.TAG="FetchStreamLoader",ne._seekHandler=$,ne._config=Z,ne._needStash=!0,ne._requestAbort=!1,ne._contentLength=null,ne._receivedLength=0,ne}return Object(z.a)(W,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),x(Object(s.a)(W.prototype),"destroy",this).call(this)}},{key:"open",value:function(Z,ne){var he=this;this._dataSource=Z,this._range=ne;var Pe=Z.url;this._config.reuseRedirectedURL&&Z.redirectedURL!=null&&(Pe=Z.redirectedURL);var ze=this._seekHandler.getConfig(Pe,ne),Rt=new self.Headers;if(typeof ze.headers=="object"){var Mt=ze.headers;for(var Ze in Mt)Mt.hasOwnProperty(Ze)&&Rt.append(Ze,Mt[Ze])}var kt={method:"GET",headers:Rt,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var an in this._config.headers)Rt.append(an,this._config.headers[an]);Z.cors===!1&&(kt.mode="same-origin"),Z.withCredentials&&(kt.credentials="include"),Z.referrerPolicy&&(kt.referrerPolicy=Z.referrerPolicy),this._status=r.kConnecting,self.fetch(ze.url,kt).then(function(At){if(he._requestAbort){he._requestAbort=!1,he._status=r.kIdle;return}if(At.ok&&At.status>=200&&At.status<=299){if(At.url!==ze.url&&he._onURLRedirect){var pn=he._seekHandler.removeURLParameters(At.url);he._onURLRedirect(pn)}var nn=At.headers.get("Content-Length");return nn!=null&&(he._contentLength=parseInt(nn),he._contentLength!==0&&(he._onContentLengthKnown&&he._onContentLengthKnown(he._contentLength))),he._pump.call(he,At.body.getReader())}else if(he._status=r.kError,he._onError)he._onError(a.HTTP_STATUS_CODE_INVALID,{code:At.status,msg:At.statusText});else throw new d("FetchStreamLoader: Http code invalid, "+At.status+" "+At.statusText)}).catch(function(At){if(he._status=r.kError,he._onError)he._onError(a.EXCEPTION,{code:-1,msg:At.message});else throw At})}},{key:"abort",value:function(){this._requestAbort=!0}},{key:"_pump",value:function(Z){var ne=this;return Z.read().then(function(he){if(he.done)if(ne._contentLength!==null&&ne._receivedLength<ne._contentLength){ne._status=r.kError;var Pe=a.EARLY_EOF,ze={code:-1,msg:"Fetch stream meet Early-EOF"};if(ne._onError)ne._onError(Pe,ze);else throw new d(ze.msg)}else ne._status=r.kComplete,ne._onComplete&&ne._onComplete(ne._range.from,ne._range.from+ne._receivedLength-1);else{if(ne._requestAbort===!0)return ne._requestAbort=!1,ne._status=r.kComplete,Z.cancel();ne._status=r.kBuffering;var Rt=he.value.buffer,Mt=ne._range.from+ne._receivedLength;ne._receivedLength+=Rt.byteLength,ne._onDataArrival&&ne._onDataArrival(Rt,Mt,ne._receivedLength),ne._pump(Z)}}).catch(function(he){if(he.code===11&&w.msedge)return;ne._status=r.kError;var Pe=0,ze=null;if((he.code===19||he.message==="network error")&&(ne._contentLength===null||ne._contentLength!==null&&ne._receivedLength<ne._contentLength)?(Pe=a.EARLY_EOF,ze={code:he.code,msg:"Fetch stream meet Early-EOF"}):(Pe=a.EXCEPTION,ze={code:he.code,msg:he.message}),ne._onError)ne._onError(Pe,ze);else throw new d(ze.msg)})}}],[{key:"isSupported",value:function(){try{var Z=w.msedge&&w.version.minor>=15048,ne=w.msedge?Z:!0;return self.fetch&&self.ReadableStream&&ne}catch(he){return!1}}}]),W}(i),b=v,g=function(fe){Object(p.a)(W,fe);var se=Object(m.a)(W);function W($,Z){var ne;return Object(Q.a)(this,W),ne=se.call(this,"xhr-moz-chunked-loader"),ne.TAG="MozChunkedLoader",ne._seekHandler=$,ne._config=Z,ne._needStash=!0,ne._xhr=null,ne._requestAbort=!1,ne._contentLength=null,ne._receivedLength=0,ne}return Object(z.a)(W,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),x(Object(s.a)(W.prototype),"destroy",this).call(this)}},{key:"open",value:function(Z,ne){this._dataSource=Z,this._range=ne;var he=Z.url;this._config.reuseRedirectedURL&&Z.redirectedURL!=null&&(he=Z.redirectedURL);var Pe=this._seekHandler.getConfig(he,ne);this._requestURL=Pe.url;var ze=this._xhr=new XMLHttpRequest;if(ze.open("GET",Pe.url,!0),ze.responseType="moz-chunked-arraybuffer",ze.onreadystatechange=this._onReadyStateChange.bind(this),ze.onprogress=this._onProgress.bind(this),ze.onloadend=this._onLoadEnd.bind(this),ze.onerror=this._onXhrError.bind(this),Z.withCredentials&&(ze.withCredentials=!0),typeof Pe.headers=="object"){var Rt=Pe.headers;for(var Mt in Rt)Rt.hasOwnProperty(Mt)&&ze.setRequestHeader(Mt,Rt[Mt])}if(typeof this._config.headers=="object"){var Ze=this._config.headers;for(var kt in Ze)Ze.hasOwnProperty(kt)&&ze.setRequestHeader(kt,Ze[kt])}this._status=r.kConnecting,ze.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=r.kComplete}},{key:"_onReadyStateChange",value:function(Z){var ne=Z.target;if(ne.readyState===2){if(ne.responseURL!=null&&ne.responseURL!==this._requestURL&&this._onURLRedirect){var he=this._seekHandler.removeURLParameters(ne.responseURL);this._onURLRedirect(he)}if(ne.status!==0&&(ne.status<200||ne.status>299))if(this._status=r.kError,this._onError)this._onError(a.HTTP_STATUS_CODE_INVALID,{code:ne.status,msg:ne.statusText});else throw new d("MozChunkedLoader: Http code invalid, "+ne.status+" "+ne.statusText);else this._status=r.kBuffering}}},{key:"_onProgress",value:function(Z){if(this._status===r.kError)return;this._contentLength===null&&(Z.total!==null&&Z.total!==0&&(this._contentLength=Z.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)));var ne=Z.target.response,he=this._range.from+this._receivedLength;this._receivedLength+=ne.byteLength,this._onDataArrival&&this._onDataArrival(ne,he,this._receivedLength)}},{key:"_onLoadEnd",value:function(Z){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===r.kError)return;this._status=r.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}},{key:"_onXhrError",value:function(Z){this._status=r.kError;var ne=0,he=null;if(this._contentLength&&Z.loaded<this._contentLength?(ne=a.EARLY_EOF,he={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(ne=a.EXCEPTION,he={code:-1,msg:Z.constructor.name+" "+Z.type}),this._onError)this._onError(ne,he);else throw new d(he.msg)}}],[{key:"isSupported",value:function(){try{var Z=new XMLHttpRequest;return Z.open("GET","https://example.com",!0),Z.responseType="moz-chunked-arraybuffer",Z.responseType==="moz-chunked-arraybuffer"}catch(ne){return N.w("MozChunkedLoader",ne.message),!1}}}]),W}(i),f=g,C=function(fe){Object(p.a)(W,fe);var se=Object(m.a)(W);function W($,Z){var ne;return Object(Q.a)(this,W),ne=se.call(this,"xhr-msstream-loader"),ne.TAG="MSStreamLoader",ne._seekHandler=$,ne._config=Z,ne._needStash=!0,ne._xhr=null,ne._reader=null,ne._totalRange=null,ne._currentRange=null,ne._currentRequestURL=null,ne._currentRedirectedURL=null,ne._contentLength=null,ne._receivedLength=0,ne._bufferLimit=16*1024*1024,ne._lastTimeBufferSize=0,ne._isReconnecting=!1,ne}return Object(z.a)(W,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._reader&&(this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr=null),x(Object(s.a)(W.prototype),"destroy",this).call(this)}},{key:"open",value:function(Z,ne){this._internalOpen(Z,ne,!1)}},{key:"_internalOpen",value:function(Z,ne,he){this._dataSource=Z,he?this._currentRange=ne:this._totalRange=ne;var Pe=Z.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?Pe=this._currentRedirectedURL:Z.redirectedURL!=null&&(Pe=Z.redirectedURL));var ze=this._seekHandler.getConfig(Pe,ne);this._currentRequestURL=ze.url;var Rt=this._reader=new self.MSStreamReader;Rt.onprogress=this._msrOnProgress.bind(this),Rt.onload=this._msrOnLoad.bind(this),Rt.onerror=this._msrOnError.bind(this);var Mt=this._xhr=new XMLHttpRequest;if(Mt.open("GET",ze.url,!0),Mt.responseType="ms-stream",Mt.onreadystatechange=this._xhrOnReadyStateChange.bind(this),Mt.onerror=this._xhrOnError.bind(this),Z.withCredentials&&(Mt.withCredentials=!0),typeof ze.headers=="object"){var Ze=ze.headers;for(var kt in Ze)Ze.hasOwnProperty(kt)&&Mt.setRequestHeader(kt,Ze[kt])}if(typeof this._config.headers=="object"){var an=this._config.headers;for(var At in an)an.hasOwnProperty(At)&&Mt.setRequestHeader(At,an[At])}this._isReconnecting?this._isReconnecting=!1:this._status=r.kConnecting,Mt.send()}},{key:"abort",value:function(){this._internalAbort(),this._status=r.kComplete}},{key:"_internalAbort",value:function(){this._reader&&(this._reader.readyState===1&&this._reader.abort(),this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.abort(),this._xhr.onreadystatechange=null,this._xhr=null)}},{key:"_xhrOnReadyStateChange",value:function(Z){var ne=Z.target;if(ne.readyState===2)if(ne.status>=200&&ne.status<=299){if(this._status=r.kBuffering,ne.responseURL!=null){var he=this._seekHandler.removeURLParameters(ne.responseURL);ne.responseURL!==this._currentRequestURL&&he!==this._currentRedirectedURL&&(this._currentRedirectedURL=he,this._onURLRedirect&&this._onURLRedirect(he))}var Pe=ne.getResponseHeader("Content-Length");if(Pe!=null&&this._contentLength==null){var ze=parseInt(Pe);ze>0&&(this._contentLength=ze,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=r.kError,this._onError)this._onError(a.HTTP_STATUS_CODE_INVALID,{code:ne.status,msg:ne.statusText});else throw new d("MSStreamLoader: Http code invalid, "+ne.status+" "+ne.statusText);else if(ne.readyState===3&&(ne.status>=200&&ne.status<=299)){this._status=r.kBuffering;var Rt=ne.response;this._reader.readAsArrayBuffer(Rt)}}},{key:"_xhrOnError",value:function(Z){this._status=r.kError;var ne=a.EXCEPTION,he={code:-1,msg:Z.constructor.name+" "+Z.type};if(this._onError)this._onError(ne,he);else throw new d(he.msg)}},{key:"_msrOnProgress",value:function(Z){var ne=Z.target,he=ne.result;if(he==null){this._doReconnectIfNeeded();return}var Pe=he.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=he.byteLength;var ze=this._totalRange.from+this._receivedLength;this._receivedLength+=Pe.byteLength,this._onDataArrival&&this._onDataArrival(Pe,ze,this._receivedLength),he.byteLength>=this._bufferLimit&&(N.v(this.TAG,"MSStream buffer exceeded max size near ".concat(ze+Pe.byteLength,", reconnecting...")),this._doReconnectIfNeeded())}},{key:"_doReconnectIfNeeded",value:function(){if(this._contentLength==null||this._receivedLength<this._contentLength){this._isReconnecting=!0,this._lastTimeBufferSize=0,this._internalAbort();var Z={from:this._totalRange.from+this._receivedLength,to:-1};this._internalOpen(this._dataSource,Z,!0)}}},{key:"_msrOnLoad",value:function(Z){this._status=r.kComplete,this._onComplete&&this._onComplete(this._totalRange.from,this._totalRange.from+this._receivedLength-1)}},{key:"_msrOnError",value:function(Z){this._status=r.kError;var ne=0,he=null;if(this._contentLength&&this._receivedLength<this._contentLength?(ne=a.EARLY_EOF,he={code:-1,msg:"MSStream meet Early-Eof"}):(ne=a.EARLY_EOF,he={code:-1,msg:Z.constructor.name+" "+Z.type}),this._onError)this._onError(ne,he);else throw new d(he.msg)}}],[{key:"isSupported",value:function(){try{if(typeof self.MSStream=="undefined"||typeof self.MSStreamReader=="undefined")return!1;var Z=new XMLHttpRequest;return Z.open("GET","https://example.com",!0),Z.responseType="ms-stream",Z.responseType==="ms-stream"}catch(ne){return N.w("MSStreamLoader",ne.message),!1}}}]),W}(i),E=C,_=function(fe){Object(p.a)(W,fe);var se=Object(m.a)(W);function W($,Z){var ne;return Object(Q.a)(this,W),ne=se.call(this,"xhr-range-loader"),ne.TAG="RangeLoader",ne._seekHandler=$,ne._config=Z,ne._needStash=!1,ne._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],ne._currentChunkSizeKB=384,ne._currentSpeedNormalized=0,ne._zeroSpeedChunkCount=0,ne._xhr=null,ne._speedSampler=new P,ne._requestAbort=!1,ne._waitForTotalLength=!1,ne._totalLengthReceived=!1,ne._currentRequestURL=null,ne._currentRedirectedURL=null,ne._currentRequestRange=null,ne._totalLength=null,ne._contentLength=null,ne._receivedLength=0,ne._lastTimeLoaded=0,ne}return Object(z.a)(W,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),x(Object(s.a)(W.prototype),"destroy",this).call(this)}},{key:"currentSpeed",get:function(){return this._speedSampler.lastSecondKBps}},{key:"open",value:function(Z,ne){this._dataSource=Z,this._range=ne,this._status=r.kConnecting;var he=!1;this._dataSource.filesize!=null&&this._dataSource.filesize!==0&&(he=!0,this._totalLength=this._dataSource.filesize),!this._totalLengthReceived&&!he?(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1})):this._openSubRange()}},{key:"_openSubRange",value:function(){var Z=this._currentChunkSizeKB*1024,ne=this._range.from+this._receivedLength,he=ne+Z;this._contentLength!=null&&(he-this._range.from>=this._contentLength&&(he=this._range.from+this._contentLength-1)),this._currentRequestRange={from:ne,to:he},this._internalOpen(this._dataSource,this._currentRequestRange)}},{key:"_internalOpen",value:function(Z,ne){this._lastTimeLoaded=0;var he=Z.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?he=this._currentRedirectedURL:Z.redirectedURL!=null&&(he=Z.redirectedURL));var Pe=this._seekHandler.getConfig(he,ne);this._currentRequestURL=Pe.url;var ze=this._xhr=new XMLHttpRequest;if(ze.open("GET",Pe.url,!0),ze.responseType="arraybuffer",ze.onreadystatechange=this._onReadyStateChange.bind(this),ze.onprogress=this._onProgress.bind(this),ze.onload=this._onLoad.bind(this),ze.onerror=this._onXhrError.bind(this),Z.withCredentials&&(ze.withCredentials=!0),typeof Pe.headers=="object"){var Rt=Pe.headers;for(var Mt in Rt)Rt.hasOwnProperty(Mt)&&ze.setRequestHeader(Mt,Rt[Mt])}if(typeof this._config.headers=="object"){var Ze=this._config.headers;for(var kt in Ze)Ze.hasOwnProperty(kt)&&ze.setRequestHeader(kt,Ze[kt])}ze.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._internalAbort(),this._status=r.kComplete}},{key:"_internalAbort",value:function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}},{key:"_onReadyStateChange",value:function(Z){var ne=Z.target;if(ne.readyState===2){if(ne.responseURL!=null){var he=this._seekHandler.removeURLParameters(ne.responseURL);ne.responseURL!==this._currentRequestURL&&he!==this._currentRedirectedURL&&(this._currentRedirectedURL=he,this._onURLRedirect&&this._onURLRedirect(he))}if(ne.status>=200&&ne.status<=299){if(this._waitForTotalLength)return;this._status=r.kBuffering}else if(this._status=r.kError,this._onError)this._onError(a.HTTP_STATUS_CODE_INVALID,{code:ne.status,msg:ne.statusText});else throw new d("RangeLoader: Http code invalid, "+ne.status+" "+ne.statusText)}}},{key:"_onProgress",value:function(Z){if(this._status===r.kError)return;if(this._contentLength===null){var ne=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,ne=!0;var he=Z.total;this._internalAbort(),he!=null&he!==0&&(this._totalLength=he)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,ne){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var Pe=Z.loaded-this._lastTimeLoaded;this._lastTimeLoaded=Z.loaded,this._speedSampler.addBytes(Pe)}},{key:"_normalizeSpeed",value:function(Z){var ne=this._chunkSizeKBList,he=ne.length-1,Pe=0,ze=0,Rt=he;if(Z<ne[0])return ne[0];for(;ze<=Rt;){if(Pe=ze+Math.floor((Rt-ze)/2),Pe===he||Z>=ne[Pe]&&Z<ne[Pe+1])return ne[Pe];ne[Pe]<Z?ze=Pe+1:Rt=Pe-1}}},{key:"_onLoad",value:function(Z){if(this._status===r.kError)return;if(this._waitForTotalLength){this._waitForTotalLength=!1;return}this._lastTimeLoaded=0;var ne=this._speedSampler.lastSecondKBps;if(ne===0&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(ne=this._speedSampler.currentKBps)),ne!==0){var he=this._normalizeSpeed(ne);this._currentSpeedNormalized!==he&&(this._currentSpeedNormalized=he,this._currentChunkSizeKB=he)}var Pe=Z.target.response,ze=this._range.from+this._receivedLength;this._receivedLength+=Pe.byteLength;var Rt=!1;this._contentLength!=null&&this._receivedLength<this._contentLength?this._openSubRange():Rt=!0,this._onDataArrival&&this._onDataArrival(Pe,ze,this._receivedLength),Rt&&(this._status=r.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}},{key:"_onXhrError",value:function(Z){this._status=r.kError;var ne=0,he=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(ne=a.EARLY_EOF,he={code:-1,msg:"RangeLoader meet Early-Eof"}):(ne=a.EXCEPTION,he={code:-1,msg:Z.constructor.name+" "+Z.type}),this._onError)this._onError(ne,he);else throw new d(he.msg)}}],[{key:"isSupported",value:function(){try{var Z=new XMLHttpRequest;return Z.open("GET","https://example.com",!0),Z.responseType="arraybuffer",Z.responseType==="arraybuffer"}catch(ne){return N.w("RangeLoader",ne.message),!1}}}]),W}(i),U=_,j=function(fe){Object(p.a)(W,fe);var se=Object(m.a)(W);function W(){var $;return Object(Q.a)(this,W),$=se.call(this,"websocket-loader"),$.TAG="WebSocketLoader",$._needStash=!0,$._ws=null,$._requestAbort=!1,$._receivedLength=0,$}return Object(z.a)(W,[{key:"destroy",value:function(){this._ws&&this.abort(),x(Object(s.a)(W.prototype),"destroy",this).call(this)}},{key:"open",value:function(Z){try{var ne=this._ws=new self.WebSocket(Z.url);ne.binaryType="arraybuffer",ne.onopen=this._onWebSocketOpen.bind(this),ne.onclose=this._onWebSocketClose.bind(this),ne.onmessage=this._onWebSocketMessage.bind(this),ne.onerror=this._onWebSocketError.bind(this),this._status=r.kConnecting}catch(Pe){this._status=r.kError;var he={code:Pe.code,msg:Pe.message};if(this._onError)this._onError(a.EXCEPTION,he);else throw new d(he.msg)}}},{key:"abort",value:function(){var Z=this._ws;Z&&(Z.readyState===0||Z.readyState===1)&&(this._requestAbort=!0,Z.close()),this._ws=null,this._status=r.kComplete}},{key:"_onWebSocketOpen",value:function(Z){this._status=r.kBuffering}},{key:"_onWebSocketClose",value:function(Z){if(this._requestAbort===!0){this._requestAbort=!1;return}this._status=r.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)}},{key:"_onWebSocketMessage",value:function(Z){var ne=this;if(Z.data instanceof ArrayBuffer)this._dispatchArrayBuffer(Z.data);else if(Z.data instanceof Blob){var he=new FileReader;he.onload=function(){ne._dispatchArrayBuffer(he.result)},he.readAsArrayBuffer(Z.data)}else{this._status=r.kError;var Pe={code:-1,msg:"Unsupported WebSocket message type: "+Z.data.constructor.name};if(this._onError)this._onError(a.EXCEPTION,Pe);else throw new d(Pe.msg)}}},{key:"_dispatchArrayBuffer",value:function(Z){var ne=Z,he=this._receivedLength;this._receivedLength+=ne.byteLength,this._onDataArrival&&this._onDataArrival(ne,he,this._receivedLength)}},{key:"_onWebSocketError",value:function(Z){this._status=r.kError;var ne={code:Z.code,msg:Z.message};if(this._onError)this._onError(a.EXCEPTION,ne);else throw new d(ne.msg)}}],[{key:"isSupported",value:function(){try{return typeof self.WebSocket!="undefined"}catch(Z){return!1}}}]),W}(i),L=j,G=function(){function fe(se){Object(Q.a)(this,fe),this._zeroStart=se||!1}return Object(z.a)(fe,[{key:"getConfig",value:function(W,$){var Z={};if($.from!==0||$.to!==-1){var ne;$.to!==-1?ne="bytes=".concat($.from.toString(),"-").concat($.to.toString()):ne="bytes=".concat($.from.toString(),"-"),Z.Range=ne}else this._zeroStart&&(Z.Range="bytes=0-");return{url:W,headers:Z}}},{key:"removeURLParameters",value:function(W){return W}}]),fe}(),B=G,O=function(){function fe(se,W){Object(Q.a)(this,fe),this._startName=se,this._endName=W}return Object(z.a)(fe,[{key:"getConfig",value:function(W,$){var Z=W;if($.from!==0||$.to!==-1){var ne=!0;Z.indexOf("?")===-1&&(Z+="?",ne=!1),ne&&(Z+="&"),Z+="".concat(this._startName,"=").concat($.from.toString()),$.to!==-1&&(Z+="&".concat(this._endName,"=").concat($.to.toString()))}return{url:Z,headers:{}}}},{key:"removeURLParameters",value:function(W){var $=W.split("?")[0],Z=void 0,ne=W.indexOf("?");ne!==-1&&(Z=W.substring(ne+1));var he="";if(Z!=null&&Z.length>0)for(var Pe=Z.split("&"),ze=0;ze<Pe.length;ze++){var Rt=Pe[ze].split("="),Mt=ze>0;Rt[0]!==this._startName&&Rt[0]!==this._endName&&(Mt&&(he+="&"),he+=Pe[ze])}return he.length===0?$:$+"?"+he}}]),fe}(),V=O,te=function(){function fe(se,W,$){Object(Q.a)(this,fe),this.TAG="IOController",this._config=W,this._extraData=$,this._stashInitialSize=1024*384,W.stashInitialSize!=null&&W.stashInitialSize>0&&(this._stashInitialSize=W.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=1024*1024*3,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,W.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=se,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(se.url),this._refTotalLength=se.filesize?se.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new P,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return Object(z.a)(fe,[{key:"destroy",value:function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null}},{key:"isWorking",value:function(){return this._loader&&this._loader.isWorking()&&!this._paused}},{key:"isPaused",value:function(){return this._paused}},{key:"status",get:function(){return this._loader.status}},{key:"extraData",get:function(){return this._extraData},set:function(W){this._extraData=W}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(W){this._onDataArrival=W}},{key:"onSeeked",get:function(){return this._onSeeked},set:function(W){this._onSeeked=W}},{key:"onError",get:function(){return this._onError},set:function(W){this._onError=W}},{key:"onComplete",get:function(){return this._onComplete},set:function(W){this._onComplete=W}},{key:"onRedirect",get:function(){return this._onRedirect},set:function(W){this._onRedirect=W}},{key:"onRecoveredEarlyEof",get:function(){return this._onRecoveredEarlyEof},set:function(W){this._onRecoveredEarlyEof=W}},{key:"currentURL",get:function(){return this._dataSource.url}},{key:"hasRedirect",get:function(){return this._redirectedURL!=null||this._dataSource.redirectedURL!=null}},{key:"currentRedirectedURL",get:function(){return this._redirectedURL||this._dataSource.redirectedURL}},{key:"currentSpeed",get:function(){return this._loaderClass===U?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}},{key:"loaderType",get:function(){return this._loader.type}},{key:"_selectSeekHandler",value:function(){var W=this._config;if(W.seekType==="range")this._seekHandler=new B(this._config.rangeLoadZeroStart);else if(W.seekType==="param"){var $=W.seekParamStart||"bstart",Z=W.seekParamEnd||"bend";this._seekHandler=new V($,Z)}else if(W.seekType==="custom"){if(typeof W.customSeekHandler!="function")throw new o("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new W.customSeekHandler}else throw new o("Invalid seekType in config: ".concat(W.seekType))}},{key:"_selectLoader",value:function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=L;else if(b.isSupported())this._loaderClass=b;else if(f.isSupported())this._loaderClass=f;else if(U.isSupported())this._loaderClass=U;else throw new d("Your browser doesn't support xhr with arraybuffer responseType!")}},{key:"_createLoader",value:function(){this._loader=new this._loaderClass(this._seekHandler,this._config),this._loader.needStashBuffer===!1&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)}},{key:"open",value:function(W){this._currentRange={from:0,to:-1},W&&(this._currentRange.from=W),this._speedSampler.reset(),W||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))}},{key:"abort",value:function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}},{key:"pause",value:function(){this.isWorking()&&(this._loader.abort(),this._stashUsed!==0?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)}},{key:"resume",value:function(){if(this._paused){this._paused=!1;var W=this._resumeFrom;this._resumeFrom=0,this._internalSeek(W,!0)}}},{key:"seek",value:function(W){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(W,!0)}},{key:"_internalSeek",value:function(W,$){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer($),this._loader.destroy(),this._loader=null;var Z={from:W,to:-1};this._currentRange={from:Z.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,Z),this._onSeeked&&this._onSeeked()}},{key:"updateUrl",value:function(W){if(!W||typeof W!="string"||W.length===0)throw new o("Url must be a non-empty string!");this._dataSource.url=W}},{key:"_expandBuffer",value:function(W){for(var $=this._stashSize;$+1024*1024*1<W;)$*=2;if($+=1024*1024*1,$===this._bufferSize)return;var Z=new ArrayBuffer($);if(this._stashUsed>0){var ne=new Uint8Array(this._stashBuffer,0,this._stashUsed),he=new Uint8Array(Z,0,$);he.set(ne,0)}this._stashBuffer=Z,this._bufferSize=$}},{key:"_normalizeSpeed",value:function(W){var $=this._speedNormalizeList,Z=$.length-1,ne=0,he=0,Pe=Z;if(W<$[0])return $[0];for(;he<=Pe;){if(ne=he+Math.floor((Pe-he)/2),ne===Z||W>=$[ne]&&W<$[ne+1])return $[ne];$[ne]<W?he=ne+1:Pe=ne-1}}},{key:"_adjustStashSize",value:function(W){var $=0;this._config.isLive||W<512?$=W:W>=512&&W<=1024?$=Math.floor(W*1.5):$=W*2,$>8192&&($=8192);var Z=$*1024+1024*1024*1;this._bufferSize<Z&&this._expandBuffer(Z),this._stashSize=$*1024}},{key:"_dispatchChunks",value:function(W,$){return this._currentRange.to=$+W.byteLength-1,this._onDataArrival(W,$)}},{key:"_onURLRedirect",value:function(W){this._redirectedURL=W,this._onRedirect&&this._onRedirect(W)}},{key:"_onContentLengthKnown",value:function(W){W&&this._fullRequestFlag&&(this._totalLength=W,this._fullRequestFlag=!1)}},{key:"_onLoaderChunkArrival",value:function(W,$,Z){if(!this._onDataArrival)throw new u("IOController: No existing consumer (onDataArrival) callback!");if(this._paused)return;this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(W.byteLength);var ne=this._speedSampler.lastSecondKBps;if(ne!==0){var he=this._normalizeSpeed(ne);this._speedNormalized!==he&&(this._speedNormalized=he,this._adjustStashSize(he))}if(this._enableStash)if(this._stashUsed===0&&this._stashByteStart===0&&(this._stashByteStart=$),this._stashUsed+W.byteLength<=this._stashSize){var an=new Uint8Array(this._stashBuffer,0,this._stashSize);an.set(new Uint8Array(W),this._stashUsed),this._stashUsed+=W.byteLength}else{var At=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){var pn=this._stashBuffer.slice(0,this._stashUsed),nn=this._dispatchChunks(pn,this._stashByteStart);if(nn<pn.byteLength){if(nn>0){var J=new Uint8Array(pn,nn);At.set(J,0),this._stashUsed=J.byteLength,this._stashByteStart+=nn}}else this._stashUsed=0,this._stashByteStart+=nn;this._stashUsed+W.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+W.byteLength),At=new Uint8Array(this._stashBuffer,0,this._bufferSize)),At.set(new Uint8Array(W),this._stashUsed),this._stashUsed+=W.byteLength}else{var R=this._dispatchChunks(W,$);if(R<W.byteLength){var k=W.byteLength-R;k>this._bufferSize&&(this._expandBuffer(k),At=new Uint8Array(this._stashBuffer,0,this._bufferSize)),At.set(new Uint8Array(W,R),0),this._stashUsed+=k,this._stashByteStart=$+R}}}else if(this._stashUsed===0){var Pe=this._dispatchChunks(W,$);if(Pe<W.byteLength){var ze=W.byteLength-Pe;ze>this._bufferSize&&this._expandBuffer(ze);var Rt=new Uint8Array(this._stashBuffer,0,this._bufferSize);Rt.set(new Uint8Array(W,Pe),0),this._stashUsed+=ze,this._stashByteStart=$+Pe}}else{this._stashUsed+W.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+W.byteLength);var Mt=new Uint8Array(this._stashBuffer,0,this._bufferSize);Mt.set(new Uint8Array(W),this._stashUsed),this._stashUsed+=W.byteLength;var Ze=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(Ze<this._stashUsed&&Ze>0){var kt=new Uint8Array(this._stashBuffer,Ze);Mt.set(kt,0)}this._stashUsed-=Ze,this._stashByteStart+=Ze}}},{key:"_flushStashBuffer",value:function(W){if(this._stashUsed>0){var $=this._stashBuffer.slice(0,this._stashUsed),Z=this._dispatchChunks($,this._stashByteStart),ne=$.byteLength-Z;if(Z<$.byteLength)if(W)N.w(this.TAG,"".concat(ne," bytes unconsumed data remain when flush buffer, dropped"));else{if(Z>0){var he=new Uint8Array(this._stashBuffer,0,this._bufferSize),Pe=new Uint8Array($,Z);he.set(Pe,0),this._stashUsed=Pe.byteLength,this._stashByteStart+=Z}return 0}return this._stashUsed=0,this._stashByteStart=0,ne}return 0}},{key:"_onLoaderComplete",value:function(W,$){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}},{key:"_onLoaderError",value:function(W,$){N.e(this.TAG,"Loader error, code = ".concat($.code,", msg = ").concat($.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,W=a.UNRECOVERABLE_EARLY_EOF);switch(W){case a.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){var Z=this._currentRange.to+1;Z<this._totalLength&&(N.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(Z,!1));return}W=a.UNRECOVERABLE_EARLY_EOF;break}case a.UNRECOVERABLE_EARLY_EOF:case a.CONNECTING_TIMEOUT:case a.HTTP_STATUS_CODE_INVALID:case a.EXCEPTION:break}if(this._onError)this._onError(W,$);else throw new d("IOException: "+$.msg)}}]),fe}(),re=te,ge={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:3*60,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:3*60,autoCleanupMinBackwardDuration:2*60,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0};function Ae(){return Object.assign({},ge)}var Oe=function(){function fe(){Object(Q.a)(this,fe)}return Object(z.a)(fe,null,[{key:"supportMSEH264Playback",value:function(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}},{key:"supportNetworkStreamIO",value:function(){var W=new re({},Ae()),$=W.loaderType;return W.destroy(),$=="fetch-stream-loader"||$=="xhr-moz-chunked-loader"}},{key:"getNetworkLoaderTypeName",value:function(){var W=new re({},Ae()),$=W.loaderType;return W.destroy(),$}},{key:"supportNativeMediaPlayback",value:function(W){fe.videoElement==null&&(fe.videoElement=window.document.createElement("video"));var $=fe.videoElement.canPlayType(W);return $==="probably"||$=="maybe"}},{key:"getFeatureList",value:function(){var W={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return W.mseFlvPlayback=fe.supportMSEH264Playback(),W.networkStreamIO=fe.supportNetworkStreamIO(),W.networkLoaderName=fe.getNetworkLoaderTypeName(),W.mseLiveFlvPlayback=W.mseFlvPlayback&&W.networkStreamIO,W.nativeMP4H264Playback=fe.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),W.nativeWebmVP8Playback=fe.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),W.nativeWebmVP9Playback=fe.supportNativeMediaPlayback('video/webm; codecs="vp9"'),W}}]),fe}(),Ce=Oe,je={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"},Ue=je,xe=function(){function fe(){Object(Q.a)(this,fe)}return Object(z.a)(fe,null,[{key:"forceGlobalTag",get:function(){return N.FORCE_GLOBAL_TAG},set:function(W){N.FORCE_GLOBAL_TAG=W,fe._notifyChange()}},{key:"globalTag",get:function(){return N.GLOBAL_TAG},set:function(W){N.GLOBAL_TAG=W,fe._notifyChange()}},{key:"enableAll",get:function(){return N.ENABLE_VERBOSE&&N.ENABLE_DEBUG&&N.ENABLE_INFO&&N.ENABLE_WARN&&N.ENABLE_ERROR},set:function(W){N.ENABLE_VERBOSE=W,N.ENABLE_DEBUG=W,N.ENABLE_INFO=W,N.ENABLE_WARN=W,N.ENABLE_ERROR=W,fe._notifyChange()}},{key:"enableDebug",get:function(){return N.ENABLE_DEBUG},set:function(W){N.ENABLE_DEBUG=W,fe._notifyChange()}},{key:"enableVerbose",get:function(){return N.ENABLE_VERBOSE},set:function(W){N.ENABLE_VERBOSE=W,fe._notifyChange()}},{key:"enableInfo",get:function(){return N.ENABLE_INFO},set:function(W){N.ENABLE_INFO=W,fe._notifyChange()}},{key:"enableWarn",get:function(){return N.ENABLE_WARN},set:function(W){N.ENABLE_WARN=W,fe._notifyChange()}},{key:"enableError",get:function(){return N.ENABLE_ERROR},set:function(W){N.ENABLE_ERROR=W,fe._notifyChange()}},{key:"getConfig",value:function(){return{globalTag:N.GLOBAL_TAG,forceGlobalTag:N.FORCE_GLOBAL_TAG,enableVerbose:N.ENABLE_VERBOSE,enableDebug:N.ENABLE_DEBUG,enableInfo:N.ENABLE_INFO,enableWarn:N.ENABLE_WARN,enableError:N.ENABLE_ERROR,enableCallback:N.ENABLE_CALLBACK}}},{key:"applyConfig",value:function(W){N.GLOBAL_TAG=W.globalTag,N.FORCE_GLOBAL_TAG=W.forceGlobalTag,N.ENABLE_VERBOSE=W.enableVerbose,N.ENABLE_DEBUG=W.enableDebug,N.ENABLE_INFO=W.enableInfo,N.ENABLE_WARN=W.enableWarn,N.ENABLE_ERROR=W.enableError,N.ENABLE_CALLBACK=W.enableCallback}},{key:"_notifyChange",value:function(){var W=fe.emitter;if(W.listenerCount("change")>0){var $=fe.getConfig();W.emit("change",$)}}},{key:"registerListener",value:function(W){fe.emitter.addListener("change",W)}},{key:"removeListener",value:function(W){fe.emitter.removeListener("change",W)}},{key:"addLogListener",value:function(W){N.emitter.addListener("log",W),N.emitter.listenerCount("log")>0&&(N.ENABLE_CALLBACK=!0,fe._notifyChange())}},{key:"removeLogListener",value:function(W){N.emitter.removeListener("log",W),N.emitter.listenerCount("log")===0&&(N.ENABLE_CALLBACK=!1,fe._notifyChange())}}]),fe}();xe.emitter=new I.a;var be=xe,Ve=function(){function fe(){Object(Q.a)(this,fe),this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return Object(z.a)(fe,[{key:"isComplete",value:function(){var W=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,$=this.hasVideo===!1||this.hasVideo===!0&&this.videoCodec!=null&&this.width!=null&&this.height!=null&&this.fps!=null&&this.profile!=null&&this.level!=null&&this.refFrames!=null&&this.chromaFormat!=null&&this.sarNum!=null&&this.sarDen!=null;return this.mimeType!=null&&this.duration!=null&&this.metadata!=null&&this.hasKeyframesIndex!=null&&W&&$}},{key:"isSeekable",value:function(){return this.hasKeyframesIndex===!0}},{key:"getNearestKeyframe",value:function(W){if(this.keyframesIndex==null)return null;var $=this.keyframesIndex,Z=this._search($.times,W);return{index:Z,milliseconds:$.times[Z],fileposition:$.filepositions[Z]}}},{key:"_search",value:function(W,$){var Z=0,ne=W.length-1,he=0,Pe=0,ze=ne;for($<W[0]&&(Z=0,Pe=ze+1);Pe<=ze;)if(he=Pe+Math.floor((ze-Pe)/2),he===ne||$>=W[he]&&$<W[he+1]){Z=he;break}else W[he]<$?Pe=he+1:ze=he-1;return Z}}]),fe}(),mt=Ve;function yt(fe,se,W){var $=fe;if(se+W<$.length){for(;W--;)if(($[++se]&192)!==128)return!1;return!0}else return!1}function _t(fe){for(var se=[],W=fe,$=0,Z=fe.length;$<Z;){if(W[$]<128){se.push(String.fromCharCode(W[$])),++$;continue}else if(!(W[$]<192)){if(W[$]<224){if(yt(W,$,1)){var ne=(W[$]&31)<<6|W[$+1]&63;if(ne>=128){se.push(String.fromCharCode(ne&65535)),$+=2;continue}}}else if(W[$]<240){if(yt(W,$,2)){var he=(W[$]&15)<<12|(W[$+1]&63)<<6|W[$+2]&63;if(he>=2048&&(he&63488)!==55296){se.push(String.fromCharCode(he&65535)),$+=3;continue}}}else if(W[$]<248&&yt(W,$,3)){var Pe=(W[$]&7)<<18|(W[$+1]&63)<<12|(W[$+2]&63)<<6|W[$+3]&63;if(Pe>65536&&Pe<1114112){Pe-=65536,se.push(String.fromCharCode(Pe>>>10|55296)),se.push(String.fromCharCode(Pe&1023|56320)),$+=4;continue}}}se.push(String.fromCharCode(65533)),++$}return se.join("")}var xt=_t,nt=function(){var fe=new ArrayBuffer(2);return new DataView(fe).setInt16(0,256,!0),new Int16Array(fe)[0]===256}(),ct=function(){function fe(){Object(Q.a)(this,fe)}return Object(z.a)(fe,null,[{key:"parseScriptData",value:function(W,$,Z){var ne={};try{var he=fe.parseValue(W,$,Z),Pe=fe.parseValue(W,$+he.size,Z-he.size);ne[he.data]=Pe.data}catch(ze){N.e("AMF",ze.toString())}return ne}},{key:"parseObject",value:function(W,$,Z){if(Z<3)throw new u("Data not enough when parse ScriptDataObject");var ne=fe.parseString(W,$,Z),he=fe.parseValue(W,$+ne.size,Z-ne.size),Pe=he.objectEnd;return{data:{name:ne.data,value:he.data},size:ne.size+he.size,objectEnd:Pe}}},{key:"parseVariable",value:function(W,$,Z){return fe.parseObject(W,$,Z)}},{key:"parseString",value:function(W,$,Z){if(Z<2)throw new u("Data not enough when parse String");var ne=new DataView(W,$,Z),he=ne.getUint16(0,!nt),Pe;return he>0?Pe=xt(new Uint8Array(W,$+2,he)):Pe="",{data:Pe,size:2+he}}},{key:"parseLongString",value:function(W,$,Z){if(Z<4)throw new u("Data not enough when parse LongString");var ne=new DataView(W,$,Z),he=ne.getUint32(0,!nt),Pe;return he>0?Pe=xt(new Uint8Array(W,$+4,he)):Pe="",{data:Pe,size:4+he}}},{key:"parseDate",value:function(W,$,Z){if(Z<10)throw new u("Data size invalid when parse Date");var ne=new DataView(W,$,Z),he=ne.getFloat64(0,!nt),Pe=ne.getInt16(8,!nt);return he+=Pe*60*1e3,{data:new Date(he),size:8+2}}},{key:"parseValue",value:function(W,$,Z){if(Z<1)throw new u("Data not enough when parse Value");var ne=new DataView(W,$,Z),he=1,Pe=ne.getUint8(0),ze,Rt=!1;try{switch(Pe){case 0:ze=ne.getFloat64(1,!nt),he+=8;break;case 1:{var Mt=ne.getUint8(1);ze=!!Mt,he+=1;break}case 2:{var Ze=fe.parseString(W,$+1,Z-1);ze=Ze.data,he+=Ze.size;break}case 3:{ze={};var kt=0;for((ne.getUint32(Z-4,!nt)&16777215)===9&&(kt=3);he<Z-4;){var an=fe.parseObject(W,$+he,Z-he-kt);if(an.objectEnd)break;ze[an.data.name]=an.data.value,he+=an.size}if(he<=Z-3){var At=ne.getUint32(he-1,!nt)&16777215;At===9&&(he+=3)}break}case 8:{ze={},he+=4;var pn=0;for((ne.getUint32(Z-4,!nt)&16777215)===9&&(pn=3);he<Z-8;){var nn=fe.parseVariable(W,$+he,Z-he-pn);if(nn.objectEnd)break;ze[nn.data.name]=nn.data.value,he+=nn.size}if(he<=Z-3){var J=ne.getUint32(he-1,!nt)&16777215;J===9&&(he+=3)}break}case 9:ze=void 0,he=1,Rt=!0;break;case 10:{ze=[];var R=ne.getUint32(1,!nt);he+=4;for(var k=0;k<R;k++){var Y=fe.parseValue(W,$+he,Z-he);ze.push(Y.data),he+=Y.size}break}case 11:{var ae=fe.parseDate(W,$+1,Z-1);ze=ae.data,he+=ae.size;break}case 12:{var q=fe.parseString(W,$+1,Z-1);ze=q.data,he+=q.size;break}default:he=Z,N.w("AMF","Unsupported AMF value type "+Pe)}}catch(Ie){N.e("AMF",Ie.toString())}return{data:ze,size:he,objectEnd:Rt}}}]),fe}(),wt=ct,_e=function(){function fe(se){Object(Q.a)(this,fe),this.TAG="ExpGolomb",this._buffer=se,this._buffer_index=0,this._total_bytes=se.byteLength,this._total_bits=se.byteLength*8,this._current_word=0,this._current_word_bits_left=0}return Object(z.a)(fe,[{key:"destroy",value:function(){this._buffer=null}},{key:"_fillCurrentWord",value:function(){var W=this._total_bytes-this._buffer_index;if(W<=0)throw new u("ExpGolomb: _fillCurrentWord() but no bytes available");var $=Math.min(4,W),Z=new Uint8Array(4);Z.set(this._buffer.subarray(this._buffer_index,this._buffer_index+$)),this._current_word=new DataView(Z.buffer).getUint32(0,!1),this._buffer_index+=$,this._current_word_bits_left=$*8}},{key:"readBits",value:function(W){if(W>32)throw new o("ExpGolomb: readBits() bits exceeded max 32bits!");if(W<=this._current_word_bits_left){var $=this._current_word>>>32-W;return this._current_word<<=W,this._current_word_bits_left-=W,$}var Z=this._current_word_bits_left?this._current_word:0;Z=Z>>>32-this._current_word_bits_left;var ne=W-this._current_word_bits_left;this._fillCurrentWord();var he=Math.min(ne,this._current_word_bits_left),Pe=this._current_word>>>32-he;return this._current_word<<=he,this._current_word_bits_left-=he,Z=Z<<he|Pe,Z}},{key:"readBool",value:function(){return this.readBits(1)===1}},{key:"readByte",value:function(){return this.readBits(8)}},{key:"_skipLeadingZero",value:function(){var W;for(W=0;W<this._current_word_bits_left;W++)if((this._current_word&2147483648>>>W)!==0)return this._current_word<<=W,this._current_word_bits_left-=W,W;return this._fillCurrentWord(),W+this._skipLeadingZero()}},{key:"readUEG",value:function(){var W=this._skipLeadingZero();return this.readBits(W+1)-1}},{key:"readSEG",value:function(){var W=this.readUEG();return W&1?W+1>>>1:-1*(W>>>1)}}]),fe}(),Me=_e,ve=function(){function fe(){Object(Q.a)(this,fe)}return Object(z.a)(fe,null,[{key:"_ebsp2rbsp",value:function(W){for(var $=W,Z=$.byteLength,ne=new Uint8Array(Z),he=0,Pe=0;Pe<Z;Pe++){if(Pe>=2&&($[Pe]===3&&$[Pe-1]===0&&$[Pe-2]===0))continue;ne[he]=$[Pe],he++}return new Uint8Array(ne.buffer,0,he)}},{key:"parseSPS",value:function(W){var $=fe._ebsp2rbsp(W),Z=new Me($);Z.readByte();var ne=Z.readByte();Z.readByte();var he=Z.readByte();Z.readUEG();var Pe=fe.getProfileString(ne),ze=fe.getLevelString(he),Rt=1,Mt=420,Ze=[0,420,422,444],kt=8;if((ne===100||ne===110||ne===122||ne===244||ne===44||ne===83||ne===86||ne===118||ne===128||ne===138||ne===144)&&(Rt=Z.readUEG(),Rt===3&&Z.readBits(1),Rt<=3&&(Mt=Ze[Rt]),kt=Z.readUEG()+8,Z.readUEG(),Z.readBits(1),Z.readBool()))for(var an=Rt!==3?8:12,At=0;At<an;At++)Z.readBool()&&(At<6?fe._skipScalingList(Z,16):fe._skipScalingList(Z,64));Z.readUEG();var pn=Z.readUEG();if(pn===0)Z.readUEG();else if(pn===1){Z.readBits(1),Z.readSEG(),Z.readSEG();for(var nn=Z.readUEG(),J=0;J<nn;J++)Z.readSEG()}var R=Z.readUEG();Z.readBits(1);var k=Z.readUEG(),Y=Z.readUEG(),ae=Z.readBits(1);ae===0&&Z.readBits(1),Z.readBits(1);var q=0,Ie=0,ht=0,Ot=0,$t=Z.readBool();$t&&(q=Z.readUEG(),Ie=Z.readUEG(),ht=Z.readUEG(),Ot=Z.readUEG());var ft=1,zt=1,on=0,Wn=!0,Si=0,hi=0,Fn=Z.readBool();if(Fn){if(Z.readBool()){var ci=Z.readByte(),Zi=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],yi=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];ci>0&&ci<16?(ft=Zi[ci-1],zt=yi[ci-1]):ci===255&&(ft=Z.readByte()<<8|Z.readByte(),zt=Z.readByte()<<8|Z.readByte())}if(Z.readBool()&&Z.readBool(),Z.readBool()&&(Z.readBits(4),Z.readBool()&&Z.readBits(24)),Z.readBool()&&(Z.readUEG(),Z.readUEG()),Z.readBool()){var ri=Z.readBits(32),Ci=Z.readBits(32);Wn=Z.readBool(),Si=Ci,hi=ri*2,on=Si/hi}}var Di=1;(ft!==1||zt!==1)&&(Di=ft/zt);var Oi=0,Ri=0;if(Rt===0)Oi=1,Ri=2-ae;else{var Vi=Rt===3?1:2,dr=Rt===1?2:1;Oi=Vi,Ri=dr*(2-ae)}var rr=(k+1)*16,ji=(2-ae)*((Y+1)*16);rr-=(q+Ie)*Oi,ji-=(ht+Ot)*Ri;var Wi=Math.ceil(rr*Di);return Z.destroy(),Z=null,{profile_string:Pe,level_string:ze,bit_depth:kt,ref_frames:R,chroma_format:Mt,chroma_format_string:fe.getChromaFormatString(Mt),frame_rate:{fixed:Wn,fps:on,fps_den:hi,fps_num:Si},sar_ratio:{width:ft,height:zt},codec_size:{width:rr,height:ji},present_size:{width:Wi,height:ji}}}},{key:"_skipScalingList",value:function(W,$){for(var Z=8,ne=8,he=0,Pe=0;Pe<$;Pe++)ne!==0&&(he=W.readSEG(),ne=(Z+he+256)%256),Z=ne===0?Z:ne}},{key:"getProfileString",value:function(W){switch(W){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}}},{key:"getLevelString",value:function(W){return(W/10).toFixed(1)}},{key:"getChromaFormatString",value:function(W){switch(W){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}]),fe}(),Te=ve,We={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"},Je=We;function at(fe){return fe>>>8&255|(fe&255)<<8}function dt(fe){return(fe&4278190080)>>>24|(fe&16711680)>>>8|(fe&65280)<<8|(fe&255)<<24}function Lt(fe,se){return fe[se]<<24|fe[se+1]<<16|fe[se+2]<<8|fe[se+3]}var It=function(){function fe(se,W){Object(Q.a)(this,fe),this.TAG="FLVDemuxer",this._config=W,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=se.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=se.hasAudioTrack,this._hasVideo=se.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new mt,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var $=new ArrayBuffer(2);return new DataView($).setInt16(0,256,!0),new Int16Array($)[0]===256}()}return Object(z.a)(fe,[{key:"destroy",value:function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null}},{key:"bindDataSource",value:function(W){return W.onDataArrival=this.parseChunks.bind(this),this}},{key:"onTrackMetadata",get:function(){return this._onTrackMetadata},set:function(W){this._onTrackMetadata=W}},{key:"onMediaInfo",get:function(){return this._onMediaInfo},set:function(W){this._onMediaInfo=W}},{key:"onMetaDataArrived",get:function(){return this._onMetaDataArrived},set:function(W){this._onMetaDataArrived=W}},{key:"onScriptDataArrived",get:function(){return this._onScriptDataArrived},set:function(W){this._onScriptDataArrived=W}},{key:"onError",get:function(){return this._onError},set:function(W){this._onError=W}},{key:"onDataAvailable",get:function(){return this._onDataAvailable},set:function(W){this._onDataAvailable=W}},{key:"timestampBase",get:function(){return this._timestampBase},set:function(W){this._timestampBase=W}},{key:"overridedDuration",get:function(){return this._duration},set:function(W){this._durationOverrided=!0,this._duration=W,this._mediaInfo.duration=W}},{key:"overridedHasAudio",set:function(W){this._hasAudioFlagOverrided=!0,this._hasAudio=W,this._mediaInfo.hasAudio=W}},{key:"overridedHasVideo",set:function(W){this._hasVideoFlagOverrided=!0,this._hasVideo=W,this._mediaInfo.hasVideo=W}},{key:"resetMediaInfo",value:function(){this._mediaInfo=new mt}},{key:"_isInitialMetadataDispatched",value:function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!this._hasAudio&&this._hasVideo?this._videoInitialMetadataDispatched:!1}},{key:"parseChunks",value:function(W,$){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new u("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var Z=0,ne=this._littleEndian;if($===0)if(W.byteLength>13){var he=fe.probe(W);Z=he.dataOffset}else return 0;if(this._firstParse){this._firstParse=!1,$+Z!==this._dataOffset&&N.w(this.TAG,"First time parsing but chunk byteStart invalid!");var Pe=new DataView(W,Z),ze=Pe.getUint32(0,!ne);ze!==0&&N.w(this.TAG,"PrevTagSize0 !== 0 !!!"),Z+=4}for(;Z<W.byteLength;){this._dispatch=!0;var Rt=new DataView(W,Z);if(Z+11+4>W.byteLength)break;var Mt=Rt.getUint8(0),Ze=Rt.getUint32(0,!ne)&16777215;if(Z+11+Ze+4>W.byteLength)break;if(Mt!==8&&Mt!==9&&Mt!==18){N.w(this.TAG,"Unsupported tag type ".concat(Mt,", skipped")),Z+=11+Ze+4;continue}var kt=Rt.getUint8(4),an=Rt.getUint8(5),At=Rt.getUint8(6),pn=Rt.getUint8(7),nn=At|an<<8|kt<<16|pn<<24,J=Rt.getUint32(7,!ne)&16777215;J!==0&&N.w(this.TAG,"Meet tag which has StreamID != 0!");var R=Z+11;switch(Mt){case 8:this._parseAudioData(W,R,Ze,nn);break;case 9:this._parseVideoData(W,R,Ze,nn,$+Z);break;case 18:this._parseScriptData(W,R,Ze);break}var k=Rt.getUint32(11+Ze,!ne);k!==11+Ze&&N.w(this.TAG,"Invalid PrevTagSize ".concat(k)),Z+=11+Ze+4}return this._isInitialMetadataDispatched()&&(this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack)),Z}},{key:"_parseScriptData",value:function(W,$,Z){var ne=wt.parseScriptData(W,$,Z);if(ne.hasOwnProperty("onMetaData")){if(ne.onMetaData==null||typeof ne.onMetaData!="object"){N.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&N.w(this.TAG,"Found another onMetaData tag!"),this._metadata=ne;var he=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},he)),typeof he.hasAudio=="boolean"&&(this._hasAudioFlagOverrided===!1&&(this._hasAudio=he.hasAudio,this._mediaInfo.hasAudio=this._hasAudio)),typeof he.hasVideo=="boolean"&&(this._hasVideoFlagOverrided===!1&&(this._hasVideo=he.hasVideo,this._mediaInfo.hasVideo=this._hasVideo)),typeof he.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=he.audiodatarate),typeof he.videodatarate=="number"&&(this._mediaInfo.videoDataRate=he.videodatarate),typeof he.width=="number"&&(this._mediaInfo.width=he.width),typeof he.height=="number"&&(this._mediaInfo.height=he.height),typeof he.duration=="number"){if(!this._durationOverrided){var Pe=Math.floor(he.duration*this._timescale);this._duration=Pe,this._mediaInfo.duration=Pe}}else this._mediaInfo.duration=0;if(typeof he.framerate=="number"){var ze=Math.floor(he.framerate*1e3);if(ze>0){var Rt=ze/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=Rt,this._referenceFrameRate.fps_num=ze,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=Rt}}if(typeof he.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var Mt=he.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(Mt),he.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=he,N.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(ne).length>0&&(this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},ne)))}},{key:"_parseKeyframesIndex",value:function(W){for(var $=[],Z=[],ne=1;ne<W.times.length;ne++){var he=this._timestampBase+Math.floor(W.times[ne]*1e3);$.push(he),Z.push(W.filepositions[ne])}return{times:$,filepositions:Z}}},{key:"_parseAudioData",value:function(W,$,Z,ne){if(Z<=1){N.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");return}if(this._hasAudioFlagOverrided===!0&&this._hasAudio===!1)return;var he=this._littleEndian,Pe=new DataView(W,$,Z),ze=Pe.getUint8(0),Rt=ze>>>4;if(Rt!==2&&Rt!==10){this._onError(Je.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+Rt);return}var Mt=0,Ze=(ze&12)>>>2;if(Ze>=0&&Ze<=4)Mt=this._flvSoundRateTable[Ze];else{this._onError(Je.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+Ze);return}var kt=(ze&2)>>>1,an=ze&1,At=this._audioMetadata,pn=this._audioTrack;if(At||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),At=this._audioMetadata={},At.type="audio",At.id=pn.id,At.timescale=this._timescale,At.duration=this._duration,At.audioSampleRate=Mt,At.channelCount=an===0?1:2),Rt===10){var nn=this._parseAACAudioData(W,$+1,Z-1);if(nn==null)return;if(nn.packetType===0){At.config&&N.w(this.TAG,"Found another AudioSpecificConfig!");var J=nn.data;At.audioSampleRate=J.samplingRate,At.channelCount=J.channelCount,At.codec=J.codec,At.originalCodec=J.originalCodec,At.config=J.config,At.refSampleDuration=1024/At.audioSampleRate*At.timescale,N.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",At);var R=this._mediaInfo;R.audioCodec=At.originalCodec,R.audioSampleRate=At.audioSampleRate,R.audioChannelCount=At.channelCount,R.hasVideo?R.videoCodec!=null&&(R.mimeType='video/x-flv; codecs="'+R.videoCodec+","+R.audioCodec+'"'):R.mimeType='video/x-flv; codecs="'+R.audioCodec+'"',R.isComplete()&&this._onMediaInfo(R)}else if(nn.packetType===1){var k=this._timestampBase+ne,Y={unit:nn.data,length:nn.data.byteLength,dts:k,pts:k};pn.samples.push(Y),pn.length+=nn.data.length}else N.e(this.TAG,"Flv: Unsupported AAC data type ".concat(nn.packetType))}else if(Rt===2){if(!At.codec){var ae=this._parseMP3AudioData(W,$+1,Z-1,!0);if(ae==null)return;At.audioSampleRate=ae.samplingRate,At.channelCount=ae.channelCount,At.codec=ae.codec,At.originalCodec=ae.originalCodec,At.refSampleDuration=1152/At.audioSampleRate*At.timescale,N.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",At);var q=this._mediaInfo;q.audioCodec=At.codec,q.audioSampleRate=At.audioSampleRate,q.audioChannelCount=At.channelCount,q.audioDataRate=ae.bitRate,q.hasVideo?q.videoCodec!=null&&(q.mimeType='video/x-flv; codecs="'+q.videoCodec+","+q.audioCodec+'"'):q.mimeType='video/x-flv; codecs="'+q.audioCodec+'"',q.isComplete()&&this._onMediaInfo(q)}var Ie=this._parseMP3AudioData(W,$+1,Z-1,!1);if(Ie==null)return;var ht=this._timestampBase+ne,Ot={unit:Ie,length:Ie.byteLength,dts:ht,pts:ht};pn.samples.push(Ot),pn.length+=Ie.length}}},{key:"_parseAACAudioData",value:function(W,$,Z){if(Z<=1){N.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}var ne={},he=new Uint8Array(W,$,Z);return ne.packetType=he[0],he[0]===0?ne.data=this._parseAACAudioSpecificConfig(W,$+1,Z-1):ne.data=he.subarray(1),ne}},{key:"_parseAACAudioSpecificConfig",value:function(W,$,Z){var ne=new Uint8Array(W,$,Z),he=null,Pe=0,ze=0,Rt=null,Mt=0,Ze=null;if(Pe=ze=ne[0]>>>3,Mt=(ne[0]&7)<<1|ne[1]>>>7,Mt<0||Mt>=this._mpegSamplingRates.length){this._onError(Je.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}var kt=this._mpegSamplingRates[Mt],an=(ne[1]&120)>>>3;if(an<0||an>=8){this._onError(Je.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}Pe===5&&(Ze=(ne[1]&7)<<1|ne[2]>>>7,Rt=(ne[2]&124)>>>2);var At=self.navigator.userAgent.toLowerCase();return At.indexOf("firefox")!==-1?Mt>=6?(Pe=5,he=new Array(4),Ze=Mt-3):(Pe=2,he=new Array(2),Ze=Mt):At.indexOf("android")!==-1?(Pe=2,he=new Array(2),Ze=Mt):(Pe=5,Ze=Mt,he=new Array(4),Mt>=6?Ze=Mt-3:an===1&&(Pe=2,he=new Array(2),Ze=Mt)),he[0]=Pe<<3,he[0]|=(Mt&15)>>>1,he[1]=(Mt&15)<<7,he[1]|=(an&15)<<3,Pe===5&&(he[1]|=(Ze&15)>>>1,he[2]=(Ze&1)<<7,he[2]|=2<<2,he[3]=0),{config:he,samplingRate:kt,channelCount:an,codec:"mp4a.40."+Pe,originalCodec:"mp4a.40."+ze}}},{key:"_parseMP3AudioData",value:function(W,$,Z,ne){if(Z<4){N.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}var he=this._littleEndian,Pe=new Uint8Array(W,$,Z),ze=null;if(ne){if(Pe[0]!==255)return;var Rt=Pe[1]>>>3&3,Mt=(Pe[1]&6)>>1,Ze=(Pe[2]&240)>>>4,kt=(Pe[2]&12)>>>2,an=Pe[3]>>>6&3,At=an!==3?2:1,pn=0,nn=0,J=34,R="mp3";switch(Rt){case 0:pn=this._mpegAudioV25SampleRateTable[kt];break;case 2:pn=this._mpegAudioV20SampleRateTable[kt];break;case 3:pn=this._mpegAudioV10SampleRateTable[kt];break}switch(Mt){case 1:J=34,Ze<this._mpegAudioL3BitRateTable.length&&(nn=this._mpegAudioL3BitRateTable[Ze]);break;case 2:J=33,Ze<this._mpegAudioL2BitRateTable.length&&(nn=this._mpegAudioL2BitRateTable[Ze]);break;case 3:J=32,Ze<this._mpegAudioL1BitRateTable.length&&(nn=this._mpegAudioL1BitRateTable[Ze]);break}ze={bitRate:nn,samplingRate:pn,channelCount:At,codec:R,originalCodec:R}}else ze=Pe;return ze}},{key:"_parseVideoData",value:function(W,$,Z,ne,he){if(Z<=1){N.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");return}if(this._hasVideoFlagOverrided===!0&&this._hasVideo===!1)return;var Pe=new Uint8Array(W,$,Z)[0],ze=(Pe&240)>>>4,Rt=Pe&15;if(Rt!==7){this._onError(Je.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(Rt));return}this._parseAVCVideoPacket(W,$+1,Z-1,ne,he,ze)}},{key:"_parseAVCVideoPacket",value:function(W,$,Z,ne,he,Pe){if(Z<4){N.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}var ze=this._littleEndian,Rt=new DataView(W,$,Z),Mt=Rt.getUint8(0),Ze=Rt.getUint32(0,!ze)&16777215,kt=Ze<<8>>8;if(Mt===0)this._parseAVCDecoderConfigurationRecord(W,$+4,Z-4);else if(Mt===1)this._parseAVCVideoData(W,$+4,Z-4,ne,he,Pe,kt);else if(!(Mt===2)){this._onError(Je.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(Mt));return}}},{key:"_parseAVCDecoderConfigurationRecord",value:function(W,$,Z){if(Z<7){N.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}var ne=this._videoMetadata,he=this._videoTrack,Pe=this._littleEndian,ze=new DataView(W,$,Z);ne?typeof ne.avcc!="undefined"&&N.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),ne=this._videoMetadata={},ne.type="video",ne.id=he.id,ne.timescale=this._timescale,ne.duration=this._duration);var Rt=ze.getUint8(0),Mt=ze.getUint8(1),Ze=ze.getUint8(2),kt=ze.getUint8(3);if(Rt!==1||Mt===0){this._onError(Je.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(ze.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(Je.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));return}var an=ze.getUint8(5)&31;if(an===0){this._onError(Je.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else an>1&&N.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(an));for(var At=6,pn=0;pn<an;pn++){var nn=ze.getUint16(At,!Pe);if(At+=2,nn===0)continue;var J=new Uint8Array(W,$+At,nn);At+=nn;var R=Te.parseSPS(J);if(pn!==0)continue;ne.codecWidth=R.codec_size.width,ne.codecHeight=R.codec_size.height,ne.presentWidth=R.present_size.width,ne.presentHeight=R.present_size.height,ne.profile=R.profile_string,ne.level=R.level_string,ne.bitDepth=R.bit_depth,ne.chromaFormat=R.chroma_format,ne.sarRatio=R.sar_ratio,ne.frameRate=R.frame_rate,(R.frame_rate.fixed===!1||R.frame_rate.fps_num===0||R.frame_rate.fps_den===0)&&(ne.frameRate=this._referenceFrameRate);var k=ne.frameRate.fps_den,Y=ne.frameRate.fps_num;ne.refSampleDuration=ne.timescale*(k/Y);for(var ae=J.subarray(1,4),q="avc1.",Ie=0;Ie<3;Ie++){var ht=ae[Ie].toString(16);ht.length<2&&(ht="0"+ht),q+=ht}ne.codec=q;var Ot=this._mediaInfo;Ot.width=ne.codecWidth,Ot.height=ne.codecHeight,Ot.fps=ne.frameRate.fps,Ot.profile=ne.profile,Ot.level=ne.level,Ot.refFrames=R.ref_frames,Ot.chromaFormat=R.chroma_format_string,Ot.sarNum=ne.sarRatio.width,Ot.sarDen=ne.sarRatio.height,Ot.videoCodec=q,Ot.hasAudio?Ot.audioCodec!=null&&(Ot.mimeType='video/x-flv; codecs="'+Ot.videoCodec+","+Ot.audioCodec+'"'):Ot.mimeType='video/x-flv; codecs="'+Ot.videoCodec+'"',Ot.isComplete()&&this._onMediaInfo(Ot)}var $t=ze.getUint8(At);if($t===0){this._onError(Je.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS");return}else $t>1&&N.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat($t));At++;for(var ft=0;ft<$t;ft++){var zt=ze.getUint16(At,!Pe);if(At+=2,zt===0)continue;At+=zt}ne.avcc=new Uint8Array(Z),ne.avcc.set(new Uint8Array(W,$,Z),0),N.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",ne)}},{key:"_parseAVCVideoData",value:function(W,$,Z,ne,he,Pe,ze){for(var Rt=this._littleEndian,Mt=new DataView(W,$,Z),Ze=[],kt=0,an=0,At=this._naluLengthSize,pn=this._timestampBase+ne,nn=Pe===1;an<Z;){if(an+4>=Z){N.w(this.TAG,"Malformed Nalu near timestamp ".concat(pn,", offset = ").concat(an,", dataSize = ").concat(Z));break}var J=Mt.getUint32(an,!Rt);if(At===3&&(J>>>=8),J>Z-At){N.w(this.TAG,"Malformed Nalus near timestamp ".concat(pn,", NaluSize > DataSize!"));return}var R=Mt.getUint8(an+At)&31;R===5&&(nn=!0);var k=new Uint8Array(W,$+an,At+J),Y={type:R,data:k};Ze.push(Y),kt+=k.byteLength,an+=At+J}if(Ze.length){var ae=this._videoTrack,q={units:Ze,length:kt,isKeyframe:nn,dts:pn,cts:ze,pts:pn+ze};nn&&(q.fileposition=he),ae.samples.push(q),ae.length+=kt}}}],[{key:"probe",value:function(W){var $=new Uint8Array(W),Z={match:!1};if($[0]!==70||$[1]!==76||$[2]!==86||$[3]!==1)return Z;var ne=($[4]&4)>>>2!==0,he=($[4]&1)!==0,Pe=Lt($,5);return Pe<9?Z:{match:!0,consumed:Pe,dataOffset:Pe,hasAudioTrack:ne,hasVideoTrack:he}}}]),fe}(),Ne=It,ke=function(){function fe(){Object(Q.a)(this,fe)}return Object(z.a)(fe,null,[{key:"init",value:function(){fe.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]};for(var W in fe.types)fe.types.hasOwnProperty(W)&&(fe.types[W]=[W.charCodeAt(0),W.charCodeAt(1),W.charCodeAt(2),W.charCodeAt(3)]);var $=fe.constants={};$.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),$.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),$.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),$.STSC=$.STCO=$.STTS,$.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),$.HDLR_VIDEO=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]),$.HDLR_AUDIO=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]),$.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),$.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),$.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(W){for(var $=8,Z=null,ne=Array.prototype.slice.call(arguments,1),he=ne.length,Pe=0;Pe<he;Pe++)$+=ne[Pe].byteLength;Z=new Uint8Array($),Z[0]=$>>>24&255,Z[1]=$>>>16&255,Z[2]=$>>>8&255,Z[3]=$&255,Z.set(W,4);for(var ze=8,Rt=0;Rt<he;Rt++)Z.set(ne[Rt],ze),ze+=ne[Rt].byteLength;return Z}},{key:"generateInitSegment",value:function(W){var $=fe.box(fe.types.ftyp,fe.constants.FTYP),Z=fe.moov(W),ne=new Uint8Array($.byteLength+Z.byteLength);return ne.set($,0),ne.set(Z,$.byteLength),ne}},{key:"moov",value:function(W){var $=fe.mvhd(W.timescale,W.duration),Z=fe.trak(W),ne=fe.mvex(W);return fe.box(fe.types.moov,$,Z,ne)}},{key:"mvhd",value:function(W,$){return fe.box(fe.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,W>>>24&255,W>>>16&255,W>>>8&255,W&255,$>>>24&255,$>>>16&255,$>>>8&255,$&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]))}},{key:"trak",value:function(W){return fe.box(fe.types.trak,fe.tkhd(W),fe.mdia(W))}},{key:"tkhd",value:function(W){var $=W.id,Z=W.duration,ne=W.presentWidth,he=W.presentHeight;return fe.box(fe.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,$>>>24&255,$>>>16&255,$>>>8&255,$&255,0,0,0,0,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&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,ne>>>8&255,ne&255,0,0,he>>>8&255,he&255,0,0]))}},{key:"mdia",value:function(W){return fe.box(fe.types.mdia,fe.mdhd(W),fe.hdlr(W),fe.minf(W))}},{key:"mdhd",value:function(W){var $=W.timescale,Z=W.duration;return fe.box(fe.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,$>>>24&255,$>>>16&255,$>>>8&255,$&255,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&255,85,196,0,0]))}},{key:"hdlr",value:function(W){var $=null;return W.type==="audio"?$=fe.constants.HDLR_AUDIO:$=fe.constants.HDLR_VIDEO,fe.box(fe.types.hdlr,$)}},{key:"minf",value:function(W){var $=null;return W.type==="audio"?$=fe.box(fe.types.smhd,fe.constants.SMHD):$=fe.box(fe.types.vmhd,fe.constants.VMHD),fe.box(fe.types.minf,$,fe.dinf(),fe.stbl(W))}},{key:"dinf",value:function(){var W=fe.box(fe.types.dinf,fe.box(fe.types.dref,fe.constants.DREF));return W}},{key:"stbl",value:function(W){var $=fe.box(fe.types.stbl,fe.stsd(W),fe.box(fe.types.stts,fe.constants.STTS),fe.box(fe.types.stsc,fe.constants.STSC),fe.box(fe.types.stsz,fe.constants.STSZ),fe.box(fe.types.stco,fe.constants.STCO));return $}},{key:"stsd",value:function(W){return W.type==="audio"?W.codec==="mp3"?fe.box(fe.types.stsd,fe.constants.STSD_PREFIX,fe.mp3(W)):fe.box(fe.types.stsd,fe.constants.STSD_PREFIX,fe.mp4a(W)):fe.box(fe.types.stsd,fe.constants.STSD_PREFIX,fe.avc1(W))}},{key:"mp3",value:function(W){var $=W.channelCount,Z=W.audioSampleRate,ne=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,$,0,16,0,0,0,0,Z>>>8&255,Z&255,0,0]);return fe.box(fe.types[".mp3"],ne)}},{key:"mp4a",value:function(W){var $=W.channelCount,Z=W.audioSampleRate,ne=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,$,0,16,0,0,0,0,Z>>>8&255,Z&255,0,0]);return fe.box(fe.types.mp4a,ne,fe.esds(W))}},{key:"esds",value:function(W){var $=W.config||[],Z=$.length,ne=new Uint8Array([0,0,0,0,3,23+Z,0,1,0,4,15+Z,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([Z]).concat($).concat([6,1,2]));return fe.box(fe.types.esds,ne)}},{key:"avc1",value:function(W){var $=W.avcc,Z=W.codecWidth,ne=W.codecHeight,he=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,Z>>>8&255,Z&255,ne>>>8&255,ne&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return fe.box(fe.types.avc1,he,fe.box(fe.types.avcC,$))}},{key:"mvex",value:function(W){return fe.box(fe.types.mvex,fe.trex(W))}},{key:"trex",value:function(W){var $=W.id,Z=new Uint8Array([0,0,0,0,$>>>24&255,$>>>16&255,$>>>8&255,$&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return fe.box(fe.types.trex,Z)}},{key:"moof",value:function(W,$){return fe.box(fe.types.moof,fe.mfhd(W.sequenceNumber),fe.traf(W,$))}},{key:"mfhd",value:function(W){var $=new Uint8Array([0,0,0,0,W>>>24&255,W>>>16&255,W>>>8&255,W&255]);return fe.box(fe.types.mfhd,$)}},{key:"traf",value:function(W,$){var Z=W.id,ne=fe.box(fe.types.tfhd,new Uint8Array([0,0,0,0,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&255])),he=fe.box(fe.types.tfdt,new Uint8Array([0,0,0,0,$>>>24&255,$>>>16&255,$>>>8&255,$&255])),Pe=fe.sdtp(W),ze=fe.trun(W,Pe.byteLength+16+16+8+16+8+8);return fe.box(fe.types.traf,ne,he,ze,Pe)}},{key:"sdtp",value:function(W){for(var $=W.samples||[],Z=$.length,ne=new Uint8Array(4+Z),he=0;he<Z;he++){var Pe=$[he].flags;ne[he+4]=Pe.isLeading<<6|Pe.dependsOn<<4|Pe.isDependedOn<<2|Pe.hasRedundancy}return fe.box(fe.types.sdtp,ne)}},{key:"trun",value:function(W,$){var Z=W.samples||[],ne=Z.length,he=12+16*ne,Pe=new Uint8Array(he);$+=8+he,Pe.set([0,0,15,1,ne>>>24&255,ne>>>16&255,ne>>>8&255,ne&255,$>>>24&255,$>>>16&255,$>>>8&255,$&255],0);for(var ze=0;ze<ne;ze++){var Rt=Z[ze].duration,Mt=Z[ze].size,Ze=Z[ze].flags,kt=Z[ze].cts;Pe.set([Rt>>>24&255,Rt>>>16&255,Rt>>>8&255,Rt&255,Mt>>>24&255,Mt>>>16&255,Mt>>>8&255,Mt&255,Ze.isLeading<<2|Ze.dependsOn,Ze.isDependedOn<<6|Ze.hasRedundancy<<4|Ze.isNonSync,0,0,kt>>>24&255,kt>>>16&255,kt>>>8&255,kt&255],12+16*ze)}return fe.box(fe.types.trun,Pe)}},{key:"mdat",value:function(W){return fe.box(fe.types.mdat,W)}}]),fe}();ke.init();var it=ke,ot=function(){function fe(){Object(Q.a)(this,fe)}return Object(z.a)(fe,null,[{key:"getSilentFrame",value:function(W,$){if(W==="mp4a.40.2"){if($===1)return new Uint8Array([0,200,0,128,35,128]);if($===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if($===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if($===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if($===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($===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])}else{if($===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($===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($===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])}return null}}]),fe}(),Ge=ot,$e=function fe(se,W,$,Z,ne){Object(Q.a)(this,fe),this.dts=se,this.pts=W,this.duration=$,this.originalDts=Z,this.isSyncPoint=ne,this.fileposition=null},we=function(){function fe(){Object(Q.a)(this,fe),this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return Object(z.a)(fe,[{key:"appendSyncPoint",value:function(W){W.isSyncPoint=!0,this.syncPoints.push(W)}}]),fe}(),Se=function(){function fe(){Object(Q.a)(this,fe),this._list=[]}return Object(z.a)(fe,[{key:"clear",value:function(){this._list=[]}},{key:"appendArray",value:function(W){var $=this._list;if(W.length===0)return;$.length>0&&W[0].originalDts<$[$.length-1].originalDts&&this.clear(),Array.prototype.push.apply($,W)}},{key:"getLastSyncPointBeforeDts",value:function(W){if(this._list.length==0)return null;var $=this._list,Z=0,ne=$.length-1,he=0,Pe=0,ze=ne;for(W<$[0].dts&&(Z=0,Pe=ze+1);Pe<=ze;)if(he=Pe+Math.floor((ze-Pe)/2),he===ne||W>=$[he].dts&&W<$[he+1].dts){Z=he;break}else $[he].dts<W?Pe=he+1:ze=he-1;return this._list[Z]}}]),fe}(),Ee=function(){function fe(se){Object(Q.a)(this,fe),this._type=se,this._list=[],this._lastAppendLocation=-1}return Object(z.a)(fe,[{key:"type",get:function(){return this._type}},{key:"length",get:function(){return this._list.length}},{key:"isEmpty",value:function(){return this._list.length===0}},{key:"clear",value:function(){this._list=[],this._lastAppendLocation=-1}},{key:"_searchNearestSegmentBefore",value:function(W){var $=this._list;if($.length===0)return-2;var Z=$.length-1,ne=0,he=0,Pe=Z,ze=0;if(W<$[0].originalBeginDts)return ze=-1,ze;for(;he<=Pe;)if(ne=he+Math.floor((Pe-he)/2),ne===Z||W>$[ne].lastSample.originalDts&&W<$[ne+1].originalBeginDts){ze=ne;break}else $[ne].originalBeginDts<W?he=ne+1:Pe=ne-1;return ze}},{key:"_searchNearestSegmentAfter",value:function(W){return this._searchNearestSegmentBefore(W)+1}},{key:"append",value:function(W){var $=this._list,Z=W,ne=this._lastAppendLocation,he=0;ne!==-1&&ne<$.length&&Z.originalBeginDts>=$[ne].lastSample.originalDts&&(ne===$.length-1||ne<$.length-1&&Z.originalBeginDts<$[ne+1].originalBeginDts)?he=ne+1:$.length>0&&(he=this._searchNearestSegmentBefore(Z.originalBeginDts)+1),this._lastAppendLocation=he,this._list.splice(he,0,Z)}},{key:"getLastSegmentBefore",value:function(W){var $=this._searchNearestSegmentBefore(W);return $>=0?this._list[$]:null}},{key:"getLastSampleBefore",value:function(W){var $=this.getLastSegmentBefore(W);return $!=null?$.lastSample:null}},{key:"getLastSyncPointBefore",value:function(W){for(var $=this._searchNearestSegmentBefore(W),Z=this._list[$].syncPoints;Z.length===0&&$>0;)$--,Z=this._list[$].syncPoints;return Z.length>0?Z[Z.length-1]:null}}]),fe}(),ue=function(){function fe(se){Object(Q.a)(this,fe),this.TAG="MP4Remuxer",this._config=se,this._isLive=se.isLive===!0,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=Infinity,this._videoDtsBase=Infinity,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new Ee("audio"),this._videoSegmentInfoList=new Ee("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(w.chrome&&(w.version.major<50||w.version.major===50&&w.version.build<2661)),this._fillSilentAfterSeek=w.msedge||w.msie,this._mp3UseMpegAudio=!w.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return Object(z.a)(fe,[{key:"destroy",value:function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null}},{key:"bindDataSource",value:function(W){return W.onDataAvailable=this.remux.bind(this),W.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}},{key:"onInitSegment",get:function(){return this._onInitSegment},set:function(W){this._onInitSegment=W}},{key:"onMediaSegment",get:function(){return this._onMediaSegment},set:function(W){this._onMediaSegment=W}},{key:"insertDiscontinuity",value:function(){this._audioNextDts=this._videoNextDts=void 0}},{key:"seek",value:function(W){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}},{key:"remux",value:function(W,$){if(!this._onMediaSegment)throw new u("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(W,$),this._remuxVideo($),this._remuxAudio(W)}},{key:"_onTrackMetadataReceived",value:function(W,$){var Z=null,ne="mp4",he=$.codec;if(W==="audio")this._audioMeta=$,$.codec==="mp3"&&this._mp3UseMpegAudio?(ne="mpeg",he="",Z=new Uint8Array):Z=it.generateInitSegment($);else if(W==="video")this._videoMeta=$,Z=it.generateInitSegment($);else return;if(!this._onInitSegment)throw new u("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(W,{type:W,data:Z.buffer,codec:he,container:"".concat(W,"/").concat(ne),mediaDuration:$.duration})}},{key:"_calculateDtsBase",value:function(W,$){if(this._dtsBaseInited)return;W.samples&&W.samples.length&&(this._audioDtsBase=W.samples[0].dts),$.samples&&$.samples.length&&(this._videoDtsBase=$.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0}},{key:"flushStashedSamples",value:function(){var W=this._videoStashedLastSample,$=this._audioStashedLastSample,Z={type:"video",id:1,sequenceNumber:0,samples:[],length:0};W!=null&&(Z.samples.push(W),Z.length=W.length);var ne={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};$!=null&&(ne.samples.push($),ne.length=$.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(Z,!0),this._remuxAudio(ne,!0)}},{key:"_remuxAudio",value:function(W,$){if(this._audioMeta==null)return;var Z=W,ne=Z.samples,he=void 0,Pe=-1,ze=-1,Rt=-1,Mt=this._audioMeta.refSampleDuration,Ze=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,kt=this._dtsBaseInited&&this._audioNextDts===void 0,an=!1;if(!ne||ne.length===0)return;if(ne.length===1&&!$)return;var At=0,pn=null,nn=0;Ze?(At=0,nn=Z.length):(At=8,nn=8+Z.length);var J=null;if(ne.length>1&&(J=ne.pop(),nn-=J.length),this._audioStashedLastSample!=null){var R=this._audioStashedLastSample;this._audioStashedLastSample=null,ne.unshift(R),nn+=R.length}J!=null&&(this._audioStashedLastSample=J);var k=ne[0].dts-this._dtsBase;if(this._audioNextDts)he=k-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())he=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&(this._audioMeta.originalCodec!=="mp3"&&(an=!0));else{var Y=this._audioSegmentInfoList.getLastSampleBefore(k);if(Y!=null){var ae=k-(Y.originalDts+Y.duration);ae<=3&&(ae=0);var q=Y.dts+Y.duration+ae;he=k-q}else he=0}if(an){var Ie=k-he,ht=this._videoSegmentInfoList.getLastSegmentBefore(k);if(ht!=null&&ht.beginDts<Ie){var Ot=Ge.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(Ot){var $t=ht.beginDts,ft=Ie-ht.beginDts;N.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat($t,", duration: ").concat(ft)),ne.unshift({unit:Ot,dts:$t,pts:$t}),nn+=Ot.byteLength}}else an=!1}for(var zt=[],on=0;on<ne.length;on++){var Wn=ne[on],Si=Wn.unit,hi=Wn.dts-this._dtsBase,Fn=hi-he;Pe===-1&&(Pe=Fn);var ci=0;if(on!==ne.length-1){var Zi=ne[on+1].dts-this._dtsBase-he;ci=Zi-Fn}else if(J!=null){var yi=J.dts-this._dtsBase-he;ci=yi-Fn}else zt.length>=1?ci=zt[zt.length-1].duration:ci=Math.floor(Mt);var ri=!1,Ci=null;if(ci>Mt*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!w.safari){ri=!0;var Di=Math.abs(ci-Mt),Oi=Math.ceil(Di/Mt),Ri=Fn+Mt;N.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.
|
|
`+"dts: ".concat(Fn+ci," ms, expected: ").concat(Fn+Math.round(Mt)," ms, ")+"delta: ".concat(Math.round(Di)," ms, generate: ").concat(Oi," frames"));var Vi=Ge.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);Vi==null&&(N.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),Vi=Si),Ci=[];for(var dr=0;dr<Oi;dr++){var rr=Math.round(Ri);if(Ci.length>0){var ji=Ci[Ci.length-1];ji.duration=rr-ji.dts}var Wi={dts:rr,pts:rr,cts:0,unit:Vi,size:Vi.byteLength,duration:0,originalDts:hi,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};Ci.push(Wi),nn+=Wi.size,Ri+=Mt}var hr=Ci[Ci.length-1];hr.duration=Fn+ci-hr.dts,ci=Math.round(Mt)}zt.push({dts:Fn,pts:Fn,cts:0,unit:Wn.unit,size:Wn.unit.byteLength,duration:ci,originalDts:hi,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),ri&&zt.push.apply(zt,Ci)}Ze?pn=new Uint8Array(nn):(pn=new Uint8Array(nn),pn[0]=nn>>>24&255,pn[1]=nn>>>16&255,pn[2]=nn>>>8&255,pn[3]=nn&255,pn.set(it.types.mdat,4));for(var Tr=0;Tr<zt.length;Tr++){var ar=zt[Tr].unit;pn.set(ar,At),At+=ar.byteLength}var Hn=zt[zt.length-1];ze=Hn.dts+Hn.duration,this._audioNextDts=ze;var wn=new we;wn.beginDts=Pe,wn.endDts=ze,wn.beginPts=Pe,wn.endPts=ze,wn.originalBeginDts=zt[0].originalDts,wn.originalEndDts=Hn.originalDts+Hn.duration,wn.firstSample=new $e(zt[0].dts,zt[0].pts,zt[0].duration,zt[0].originalDts,!1),wn.lastSample=new $e(Hn.dts,Hn.pts,Hn.duration,Hn.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(wn),Z.samples=zt,Z.sequenceNumber++;var _i=null;Ze?_i=new Uint8Array:_i=it.moof(Z,Pe),Z.samples=[],Z.length=0;var Nn={type:"audio",data:this._mergeBoxes(_i,pn).buffer,sampleCount:zt.length,info:wn};Ze&&kt&&(Nn.timestampOffset=Pe),this._onMediaSegment("audio",Nn)}},{key:"_remuxVideo",value:function(W,$){if(this._videoMeta==null)return;var Z=W,ne=Z.samples,he=void 0,Pe=-1,ze=-1,Rt=-1,Mt=-1;if(!ne||ne.length===0)return;if(ne.length===1&&!$)return;var Ze=8,kt=null,an=8+W.length,At=null;if(ne.length>1&&(At=ne.pop(),an-=At.length),this._videoStashedLastSample!=null){var pn=this._videoStashedLastSample;this._videoStashedLastSample=null,ne.unshift(pn),an+=pn.length}At!=null&&(this._videoStashedLastSample=At);var nn=ne[0].dts-this._dtsBase;if(this._videoNextDts)he=nn-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())he=0;else{var J=this._videoSegmentInfoList.getLastSampleBefore(nn);if(J!=null){var R=nn-(J.originalDts+J.duration);R<=3&&(R=0);var k=J.dts+J.duration+R;he=nn-k}else he=0}for(var Y=new we,ae=[],q=0;q<ne.length;q++){var Ie=ne[q],ht=Ie.dts-this._dtsBase,Ot=Ie.isKeyframe,$t=ht-he,ft=Ie.cts,zt=$t+ft;Pe===-1&&(Pe=$t,Rt=zt);var on=0;if(q!==ne.length-1){var Wn=ne[q+1].dts-this._dtsBase-he;on=Wn-$t}else if(At!=null){var Si=At.dts-this._dtsBase-he;on=Si-$t}else ae.length>=1?on=ae[ae.length-1].duration:on=Math.floor(this._videoMeta.refSampleDuration);if(Ot){var hi=new $e($t,zt,on,Ie.dts,!0);hi.fileposition=Ie.fileposition,Y.appendSyncPoint(hi)}ae.push({dts:$t,pts:zt,cts:ft,units:Ie.units,size:Ie.length,isKeyframe:Ot,duration:on,originalDts:ht,flags:{isLeading:0,dependsOn:Ot?2:1,isDependedOn:Ot?1:0,hasRedundancy:0,isNonSync:Ot?0:1}})}kt=new Uint8Array(an),kt[0]=an>>>24&255,kt[1]=an>>>16&255,kt[2]=an>>>8&255,kt[3]=an&255,kt.set(it.types.mdat,4);for(var Fn=0;Fn<ae.length;Fn++)for(var ci=ae[Fn].units;ci.length;){var Zi=ci.shift(),yi=Zi.data;kt.set(yi,Ze),Ze+=yi.byteLength}var ri=ae[ae.length-1];if(ze=ri.dts+ri.duration,Mt=ri.pts+ri.duration,this._videoNextDts=ze,Y.beginDts=Pe,Y.endDts=ze,Y.beginPts=Rt,Y.endPts=Mt,Y.originalBeginDts=ae[0].originalDts,Y.originalEndDts=ri.originalDts+ri.duration,Y.firstSample=new $e(ae[0].dts,ae[0].pts,ae[0].duration,ae[0].originalDts,ae[0].isKeyframe),Y.lastSample=new $e(ri.dts,ri.pts,ri.duration,ri.originalDts,ri.isKeyframe),this._isLive||this._videoSegmentInfoList.append(Y),Z.samples=ae,Z.sequenceNumber++,this._forceFirstIDR){var Ci=ae[0].flags;Ci.dependsOn=2,Ci.isNonSync=0}var Di=it.moof(Z,Pe);Z.samples=[],Z.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(Di,kt).buffer,sampleCount:ae.length,info:Y})}},{key:"_mergeBoxes",value:function(W,$){var Z=new Uint8Array(W.byteLength+$.byteLength);return Z.set(W,0),Z.set($,W.byteLength),Z}}]),fe}(),de=ue,ye={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"},me=ye,Le=function(){function fe(se,W){Object(Q.a)(this,fe),this.TAG="TransmuxingController",this._emitter=new I.a,this._config=W,se.segments||(se.segments=[{duration:se.duration,filesize:se.filesize,url:se.url}]),typeof se.cors!="boolean"&&(se.cors=!0),typeof se.withCredentials!="boolean"&&(se.withCredentials=!1),this._mediaDataSource=se,this._currentSegmentIndex=0;var $=0;this._mediaDataSource.segments.forEach(function(Z){Z.timestampBase=$,$+=Z.duration,Z.cors=se.cors,Z.withCredentials=se.withCredentials,W.referrerPolicy&&(Z.referrerPolicy=W.referrerPolicy)}),!isNaN($)&&this._mediaDataSource.duration!==$&&(this._mediaDataSource.duration=$),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return Object(z.a)(fe,[{key:"destroy",value:function(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(W,$){this._emitter.addListener(W,$)}},{key:"off",value:function(W,$){this._emitter.removeListener(W,$)}},{key:"start",value:function(){this._loadSegment(0),this._enableStatisticsReporter()}},{key:"_loadSegment",value:function(W,$){this._currentSegmentIndex=W;var Z=this._mediaDataSource.segments[W],ne=this._ioctl=new re(Z,this._config,W);ne.onError=this._onIOException.bind(this),ne.onSeeked=this._onIOSeeked.bind(this),ne.onComplete=this._onIOComplete.bind(this),ne.onRedirect=this._onIORedirect.bind(this),ne.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),$?this._demuxer.bindDataSource(this._ioctl):ne.onDataArrival=this._onInitChunkArrival.bind(this),ne.open($)}},{key:"stop",value:function(){this._internalAbort(),this._disableStatisticsReporter()}},{key:"_internalAbort",value:function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)}},{key:"pause",value:function(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())}},{key:"resume",value:function(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())}},{key:"seek",value:function(W){if(this._mediaInfo==null||!this._mediaInfo.isSeekable())return;var $=this._searchSegmentIndexContains(W);if($===this._currentSegmentIndex){var Z=this._mediaInfo.segments[$];if(Z==null)this._pendingSeekTime=W;else{var ne=Z.getNearestKeyframe(W);this._remuxer.seek(ne.milliseconds),this._ioctl.seek(ne.fileposition),this._pendingResolveSeekPoint=ne.milliseconds}}else{var he=this._mediaInfo.segments[$];if(he==null)this._pendingSeekTime=W,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment($);else{var Pe=he.getNearestKeyframe(W);this._internalAbort(),this._remuxer.seek(W),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[$].timestampBase,this._loadSegment($,Pe.fileposition),this._pendingResolveSeekPoint=Pe.milliseconds,this._reportSegmentMediaInfo($)}}this._enableStatisticsReporter()}},{key:"_searchSegmentIndexContains",value:function(W){for(var $=this._mediaDataSource.segments,Z=$.length-1,ne=0;ne<$.length;ne++)if(W<$[ne].timestampBase){Z=ne-1;break}return Z}},{key:"_onInitChunkArrival",value:function(W,$){var Z=this,ne=null,he=0;if($>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,he=this._demuxer.parseChunks(W,$);else if((ne=Ne.probe(W)).match){this._demuxer=new Ne(ne,this._config),this._remuxer||(this._remuxer=new de(this._config));var Pe=this._mediaDataSource;Pe.duration!=null&&!isNaN(Pe.duration)&&(this._demuxer.overridedDuration=Pe.duration),typeof Pe.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=Pe.hasAudio),typeof Pe.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=Pe.hasVideo),this._demuxer.timestampBase=Pe.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),he=this._demuxer.parseChunks(W,$)}else ne=null,N.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(function(){Z._internalAbort()}),this._emitter.emit(me.DEMUX_ERROR,Je.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),he=0;return he}},{key:"_onMediaInfo",value:function(W){var $=this;this._mediaInfo==null&&(this._mediaInfo=Object.assign({},W),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,mt.prototype));var Z=Object.assign({},W);Object.setPrototypeOf(Z,mt.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=Z,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var ne=$._pendingSeekTime;$._pendingSeekTime=null,$.seek(ne)})}},{key:"_onMetaDataArrived",value:function(W){this._emitter.emit(me.METADATA_ARRIVED,W)}},{key:"_onScriptDataArrived",value:function(W){this._emitter.emit(me.SCRIPTDATA_ARRIVED,W)}},{key:"_onIOSeeked",value:function(){this._remuxer.insertDiscontinuity()}},{key:"_onIOComplete",value:function(W){var $=W,Z=$+1;Z<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment(Z)):(this._remuxer.flushStashedSamples(),this._emitter.emit(me.LOADING_COMPLETE),this._disableStatisticsReporter())}},{key:"_onIORedirect",value:function(W){var $=this._ioctl.extraData;this._mediaDataSource.segments[$].redirectedURL=W}},{key:"_onIORecoveredEarlyEof",value:function(){this._emitter.emit(me.RECOVERED_EARLY_EOF)}},{key:"_onIOException",value:function(W,$){N.e(this.TAG,"IOException: type = ".concat(W,", code = ").concat($.code,", msg = ").concat($.msg)),this._emitter.emit(me.IO_ERROR,W,$),this._disableStatisticsReporter()}},{key:"_onDemuxException",value:function(W,$){N.e(this.TAG,"DemuxException: type = ".concat(W,", info = ").concat($)),this._emitter.emit(me.DEMUX_ERROR,W,$)}},{key:"_onRemuxerInitSegmentArrival",value:function(W,$){this._emitter.emit(me.INIT_SEGMENT,W,$)}},{key:"_onRemuxerMediaSegmentArrival",value:function(W,$){if(this._pendingSeekTime!=null)return;if(this._emitter.emit(me.MEDIA_SEGMENT,W,$),this._pendingResolveSeekPoint!=null&&W==="video"){var Z=$.info.syncPoints,ne=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,w.safari&&Z.length>0&&Z[0].originalDts===ne&&(ne=Z[0].pts),this._emitter.emit(me.RECOMMEND_SEEKPOINT,ne)}}},{key:"_enableStatisticsReporter",value:function(){this._statisticsReporter==null&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}},{key:"_disableStatisticsReporter",value:function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"_reportSegmentMediaInfo",value:function(W){var $=this._mediaInfo.segments[W],Z=Object.assign({},$);Z.duration=this._mediaInfo.duration,Z.segmentCount=this._mediaInfo.segmentCount,delete Z.segments,delete Z.keyframesIndex,this._emitter.emit(me.MEDIA_INFO,Z)}},{key:"_reportStatisticsInfo",value:function(){var W={};W.url=this._ioctl.currentURL,W.hasRedirect=this._ioctl.hasRedirect,W.hasRedirect&&(W.redirectedURL=this._ioctl.currentRedirectedURL),W.speed=this._ioctl.currentSpeed,W.loaderType=this._ioctl.loaderType,W.currentSegmentIndex=this._currentSegmentIndex,W.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(me.STATISTICS_INFO,W)}}]),fe}(),Xe=Le,ut=function(se){var W="TransmuxingWorker",$=null,Z=nn.bind(this);X.install(),se.addEventListener("message",function(J){switch(J.data.cmd){case"init":$=new Xe(J.data.param[0],J.data.param[1]),$.on(me.IO_ERROR,an.bind(this)),$.on(me.DEMUX_ERROR,At.bind(this)),$.on(me.INIT_SEGMENT,ne.bind(this)),$.on(me.MEDIA_SEGMENT,he.bind(this)),$.on(me.LOADING_COMPLETE,Pe.bind(this)),$.on(me.RECOVERED_EARLY_EOF,ze.bind(this)),$.on(me.MEDIA_INFO,Rt.bind(this)),$.on(me.METADATA_ARRIVED,Mt.bind(this)),$.on(me.SCRIPTDATA_ARRIVED,Ze.bind(this)),$.on(me.STATISTICS_INFO,kt.bind(this)),$.on(me.RECOMMEND_SEEKPOINT,pn.bind(this));break;case"destroy":$&&($.destroy(),$=null),se.postMessage({msg:"destroyed"});break;case"start":$.start();break;case"stop":$.stop();break;case"seek":$.seek(J.data.param);break;case"pause":$.pause();break;case"resume":$.resume();break;case"logging_config":{var R=J.data.param;be.applyConfig(R),R.enableCallback===!0?be.addLogListener(Z):be.removeLogListener(Z);break}}});function ne(J,R){var k={msg:me.INIT_SEGMENT,data:{type:J,data:R}};se.postMessage(k,[R.data])}function he(J,R){var k={msg:me.MEDIA_SEGMENT,data:{type:J,data:R}};se.postMessage(k,[R.data])}function Pe(){var J={msg:me.LOADING_COMPLETE};se.postMessage(J)}function ze(){var J={msg:me.RECOVERED_EARLY_EOF};se.postMessage(J)}function Rt(J){var R={msg:me.MEDIA_INFO,data:J};se.postMessage(R)}function Mt(J){var R={msg:me.METADATA_ARRIVED,data:J};se.postMessage(R)}function Ze(J){var R={msg:me.SCRIPTDATA_ARRIVED,data:J};se.postMessage(R)}function kt(J){var R={msg:me.STATISTICS_INFO,data:J};se.postMessage(R)}function an(J,R){se.postMessage({msg:me.IO_ERROR,data:{type:J,info:R}})}function At(J,R){se.postMessage({msg:me.DEMUX_ERROR,data:{type:J,info:R}})}function pn(J){se.postMessage({msg:me.RECOMMEND_SEEKPOINT,data:J})}function nn(J,R){se.postMessage({msg:"logcat_callback",data:{type:J,logcat:R}})}},Dt=ut,jt=function(){function fe(se,W){if(Object(Q.a)(this,fe),this.TAG="Transmuxer",this._emitter=new I.a,W.enableWorker&&typeof Worker!="undefined")try{var $=D("0r65");this._worker=$(Dt),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[se,W]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},be.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:be.getConfig()})}catch(ne){N.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new Xe(se,W)}else this._controller=new Xe(se,W);if(this._controller){var Z=this._controller;Z.on(me.IO_ERROR,this._onIOError.bind(this)),Z.on(me.DEMUX_ERROR,this._onDemuxError.bind(this)),Z.on(me.INIT_SEGMENT,this._onInitSegment.bind(this)),Z.on(me.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),Z.on(me.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),Z.on(me.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),Z.on(me.MEDIA_INFO,this._onMediaInfo.bind(this)),Z.on(me.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),Z.on(me.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),Z.on(me.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),Z.on(me.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return Object(z.a)(fe,[{key:"destroy",value:function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),be.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(W,$){this._emitter.addListener(W,$)}},{key:"off",value:function(W,$){this._emitter.removeListener(W,$)}},{key:"hasWorker",value:function(){return this._worker!=null}},{key:"open",value:function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()}},{key:"close",value:function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()}},{key:"seek",value:function(W){this._worker?this._worker.postMessage({cmd:"seek",param:W}):this._controller.seek(W)}},{key:"pause",value:function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}},{key:"resume",value:function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}},{key:"_onInitSegment",value:function(W,$){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(me.INIT_SEGMENT,W,$)})}},{key:"_onMediaSegment",value:function(W,$){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(me.MEDIA_SEGMENT,W,$)})}},{key:"_onLoadingComplete",value:function(){var W=this;Promise.resolve().then(function(){W._emitter.emit(me.LOADING_COMPLETE)})}},{key:"_onRecoveredEarlyEof",value:function(){var W=this;Promise.resolve().then(function(){W._emitter.emit(me.RECOVERED_EARLY_EOF)})}},{key:"_onMediaInfo",value:function(W){var $=this;Promise.resolve().then(function(){$._emitter.emit(me.MEDIA_INFO,W)})}},{key:"_onMetaDataArrived",value:function(W){var $=this;Promise.resolve().then(function(){$._emitter.emit(me.METADATA_ARRIVED,W)})}},{key:"_onScriptDataArrived",value:function(W){var $=this;Promise.resolve().then(function(){$._emitter.emit(me.SCRIPTDATA_ARRIVED,W)})}},{key:"_onStatisticsInfo",value:function(W){var $=this;Promise.resolve().then(function(){$._emitter.emit(me.STATISTICS_INFO,W)})}},{key:"_onIOError",value:function(W,$){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(me.IO_ERROR,W,$)})}},{key:"_onDemuxError",value:function(W,$){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(me.DEMUX_ERROR,W,$)})}},{key:"_onRecommendSeekpoint",value:function(W){var $=this;Promise.resolve().then(function(){$._emitter.emit(me.RECOMMEND_SEEKPOINT,W)})}},{key:"_onLoggingConfigChanged",value:function(W){this._worker&&this._worker.postMessage({cmd:"logging_config",param:W})}},{key:"_onWorkerMessage",value:function(W){var $=W.data,Z=$.data;if($.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch($.msg){case me.INIT_SEGMENT:case me.MEDIA_SEGMENT:this._emitter.emit($.msg,Z.type,Z.data);break;case me.LOADING_COMPLETE:case me.RECOVERED_EARLY_EOF:this._emitter.emit($.msg);break;case me.MEDIA_INFO:Object.setPrototypeOf(Z,mt.prototype),this._emitter.emit($.msg,Z);break;case me.METADATA_ARRIVED:case me.SCRIPTDATA_ARRIVED:case me.STATISTICS_INFO:this._emitter.emit($.msg,Z);break;case me.IO_ERROR:case me.DEMUX_ERROR:this._emitter.emit($.msg,Z.type,Z.info);break;case me.RECOMMEND_SEEKPOINT:this._emitter.emit($.msg,Z);break;case"logcat_callback":N.emitter.emit("log",Z.type,Z.logcat);break;default:break}}}]),fe}(),Ut=jt,Ct={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"},et=Ct,st=function(){function fe(se){Object(Q.a)(this,fe),this.TAG="MSEController",this._config=se,this._emitter=new I.a,this._config.isLive&&this._config.autoCleanupSourceBuffer==null&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new Se}return Object(z.a)(fe,[{key:"destroy",value:function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(W,$){this._emitter.addListener(W,$)}},{key:"off",value:function(W,$){this._emitter.removeListener(W,$)}},{key:"attachMediaElement",value:function(W){if(this._mediaSource)throw new u("MediaSource has been attached to an HTMLMediaElement!");var $=this._mediaSource=new window.MediaSource;$.addEventListener("sourceopen",this.e.onSourceOpen),$.addEventListener("sourceended",this.e.onSourceEnded),$.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=W,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),W.src=this._mediaSourceObjectURL}},{key:"detachMediaElement",value:function(){if(this._mediaSource){var W=this._mediaSource;for(var $ in this._sourceBuffers){var Z=this._pendingSegments[$];Z.splice(0,Z.length),this._pendingSegments[$]=null,this._pendingRemoveRanges[$]=null,this._lastInitSegments[$]=null;var ne=this._sourceBuffers[$];if(ne){if(W.readyState!=="closed"){try{W.removeSourceBuffer(ne)}catch(he){N.e(this.TAG,he.message)}ne.removeEventListener("error",this.e.onSourceBufferError),ne.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[$]=null,this._sourceBuffers[$]=null}}if(W.readyState==="open")try{W.endOfStream()}catch(he){N.e(this.TAG,he.message)}W.removeEventListener("sourceopen",this.e.onSourceOpen),W.removeEventListener("sourceended",this.e.onSourceEnded),W.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)}},{key:"appendInitSegment",value:function(W,$){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(W),this._pendingSegments[W.type].push(W);return}var Z=W,ne="".concat(Z.container);Z.codec&&Z.codec.length>0&&(ne+=";codecs=".concat(Z.codec));var he=!1;if(N.v(this.TAG,"Received Initialization Segment, mimeType: "+ne),this._lastInitSegments[Z.type]=Z,ne!==this._mimeTypes[Z.type]){if(this._mimeTypes[Z.type])N.v(this.TAG,"Notice: ".concat(Z.type," mimeType changed, origin: ").concat(this._mimeTypes[Z.type],", target: ").concat(ne));else{he=!0;try{var Pe=this._sourceBuffers[Z.type]=this._mediaSource.addSourceBuffer(ne);Pe.addEventListener("error",this.e.onSourceBufferError),Pe.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(ze){N.e(this.TAG,ze.message),this._emitter.emit(et.ERROR,{code:ze.code,msg:ze.message});return}}this._mimeTypes[Z.type]=ne}$||this._pendingSegments[Z.type].push(Z),he||this._sourceBuffers[Z.type]&&!this._sourceBuffers[Z.type].updating&&this._doAppendSegments(),w.safari&&Z.container==="audio/mpeg"&&Z.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=Z.mediaDuration/1e3,this._updateMediaSourceDuration())}},{key:"appendMediaSegment",value:function(W){var $=W;this._pendingSegments[$.type].push($),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var Z=this._sourceBuffers[$.type];Z&&!Z.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}},{key:"seek",value:function(W){for(var $ in this._sourceBuffers){if(!this._sourceBuffers[$])continue;var Z=this._sourceBuffers[$];if(this._mediaSource.readyState==="open")try{Z.abort()}catch(Mt){N.e(this.TAG,Mt.message)}this._idrList.clear();var ne=this._pendingSegments[$];if(ne.splice(0,ne.length),this._mediaSource.readyState==="closed")continue;for(var he=0;he<Z.buffered.length;he++){var Pe=Z.buffered.start(he),ze=Z.buffered.end(he);this._pendingRemoveRanges[$].push({start:Pe,end:ze})}if(Z.updating||this._doRemoveRanges(),w.safari){var Rt=this._lastInitSegments[$];Rt&&(this._pendingSegments[$].push(Rt),Z.updating||this._doAppendSegments())}}}},{key:"endOfStream",value:function(){var W=this._mediaSource,$=this._sourceBuffers;if(!W||W.readyState!=="open"){W&&W.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0);return}$.video&&$.video.updating||$.audio&&$.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,W.endOfStream())}},{key:"getNearestKeyframe",value:function(W){return this._idrList.getLastSyncPointBeforeDts(W)}},{key:"_needCleanupSourceBuffer",value:function(){if(!this._config.autoCleanupSourceBuffer)return!1;var W=this._mediaElement.currentTime;for(var $ in this._sourceBuffers){var Z=this._sourceBuffers[$];if(Z){var ne=Z.buffered;if(ne.length>=1&&W-ne.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}},{key:"_doCleanupSourceBuffer",value:function(){var W=this._mediaElement.currentTime;for(var $ in this._sourceBuffers){var Z=this._sourceBuffers[$];if(Z){for(var ne=Z.buffered,he=!1,Pe=0;Pe<ne.length;Pe++){var ze=ne.start(Pe),Rt=ne.end(Pe);if(ze<=W&&W<Rt+3){if(W-ze>=this._config.autoCleanupMaxBackwardDuration){he=!0;var Mt=W-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[$].push({start:ze,end:Mt})}}else Rt<W&&(he=!0,this._pendingRemoveRanges[$].push({start:ze,end:Rt}))}he&&!Z.updating&&this._doRemoveRanges()}}}},{key:"_updateMediaSourceDuration",value:function(){var W=this._sourceBuffers;if(this._mediaElement.readyState===0||this._mediaSource.readyState!=="open")return;if(W.video&&W.video.updating||W.audio&&W.audio.updating)return;var $=this._mediaSource.duration,Z=this._pendingMediaDuration;Z>0&&(isNaN($)||Z>$)&&(N.v(this.TAG,"Update MediaSource duration from ".concat($," to ").concat(Z)),this._mediaSource.duration=Z),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},{key:"_doRemoveRanges",value:function(){for(var W in this._pendingRemoveRanges){if(!this._sourceBuffers[W]||this._sourceBuffers[W].updating)continue;for(var $=this._sourceBuffers[W],Z=this._pendingRemoveRanges[W];Z.length&&!$.updating;){var ne=Z.shift();$.remove(ne.start,ne.end)}}}},{key:"_doAppendSegments",value:function(){var W=this._pendingSegments;for(var $ in W){if(!this._sourceBuffers[$]||this._sourceBuffers[$].updating)continue;if(W[$].length>0){var Z=W[$].shift();if(Z.timestampOffset){var ne=this._sourceBuffers[$].timestampOffset,he=Z.timestampOffset/1e3,Pe=Math.abs(ne-he);Pe>.1&&(N.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(ne," to ").concat(he)),this._sourceBuffers[$].timestampOffset=he),delete Z.timestampOffset}if(!Z.data||Z.data.byteLength===0)continue;try{this._sourceBuffers[$].appendBuffer(Z.data),this._isBufferFull=!1,$==="video"&&Z.hasOwnProperty("info")&&this._idrList.appendArray(Z.info.syncPoints)}catch(ze){this._pendingSegments[$].unshift(Z),ze.code===22?(this._isBufferFull||this._emitter.emit(et.BUFFER_FULL),this._isBufferFull=!0):(N.e(this.TAG,ze.message),this._emitter.emit(et.ERROR,{code:ze.code,msg:ze.message}))}}}}},{key:"_onSourceOpen",value:function(){if(N.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var W=this._pendingSourceBufferInit;W.length;){var $=W.shift();this.appendInitSegment($,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(et.SOURCE_OPEN)}},{key:"_onSourceEnded",value:function(){N.v(this.TAG,"MediaSource onSourceEnded")}},{key:"_onSourceClose",value:function(){N.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&this.e!=null&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))}},{key:"_hasPendingSegments",value:function(){var W=this._pendingSegments;return W.video.length>0||W.audio.length>0}},{key:"_hasPendingRemoveRanges",value:function(){var W=this._pendingRemoveRanges;return W.video.length>0||W.audio.length>0}},{key:"_onSourceBufferUpdateEnd",value:function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(et.UPDATE_END)}},{key:"_onSourceBufferError",value:function(W){N.e(this.TAG,"SourceBuffer Error: ".concat(W))}}]),fe}(),He=st,pe={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},Re={NETWORK_EXCEPTION:a.EXCEPTION,NETWORK_STATUS_CODE_INVALID:a.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:a.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:a.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:Je.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:Je.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:Je.CODEC_UNSUPPORTED},lt=function(){function fe(se,W){if(Object(Q.a)(this,fe),this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new I.a,this._config=Ae(),typeof W=="object"&&Object.assign(this._config,W),se.type.toLowerCase()!=="flv")throw new o("FlvPlayer requires an flv MediaDataSource input!");se.isLive===!0&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=se,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var $=w.chrome&&(w.version.major<50||w.version.major===50&&w.version.build<2661);this._alwaysSeekKeyframe=!!($||w.msedge||w.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return Object(z.a)(fe,[{key:"destroy",value:function(){this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(W,$){var Z=this;W===Ue.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(function(){Z._emitter.emit(Ue.MEDIA_INFO,Z.mediaInfo)}):W===Ue.STATISTICS_INFO&&(this._statisticsInfo!=null&&Promise.resolve().then(function(){Z._emitter.emit(Ue.STATISTICS_INFO,Z.statisticsInfo)})),this._emitter.addListener(W,$)}},{key:"off",value:function(W,$){this._emitter.removeListener(W,$)}},{key:"attachMediaElement",value:function(W){var $=this;if(this._mediaElement=W,W.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),W.addEventListener("seeking",this.e.onvSeeking),W.addEventListener("canplay",this.e.onvCanPlay),W.addEventListener("stalled",this.e.onvStalled),W.addEventListener("progress",this.e.onvProgress),this._msectl=new He(this._config),this._msectl.on(et.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(et.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(et.SOURCE_OPEN,function(){$._mseSourceOpened=!0,$._hasPendingLoad&&($._hasPendingLoad=!1,$.load())}),this._msectl.on(et.ERROR,function(Z){$._emitter.emit(Ue.ERROR,pe.MEDIA_ERROR,Re.MEDIA_MSE_ERROR,Z)}),this._msectl.attachMediaElement(W),this._pendingSeekTime!=null)try{W.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(Z){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)}},{key:"load",value:function(){var W=this;if(!this._mediaElement)throw new u("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new u("FlvPlayer.load() has been called, please call unload() first!");if(this._hasPendingLoad)return;if(this._config.deferLoadAfterSourceOpen&&this._mseSourceOpened===!1){this._hasPendingLoad=!0;return}this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new Ut(this._mediaDataSource,this._config),this._transmuxer.on(me.INIT_SEGMENT,function($,Z){W._msectl.appendInitSegment(Z)}),this._transmuxer.on(me.MEDIA_SEGMENT,function($,Z){if(W._msectl.appendMediaSegment(Z),W._config.lazyLoad&&!W._config.isLive){var ne=W._mediaElement.currentTime;Z.info.endDts>=(ne+W._config.lazyLoadMaxDuration)*1e3&&(W._progressChecker==null&&(N.v(W.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),W._suspendTransmuxer()))}}),this._transmuxer.on(me.LOADING_COMPLETE,function(){W._msectl.endOfStream(),W._emitter.emit(Ue.LOADING_COMPLETE)}),this._transmuxer.on(me.RECOVERED_EARLY_EOF,function(){W._emitter.emit(Ue.RECOVERED_EARLY_EOF)}),this._transmuxer.on(me.IO_ERROR,function($,Z){W._emitter.emit(Ue.ERROR,pe.NETWORK_ERROR,$,Z)}),this._transmuxer.on(me.DEMUX_ERROR,function($,Z){W._emitter.emit(Ue.ERROR,pe.MEDIA_ERROR,$,{code:-1,msg:Z})}),this._transmuxer.on(me.MEDIA_INFO,function($){W._mediaInfo=$,W._emitter.emit(Ue.MEDIA_INFO,Object.assign({},$))}),this._transmuxer.on(me.METADATA_ARRIVED,function($){W._emitter.emit(Ue.METADATA_ARRIVED,$)}),this._transmuxer.on(me.SCRIPTDATA_ARRIVED,function($){W._emitter.emit(Ue.SCRIPTDATA_ARRIVED,$)}),this._transmuxer.on(me.STATISTICS_INFO,function($){W._statisticsInfo=W._fillStatisticsInfo($),W._emitter.emit(Ue.STATISTICS_INFO,Object.assign({},W._statisticsInfo))}),this._transmuxer.on(me.RECOMMEND_SEEKPOINT,function($){W._mediaElement&&!W._config.accurateSeek&&(W._requestSetTime=!0,W._mediaElement.currentTime=$/1e3)}),this._transmuxer.open()}},{key:"unload",value:function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(W){this._mediaElement.volume=W}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(W){this._mediaElement.muted=W}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(W){this._mediaElement?this._internalSeek(W):this._pendingSeekTime=W}},{key:"mediaInfo",get:function(){return Object.assign({},this._mediaInfo)}},{key:"statisticsInfo",get:function(){return this._statisticsInfo==null&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)}},{key:"_fillStatisticsInfo",value:function(W){if(W.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return W;var $=!0,Z=0,ne=0;if(this._mediaElement.getVideoPlaybackQuality){var he=this._mediaElement.getVideoPlaybackQuality();Z=he.totalVideoFrames,ne=he.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(Z=this._mediaElement.webkitDecodedFrameCount,ne=this._mediaElement.webkitDroppedFrameCount):$=!1;return $&&(W.decodedFrames=Z,W.droppedFrames=ne),W}},{key:"_onmseUpdateEnd",value:function(){if(!this._config.lazyLoad||this._config.isLive)return;for(var W=this._mediaElement.buffered,$=this._mediaElement.currentTime,Z=0,ne=0,he=0;he<W.length;he++){var Pe=W.start(he),ze=W.end(he);if(Pe<=$&&$<ze){Z=Pe,ne=ze;break}}ne>=$+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(N.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},{key:"_onmseBufferFull",value:function(){N.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._progressChecker==null&&this._suspendTransmuxer()}},{key:"_suspendTransmuxer",value:function(){this._transmuxer&&(this._transmuxer.pause(),this._progressChecker==null&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}},{key:"_checkProgressAndResume",value:function(){for(var W=this._mediaElement.currentTime,$=this._mediaElement.buffered,Z=!1,ne=0;ne<$.length;ne++){var he=$.start(ne),Pe=$.end(ne);if(W>=he&&W<Pe){W>=Pe-this._config.lazyLoadRecoverDuration&&(Z=!0);break}}Z&&(window.clearInterval(this._progressChecker),this._progressChecker=null,Z&&(N.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}},{key:"_isTimepointBuffered",value:function(W){for(var $=this._mediaElement.buffered,Z=0;Z<$.length;Z++){var ne=$.start(Z),he=$.end(Z);if(W>=ne&&W<he)return!0}return!1}},{key:"_internalSeek",value:function(W){var $=this._isTimepointBuffered(W),Z=!1,ne=0;if(W<1&&this._mediaElement.buffered.length>0){var he=this._mediaElement.buffered.start(0);(he<1&&W<he||w.safari)&&(Z=!0,ne=w.safari?.1:he)}if(Z)this._requestSetTime=!0,this._mediaElement.currentTime=ne;else if($){if(!this._alwaysSeekKeyframe)this._requestSetTime=!0,this._mediaElement.currentTime=W;else{var Pe=this._msectl.getNearestKeyframe(Math.floor(W*1e3));this._requestSetTime=!0,Pe!=null?this._mediaElement.currentTime=Pe.dts/1e3:this._mediaElement.currentTime=W}this._progressChecker!=null&&this._checkProgressAndResume()}else this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(W),this._transmuxer.seek(Math.floor(W*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=W)}},{key:"_checkAndApplyUnbufferedSeekpoint",value:function(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){var W=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(W)||(this._progressChecker!=null&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(W),this._transmuxer.seek(Math.floor(W*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=W))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},{key:"_checkAndResumeStuckPlayback",value:function(W){var $=this._mediaElement;if(W||!this._receivedCanPlay||$.readyState<2){var Z=$.buffered;Z.length>0&&$.currentTime<Z.start(0)&&(N.w(this.TAG,"Playback seems stuck at ".concat($.currentTime,", seek to ").concat(Z.start(0))),this._requestSetTime=!0,this._mediaElement.currentTime=Z.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)}},{key:"_onvLoadedMetadata",value:function(W){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)}},{key:"_onvSeeking",value:function(W){var $=this._mediaElement.currentTime,Z=this._mediaElement.buffered;if(this._requestSetTime){this._requestSetTime=!1;return}if($<1&&Z.length>0){var ne=Z.start(0);if(ne<1&&$<ne||w.safari){this._requestSetTime=!0,this._mediaElement.currentTime=w.safari?.1:ne;return}}if(this._isTimepointBuffered($)){if(this._alwaysSeekKeyframe){var he=this._msectl.getNearestKeyframe(Math.floor($*1e3));he!=null&&(this._requestSetTime=!0,this._mediaElement.currentTime=he.dts/1e3)}this._progressChecker!=null&&this._checkProgressAndResume();return}this._seekpointRecord={seekPoint:$,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},{key:"_onvCanPlay",value:function(W){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)}},{key:"_onvStalled",value:function(W){this._checkAndResumeStuckPlayback(!0)}},{key:"_onvProgress",value:function(W){this._checkAndResumeStuckPlayback()}}]),fe}(),Ye=lt,Pt=function(){function fe(se,W){if(Object(Q.a)(this,fe),this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new I.a,this._config=Ae(),typeof W=="object"&&Object.assign(this._config,W),se.type.toLowerCase()==="flv")throw new o("NativePlayer does't support flv MediaDataSource input!");if(se.hasOwnProperty("segments"))throw new o("NativePlayer(".concat(se.type,") doesn't support multipart playback!"));this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=se,this._mediaElement=null}return Object(z.a)(fe,[{key:"destroy",value:function(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(W,$){var Z=this;W===Ue.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){Z._emitter.emit(Ue.MEDIA_INFO,Z.mediaInfo)}):W===Ue.STATISTICS_INFO&&(this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){Z._emitter.emit(Ue.STATISTICS_INFO,Z.statisticsInfo)})),this._emitter.addListener(W,$)}},{key:"off",value:function(W,$){this._emitter.removeListener(W,$)}},{key:"attachMediaElement",value:function(W){if(this._mediaElement=W,W.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{W.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch($){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"load",value:function(){if(!this._mediaElement)throw new u("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)}},{key:"unload",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(W){this._mediaElement.volume=W}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(W){this._mediaElement.muted=W}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(W){this._mediaElement?this._mediaElement.currentTime=W:this._pendingSeekTime=W}},{key:"mediaInfo",get:function(){var W=this._mediaElement instanceof HTMLAudioElement?"audio/":"video/",$={mimeType:W+this._mediaDataSource.type};return this._mediaElement&&($.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&($.width=this._mediaElement.videoWidth,$.height=this._mediaElement.videoHeight)),$}},{key:"statisticsInfo",get:function(){var W={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return W;var $=!0,Z=0,ne=0;if(this._mediaElement.getVideoPlaybackQuality){var he=this._mediaElement.getVideoPlaybackQuality();Z=he.totalVideoFrames,ne=he.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(Z=this._mediaElement.webkitDecodedFrameCount,ne=this._mediaElement.webkitDroppedFrameCount):$=!1;return $&&(W.decodedFrames=Z,W.droppedFrames=ne),W}},{key:"_onvLoadedMetadata",value:function(W){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(Ue.MEDIA_INFO,this.mediaInfo)}},{key:"_reportStatisticsInfo",value:function(){this._emitter.emit(Ue.STATISTICS_INFO,this.statisticsInfo)}}]),fe}(),Nt=Pt;X.install();function Ke(fe,se){var W=fe;if(W==null||typeof W!="object")throw new o("MediaDataSource must be an javascript object!");if(!W.hasOwnProperty("type"))throw new o("MediaDataSource must has type field to indicate video file type!");switch(W.type){case"flv":return new Ye(W,se);default:return new Nt(W,se)}}function gt(){return Ce.supportMSEH264Playback()}function bt(){return Ce.getFeatureList()}var Tt={};Tt.createPlayer=Ke,Tt.isSupported=gt,Tt.getFeatureList=bt,Tt.BaseLoader=i,Tt.LoaderStatus=r,Tt.LoaderErrors=a,Tt.Events=Ue,Tt.ErrorTypes=pe,Tt.ErrorDetails=Re,Tt.FlvPlayer=Ye,Tt.NativePlayer=Nt,Tt.LoggingControl=be,Object.defineProperty(Tt,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var Wt=le.a=Tt},GgEA:function(Be,le,D){},Gytx:function(Be,le){Be.exports=function(Q,z,M,X){var F=M?M.call(X,Q,z):void 0;if(F!==void 0)return!!F;if(Q===z)return!0;if(typeof Q!="object"||!Q||typeof z!="object"||!z)return!1;var I=Object.keys(Q),H=Object.keys(z);if(I.length!==H.length)return!1;for(var N=Object.prototype.hasOwnProperty.bind(z),n=0;n<I.length;n++){var P=I[n];if(!N(P))return!1;var p=Q[P],m=z[P];if(F=M?M.call(X,p,m,P):void 0,F===!1||F===void 0&&p!==m)return!1}return!0}},HmJG:function(Be,le,D){},Hw79:function(Be,le,D){Be.exports={pagination:"pagination___2VQzP",info:"info___1saw2"}},I8Z2:function(Be,le,D){"use strict";D.d(le,"a",function(){return X}),D.d(le,"b",function(){return d}),D.d(le,"c",function(){return o});var Q=D("q1tI"),z=function(){var h=function(r,a){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var S in s)s.hasOwnProperty(S)&&(i[S]=s[S])},h(r,a)};return function(r,a){h(r,a);function i(){this.constructor=r}r.prototype=a===null?Object.create(a):(i.prototype=a.prototype,new i)}}(),M=Q.createContext(null),X=function(h){z(r,h);function r(){return h!==null&&h.apply(this,arguments)||this}return r.prototype.render=function(){return Q.createElement(M.Provider,{value:this.props.store},this.props.children)},r}(Q.Component),F=D("Gytx"),I=D.n(F),H=D("2mql"),N=D.n(H),n=function(){var h=function(r,a){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var S in s)s.hasOwnProperty(S)&&(i[S]=s[S])},h(r,a)};return function(r,a){h(r,a);function i(){this.constructor=r}r.prototype=a===null?Object.create(a):(i.prototype=a.prototype,new i)}}(),P=function(){return P=Object.assign||function(h){for(var r,a=1,i=arguments.length;a<i;a++){r=arguments[a];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(h[s]=r[s])}return h},P.apply(this,arguments)};function p(h){return h.displayName||h.name||"Component"}var m=function(){return{}};function d(h,r){r===void 0&&(r={});var a=!!h,i=h||m;return function(S){var x=function(A){n(w,A);function w(v,b){var g=A.call(this,v,b)||this;return g.unsubscribe=null,g.handleChange=function(){if(!g.unsubscribe)return;var f=i(g.store.getState(),g.props);g.setState({subscribed:f})},g.store=g.context,g.state={subscribed:i(g.store.getState(),v),store:g.store,props:v},g}return w.getDerivedStateFromProps=function(v,b){return h&&h.length===2&&v!==b.props?{subscribed:i(b.store.getState(),v),props:v}:{props:v}},w.prototype.componentDidMount=function(){this.trySubscribe()},w.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},w.prototype.shouldComponentUpdate=function(v,b){return!I()(this.props,v)||!I()(this.state.subscribed,b.subscribed)},w.prototype.trySubscribe=function(){a&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},w.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},w.prototype.render=function(){var v=P(P(P({},this.props),this.state.subscribed),{store:this.store});return Q.createElement(S,P({},v,{ref:this.props.miniStoreForwardedRef}))},w.displayName="Connect("+p(S)+")",w.contextType=M,w}(Q.Component);if(r.forwardRef){var T=Q.forwardRef(function(A,w){return Q.createElement(x,P({},A,{miniStoreForwardedRef:w}))});return N()(T,S)}return N()(x,S)}}var u=function(){return u=Object.assign||function(h){for(var r,a=1,i=arguments.length;a<i;a++){r=arguments[a];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(h[s]=r[s])}return h},u.apply(this,arguments)};function o(h){var r=h,a=[];function i(x){r=u(u({},r),x);for(var T=0;T<a.length;T++)a[T]()}function s(){return r}function S(x){return a.push(x),function(){var A=a.indexOf(x);a.splice(A,1)}}return{setState:i,getState:s,subscribe:S}}},IBYe:function(Be,le,D){"use strict";function Q(z){return null}le.a=Q},IxHN:function(Be,le,D){"use strict";var Q=D("q1tI"),z=D.n(Q),M=D("07cG"),X=D.n(M);le.a=function(F){var I=F.message,H=F.className,N=F.children,n=F.style,P=n===void 0?{}:n;return z.a.createElement("div",{className:"".concat(X.a.idsRingWrapper," ").concat(H)},z.a.createElement("div",{className:X.a.ldsRing},z.a.createElement("div",null),z.a.createElement("div",null),z.a.createElement("div",null),z.a.createElement("div",null)),I?z.a.createElement("p",{style:P},I):null,N)}},J66h:function(Be,le,D){(function(Q){var z,M;(function(X,F){Be.exports=F(X)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof Q!="undefined"?Q:this,function(X){"use strict";X=X||{};var F=X.Base64,I="2.6.4",H="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N=function(_){for(var U={},j=0,L=_.length;j<L;j++)U[_.charAt(j)]=j;return U}(H),n=String.fromCharCode,P=function(_){if(_.length<2){var U=_.charCodeAt(0);return U<128?_:U<2048?n(192|U>>>6)+n(128|U&63):n(224|U>>>12&15)+n(128|U>>>6&63)+n(128|U&63)}else{var U=65536+(_.charCodeAt(0)-55296)*1024+(_.charCodeAt(1)-56320);return n(240|U>>>18&7)+n(128|U>>>12&63)+n(128|U>>>6&63)+n(128|U&63)}},p=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,m=function(_){return _.replace(p,P)},d=function(_){var U=[0,2,1][_.length%3],j=_.charCodeAt(0)<<16|(_.length>1?_.charCodeAt(1):0)<<8|(_.length>2?_.charCodeAt(2):0),L=[H.charAt(j>>>18),H.charAt(j>>>12&63),U>=2?"=":H.charAt(j>>>6&63),U>=1?"=":H.charAt(j&63)];return L.join("")},u=X.btoa&&typeof X.btoa=="function"?function(_){return X.btoa(_)}:function(_){if(_.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return _.replace(/[\s\S]{1,3}/g,d)},o=function(_){return u(m(String(_)))},h=function(_){return _.replace(/[+\/]/g,function(U){return U=="+"?"-":"_"}).replace(/=/g,"")},r=function(_,U){return U?h(o(_)):o(_)},a=function(_){return r(_,!0)},i;X.Uint8Array&&(i=function(_,U){for(var j="",L=0,G=_.length;L<G;L+=3){var B=_[L],O=_[L+1],V=_[L+2],te=B<<16|O<<8|V;j+=H.charAt(te>>>18)+H.charAt(te>>>12&63)+(typeof O!="undefined"?H.charAt(te>>>6&63):"=")+(typeof V!="undefined"?H.charAt(te&63):"=")}return U?h(j):j});var s=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,S=function(_){switch(_.length){case 4:var U=(7&_.charCodeAt(0))<<18|(63&_.charCodeAt(1))<<12|(63&_.charCodeAt(2))<<6|63&_.charCodeAt(3),j=U-65536;return n((j>>>10)+55296)+n((j&1023)+56320);case 3:return n((15&_.charCodeAt(0))<<12|(63&_.charCodeAt(1))<<6|63&_.charCodeAt(2));default:return n((31&_.charCodeAt(0))<<6|63&_.charCodeAt(1))}},x=function(_){return _.replace(s,S)},T=function(_){var U=_.length,j=U%4,L=(U>0?N[_.charAt(0)]<<18:0)|(U>1?N[_.charAt(1)]<<12:0)|(U>2?N[_.charAt(2)]<<6:0)|(U>3?N[_.charAt(3)]:0),G=[n(L>>>16),n(L>>>8&255),n(L&255)];return G.length-=[0,0,2,1][j],G.join("")},A=X.atob&&typeof X.atob=="function"?function(_){return X.atob(_)}:function(_){return _.replace(/\S{1,4}/g,T)},w=function(_){return A(String(_).replace(/[^A-Za-z0-9\+\/]/g,""))},v=function(_){return x(A(_))},b=function(_){return String(_).replace(/[-_]/g,function(U){return U=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},g=function(_){return v(b(_))},f;X.Uint8Array&&(f=function(_){return Uint8Array.from(w(b(_)),function(U){return U.charCodeAt(0)})});var C=function(){var _=X.Base64;return X.Base64=F,_};if(X.Base64={VERSION:I,atob:w,btoa:u,fromBase64:g,toBase64:r,utob:m,encode:r,encodeURI:a,btou:x,decode:g,noConflict:C,fromUint8Array:i,toUint8Array:f},typeof Object.defineProperty=="function"){var E=function(_){return{value:_,enumerable:!1,writable:!0,configurable:!0}};X.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",E(function(){return g(this)})),Object.defineProperty(String.prototype,"toBase64",E(function(_){return r(this,_)})),Object.defineProperty(String.prototype,"toBase64URI",E(function(){return r(this,!0)}))}}return X.Meteor&&(Base64=X.Base64),Be.exports?Be.exports.Base64=X.Base64:!(z=[],M=function(){return X.Base64}.apply(le,z),M!==void 0&&(Be.exports=M)),{Base64:X.Base64}})}).call(this,D("IyRk"))},JOrW:function(Be,le,D){Be.exports=D.p+"static/gf.a4054c89.svg"},JYp7:function(Be,le,D){"use strict";D.d(le,"a",function(){return Q});var Q;(function(z){function M(s){return s&&typeof s=="object"&&typeof s[Symbol.iterator]=="function"}z.is=M;const X=Object.freeze([]);function F(){return X}z.empty=F;function*I(s){yield s}z.single=I;function H(s){return s||X}z.from=H;function N(s){return!s||s[Symbol.iterator]().next().done===!0}z.isEmpty=N;function n(s){return s[Symbol.iterator]().next().value}z.first=n;function P(s,S){for(const x of s)if(S(x))return!0;return!1}z.some=P;function p(s,S){for(const x of s)if(S(x))return x;return}z.find=p;function*m(s,S){for(const x of s)S(x)&&(yield x)}z.filter=m;function*d(s,S){let x=0;for(const T of s)yield S(T,x++)}z.map=d;function*u(...s){for(const S of s)for(const x of S)yield x}z.concat=u;function*o(s){for(const S of s)for(const x of S)yield x}z.concatNested=o;function h(s,S,x){let T=x;for(const A of s)T=S(T,A);return T}z.reduce=h;function*r(s,S,x=s.length){for(S<0&&(S+=s.length),x<0?x+=s.length:x>s.length&&(x=s.length);S<x;S++)yield s[S]}z.slice=r;function a(s,S=Number.POSITIVE_INFINITY){const x=[];if(S===0)return[x,s];const T=s[Symbol.iterator]();for(let A=0;A<S;A++){const w=T.next();if(w.done)return[x,z.empty()];x.push(w.value)}return[x,{[Symbol.iterator](){return T}}]}z.consume=a;function i(s,S,x=(T,A)=>T===A){const T=s[Symbol.iterator](),A=S[Symbol.iterator]();for(;;){const w=T.next(),v=A.next();if(w.done!==v.done)return!1;if(w.done)return!0;if(!x(w.value,v.value))return!1}}z.equals=i})(Q||(Q={}))},LdHM:function(Be,le,D){"use strict";D.d(le,"b",function(){return s}),D.d(le,"a",function(){return x});var Q=D("1OyB"),z=D("vuIU"),M=D("Ji7U"),X=D("LK+K"),F=D("q1tI"),I=D("rePB"),H=D("Ff2n"),N=D("ODXe"),n=D("4IlW"),P=D("bX4T"),p=D("YrtM"),m=D("TSYQ"),d=D.n(m),u=D("+nKL"),o=D("8OUc"),h=function(V,te){var re=V.prefixCls,ge=V.id,Ae=V.flattenOptions,Oe=V.childrenAsData,Ce=V.values,je=V.searchValue,Ue=V.multiple,xe=V.defaultActiveFirstOption,be=V.height,Ve=V.itemHeight,mt=V.notFoundContent,yt=V.open,_t=V.menuItemSelectedIcon,xt=V.virtual,nt=V.onSelect,ct=V.onToggleOpen,wt=V.onActiveValue,_e=V.onScroll,Me=V.onMouseEnter,ve="".concat(re,"-item"),Te=Object(p.a)(function(){return Ae},[yt,Ae],function($e,we){return we[0]&&$e[1]!==we[1]}),We=F.useRef(null),Je=function(we){we.preventDefault()},at=function(we){We.current&&We.current.scrollTo({index:we})},dt=function(we){for(var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ee=Te.length,ue=0;ue<Ee;ue+=1){var de=(we+ue*Se+Ee)%Ee,ye=Te[de],me=ye.group,Le=ye.data;if(!me&&!Le.disabled)return de}return-1},Lt=F.useState(function(){return dt(0)}),It=Object(N.a)(Lt,2),Ne=It[0],ke=It[1],it=function(we){ke(we);var Se=Te[we];if(!Se){wt(null,-1);return}wt(Se.data.value,we)};F.useEffect(function(){it(xe!==!1?dt(0):-1)},[Te.length,je]),F.useEffect(function(){var $e=setTimeout(function(){if(!Ue&&yt&&Ce.size===1){var we=Array.from(Ce)[0],Se=Te.findIndex(function(Ee){var ue=Ee.data;return ue.value===we});it(Se),at(Se)}});return function(){return clearTimeout($e)}},[yt]);var ot=function(we){we!==void 0&&nt(we,{selected:!Ce.has(we)}),Ue||ct(!1)};if(F.useImperativeHandle(te,function(){return{onKeyDown:function(we){var Se=we.which;switch(Se){case n.a.UP:case n.a.DOWN:{var Ee=0;if(Se===n.a.UP?Ee=-1:Se===n.a.DOWN&&(Ee=1),Ee!==0){var ue=dt(Ne+Ee,Ee);at(ue),it(ue)}break}case n.a.ENTER:{var de=Te[Ne];de&&!de.data.disabled?ot(de.data.value):ot(void 0),yt&&we.preventDefault();break}case n.a.ESC:ct(!1)}},onKeyUp:function(){},scrollTo:function(we){at(we)}}}),Te.length===0)return F.createElement("div",{role:"listbox",id:"".concat(ge,"_list"),className:"".concat(ve,"-empty"),onMouseDown:Je},mt);function Ge($e){var we=Te[$e];if(!we)return null;var Se=we.data||{},Ee=Se.value,ue=Se.label,de=Se.children,ye=Object(P.a)(Se,!0),me=Oe?de:ue;return we?F.createElement("div",Object.assign({"aria-label":typeof me=="string"?me:null},ye,{key:$e,role:"option",id:"".concat(ge,"_list_").concat($e),"aria-selected":Ce.has(Ee)}),Ee):null}return F.createElement(F.Fragment,null,F.createElement("div",{role:"listbox",id:"".concat(ge,"_list"),style:{height:0,width:0,overflow:"hidden"}},Ge(Ne-1),Ge(Ne),Ge(Ne+1)),F.createElement(u.a,{itemKey:"key",ref:We,data:Te,height:be,itemHeight:Ve,fullHeight:!1,onMouseDown:Je,onScroll:_e,virtual:xt,onMouseEnter:Me},function($e,we){var Se,Ee=$e.group,ue=$e.groupOption,de=$e.data,ye=de.label,me=de.key;if(Ee)return F.createElement("div",{className:d()(ve,"".concat(ve,"-group"))},ye!==void 0?ye:me);var Le=de.disabled,Xe=de.value,ut=de.title,Dt=de.children,jt=de.style,Ut=de.className,Ct=Object(H.a)(de,["disabled","value","title","children","style","className"]),et=Ce.has(Xe),st="".concat(ve,"-option"),He=d()(ve,st,Ut,(Se={},Object(I.a)(Se,"".concat(st,"-grouped"),ue),Object(I.a)(Se,"".concat(st,"-active"),Ne===we&&!Le),Object(I.a)(Se,"".concat(st,"-disabled"),Le),Object(I.a)(Se,"".concat(st,"-selected"),et),Se)),pe=Oe?Dt:ye,Re=!_t||typeof _t=="function"||et;return F.createElement("div",Object.assign({},Ct,{"aria-selected":et,className:He,title:ut,onMouseMove:function(){if(Ne===we||Le)return;it(we)},onClick:function(){Le||ot(Xe)},style:jt}),F.createElement("div",{className:"".concat(st,"-content")},pe||Xe),F.isValidElement(_t)||et,Re&&F.createElement(o.a,{className:"".concat(ve,"-option-state"),customizeIcon:_t,customizeIconProps:{isSelected:et}},et?"\u2713":null))}))},r=F.forwardRef(h);r.displayName="OptionList";var a=r,i=function(){return null};i.isSelectOption=!0;var s=i,S=function(){return null};S.isSelectOptGroup=!0;var x=S,T=D("VTBJ"),A=D("Zm9Q");function w(O){var V=O.key,te=O.props,re=te.children,ge=te.value,Ae=Object(H.a)(te,["children","value"]);return Object(T.a)({key:V,value:ge!==void 0?ge:V,children:re},Ae)}function v(O){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(A.a)(O).map(function(te,re){if(!F.isValidElement(te)||!te.type)return null;var ge=te.type.isSelectOptGroup,Ae=te.key,Oe=te.props,Ce=Oe.children,je=Object(H.a)(Oe,["children"]);return V||!ge?w(te):Object(T.a)(Object(T.a)({key:"__RC_SELECT_GRP__".concat(Ae===null?re:Ae,"__"),label:Ae},je),{},{options:v(Ce)})}).filter(function(te){return te})}var b=D("2Qr1"),g=D("qNPg"),f=D("U8pU"),C=D("Kwbf"),E=D("WKfj");function _(O){var V=O.mode,te=O.options,re=O.children,ge=O.backfill,Ae=O.allowClear,Oe=O.placeholder,Ce=O.getInputElement,je=O.showSearch,Ue=O.onSearch,xe=O.defaultOpen,be=O.autoFocus,Ve=O.labelInValue,mt=O.value,yt=O.inputValue,_t=O.optionLabelProp,xt=V==="multiple"||V==="tags",nt=je!==void 0?je:xt||V==="combobox",ct=te||v(re);if(Object(C.a)(V!=="tags"||ct.every(function(ve){return!ve.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),V==="tags"||V==="combobox"){var wt=ct.some(function(ve){return ve.options?ve.options.some(function(Te){return typeof("value"in Te?Te.value:Te.key)=="number"}):typeof("value"in ve?ve.value:ve.key)=="number"});Object(C.a)(!wt,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(C.a)(V!=="combobox"||!_t,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(C.a)(V==="combobox"||!ge,"`backfill` only works with `combobox` mode."),Object(C.a)(V==="combobox"||!Ce,"`getInputElement` only work with `combobox` mode."),Object(C.b)(V!=="combobox"||!Ce||!Ae||!Oe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ue&&!nt&&V!=="combobox"&&V!=="tags"&&Object(C.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(C.b)(!xe||be,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),mt!=null){var _e=Object(E.d)(mt);Object(C.a)(!Ve||_e.every(function(ve){return Object(f.a)(ve)==="object"&&("key"in ve||"value"in ve)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(C.a)(!xt||Array.isArray(mt),"`value` should be array when `mode` is `multiple` or `tags`")}if(re){var Me=null;Object(A.a)(re).some(function(ve){if(!F.isValidElement(ve)||!ve.type)return!1;var Te=ve.type;if(Te.isSelectOption)return!1;if(Te.isSelectOptGroup){var We=Object(A.a)(ve.props.children).every(function(Je){return!F.isValidElement(Je)||!ve.type||Je.type.isSelectOption?!0:(Me=Je.type,!1)});return!We}return Me=Te,!0}),Me&&Object(C.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Me.displayName||Me.name||Me,"`.")),Object(C.a)(yt===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var U=_,j=Object(g.a)({prefixCls:"rc-select",components:{optionList:a},convertChildrenToData:v,flattenOptions:b.d,getLabeledValue:b.e,filterOptions:b.b,isValueDisabled:b.g,findValueOption:b.c,warningProps:U,fillOptionsWithMissingValue:b.a}),L=function(O){Object(M.a)(te,O);var V=Object(X.a)(te);function te(){var re;return Object(Q.a)(this,te),re=V.apply(this,arguments),re.selectRef=F.createRef(),re.focus=function(){re.selectRef.current.focus()},re.blur=function(){re.selectRef.current.blur()},re}return Object(z.a)(te,[{key:"render",value:function(){return F.createElement(j,Object.assign({ref:this.selectRef},this.props))}}]),te}(F.Component);L.Option=s,L.OptGroup=x;var G=L,B=le.c=G},M8RZ:function(Be,le,D){"use strict";D.d(le,"a",function(){return n});var Q=D("fWQN"),z=D("mtLc"),M=D("yKVA"),X=D("879j"),F=D("q1tI"),I=D.n(F),H=D("i8i4"),N=D.n(H),n=function(P){Object(M.a)(m,P);var p=Object(X.a)(m);function m(d){var u;Object(Q.a)(this,m),u=p.call(this,d);var o=window.document;return u.node=o.createElement("div"),o.body.appendChild(u.node),u}return Object(z.a)(m,[{key:"render",value:function(){var u=this.props.children;return Object(H.createPortal)(u,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),m}(I.a.Component)},MFOe:function(Be,le,D){(function(Q){var z=I(),M=H(),X=N(),F=typeof window!="undefined"?window:Q;Be.exports={assign:z,create:M,trim:X,bind:n,slice:P,each:p,map:m,pluck:d,isList:u,isFunction:o,isObject:h,Global:F};function I(){return Object.assign?Object.assign:function(a,i,s,S){for(var x=1;x<arguments.length;x++)p(Object(arguments[x]),function(T,A){a[A]=T});return a}}function H(){if(Object.create)return function(i,s,S,x){var T=P(arguments,1);return z.apply(this,[Object.create(i)].concat(T))};{function r(){}return function(i,s,S,x){var T=P(arguments,1);return r.prototype=i,z.apply(this,[new r].concat(T))}}}function N(){return String.prototype.trim?function(a){return String.prototype.trim.call(a)}:function(a){return a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function n(r,a){return function(){return a.apply(r,Array.prototype.slice.call(arguments,0))}}function P(r,a){return Array.prototype.slice.call(r,a||0)}function p(r,a){d(r,function(i,s){return a(i,s),!1})}function m(r,a){var i=u(r)?[]:{};return d(r,function(s,S){return i[S]=a(s,S),!1}),i}function d(r,a){if(u(r)){for(var i=0;i<r.length;i++)if(a(r[i],i))return r[i]}else for(var s in r)if(r.hasOwnProperty(s)&&a(r[s],s))return r[s]}function u(r){return r!=null&&typeof r!="function"&&typeof r.length=="number"}function o(r){return r&&{}.toString.call(r)==="[object Function]"}function h(r){return r&&{}.toString.call(r)==="[object Object]"}}).call(this,D("IyRk"))},MI8n:function(Be,le,D){"use strict";D.d(le,"c",function(){return F}),D.d(le,"b",function(){return n}),D.d(le,"e",function(){return P}),D.d(le,"a",function(){return p}),D.d(le,"d",function(){return m}),D.d(le,"f",function(){return d});var Q=D("/cxE"),z=D("pmY6"),M=D("24hK"),X=D("5Y4S"),F;(function(u){u.None=()=>z.a.None;function o(_){return(U,j=null,L)=>{let G=!1,B;return B=_(O=>G?void 0:(B?B.dispose():G=!0,U.call(j,O)),null,L),G&&B.dispose(),B}}u.once=o;function h(_,U){return x((j,L=null,G)=>_(B=>j.call(L,U(B)),null,G))}u.map=h;function r(_,U){return x((j,L=null,G)=>_(B=>{U(B),j.call(L,B)},null,G))}u.forEach=r;function a(_,U){return x((j,L=null,G)=>_(B=>U(B)&&j.call(L,B),null,G))}u.filter=a;function i(_){return _}u.signal=i;function s(..._){return(U,j=null,L)=>Object(z.e)(..._.map(G=>G(B=>U.call(j,B),null,L)))}u.any=s;function S(_,U,j){let L=j;return h(_,G=>(L=U(L,G),L))}u.reduce=S;function x(_){let U;const j=new n({onFirstListenerAdd(){U=_(j.fire,j)},onLastListenerRemove(){U.dispose()}});return j.event}function T(_,U,j=100,L=!1,G){let B,O,V,te=0;const re=new n({leakWarningThreshold:G,onFirstListenerAdd(){B=_(ge=>{te++,O=U(O,ge),L&&!V&&(re.fire(O),O=void 0),clearTimeout(V),V=setTimeout(()=>{const Ae=O;O=void 0,V=void 0,(!L||te>1)&&re.fire(Ae),te=0},j)})},onLastListenerRemove(){B.dispose()}});return re.event}u.debounce=T;function A(_,U=(j,L)=>j===L){let j=!0,L;return a(_,G=>{const B=j||!U(G,L);return j=!1,L=G,B})}u.latch=A;function w(_,U){return[u.filter(_,U),u.filter(_,j=>!U(j))]}u.split=w;function v(_,U=!1,j=[]){let L=j.slice(),G=_(V=>{L?L.push(V):O.fire(V)});const B=()=>{L&&L.forEach(V=>O.fire(V)),L=null},O=new n({onFirstListenerAdd(){G||(G=_(V=>O.fire(V)))},onFirstListenerDidAdd(){L&&(U?setTimeout(B):B())},onLastListenerRemove(){G&&G.dispose(),G=null}});return O.event}u.buffer=v;class b{constructor(_){this.event=_}map(_){return new b(h(this.event,_))}forEach(_){return new b(r(this.event,_))}filter(_){return new b(a(this.event,_))}reduce(_,U){return new b(S(this.event,_,U))}latch(){return new b(A(this.event))}debounce(_,U=100,j=!1,L){return new b(T(this.event,_,U,j,L))}on(_,U,j){return this.event(_,U,j)}once(_,U,j){return o(this.event)(_,U,j)}}function g(_){return new b(_)}u.chain=g;function f(_,U,j=L=>L){const L=(...V)=>O.fire(j(...V)),G=()=>_.on(U,L),B=()=>_.removeListener(U,L),O=new n({onFirstListenerAdd:G,onLastListenerRemove:B});return O.event}u.fromNodeEventEmitter=f;function C(_,U,j=L=>L){const L=(...V)=>O.fire(j(...V)),G=()=>_.addEventListener(U,L),B=()=>_.removeEventListener(U,L),O=new n({onFirstListenerAdd:G,onLastListenerRemove:B});return O.event}u.fromDOMEventEmitter=C;function E(_){return new Promise(U=>o(_)(U))}u.toPromise=E})(F||(F={}));class I{constructor(u){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${u}_${I._idPool++}`}start(u){this._stopWatch=new X.a(!0),this._listenerCount=u}stop(){if(this._stopWatch){const u=this._stopWatch.elapsed();this._elapsedOverall+=u,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${u.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}I._idPool=0;let H=-1;class N{constructor(u,o=Math.random().toString(18).slice(2,5)){this.customThreshold=u,this.name=o,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(u){let o=H;if(typeof this.customThreshold=="number"&&(o=this.customThreshold),o<=0||u<o)return;this._stacks||(this._stacks=new Map);const h=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),r=this._stacks.get(h)||0;if(this._stacks.set(h,r+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=o*.5;let a,i=0;for(const[s,S]of this._stacks)(!a||i<S)&&(a=s,i=S);console.warn(`[${this.name}] potential listener LEAK detected, having ${u} listeners already. MOST frequent listener (${i}):`),console.warn(a)}return()=>{const a=this._stacks.get(h)||0;this._stacks.set(h,a-1)}}}class n{constructor(u){var o;this._disposed=!1,this._options=u,this._leakageMon=H>0?new N(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((o=this._options)===null||o===void 0?void 0:o._profName)?new I(this._options._profName):void 0}get event(){return this._event||(this._event=(u,o,h)=>{var r;this._listeners||(this._listeners=new M.a);const a=this._listeners.isEmpty();a&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const i=this._listeners.push(o?[u,o]:u);a&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,u,o);const s=(r=this._leakageMon)===null||r===void 0?void 0:r.check(this._listeners.size),S=Object(z.i)(()=>{if(s&&s(),!this._disposed&&(i(),this._options&&this._options.onLastListenerRemove)){const x=this._listeners&&!this._listeners.isEmpty();x||this._options.onLastListenerRemove(this)}});return h instanceof z.b?h.add(S):Array.isArray(h)&&h.push(S),S}),this._event}fire(u){var o,h;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new M.a);for(let r of this._listeners)this._deliveryQueue.push([r,u]);for((o=this._perfMon)===null||o===void 0||o.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[r,a]=this._deliveryQueue.shift();try{typeof r=="function"?r.call(void 0,a):r[0].call(r[1],a)}catch(i){Object(Q.f)(i)}}(h=this._perfMon)===null||h===void 0||h.stop()}}dispose(){var u,o,h,r,a;this._disposed||(this._disposed=!0,(u=this._listeners)===null||u===void 0||u.clear(),(o=this._deliveryQueue)===null||o===void 0||o.clear(),(r=(h=this._options)===null||h===void 0?void 0:h.onLastListenerRemove)===null||r===void 0||r.call(h),(a=this._leakageMon)===null||a===void 0||a.dispose())}}class P extends n{constructor(u){super(u);this._isPaused=0,this._eventQueue=new M.a,this._mergeFn=u==null?void 0:u.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const u=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(u))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(u){this._listeners&&(this._isPaused!==0?this._eventQueue.push(u):super.fire(u))}}class p extends P{constructor(u){var o;super(u);this._delay=(o=u.delay)!==null&&o!==void 0?o:100}fire(u){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(u)}}class m{constructor(){this.buffers=[]}wrapEvent(u){return(o,h,r)=>u(a=>{const i=this.buffers[this.buffers.length-1];i?i.push(()=>o.call(h,a)):o.call(h,a)},void 0,r)}bufferEvents(u){const o=[];this.buffers.push(o);const h=u();return this.buffers.pop(),o.forEach(r=>r()),h}}class d{constructor(){this.listening=!1,this.inputEvent=F.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(u){this.inputEvent=u,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=u(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(Be,le,D){"use strict";(function(Q,z){D.d(le,"b",function(){return h}),D.d(le,"i",function(){return s}),D.d(le,"f",function(){return S}),D.d(le,"d",function(){return x}),D.d(le,"g",function(){return T}),D.d(le,"h",function(){return A}),D.d(le,"c",function(){return w}),D.d(le,"k",function(){return v}),D.d(le,"j",function(){return b}),D.d(le,"a",function(){return g}),D.d(le,"e",function(){return E});var M;const X="en";let F=!1,I=!1,H=!1,N=!1,n=!1,P=!1,p=!1,m,d=X,u,o;const h=typeof self=="object"?self:typeof Q=="object"?Q:{};let r;typeof h.vscode!="undefined"&&typeof h.vscode.process!="undefined"?r=h.vscode.process:typeof z!="undefined"&&(r=z);const a=typeof((M=r==null?void 0:r.versions)===null||M===void 0?void 0:M.electron)=="string"&&r.type==="renderer";if(typeof navigator=="object"&&!a)o=navigator.userAgent,F=o.indexOf("Windows")>=0,I=o.indexOf("Macintosh")>=0,p=(o.indexOf("Macintosh")>=0||o.indexOf("iPad")>=0||o.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,H=o.indexOf("Linux")>=0,P=!0,m=navigator.language,d=m;else if(typeof r=="object"){F=r.platform==="win32",I=r.platform==="darwin",H=r.platform==="linux",N=H&&!!r.env.SNAP&&!!r.env.SNAP_REVISION,m=X,d=X;const _=r.env.VSCODE_NLS_CONFIG;if(_)try{const U=JSON.parse(_),j=U.availableLanguages["*"];m=U.locale,d=j||X,u=U._translationsConfigFile}catch(U){}n=!0}else console.error("Unable to resolve platform.");let i=0;I?i=1:F?i=3:H&&(i=2);const s=F,S=I,x=H,T=n,A=P,w=p,v=o,b=function(){if(h.setImmediate)return h.setImmediate.bind(h);if(typeof h.postMessage=="function"&&!h.importScripts){let j=[];h.addEventListener("message",G=>{if(G.data&&G.data.vscodeSetImmediateId)for(let B=0,O=j.length;B<O;B++){const V=j[B];if(V.id===G.data.vscodeSetImmediateId){j.splice(B,1),V.callback();return}}});let L=0;return G=>{const B=++L;j.push({id:B,callback:G}),h.postMessage({vscodeSetImmediateId:B},"*")}}if(typeof(r==null?void 0:r.nextTick)=="function")return r.nextTick.bind(r);const U=Promise.resolve();return j=>U.then(j)}(),g=I||p?2:F?1:3;let f=!0,C=!1;function E(){if(!C){C=!0;const _=new Uint8Array(2);_[0]=1,_[1]=2;const U=new Uint16Array(_.buffer);f=U[0]===(2<<8)+1}return f}}).call(this,D("IyRk"),D("Q2Ig"))},MVJL:function(Be,le,D){Be.exports={flex_box_center:"flex_box_center___2gBaY",flex_space_between:"flex_space_between___2uD--",flex_box_vertical_center:"flex_box_vertical_center___3Bq-4",flex_box_center_end:"flex_box_center_end___2MOXm",flex_box_column:"flex_box_column___1Sq4x",discussItem:"discussItem___Mk503",wrap:"wrap___VPGVq",list:"list___2zNHf",btns:"btns___1hoB3",secondLevelDiscuss:"secondLevelDiscuss___9Ixoa",line:"line___20Ukm",thirdlyLevelDiscuss:"thirdlyLevelDiscuss___3ZS-s"}},N0LK:function(Be,le,D){"use strict";D.d(le,"C",function(){return Q}),D.d(le,"v",function(){return M}),D.d(le,"s",function(){return X}),D.d(le,"t",function(){return F}),D.d(le,"U",function(){return I}),D.d(le,"J",function(){return H}),D.d(le,"O",function(){return N}),D.d(le,"p",function(){return n}),D.d(le,"T",function(){return P}),D.d(le,"q",function(){return p}),D.d(le,"N",function(){return m}),D.d(le,"M",function(){return d}),D.d(le,"Q",function(){return u}),D.d(le,"u",function(){return o}),D.d(le,"x",function(){return h}),D.d(le,"I",function(){return r}),D.d(le,"f",function(){return a}),D.d(le,"h",function(){return i}),D.d(le,"g",function(){return s}),D.d(le,"i",function(){return S}),D.d(le,"G",function(){return x}),D.d(le,"H",function(){return T}),D.d(le,"r",function(){return A}),D.d(le,"R",function(){return w}),D.d(le,"d",function(){return v}),D.d(le,"e",function(){return b}),D.d(le,"E",function(){return g}),D.d(le,"F",function(){return f}),D.d(le,"j",function(){return C}),D.d(le,"z",function(){return E}),D.d(le,"K",function(){return U}),D.d(le,"L",function(){return j}),D.d(le,"m",function(){return G}),D.d(le,"k",function(){return O}),D.d(le,"A",function(){return te}),D.d(le,"a",function(){return re}),D.d(le,"n",function(){return ge}),D.d(le,"l",function(){return Ae}),D.d(le,"D",function(){return Oe}),D.d(le,"B",function(){return Ce}),D.d(le,"b",function(){return je}),D.d(le,"S",function(){return Ue}),D.d(le,"o",function(){return xe}),D.d(le,"P",function(){return be}),D.d(le,"w",function(){return Ve}),D.d(le,"c",function(){return mt}),D.d(le,"y",function(){return xt});function Q(_e){return!_e||typeof _e!="string"?!0:_e.trim().length===0}const z=/{(\d+)}/g;function M(_e,...Me){return Me.length===0?_e:_e.replace(z,function(ve,Te){const We=parseInt(Te,10);return isNaN(We)||We<0||We>=Me.length?ve:Me[We]})}function X(_e){return _e.replace(/[<>&]/g,function(Me){switch(Me){case"<":return"<";case">":return">";case"&":return"&";default:return Me}})}function F(_e){return _e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function I(_e,Me=" "){const ve=H(_e,Me);return N(ve,Me)}function H(_e,Me){if(!_e||!Me)return _e;const ve=Me.length;if(ve===0||_e.length===0)return _e;let Te=0;for(;_e.indexOf(Me,Te)===Te;)Te=Te+ve;return _e.substring(Te)}function N(_e,Me){if(!_e||!Me)return _e;const ve=Me.length,Te=_e.length;if(ve===0||Te===0)return _e;let We=Te,Je=-1;for(;!(Je=_e.lastIndexOf(Me,We-1),Je===-1||Je+ve!==We);){if(Je===0)return"";We=Je}return _e.substring(0,We)}function n(_e){return _e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function P(_e){return _e.replace(/\*/g,"")}function p(_e,Me,ve={}){if(!_e)throw new Error("Cannot create regex from empty string");Me||(_e=F(_e)),ve.wholeWord&&(/\B/.test(_e.charAt(0))||(_e="\\b"+_e),/\B/.test(_e.charAt(_e.length-1))||(_e=_e+"\\b"));let Te="";return ve.global&&(Te+="g"),ve.matchCase||(Te+="i"),ve.multiline&&(Te+="m"),ve.unicode&&(Te+="u"),new RegExp(_e,Te)}function m(_e){if(_e.source==="^"||_e.source==="^$"||_e.source==="$"||_e.source==="^\\s*$")return!1;const Me=_e.exec("");return!!(Me&&_e.lastIndex===0)}function d(_e){return(_e.global?"g":"")+(_e.ignoreCase?"i":"")+(_e.multiline?"m":"")+(_e.unicode?"u":"")}function u(_e){return _e.split(/\r\n|\r|\n/)}function o(_e){for(let Me=0,ve=_e.length;Me<ve;Me++){const Te=_e.charCodeAt(Me);if(Te!==32&&Te!==9)return Me}return-1}function h(_e,Me=0,ve=_e.length){for(let Te=Me;Te<ve;Te++){const We=_e.charCodeAt(Te);if(We!==32&&We!==9)return _e.substring(Me,Te)}return _e.substring(Me,ve)}function r(_e,Me=_e.length-1){for(let ve=Me;ve>=0;ve--){const Te=_e.charCodeAt(ve);if(Te!==32&&Te!==9)return ve}return-1}function a(_e,Me){return _e<Me?-1:_e>Me?1:0}function i(_e,Me,ve=0,Te=_e.length,We=0,Je=Me.length){for(;ve<Te&&We<Je;ve++,We++){let Lt=_e.charCodeAt(ve),It=Me.charCodeAt(We);if(Lt<It)return-1;if(Lt>It)return 1}const at=Te-ve,dt=Je-We;return at<dt?-1:at>dt?1:0}function s(_e,Me){return S(_e,Me,0,_e.length,0,Me.length)}function S(_e,Me,ve=0,Te=_e.length,We=0,Je=Me.length){for(;ve<Te&&We<Je;ve++,We++){let Lt=_e.charCodeAt(ve),It=Me.charCodeAt(We);if(Lt===It)continue;if(Lt>=128||It>=128)return i(_e.toLowerCase(),Me.toLowerCase(),ve,Te,We,Je);x(Lt)&&(Lt-=32),x(It)&&(It-=32);const Ne=Lt-It;if(Ne===0)continue;return Ne}const at=Te-ve,dt=Je-We;return at<dt?-1:at>dt?1:0}function x(_e){return _e>=97&&_e<=122}function T(_e){return _e>=65&&_e<=90}function A(_e,Me){return _e.length===Me.length&&S(_e,Me)===0}function w(_e,Me){const ve=Me.length;return Me.length>_e.length?!1:S(_e,Me,0,ve)===0}function v(_e,Me){let ve,Te=Math.min(_e.length,Me.length);for(ve=0;ve<Te;ve++)if(_e.charCodeAt(ve)!==Me.charCodeAt(ve))return ve;return Te}function b(_e,Me){let ve,Te=Math.min(_e.length,Me.length);const We=_e.length-1,Je=Me.length-1;for(ve=0;ve<Te;ve++)if(_e.charCodeAt(We-ve)!==Me.charCodeAt(Je-ve))return ve;return Te}function g(_e){return 55296<=_e&&_e<=56319}function f(_e){return 56320<=_e&&_e<=57343}function C(_e,Me){return(_e-55296<<10)+(Me-56320)+65536}function E(_e,Me,ve){const Te=_e.charCodeAt(ve);if(g(Te)&&ve+1<Me){const We=_e.charCodeAt(ve+1);if(f(We))return C(Te,We)}return Te}function _(_e,Me){const ve=_e.charCodeAt(Me-1);if(f(ve)&&Me>1){const Te=_e.charCodeAt(Me-2);if(g(Te))return C(Te,ve)}return ve}function U(_e,Me){const ve=yt.getInstance(),Te=Me,We=_e.length,Je=E(_e,We,Me);Me+=Je>=65536?2:1;let at=ve.getGraphemeBreakType(Je);for(;Me<We;){const dt=E(_e,We,Me),Lt=ve.getGraphemeBreakType(dt);if(mt(at,Lt))break;Me+=dt>=65536?2:1,at=Lt}return Me-Te}function j(_e,Me){const ve=yt.getInstance(),Te=Me,We=_(_e,Me);Me-=We>=65536?2:1;let Je=ve.getGraphemeBreakType(We);for(;Me>0;){const at=_(_e,Me),dt=ve.getGraphemeBreakType(at);if(mt(dt,Je))break;Me-=at>=65536?2:1,Je=dt}return Te-Me}const L=/(?:[\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 G(_e){return L.test(_e)}const B=/(?:[\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 O(_e){return B.test(_e)}const V=/^[\t\n\r\x20-\x7E]*$/;function te(_e){return V.test(_e)}const re=/[\u2028\u2029]/;function ge(_e){return re.test(_e)}function Ae(_e){for(let Me=0,ve=_e.length;Me<ve;Me++)if(Oe(_e.charCodeAt(Me)))return!0;return!1}function Oe(_e){return _e=+_e,_e>=11904&&_e<=55215||_e>=63744&&_e<=64255||_e>=65281&&_e<=65374}function Ce(_e){return _e>=127462&&_e<=127487||_e===8986||_e===8987||_e===9200||_e===9203||_e>=9728&&_e<=10175||_e===11088||_e===11093||_e>=127744&&_e<=128591||_e>=128640&&_e<=128764||_e>=128992&&_e<=129003||_e>=129280&&_e<=129535||_e>=129648&&_e<=129750}const je=String.fromCharCode(65279);function Ue(_e){return!!(_e&&_e.length>0&&_e.charCodeAt(0)===65279)}function xe(_e,Me=!1){return _e?(Me&&(_e=_e.replace(/\\./g,"")),_e.toLowerCase()!==_e):!1}function be(_e){const Me=90-65+1;return _e=_e%(2*Me),_e<Me?String.fromCharCode(97+_e):String.fromCharCode(65+_e-Me)}function Ve(_e){const Me=yt.getInstance();return Me.getGraphemeBreakType(_e)}function mt(_e,Me){return _e===0?Me!==5&&Me!==7:_e===2&&Me===3?!1:_e===4||_e===2||_e===3||(Me===4||Me===2||Me===3)?!0:_e===8&&(Me===8||Me===9||Me===11||Me===12)||((_e===11||_e===9)&&(Me===9||Me===10)||((_e===12||_e===10)&&Me===10||(Me===5||Me===13||(Me===7||(_e===1||_e===13&&Me===14)))))?!1:!(_e===6&&Me===6)}class yt{constructor(){this._data=_t()}static getInstance(){return yt._INSTANCE||(yt._INSTANCE=new yt),yt._INSTANCE}getGraphemeBreakType(_e){if(_e<32)return _e===10?3:_e===13?2:4;if(_e<127)return 0;const Me=this._data,ve=Me.length/3;let Te=1;for(;Te<=ve;)if(_e<Me[3*Te])Te=2*Te;else if(_e>Me[3*Te+1])Te=2*Te+1;else return Me[3*Te+2];return 0}}yt._INSTANCE=null;function _t(){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 xt(_e,Me){if(_e===0)return 0;const ve=nt(_e,Me);if(ve!==void 0)return ve;const Te=_(Me,_e);return _e-=ct(Te),_e}function nt(_e,Me){let ve=_(Me,_e);for(_e-=ct(ve);wt(ve)||ve===65039||ve===8419;){if(_e===0)return;ve=_(Me,_e),_e-=ct(ve)}if(!Ce(ve))return;if(_e>=0){const Te=_(Me,_e);Te===8205&&(_e-=ct(Te))}return _e}function ct(_e){return _e>=65536?2:1}function wt(_e){return 127995<=_e&&_e<=127999}},NvD2:function(Be,le,D){"use strict";D.d(le,"a",function(){return I});var Q=D("Kwbf");function z(H,N){var n=new Set;return H.forEach(function(P){N.has(P)||n.add(P)}),n}function M(H){var N=H||{},n=N.disabled,P=N.disableCheckbox,p=N.checkable;return!!(n||P)||p===!1}function X(H,N,n,P){for(var p=new Set(H),m=new Set,d=0;d<=n;d+=1){var u=N.get(d)||new Set;u.forEach(function(a){var i=a.key,s=a.node,S=a.children,x=S===void 0?[]:S;p.has(i)&&!P(s)&&x.filter(function(T){return!P(T.node)}).forEach(function(T){p.add(T.key)})})}for(var o=new Set,h=n;h>=0;h-=1){var r=N.get(h)||new Set;r.forEach(function(a){var i=a.parent,s=a.node;if(P(s)||!a.parent||o.has(a.parent.key))return;if(P(a.parent.node)){o.add(i.key);return}var S=!0,x=!1;(i.children||[]).filter(function(T){return!P(T.node)}).forEach(function(T){var A=T.key,w=p.has(A);S&&!w&&(S=!1),!x&&(w||m.has(A))&&(x=!0)}),S&&p.add(i.key),x&&m.add(i.key),o.add(i.key)})}return{checkedKeys:Array.from(p),halfCheckedKeys:Array.from(z(m,p))}}function F(H,N,n,P,p){for(var m=new Set(H),d=new Set(N),u=0;u<=P;u+=1){var o=n.get(u)||new Set;o.forEach(function(i){var s=i.key,S=i.node,x=i.children,T=x===void 0?[]:x;!m.has(s)&&!d.has(s)&&!p(S)&&T.filter(function(A){return!p(A.node)}).forEach(function(A){m.delete(A.key)})})}d=new Set;for(var h=new Set,r=P;r>=0;r-=1){var a=n.get(r)||new Set;a.forEach(function(i){var s=i.parent,S=i.node;if(p(S)||!i.parent||h.has(i.parent.key))return;if(p(i.parent.node)){h.add(s.key);return}var x=!0,T=!1;(s.children||[]).filter(function(A){return!p(A.node)}).forEach(function(A){var w=A.key,v=m.has(w);x&&!v&&(x=!1),!T&&(v||d.has(w))&&(T=!0)}),x||m.delete(s.key),T&&d.add(s.key),h.add(s.key)})}return{checkedKeys:Array.from(m),halfCheckedKeys:Array.from(z(d,m))}}function I(H,N,n,P){var p=[],m;P?m=P:m=M;var d=new Set(H.filter(function(r){var a=!!n[r];return a||p.push(r),a})),u=new Map,o=0;Object.keys(n).forEach(function(r){var a=n[r],i=a.level,s=u.get(i);s||(s=new Set,u.set(i,s)),s.add(a),o=Math.max(o,i)}),Object(Q.a)(!p.length,"Tree missing follow keys: ".concat(p.slice(0,100).map(function(r){return"'".concat(r,"'")}).join(", ")));var h;return N===!0?h=X(d,u,o,m):h=F(d,N.halfCheckedKeys,u,o,m),h}},OLES:function(Be,le,D){"use strict";var Q=D("U8pU"),z=D("VTBJ"),M=D("Ff2n"),X=D("q1tI"),F=D("uciX"),I=D("7ixt"),H=function(d){var u=d.overlay,o=d.prefixCls,h=d.id,r=d.overlayInnerStyle;return X.createElement("div",{className:"".concat(o,"-inner"),id:h,role:"tooltip",style:r},typeof u=="function"?u():u)},N=H,n=function(d,u){var o=d.overlayClassName,h=d.trigger,r=h===void 0?["hover"]:h,a=d.mouseEnterDelay,i=a===void 0?0:a,s=d.mouseLeaveDelay,S=s===void 0?.1:s,x=d.overlayStyle,T=d.prefixCls,A=T===void 0?"rc-tooltip":T,w=d.children,v=d.onVisibleChange,b=d.afterVisibleChange,g=d.transitionName,f=d.animation,C=d.placement,E=C===void 0?"right":C,_=d.align,U=_===void 0?{}:_,j=d.destroyTooltipOnHide,L=j===void 0?!1:j,G=d.defaultVisible,B=d.getTooltipContainer,O=d.overlayInnerStyle,V=Object(M.a)(d,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),te=Object(X.useRef)(null);Object(X.useImperativeHandle)(u,function(){return te.current});var re=Object(z.a)({},V);"visible"in d&&(re.popupVisible=d.visible);var ge=function(){var Ue=d.arrowContent,xe=Ue===void 0?null:Ue,be=d.overlay,Ve=d.id;return[X.createElement("div",{className:"".concat(A,"-arrow"),key:"arrow"},xe),X.createElement(N,{key:"content",prefixCls:A,id:Ve,overlay:be,overlayInnerStyle:O})]},Ae=!1,Oe=!1;if(typeof L=="boolean")Ae=L;else if(L&&Object(Q.a)(L)==="object"){var Ce=L.keepParent;Ae=Ce===!0,Oe=Ce===!1}return X.createElement(F.a,Object.assign({popupClassName:o,prefixCls:A,popup:ge,action:r,builtinPlacements:I.a,popupPlacement:E,ref:te,popupAlign:U,getPopupContainer:B,onPopupVisibleChange:v,afterPopupVisibleChange:b,popupTransitionName:g,popupAnimation:f,defaultPopupVisible:G,destroyPopupOnHide:Ae,autoDestroy:Oe,mouseLeaveDelay:S,popupStyle:x,mouseEnterDelay:i},re),w)},P=Object(X.forwardRef)(n),p=le.a=P},OZM5:function(Be,le,D){"use strict";D.d(le,"b",function(){return P}),D.d(le,"a",function(){return p}),D.d(le,"k",function(){return m}),D.d(le,"h",function(){return d}),D.d(le,"i",function(){return u}),D.d(le,"g",function(){return o}),D.d(le,"c",function(){return h}),D.d(le,"d",function(){return r}),D.d(le,"j",function(){return s}),D.d(le,"e",function(){return S}),D.d(le,"f",function(){return x});var Q=D("KQm4"),z=D("U8pU"),M=D("Ff2n"),X=D("q1tI"),F=D.n(X),I=D("Kwbf"),H=D("WaYH"),N=.25,n=2;function P(T,A){var w=T.slice(),v=w.indexOf(A);return v>=0&&w.splice(v,1),w}function p(T,A){var w=T.slice();return w.indexOf(A)===-1&&w.push(A),w}function m(T){return T.split("-")}function d(T,A){return"".concat(T,"-").concat(A)}function u(T){return T&&T.type&&T.type.isTreeNode}function o(T,A){var w=[T],v=A[T];function b(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];g.forEach(function(f){var C=f.key,E=f.children;w.push(C),b(E)})}return b(v.children),w}function h(T,A){var w=T.clientY,v=A.selectHandle.getBoundingClientRect(),b=v.top,g=v.bottom,f=v.height,C=Math.max(f*N,n);return w<=b+C?-1:w>=g-C?1:0}function r(T,A){if(!T)return;var w=A.multiple;return w?T.slice():T.length?[T[0]]:T}var a=function(A){return A};function i(T,A){if(!T)return[];var w=A||{},v=w.processProps,b=v===void 0?a:v,g=Array.isArray(T)?T:[T];return g.map(function(f){var C=f.children,E=Object(M.a)(f,["children"]),_=i(C,A);return F.a.createElement(H.a,Object.assign({},b(E)),_)})}function s(T){if(!T)return null;var A;if(Array.isArray(T))A={checkedKeys:T,halfCheckedKeys:void 0};else if(Object(z.a)(T)==="object")A={checkedKeys:T.checked||void 0,halfCheckedKeys:T.halfChecked||void 0};else return Object(I.a)(!1,"`checkedKeys` is not an array or an object"),null;return A}function S(T,A){var w=new Set;function v(b){if(w.has(b))return;var g=A[b];if(!g)return;w.add(b);var f=g.parent,C=g.node;if(C.disabled)return;f&&v(f.key)}return(T||[]).forEach(function(b){v(b)}),Object(Q.a)(w)}function x(T){var A={};return Object.keys(T).forEach(function(w){(w.startsWith("data-")||w.startsWith("aria-"))&&(A[w]=T[w])}),A}},"OkW/":function(Be,le,D){},Ot1p:function(Be,le,D){"use strict";var Q=D("2qtc"),z=D("kLXV"),M=D("rAM+"),X=D("miYZ"),F=D("tsqr"),I=D("9og8"),H=D("tJVT"),N=D("jrin"),n=D("WmNS"),P=D.n(n),p=D("q1tI"),m=D.n(p),d=D("VrN/"),u=D.n(d),o=D("bdgK"),h=D("p77/"),r=D("Bd2K"),a=D("ELLl"),i=D("19Vz"),s=D("lZu9"),S=D("+NIl"),x=D("kSUc"),T=D("9Bee"),A=function(Le){var Xe=Le.value,ut=Xe===void 0?"":Xe,Dt=Le.className,jt=Le.showTextOnly,Ut=Le.showLines,Ct=Le.style,et=Ct===void 0?{}:Ct,st=Object(p.useMemo)(function(){return""},[ut]);return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{dangerouslySetInnerHTML:{__html:st}}))},w=D("0Owb"),v=D("dejd"),b=D("C+DQ"),g=D("1vsH"),f=D("m3rI"),C=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function E(Le){var Xe=Le.onActionCallback,ut=Le.title,Dt=Le.icon,jt=Le.actionName,Ut=Le.className,Ct=Ut===void 0?"":Ut,et=Le.children;function st(){Xe(jt)}return m.a.createElement("a",{title:ut,className:Ct,onClick:st},m.a.createElement("i",{className:"md-iconfont ".concat(Dt)}),et)}var _=function(Le){var Xe=Le.watch,ut=Le.showNullButton,Dt=Le.onActionCallback,jt=Le.fullScreen,Ut=Le.insertTemp,Ct=Le.hidetoolBar,et=Le.uuid,st=Le.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(g.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(g.F)("_educoder_session"),"&key=").concat(et,"&api=").concat(encodeURIComponent(f.a.PROXY_SERVER)));var He=[].concat(C,[{title:"".concat(Xe?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Xe?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return m.a.createElement("ul",{className:"markdown-toolbar-container"},!Ct&&He.map(function(pe,Re){return m.a.createElement("li",{key:Re},pe.actionName?m.a.createElement(E,Object(w.a)({},pe,{onActionCallback:Dt})):m.a.createElement("span",{className:"v-line"}))}),ut?m.a.createElement("li",null,m.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Dt},m.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Ut&&m.a.createElement("li",null,m.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Ut),onActionCallback:Dt},m.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),m.a.createElement("li",{className:"btn-full-screen"},m.a.createElement(E,{icon:"".concat(jt?"icon-shrink":"icon-enlarge"),title:jt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Dt})))},U=D("M8RZ"),j=D("+L6B"),L=D("2/Rp"),G=D("y8nQ"),B=D("Vl3Y"),O=D("5NDa"),V=D("5rEg"),te={labelCol:{span:4},wrapperCol:{span:20}},re=function(Le){var Xe=Le.callback,ut=Le.onCancel;function Dt(jt){Xe(jt)}return m.a.createElement(B.a,Object(w.a)({},te,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Dt}),m.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},m.a.createElement(V.a,null)),m.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},m.a.createElement(V.a,null)),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(L.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(L.a,{type:"ghost",onClick:ut},"\u53D6\u6D88")))},ge=D("7ahc"),Ae=D("HmJG"),Oe=D("BjJ7"),Ce=B.a.useForm,je={width:280,marginRight:10},Ue={labelCol:{span:5},wrapperCol:{span:19}},xe=function(Le){var Xe=Le.callback,ut=Le.onCancel,Dt=Ce(),jt=Object(H.a)(Dt,1),Ut=jt[0];function Ct(He){Xe(He)}function et(He,pe){if(He.status===-1){F.b.error(He.message);return}Ut.setFieldsValue({src:"/api/attachments/".concat(He.id),type:pe.type})}function st(He){var pe=He.target.files[0];Ve(pe,et)}return m.a.createElement(B.a,Object(w.a)({form:Ut},Ue,{className:"upload-image-panel",onFinish:Ct}),m.a.createElement(B.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},m.a.createElement("div",{className:"flex-container"},m.a.createElement(B.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},m.a.createElement(V.a,{style:je})),m.a.createElement(be,{onFileChange:st}))),m.a.createElement(B.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},m.a.createElement(V.a,{style:{width:264}})),m.a.createElement(B.a.Item,{style:{textAlign:"right"}},m.a.createElement(L.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(L.a,{type:"ghost",onClick:ut},"\u53D6\u6D88")))};function be(Le){var Xe=Le.onFileChange;return m.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",m.a.createElement("input",{type:"file",onChange:Xe}))}function Ve(Le,Xe){if(!Le)throw new String("\u6CA1\u6709\u6587\u4EF6");var ut=new FormData;ut.append("editormd-image-file",Le),ut.append("file_param_name","editormd-image-file"),ut.append("byxhr","true");var Dt=new window.XMLHttpRequest;Dt.withCredentials=!0,Dt.addEventListener("load",function(jt){Xe(JSON.parse(jt.target.responseText),Le)},!1),Dt.addEventListener("error",function(jt){console.error(jt)},!1),Dt.open("POST","".concat(Oe.a,"/api/attachments.json")),Dt.send(ut)}var mt=D("giR+"),yt=D("fyUT"),_t=D("7Kak"),xt=D("9yH6"),nt=xt.a.Group,ct={margin:"0 8px"},wt=function(Le){var Xe=Le.callback,ut=Le.onCancel;function Dt(jt){Xe(jt)}return m.a.createElement(B.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Dt},m.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},m.a.createElement("span",{style:ct},"\u5355\u5143\u683C\u6570\uFF1A"),m.a.createElement("span",{style:ct},"\u884C\u6570"),m.a.createElement(B.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},m.a.createElement(yt.a,null)),m.a.createElement("span",{style:ct},"\u5217\u6570"),m.a.createElement(B.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},m.a.createElement(yt.a,null))),m.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},m.a.createElement("span",{style:ct},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),m.a.createElement(B.a.Item,{name:"align"},m.a.createElement(nt,null,m.a.createElement(xt.a,{value:"default"},m.a.createElement("i",{className:"fa fa-align-justify"})),m.a.createElement(xt.a,{value:"left"},m.a.createElement("i",{className:"fa fa-align-left"})),m.a.createElement(xt.a,{value:"center"},m.a.createElement("i",{className:"fa fa-align-center"})),m.a.createElement(xt.a,{value:"right"},m.a.createElement("i",{className:"fa fa-align-right"}))))),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(L.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(L.a,{type:"ghost",onClick:ut},"\u53D6\u6D88")))},_e=D("ErOA"),Me=D("7Cbv"),ve="link",Te="upload-image",We="code-block",Je="add-table",at="------------",dt={default:at,left:":".concat(at),center:":".concat(at,":"),right:"".concat(at,":")},Lt=D("9VGf"),It,Ne;function ke(){}var it=0,ot=1e4,Ge="\u2581",$e=`
|
|
**\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 we(Le){return/^\d+$/.test(Le)?"".concat(Le,"px"):Le}var Se=navigator.platform.toUpperCase().indexOf("MAC")>=0,Ee=Se?"Cmd":"Ctrl",ue=["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"],de=(It={},Object(N.a)(It,Ee+"-B","bold"),Object(N.a)(It,Ee+"-I","italic"),It),ye=(Ne={},Object(N.a)(Ne,ve,"\u6DFB\u52A0\u94FE\u63A5"),Object(N.a)(Ne,We,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(N.a)(Ne,Te,"\u6DFB\u52A0\u6587\u4EF6"),Object(N.a)(Ne,Je,"\u6DFB\u52A0\u8868\u683C"),Ne),me=le.a=function(Le){var Xe=Le.defaultValue,ut=Xe===void 0?"":Xe,Dt=Le.onChange,jt=Le.width,Ut=jt===void 0?"100%":jt,Ct=Le.height,et=Ct===void 0?400:Ct,st=Le.miniToolbar,He=st===void 0?!1:st,pe=Le.isFocus,Re=pe===void 0?!1:pe,lt=Le.watch,Ye=Le.insertTemp,Pt=Le.mode,Nt=Pt===void 0?"markdown":Pt,Ke=Le.id,gt=Ke===void 0?"markdown-editor-id":Ke,bt=Le.showResizeBar,Tt=bt===void 0?!1:bt,Wt=Le.noStorage,fe=Wt===void 0?!1:Wt,se=Le.showNullButton,W=se===void 0?!1:se,$=Le.hidetoolBar,Z=$===void 0?!1:$,ne=Le.fullScreen,he=ne===void 0?!1:ne,Pe=Le.onBlur,ze=Le.onCMBeforeChange,Rt=Le.onFullScreen,Mt=Le.className,Ze=Mt===void 0?"":Mt,kt=Le.disablePaste,an=kt===void 0?!1:kt,At=Le.placeholder,pn=At===void 0?"":At,nn=Le.values,J=nn===void 0?"":nn,R=Object(p.useState)(null),k=Object(H.a)(R,2),Y=k[0],ae=k[1],q=Object(p.useState)(ut),Ie=Object(H.a)(q,2),ht=Ie[0],Ot=Ie[1],$t=Object(p.useState)(lt),ft=Object(H.a)($t,2),zt=ft[0],on=ft[1],Wn=Object(p.useState)(he),Si=Object(H.a)(Wn,2),hi=Si[0],Fn=Si[1],ci=Object(p.useState)(""),Zi=Object(H.a)(ci,2),yi=Zi[0],ri=Zi[1],Ci=Object(p.useState)(0),Di=Object(H.a)(Ci,2),Oi=Di[0],Ri=Di[1],Vi=Object(p.useState)(et),dr=Object(H.a)(Vi,2),rr=dr[0],ji=dr[1],Wi=Object(p.useState)(!1),hr=Object(H.a)(Wi,2),Tr=hr[0],ar=hr[1],Hn=Object(p.useRef)(Object(Me.a)()),wn=Object(p.useRef)(!1),_i=Object(p.useRef)(),Nn=Object(p.useRef)(),Ti=Object(p.useRef)(),ii=Object(p.useRef)(),wr=Object(p.useRef)(),Ni=function(){var mn=Object(I.a)(P.a.mark(function On(){var yn,jn;return P.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:return un.next=2,Object(_e.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Hn.current}});case 2:jn=un.sent,jn!=null&&(yn=jn.attachments)!==null&&yn!==void 0&&yn.length&&(console.log("cm:",Y,Nn),jn.attachments.map(function(Bn){Bn.content_type.indexOf("image")>-1?Y.replaceSelection(".concat(Bn.content_type,")")):Bn.content_type.indexOf("video")>-1?Y.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Bn.content_type.indexOf("pdf")>-1?Y.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Bn.id,"?type=").concat(Bn.content_type,'&disposition=inline" target="_blank">').concat(Bn.name,"</a>")):Y.replaceSelection("[".concat(Bn.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(Bn.id,"?type=").concat(Bn.content_type,")"))}));case 4:case"end":return un.stop()}},On)}));return function(){return mn.apply(this,arguments)}}();Object(p.useEffect)(function(){Ot(J),Y==null||Y.setValue(J)},[J]),Object(p.useEffect)(function(){Rt==null||Rt(hi)},[hi]),Object(p.useEffect)(function(){if(Nn.current){var mn=u.a.fromTextArea(Nn.current,{mode:Nt,lineNumbers:!He,lineWrapping:!0,value:ut,autoCloseTags:!0,autoCloseBrackets:!0});Re&&mn.focus();function On(yn,jn){if(an){jn.preventDefault();return}var Qn=jn.clipboardData;if(Qn){var un=Qn.types.toString(),Bn=Qn.items;if(un==="Files"||Qn.types.indexOf("Files")>-1){if(jn.preventDefault(),Nt=="stex")return;try{var Ai,Yi=Bn[1];((Ai=Bn[0])===null||Ai===void 0?void 0:Ai.kind)==="file"&&(Yi=Bn[0]);var Xn=Yi.getAsFile(),yr=Xn.name.split(".").pop();Ve(Xn,function(si){if(si.id){var qe,vt,Gt;(Xn==null||((qe=Xn.type)===null||qe===void 0)?void 0:qe.indexOf("image"))>-1?mn.replaceSelection(".concat(si.content_type,")")):(Xn==null||((vt=Xn.type)===null||vt===void 0)?void 0:vt.indexOf("video"))>-1?mn.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(si.id,'"></video>')):(Xn==null||((Gt=Xn.type)===null||Gt===void 0)?void 0:Gt.indexOf("pdf"))>-1?mn.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(si.id,"?type=").concat(Xn.type,'&disposition=inline" target="_blank">').concat(Xn.name,"</a>")):ue.includes(yr)?mn.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(si.id,'?type=office&disposition=inline" target="_blank">').concat(Xn.name,"</a>")):mn.replaceSelection("[".concat(Xn.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(si.id,"?type=").concat(si.content_type,")"))}else(si==null?void 0:si.status)===401&&(document.location.href="/user/login")})}catch(si){F.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return mn.on("paste",On),mn.on("dragleave",function(yn,jn){Ti.current.classList.remove("mouse-hover-md")}),mn.on("dragover",function(yn,jn){Ti.current.classList.add("mouse-hover-md")}),mn.on("drop",function(yn,jn){Ti.current.classList.add("mouse-hover-md");var Qn;if(Qn=jn.dataTransfer.files,Qn.length>0){jn.preventDefault(),jn.stopPropagation();for(var un=function(Yi){var Xn=Qn[Yi],yr=Xn.name.split(".").pop();Ve(Xn,function(si){if(si.id){var qe,vt,Gt;(Xn==null||((qe=Xn.type)===null||qe===void 0)?void 0:qe.indexOf("image"))>-1?mn.replaceSelection(".concat(si.content_type,")")):(Xn==null||((vt=Xn.type)===null||vt===void 0)?void 0:vt.indexOf("video"))>-1?mn.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(si.id,'"></video>')):(Xn==null||((Gt=Xn.type)===null||Gt===void 0)?void 0:Gt.indexOf("pdf"))>-1?mn.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(si.id,"?type=").concat(Xn.type,'&disposition=inline" target="_blank">').concat(Xn.name,"</a>")):ue.includes(yr)?mn.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(si.id,'?type=office&disposition=inline" target="_blank">').concat(Xn.name,"</a>")):mn.replaceSelection("[".concat(Xn.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(si.id,"?type=").concat(si.content_type,")"))}else(si==null?void 0:si.status)===401&&(document.location.href="/user/login")})},Bn=0;Bn<Qn.length;Bn++)un(Bn)}}),ae(mn),function(){mn.off("paste",On)}}},[]);var Xi=Object(p.useCallback)(function(){if(Ti.current)try{}catch(mn){console.log(mn,"---- to set md editor body height")}},[rr,Ti,hi]);Object(p.useEffect)(function(){function mn(){var yn=new o.default(function(jn){var Qn=Object(M.a)(jn),un;try{for(Qn.s();!(un=Qn.n()).done;){var Bn=un.value;(Bn.target.offsetHeight>0||Bn.target.offsetWidth>0)&&(Xi(),Y.setSize("100%","100%"),Y.refresh())}}catch(Ai){Qn.e(Ai)}finally{Qn.f()}});return yn.observe(Nn.current.parentElement),yn}if(Y){var On=mn();return function(){On.unobserve(Nn.current.parentElement)}}},[Y,Xi]),Object(p.useEffect)(function(){if(Y){for(var mn=[],On=function(){var Bn=jn[yn];Qn=Object(H.a)(Bn,2);var Ai=Qn[0],Yi=Qn[1],Xn=Object(N.a)({},Ai,function(){lr(Yi)});mn.push(Xn),Y.addKeyMap(Xn)},yn=0,jn=Object.entries(de);yn<jn.length;yn++){var Qn;On()}return _i.current=setInterval(function(){wn.current&&Ni()},4e3),function(){clearInterval(_i.current);var un=Object(M.a)(mn),Bn;try{for(un.s();!(Bn=un.n()).done;){var Ai=Bn.value;Y.removeKeyMap(Ai)}}catch(Yi){un.e(Yi)}finally{un.f()}}}},[Y]),Object(p.useEffect)(function(){he!==hi&&Fn(he)},[he]),Object(Lt.a)(function(){if(!fe&&Oi>0){var mn=new Date().getTime(),On=window.sessionStorage.getItem(gt);mn>=Oi+ot&&(!On||On!==ht)&&(window.sessionStorage.setItem(gt,ht),ar(!0))}},ot),Object(p.useEffect)(function(){on(lt)},[Y,lt]),Object(p.useEffect)(function(){Y&&(Re&&Y.focus())},[Y,Re]),Object(p.useEffect)(function(){if(zt&&Y){var mn=Y.getScrollerElement();function On(yn){var jn=yn.target;if(wr.current){var Qn=jn.scrollTop/jn.scrollHeight;wr.current.scrollTop=wr.current.scrollHeight*Qn}}return mn.addEventListener("scroll",On),function(){mn.removeEventListener("scroll",On)}}},[Y,zt]),Object(p.useEffect)(function(){if(Y&&ze){function mn(On,yn){ze(On,yn)}return Y.on("beforeChange",mn),function(){Y.off("beforeChange",mn)}}},[Y,ze]),Object(p.useEffect)(function(){if(Y&&Pe){function mn(){Pe(Y.getValue())}return Y.on("blur",mn),function(){Y.off("blur",mn)}}},[Y,Pe]),Object(p.useEffect)(function(){if(Y){function mn(On){var yn=On.getValue();Ot(yn),Ri(new Date().getTime()),On.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Dt&&Dt(yn)}return Y.on("change",mn),function(){Y.off("change",mn)}}},[Y,Dt]),Object(p.useEffect)(function(){Y&&(ut==null?(Y.setValue(""),Ot("")):ut!==Y.getValue()&&(Y.setValue(ut),Ot(ut),Y.setCursor(Y.lineCount(),0)))},[Y,ut]);var lr=Object(p.useCallback)(function(mn){var On=Y.getCursor(),yn=Y.getSelection(),jn=yn.split(`
|
|
`);switch(mn){case"bold":return Y.replaceSelection("**"+yn+"**"),yn===""&&Y.setCursor(On.line,On.ch+2),Y.focus();case"italic":return Y.replaceSelection("*"+yn+"*"),yn===""&&Y.setCursor(On.line,On.ch+1),Y.focus();case"code":return Y.replaceSelection("`"+yn+"`"),yn===""&&Y.setCursor(On.line,On.ch+1),Y.focus();case"inline-latex":return Y.replaceSelection("`$$"+yn+"$$`"),yn===""&&Y.setCursor(On.line,On.ch+3),Y.focus();case"latex":return Y.replaceSelection("```latex\n"+yn+"\n```"),Y.setCursor(On.line+1,yn.length+1),Y.focus();case"line-break":return Y.replaceSelection(`<br/>
|
|
`),Y.focus();case"list-ul":return yn===""?Y.replaceSelection("- "+yn):Y.replaceSelection(jn.map(function(Qn){return Qn===""?"":"- ".concat(Qn)}).join(`
|
|
`)),Y.focus();case"list-ol":return yn===""?Y.replaceSelection("1. "+yn):Y.replaceSelection(jn.map(function(Qn,un){return Qn===""?"":"".concat(un+1,". ").concat(Qn)}).join(`
|
|
`)),Y.focus();case"add-null-ch":return yn===""&&Y.setCursor(On.line,On.ch+1),Y.replaceSelection(Ge),Y.focus();case"inster-template-1":return yn===""&&Y.setCursor(On.line,On.ch),Y.replaceSelection($e),Y.focus();case"eraser":return Y.setValue(""),Y.focus();case"trigger-watch":return on(!zt),Y.focus();case"trigger-full-screen":return Fn(!hi),Y.focus();case ve:ri(ve);return;case We:ri(We);return;case Te:ri(Te);return;case Je:ri(Je);return;default:throw new Error}},[Y,zt,hi]),gr=Object(p.useCallback)(function(mn){ri("");switch(yi){case ve:var On=mn.title,yn=mn.link;return Y.replaceSelection("[".concat(On,"](").concat(yn,")")),Y.focus();case We:var jn=mn.language,Qn=mn.content;return Y.replaceSelection(["```"+jn,Qn,"```"].join(`
|
|
`)),Y.focus();case Te:var un=mn.src,Bn=mn.alt;return Bn?Y.replaceSelection(".concat(un,' "').concat(Bn,'" )')):Y.replaceSelection("")),Y.focus();case Je:for(var Ai=mn.row,Yi=mn.col,Xn=mn.align,yr=`
|
|
`,si=0;si<Ai;si++){for(var qe=[],vt=[],Gt=0;Gt<Yi;Gt++)si===1&&vt.push(dt[Xn]),qe.push(" ");si===1&&(yr+="| ".concat(vt.join(" | "),` |
|
|
`)),yr+="| ".concat(qe.join(Yi===1?"":" | "),` |
|
|
`)}return Y.replaceSelection(yr+`
|
|
`),Y.focus();default:throw new Error}},[Y,yi]),Hr=Object(p.useMemo)(function(){switch(yi){case ve:return m.a.createElement(re,{callback:gr,onCancel:kr});case We:return m.a.createElement(ge.b,{callback:gr,onCancel:kr});case Te:return m.a.createElement(xe,{callback:gr,onCancel:kr});case Je:return m.a.createElement(wt,{callback:gr,onCancel:kr});default:return null}},[yi]);function kr(){ri("")}Object(p.useEffect)(function(){if(ii.current){var mn=ii.current,On=!1,yn=0;function jn(Bn){On=!0,yn=Bn.pageY}function Qn(){On=!1}function un(Bn){if(On){var Ai=Bn.pageY-yn;Ai<0&&(Ai=0),Ai>300&&(Ai=300);var Yi=et+Ai+"px";ji(Yi)}}return mn.addEventListener("mousedown",jn),document.addEventListener("mousemove",un),document.addEventListener("mouseup",Qn),function(){mn.removeEventListener("mousedown",jn),document.removeEventListener("mousemove",un),document.removeEventListener("mouseup",Qn)}}},[Y,ii]),Object(p.useEffect)(function(){ji(et)},[et]);var Cr=we(Ut),Xr=we(rr),vr={width:Cr,height:Xr},Yr=Object(p.useMemo)(function(){if(Oi){var mn=new Date(Oi),On=mn.getHours(),yn=mn.getMinutes(),jn=mn.getSeconds();return On=On<10?"0"+On:On,yn=yn<10?"0"+yn:yn,jn=jn<10?"0"+jn:jn,"".concat(On,":").concat(yn,":").concat(jn)}return 0},[Oi]);function $r(){window.sessionStorage.removeItem(gt),ar(!1),Ri(0)}function fr(){ar(!1),Ri(0),Y.setValue(window.sessionStorage.getItem(gt))}function Qr(mn,On){var yn=Y.getValue();yn=yn.replace(mn,On),Ot(yn),Y==null||Y.setValue(yn)}return m.a.createElement(p.Fragment,null,m.a.createElement("div",{className:"markdown-editor-wrapper",ref:Ti},m.a.createElement("div",{className:"markdown-editor-container ".concat(Ze," ").concat(zt?"on-preview":""," ").concat(He?"mini":""," ").concat(hi?"full-screen":""),style:vr},m.a.createElement(_,{insertTemp:Ye,watch:zt,fullScreen:hi,showNullButton:W,onActionCallback:lr,hidetoolBar:Z,uuid:Hn.current,setOpenPhones:function(){wn.current=!0}}),m.a.createElement("div",{className:"markdown-editor-body"},m.a.createElement("div",{className:"codemirror-container"},m.a.createElement("textarea",{ref:Nn,placeholder:pn})),zt?m.a.createElement("div",{ref:wr,className:"preview-container"},Nt==="stex"&&m.a.createElement(A,{value:ht}),Nt!=="stex"&&m.a.createElement(T.a,{edit:!0,value:ht,replaces:Qr})):null))),Tt?m.a.createElement("a",{ref:ii,className:"editor-resize"}):null,m.a.createElement(U.a,null,ye[yi]?m.a.createElement(z.a,{centered:!0,title:ye[yi],visible:!0,onCancel:kr,footer:null,className:"markdown-popup-form"},Hr):null))}},P5Jw:function(Be,le,D){"use strict";var Q=D("rHrb"),z=Q.CopyToClipboard;z.CopyToClipboard=z,Be.exports=z},PD8m:function(Be,le){Be.exports={name:"memoryStorage",read:Q,write:z,each:M,remove:X,clearAll:F};var D={};function Q(I){return D[I]}function z(I,H){D[I]=H}function M(I){for(var H in D)D.hasOwnProperty(H)&&I(D[H],H)}function X(I){delete D[I]}function F(I){D={}}},RELg:function(Be,le,D){var Q=D("MFOe"),z=Q.Global;Be.exports={name:"oldIE-userDataStorage",write:H,read:N,each:n,remove:P,clearAll:p};var M="storejs",X=z.document,F=u(),I=(z.navigator?z.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function H(o,h){if(I)return;var r=d(o);F(function(a){a.setAttribute(r,h),a.save(M)})}function N(o){if(I)return;var h=d(o),r=null;return F(function(a){r=a.getAttribute(h)}),r}function n(o){F(function(h){for(var r=h.XMLDocument.documentElement.attributes,a=r.length-1;a>=0;a--){var i=r[a];o(h.getAttribute(i.name),i.name)}})}function P(o){var h=d(o);F(function(r){r.removeAttribute(h),r.save(M)})}function p(){F(function(o){var h=o.XMLDocument.documentElement.attributes;o.load(M);for(var r=h.length-1;r>=0;r--)o.removeAttribute(h[r].name);o.save(M)})}var m=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function d(o){return o.replace(/^\d/,"___$&").replace(m,"___")}function u(){if(!X||!X.documentElement||!X.documentElement.addBehavior)return null;var o="script",h,r,a;try{r=new ActiveXObject("htmlfile"),r.open(),r.write("<"+o+">document.w=window</"+o+'><iframe src="/favicon.ico"></iframe>'),r.close(),h=r.w.frames[0].document,a=h.createElement("div")}catch(i){a=X.createElement("div"),h=X.body}return function(i){var s=[].slice.call(arguments,0);s.unshift(a),h.appendChild(a),a.addBehavior("#default#userData"),a.load(M),i.apply(this,s),h.removeChild(a);return}}},RpDr:function(Be,le,D){"use strict";D.d(le,"a",function(){return T}),D.d(le,"c",function(){return v});var Q=D("+L6B"),z=D("2/Rp"),M=D("tJVT"),X=D("k1fw"),F=D("jrin"),I=D("5NDa"),H=D("5rEg"),N=D("q1tI"),n=D.n(N),P=D("8Skl"),p=D("y3Kf"),m=D("bdLU"),d=D("J66h"),u=D.n(d),o=D("++UQ"),h=D.n(o),r=D("IxHN"),a=D("9Bee"),i=D("1vsH"),s,S=H.a.TextArea,x={visible:!1,tabIndex:"0"},T=(s={},Object(F.a)(s,m.a.NOMATCH,"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D"),Object(F.a)(s,m.a.OK,"\u8C03\u8BD5\u901A\u8FC7"),Object(F.a)(s,2,"\u8C03\u8BD5\u8D85\u65F6"),Object(F.a)(s,3,"\u8C03\u8BD5pod\u5931\u8D25"),Object(F.a)(s,4,"\u7F16\u8BD1\u5931\u8D25"),Object(F.a)(s,5,"\u6267\u884C\u5931\u8D25"),s),A;(function(g){g[g.SET_VISIBLE=0]="SET_VISIBLE",g[g.SET_TABINDEX=1]="SET_TABINDEX"})(A||(A={}));function w(g,f){switch(f.type){case A.SET_VISIBLE:return Object(X.a)(Object(X.a)({},g),{},{visible:f.payload});case A.SET_TABINDEX:return Object(X.a)(Object(X.a)({},g),{},{tabIndex:f.payload});default:throw new Error}}function v(g){var f=g.status,C=g.error_msg,E=g.output,_=g.input,U=g.expected_output,j=g.is_file,L=g.input_file_url,G=g.output_file_url,B=g.expected_output_file_url,O=null,V={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(f){case m.a.NOMATCH:O=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!j&&n.a.createElement(a.a,{value:_,style:V}),j&&n.a.createElement("div",{style:V},n.a.createElement("a",{onClick:function(){return Object(i.y)(L,_)}},_)),n.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!j&&n.a.createElement(a.a,{value:E&&d.Base64.decode(E)||"",style:V}),j&&n.a.createElement("div",{style:V},n.a.createElement("a",{onClick:function(){return Object(i.y)(G,E)}},E)),n.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!j&&n.a.createElement(a.a,{value:U&&d.Base64.decode(U)||"",style:V}),j&&n.a.createElement("div",{style:V},n.a.createElement("a",{onClick:function(){return Object(i.y)(B,U)}},U)));break;case m.a.EXECUTEFAILURE:O=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!j&&n.a.createElement(a.a,{value:_,style:V}),j&&n.a.createElement("div",{style:V},n.a.createElement("a",{onClick:function(){return Object(i.y)(L,_)}},_)),n.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),n.a.createElement("pre",{className:"error"},d.Base64.decode(C)));break;case m.a.COMPILEFAILURE:O=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!j&&n.a.createElement(a.a,{value:_,style:V}),j&&n.a.createElement("div",{style:V},n.a.createElement("a",{onClick:function(){return Object(i.y)(L,_)}},_)),n.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),n.a.createElement("pre",{className:"error"},d.Base64.decode(C)));break;case m.a.PODFAILURE:O=n.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case m.a.TIMEOUT:O=n.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return n.a.createElement(n.a.Fragment,null," ",O," ")}function b(g){var f=g.status,C=g.error_msg,E=g.execute_time,_=g.output,U=g.input,j=g.expected_output,L=g.is_file,G=g.input_file_url,B=g.output_file_url,O=g.expected_output_file_url,V=null;switch(f){case m.a.OK:V=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",E),n.a.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),n.a.createElement("pre",null,d.Base64.decode(_)));break;case m.a.NOMATCH:V=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",null,"\u8F93\u5165\uFF1A",n.a.createElement("pre",null,U)),n.a.createElement("p",null,"\u8F93\u51FA\uFF1A",_&&d.Base64.decode(_)),n.a.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",j&&d.Base64.decode(j)));break;case m.a.EXECUTEFAILURE:V=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",n.a.createElement("pre",null,U)),n.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),n.a.createElement("pre",{className:"error"},d.Base64.decode(C)));break;case m.a.COMPILEFAILURE:V=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",n.a.createElement("pre",null,U)),n.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),n.a.createElement("pre",{className:"error"},d.Base64.decode(C)));break;case m.a.PODFAILURE:V=n.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case m.a.TIMEOUT:V=n.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return n.a.createElement(n.a.Fragment,null," ",V," ")}le.b=function(g){var f=g.id,C=g.input,E=g.debuging,_=g.submitting,U=g.executingMessage,j=g.debugResult,L=g.onChangeInput,G=g.onDebugCode,B=g.onSubmitCode,O=Object(N.useReducer)(w,x),V=Object(M.a)(O,2),te=V[0],re=V[1],ge=te.visible,Ae=te.tabIndex;Object(N.useEffect)(function(){re({type:A.SET_VISIBLE,payload:!1})},[f]);function Oe(xe){var be=xe.target.id;re({type:A.SET_TABINDEX,payload:be})}function Ce(){re({type:A.SET_VISIBLE,payload:!ge})}var je=Object(N.useMemo)(function(){if(j){var xe=j.status;return n.a.createElement(n.a.Fragment,null,b(j))}return null},[j]);function Ue(){re({type:A.SET_VISIBLE,payload:!0}),re({type:A.SET_TABINDEX,payload:"1"}),G()}return n.a.createElement("div",{className:"test-case-panel"},n.a.createElement("div",{className:"test-case-panel-body ".concat(ge?"active":"")},n.a.createElement("ul",{className:"s-navs"},n.a.createElement("li",null,n.a.createElement("a",{className:Ae==="0"?"active":"",id:"0",onClick:Oe},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")),n.a.createElement("li",null,n.a.createElement("a",{className:Ae==="1"?"active":"",id:"1",onClick:Oe},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))),n.a.createElement("div",{className:"tab-panel-body ".concat(Ae==="0"?"":"hide")},n.a.createElement(S,{placeholder:"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D",value:C,onChange:L})),n.a.createElement("div",{className:"tab-panel-body ".concat(Ae==="1"?"":"hide")},E?n.a.createElement(r.a,{message:U}):j?n.a.createElement("section",{style:{height:200}}," ",je," "):n.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"))),n.a.createElement("a",{className:"btn-collapse ".concat(ge?"up":""),onClick:Ce},ge?n.a.createElement(P.a,null):n.a.createElement(p.a,null)),n.a.createElement("footer",{className:"footer"},n.a.createElement("span",{style:{visibility:"hidden"}},"\u63A7\u5236\u53F0"),n.a.createElement("div",{className:"flex-container"},n.a.createElement(z.a,{id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),n.a.createElement(z.a,{id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),n.a.createElement(z.a,{className:"btn-green",type:"ghost",loading:E,onClick:Ue},"\u8C03\u8BD5\u4EE3\u7801"),n.a.createElement(z.a,{type:"primary",loading:_,disabled:_,onClick:function(){re({type:A.SET_VISIBLE,payload:!1}),B()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},"S/kP":function(Be,le,D){Be.exports=D.p+"static/time.69bc8c81.svg"},"SA+Z":function(Be,le,D){var Q=D("wTVA"),z=D("EbDI"),M=D("ZhPi"),X=D("wkBT");function F(I){return Q(I)||z(I)||M(I)||X()}Be.exports=F,Be.exports.__esModule=!0,Be.exports.default=Be.exports},SJMd:function(Be,le){/**
|
|
* @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 D,Q,z,M=!1,X,F;window.PR_SHOULD_USE_CONTINUATION=!0;var I,H;(function(){var N=window,n=["break,continue,do,else,for,if,return,while"],P=[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"],p=[P,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],m=[p,"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"],d=[p,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],u=[p,"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"],o="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",h=[p,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],r="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",a=[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"],i=[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"],s=[n,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],S=[m,u,d,h,r,a,i,s],x=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,T="str",A="kwd",w="com",v="typ",b="lit",g="pun",f="pln",C="tag",E="dec",_="src",U="atn",j="atv",L="nocode",G="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function B(nt){for(var ct=0,wt=!1,_e=!1,Me=0,ve=nt.length;Me<ve;++Me){var Te=nt[Me];if(Te.ignoreCase)_e=!0;else if(/[a-z]/i.test(Te.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){wt=!0,_e=!1;break}}var We={b:8,t:9,n:10,v:11,f:12,r:13};function Je(Ne){var ke=Ne.charCodeAt(0);if(ke!==92)return ke;var it=Ne.charAt(1);return ke=We[it],ke||("0"<=it&&it<="7"?parseInt(Ne.substring(1),8):it==="u"||it==="x"?parseInt(Ne.substring(2),16):Ne.charCodeAt(1))}function at(Ne){if(Ne<32)return(Ne<16?"\\x0":"\\x")+Ne.toString(16);var ke=String.fromCharCode(Ne);return ke==="\\"||ke==="-"||ke==="]"||ke==="^"?"\\"+ke:ke}function dt(Ne){var ke=Ne.substring(1,Ne.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),it=[],ot=ke[0]==="^",Ge=["["];ot&&Ge.push("^");for(var $e=ot?1:0,we=ke.length;$e<we;++$e){var Se=ke[$e];if(/\\[bdsw]/i.test(Se))Ge.push(Se);else{var Ee=Je(Se),ue;$e+2<we&&ke[$e+1]==="-"?(ue=Je(ke[$e+2]),$e+=2):ue=Ee,it.push([Ee,ue]),ue<65||Ee>122||(ue<65||Ee>90||it.push([Math.max(65,Ee)|32,Math.min(ue,90)|32]),ue<97||Ee>122||it.push([Math.max(97,Ee)&~32,Math.min(ue,122)&~32]))}}it.sort(function(Le,Xe){return Le[0]-Xe[0]||Xe[1]-Le[1]});for(var de=[],ye=[],$e=0;$e<it.length;++$e){var me=it[$e];me[0]<=ye[1]+1?ye[1]=Math.max(ye[1],me[1]):de.push(ye=me)}for(var $e=0;$e<de.length;++$e){var me=de[$e];Ge.push(at(me[0])),me[1]>me[0]&&(me[1]+1>me[0]&&Ge.push("-"),Ge.push(at(me[1])))}return Ge.push("]"),Ge.join("")}function Lt(Ne){for(var ke=Ne.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),it=ke.length,ot=[],Ge=0,$e=0;Ge<it;++Ge){var we=ke[Ge];if(we==="(")++$e;else if(we.charAt(0)==="\\"){var Se=+we.substring(1);Se&&(Se<=$e?ot[Se]=-1:ke[Ge]=at(Se))}}for(var Ge=1;Ge<ot.length;++Ge)ot[Ge]===-1&&(ot[Ge]=++ct);for(var Ge=0,$e=0;Ge<it;++Ge){var we=ke[Ge];if(we==="(")++$e,ot[$e]||(ke[Ge]="(?:");else if(we.charAt(0)==="\\"){var Se=+we.substring(1);Se&&Se<=$e&&(ke[Ge]="\\"+ot[Se])}}for(var Ge=0;Ge<it;++Ge)ke[Ge]==="^"&&ke[Ge+1]!=="^"&&(ke[Ge]="");if(Ne.ignoreCase&&wt)for(var Ge=0;Ge<it;++Ge){var we=ke[Ge],Ee=we.charAt(0);we.length>=2&&Ee==="["?ke[Ge]=dt(we):Ee!=="\\"&&(ke[Ge]=we.replace(/[a-zA-Z]/g,function(ye){var me=ye.charCodeAt(0);return"["+String.fromCharCode(me&~32,me|32)+"]"}))}return ke.join("")}for(var It=[],Me=0,ve=nt.length;Me<ve;++Me){var Te=nt[Me];if(Te.global||Te.multiline)throw new Error(""+Te);It.push("(?:"+Lt(Te)+")")}return new RegExp(It.join("|"),_e?"gi":"g")}function O(nt,ct){var wt=/(?:^|\s)nocode(?:\s|$)/,_e=[],Me=0,ve=[],Te=0;function We(Je){var at=Je.nodeType;if(at==1){if(wt.test(Je.className))return;for(var dt=Je.firstChild;dt;dt=dt.nextSibling)We(dt);var Lt=Je.nodeName.toLowerCase();(Lt==="br"||Lt==="li")&&(_e[Te]=`
|
|
`,ve[Te<<1]=Me++,ve[Te++<<1|1]=Je)}else if(at==3||at==4){var It=Je.nodeValue;It.length&&(ct?It=It.replace(/\r\n?/g,`
|
|
`):It=It.replace(/[ \t\r\n]+/g," "),_e[Te]=It,ve[Te<<1]=Me,Me+=It.length,ve[Te++<<1|1]=Je)}}return We(nt),{sourceCode:_e.join("").replace(/\n$/,""),spans:ve}}function V(nt,ct,wt,_e,Me){if(!wt)return;var ve={sourceNode:nt,pre:1,langExtension:null,numberLines:null,sourceCode:wt,spans:null,basePos:ct,decorations:null};_e(ve),Me.push.apply(Me,ve.decorations)}var te=/\S/;function re(nt){for(var ct=void 0,wt=nt.firstChild;wt;wt=wt.nextSibling){var _e=wt.nodeType;ct=_e===1?ct?nt:wt:_e===3&&te.test(wt.nodeValue)?nt:ct}return ct===nt?void 0:ct}function ge(nt,ct){var wt={},_e;(function(){for(var Te=nt.concat(ct),We=[],Je={},at=0,dt=Te.length;at<dt;++at){var Lt=Te[at],It=Lt[3];if(It)for(var Ne=It.length;--Ne>=0;)wt[It.charAt(Ne)]=Lt;var ke=Lt[1],it=""+ke;Je.hasOwnProperty(it)||(We.push(ke),Je[it]=null)}We.push(/[\0-\uffff]/),_e=B(We)})();var Me=ct.length,ve=function(Te){for(var We=Te.sourceCode,Je=Te.basePos,at=Te.sourceNode,dt=[Je,f],Lt=0,It=We.match(_e)||[],Ne={},ke=0,it=It.length;ke<it;++ke){var ot=It[ke],Ge=Ne[ot],$e=void 0,we;if(typeof Ge=="string")we=!1;else{var Se=wt[ot.charAt(0)];if(Se)$e=ot.match(Se[1]),Ge=Se[0];else{for(var Ee=0;Ee<Me;++Ee)if(Se=ct[Ee],$e=ot.match(Se[1]),$e){Ge=Se[0];break}$e||(Ge=f)}we=Ge.length>=5&&Ge.substring(0,5)==="lang-",we&&!($e&&typeof $e[1]=="string")&&(we=!1,Ge=_),we||(Ne[ot]=Ge)}var ue=Lt;if(Lt+=ot.length,!we)dt.push(Je+ue,Ge);else{var de=$e[1],ye=ot.indexOf(de),me=ye+de.length;$e[2]&&(me=ot.length-$e[2].length,ye=me-de.length);var Le=Ge.substring(5);V(at,Je+ue,ot.substring(0,ye),ve,dt),V(at,Je+ue+ye,de,be(Le,de),dt),V(at,Je+ue+me,ot.substring(me),ve,dt)}}Te.decorations=dt};return ve}function Ae(nt){var ct=[],wt=[];nt.tripleQuotedStrings?ct.push([T,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):nt.multiLineStrings?ct.push([T,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):ct.push([T,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),nt.verbatimStrings&&wt.push([T,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var _e=nt.hashComments;_e&&(nt.cStyleComments?(_e>1?ct.push([w,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):ct.push([w,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),wt.push([T,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):ct.push([w,/^#[^\r\n]*/,null,"#"])),nt.cStyleComments&&(wt.push([w,/^\/\/[^\r\n]*/,null]),wt.push([w,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Me=nt.regexLiterals;if(Me){var ve=Me>1?"":`
|
|
\r`,Te=ve?".":"[\\S\\s]",We="/(?=[^/*"+ve+"])(?:[^/\\x5B\\x5C"+ve+"]|\\x5C"+Te+"|\\x5B(?:[^\\x5C\\x5D"+ve+"]|\\x5C"+Te+")*(?:\\x5D|$))+/";wt.push(["lang-regex",RegExp("^"+G+"("+We+")")])}var Je=nt.types;Je&&wt.push([v,Je]);var at=(""+nt.keywords).replace(/^ | $/g,"");at.length&&wt.push([A,new RegExp("^(?:"+at.replace(/[\s,]+/g,"|")+")\\b"),null]),ct.push([f,/^\s+/,null,` \r
|
|
\xA0`]);var dt="^.[^\\s\\w.$@'\"`/\\\\]*";return nt.regexLiterals&&(dt+="(?!s*/)"),wt.push([b,/^@[a-z_$][a-z_$@0-9]*/i,null],[v,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[f,/^[a-z_$][a-z_$@0-9]*/i,null],[b,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[f,/^\\[\s\S]?/,null],[g,new RegExp(dt),null]),ge(ct,wt)}var Oe=Ae({keywords:S,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ce(nt,ct,wt){for(var _e=/(?:^|\s)nocode(?:\s|$)/,Me=/\r\n?|\n/,ve=nt.ownerDocument,Te=ve.createElement("li");nt.firstChild;)Te.appendChild(nt.firstChild);var We=[Te];function Je(ke){var it=ke.nodeType;if(it==1&&!_e.test(ke.className))if(ke.nodeName==="br")at(ke),ke.parentNode&&ke.parentNode.removeChild(ke);else for(var ot=ke.firstChild;ot;ot=ot.nextSibling)Je(ot);else if((it==3||it==4)&&wt){var Ge=ke.nodeValue,$e=Ge.match(Me);if($e){var we=Ge.substring(0,$e.index);ke.nodeValue=we;var Se=Ge.substring($e.index+$e[0].length);if(Se){var Ee=ke.parentNode;Ee.insertBefore(ve.createTextNode(Se),ke.nextSibling)}at(ke),we||ke.parentNode.removeChild(ke)}}}function at(ke){for(;!ke.nextSibling;)if(ke=ke.parentNode,!ke)return;function it($e,we){var Se=we?$e.cloneNode(!1):$e,Ee=$e.parentNode;if(Ee){var ue=it(Ee,1),de=$e.nextSibling;ue.appendChild(Se);for(var ye=de;ye;ye=de)de=ye.nextSibling,ue.appendChild(ye)}return Se}for(var ot=it(ke.nextSibling,0),Ge;(Ge=ot.parentNode)&&Ge.nodeType===1;)ot=Ge;We.push(ot)}for(var dt=0;dt<We.length;++dt)Je(We[dt]);ct===(ct|0)&&We[0].setAttribute("value",ct);var Lt=ve.createElement("ol");Lt.className="linenums";for(var It=Math.max(0,ct-1|0)||0,dt=0,Ne=We.length;dt<Ne;++dt)Te=We[dt],Te.className="L"+(dt+It)%10,Te.firstChild||Te.appendChild(ve.createTextNode("\xA0")),Lt.appendChild(Te);nt.appendChild(Lt)}function je(nt){var ct=/\bMSIE\s(\d+)/.exec(navigator.userAgent);ct=ct&&+ct[1]<=8;var wt=/\n/g,_e=nt.sourceCode,Me=_e.length,ve=0,Te=nt.spans,We=Te.length,Je=0,at=nt.decorations,dt=at.length,Lt=0;at[dt]=Me;var It,Ne;for(Ne=It=0;Ne<dt;)at[Ne]!==at[Ne+2]?(at[It++]=at[Ne++],at[It++]=at[Ne++]):Ne+=2;for(dt=It,Ne=It=0;Ne<dt;){for(var ke=at[Ne],it=at[Ne+1],ot=Ne+2;ot+2<=dt&&at[ot+1]===it;)ot+=2;at[It++]=ke,at[It++]=it,Ne=ot}dt=at.length=It;var Ge=nt.sourceNode,$e="";Ge&&($e=Ge.style.display,Ge.style.display="none");try{for(var we=null;Je<We;){var Se=Te[Je],Ee=Te[Je+2]||Me,ue=at[Lt+2]||Me,ot=Math.min(Ee,ue),de=Te[Je+1],ye;if(de.nodeType!==1&&(ye=_e.substring(ve,ot))){ct&&(ye=ye.replace(wt,"\r")),de.nodeValue=ye;var me=de.ownerDocument,Le=me.createElement("span");Le.className=at[Lt+1];var Xe=de.parentNode;Xe.replaceChild(Le,de),Le.appendChild(de),ve<Ee&&(Te[Je+1]=de=me.createTextNode(_e.substring(ot,Ee)),Xe.insertBefore(de,Le.nextSibling))}ve=ot,ve>=Ee&&(Je+=2),ve>=ue&&(Lt+=2)}}finally{Ge&&(Ge.style.display=$e)}}var Ue={};function xe(nt,ct){for(var wt=ct.length;--wt>=0;){var _e=ct[wt];Ue.hasOwnProperty(_e)?N.console&&console.warn("cannot override language handler %s",_e):Ue[_e]=nt}}function be(nt,ct){return nt&&Ue.hasOwnProperty(nt)||(nt=/^\s*</.test(ct)?"default-markup":"default-code"),Ue[nt]}xe(Oe,["default-code"]),xe(ge([],[[f,/^[^<?]+/],[E,/^<!\w[^>]*(?:>|$)/],[w,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[g,/^(?:<[%?]|[%?]>)/],["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"]),xe(ge([[f,/^[\s]+/,null,` \r
|
|
`],[j,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[C,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[U,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[g,/^[=<>\/]+/],["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"]),xe(ge([],[[j,/^[\s\S]+/]]),["uq.val"]),xe(Ae({keywords:m,hashComments:!0,cStyleComments:!0,types:x}),["c","cc","cpp","cxx","cyc","m"]),xe(Ae({keywords:"null,true,false"}),["json"]),xe(Ae({keywords:u,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:x}),["cs"]),xe(Ae({keywords:d,cStyleComments:!0}),["java"]),xe(Ae({keywords:s,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),xe(Ae({keywords:a,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),xe(Ae({keywords:r,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),xe(Ae({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),xe(Ae({keywords:h,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),xe(Ae({keywords:o,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),xe(ge([],[[T,/^[\s\S]+/]]),["regex"]);function Ve(nt){var ct=nt.langExtension;try{var wt=O(nt.sourceNode,nt.pre),_e=wt.sourceCode;nt.sourceCode=_e,nt.spans=wt.spans,nt.basePos=0,be(ct,_e)(nt),je(nt)}catch(Me){N.console&&console.log(Me&&Me.stack||Me)}}function mt(nt,ct,wt){var _e=wt||!1,Me=ct||null,ve=document.createElement("div");ve.innerHTML="<pre>"+nt+"</pre>",ve=ve.firstChild,_e&&Ce(ve,_e,!0);var Te={langExtension:Me,numberLines:_e,sourceNode:ve,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Ve(Te),ve.innerHTML}function yt(nt,ct){var wt=ct||document.body,_e=wt.ownerDocument||document;function Me(Se){return wt.getElementsByTagName(Se)}for(var ve=[Me("pre"),Me("code"),Me("xmp")],Te=[],We=0;We<ve.length;++We)for(var Je=0,at=ve[We].length;Je<at;++Je)Te.push(ve[We][Je]);ve=null;var dt=Date;dt.now||(dt={now:function(){return+new Date}});var Lt=0,It=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ne=/\bprettyprint\b/,ke=/\bprettyprinted\b/,it=/pre|xmp/i,ot=/^code$/i,Ge=/^(?:pre|code|xmp)$/i,$e={};function we(){for(var Se=N.PR_SHOULD_USE_CONTINUATION?dt.now()+250:Infinity;Lt<Te.length&&dt.now()<Se;Lt++){for(var Ee=Te[Lt],ue=$e,de=Ee;de=de.previousSibling;){var ye=de.nodeType,me=(ye===7||ye===8)&&de.nodeValue;if(me?!/^\??prettify\b/.test(me):ye!==3||/\S/.test(de.nodeValue))break;if(me){ue={},me.replace(/\b(\w+)=([\w:.%+-]+)/g,function(lt,Ye,Pt){ue[Ye]=Pt});break}}var Le=Ee.className;if((ue!==$e||Ne.test(Le))&&!ke.test(Le)){for(var Xe=!1,ut=Ee.parentNode;ut;ut=ut.parentNode){var Dt=ut.tagName;if(Ge.test(Dt)&&ut.className&&Ne.test(ut.className)){Xe=!0;break}}if(!Xe){Ee.className+=" prettyprinted";var jt=ue.lang;if(!jt){jt=Le.match(It);var Ut;!jt&&(Ut=re(Ee))&&ot.test(Ut.tagName)&&(jt=Ut.className.match(It)),jt&&(jt=jt[1])}var Ct;if(it.test(Ee.tagName))Ct=1;else{var et=Ee.currentStyle,st=_e.defaultView,He=et?et.whiteSpace:st&&st.getComputedStyle?st.getComputedStyle(Ee,null).getPropertyValue("white-space"):0;Ct=He&&He.substring(0,3)==="pre"}var pe=ue.linenums;(pe=pe==="true"||+pe)||(pe=Le.match(/\blinenums\b(?::(\d+))?/),pe=pe?pe[1]&&pe[1].length?+pe[1]:!0:!1),pe&&Ce(Ee,pe,Ct);var Re={langExtension:jt,sourceNode:Ee,numberLines:pe,pre:Ct,sourceCode:null,basePos:null,spans:null,decorations:null};Ve(Re)}}}Lt<Te.length?N.setTimeout(we,250):typeof nt=="function"&&nt()}we()}var _t=N.PR={createSimpleLexer:ge,registerLangHandler:xe,sourceDecorator:Ae,PR_ATTRIB_NAME:U,PR_ATTRIB_VALUE:j,PR_COMMENT:w,PR_DECLARATION:E,PR_KEYWORD:A,PR_LITERAL:b,PR_NOCODE:L,PR_PLAIN:f,PR_PUNCTUATION:g,PR_SOURCE:_,PR_STRING:T,PR_TAG:C,PR_TYPE:v,prettyPrintOne:M?N.prettyPrintOne=mt:I=mt,prettyPrint:H=M?N.prettyPrint=yt:H=yt},xt=N.define;typeof xt=="function"&&xt.amd&&xt("google-code-prettify",[],function(){return _t})})()},T8No:function(Be,le,D){"use strict";D.d(le,"a",function(){return H}),D.d(le,"e",function(){return N}),D.d(le,"c",function(){return g}),D.d(le,"b",function(){return f}),D.d(le,"d",function(){return C}),D.d(le,"f",function(){return U});var Q=D("MNsG"),z=D("N0LK"),M=D("Cg/j");let X=Q.k||"";const F=new Map;F.set("false",!1),F.set("true",!0),F.set("isMac",Q.f),F.set("isLinux",Q.d),F.set("isWindows",Q.i),F.set("isWeb",Q.h),F.set("isMacNative",Q.f&&!Q.h),F.set("isEdge",X.indexOf("Edg/")>=0),F.set("isFirefox",X.indexOf("Firefox")>=0),F.set("isChrome",X.indexOf("Chrome")>=0),F.set("isSafari",X.indexOf("Safari")>=0);const I=Object.prototype.hasOwnProperty;class H{static has(L){return m.create(L)}static equals(L,G){return d.create(L,G)}static regex(L,G){return T.create(L,G)}static not(L){return r.create(L)}static and(...L){return v.create(L,null)}static or(...L){return b.create(L,null,!0)}static deserialize(L,G=!1){return L?this._deserializeOrExpression(L,G):void 0}static _deserializeOrExpression(L,G){let B=L.split("||");return b.create(B.map(O=>this._deserializeAndExpression(O,G)),null,!0)}static _deserializeAndExpression(L,G){let B=L.split("&&");return v.create(B.map(O=>this._deserializeOne(O,G)),null)}static _deserializeOne(L,G){if(L=L.trim(),L.indexOf("!=")>=0){let B=L.split("!=");return h.create(B[0].trim(),this._deserializeValue(B[1],G))}if(L.indexOf("==")>=0){let B=L.split("==");return d.create(B[0].trim(),this._deserializeValue(B[1],G))}if(L.indexOf("=~")>=0){let B=L.split("=~");return T.create(B[0].trim(),this._deserializeRegexValue(B[1],G))}if(L.indexOf(" in ")>=0){let B=L.split(" in ");return u.create(B[0].trim(),B[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(L)){const B=L.split(">=");return s.create(B[0].trim(),B[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(L)){const B=L.split(">");return i.create(B[0].trim(),B[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(L)){const B=L.split("<=");return x.create(B[0].trim(),B[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(L)){const B=L.split("<");return S.create(B[0].trim(),B[1].trim())}return/^\!\s*/.test(L)?r.create(L.substr(1).trim()):m.create(L)}static _deserializeValue(L,G){if(L=L.trim(),L==="true")return!0;if(L==="false")return!1;let B=/^'([^']*)'$/.exec(L);return B?B[1].trim():L}static _deserializeRegexValue(L,G){if(Object(z.C)(L)){if(G)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let B=L.indexOf("/"),O=L.lastIndexOf("/");if(B===O||B<0){if(G)throw new Error(`bad regexp-value '${L}', missing /-enclosure`);return console.warn(`bad regexp-value '${L}', missing /-enclosure`),null}let V=L.slice(B+1,O),te=L[O+1]==="i"?"i":"";try{return new RegExp(V,te)}catch(re){if(G)throw new Error(`bad regexp-value '${L}', parse error: ${re}`);return console.warn(`bad regexp-value '${L}', parse error: ${re}`),null}}}function N(L,G){const B=L?L.substituteConstants():void 0,O=G?G.substituteConstants():void 0;return!B&&!O?!0:!B||!O?!1:B.equals(O)}function n(L,G){return L.cmp(G)}class P{constructor(){this.type=0}cmp(L){return this.type-L.type}equals(L){return L.type===this.type}substituteConstants(){return this}evaluate(L){return!1}serialize(){return"false"}keys(){return[]}negate(){return p.INSTANCE}}P.INSTANCE=new P;class p{constructor(){this.type=1}cmp(L){return this.type-L.type}equals(L){return L.type===this.type}substituteConstants(){return this}evaluate(L){return!0}serialize(){return"true"}keys(){return[]}negate(){return P.INSTANCE}}p.INSTANCE=new p;class m{constructor(L,G){this.key=L,this.negated=G,this.type=2}static create(L,G=null){const B=F.get(L);return typeof B=="boolean"?B?p.INSTANCE:P.INSTANCE:new m(L,G)}cmp(L){return L.type!==this.type?this.type-L.type:E(this.key,L.key)}equals(L){return L.type===this.type?this.key===L.key:!1}substituteConstants(){const L=F.get(this.key);return typeof L=="boolean"?L?p.INSTANCE:P.INSTANCE:this}evaluate(L){return!!L.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=r.create(this.key,this)),this.negated}}class d{constructor(L,G,B){this.key=L,this.value=G,this.negated=B,this.type=4}static create(L,G,B=null){if(typeof G=="boolean")return G?m.create(L,B):r.create(L,B);const O=F.get(L);if(typeof O=="boolean"){const V=O?"true":"false";return G===V?p.INSTANCE:P.INSTANCE}return new d(L,G,B)}cmp(L){return L.type!==this.type?this.type-L.type:_(this.key,this.value,L.key,L.value)}equals(L){return L.type===this.type?this.key===L.key&&this.value===L.value:!1}substituteConstants(){const L=F.get(this.key);if(typeof L=="boolean"){const G=L?"true":"false";return this.value===G?p.INSTANCE:P.INSTANCE}return this}evaluate(L){return L.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 u{constructor(L,G){this.key=L,this.valueKey=G,this.type=10,this.negated=null}static create(L,G){return new u(L,G)}cmp(L){return L.type!==this.type?this.type-L.type:_(this.key,this.valueKey,L.key,L.valueKey)}equals(L){return L.type===this.type?this.key===L.key&&this.valueKey===L.valueKey:!1}substituteConstants(){return this}evaluate(L){const G=L.getValue(this.valueKey),B=L.getValue(this.key);return Array.isArray(G)?G.indexOf(B)>=0:typeof B=="string"&&typeof G=="object"&&G!==null?I.call(G,B):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=o.create(this)),this.negated}}class o{constructor(L){this._actual=L,this.type=11}static create(L){return new o(L)}cmp(L){return L.type!==this.type?this.type-L.type:this._actual.cmp(L._actual)}equals(L){return L.type===this.type?this._actual.equals(L._actual):!1}substituteConstants(){return this}evaluate(L){return!this._actual.evaluate(L)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class h{constructor(L,G,B){this.key=L,this.value=G,this.negated=B,this.type=5}static create(L,G,B=null){if(typeof G=="boolean")return G?r.create(L,B):m.create(L,B);const O=F.get(L);if(typeof O=="boolean"){const V=O?"true":"false";return G===V?P.INSTANCE:p.INSTANCE}return new h(L,G,B)}cmp(L){return L.type!==this.type?this.type-L.type:_(this.key,this.value,L.key,L.value)}equals(L){return L.type===this.type?this.key===L.key&&this.value===L.value:!1}substituteConstants(){const L=F.get(this.key);if(typeof L=="boolean"){const G=L?"true":"false";return this.value===G?P.INSTANCE:p.INSTANCE}return this}evaluate(L){return L.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 r{constructor(L,G){this.key=L,this.negated=G,this.type=3}static create(L,G=null){const B=F.get(L);return typeof B=="boolean"?B?P.INSTANCE:p.INSTANCE:new r(L,G)}cmp(L){return L.type!==this.type?this.type-L.type:E(this.key,L.key)}equals(L){return L.type===this.type?this.key===L.key:!1}substituteConstants(){const L=F.get(this.key);return typeof L=="boolean"?L?P.INSTANCE:p.INSTANCE:this}evaluate(L){return!L.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this)),this.negated}}function a(L,G){if(typeof L=="string"){const B=parseFloat(L);isNaN(B)||(L=B)}return typeof L=="string"||typeof L=="number"?G(L):P.INSTANCE}class i{constructor(L,G,B){this.key=L,this.value=G,this.negated=B,this.type=12}static create(L,G,B=null){return a(G,O=>new i(L,O,B))}cmp(L){return L.type!==this.type?this.type-L.type:_(this.key,this.value,L.key,L.value)}equals(L){return L.type===this.type?this.key===L.key&&this.value===L.value:!1}substituteConstants(){return this}evaluate(L){return typeof this.value=="string"?!1:parseFloat(L.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=x.create(this.key,this.value,this)),this.negated}}class s{constructor(L,G,B){this.key=L,this.value=G,this.negated=B,this.type=13}static create(L,G,B=null){return a(G,O=>new s(L,O,B))}cmp(L){return L.type!==this.type?this.type-L.type:_(this.key,this.value,L.key,L.value)}equals(L){return L.type===this.type?this.key===L.key&&this.value===L.value:!1}substituteConstants(){return this}evaluate(L){return typeof this.value=="string"?!1:parseFloat(L.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=S.create(this.key,this.value,this)),this.negated}}class S{constructor(L,G,B){this.key=L,this.value=G,this.negated=B,this.type=14}static create(L,G,B=null){return a(G,O=>new S(L,O,B))}cmp(L){return L.type!==this.type?this.type-L.type:_(this.key,this.value,L.key,L.value)}equals(L){return L.type===this.type?this.key===L.key&&this.value===L.value:!1}substituteConstants(){return this}evaluate(L){return typeof this.value=="string"?!1:parseFloat(L.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this.value,this)),this.negated}}class x{constructor(L,G,B){this.key=L,this.value=G,this.negated=B,this.type=15}static create(L,G,B=null){return a(G,O=>new x(L,O,B))}cmp(L){return L.type!==this.type?this.type-L.type:_(this.key,this.value,L.key,L.value)}equals(L){return L.type===this.type?this.key===L.key&&this.value===L.value:!1}substituteConstants(){return this}evaluate(L){return typeof this.value=="string"?!1:parseFloat(L.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=i.create(this.key,this.value,this)),this.negated}}class T{constructor(L,G){this.key=L,this.regexp=G,this.type=7,this.negated=null}static create(L,G){return new T(L,G)}cmp(L){if(L.type!==this.type)return this.type-L.type;if(this.key<L.key)return-1;if(this.key>L.key)return 1;const G=this.regexp?this.regexp.source:"",B=L.regexp?L.regexp.source:"";return G<B?-1:G>B?1:0}equals(L){if(L.type===this.type){const G=this.regexp?this.regexp.source:"",B=L.regexp?L.regexp.source:"";return this.key===L.key&&G===B}return!1}substituteConstants(){return this}evaluate(L){let G=L.getValue(this.key);return this.regexp?this.regexp.test(G):!1}serialize(){const L=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${L}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=A.create(this)),this.negated}}class A{constructor(L){this._actual=L,this.type=8}static create(L){return new A(L)}cmp(L){return L.type!==this.type?this.type-L.type:this._actual.cmp(L._actual)}equals(L){return L.type===this.type?this._actual.equals(L._actual):!1}substituteConstants(){return this}evaluate(L){return!this._actual.evaluate(L)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function w(L){let G=null;for(let B=0,O=L.length;B<O;B++){const V=L[B].substituteConstants();if(L[B]!==V&&G===null){G=[];for(let te=0;te<B;te++)G[te]=L[te]}G!==null&&(G[B]=V)}return G===null?L:G}class v{constructor(L,G){this.expr=L,this.negated=G,this.type=6}static create(L,G){return v._normalizeArr(L,G)}cmp(L){if(L.type!==this.type)return this.type-L.type;if(this.expr.length<L.expr.length)return-1;if(this.expr.length>L.expr.length)return 1;for(let G=0,B=this.expr.length;G<B;G++){const O=n(this.expr[G],L.expr[G]);if(O!==0)return O}return 0}equals(L){if(L.type===this.type){if(this.expr.length!==L.expr.length)return!1;for(let G=0,B=this.expr.length;G<B;G++)if(!this.expr[G].equals(L.expr[G]))return!1;return!0}return!1}substituteConstants(){const L=w(this.expr);return L===this.expr?this:v.create(L,this.negated)}evaluate(L){for(let G=0,B=this.expr.length;G<B;G++)if(!this.expr[G].evaluate(L))return!1;return!0}static _normalizeArr(L,G){const B=[];let O=!1;for(const V of L){if(!V)continue;if(V.type===1){O=!0;continue}if(V.type===0)return P.INSTANCE;if(V.type===6){B.push(...V.expr);continue}B.push(V)}if(B.length===0&&O)return p.INSTANCE;if(B.length===0)return;if(B.length===1)return B[0];B.sort(n);for(let V=1;V<B.length;V++)B[V-1].equals(B[V])&&(B.splice(V,1),V--);if(B.length===1)return B[0];for(;B.length>1;){const V=B[B.length-1];if(V.type!==9)break;B.pop();const te=B.pop(),re=B.length===0,ge=b.create(V.expr.map(Ae=>v.create([Ae,te],null)),null,re);ge&&(B.push(ge),B.sort(n))}return B.length===1?B[0]:new v(B,G)}serialize(){return this.expr.map(L=>L.serialize()).join(" && ")}keys(){const L=[];for(let G of this.expr)L.push(...G.keys());return L}negate(){if(!this.negated){const L=[];for(let G of this.expr)L.push(G.negate());this.negated=b.create(L,this,!0)}return this.negated}}class b{constructor(L,G){this.expr=L,this.negated=G,this.type=9}static create(L,G,B){return b._normalizeArr(L,G,B)}cmp(L){if(L.type!==this.type)return this.type-L.type;if(this.expr.length<L.expr.length)return-1;if(this.expr.length>L.expr.length)return 1;for(let G=0,B=this.expr.length;G<B;G++){const O=n(this.expr[G],L.expr[G]);if(O!==0)return O}return 0}equals(L){if(L.type===this.type){if(this.expr.length!==L.expr.length)return!1;for(let G=0,B=this.expr.length;G<B;G++)if(!this.expr[G].equals(L.expr[G]))return!1;return!0}return!1}substituteConstants(){const L=w(this.expr);return L===this.expr?this:b.create(L,this.negated,!1)}evaluate(L){for(let G=0,B=this.expr.length;G<B;G++)if(this.expr[G].evaluate(L))return!0;return!1}static _normalizeArr(L,G,B){let O=[],V=!1;if(L){for(let te=0,re=L.length;te<re;te++){const ge=L[te];if(!ge)continue;if(ge.type===0){V=!0;continue}if(ge.type===1)return p.INSTANCE;if(ge.type===9){O=O.concat(ge.expr);continue}O.push(ge)}if(O.length===0&&V)return P.INSTANCE;O.sort(n)}if(O.length===0)return;if(O.length===1)return O[0];for(let te=1;te<O.length;te++)O[te-1].equals(O[te])&&(O.splice(te,1),te--);if(O.length===1)return O[0];if(B){for(let te=0;te<O.length;te++)for(let re=te+1;re<O.length;re++)U(O[te],O[re])&&(O.splice(re,1),re--);if(O.length===1)return O[0]}return new b(O,G)}serialize(){return this.expr.map(L=>L.serialize()).join(" || ")}keys(){const L=[];for(let G of this.expr)L.push(...G.keys());return L}negate(){if(!this.negated){let L=[];for(let G of this.expr)L.push(G.negate());for(;L.length>1;){const G=L.shift(),B=L.shift(),O=[];for(const te of j(G))for(const re of j(B))O.push(v.create([te,re],null));const V=L.length===0;L.unshift(b.create(O,null,V))}this.negated=L[0]}return this.negated}}class g extends m{constructor(L,G,B){super(L,null);this._defaultValue=G,typeof B=="object"?g._info.push(Object.assign(Object.assign({},B),{key:L})):B!==!0&&g._info.push({key:L,description:B,type:G!=null?typeof G:void 0})}static all(){return g._info.values()}bindTo(L){return L.createKey(this.key,this._defaultValue)}getValue(L){return L.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(L){return d.create(this.key,L)}}g._info=[];const f=Object(M.c)("contextKeyService"),C="setContext";function E(L,G){return L<G?-1:L>G?1:0}function _(L,G,B,O){return L<B?-1:L>B?1:G<O?-1:G>O?1:0}function U(L,G){if(G.type===6&&L.type!==9&&L.type!==6){for(const V of G.expr)if(L.equals(V))return!0}const B=L.negate(),O=j(B).concat(j(G));O.sort(n);for(let V=0;V<O.length;V++){const te=O[V],re=te.negate();for(let ge=V+1;ge<O.length;ge++){const Ae=O[ge];if(re.equals(Ae))return!0}}return!1}function j(L){return L.type===9?L.expr:[L]}},TXwP:function(Be,le,D){var Q,z;(function(){var M;(function(){"use strict";var F=[,,function(n){function P(d){this.__parent=d,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 d=new P(this.__parent);return d.set_indent(this.__indent_count,this.__alignment_count),d},P.prototype.item=function(d){return d<0?this.__items[this.__items.length+d]:this.__items[d]},P.prototype.has_match=function(d){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(d))return!0;return!1},P.prototype.set_indent=function(d,u){this.is_empty()&&(this.__indent_count=d||0,this.__alignment_count=u||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 d=this.__parent.current_line;return d.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),d.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),d.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,d.__items[0]===" "&&(d.__items.splice(0,1),d.__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(d){this.__items.push(d);var u=d.lastIndexOf(`
|
|
`);u!==-1?this.__character_count=d.length-u:this.__character_count+=d.length},P.prototype.pop=function(){var d=null;return this.is_empty()||(d=this.__items.pop(),this.__character_count-=d.length),d},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 d="";return this.is_empty()?this.__parent.indent_empty_lines&&(d=this.__parent.get_indent_string(this.__indent_count)):(d=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),d+=this.__items.join("")),d};function p(d,u){this.__cache=[""],this.__indent_size=d.indent_size,this.__indent_string=d.indent_char,d.indent_with_tabs||(this.__indent_string=new Array(d.indent_size+1).join(d.indent_char)),u=u||"",d.indent_level>0&&(u=new Array(d.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}p.prototype.get_indent_size=function(d,u){var o=this.__base_string_length;return u=u||0,d<0&&(o=0),o+=d*this.__indent_size,o+=u,o},p.prototype.get_indent_string=function(d,u){var o=this.__base_string;return u=u||0,d<0&&(d=0,o=""),u+=d*this.__indent_size,this.__ensure_cache(u),o+=this.__cache[u],o},p.prototype.__ensure_cache=function(d){for(;d>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var d=this.__cache.length,u=0,o="";this.__indent_size&&d>=this.__indent_size&&(u=Math.floor(d/this.__indent_size),d-=u*this.__indent_size,o=new Array(u+1).join(this.__indent_string)),d&&(o+=new Array(d+1).join(" ")),this.__cache.push(o)};function m(d,u){this.__indent_cache=new p(d,u),this.raw=!1,this._end_with_newline=d.end_with_newline,this.indent_size=d.indent_size,this.wrap_line_length=d.wrap_line_length,this.indent_empty_lines=d.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()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(d,u){return this.__indent_cache.get_indent_string(d,u)},m.prototype.get_indent_size=function(d,u){return this.__indent_cache.get_indent_size(d,u)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(d){return this.is_empty()||!d&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(d){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
|
|
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
|
|
`);return d!==`
|
|
`&&(o=o.replace(/[\n]/g,d)),o},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(d,u){return d=d||0,u=u||0,this.next_line.set_indent(d,u),this.__lines.length>1?(this.current_line.set_indent(d,u),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(d){for(var u=0;u<d.newlines;u++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(d.whitespace_before),this.current_line.push(d.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(d){this.__add_space_before_token(),this.current_line.push(d),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},m.prototype.remove_indent=function(d){for(var u=this.__lines.length;d<u;)this.__lines[d]._remove_indent(),d++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(d){for(d=d===void 0?!1:d,this.current_line.trim();d&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(d,u){for(var o=this.__lines.length-2;o>=0;){var h=this.__lines[o];if(h.is_empty())break;if(h.item(0).indexOf(d)!==0&&h.item(-1)!==u){this.__lines.splice(o+1,0,new P(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},n.exports.Output=m},,,,function(n){function P(d,u){this.raw_options=p(d,u),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(d,u){var o=this.raw_options[d],h=u||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(h=o.concat()):typeof o=="string"&&(h=o.split(/[^a-zA-Z0-9_\/\-]+/)),h},P.prototype._get_boolean=function(d,u){var o=this.raw_options[d],h=o===void 0?!!u:!!o;return h},P.prototype._get_characters=function(d,u){var o=this.raw_options[d],h=u||"";return typeof o=="string"&&(h=o.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),h},P.prototype._get_number=function(d,u){var o=this.raw_options[d];u=parseInt(u,10),isNaN(u)&&(u=0);var h=parseInt(o,10);return isNaN(h)&&(h=u),h},P.prototype._get_selection=function(d,u,o){var h=this._get_selection_list(d,u,o);if(h.length!==1)throw new Error("Invalid Option Value: The option '"+d+`' can only be one of the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[d]+"'");return h[0]},P.prototype._get_selection_list=function(d,u,o){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[u[0]],!this._is_valid_selection(o,u))throw new Error("Invalid Default Value!");var h=this._get_array(d,o);if(!this._is_valid_selection(h,u))throw new Error("Invalid Option Value: The option '"+d+`' can contain only the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[d]+"'");return h},P.prototype._is_valid_selection=function(d,u){return d.length&&u.length&&!d.some(function(o){return u.indexOf(o)===-1})};function p(d,u){var o={};d=m(d);var h;for(h in d)h!==u&&(o[h]=d[h]);if(u&&d[u])for(h in d[u])o[h]=d[u][h];return o}function m(d){var u={},o;for(o in d){var h=o.replace(/-/g,"_");u[h]=d[o]}return u}n.exports.Options=P,n.exports.normalizeOpts=m,n.exports.mergeOpts=p},,function(n){var P=RegExp.prototype.hasOwnProperty("sticky");function p(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position<this.__input_length},p.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},p.prototype.peek=function(m){var d=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(d=this.__input.charAt(m)),d},p.prototype.__match=function(m,d){m.lastIndex=d;var u=m.exec(this.__input);return u&&!(P&&m.sticky)&&(u.index!==d&&(u=null)),u},p.prototype.test=function(m,d){return d=d||0,d+=this.__position,d>=0&&d<this.__input_length?!!this.__match(m,d):!1},p.prototype.testChar=function(m,d){var u=this.peek(d);return m.lastIndex=0,u!==null&&m.test(u)},p.prototype.match=function(m){var d=this.__match(m,this.__position);return d?this.__position+=d[0].length:d=null,d},p.prototype.read=function(m,d,u){var o="",h;return m&&(h=this.match(m),h&&(o+=h[0])),d&&(h||!m)&&(o+=this.readUntil(d,u)),o},p.prototype.readUntil=function(m,d){var u="",o=this.__position;m.lastIndex=this.__position;var h=m.exec(this.__input);return h?(o=h.index,d&&(o+=h[0].length)):o=this.__input_length,u=this.__input.substring(this.__position,o),this.__position=o,u},p.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},p.prototype.get_regexp=function(m,d){var u=null,o="g";return d&&P&&(o="y"),typeof m=="string"&&m!==""?u=new RegExp(m,o):m&&(u=new RegExp(m.source,o)),u},p.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(m){var d=this.__position,u=this.readUntilAfter(m);return this.__position=d,u},p.prototype.lookBack=function(m){var d=this.__position-1;return d>=m.length&&this.__input.substring(d-m.length,d).toLowerCase()===m},n.exports.InputScanner=p},,,,,function(n){function P(p,m){p=typeof p=="string"?p:p.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+m,"g")}P.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var d=this.__directive_pattern.exec(p);d;)m[d[1]]=d[2],d=this.__directive_pattern.exec(p);return m},P.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=P},,function(n,P,p){var m=p(16).Beautifier,d=p(17).Options;function u(o,h){var r=new m(o,h);return r.beautify()}n.exports=u,n.exports.defaultOptions=function(){return new d}},function(n,P,p){var m=p(17).Options,d=p(2).Output,u=p(8).InputScanner,o=p(13).Directives,h=new o(/\/\*/,/\*\//),r=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,i=/\s/,s=/(?:\s|\n)+/g,S=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,x=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function T(A,w){this._source_text=A||"",this._options=new m(w),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"]}T.prototype.eatString=function(A){var w="";for(this._ch=this._input.next();this._ch;){if(w+=this._ch,this._ch==="\\")w+=this._input.next();else if(A.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return w},T.prototype.eatWhitespace=function(A){for(var w=i.test(this._input.peek()),v=0;i.test(this._input.peek());)this._ch=this._input.next(),A&&this._ch===`
|
|
`&&((v===0||v<this._options.max_preserve_newlines)&&(v++,this._output.add_new_line(!0)));return w},T.prototype.foundNestedPseudoClass=function(){for(var A=0,w=1,v=this._input.peek(w);v;){if(v==="{")return!0;if(v==="(")A+=1;else if(v===")"){if(A===0)return!1;A-=1}else if(v===";"||v==="}")return!1;w++,v=this._input.peek(w)}return!1},T.prototype.print_string=function(A){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(A)},T.prototype.preserveSingleSpace=function(A){A&&(this._output.space_before_token=!0)},T.prototype.indent=function(){this._indentLevel++},T.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},T.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var A=this._source_text,w=this._options.eol;w==="auto"&&(w=`
|
|
`,A&&r.test(A||"")&&(w=A.match(r)[0])),A=A.replace(a,`
|
|
`);var v=A.match(/^[\t ]*/)[0];this._output=new d(this._options,v),this._input=new u(A),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var b=0,g=!1,f=!1,C=!1,E=!1,_=!1,U=!1,j=this._ch,L=!1,G,B,O;G=this._input.read(s),B=G!=="",O=j,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),j=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var V=this._input.read(S),te=h.get_directives(V);te&&te.ignore==="start"&&(V+=h.readIgnored(this._input)),this.print_string(V),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(x)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(B),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var re=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);re.match(/[ :]$/)&&(re=this.eatString(": ").replace(/\s$/,""),this.print_string(re),this._output.space_before_token=!0),re=re.replace(/\s$/,""),re==="extend"?E=!0:re==="import"&&(_=!0),re in this.NESTED_AT_RULE?(this._nestedLevel+=1,re in this.CONDITIONAL_GROUP_RULE&&(C=!0)):!g&&b===0&&re.indexOf(":")!==-1&&(f=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(B),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")f&&(f=!1,this.outdent()),C?(C=!1,g=this._indentLevel>=this._nestedLevel):g=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&g&&(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)):(O==="("?this._output.space_before_token=!1:O!==","&&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(),O==="{"&&this._output.trim(!0),_=!1,E=!1,f&&(this.outdent(),f=!1),this.print_string(this._ch),g=!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 ge=0;ge<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;ge++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[ge])){L=!0;break}(g||C)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!E&&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 Ae=O==='"'||O==="'";this.preserveSingleSpace(Ae||B),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")L=!1,b===0?(f&&(this.outdent(),f=!1),E=!1,_=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),b++,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(")")),b&&(b--,this.outdent()));else{var Oe=!1;this._input.lookBack("with")&&(Oe=!0),this.preserveSingleSpace(B||Oe),this.print_string(this._ch),f&&O==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),U=!0):(this.eatWhitespace(),b++,this.indent())}else if(this._ch===")")b&&(b--,this.outdent()),U&&this._input.peek()===";"&&this._options.selector_separator_newline&&(U=!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||U)&&b===0&&!_&&!E?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!f&&b===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&&i.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(B),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),i.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 Ce=O==='"'||O==="'";this.preserveSingleSpace(Ce||B),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&L&&this._output.add_new_line()}var je=this._output.get_code(w);return je},n.exports.Beautifier=T},function(n,P,p){var m=p(6).Options;function d(u){m.call(this,u,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var o=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||o;var h=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var r=0;r<h.length;r++)h[r]!=="expand"?this.brace_style="collapse":this.brace_style=h[r]}d.prototype=new m,n.exports.Options=d}],I={};function H(n){var P=I[n];if(P!==void 0)return P.exports;var p=I[n]={exports:{}};return F[n](p,p.exports,H),p.exports}var N=H(15);M=N})();var X=M;!(Q=[],z=function(){return{css_beautify:X}}.apply(le,Q),z!==void 0&&(Be.exports=z))})()},TcMa:function(Be,le,D){Be.exports={desc:"desc___qlRMF",info:"info___JEaKq","commit-info":"commit-info___3-4e0"}},UZu5:function(Be,le,D){},VEzc:function(Be,le,D){Be.exports={flex_box_center:"flex_box_center___z2AYj",flex_space_between:"flex_space_between___2PZH7",flex_box_vertical_center:"flex_box_vertical_center___3Vw8I",flex_box_center_end:"flex_box_center_end___1dJQf",flex_box_column:"flex_box_column___kstqC",wrap:"wrap___wWYG3",head:"head___1xABk",title:"title___yYb50",content:"content___fzoVv",list:"list___2q90P",footer:"footer___3zT-e"}},Vhoy:function(Be,le,D){"use strict";D.d(le,"d",function(){return X}),D.d(le,"e",function(){return F}),D.d(le,"c",function(){return I}),D.d(le,"b",function(){return H}),D.d(le,"a",function(){return N});var Q=D("MI8n");class z{constructor(){this._icons=new Map,this._onDidRegister=new Q.b}add(n){const P=this._icons.get(n.id);P?n.description?P.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 M=new z,X=M;function F(n,P){return new H(n,P)}function I(n){return n?n.replace(/\$\((.*?)\)/g,(P,p)=>` ${p} `).trim():""}class H{constructor(n,P,p){this.id=n,this.definition=P,this.description=p,M.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var N;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9\\-]+",n.iconModifierExpression="~[A-Za-z]+";const P=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function p(u){if(u instanceof H)return["codicon","codicon-"+u.id];const o=P.exec(u.id);if(!o)return p(H.error);let[,h,r]=o;const a=["codicon","codicon-"+h];return r&&a.push("codicon-modifier-"+r.substr(1)),a}n.asClassNameArray=p;function m(u){return p(u).join(" ")}n.asClassName=m;function d(u){return"."+p(u).join(".")}n.asCSSSelector=d})(N||(N={})),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"})}(H||(H={}))},"VrN/":function(Be,le,D){(function(Q,z){Be.exports=z()})(this,function(){"use strict";var Q=navigator.userAgent,z=navigator.platform,M=/gecko\/\d/i.test(Q),X=/MSIE \d/.test(Q),F=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Q),I=/Edge\/(\d+)/.exec(Q),H=X||F||I,N=H&&(X?document.documentMode||6:+(I||F)[1]),n=!I&&/WebKit\//.test(Q),P=n&&/Qt\/\d+\.\d+/.test(Q),p=!I&&/Chrome\//.test(Q),m=/Opera\//.test(Q),d=/Apple Computer/.test(navigator.vendor),u=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Q),o=/PhantomJS/.test(Q),h=!I&&/AppleWebKit/.test(Q)&&/Mobile\/\w+/.test(Q),r=/Android/.test(Q),a=h||r||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Q),i=h||/Mac/.test(z),s=/\bCrOS\b/.test(Q),S=/win/i.test(z),x=m&&Q.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(m=!1,n=!0);var T=i&&(P||m&&(x==null||x<12.11)),A=M||H&&N>=9;function w(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var v=function(e,t){var c=e.className,l=w(t).exec(c);if(l){var y=c.slice(l.index+l[0].length);e.className=c.slice(0,l.index)+(y?l[1]+y:"")}};function b(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function g(e,t){return b(e).appendChild(t)}function f(e,t,c,l){var y=document.createElement(e);if(c&&(y.className=c),l&&(y.style.cssText=l),typeof t=="string")y.appendChild(document.createTextNode(t));else if(t)for(var K=0;K<t.length;++K)y.appendChild(t[K]);return y}function C(e,t,c,l){var y=f(e,t,c,l);return y.setAttribute("role","presentation"),y}var E;document.createRange?E=function(e,t,c,l){var y=document.createRange();return y.setEnd(l||e,c),y.setStart(e,t),y}:E=function(e,t,c){var l=document.body.createTextRange();try{l.moveToElementText(e.parentNode)}catch(y){return l}return l.collapse(!0),l.moveEnd("character",c),l.moveStart("character",t),l};function _(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function U(){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 j(e,t){var c=e.className;w(t).test(c)||(e.className+=(c?" ":"")+t)}function L(e,t){for(var c=e.split(" "),l=0;l<c.length;l++)c[l]&&!w(c[l]).test(t)&&(t+=" "+c[l]);return t}var G=function(e){e.select()};h?G=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:H&&(G=function(e){try{e.select()}catch(t){}});function B(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function O(e,t,c){t||(t={});for(var l in e)e.hasOwnProperty(l)&&(c!==!1||!t.hasOwnProperty(l))&&(t[l]=e[l]);return t}function V(e,t,c,l,y){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var K=l||0,ee=y||0;;){var ie=e.indexOf(" ",K);if(ie<0||ie>=t)return ee+(t-K);ee+=ie-K,ee+=c-ee%c,K=ie+1}}var te=function(){this.id=null,this.f=null,this.time=0,this.handler=B(this.onTimeout,this)};te.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},te.prototype.set=function(e,t){this.f=t;var c=+new Date+e;(!this.id||c<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=c)};function re(e,t){for(var c=0;c<e.length;++c)if(e[c]==t)return c;return-1}var ge=50,Ae={toString:function(){return"CodeMirror.Pass"}},Oe={scroll:!1},Ce={origin:"*mouse"},je={origin:"+move"};function Ue(e,t,c){for(var l=0,y=0;;){var K=e.indexOf(" ",l);K==-1&&(K=e.length);var ee=K-l;if(K==e.length||y+ee>=t)return l+Math.min(ee,t-y);if(y+=K-l,y+=c-y%c,l=K+1,y>=t)return l}}var xe=[""];function be(e){for(;xe.length<=e;)xe.push(Ve(xe)+" ");return xe[e]}function Ve(e){return e[e.length-1]}function mt(e,t){for(var c=[],l=0;l<e.length;l++)c[l]=t(e[l],l);return c}function yt(e,t,c){for(var l=0,y=c(t);l<e.length&&c(e[l])<=y;)l++;e.splice(l,0,t)}function _t(){}function xt(e,t){var c;return Object.create?c=Object.create(e):(_t.prototype=e,c=new _t),t&&O(t,c),c}var nt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ct(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||nt.test(e))}function wt(e,t){return t?t.source.indexOf("\\w")>-1&&ct(e)?!0:t.test(e):ct(e)}function _e(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Me=/[\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 ve(e){return e.charCodeAt(0)>=768&&Me.test(e)}function Te(e,t,c){for(;(c<0?t>0:t<e.length)&&ve(e.charAt(t));)t+=c;return t}function We(e,t,c){for(var l=t>c?-1:1;;){if(t==c)return t;var y=(t+c)/2,K=l<0?Math.ceil(y):Math.floor(y);if(K==t)return e(K)?t:c;e(K)?c=K:t=K+l}}function Je(e,t,c,l){if(!e)return l(t,c,"ltr",0);for(var y=!1,K=0;K<e.length;++K){var ee=e[K];(ee.from<c&&ee.to>t||t==c&&ee.to==t)&&(l(Math.max(ee.from,t),Math.min(ee.to,c),ee.level==1?"rtl":"ltr",K),y=!0)}y||l(t,c,"ltr")}var at=null;function dt(e,t,c){var l;at=null;for(var y=0;y<e.length;++y){var K=e[y];if(K.from<t&&K.to>t)return y;K.to==t&&(K.from!=K.to&&c=="before"?l=y:at=y),K.from==t&&(K.from!=K.to&&c!="before"?l=y:at=y)}return l!=null?l:at}var Lt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function c(ce){return ce<=247?e.charAt(ce):1424<=ce&&ce<=1524?"R":1536<=ce&&ce<=1785?t.charAt(ce-1536):1774<=ce&&ce<=2220?"r":8192<=ce&&ce<=8203?"w":ce==8204?"b":"L"}var l=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,y=/[stwN]/,K=/[LRr]/,ee=/[Lb1n]/,ie=/[1n]/;function oe(ce,De,Fe){this.level=ce,this.from=De,this.to=Fe}return function(ce,De){var Fe=De=="ltr"?"L":"R";if(ce.length==0||De=="ltr"&&!l.test(ce))return!1;for(var tt=ce.length,Qe=[],St=0;St<tt;++St)Qe.push(c(ce.charCodeAt(St)));for(var Ft=0,Kt=Fe;Ft<tt;++Ft){var Qt=Qe[Ft];Qt=="m"?Qe[Ft]=Kt:Kt=Qt}for(var rn=0,Zt=Fe;rn<tt;++rn){var cn=Qe[rn];cn=="1"&&Zt=="r"?Qe[rn]="n":K.test(cn)&&(Zt=cn,cn=="r"&&(Qe[rn]="R"))}for(var An=1,En=Qe[0];An<tt-1;++An){var Jn=Qe[An];Jn=="+"&&En=="1"&&Qe[An+1]=="1"?Qe[An]="1":Jn==","&&En==Qe[An+1]&&(En=="1"||En=="n")&&(Qe[An]=En),En=Jn}for(var wi=0;wi<tt;++wi){var nr=Qe[wi];if(nr==",")Qe[wi]="N";else if(nr=="%"){var ki=void 0;for(ki=wi+1;ki<tt&&Qe[ki]=="%";++ki);for(var Mr=wi&&Qe[wi-1]=="!"||ki<tt&&Qe[ki]=="1"?"1":"N",Er=wi;Er<ki;++Er)Qe[Er]=Mr;wi=ki-1}}for(var Gi=0,xr=Fe;Gi<tt;++Gi){var or=Qe[Gi];xr=="L"&&or=="1"?Qe[Gi]="L":K.test(or)&&(xr=or)}for(var Qi=0;Qi<tt;++Qi)if(y.test(Qe[Qi])){var zi=void 0;for(zi=Qi+1;zi<tt&&y.test(Qe[zi]);++zi);for(var Fi=(Qi?Qe[Qi-1]:Fe)=="L",Sr=(zi<tt?Qe[zi]:Fe)=="L",La=Fi==Sr?Fi?"L":"R":Fe,ua=Qi;ua<zi;++ua)Qe[ua]=La;Qi=zi-1}for(var cr=[],Jr,ir=0;ir<tt;)if(ee.test(Qe[ir])){var Fs=ir;for(++ir;ir<tt&&ee.test(Qe[ir]);++ir);cr.push(new oe(0,Fs,ir))}else{var ea=ir,ma=cr.length,ga=De=="rtl"?1:0;for(++ir;ir<tt&&Qe[ir]!="L";++ir);for(var mr=ea;mr<ir;)if(ie.test(Qe[mr])){ea<mr&&(cr.splice(ma,0,new oe(1,ea,mr)),ma+=ga);var Ia=mr;for(++mr;mr<ir&&ie.test(Qe[mr]);++mr);cr.splice(ma,0,new oe(2,Ia,mr)),ma+=ga,ea=mr}else++mr;ea<ir&&cr.splice(ma,0,new oe(1,ea,ir))}return De=="ltr"&&(cr[0].level==1&&(Jr=ce.match(/^\s+/))&&(cr[0].from=Jr[0].length,cr.unshift(new oe(0,0,Jr[0].length))),Ve(cr).level==1&&(Jr=ce.match(/\s+$/))&&(Ve(cr).to-=Jr[0].length,cr.push(new oe(0,tt-Jr[0].length,tt)))),De=="rtl"?cr.reverse():cr}}();function It(e,t){var c=e.order;return c==null&&(c=e.order=Lt(e.text,t)),c}var Ne=[],ke=function(e,t,c){if(e.addEventListener)e.addEventListener(t,c,!1);else if(e.attachEvent)e.attachEvent("on"+t,c);else{var l=e._handlers||(e._handlers={});l[t]=(l[t]||Ne).concat(c)}};function it(e,t){return e._handlers&&e._handlers[t]||Ne}function ot(e,t,c){if(e.removeEventListener)e.removeEventListener(t,c,!1);else if(e.detachEvent)e.detachEvent("on"+t,c);else{var l=e._handlers,y=l&&l[t];if(y){var K=re(y,c);K>-1&&(l[t]=y.slice(0,K).concat(y.slice(K+1)))}}}function Ge(e,t){var c=it(e,t);if(!c.length)return;for(var l=Array.prototype.slice.call(arguments,2),y=0;y<c.length;++y)c[y].apply(null,l)}function $e(e,t,c){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ge(e,c||t.type,e,t),ye(t)||t.codemirrorIgnore}function we(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var c=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),l=0;l<t.length;++l)re(c,t[l])==-1&&c.push(t[l])}function Se(e,t){return it(e,t).length>0}function Ee(e){e.prototype.on=function(t,c){ke(this,t,c)},e.prototype.off=function(t,c){ot(this,t,c)}}function ue(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function de(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ye(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function me(e){ue(e),de(e)}function Le(e){return e.target||e.srcElement}function Xe(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),i&&e.ctrlKey&&t==1&&(t=3),t}var ut=function(){if(H&&N<9)return!1;var e=f("div");return"draggable"in e||"dragDrop"in e}(),Dt;function jt(e){if(Dt==null){var t=f("span","\u200B");g(e,f("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Dt=t.offsetWidth<=1&&t.offsetHeight>2&&!(H&&N<8))}var c=Dt?f("span","\u200B"):f("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return c.setAttribute("cm-text",""),c}var Ut;function Ct(e){if(Ut!=null)return Ut;var t=g(e,document.createTextNode("A\u062EA")),c=E(t,0,1).getBoundingClientRect(),l=E(t,1,2).getBoundingClientRect();return b(e),!c||c.left==c.right?!1:Ut=l.right-c.right<3}var et=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,c=[],l=e.length;t<=l;){var y=e.indexOf(`
|
|
`,t);y==-1&&(y=e.length);var K=e.slice(t,e.charAt(y-1)=="\r"?y-1:y),ee=K.indexOf("\r");ee!=-1?(c.push(K.slice(0,ee)),t+=ee+1):(c.push(K),t=y+1)}return c}:function(e){return e.split(/\r\n?|\n/)},st=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(c){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},He=function(){var e=f("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),pe=null;function Re(e){if(pe!=null)return pe;var t=g(e,f("span","x")),c=t.getBoundingClientRect(),l=E(t,0,1).getBoundingClientRect();return pe=Math.abs(c.left-l.left)>1}var lt={},Ye={};function Pt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),lt[e]=t}function Nt(e,t){Ye[e]=t}function Ke(e){if(typeof e=="string"&&Ye.hasOwnProperty(e))e=Ye[e];else if(e&&typeof e.name=="string"&&Ye.hasOwnProperty(e.name)){var t=Ye[e.name];typeof t=="string"&&(t={name:t}),e=xt(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ke("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ke("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function gt(e,t){t=Ke(t);var c=lt[t.name];if(!c)return gt(e,"text/plain");var l=c(e,t);if(bt.hasOwnProperty(t.name)){var y=bt[t.name];for(var K in y){if(!y.hasOwnProperty(K))continue;l.hasOwnProperty(K)&&(l["_"+K]=l[K]),l[K]=y[K]}}if(l.name=t.name,t.helperType&&(l.helperType=t.helperType),t.modeProps)for(var ee in t.modeProps)l[ee]=t.modeProps[ee];return l}var bt={};function Tt(e,t){var c=bt.hasOwnProperty(e)?bt[e]:bt[e]={};O(t,c)}function Wt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var c={};for(var l in t){var y=t[l];y instanceof Array&&(y=y.concat([])),c[l]=y}return c}function fe(e,t){for(var c;e.innerMode&&!(c=e.innerMode(t),!c||c.mode==e);)t=c.state,e=c.mode;return c||{mode:e,state:t}}function se(e,t,c){return e.startState?e.startState(t,c):!0}var W=function(e,t,c){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=c};W.prototype.eol=function(){return this.pos>=this.string.length},W.prototype.sol=function(){return this.pos==this.lineStart},W.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},W.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},W.prototype.eat=function(e){var t=this.string.charAt(this.pos),c;if(typeof e=="string"?c=t==e:c=t&&(e.test?e.test(t):e(t)),c)return++this.pos,t},W.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},W.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},W.prototype.skipToEnd=function(){this.pos=this.string.length},W.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},W.prototype.backUp=function(e){this.pos-=e},W.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=V(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?V(this.string,this.lineStart,this.tabSize):0)},W.prototype.indentation=function(){return V(this.string,null,this.tabSize)-(this.lineStart?V(this.string,this.lineStart,this.tabSize):0)},W.prototype.match=function(e,t,c){if(typeof e=="string"){var l=function(ee){return c?ee.toLowerCase():ee},y=this.string.substr(this.pos,e.length);if(l(y)==l(e))return t!==!1&&(this.pos+=e.length),!0}else{var K=this.string.slice(this.pos).match(e);return K&&K.index>0?null:(K&&t!==!1&&(this.pos+=K[0].length),K)}},W.prototype.current=function(){return this.string.slice(this.start,this.pos)},W.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},W.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},W.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function $(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 c=e;!c.lines;)for(var l=0;;++l){var y=c.children[l],K=y.chunkSize();if(t<K){c=y;break}t-=K}return c.lines[t]}function Z(e,t,c){var l=[],y=t.line;return e.iter(t.line,c.line+1,function(K){var ee=K.text;y==c.line&&(ee=ee.slice(0,c.ch)),y==t.line&&(ee=ee.slice(t.ch)),l.push(ee),++y}),l}function ne(e,t,c){var l=[];return e.iter(t,c,function(y){l.push(y.text)}),l}function he(e,t){var c=t-e.height;if(c)for(var l=e;l;l=l.parent)l.height+=c}function Pe(e){if(e.parent==null)return null;for(var t=e.parent,c=re(t.lines,e),l=t.parent;l;t=l,l=l.parent)for(var y=0;!(l.children[y]==t);++y)c+=l.children[y].chunkSize();return c+t.first}function ze(e,t){var c=e.first;e:do{for(var l=0;l<e.children.length;++l){var y=e.children[l],K=y.height;if(t<K){e=y;continue e}t-=K,c+=y.chunkSize()}return c}while(!e.lines);for(var ee=0;ee<e.lines.length;++ee){var ie=e.lines[ee],oe=ie.height;if(t<oe)break;t-=oe}return c+ee}function Rt(e,t){return t>=e.first&&t<e.first+e.size}function Mt(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Ze(e,t,c){if(c===void 0&&(c=null),!(this instanceof Ze))return new Ze(e,t,c);this.line=e,this.ch=t,this.sticky=c}function kt(e,t){return e.line-t.line||e.ch-t.ch}function an(e,t){return e.sticky==t.sticky&&kt(e,t)==0}function At(e){return Ze(e.line,e.ch)}function pn(e,t){return kt(e,t)<0?t:e}function nn(e,t){return kt(e,t)<0?e:t}function J(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function R(e,t){if(t.line<e.first)return Ze(e.first,0);var c=e.first+e.size-1;return t.line>c?Ze(c,$(e,c).text.length):k(t,$(e,t.line).text.length)}function k(e,t){var c=e.ch;return c==null||c>t?Ze(e.line,t):c<0?Ze(e.line,0):e}function Y(e,t){for(var c=[],l=0;l<t.length;l++)c[l]=R(e,t[l]);return c}var ae=function(e,t){this.state=e,this.lookAhead=t},q=function(e,t,c,l){this.state=t,this.doc=e,this.line=c,this.maxLookAhead=l||0,this.baseTokens=null,this.baseTokenPos=1};q.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},q.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}},q.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},q.fromSaved=function(e,t,c){return t instanceof ae?new q(e,Wt(e.mode,t.state),c,t.lookAhead):new q(e,Wt(e.mode,t),c)},q.prototype.save=function(e){var t=e!==!1?Wt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ae(t,this.maxLookAhead):t};function Ie(e,t,c,l){var y=[e.state.modeGen],K={};hi(e,t.text,e.doc.mode,c,function(ce,De){return y.push(ce,De)},K,l);for(var ee=c.state,ie=function(ce){c.baseTokens=y;var De=e.state.overlays[ce],Fe=1,tt=0;c.state=!0,hi(e,t.text,De.mode,c,function(Qe,St){for(var Ft=Fe;tt<Qe;){var Kt=y[Fe];Kt>Qe&&y.splice(Fe,1,Qe,y[Fe+1],Kt),Fe+=2,tt=Math.min(Qe,Kt)}if(!St)return;if(De.opaque)y.splice(Ft,Fe-Ft,Qe,"overlay "+St),Fe=Ft+2;else for(;Ft<Fe;Ft+=2){var Qt=y[Ft+1];y[Ft+1]=(Qt?Qt+" ":"")+"overlay "+St}},K),c.state=ee,c.baseTokens=null,c.baseTokenPos=1},oe=0;oe<e.state.overlays.length;++oe)ie(oe);return{styles:y,classes:K.bgClass||K.textClass?K:null}}function ht(e,t,c){if(!t.styles||t.styles[0]!=e.state.modeGen){var l=Ot(e,Pe(t)),y=t.text.length>e.options.maxHighlightLength&&Wt(e.doc.mode,l.state),K=Ie(e,t,l);y&&(l.state=y),t.stateAfter=l.save(!y),t.styles=K.styles,K.classes?t.styleClasses=K.classes:t.styleClasses&&(t.styleClasses=null),c===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Ot(e,t,c){var l=e.doc,y=e.display;if(!l.mode.startState)return new q(l,!0,t);var K=Fn(e,t,c),ee=K>l.first&&$(l,K-1).stateAfter,ie=ee?q.fromSaved(l,ee,K):new q(l,se(l.mode),K);return l.iter(K,t,function(oe){$t(e,oe.text,ie);var ce=ie.line;oe.stateAfter=ce==t-1||ce%5==0||ce>=y.viewFrom&&ce<y.viewTo?ie.save():null,ie.nextLine()}),c&&(l.modeFrontier=ie.line),ie}function $t(e,t,c,l){var y=e.doc.mode,K=new W(t,e.options.tabSize,c);for(K.start=K.pos=l||0,t==""&&ft(y,c.state);!K.eol();)zt(y,K,c.state),K.start=K.pos}function ft(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var c=fe(e,t);if(c.mode.blankLine)return c.mode.blankLine(c.state)}function zt(e,t,c,l){for(var y=0;y<10;y++){l&&(l[0]=fe(e,c).mode);var K=e.token(t,c);if(t.pos>t.start)return K}throw new Error("Mode "+e.name+" failed to advance stream.")}var on=function(e,t,c){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=c};function Wn(e,t,c,l){var y=e.doc,K=y.mode,ee;t=R(y,t);var ie=$(y,t.line),oe=Ot(e,t.line,c),ce=new W(ie.text,e.options.tabSize,oe),De;for(l&&(De=[]);(l||ce.pos<t.ch)&&!ce.eol();)ce.start=ce.pos,ee=zt(K,ce,oe.state),l&&De.push(new on(ce,ee,Wt(y.mode,oe.state)));return l?De:new on(ce,ee,oe.state)}function Si(e,t){if(e)for(;;){var c=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!c)break;e=e.slice(0,c.index)+e.slice(c.index+c[0].length);var l=c[1]?"bgClass":"textClass";t[l]==null?t[l]=c[2]:new RegExp("(?:^|\\s)"+c[2]+"(?:$|\\s)").test(t[l])||(t[l]+=" "+c[2])}return e}function hi(e,t,c,l,y,K,ee){var ie=c.flattenSpans;ie==null&&(ie=e.options.flattenSpans);var oe=0,ce=null,De=new W(t,e.options.tabSize,l),Fe,tt=e.options.addModeClass&&[null];for(t==""&&Si(ft(c,l.state),K);!De.eol();){if(De.pos>e.options.maxHighlightLength?(ie=!1,ee&&$t(e,t,l,De.pos),De.pos=t.length,Fe=null):Fe=Si(zt(c,De,l.state,tt),K),tt){var Qe=tt[0].name;Qe&&(Fe="m-"+(Fe?Qe+" "+Fe:Qe))}if(!ie||ce!=Fe){for(;oe<De.start;)oe=Math.min(De.start,oe+5e3),y(oe,ce);ce=Fe}De.start=De.pos}for(;oe<De.pos;){var St=Math.min(De.pos,oe+5e3);y(St,ce),oe=St}}function Fn(e,t,c){for(var l,y,K=e.doc,ee=c?-1:t-(e.doc.mode.innerMode?1e3:100),ie=t;ie>ee;--ie){if(ie<=K.first)return K.first;var oe=$(K,ie-1),ce=oe.stateAfter;if(ce&&(!c||ie+(ce instanceof ae?ce.lookAhead:0)<=K.modeFrontier))return ie;var De=V(oe.text,null,e.options.tabSize);(y==null||l>De)&&(y=ie-1,l=De)}return y}function ci(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var c=e.first,l=t-1;l>c;l--){var y=$(e,l).stateAfter;if(y&&(!(y instanceof ae)||l+y.lookAhead<t)){c=l+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,c)}var Zi=!1,yi=!1;function ri(){Zi=!0}function Ci(){yi=!0}function Di(e,t,c){this.marker=e,this.from=t,this.to=c}function Oi(e,t){if(e)for(var c=0;c<e.length;++c){var l=e[c];if(l.marker==t)return l}}function Ri(e,t){for(var c,l=0;l<e.length;++l)e[l]!=t&&(c||(c=[])).push(e[l]);return c}function Vi(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function dr(e,t,c){var l;if(e)for(var y=0;y<e.length;++y){var K=e[y],ee=K.marker,ie=K.from==null||(ee.inclusiveLeft?K.from<=t:K.from<t);if(ie||K.from==t&&ee.type=="bookmark"&&(!c||!K.marker.insertLeft)){var oe=K.to==null||(ee.inclusiveRight?K.to>=t:K.to>t);(l||(l=[])).push(new Di(ee,K.from,oe?null:K.to))}}return l}function rr(e,t,c){var l;if(e)for(var y=0;y<e.length;++y){var K=e[y],ee=K.marker,ie=K.to==null||(ee.inclusiveRight?K.to>=t:K.to>t);if(ie||K.from==t&&ee.type=="bookmark"&&(!c||K.marker.insertLeft)){var oe=K.from==null||(ee.inclusiveLeft?K.from<=t:K.from<t);(l||(l=[])).push(new Di(ee,oe?null:K.from-t,K.to==null?null:K.to-t))}}return l}function ji(e,t){if(t.full)return null;var c=Rt(e,t.from.line)&&$(e,t.from.line).markedSpans,l=Rt(e,t.to.line)&&$(e,t.to.line).markedSpans;if(!c&&!l)return null;var y=t.from.ch,K=t.to.ch,ee=kt(t.from,t.to)==0,ie=dr(c,y,ee),oe=rr(l,K,ee),ce=t.text.length==1,De=Ve(t.text).length+(ce?y:0);if(ie)for(var Fe=0;Fe<ie.length;++Fe){var tt=ie[Fe];if(tt.to==null){var Qe=Oi(oe,tt.marker);Qe?ce&&(tt.to=Qe.to==null?null:Qe.to+De):tt.to=y}}if(oe)for(var St=0;St<oe.length;++St){var Ft=oe[St];if(Ft.to!=null&&(Ft.to+=De),Ft.from==null){var Kt=Oi(ie,Ft.marker);Kt||(Ft.from=De,ce&&(ie||(ie=[])).push(Ft))}else Ft.from+=De,ce&&(ie||(ie=[])).push(Ft)}ie&&(ie=Wi(ie)),oe&&oe!=ie&&(oe=Wi(oe));var Qt=[ie];if(!ce){var rn=t.text.length-2,Zt;if(rn>0&&ie)for(var cn=0;cn<ie.length;++cn)ie[cn].to==null&&(Zt||(Zt=[])).push(new Di(ie[cn].marker,null,null));for(var An=0;An<rn;++An)Qt.push(Zt);Qt.push(oe)}return Qt}function Wi(e){for(var t=0;t<e.length;++t){var c=e[t];c.from!=null&&c.from==c.to&&c.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function hr(e,t,c){var l=null;if(e.iter(t.line,c.line+1,function(Qe){if(Qe.markedSpans)for(var St=0;St<Qe.markedSpans.length;++St){var Ft=Qe.markedSpans[St].marker;Ft.readOnly&&(!l||re(l,Ft)==-1)&&(l||(l=[])).push(Ft)}}),!l)return null;for(var y=[{from:t,to:c}],K=0;K<l.length;++K)for(var ee=l[K],ie=ee.find(0),oe=0;oe<y.length;++oe){var ce=y[oe];if(kt(ce.to,ie.from)<0||kt(ce.from,ie.to)>0)continue;var De=[oe,1],Fe=kt(ce.from,ie.from),tt=kt(ce.to,ie.to);(Fe<0||!ee.inclusiveLeft&&!Fe)&&De.push({from:ce.from,to:ie.from}),(tt>0||!ee.inclusiveRight&&!tt)&&De.push({from:ie.to,to:ce.to}),y.splice.apply(y,De),oe+=De.length-3}return y}function Tr(e){var t=e.markedSpans;if(!t)return;for(var c=0;c<t.length;++c)t[c].marker.detachLine(e);e.markedSpans=null}function ar(e,t){if(!t)return;for(var c=0;c<t.length;++c)t[c].marker.attachLine(e);e.markedSpans=t}function Hn(e){return e.inclusiveLeft?-1:0}function wn(e){return e.inclusiveRight?1:0}function _i(e,t){var c=e.lines.length-t.lines.length;if(c!=0)return c;var l=e.find(),y=t.find(),K=kt(l.from,y.from)||Hn(e)-Hn(t);if(K)return-K;var ee=kt(l.to,y.to)||wn(e)-wn(t);return ee||t.id-e.id}function Nn(e,t){var c=yi&&e.markedSpans,l;if(c)for(var y=void 0,K=0;K<c.length;++K)y=c[K],y.marker.collapsed&&(t?y.from:y.to)==null&&(!l||_i(l,y.marker)<0)&&(l=y.marker);return l}function Ti(e){return Nn(e,!0)}function ii(e){return Nn(e,!1)}function wr(e,t){var c=yi&&e.markedSpans,l;if(c)for(var y=0;y<c.length;++y){var K=c[y];K.marker.collapsed&&(K.from==null||K.from<t)&&(K.to==null||K.to>t)&&(!l||_i(l,K.marker)<0)&&(l=K.marker)}return l}function Ni(e,t,c,l,y){var K=$(e,t),ee=yi&&K.markedSpans;if(ee)for(var ie=0;ie<ee.length;++ie){var oe=ee[ie];if(!oe.marker.collapsed)continue;var ce=oe.marker.find(0),De=kt(ce.from,c)||Hn(oe.marker)-Hn(y),Fe=kt(ce.to,l)||wn(oe.marker)-wn(y);if(De>=0&&Fe<=0||De<=0&&Fe>=0)continue;if(De<=0&&(oe.marker.inclusiveRight&&y.inclusiveLeft?kt(ce.to,c)>=0:kt(ce.to,c)>0)||De>=0&&(oe.marker.inclusiveRight&&y.inclusiveLeft?kt(ce.from,l)<=0:kt(ce.from,l)<0))return!0}}function Xi(e){for(var t;t=Ti(e);)e=t.find(-1,!0).line;return e}function lr(e){for(var t;t=ii(e);)e=t.find(1,!0).line;return e}function gr(e){for(var t,c;t=ii(e);)e=t.find(1,!0).line,(c||(c=[])).push(e);return c}function Hr(e,t){var c=$(e,t),l=Xi(c);return c==l?t:Pe(l)}function kr(e,t){if(t>e.lastLine())return t;var c=$(e,t),l;if(!Cr(e,c))return t;for(;l=ii(c);)c=l.find(1,!0).line;return Pe(c)+1}function Cr(e,t){var c=yi&&t.markedSpans;if(c)for(var l=void 0,y=0;y<c.length;++y){if(l=c[y],!l.marker.collapsed)continue;if(l.from==null)return!0;if(l.marker.widgetNode)continue;if(l.from==0&&l.marker.inclusiveLeft&&Xr(e,t,l))return!0}}function Xr(e,t,c){if(c.to==null){var l=c.marker.find(1,!0);return Xr(e,l.line,Oi(l.line.markedSpans,c.marker))}if(c.marker.inclusiveRight&&c.to==t.text.length)return!0;for(var y=void 0,K=0;K<t.markedSpans.length;++K)if(y=t.markedSpans[K],y.marker.collapsed&&!y.marker.widgetNode&&y.from==c.to&&(y.to==null||y.to!=c.from)&&(y.marker.inclusiveLeft||c.marker.inclusiveRight)&&Xr(e,t,y))return!0}function vr(e){e=Xi(e);for(var t=0,c=e.parent,l=0;l<c.lines.length;++l){var y=c.lines[l];if(y==e)break;t+=y.height}for(var K=c.parent;K;c=K,K=c.parent)for(var ee=0;ee<K.children.length;++ee){var ie=K.children[ee];if(ie==c)break;t+=ie.height}return t}function Yr(e){if(e.height==0)return 0;for(var t=e.text.length,c,l=e;c=Ti(l);){var y=c.find(0,!0);l=y.from.line,t+=y.from.ch-y.to.ch}for(l=e;c=ii(l);){var K=c.find(0,!0);t-=l.text.length-K.from.ch,l=K.to.line,t+=l.text.length-K.to.ch}return t}function $r(e){var t=e.display,c=e.doc;t.maxLine=$(c,c.first),t.maxLineLength=Yr(t.maxLine),t.maxLineChanged=!0,c.iter(function(l){var y=Yr(l);y>t.maxLineLength&&(t.maxLineLength=y,t.maxLine=l)})}var fr=function(e,t,c){this.text=e,ar(this,t),this.height=c?c(this):1};fr.prototype.lineNo=function(){return Pe(this)},Ee(fr);function Qr(e,t,c,l){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Tr(e),ar(e,c);var y=l?l(e):1;y!=e.height&&he(e,y)}function mn(e){e.parent=null,Tr(e)}var On={},yn={};function jn(e,t){if(!e||/^\s*$/.test(e))return null;var c=t.addModeClass?yn:On;return c[e]||(c[e]=e.replace(/\S+/g,"cm-$&"))}function Qn(e,t){var c=C("span",null,null,n?"padding-right: .1px":null),l={pre:C("pre",[c],"CodeMirror-line"),content:c,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var y=0;y<=(t.rest?t.rest.length:0);y++){var K=y?t.rest[y-1]:t.line,ee=void 0;l.pos=0,l.addToken=Bn,Ct(e.display.measure)&&(ee=It(K,e.doc.direction))&&(l.addToken=Yi(l.addToken,ee)),l.map=[];var ie=t!=e.display.externalMeasured&&Pe(K);yr(K,l,ht(e,K,ie)),K.styleClasses&&(K.styleClasses.bgClass&&(l.bgClass=L(K.styleClasses.bgClass,l.bgClass||"")),K.styleClasses.textClass&&(l.textClass=L(K.styleClasses.textClass,l.textClass||""))),l.map.length==0&&l.map.push(0,0,l.content.appendChild(jt(e.display.measure))),y==0?(t.measure.map=l.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(l.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(n){var oe=l.content.lastChild;(/\bcm-tab\b/.test(oe.className)||oe.querySelector&&oe.querySelector(".cm-tab"))&&(l.content.className="cm-tab-wrap-hack")}return Ge(e,"renderLine",e,t.line,l.pre),l.pre.className&&(l.textClass=L(l.pre.className,l.textClass||"")),l}function un(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 Bn(e,t,c,l,y,K,ee){if(!t)return;var ie=e.splitSpaces?Ai(t,e.trailingSpace):t,oe=e.cm.state.specialChars,ce=!1,De;if(!oe.test(t))e.col+=t.length,De=document.createTextNode(ie),e.map.push(e.pos,e.pos+t.length,De),H&&N<9&&(ce=!0),e.pos+=t.length;else{De=document.createDocumentFragment();for(var Fe=0;;){oe.lastIndex=Fe;var tt=oe.exec(t),Qe=tt?tt.index-Fe:t.length-Fe;if(Qe){var St=document.createTextNode(ie.slice(Fe,Fe+Qe));H&&N<9?De.appendChild(f("span",[St])):De.appendChild(St),e.map.push(e.pos,e.pos+Qe,St),e.col+=Qe,e.pos+=Qe}if(!tt)break;Fe+=Qe+1;var Ft=void 0;if(tt[0]==" "){var Kt=e.cm.options.tabSize,Qt=Kt-e.col%Kt;Ft=De.appendChild(f("span",be(Qt),"cm-tab")),Ft.setAttribute("role","presentation"),Ft.setAttribute("cm-text"," "),e.col+=Qt}else tt[0]=="\r"||tt[0]==`
|
|
`?(Ft=De.appendChild(f("span",tt[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ft.setAttribute("cm-text",tt[0]),e.col+=1):(Ft=e.cm.options.specialCharPlaceholder(tt[0]),Ft.setAttribute("cm-text",tt[0]),H&&N<9?De.appendChild(f("span",[Ft])):De.appendChild(Ft),e.col+=1);e.map.push(e.pos,e.pos+1,Ft),e.pos++}}if(e.trailingSpace=ie.charCodeAt(t.length-1)==32,c||l||y||ce||K||ee){var rn=c||"";l&&(rn+=l),y&&(rn+=y);var Zt=f("span",[De],rn,K);if(ee)for(var cn in ee)ee.hasOwnProperty(cn)&&cn!="style"&&cn!="class"&&Zt.setAttribute(cn,ee[cn]);return e.content.appendChild(Zt)}e.content.appendChild(De)}function Ai(e,t){if(e.length>1&&!/ /.test(e))return e;for(var c=t,l="",y=0;y<e.length;y++){var K=e.charAt(y);K==" "&&c&&(y==e.length-1||e.charCodeAt(y+1)==32)&&(K="\xA0"),l+=K,c=K==" "}return l}function Yi(e,t){return function(c,l,y,K,ee,ie,oe){y=y?y+" cm-force-border":"cm-force-border";for(var ce=c.pos,De=ce+l.length;;){for(var Fe=void 0,tt=0;tt<t.length&&!(Fe=t[tt],Fe.to>ce&&Fe.from<=ce);tt++);if(Fe.to>=De)return e(c,l,y,K,ee,ie,oe);e(c,l.slice(0,Fe.to-ce),y,K,null,ie,oe),K=null,l=l.slice(Fe.to-ce),ce=Fe.to}}}function Xn(e,t,c,l){var y=!l&&c.widgetNode;y&&e.map.push(e.pos,e.pos+t,y),!l&&e.cm.display.input.needsContentAttribute&&(y||(y=e.content.appendChild(document.createElement("span"))),y.setAttribute("cm-marker",c.id)),y&&(e.cm.display.input.setUneditable(y),e.content.appendChild(y)),e.pos+=t,e.trailingSpace=!1}function yr(e,t,c){var l=e.markedSpans,y=e.text,K=0;if(!l){for(var ee=1;ee<c.length;ee+=2)t.addToken(t,y.slice(K,K=c[ee]),jn(c[ee+1],t.cm.options));return}for(var ie=y.length,oe=0,ce=1,De="",Fe,tt,Qe=0,St,Ft,Kt,Qt,rn;;){if(Qe==oe){St=Ft=Kt=tt="",rn=null,Qt=null,Qe=Infinity;for(var Zt=[],cn=void 0,An=0;An<l.length;++An){var En=l[An],Jn=En.marker;if(Jn.type=="bookmark"&&En.from==oe&&Jn.widgetNode)Zt.push(Jn);else if(En.from<=oe&&(En.to==null||En.to>oe||Jn.collapsed&&En.to==oe&&En.from==oe)){if(En.to!=null&&En.to!=oe&&Qe>En.to&&(Qe=En.to,Ft=""),Jn.className&&(St+=" "+Jn.className),Jn.css&&(tt=(tt?tt+";":"")+Jn.css),Jn.startStyle&&En.from==oe&&(Kt+=" "+Jn.startStyle),Jn.endStyle&&En.to==Qe&&(cn||(cn=[])).push(Jn.endStyle,En.to),Jn.title&&((rn||(rn={})).title=Jn.title),Jn.attributes)for(var wi in Jn.attributes)(rn||(rn={}))[wi]=Jn.attributes[wi];Jn.collapsed&&(!Qt||_i(Qt.marker,Jn)<0)&&(Qt=En)}else En.from>oe&&Qe>En.from&&(Qe=En.from)}if(cn)for(var nr=0;nr<cn.length;nr+=2)cn[nr+1]==Qe&&(Ft+=" "+cn[nr]);if(!Qt||Qt.from==oe)for(var ki=0;ki<Zt.length;++ki)Xn(t,0,Zt[ki]);if(Qt&&(Qt.from||0)==oe){if(Xn(t,(Qt.to==null?ie+1:Qt.to)-oe,Qt.marker,Qt.from==null),Qt.to==null)return;Qt.to==oe&&(Qt=!1)}}if(oe>=ie)break;for(var Mr=Math.min(ie,Qe);;){if(De){var Er=oe+De.length;if(!Qt){var Gi=Er>Mr?De.slice(0,Mr-oe):De;t.addToken(t,Gi,Fe?Fe+St:St,Kt,oe+Gi.length==Qe?Ft:"",tt,rn)}if(Er>=Mr){De=De.slice(Mr-oe),oe=Mr;break}oe=Er,Kt=""}De=y.slice(K,K=c[ce++]),Fe=jn(c[ce++],t.cm.options)}}}function si(e,t,c){this.line=t,this.rest=gr(t),this.size=this.rest?Pe(Ve(this.rest))-c+1:1,this.node=this.text=null,this.hidden=Cr(e,t)}function qe(e,t,c){for(var l=[],y,K=t;K<c;K=y){var ee=new si(e.doc,$(e.doc,K),K);y=K+ee.size,l.push(ee)}return l}var vt=null;function Gt(e){vt?vt.ops.push(e):e.ownsGroup=vt={ops:[e],delayedCallbacks:[]}}function fn(e){var t=e.delayedCallbacks,c=0;do{for(;c<t.length;c++)t[c].call(null);for(var l=0;l<e.ops.length;l++){var y=e.ops[l];if(y.cursorActivityHandlers)for(;y.cursorActivityCalled<y.cursorActivityHandlers.length;)y.cursorActivityHandlers[y.cursorActivityCalled++].call(null,y.cm)}}while(c<t.length)}function tn(e,t){var c=e.ownsGroup;if(!c)return;try{fn(c)}finally{vt=null,t(c)}}var Yt=null;function rt(e,t){var c=it(e,t);if(!c.length)return;var l=Array.prototype.slice.call(arguments,2),y;vt?y=vt.delayedCallbacks:Yt?y=Yt:(y=Yt=[],setTimeout(Et,0));for(var K=function(ie){y.push(function(){return c[ie].apply(null,l)})},ee=0;ee<c.length;++ee)K(ee)}function Et(){var e=Yt;Yt=null;for(var t=0;t<e.length;++t)e[t]()}function dn(e,t,c,l){for(var y=0;y<t.changes.length;y++){var K=t.changes[y];K=="text"?vn(e,t):K=="gutter"?Mn(e,t,c,l):K=="class"?Kn(e,t):K=="widget"&&Sn(e,t,l)}t.changes=null}function pt(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),H&&N<8&&(e.node.style.zIndex=2)),e.node}function hn(e,t){var c=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(c&&(c+=" CodeMirror-linebackground"),t.background)c?t.background.className=c:(t.background.parentNode.removeChild(t.background),t.background=null);else if(c){var l=pt(t);t.background=l.insertBefore(f("div",null,c),l.firstChild),e.display.input.setUneditable(t.background)}}function Bt(e,t){var c=e.display.externalMeasured;return c&&c.line==t.line?(e.display.externalMeasured=null,t.measure=c.measure,c.built):Qn(e,t)}function vn(e,t){var c=t.text.className,l=Bt(e,t);t.text==t.node&&(t.node=l.pre),t.text.parentNode.replaceChild(l.pre,t.text),t.text=l.pre,l.bgClass!=t.bgClass||l.textClass!=t.textClass?(t.bgClass=l.bgClass,t.textClass=l.textClass,Kn(e,t)):c&&(t.text.className=c)}function Kn(e,t){hn(e,t),t.line.wrapClass?pt(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var c=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=c||""}function Mn(e,t,c,l){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 y=pt(t);t.gutterBackground=f("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px; width: "+l.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),y.insertBefore(t.gutterBackground,t.text)}var K=t.line.gutterMarkers;if(e.options.lineNumbers||K){var ee=pt(t),ie=t.gutter=f("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px");if(e.display.input.setUneditable(ie),ee.insertBefore(ie,t.text),t.line.gutterClass&&(ie.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!K||!K["CodeMirror-linenumbers"])&&(t.lineNumber=ie.appendChild(f("div",Mt(e.options,c),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+l.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),K)for(var oe=0;oe<e.display.gutterSpecs.length;++oe){var ce=e.display.gutterSpecs[oe].className,De=K.hasOwnProperty(ce)&&K[ce];De&&ie.appendChild(f("div",[De],"CodeMirror-gutter-elt","left: "+l.gutterLeft[ce]+"px; width: "+l.gutterWidth[ce]+"px"))}}}function Sn(e,t,c){t.alignable&&(t.alignable=null);for(var l=w("CodeMirror-linewidget"),y=t.node.firstChild,K=void 0;y;y=K)K=y.nextSibling,l.test(y.className)&&t.node.removeChild(y);Ln(e,t,c)}function ni(e,t,c,l){var y=Bt(e,t);return t.text=t.node=y.pre,y.bgClass&&(t.bgClass=y.bgClass),y.textClass&&(t.textClass=y.textClass),Kn(e,t),Mn(e,t,c,l),Ln(e,t,l),t.node}function Ln(e,t,c){if(Zn(e,t.line,t,c,!0),t.rest)for(var l=0;l<t.rest.length;l++)Zn(e,t.rest[l],t,c,!1)}function Zn(e,t,c,l,y){if(!t.widgets)return;for(var K=pt(c),ee=0,ie=t.widgets;ee<ie.length;++ee){var oe=ie[ee],ce=f("div",[oe.node],"CodeMirror-linewidget"+(oe.className?" "+oe.className:""));oe.handleMouseEvents||ce.setAttribute("cm-ignore-events","true"),qn(oe,ce,c,l),e.display.input.setUneditable(ce),y&&oe.above?K.insertBefore(ce,c.gutter||c.text):K.appendChild(ce),rt(oe,"redraw")}}function qn(e,t,c,l){if(e.noHScroll){(c.alignable||(c.alignable=[])).push(t);var y=l.wrapperWidth;t.style.left=l.fixedPos+"px",e.coverGutter||(y-=l.gutterTotalWidth,t.style.paddingLeft=l.gutterTotalWidth+"px"),t.style.width=y+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-l.gutterTotalWidth+"px"))}function bi(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!_(document.body,e.node)){var c="position: relative;";e.coverGutter&&(c+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(c+="width: "+t.display.wrapper.clientWidth+"px;"),g(t.display.measure,f("div",[e.node],null,c))}return e.height=e.node.parentNode.offsetHeight}function Un(e,t){for(var c=Le(t);c!=e.wrapper;c=c.parentNode)if(!c||c.nodeType==1&&c.getAttribute("cm-ignore-events")=="true"||c.parentNode==e.sizer&&c!=e.mover)return!0}function mi(e){return e.lineSpace.offsetTop}function gi(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ai(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=g(e.measure,f("pre","x","CodeMirror-line-like")),c=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,l={left:parseInt(c.paddingLeft),right:parseInt(c.paddingRight)};return!isNaN(l.left)&&!isNaN(l.right)&&(e.cachedPaddingH=l),l}function kn(e){return ge-e.display.nativeBarWidth}function ei(e){return e.display.scroller.clientWidth-kn(e)-e.display.barWidth}function Gn(e){return e.display.scroller.clientHeight-kn(e)-e.display.barHeight}function Xt(e,t,c){var l=e.options.lineWrapping,y=l&&ei(e);if(!t.measure.heights||l&&t.measure.width!=y){var K=t.measure.heights=[];if(l){t.measure.width=y;for(var ee=t.text.firstChild.getClientRects(),ie=0;ie<ee.length-1;ie++){var oe=ee[ie],ce=ee[ie+1];Math.abs(oe.bottom-ce.bottom)>2&&K.push((oe.bottom+ce.top)/2-c.top)}}K.push(c.bottom-c.top)}}function Tn(e,t,c){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var l=0;l<e.rest.length;l++)if(e.rest[l]==t)return{map:e.measure.maps[l],cache:e.measure.caches[l]};for(var y=0;y<e.rest.length;y++)if(Pe(e.rest[y])>c)return{map:e.measure.maps[y],cache:e.measure.caches[y],before:!0}}function oi(e,t){t=Xi(t);var c=Pe(t),l=e.display.externalMeasured=new si(e.doc,t,c);l.lineN=c;var y=l.built=Qn(e,l);return l.text=y.pre,g(e.display.lineMeasure,y.pre),l}function vi(e,t,c,l){return Dn(e,ti(e,t),c,l)}function ui(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Lr(e,t)];var c=e.display.externalMeasured;if(c&&t>=c.lineN&&t<c.lineN+c.size)return c}function ti(e,t){var c=Pe(t),l=ui(e,c);l&&!l.text?l=null:l&&l.changes&&(dn(e,l,c,Ui(e)),e.curOp.forceUpdate=!0),l||(l=oi(e,t));var y=Tn(l,t,c);return{line:t,view:l,rect:null,map:y.map,cache:y.cache,before:y.before,hasHeights:!1}}function Dn(e,t,c,l,y){t.before&&(c=-1);var K=c+(l||""),ee;return t.cache.hasOwnProperty(K)?ee=t.cache[K]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Xt(e,t.view,t.rect),t.hasHeights=!0),ee=Jt(e,t,c,l),ee.bogus||(t.cache[K]=ee)),{left:ee.left,right:ee.right,top:y?ee.rtop:ee.top,bottom:y?ee.rbottom:ee.bottom}}var _n={left:0,right:0,top:0,bottom:0};function Rn(e,t,c){for(var l,y,K,ee,ie,oe,ce=0;ce<e.length;ce+=3)if(ie=e[ce],oe=e[ce+1],t<ie?(y=0,K=1,ee="left"):t<oe?(y=t-ie,K=y+1):(ce==e.length-3||t==oe&&e[ce+3]>t)&&(K=oe-ie,y=K-1,t>=oe&&(ee="right")),y!=null){if(l=e[ce+2],ie==oe&&c==(l.insertLeft?"left":"right")&&(ee=c),c=="left"&&y==0)for(;ce&&e[ce-2]==e[ce-3]&&e[ce-1].insertLeft;)l=e[(ce-=3)+2],ee="left";if(c=="right"&&y==oe-ie)for(;ce<e.length-3&&e[ce+3]==e[ce+4]&&!e[ce+5].insertLeft;)l=e[(ce+=3)+2],ee="right";break}return{node:l,start:y,end:K,collapse:ee,coverStart:ie,coverEnd:oe}}function Vt(e,t){var c=_n;if(t=="left")for(var l=0;l<e.length&&!((c=e[l]).left!=c.right);l++);else for(var y=e.length-1;y>=0&&!((c=e[y]).left!=c.right);y--);return c}function Jt(e,t,c,l){var y=Rn(t.map,c,l),K=y.node,ee=y.start,ie=y.end,oe=y.collapse,ce;if(K.nodeType==3){for(var De=0;De<4;De++){for(;ee&&ve(t.line.text.charAt(y.coverStart+ee));)--ee;for(;y.coverStart+ie<y.coverEnd&&ve(t.line.text.charAt(y.coverStart+ie));)++ie;if(H&&N<9&&ee==0&&ie==y.coverEnd-y.coverStart?ce=K.parentNode.getBoundingClientRect():ce=Vt(E(K,ee,ie).getClientRects(),l),ce.left||ce.right||ee==0)break;ie=ee,ee=ee-1,oe="right"}H&&N<11&&(ce=sn(e.display.measure,ce))}else{ee>0&&(oe=l="right");var Fe;e.options.lineWrapping&&(Fe=K.getClientRects()).length>1?ce=Fe[l=="right"?Fe.length-1:0]:ce=K.getBoundingClientRect()}if(H&&N<9&&!ee&&(!ce||!ce.left&&!ce.right)){var tt=K.parentNode.getClientRects()[0];tt?ce={left:tt.left,right:tt.left+Yn(e.display),top:tt.top,bottom:tt.bottom}:ce=_n}for(var Qe=ce.top-t.rect.top,St=ce.bottom-t.rect.top,Ft=(Qe+St)/2,Kt=t.view.measure.heights,Qt=0;Qt<Kt.length-1&&!(Ft<Kt[Qt]);Qt++);var rn=Qt?Kt[Qt-1]:0,Zt=Kt[Qt],cn={left:(oe=="right"?ce.right:ce.left)-t.rect.left,right:(oe=="left"?ce.left:ce.right)-t.rect.left,top:rn,bottom:Zt};return!ce.left&&!ce.right&&(cn.bogus=!0),e.options.singleCursorHeightPerLine||(cn.rtop=Qe,cn.rbottom=St),cn}function sn(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Re(e))return t;var c=screen.logicalXDPI/screen.deviceXDPI,l=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*c,right:t.right*c,top:t.top*l,bottom:t.bottom*l}}function ln(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 Ht(e){e.display.externalMeasure=null,b(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)ln(e.display.view[t])}function qt(e){Ht(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function gn(){return p&&r?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function di(){return p&&r?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Li(e){var t=0;if(e.widgets)for(var c=0;c<e.widgets.length;++c)e.widgets[c].above&&(t+=bi(e.widgets[c]));return t}function qi(e,t,c,l,y){if(!y){var K=Li(t);c.top+=K,c.bottom+=K}if(l=="line")return c;l||(l="local");var ee=vr(t);if(l=="local"?ee+=mi(e.display):ee-=e.display.viewOffset,l=="page"||l=="window"){var ie=e.display.lineSpace.getBoundingClientRect();ee+=ie.top+(l=="window"?0:di());var oe=ie.left+(l=="window"?0:gn());c.left+=oe,c.right+=oe}return c.top+=ee,c.bottom+=ee,c}function Hi(e,t,c){if(c=="div")return t;var l=t.left,y=t.top;if(c=="page")l-=gn(),y-=di();else if(c=="local"||!c){var K=e.display.sizer.getBoundingClientRect();l+=K.left,y+=K.top}var ee=e.display.lineSpace.getBoundingClientRect();return{left:l-ee.left,top:y-ee.top}}function Or(e,t,c,l,y){return l||(l=$(e.doc,t.line)),qi(e,l,vi(e,l,t.ch,y),c)}function li(e,t,c,l,y,K){l=l||$(e.doc,t.line),y||(y=ti(e,l));function ee(St,Ft){var Kt=Dn(e,y,St,Ft?"right":"left",K);return Ft?Kt.left=Kt.right:Kt.right=Kt.left,qi(e,l,Kt,c)}var ie=It(l,e.doc.direction),oe=t.ch,ce=t.sticky;if(oe>=l.text.length?(oe=l.text.length,ce="before"):oe<=0&&(oe=0,ce="after"),!ie)return ee(ce=="before"?oe-1:oe,ce=="before");function De(St,Ft,Kt){var Qt=ie[Ft],rn=Qt.level==1;return ee(Kt?St-1:St,rn!=Kt)}var Fe=dt(ie,oe,ce),tt=at,Qe=De(oe,Fe,ce=="before");return tt!=null&&(Qe.other=De(oe,tt,ce!="before")),Qe}function Rr(e,t){var c=0;t=R(e.doc,t),e.options.lineWrapping||(c=Yn(e.display)*t.ch);var l=$(e.doc,t.line),y=vr(l)+mi(e.display);return{left:c,right:c,top:y,bottom:y+l.height}}function Nr(e,t,c,l,y){var K=Ze(e,t,c);return K.xRel=y,l&&(K.outside=l),K}function Kr(e,t,c){var l=e.doc;if(c+=e.display.viewOffset,c<0)return Nr(l.first,0,null,-1,-1);var y=ze(l,c),K=l.first+l.size-1;if(y>K)return Nr(l.first+l.size-1,$(l,K).text.length,null,1,1);t<0&&(t=0);for(var ee=$(l,y);;){var ie=ta(e,ee,y,t,c),oe=wr(ee,ie.ch+(ie.xRel>0||ie.outside>0?1:0));if(!oe)return ie;var ce=oe.find(1);if(ce.line==y)return ce;ee=$(l,y=ce.line)}}function Ur(e,t,c,l){l-=Li(t);var y=t.text.length,K=We(function(ee){return Dn(e,c,ee-1).bottom<=l},y,0);return y=We(function(ee){return Dn(e,c,ee).top>l},K,y),{begin:K,end:y}}function ca(e,t,c,l){c||(c=ti(e,t));var y=qi(e,t,Dn(e,c,l),"line").top;return Ur(e,t,c,y)}function _r(e,t,c,l){return e.bottom<=c?!1:e.top>c?!0:(l?e.left:e.right)>t}function ta(e,t,c,l,y){y-=vr(t);var K=ti(e,t),ee=Li(t),ie=0,oe=t.text.length,ce=!0,De=It(t,e.doc.direction);if(De){var Fe=(e.options.lineWrapping?fi:Da)(e,t,c,K,De,l,y);ce=Fe.level!=1,ie=ce?Fe.from:Fe.to-1,oe=ce?Fe.to:Fe.from-1}var tt=null,Qe=null,St=We(function(An){var En=Dn(e,K,An);return En.top+=ee,En.bottom+=ee,_r(En,l,y,!1)?(En.top<=y&&En.left<=l&&(tt=An,Qe=En),!0):!1},ie,oe),Ft,Kt,Qt=!1;if(Qe){var rn=l-Qe.left<Qe.right-l,Zt=rn==ce;St=tt+(Zt?0:1),Kt=Zt?"after":"before",Ft=rn?Qe.left:Qe.right}else{!ce&&(St==oe||St==ie)&&St++,Kt=St==0?"after":St==t.text.length?"before":Dn(e,K,St-(ce?1:0)).bottom+ee<=y==ce?"after":"before";var cn=li(e,Ze(c,St,Kt),"line",t,K);Ft=cn.left,Qt=y<cn.top?-1:y>=cn.bottom?1:0}return St=Te(t.text,St,1),Nr(c,St,Kt,Qt,l-Ft)}function Da(e,t,c,l,y,K,ee){var ie=We(function(Fe){var tt=y[Fe],Qe=tt.level!=1;return _r(li(e,Ze(c,Qe?tt.to:tt.from,Qe?"before":"after"),"line",t,l),K,ee,!0)},0,y.length-1),oe=y[ie];if(ie>0){var ce=oe.level!=1,De=li(e,Ze(c,ce?oe.from:oe.to,ce?"after":"before"),"line",t,l);_r(De,K,ee,!0)&&De.top>ee&&(oe=y[ie-1])}return oe}function fi(e,t,c,l,y,K,ee){var ie=Ur(e,t,l,ee),oe=ie.begin,ce=ie.end;/\s/.test(t.text.charAt(ce-1))&&ce--;for(var De=null,Fe=null,tt=0;tt<y.length;tt++){var Qe=y[tt];if(Qe.from>=ce||Qe.to<=oe)continue;var St=Qe.level!=1,Ft=Dn(e,l,St?Math.min(ce,Qe.to)-1:Math.max(oe,Qe.from)).right,Kt=Ft<K?K-Ft+1e9:Ft-K;(!De||Fe>Kt)&&(De=Qe,Fe=Kt)}return De||(De=y[y.length-1]),De.from<oe&&(De={from:oe,to:De.to,level:De.level}),De.to>ce&&(De={from:De.from,to:ce,level:De.level}),De}var xn;function zn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(xn==null){xn=f("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)xn.appendChild(document.createTextNode("x")),xn.appendChild(f("br"));xn.appendChild(document.createTextNode("x"))}g(e.measure,xn);var c=xn.offsetHeight/50;return c>3&&(e.cachedTextHeight=c),b(e.measure),c||1}function Yn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=f("span","xxxxxxxxxx"),c=f("pre",[t],"CodeMirror-line-like");g(e.measure,c);var l=t.getBoundingClientRect(),y=(l.right-l.left)/10;return y>2&&(e.cachedCharWidth=y),y||10}function Ui(e){for(var t=e.display,c={},l={},y=t.gutters.clientLeft,K=t.gutters.firstChild,ee=0;K;K=K.nextSibling,++ee){var ie=e.display.gutterSpecs[ee].className;c[ie]=K.offsetLeft+K.clientLeft+y,l[ie]=K.clientWidth}return{fixedPos:Vn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:c,gutterWidth:l,wrapperWidth:t.wrapper.clientWidth}}function Vn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ar(e){var t=zn(e.display),c=e.options.lineWrapping,l=c&&Math.max(5,e.display.scroller.clientWidth/Yn(e.display)-3);return function(y){if(Cr(e.doc,y))return 0;var K=0;if(y.widgets)for(var ee=0;ee<y.widgets.length;ee++)y.widgets[ee].height&&(K+=y.widgets[ee].height);return c?K+(Math.ceil(y.text.length/l)||1)*t:K+t}}function Br(e){var t=e.doc,c=Ar(e);t.iter(function(l){var y=c(l);y!=l.height&&he(l,y)})}function $i(e,t,c,l){var y=e.display;if(!c&&Le(t).getAttribute("cm-not-content")=="true")return null;var K,ee,ie=y.lineSpace.getBoundingClientRect();try{K=t.clientX-ie.left,ee=t.clientY-ie.top}catch(Fe){return null}var oe=Kr(e,K,ee),ce;if(l&&oe.xRel>0&&(ce=$(e.doc,oe.line).text).length==oe.ch){var De=V(ce,ce.length,e.options.tabSize)-ce.length;oe=Ze(oe.line,Math.max(0,Math.round((K-ai(e.display).left)/Yn(e.display))-De))}return oe}function Lr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var c=e.display.view,l=0;l<c.length;l++)if(t-=c[l].size,t<0)return l}function Pi(e,t,c,l){t==null&&(t=e.doc.first),c==null&&(c=e.doc.first+e.doc.size),l||(l=0);var y=e.display;if(l&&c<y.viewTo&&(y.updateLineNumbers==null||y.updateLineNumbers>t)&&(y.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=y.viewTo)yi&&Hr(e.doc,t)<y.viewTo&&Pn(e);else if(c<=y.viewFrom)yi&&kr(e.doc,c+l)>y.viewFrom?Pn(e):(y.viewFrom+=l,y.viewTo+=l);else if(t<=y.viewFrom&&c>=y.viewTo)Pn(e);else if(t<=y.viewFrom){var K=Cn(e,c,c+l,1);K?(y.view=y.view.slice(K.index),y.viewFrom=K.lineN,y.viewTo+=l):Pn(e)}else if(c>=y.viewTo){var ee=Cn(e,t,t,-1);ee?(y.view=y.view.slice(0,ee.index),y.viewTo=ee.lineN):Pn(e)}else{var ie=Cn(e,t,t,-1),oe=Cn(e,c,c+l,1);ie&&oe?(y.view=y.view.slice(0,ie.index).concat(qe(e,ie.lineN,oe.lineN)).concat(y.view.slice(oe.index)),y.viewTo+=l):Pn(e)}var ce=y.externalMeasured;ce&&(c<ce.lineN?ce.lineN+=l:t<ce.lineN+ce.size&&(y.externalMeasured=null))}function sr(e,t,c){e.curOp.viewChanged=!0;var l=e.display,y=e.display.externalMeasured;if(y&&t>=y.lineN&&t<y.lineN+y.size&&(l.externalMeasured=null),t<l.viewFrom||t>=l.viewTo)return;var K=l.view[Lr(e,t)];if(K.node==null)return;var ee=K.changes||(K.changes=[]);re(ee,c)==-1&&ee.push(c)}function Pn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Cn(e,t,c,l){var y=Lr(e,t),K,ee=e.display.view;if(!yi||c==e.doc.first+e.doc.size)return{index:y,lineN:c};for(var ie=e.display.viewFrom,oe=0;oe<y;oe++)ie+=ee[oe].size;if(ie!=t){if(l>0){if(y==ee.length-1)return null;K=ie+ee[y].size-t,y++}else K=ie-t;t+=K,c+=K}for(;Hr(e.doc,c)!=c;){if(y==(l<0?0:ee.length-1))return null;c+=l*ee[y-(l<0?1:0)].size,y+=l}return{index:y,lineN:c}}function $n(e,t,c){var l=e.display,y=l.view;y.length==0||t>=l.viewTo||c<=l.viewFrom?(l.view=qe(e,t,c),l.viewFrom=t):(l.viewFrom>t?l.view=qe(e,t,l.viewFrom).concat(l.view):l.viewFrom<t&&(l.view=l.view.slice(Lr(e,t))),l.viewFrom=t,l.viewTo<c?l.view=l.view.concat(qe(e,l.viewTo,c)):l.viewTo>c&&(l.view=l.view.slice(0,Lr(e,c)))),l.viewTo=c}function en(e){for(var t=e.display.view,c=0,l=0;l<t.length;l++){var y=t[l];!y.hidden&&(!y.node||y.changes)&&++c}return c}function In(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Ei(e,t){t===void 0&&(t=!0);for(var c=e.doc,l={},y=l.cursors=document.createDocumentFragment(),K=l.selection=document.createDocumentFragment(),ee=0;ee<c.sel.ranges.length;ee++){if(!t&&ee==c.sel.primIndex)continue;var ie=c.sel.ranges[ee];if(ie.from().line>=e.display.viewTo||ie.to().line<e.display.viewFrom)continue;var oe=ie.empty();(oe||e.options.showCursorWhenSelecting)&&Ki(e,ie.head,y),oe||va(e,ie,K)}return l}function Ki(e,t,c){var l=li(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),y=c.appendChild(f("div","\xA0","CodeMirror-cursor"));if(y.style.left=l.left+"px",y.style.top=l.top+"px",y.style.height=Math.max(0,l.bottom-l.top)*e.options.cursorHeight+"px",l.other){var K=c.appendChild(f("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));K.style.display="",K.style.left=l.other.left+"px",K.style.top=l.other.top+"px",K.style.height=(l.other.bottom-l.other.top)*.85+"px"}}function Mi(e,t){return e.top-t.top||e.left-t.left}function va(e,t,c){var l=e.display,y=e.doc,K=document.createDocumentFragment(),ee=ai(e.display),ie=ee.left,oe=Math.max(l.sizerWidth,ei(e)-l.sizer.offsetLeft)-ee.right,ce=y.direction=="ltr";function De(Zt,cn,An,En){cn<0&&(cn=0),cn=Math.round(cn),En=Math.round(En),K.appendChild(f("div",null,"CodeMirror-selected","position: absolute; left: "+Zt+`px;
|
|
top: `+cn+"px; width: "+(An==null?oe-Zt:An)+`px;
|
|
height: `+(En-cn)+"px"))}function Fe(Zt,cn,An){var En=$(y,Zt),Jn=En.text.length,wi,nr;function ki(Gi,xr){return Or(e,Ze(Zt,Gi),"div",En,xr)}function Mr(Gi,xr,or){var Qi=ca(e,En,null,Gi),zi=xr=="ltr"==(or=="after")?"left":"right",Fi=or=="after"?Qi.begin:Qi.end-(/\s/.test(En.text.charAt(Qi.end-1))?2:1);return ki(Fi,zi)[zi]}var Er=It(En,y.direction);return Je(Er,cn||0,An==null?Jn:An,function(Gi,xr,or,Qi){var zi=or=="ltr",Fi=ki(Gi,zi?"left":"right"),Sr=ki(xr-1,zi?"right":"left"),La=cn==null&&Gi==0,ua=An==null&&xr==Jn,cr=Qi==0,Jr=!Er||Qi==Er.length-1;if(Sr.top-Fi.top<=3){var ir=(ce?La:ua)&&cr,Fs=(ce?ua:La)&&Jr,ea=ir?ie:(zi?Fi:Sr).left,ma=Fs?oe:(zi?Sr:Fi).right;De(ea,Fi.top,ma-ea,Fi.bottom)}else{var ga,mr,Ia,js;zi?(ga=ce&&La&&cr?ie:Fi.left,mr=ce?oe:Mr(Gi,or,"before"),Ia=ce?ie:Mr(xr,or,"after"),js=ce&&ua&&Jr?oe:Sr.right):(ga=ce?Mr(Gi,or,"before"):ie,mr=!ce&&La&&cr?oe:Fi.right,Ia=!ce&&ua&&Jr?ie:Sr.left,js=ce?Mr(xr,or,"after"):oe),De(ga,Fi.top,mr-ga,Fi.bottom),Fi.bottom<Sr.top&&De(ie,Fi.bottom,null,Sr.top),De(Ia,Sr.top,js-Ia,Sr.bottom)}(!wi||Mi(Fi,wi)<0)&&(wi=Fi),Mi(Sr,wi)<0&&(wi=Sr),(!nr||Mi(Fi,nr)<0)&&(nr=Fi),Mi(Sr,nr)<0&&(nr=Sr)}),{start:wi,end:nr}}var tt=t.from(),Qe=t.to();if(tt.line==Qe.line)Fe(tt.line,tt.ch,Qe.ch);else{var St=$(y,tt.line),Ft=$(y,Qe.line),Kt=Xi(St)==Xi(Ft),Qt=Fe(tt.line,tt.ch,Kt?St.text.length+1:null).end,rn=Fe(Qe.line,Kt?0:null,Qe.ch).start;Kt&&(Qt.top<rn.top-2?(De(Qt.right,Qt.top,null,Qt.bottom),De(ie,rn.top,rn.left,rn.bottom)):De(Qt.right,Qt.top,rn.left-Qt.right,Qt.bottom)),Qt.bottom<rn.top&&De(ie,Qt.bottom,null,rn.top)}c.appendChild(K)}function bn(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var c=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ir(e),t.cursorDiv.style.visibility=(c=!c)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function na(e){e.state.focused||(e.display.input.focus(),Wr(e))}function ya(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ir(e))},100)}function Wr(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Ge(e,"focus",e,t),e.state.focused=!0,j(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()),bn(e)}function Ir(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ge(e,"blur",e,t),e.state.focused=!1,v(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Dr(e){for(var t=e.display,c=t.lineDiv.offsetTop,l=0;l<t.view.length;l++){var y=t.view[l],K=e.options.lineWrapping,ee=void 0,ie=0;if(y.hidden)continue;if(H&&N<8){var oe=y.node.offsetTop+y.node.offsetHeight;ee=oe-c,c=oe}else{var ce=y.node.getBoundingClientRect();ee=ce.bottom-ce.top,!K&&y.text.firstChild&&(ie=y.text.firstChild.getBoundingClientRect().right-ce.left-1)}var De=y.line.height-ee;if((De>.005||De<-.005)&&(he(y.line,ee),Zr(y.line),y.rest))for(var Fe=0;Fe<y.rest.length;Fe++)Zr(y.rest[Fe]);if(ie>e.display.sizerWidth){var tt=Math.ceil(ie/Yn(e.display));tt>e.display.maxLineLength&&(e.display.maxLineLength=tt,e.display.maxLine=y.line,e.display.maxLineChanged=!0)}}}function Zr(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var c=e.widgets[t],l=c.node.parentNode;l&&(c.height=l.offsetHeight)}}function Gr(e,t,c){var l=c&&c.top!=null?Math.max(0,c.top):e.scroller.scrollTop;l=Math.floor(l-mi(e));var y=c&&c.bottom!=null?c.bottom:l+e.wrapper.clientHeight,K=ze(t,l),ee=ze(t,y);if(c&&c.ensure){var ie=c.ensure.from.line,oe=c.ensure.to.line;ie<K?(K=ie,ee=ze(t,vr($(t,ie))+e.wrapper.clientHeight)):Math.min(oe,t.lastLine())>=ee&&(K=ze(t,vr($(t,oe))-e.wrapper.clientHeight),ee=oe)}return{from:K,to:Math.max(ee,K+1)}}function ia(e,t){if($e(e,"scrollCursorIntoView"))return;var c=e.display,l=c.sizer.getBoundingClientRect(),y=null;if(t.top+l.top<0?y=!0:t.bottom+l.top>(window.innerHeight||document.documentElement.clientHeight)&&(y=!1),y!=null&&!o){var K=f("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-c.viewOffset-mi(e.display))+`px;
|
|
height: `+(t.bottom-t.top+kn(e)+c.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(K),K.scrollIntoView(y),e.display.lineSpace.removeChild(K)}}function ms(e,t,c,l){l==null&&(l=0);var y;!e.options.lineWrapping&&t==c&&(t=t.ch?Ze(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,c=t.sticky=="before"?Ze(t.line,t.ch+1,"before"):t);for(var K=0;K<5;K++){var ee=!1,ie=li(e,t),oe=!c||c==t?ie:li(e,c);y={left:Math.min(ie.left,oe.left),top:Math.min(ie.top,oe.top)-l,right:Math.max(ie.left,oe.left),bottom:Math.max(ie.bottom,oe.bottom)+l};var ce=gs(e,y),De=e.doc.scrollTop,Fe=e.doc.scrollLeft;if(ce.scrollTop!=null&&(Ma(e,ce.scrollTop),Math.abs(e.doc.scrollTop-De)>1&&(ee=!0)),ce.scrollLeft!=null&&(da(e,ce.scrollLeft),Math.abs(e.doc.scrollLeft-Fe)>1&&(ee=!0)),!ee)break}return y}function Ji(e,t){var c=gs(e,t);c.scrollTop!=null&&Ma(e,c.scrollTop),c.scrollLeft!=null&&da(e,c.scrollLeft)}function gs(e,t){var c=e.display,l=zn(e.display);t.top<0&&(t.top=0);var y=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:c.scroller.scrollTop,K=Gn(e),ee={};t.bottom-t.top>K&&(t.bottom=t.top+K);var ie=e.doc.height+gi(c),oe=t.top<l,ce=t.bottom>ie-l;if(t.top<y)ee.scrollTop=oe?0:t.top;else if(t.bottom>y+K){var De=Math.min(t.top,(ce?ie:t.bottom)-K);De!=y&&(ee.scrollTop=De)}var Fe=e.options.fixedGutter?0:c.gutters.offsetWidth,tt=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:c.scroller.scrollLeft-Fe,Qe=ei(e)-c.gutters.offsetWidth,St=t.right-t.left>Qe;return St&&(t.right=t.left+Qe),t.left<10?ee.scrollLeft=0:t.left<tt?ee.scrollLeft=Math.max(0,t.left+Fe-(St?0:10)):t.right>Qe+tt-3&&(ee.scrollLeft=t.right+(St?0:10)-Qe),ee}function vs(e,t){if(t==null)return;qa(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function _a(e){qa(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Pa(e,t,c){(t!=null||c!=null)&&qa(e),t!=null&&(e.curOp.scrollLeft=t),c!=null&&(e.curOp.scrollTop=c)}function Qo(e,t){qa(e),e.curOp.scrollToPos=t}function qa(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var c=Rr(e,t.from),l=Rr(e,t.to);Bs(e,c,l,t.margin)}}function Bs(e,t,c,l){var y=gs(e,{left:Math.min(t.left,c.left),top:Math.min(t.top,c.top)-l,right:Math.max(t.right,c.right),bottom:Math.max(t.bottom,c.bottom)+l});Pa(e,y.scrollLeft,y.scrollTop)}function Ma(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;M||_s(e,{top:t}),Ws(e,t,!0),M&&_s(e),Ua(e,100)}function Ws(e,t,c){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!c)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function da(e,t,c,l){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(c?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!l)return;e.doc.scrollLeft=t,Vs(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function ka(e){var t=e.display,c=t.gutters.offsetWidth,l=Math.round(e.doc.height+gi(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?c:0,docHeight:l,scrollHeight:l+kn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:c}}var ha=function(e,t,c){this.cm=c;var l=this.vert=f("div",[f("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),y=this.horiz=f("div",[f("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");l.tabIndex=y.tabIndex=-1,e(l),e(y),ke(l,"scroll",function(){l.clientHeight&&t(l.scrollTop,"vertical")}),ke(y,"scroll",function(){y.clientWidth&&t(y.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,H&&N<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ha.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,c=e.scrollHeight>e.clientHeight+1,l=e.nativeBarWidth;if(c){this.vert.style.display="block",this.vert.style.bottom=t?l+"px":"0";var y=e.viewHeight-(t?l:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+y)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=c?l+"px":"0",this.horiz.style.left=e.barLeft+"px";var K=e.viewWidth-e.barLeft-(c?l:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+K)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(l==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:c?l:0,bottom:t?l:0}},ha.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ha.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ha.prototype.zeroWidthHack=function(){var e=i&&!u?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new te,this.disableVert=new te},ha.prototype.enableZeroWidthBar=function(e,t,c){e.style.pointerEvents="auto";function l(){var y=e.getBoundingClientRect(),K=c=="vert"?document.elementFromPoint(y.right-1,(y.top+y.bottom)/2):document.elementFromPoint((y.right+y.left)/2,y.bottom-1);K!=e?e.style.pointerEvents="none":t.set(1e3,l)}t.set(1e3,l)},ha.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Na=function(){};Na.prototype.update=function(){return{bottom:0,right:0}},Na.prototype.setScrollLeft=function(){},Na.prototype.setScrollTop=function(){},Na.prototype.clear=function(){};function ba(e,t){t||(t=ka(e));var c=e.display.barWidth,l=e.display.barHeight;Hs(e,t);for(var y=0;y<4&&c!=e.display.barWidth||l!=e.display.barHeight;y++)c!=e.display.barWidth&&e.options.lineWrapping&&Dr(e),Hs(e,ka(e)),c=e.display.barWidth,l=e.display.barHeight}function Hs(e,t){var c=e.display,l=c.scrollbars.update(t);c.sizer.style.paddingRight=(c.barWidth=l.right)+"px",c.sizer.style.paddingBottom=(c.barHeight=l.bottom)+"px",c.heightForcer.style.borderBottom=l.bottom+"px solid transparent",l.right&&l.bottom?(c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=l.bottom+"px",c.scrollbarFiller.style.width=l.right+"px"):c.scrollbarFiller.style.display="",l.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=l.bottom+"px",c.gutterFiller.style.width=t.gutterWidth+"px"):c.gutterFiller.style.display=""}var Ks={native:ha,null:Na};function Gs(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&v(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ks[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ke(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,c){c=="horizontal"?da(e,t):Ma(e,t)},e),e.display.scrollbars.addClass&&j(e.display.wrapper,e.display.scrollbars.addClass)}var Zo=0;function fa(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:++Zo},Gt(e.curOp)}function pa(e){var t=e.curOp;t&&tn(t,function(c){for(var l=0;l<c.ops.length;l++)c.ops[l].cm.curOp=null;qo(c)})}function qo(e){for(var t=e.ops,c=0;c<t.length;c++)el(t[c]);for(var l=0;l<t.length;l++)tl(t[l]);for(var y=0;y<t.length;y++)nl(t[y]);for(var K=0;K<t.length;K++)il(t[K]);for(var ee=0;ee<t.length;ee++)rl(t[ee])}function el(e){var t=e.cm,c=t.display;sl(t),e.updateMaxLine&&$r(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<c.viewFrom||e.scrollToPos.to.line>=c.viewTo)||c.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new es(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&ys(e.cm,e.update)}function nl(e){var t=e.cm,c=t.display;e.updatedDisplay&&Dr(t),e.barMeasure=ka(t),c.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=vi(t,c.maxLine,c.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(c.scroller.clientWidth,c.sizer.offsetLeft+e.adjustWidthTo+kn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,c.sizer.offsetLeft+e.adjustWidthTo-ei(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=c.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&da(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var c=e.focus&&e.focus==U();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,c),(e.updatedDisplay||e.startHeight!=t.doc.height)&&ba(t,e.barMeasure),e.updatedDisplay&&Es(t,e.barMeasure),e.selectionChanged&&bn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),c&&na(e.cm)}function rl(e){var t=e.cm,c=t.display,l=t.doc;if(e.updatedDisplay&&zs(t,e.update),c.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(c.wheelStartX=c.wheelStartY=null),e.scrollTop!=null&&Ws(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&da(t,e.scrollLeft,!0,!0),e.scrollToPos){var y=ms(t,R(l,e.scrollToPos.from),R(l,e.scrollToPos.to),e.scrollToPos.margin);ia(t,y)}var K=e.maybeHiddenMarkers,ee=e.maybeUnhiddenMarkers;if(K)for(var ie=0;ie<K.length;++ie)K[ie].lines.length||Ge(K[ie],"hide");if(ee)for(var oe=0;oe<ee.length;++oe)ee[oe].lines.length&&Ge(ee[oe],"unhide");c.wrapper.offsetHeight&&(l.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ge(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Pr(e,t){if(e.curOp)return t();fa(e);try{return t()}finally{pa(e)}}function er(e,t){return function(){if(e.curOp)return t.apply(e,arguments);fa(e);try{return t.apply(e,arguments)}finally{pa(e)}}}function pr(e){return function(){if(this.curOp)return e.apply(this,arguments);fa(this);try{return e.apply(this,arguments)}finally{pa(this)}}}function tr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);fa(t);try{return e.apply(this,arguments)}finally{pa(t)}}}function Ua(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,B(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var c=+new Date+e.options.workTime,l=Ot(e,t.highlightFrontier),y=[];t.iter(l.line,Math.min(t.first+t.size,e.display.viewTo+500),function(K){if(l.line>=e.display.viewFrom){var ee=K.styles,ie=K.text.length>e.options.maxHighlightLength?Wt(t.mode,l.state):null,oe=Ie(e,K,l,!0);ie&&(l.state=ie),K.styles=oe.styles;var ce=K.styleClasses,De=oe.classes;De?K.styleClasses=De:ce&&(K.styleClasses=null);for(var Fe=!ee||ee.length!=K.styles.length||ce!=De&&(!ce||!De||ce.bgClass!=De.bgClass||ce.textClass!=De.textClass),tt=0;!Fe&&tt<ee.length;++tt)Fe=ee[tt]!=K.styles[tt];Fe&&y.push(l.line),K.stateAfter=l.save(),l.nextLine()}else K.text.length<=e.options.maxHighlightLength&&$t(e,K.text,l),K.stateAfter=l.line%5==0?l.save():null,l.nextLine();if(+new Date>c)return Ua(e,e.options.workDelay),!0}),t.highlightFrontier=l.line,t.modeFrontier=Math.max(t.modeFrontier,l.line),y.length&&Pr(e,function(){for(var K=0;K<y.length;K++)sr(e,y[K],"text")})}var es=function(e,t,c){var l=e.display;this.viewport=t,this.visible=Gr(l,e.doc,t),this.editorIsHidden=!l.wrapper.offsetWidth,this.wrapperHeight=l.wrapper.clientHeight,this.wrapperWidth=l.wrapper.clientWidth,this.oldDisplayWidth=ei(e),this.force=c,this.dims=Ui(e),this.events=[]};es.prototype.signal=function(e,t){Se(e,t)&&this.events.push(arguments)},es.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ge.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=kn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=kn(e)+"px",t.scrollbarsClipped=!0)}function ol(e){if(e.hasFocus())return null;var t=U();if(!t||!_(e.display.lineDiv,t))return null;var c={activeElt:t};if(window.getSelection){var l=window.getSelection();l.anchorNode&&l.extend&&_(e.display.lineDiv,l.anchorNode)&&(c.anchorNode=l.anchorNode,c.anchorOffset=l.anchorOffset,c.focusNode=l.focusNode,c.focusOffset=l.focusOffset)}return c}function ll(e){if(!e||!e.activeElt||e.activeElt==U())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&_(document.body,e.anchorNode)&&_(document.body,e.focusNode)){var t=window.getSelection(),c=document.createRange();c.setEnd(e.anchorNode,e.anchorOffset),c.collapse(!1),t.removeAllRanges(),t.addRange(c),t.extend(e.focusNode,e.focusOffset)}}function ys(e,t){var c=e.display,l=e.doc;if(t.editorIsHidden)return Pn(e),!1;if(!t.force&&t.visible.from>=c.viewFrom&&t.visible.to<=c.viewTo&&(c.updateLineNumbers==null||c.updateLineNumbers>=c.viewTo)&&c.renderedView==c.view&&en(e)==0)return!1;Xs(e)&&(Pn(e),t.dims=Ui(e));var y=l.first+l.size,K=Math.max(t.visible.from-e.options.viewportMargin,l.first),ee=Math.min(y,t.visible.to+e.options.viewportMargin);c.viewFrom<K&&K-c.viewFrom<20&&(K=Math.max(l.first,c.viewFrom)),c.viewTo>ee&&c.viewTo-ee<20&&(ee=Math.min(y,c.viewTo)),yi&&(K=Hr(e.doc,K),ee=kr(e.doc,ee));var ie=K!=c.viewFrom||ee!=c.viewTo||c.lastWrapHeight!=t.wrapperHeight||c.lastWrapWidth!=t.wrapperWidth;$n(e,K,ee),c.viewOffset=vr($(e.doc,c.viewFrom)),e.display.mover.style.top=c.viewOffset+"px";var oe=en(e);if(!ie&&oe==0&&!t.force&&c.renderedView==c.view&&(c.updateLineNumbers==null||c.updateLineNumbers>=c.viewTo))return!1;var ce=ol(e);return oe>4&&(c.lineDiv.style.display="none"),ul(e,c.updateLineNumbers,t.dims),oe>4&&(c.lineDiv.style.display=""),c.renderedView=c.view,ll(ce),b(c.cursorDiv),b(c.selectionDiv),c.gutters.style.height=c.sizer.style.minHeight=0,ie&&(c.lastWrapHeight=t.wrapperHeight,c.lastWrapWidth=t.wrapperWidth,Ua(e,400)),c.updateLineNumbers=null,!0}function zs(e,t){for(var c=t.viewport,l=!0;;l=!1){if(!l||!e.options.lineWrapping||t.oldDisplayWidth==ei(e)){if(c&&c.top!=null&&(c={top:Math.min(e.doc.height+gi(e.display)-Gn(e),c.top)}),t.visible=Gr(e.display,e.doc,c),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else l&&(t.visible=Gr(e.display,e.doc,c));if(!ys(e,t))break;Dr(e);var y=ka(e);In(e),ba(e,y),Es(e,y),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 _s(e,t){var c=new es(e,t);if(ys(e,c)){Dr(e),zs(e,c);var l=ka(e);In(e),ba(e,l),Es(e,l),c.finish()}}function ul(e,t,c){var l=e.display,y=e.options.lineNumbers,K=l.lineDiv,ee=K.firstChild;function ie(St){var Ft=St.nextSibling;return n&&i&&e.display.currentWheelTarget==St?St.style.display="none":St.parentNode.removeChild(St),Ft}for(var oe=l.view,ce=l.viewFrom,De=0;De<oe.length;De++){var Fe=oe[De];if(!Fe.hidden)if(!Fe.node||Fe.node.parentNode!=K){var tt=ni(e,Fe,ce,c);K.insertBefore(tt,ee)}else{for(;ee!=Fe.node;)ee=ie(ee);var Qe=y&&t!=null&&t<=ce&&Fe.lineNumber;Fe.changes&&(re(Fe.changes,"gutter")>-1&&(Qe=!1),dn(e,Fe,ce,c)),Qe&&(b(Fe.lineNumber),Fe.lineNumber.appendChild(document.createTextNode(Mt(e.options,ce)))),ee=Fe.node.nextSibling}ce+=Fe.size}for(;ee;)ee=ie(ee)}function bs(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Es(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+kn(e)+"px"}function Vs(e){var t=e.display,c=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var l=Vn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,y=t.gutters.offsetWidth,K=l+"px",ee=0;ee<c.length;ee++)if(!c[ee].hidden){e.options.fixedGutter&&(c[ee].gutter&&(c[ee].gutter.style.left=K),c[ee].gutterBackground&&(c[ee].gutterBackground.style.left=K));var ie=c[ee].alignable;if(ie)for(var oe=0;oe<ie.length;oe++)ie[oe].style.left=K}e.options.fixedGutter&&(t.gutters.style.left=l+y+"px")}function Xs(e){if(!e.options.lineNumbers)return!1;var t=e.doc,c=Mt(e.options,t.first+t.size-1),l=e.display;if(c.length!=l.lineNumChars){var y=l.measure.appendChild(f("div",[f("div",c)],"CodeMirror-linenumber CodeMirror-gutter-elt")),K=y.firstChild.offsetWidth,ee=y.offsetWidth-K;return l.lineGutter.style.width="",l.lineNumInnerWidth=Math.max(K,l.lineGutter.offsetWidth-ee)+1,l.lineNumWidth=l.lineNumInnerWidth+ee,l.lineNumChars=l.lineNumInnerWidth?c.length:-1,l.lineGutter.style.width=l.lineNumWidth+"px",bs(e.display),!0}return!1}function xs(e,t){for(var c=[],l=!1,y=0;y<e.length;y++){var K=e[y],ee=null;if(typeof K!="string"&&(ee=K.style,K=K.className),K=="CodeMirror-linenumbers")if(t)l=!0;else continue;c.push({className:K,style:ee})}return t&&!l&&c.push({className:"CodeMirror-linenumbers",style:null}),c}function Ys(e){var t=e.gutters,c=e.gutterSpecs;b(t),e.lineGutter=null;for(var l=0;l<c.length;++l){var y=c[l],K=y.className,ee=y.style,ie=t.appendChild(f("div",null,"CodeMirror-gutter "+K));ee&&(ie.style.cssText=ee),K=="CodeMirror-linenumbers"&&(e.lineGutter=ie,ie.style.width=(e.lineNumWidth||1)+"px")}t.style.display=c.length?"":"none",bs(e)}function Fa(e){Ys(e.display),Pi(e),Vs(e)}function cl(e,t,c,l){var y=this;this.input=c,y.scrollbarFiller=f("div",null,"CodeMirror-scrollbar-filler"),y.scrollbarFiller.setAttribute("cm-not-content","true"),y.gutterFiller=f("div",null,"CodeMirror-gutter-filler"),y.gutterFiller.setAttribute("cm-not-content","true"),y.lineDiv=C("div",null,"CodeMirror-code"),y.selectionDiv=f("div",null,null,"position: relative; z-index: 1"),y.cursorDiv=f("div",null,"CodeMirror-cursors"),y.measure=f("div",null,"CodeMirror-measure"),y.lineMeasure=f("div",null,"CodeMirror-measure"),y.lineSpace=C("div",[y.measure,y.lineMeasure,y.selectionDiv,y.cursorDiv,y.lineDiv],null,"position: relative; outline: none");var K=C("div",[y.lineSpace],"CodeMirror-lines");y.mover=f("div",[K],null,"position: relative"),y.sizer=f("div",[y.mover],"CodeMirror-sizer"),y.sizerWidth=null,y.heightForcer=f("div",null,null,"position: absolute; height: "+ge+"px; width: 1px;"),y.gutters=f("div",null,"CodeMirror-gutters"),y.lineGutter=null,y.scroller=f("div",[y.sizer,y.heightForcer,y.gutters],"CodeMirror-scroll"),y.scroller.setAttribute("tabIndex","-1"),y.wrapper=f("div",[y.scrollbarFiller,y.gutterFiller,y.scroller],"CodeMirror"),H&&N<8&&(y.gutters.style.zIndex=-1,y.scroller.style.paddingRight=0),!n&&!(M&&a)&&(y.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(y.wrapper):e(y.wrapper)),y.viewFrom=y.viewTo=t.first,y.reportedViewFrom=y.reportedViewTo=t.first,y.view=[],y.renderedView=null,y.externalMeasured=null,y.viewOffset=0,y.lastWrapHeight=y.lastWrapWidth=0,y.updateLineNumbers=null,y.nativeBarWidth=y.barHeight=y.barWidth=0,y.scrollbarsClipped=!1,y.lineNumWidth=y.lineNumInnerWidth=y.lineNumChars=null,y.alignWidgets=!1,y.cachedCharWidth=y.cachedTextHeight=y.cachedPaddingH=null,y.maxLine=null,y.maxLineLength=0,y.maxLineChanged=!1,y.wheelDX=y.wheelDY=y.wheelStartX=y.wheelStartY=null,y.shift=!1,y.selForContextMenu=null,y.activeTouch=null,y.gutterSpecs=xs(l.gutters,l.lineNumbers),Ys(y),c.init(y)}var ts=0,Fr=null;H?Fr=-.53:M?Fr=15:p?Fr=-.7:d&&(Fr=-1/3);function $s(e){var t=e.wheelDeltaX,c=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),c==null&&e.detail&&e.axis==e.VERTICAL_AXIS?c=e.detail:c==null&&(c=e.wheelDelta),{x:t,y:c}}function dl(e){var t=$s(e);return t.x*=Fr,t.y*=Fr,t}function Js(e,t){var c=$s(t),l=c.x,y=c.y,K=e.display,ee=K.scroller,ie=ee.scrollWidth>ee.clientWidth,oe=ee.scrollHeight>ee.clientHeight;if(!(l&&ie||y&&oe))return;if(y&&i&&n){e:for(var ce=t.target,De=K.view;ce!=ee;ce=ce.parentNode)for(var Fe=0;Fe<De.length;Fe++)if(De[Fe].node==ce){e.display.currentWheelTarget=ce;break e}}if(l&&!M&&!m&&Fr!=null){y&&oe&&Ma(e,Math.max(0,ee.scrollTop+y*Fr)),da(e,Math.max(0,ee.scrollLeft+l*Fr)),(!y||y&&oe)&&ue(t),K.wheelStartX=null;return}if(y&&Fr!=null){var tt=y*Fr,Qe=e.doc.scrollTop,St=Qe+K.wrapper.clientHeight;tt<0?Qe=Math.max(0,Qe+tt-50):St=Math.min(e.doc.height,St+tt+50),_s(e,{top:Qe,bottom:St})}ts<20&&(K.wheelStartX==null?(K.wheelStartX=ee.scrollLeft,K.wheelStartY=ee.scrollTop,K.wheelDX=l,K.wheelDY=y,setTimeout(function(){if(K.wheelStartX==null)return;var Ft=ee.scrollLeft-K.wheelStartX,Kt=ee.scrollTop-K.wheelStartY,Qt=Kt&&K.wheelDY&&Kt/K.wheelDY||Ft&&K.wheelDX&&Ft/K.wheelDX;if(K.wheelStartX=K.wheelStartY=null,!Qt)return;Fr=(Fr*ts+Qt)/(ts+1),++ts},200)):(K.wheelDX+=l,K.wheelDY+=y))}var jr=function(e,t){this.ranges=e,this.primIndex=t};jr.prototype.primary=function(){return this.ranges[this.primIndex]},jr.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 c=this.ranges[t],l=e.ranges[t];if(!an(c.anchor,l.anchor)||!an(c.head,l.head))return!1}return!0},jr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new pi(At(this.ranges[t].anchor),At(this.ranges[t].head));return new jr(e,this.primIndex)},jr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},jr.prototype.contains=function(e,t){t||(t=e);for(var c=0;c<this.ranges.length;c++){var l=this.ranges[c];if(kt(t,l.from())>=0&&kt(e,l.to())<=0)return c}return-1};var pi=function(e,t){this.anchor=e,this.head=t};pi.prototype.from=function(){return nn(this.anchor,this.head)},pi.prototype.to=function(){return pn(this.anchor,this.head)},pi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function zr(e,t,c){var l=e&&e.options.selectionsMayTouch,y=t[c];t.sort(function(tt,Qe){return kt(tt.from(),Qe.from())}),c=re(t,y);for(var K=1;K<t.length;K++){var ee=t[K],ie=t[K-1],oe=kt(ie.to(),ee.from());if(l&&!ee.empty()?oe>0:oe>=0){var ce=nn(ie.from(),ee.from()),De=pn(ie.to(),ee.to()),Fe=ie.empty()?ee.from()==ee.head:ie.from()==ie.head;K<=c&&--c,t.splice(--K,2,new pi(Fe?De:ce,Fe?ce:De))}}return new jr(t,c)}function ra(e,t){return new jr([new pi(e,t||e)],0)}function aa(e){return e.text?Ze(e.from.line+e.text.length-1,Ve(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Qs(e,t){if(kt(e,t.from)<0)return e;if(kt(e,t.to)<=0)return aa(t);var c=e.line+t.text.length-(t.to.line-t.from.line)-1,l=e.ch;return e.line==t.to.line&&(l+=aa(t).ch-t.to.ch),Ze(c,l)}function Ss(e,t){for(var c=[],l=0;l<e.sel.ranges.length;l++){var y=e.sel.ranges[l];c.push(new pi(Qs(y.anchor,t),Qs(y.head,t)))}return zr(e.cm,c,e.sel.primIndex)}function Zs(e,t,c){return e.line==t.line?Ze(c.line,e.ch-t.ch+c.ch):Ze(c.line+(e.line-t.line),e.ch)}function hl(e,t,c){for(var l=[],y=Ze(e.first,0),K=y,ee=0;ee<t.length;ee++){var ie=t[ee],oe=Zs(ie.from,y,K),ce=Zs(aa(ie),y,K);if(y=ie.to,K=ce,c=="around"){var De=e.sel.ranges[ee],Fe=kt(De.head,De.anchor)<0;l[ee]=new pi(Fe?ce:oe,Fe?oe:ce)}else l[ee]=new pi(oe,oe)}return new jr(l,e.sel.primIndex)}function Ts(e){e.doc.mode=gt(e.options,e.doc.modeOption),ja(e)}function ja(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,Ua(e,100),e.state.modeGen++,e.curOp&&Pi(e)}function qs(e,t){return t.from.ch==0&&t.to.ch==0&&Ve(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ws(e,t,c,l){function y(rn){return c?c[rn]:null}function K(rn,Zt,cn){Qr(rn,Zt,cn,l),rt(rn,"change",rn,t)}function ee(rn,Zt){for(var cn=[],An=rn;An<Zt;++An)cn.push(new fr(ce[An],y(An),l));return cn}var ie=t.from,oe=t.to,ce=t.text,De=$(e,ie.line),Fe=$(e,oe.line),tt=Ve(ce),Qe=y(ce.length-1),St=oe.line-ie.line;if(t.full)e.insert(0,ee(0,ce.length)),e.remove(ce.length,e.size-ce.length);else if(qs(e,t)){var Ft=ee(0,ce.length-1);K(Fe,Fe.text,Qe),St&&e.remove(ie.line,St),Ft.length&&e.insert(ie.line,Ft)}else if(De==Fe)if(ce.length==1)K(De,De.text.slice(0,ie.ch)+tt+De.text.slice(oe.ch),Qe);else{var Kt=ee(1,ce.length-1);Kt.push(new fr(tt+De.text.slice(oe.ch),Qe,l)),K(De,De.text.slice(0,ie.ch)+ce[0],y(0)),e.insert(ie.line+1,Kt)}else if(ce.length==1)K(De,De.text.slice(0,ie.ch)+ce[0]+Fe.text.slice(oe.ch),y(0)),e.remove(ie.line+1,St);else{K(De,De.text.slice(0,ie.ch)+ce[0],y(0)),K(Fe,tt+Fe.text.slice(oe.ch),Qe);var Qt=ee(1,ce.length-1);St>1&&e.remove(ie.line+1,St-1),e.insert(ie.line+1,Qt)}rt(e,"change",e,t)}function sa(e,t,c){function l(y,K,ee){if(y.linked)for(var ie=0;ie<y.linked.length;++ie){var oe=y.linked[ie];if(oe.doc==K)continue;var ce=ee&&oe.sharedHist;if(c&&!ce)continue;t(oe.doc,ce),l(oe.doc,y,ce)}}l(e,null,!0)}function eo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Br(e),Ts(e),to(e),e.options.lineWrapping||$r(e),e.options.mode=t.modeOption,Pi(e)}function to(e){(e.doc.direction=="rtl"?j:v)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Pr(e,function(){to(e),Pi(e)})}function ns(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 Cs(e,t){var c={from:At(t.from),to:aa(t),text:Z(e,t.from,t.to)};return ro(e,c,t.from.line,t.to.line+1),sa(e,function(l){return ro(l,c,t.from.line,t.to.line+1)},!0),c}function no(e){for(;e.length;){var t=Ve(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return no(e.done),Ve(e.done);if(e.done.length&&!Ve(e.done).ranges)return Ve(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ve(e.done)}function io(e,t,c,l){var y=e.history;y.undone.length=0;var K=+new Date,ee,ie;if((y.lastOp==l||y.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&y.lastModTime>K-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(ee=pl(y,y.lastOp==l)))ie=Ve(ee.changes),kt(t.from,t.to)==0&&kt(t.from,ie.to)==0?ie.to=aa(t):ee.changes.push(Cs(e,t));else{var oe=Ve(y.done);for((!oe||!oe.ranges)&&is(e.sel,y.done),ee={changes:[Cs(e,t)],generation:y.generation},y.done.push(ee);y.done.length>y.undoDepth;)y.done.shift(),y.done[0].ranges||y.done.shift()}y.done.push(c),y.generation=++y.maxGeneration,y.lastModTime=y.lastSelTime=K,y.lastOp=y.lastSelOp=l,y.lastOrigin=y.lastSelOrigin=t.origin,ie||Ge(e,"historyAdded")}function ml(e,t,c,l){var y=t.charAt(0);return y=="*"||y=="+"&&c.ranges.length==l.ranges.length&&c.somethingSelected()==l.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,c,l){var y=e.history,K=l&&l.origin;c==y.lastSelOp||K&&y.lastSelOrigin==K&&(y.lastModTime==y.lastSelTime&&y.lastOrigin==K||ml(e,K,Ve(y.done),t))?y.done[y.done.length-1]=t:is(t,y.done),y.lastSelTime=+new Date,y.lastSelOrigin=K,y.lastSelOp=c,l&&l.clearRedo!==!1&&no(y.undone)}function is(e,t){var c=Ve(t);c&&c.ranges&&c.equals(e)||t.push(e)}function ro(e,t,c,l){var y=t["spans_"+e.id],K=0;e.iter(Math.max(e.first,c),Math.min(e.first+e.size,l),function(ee){ee.markedSpans&&((y||(y=t["spans_"+e.id]={}))[K]=ee.markedSpans),++K})}function vl(e){if(!e)return null;for(var t,c=0;c<e.length;++c)e[c].marker.explicitlyCleared?t||(t=e.slice(0,c)):t&&t.push(e[c]);return t?t.length?t:null:e}function yl(e,t){var c=t["spans_"+e.id];if(!c)return null;for(var l=[],y=0;y<t.text.length;++y)l.push(vl(c[y]));return l}function ao(e,t){var c=yl(e,t),l=ji(e,t);if(!c)return l;if(!l)return c;for(var y=0;y<c.length;++y){var K=c[y],ee=l[y];if(K&&ee){e:for(var ie=0;ie<ee.length;++ie){for(var oe=ee[ie],ce=0;ce<K.length;++ce)if(K[ce].marker==oe.marker)continue e;K.push(oe)}}else ee&&(c[y]=ee)}return c}function Ea(e,t,c){for(var l=[],y=0;y<e.length;++y){var K=e[y];if(K.ranges){l.push(c?jr.prototype.deepCopy.call(K):K);continue}var ee=K.changes,ie=[];l.push({changes:ie});for(var oe=0;oe<ee.length;++oe){var ce=ee[oe],De=void 0;if(ie.push({from:ce.from,to:ce.to,text:ce.text}),t)for(var Fe in ce)(De=Fe.match(/^spans_(\d+)$/))&&(re(t,Number(De[1]))>-1&&(Ve(ie)[Fe]=ce[Fe],delete ce[Fe]))}}return l}function Os(e,t,c,l){if(l){var y=e.anchor;if(c){var K=kt(t,y)<0;K!=kt(c,y)<0?(y=t,t=c):K!=kt(t,c)<0&&(t=c)}return new pi(y,t)}else return new pi(c||t,t)}function rs(e,t,c,l,y){y==null&&(y=e.cm&&(e.cm.display.shift||e.extend)),ur(e,new jr([Os(e.sel.primary(),t,c,y)],0),l)}function so(e,t,c){for(var l=[],y=e.cm&&(e.cm.display.shift||e.extend),K=0;K<e.sel.ranges.length;K++)l[K]=Os(e.sel.ranges[K],t[K],null,y);var ee=zr(e.cm,l,e.sel.primIndex);ur(e,ee,c)}function Rs(e,t,c,l){var y=e.sel.ranges.slice(0);y[t]=c,ur(e,zr(e.cm,y,e.sel.primIndex),l)}function oo(e,t,c,l){ur(e,ra(t,c),l)}function _l(e,t,c){var l={ranges:t.ranges,update:function(y){this.ranges=[];for(var K=0;K<y.length;K++)this.ranges[K]=new pi(R(e,y[K].anchor),R(e,y[K].head))},origin:c&&c.origin};return Ge(e,"beforeSelectionChange",e,l),e.cm&&Ge(e.cm,"beforeSelectionChange",e.cm,l),l.ranges!=t.ranges?zr(e.cm,l.ranges,l.ranges.length-1):t}function lo(e,t,c){var l=e.history.done,y=Ve(l);y&&y.ranges?(l[l.length-1]=t,as(e,t,c)):ur(e,t,c)}function ur(e,t,c){as(e,t,c),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,c)}function as(e,t,c){(Se(e,"beforeSelectionChange")||e.cm&&Se(e.cm,"beforeSelectionChange"))&&(t=_l(e,t,c));var l=c&&c.bias||(kt(t.primary().head,e.sel.primary().head)<0?-1:1);uo(e,ho(e,t,l,!0)),!(c&&c.scroll===!1)&&e.cm&&_a(e.cm)}function uo(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,we(e.cm)),rt(e,"cursorActivity",e)}function co(e){uo(e,ho(e,e.sel,null,!1))}function ho(e,t,c,l){for(var y,K=0;K<t.ranges.length;K++){var ee=t.ranges[K],ie=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[K],oe=ss(e,ee.anchor,ie&&ie.anchor,c,l),ce=ss(e,ee.head,ie&&ie.head,c,l);(y||oe!=ee.anchor||ce!=ee.head)&&(y||(y=t.ranges.slice(0,K)),y[K]=new pi(oe,ce))}return y?zr(e.cm,y,t.primIndex):t}function xa(e,t,c,l,y){var K=$(e,t.line);if(K.markedSpans)for(var ee=0;ee<K.markedSpans.length;++ee){var ie=K.markedSpans[ee],oe=ie.marker,ce="selectLeft"in oe?!oe.selectLeft:oe.inclusiveLeft,De="selectRight"in oe?!oe.selectRight:oe.inclusiveRight;if((ie.from==null||(ce?ie.from<=t.ch:ie.from<t.ch))&&(ie.to==null||(De?ie.to>=t.ch:ie.to>t.ch))){if(y&&(Ge(oe,"beforeCursorEnter"),oe.explicitlyCleared))if(K.markedSpans){--ee;continue}else break;if(!oe.atomic)continue;if(c){var Fe=oe.find(l<0?1:-1),tt=void 0;if((l<0?De:ce)&&(Fe=fo(e,Fe,-l,Fe&&Fe.line==t.line?K:null)),Fe&&Fe.line==t.line&&(tt=kt(Fe,c))&&(l<0?tt<0:tt>0))return xa(e,Fe,t,l,y)}var Qe=oe.find(l<0?-1:1);return(l<0?ce:De)&&(Qe=fo(e,Qe,l,Qe.line==t.line?K:null)),Qe?xa(e,Qe,t,l,y):null}}return t}function ss(e,t,c,l,y){var K=l||1,ee=xa(e,t,c,K,y)||!y&&xa(e,t,c,K,!0)||xa(e,t,c,-K,y)||!y&&xa(e,t,c,-K,!0);return ee||(e.cantEdit=!0,Ze(e.first,0))}function fo(e,t,c,l){return c<0&&t.ch==0?t.line>e.first?R(e,Ze(t.line-1)):null:c>0&&t.ch==(l||$(e,t.line)).text.length?t.line<e.first+e.size-1?Ze(t.line+1,0):null:new Ze(t.line,t.ch+c)}function po(e){e.setSelection(Ze(e.firstLine(),0),Ze(e.lastLine()),Oe)}function mo(e,t,c){var l={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return l.canceled=!0}};return c&&(l.update=function(y,K,ee,ie){y&&(l.from=R(e,y)),K&&(l.to=R(e,K)),ee&&(l.text=ee),ie!==void 0&&(l.origin=ie)}),Ge(e,"beforeChange",e,l),e.cm&&Ge(e.cm,"beforeChange",e.cm,l),l.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:l.from,to:l.to,text:l.text,origin:l.origin}}function Sa(e,t,c){if(e.cm){if(!e.cm.curOp)return er(e.cm,Sa)(e,t,c);if(e.cm.state.suppressEdits)return}if((Se(e,"beforeChange")||e.cm&&Se(e.cm,"beforeChange"))&&(t=mo(e,t,!0),!t))return;var l=Zi&&!c&&hr(e,t.from,t.to);if(l)for(var y=l.length-1;y>=0;--y)go(e,{from:l[y].from,to:l[y].to,text:y?[""]:t.text,origin:t.origin});else go(e,t)}function go(e,t){if(t.text.length==1&&t.text[0]==""&&kt(t.from,t.to)==0)return;var c=Ss(e,t);io(e,t,c,e.cm?e.cm.curOp.id:NaN),Ba(e,t,c,ji(e,t));var l=[];sa(e,function(y,K){!K&&re(l,y.history)==-1&&(bo(y.history,t),l.push(y.history)),Ba(y,t,null,ji(y,t))})}function os(e,t,c){var l=e.cm&&e.cm.state.suppressEdits;if(l&&!c)return;for(var y=e.history,K,ee=e.sel,ie=t=="undo"?y.done:y.undone,oe=t=="undo"?y.undone:y.done,ce=0;ce<ie.length&&!(K=ie[ce],c?K.ranges&&!K.equals(e.sel):!K.ranges);ce++);if(ce==ie.length)return;for(y.lastOrigin=y.lastSelOrigin=null;;)if(K=ie.pop(),K.ranges){if(is(K,oe),c&&!K.equals(e.sel)){ur(e,K,{clearRedo:!1});return}ee=K}else if(l){ie.push(K);return}else break;var De=[];is(ee,oe),oe.push({changes:De,generation:y.generation}),y.generation=K.generation||++y.maxGeneration;for(var Fe=Se(e,"beforeChange")||e.cm&&Se(e.cm,"beforeChange"),tt=function(Ft){var Kt=K.changes[Ft];if(Kt.origin=t,Fe&&!mo(e,Kt,!1))return ie.length=0,{};De.push(Cs(e,Kt));var Qt=Ft?Ss(e,Kt):Ve(ie);Ba(e,Kt,Qt,ao(e,Kt)),!Ft&&e.cm&&e.cm.scrollIntoView({from:Kt.from,to:aa(Kt)});var rn=[];sa(e,function(Zt,cn){!cn&&re(rn,Zt.history)==-1&&(bo(Zt.history,Kt),rn.push(Zt.history)),Ba(Zt,Kt,null,ao(Zt,Kt))})},Qe=K.changes.length-1;Qe>=0;--Qe){var St=tt(Qe);if(St)return St.v}}function vo(e,t){if(t==0)return;if(e.first+=t,e.sel=new jr(mt(e.sel.ranges,function(y){return new pi(Ze(y.anchor.line+t,y.anchor.ch),Ze(y.head.line+t,y.head.ch))}),e.sel.primIndex),e.cm){Pi(e.cm,e.first,e.first-t,t);for(var c=e.cm.display,l=c.viewFrom;l<c.viewTo;l++)sr(e.cm,l,"gutter")}}function Ba(e,t,c,l){if(e.cm&&!e.cm.curOp)return er(e.cm,Ba)(e,t,c,l);if(t.to.line<e.first){vo(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 y=t.text.length-1-(e.first-t.from.line);vo(e,y),t={from:Ze(e.first,0),to:Ze(t.to.line+y,t.to.ch),text:[Ve(t.text)],origin:t.origin}}var K=e.lastLine();t.to.line>K&&(t={from:t.from,to:Ze(K,$(e,K).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Z(e,t.from,t.to),c||(c=Ss(e,t)),e.cm?bl(e.cm,t,l):ws(e,t,l),as(e,c,Oe),e.cantEdit&&ss(e,Ze(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,c){var l=e.doc,y=e.display,K=t.from,ee=t.to,ie=!1,oe=K.line;e.options.lineWrapping||(oe=Pe(Xi($(l,K.line))),l.iter(oe,ee.line+1,function(Qe){if(Qe==y.maxLine)return ie=!0,!0})),l.sel.contains(t.from,t.to)>-1&&we(e),ws(l,t,c,Ar(e)),e.options.lineWrapping||(l.iter(oe,K.line+t.text.length,function(Qe){var St=Yr(Qe);St>y.maxLineLength&&(y.maxLine=Qe,y.maxLineLength=St,y.maxLineChanged=!0,ie=!1)}),ie&&(e.curOp.updateMaxLine=!0)),ci(l,K.line),Ua(e,400);var ce=t.text.length-(ee.line-K.line)-1;t.full?Pi(e):K.line==ee.line&&t.text.length==1&&!qs(e.doc,t)?sr(e,K.line,"text"):Pi(e,K.line,ee.line+1,ce);var De=Se(e,"changes"),Fe=Se(e,"change");if(Fe||De){var tt={from:K,to:ee,text:t.text,removed:t.removed,origin:t.origin};Fe&&rt(e,"change",e,tt),De&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(tt)}e.display.selForContextMenu=null}function Ta(e,t,c,l,y){var K;l||(l=c),kt(l,c)<0&&(K=[l,c],c=K[0],l=K[1]),typeof t=="string"&&(t=e.splitLines(t)),Sa(e,{from:c,to:l,text:t,origin:y})}function yo(e,t,c,l){c<e.line?e.line+=l:t<e.line&&(e.line=t,e.ch=0)}function _o(e,t,c,l){for(var y=0;y<e.length;++y){var K=e[y],ee=!0;if(K.ranges){K.copied||(K=e[y]=K.deepCopy(),K.copied=!0);for(var ie=0;ie<K.ranges.length;ie++)yo(K.ranges[ie].anchor,t,c,l),yo(K.ranges[ie].head,t,c,l);continue}for(var oe=0;oe<K.changes.length;++oe){var ce=K.changes[oe];if(c<ce.from.line)ce.from=Ze(ce.from.line+l,ce.from.ch),ce.to=Ze(ce.to.line+l,ce.to.ch);else if(t<=ce.to.line){ee=!1;break}}ee||(e.splice(0,y+1),y=0)}}function bo(e,t){var c=t.from.line,l=t.to.line,y=t.text.length-(l-c)-1;_o(e.done,c,l,y),_o(e.undone,c,l,y)}function Wa(e,t,c,l){var y=t,K=t;return typeof t=="number"?K=$(e,J(e,t)):y=Pe(t),y==null?null:(l(K,y)&&e.cm&&sr(e.cm,y,c),K)}function Ha(e){this.lines=e,this.parent=null;for(var t=0,c=0;c<e.length;++c)e[c].parent=this,t+=e[c].height;this.height=t}Ha.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var c=e,l=e+t;c<l;++c){var y=this.lines[c];this.height-=y.height,mn(y),rt(y,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,c){this.height+=c,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var l=0;l<t.length;++l)t[l].parent=this},iterN:function(e,t,c){for(var l=e+t;e<l;++e)if(c(this.lines[e]))return!0}};function Ka(e){this.children=e;for(var t=0,c=0,l=0;l<e.length;++l){var y=e[l];t+=y.chunkSize(),c+=y.height,y.parent=this}this.size=t,this.height=c,this.parent=null}Ka.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var c=0;c<this.children.length;++c){var l=this.children[c],y=l.chunkSize();if(e<y){var K=Math.min(t,y-e),ee=l.height;if(l.removeInner(e,K),this.height-=ee-l.height,y==K&&(this.children.splice(c--,1),l.parent=null),(t-=K)==0)break;e=0}else e-=y}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ha))){var ie=[];this.collapse(ie),this.children=[new Ha(ie)],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,c){this.size+=t.length,this.height+=c;for(var l=0;l<this.children.length;++l){var y=this.children[l],K=y.chunkSize();if(e<=K){if(y.insertInner(e,t,c),y.lines&&y.lines.length>50){for(var ee=y.lines.length%25+25,ie=ee;ie<y.lines.length;){var oe=new Ha(y.lines.slice(ie,ie+=25));y.height-=oe.height,this.children.splice(++l,0,oe),oe.parent=this}y.lines=y.lines.slice(0,ee),this.maybeSpill()}break}e-=K}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),c=new Ka(t);if(e.parent){e.size-=c.size,e.height-=c.height;var y=re(e.parent.children,e);e.parent.children.splice(y+1,0,c)}else{var l=new Ka(e.children);l.parent=e,e.children=[l,c],e=l}c.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,c){for(var l=0;l<this.children.length;++l){var y=this.children[l],K=y.chunkSize();if(e<K){var ee=Math.min(t,K-e);if(y.iterN(e,ee,c))return!0;if((t-=ee)==0)break;e=0}else e-=K}}};var Ga=function(e,t,c){if(c)for(var l in c)c.hasOwnProperty(l)&&(this[l]=c[l]);this.doc=e,this.node=t};Ga.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,c=this.line,l=Pe(c);if(l==null||!t)return;for(var y=0;y<t.length;++y)t[y]==this&&t.splice(y--,1);t.length||(c.widgets=null);var K=bi(this);he(c,Math.max(0,c.height-K)),e&&(Pr(e,function(){Eo(e,c,-K),sr(e,l,"widget")}),rt(e,"lineWidgetCleared",e,this,l))},Ga.prototype.changed=function(){var e=this,t=this.height,c=this.doc.cm,l=this.line;this.height=null;var y=bi(this)-t;if(!y)return;Cr(this.doc,l)||he(l,l.height+y),c&&Pr(c,function(){c.curOp.forceUpdate=!0,Eo(c,l,y),rt(c,"lineWidgetChanged",c,e,Pe(l))})},Ee(Ga);function Eo(e,t,c){vr(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&vs(e,c)}function El(e,t,c,l){var y=new Ga(e,c,l),K=e.cm;return K&&y.noHScroll&&(K.display.alignWidgets=!0),Wa(e,t,"widget",function(ee){var ie=ee.widgets||(ee.widgets=[]);if(y.insertAt==null?ie.push(y):ie.splice(Math.min(ie.length-1,Math.max(0,y.insertAt)),0,y),y.line=ee,K&&!Cr(e,ee)){var oe=vr(ee)<e.scrollTop;he(ee,ee.height+bi(y)),oe&&vs(K,y.height),K.curOp.forceUpdate=!0}return!0}),K&&rt(K,"lineWidgetAdded",K,y,typeof t=="number"?t:Pe(t)),y}var xo=0,oa=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++xo};oa.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&fa(e),Se(this,"clear")){var c=this.find();c&&rt(this,"clear",c.from,c.to)}for(var l=null,y=null,K=0;K<this.lines.length;++K){var ee=this.lines[K],ie=Oi(ee.markedSpans,this);e&&!this.collapsed?sr(e,Pe(ee),"text"):e&&(ie.to!=null&&(y=Pe(ee)),ie.from!=null&&(l=Pe(ee))),ee.markedSpans=Ri(ee.markedSpans,ie),ie.from==null&&this.collapsed&&!Cr(this.doc,ee)&&e&&he(ee,zn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var oe=0;oe<this.lines.length;++oe){var ce=Xi(this.lines[oe]),De=Yr(ce);De>e.display.maxLineLength&&(e.display.maxLine=ce,e.display.maxLineLength=De,e.display.maxLineChanged=!0)}l!=null&&e&&this.collapsed&&Pi(e,l,y+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&co(e.doc)),e&&rt(e,"markerCleared",e,this,l,y),t&&pa(e),this.parent&&this.parent.clear()},oa.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var c,l,y=0;y<this.lines.length;++y){var K=this.lines[y],ee=Oi(K.markedSpans,this);if(ee.from!=null&&(c=Ze(t?K:Pe(K),ee.from),e==-1))return c;if(ee.to!=null&&(l=Ze(t?K:Pe(K),ee.to),e==1))return l}return c&&{from:c,to:l}},oa.prototype.changed=function(){var e=this,t=this.find(-1,!0),c=this,l=this.doc.cm;if(!t||!l)return;Pr(l,function(){var y=t.line,K=Pe(t.line),ee=ui(l,K);if(ee&&(ln(ee),l.curOp.selectionChanged=l.curOp.forceUpdate=!0),l.curOp.updateMaxLine=!0,!Cr(c.doc,y)&&c.height!=null){var ie=c.height;c.height=null;var oe=bi(c)-ie;oe&&he(y,y.height+oe)}rt(l,"markerChanged",l,e)})},oa.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||re(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},oa.prototype.detachLine=function(e){if(this.lines.splice(re(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Ee(oa);function wa(e,t,c,l,y){if(l&&l.shared)return xl(e,t,c,l,y);if(e.cm&&!e.cm.curOp)return er(e.cm,wa)(e,t,c,l,y);var K=new oa(e,y),ee=kt(t,c);if(l&&O(l,K,!1),ee>0||ee==0&&K.clearWhenEmpty!==!1)return K;if(K.replacedWith&&(K.collapsed=!0,K.widgetNode=C("span",[K.replacedWith],"CodeMirror-widget"),l.handleMouseEvents||K.widgetNode.setAttribute("cm-ignore-events","true"),l.insertLeft&&(K.widgetNode.insertLeft=!0)),K.collapsed){if(Ni(e,t.line,t,c,K)||t.line!=c.line&&Ni(e,c.line,t,c,K))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ci()}K.addToHistory&&io(e,{from:t,to:c,origin:"markText"},e.sel,NaN);var ie=t.line,oe=e.cm,ce;if(e.iter(ie,c.line+1,function(Fe){oe&&K.collapsed&&!oe.options.lineWrapping&&Xi(Fe)==oe.display.maxLine&&(ce=!0),K.collapsed&&ie!=t.line&&he(Fe,0),Vi(Fe,new Di(K,ie==t.line?t.ch:null,ie==c.line?c.ch:null)),++ie}),K.collapsed&&e.iter(t.line,c.line+1,function(Fe){Cr(e,Fe)&&he(Fe,0)}),K.clearOnEnter&&ke(K,"beforeCursorEnter",function(){return K.clear()}),K.readOnly&&(ri(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),K.collapsed&&(K.id=++xo,K.atomic=!0),oe){if(ce&&(oe.curOp.updateMaxLine=!0),K.collapsed)Pi(oe,t.line,c.line+1);else if(K.className||K.startStyle||K.endStyle||K.css||K.attributes||K.title)for(var De=t.line;De<=c.line;De++)sr(oe,De,"text");K.atomic&&co(oe.doc),rt(oe,"markerAdded",oe,K)}return K}var za=function(e,t){this.markers=e,this.primary=t;for(var c=0;c<e.length;++c)e[c].parent=this};za.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();rt(this,"clear")},za.prototype.find=function(e,t){return this.primary.find(e,t)},Ee(za);function xl(e,t,c,l,y){l=O(l),l.shared=!1;var K=[wa(e,t,c,l,y)],ee=K[0],ie=l.widgetNode;return sa(e,function(oe){ie&&(l.widgetNode=ie.cloneNode(!0)),K.push(wa(oe,R(oe,t),R(oe,c),l,y));for(var ce=0;ce<oe.linked.length;++ce)if(oe.linked[ce].isParent)return;ee=Ve(K)}),new za(K,ee)}function So(e){return e.findMarks(Ze(e.first,0),e.clipPos(Ze(e.lastLine())),function(t){return t.parent})}function Sl(e,t){for(var c=0;c<t.length;c++){var l=t[c],y=l.find(),K=e.clipPos(y.from),ee=e.clipPos(y.to);if(kt(K,ee)){var ie=wa(e,K,ee,l.primary,l.primary.type);l.markers.push(ie),ie.parent=l}}}function Tl(e){for(var t=function(l){var y=e[l],K=[y.primary.doc];sa(y.primary.doc,function(oe){return K.push(oe)});for(var ee=0;ee<y.markers.length;ee++){var ie=y.markers[ee];re(K,ie.doc)==-1&&(ie.parent=null,y.markers.splice(ee--,1))}},c=0;c<e.length;c++)t(c)}var wl=0,br=function(e,t,c,l,y){if(!(this instanceof br))return new br(e,t,c,l,y);c==null&&(c=0),Ka.call(this,[new Ha([new fr("",null)])]),this.first=c,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=c;var K=Ze(c,0);this.sel=ra(K),this.history=new ns(null),this.id=++wl,this.modeOption=t,this.lineSep=l,this.direction=y=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ws(this,{from:K,to:K,text:e}),ur(this,ra(K),Oe)};br.prototype=xt(Ka.prototype,{constructor:br,iter:function(e,t,c){c?this.iterN(e-this.first,t-e,c):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var c=0,l=0;l<t.length;++l)c+=t[l].height;this.insertInner(e-this.first,t,c)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=ne(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:tr(function(e){var t=Ze(this.first,0),c=this.first+this.size-1;Sa(this,{from:t,to:Ze(c,$(this,c).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Pa(this.cm,0,0),ur(this,ra(t),Oe)}),replaceRange:function(e,t,c,l){t=R(this,t),c=c?R(this,c):t,Ta(this,e,t,c,l)},getRange:function(e,t,c){var l=Z(this,R(this,e),R(this,t));return c===!1?l:l.join(c||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Rt(this,e))return $(this,e)},getLineNumber:function(e){return Pe(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=$(this,e)),Xi(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return R(this,e)},getCursor:function(e){var t=this.sel.primary(),c;return e==null||e=="head"?c=t.head:e=="anchor"?c=t.anchor:e=="end"||e=="to"||e===!1?c=t.to():c=t.from(),c},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:tr(function(e,t,c){oo(this,R(this,typeof e=="number"?Ze(e,t||0):e),null,c)}),setSelection:tr(function(e,t,c){oo(this,R(this,e),R(this,t||e),c)}),extendSelection:tr(function(e,t,c){rs(this,R(this,e),t&&R(this,t),c)}),extendSelections:tr(function(e,t){so(this,Y(this,e),t)}),extendSelectionsBy:tr(function(e,t){var c=mt(this.sel.ranges,e);so(this,Y(this,c),t)}),setSelections:tr(function(e,t,c){if(!e.length)return;for(var l=[],y=0;y<e.length;y++)l[y]=new pi(R(this,e[y].anchor),R(this,e[y].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),ur(this,zr(this.cm,l,t),c)}),addSelection:tr(function(e,t,c){var l=this.sel.ranges.slice(0);l.push(new pi(R(this,e),R(this,t||e))),ur(this,zr(this.cm,l,l.length-1),c)}),getSelection:function(e){for(var t=this.sel.ranges,c,l=0;l<t.length;l++){var y=Z(this,t[l].from(),t[l].to());c=c?c.concat(y):y}return e===!1?c:c.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],c=this.sel.ranges,l=0;l<c.length;l++){var y=Z(this,c[l].from(),c[l].to());e!==!1&&(y=y.join(e||this.lineSeparator())),t[l]=y}return t},replaceSelection:function(e,t,c){for(var l=[],y=0;y<this.sel.ranges.length;y++)l[y]=e;this.replaceSelections(l,t,c||"+input")},replaceSelections:tr(function(e,t,c){for(var l=[],y=this.sel,K=0;K<y.ranges.length;K++){var ee=y.ranges[K];l[K]={from:ee.from(),to:ee.to(),text:this.splitLines(e[K]),origin:c}}for(var ie=t&&t!="end"&&hl(this,l,t),oe=l.length-1;oe>=0;oe--)Sa(this,l[oe]);ie?lo(this,ie):this.cm&&_a(this.cm)}),undo:tr(function(){os(this,"undo")}),redo:tr(function(){os(this,"redo")}),undoSelection:tr(function(){os(this,"undo",!0)}),redoSelection:tr(function(){os(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,c=0,l=0;l<e.done.length;l++)e.done[l].ranges||++t;for(var y=0;y<e.undone.length;y++)e.undone[y].ranges||++c;return{undo:t,redo:c}},clearHistory:function(){var e=this;this.history=new ns(this.history.maxGeneration),sa(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:Ea(this.history.done),undone:Ea(this.history.undone)}},setHistory:function(e){var t=this.history=new ns(this.history.maxGeneration);t.done=Ea(e.done.slice(0),null,!0),t.undone=Ea(e.undone.slice(0),null,!0)},setGutterMarker:tr(function(e,t,c){return Wa(this,e,"gutter",function(l){var y=l.gutterMarkers||(l.gutterMarkers={});return y[t]=c,!c&&_e(y)&&(l.gutterMarkers=null),!0})}),clearGutter:tr(function(e){var t=this;this.iter(function(c){c.gutterMarkers&&c.gutterMarkers[e]&&Wa(t,c,"gutter",function(){return c.gutterMarkers[e]=null,_e(c.gutterMarkers)&&(c.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Rt(this,e))return null;if(t=e,e=$(this,e),!e)return null}else if(t=Pe(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:tr(function(e,t,c){return Wa(this,e,t=="gutter"?"gutter":"class",function(l){var y=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!l[y])l[y]=c;else{if(w(c).test(l[y]))return!1;l[y]+=" "+c}return!0})}),removeLineClass:tr(function(e,t,c){return Wa(this,e,t=="gutter"?"gutter":"class",function(l){var y=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",K=l[y];if(K)if(c==null)l[y]=null;else{var ee=K.match(w(c));if(!ee)return!1;var ie=ee.index+ee[0].length;l[y]=K.slice(0,ee.index)+(!ee.index||ie==K.length?"":" ")+K.slice(ie)||null}else return!1;return!0})}),addLineWidget:tr(function(e,t,c){return El(this,e,t,c)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,c){return wa(this,R(this,e),R(this,t),c,c&&c.type||"range")},setBookmark:function(e,t){var c={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=R(this,e),wa(this,e,e,c,"bookmark")},findMarksAt:function(e){e=R(this,e);var t=[],c=$(this,e.line).markedSpans;if(c)for(var l=0;l<c.length;++l){var y=c[l];(y.from==null||y.from<=e.ch)&&(y.to==null||y.to>=e.ch)&&t.push(y.marker.parent||y.marker)}return t},findMarks:function(e,t,c){e=R(this,e),t=R(this,t);var l=[],y=e.line;return this.iter(e.line,t.line+1,function(K){var ee=K.markedSpans;if(ee)for(var ie=0;ie<ee.length;ie++){var oe=ee[ie];!(oe.to!=null&&y==e.line&&e.ch>=oe.to||oe.from==null&&y!=e.line||oe.from!=null&&y==t.line&&oe.from>=t.ch)&&(!c||c(oe.marker))&&l.push(oe.marker.parent||oe.marker)}++y}),l},getAllMarks:function(){var e=[];return this.iter(function(t){var c=t.markedSpans;if(c)for(var l=0;l<c.length;++l)c[l].from!=null&&e.push(c[l].marker)}),e},posFromIndex:function(e){var t,c=this.first,l=this.lineSeparator().length;return this.iter(function(y){var K=y.text.length+l;if(K>e)return t=e,!0;e-=K,++c}),R(this,Ze(c,t))},indexFromPos:function(e){e=R(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var c=this.lineSeparator().length;return this.iter(this.first,e.line,function(l){t+=l.text.length+c}),t},copy:function(e){var t=new br(ne(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,c=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<c&&(c=e.to);var l=new br(ne(this,t,c),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(l.history=this.history),(this.linked||(this.linked=[])).push({doc:l,sharedHist:e.sharedHist}),l.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Sl(l,So(this)),l},unlinkDoc:function(e){if(e instanceof Ii&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var c=this.linked[t];if(c.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Tl(So(this));break}if(e.history==this.history){var l=[e.id];sa(e,function(y){return l.push(y.id)},!0),e.history=new ns(null),e.history.done=Ea(this.history.done,l),e.history.undone=Ea(this.history.undone,l)}},iterLinkedDocs:function(e){sa(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):et(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:tr(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)})}),br.prototype.eachLine=br.prototype.iter;var To=0;function Cl(e){var t=this;if(wo(t),$e(t,e)||Un(t.display,e))return;ue(e),H&&(To=+new Date);var c=$i(t,e,!0),l=e.dataTransfer.files;if(!c||t.isReadOnly())return;if(l&&l.length&&window.FileReader&&window.File)for(var y=l.length,K=Array(y),ee=0,ie=function(){++ee==y&&er(t,function(){c=R(t.doc,c);var Qe={from:c,to:c,text:t.doc.splitLines(K.filter(function(St){return St!=null}).join(t.doc.lineSeparator())),origin:"paste"};Sa(t.doc,Qe),lo(t.doc,ra(R(t.doc,c),R(t.doc,aa(Qe))))})()},oe=function(Qe,St){if(t.options.allowDropFileTypes&&re(t.options.allowDropFileTypes,Qe.type)==-1){ie();return}var Ft=new FileReader;Ft.onerror=function(){return ie()},Ft.onload=function(){var Kt=Ft.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Kt)){ie();return}K[St]=Kt,ie()},Ft.readAsText(Qe)},ce=0;ce<l.length;ce++)oe(l[ce],ce);else{if(t.state.draggingText&&t.doc.sel.contains(c)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var De=e.dataTransfer.getData("Text");if(De){var Fe;if(t.state.draggingText&&!t.state.draggingText.copy&&(Fe=t.listSelections()),as(t.doc,ra(c,c)),Fe)for(var tt=0;tt<Fe.length;++tt)Ta(t.doc,"",Fe[tt].anchor,Fe[tt].head,"drag");t.replaceSelection(De,"around","paste"),t.display.input.focus()}}catch(Qe){}}}function Ol(e,t){if(H&&(!e.state.draggingText||+new Date-To<100)){me(t);return}if($e(e,t)||Un(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d){var c=f("img",null,null,"position: fixed; left: 0; top: 0;");c.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",m&&(c.width=c.height=1,e.display.wrapper.appendChild(c),c._top=c.offsetTop),t.dataTransfer.setDragImage(c,0,0),m&&c.parentNode.removeChild(c)}}function Rl(e,t){var c=$i(e,t);if(!c)return;var l=document.createDocumentFragment();Ki(e,c,l),e.display.dragCursor||(e.display.dragCursor=f("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),g(e.display.dragCursor,l)}function wo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Co(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),c=[],l=0;l<t.length;l++){var y=t[l].CodeMirror;y&&c.push(y)}c.length&&c[0].operation(function(){for(var K=0;K<c.length;K++)e(c[K])})}var Oo=!1;function Al(){if(Oo)return;Ll(),Oo=!0}function Ll(){var e;ke(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Co(Il)},100))}),ke(window,"blur",function(){return Co(Ir)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var la={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"},Va=0;Va<10;Va++)la[Va+48]=la[Va+96]=String(Va);for(var ls=65;ls<=90;ls++)la[ls]=String.fromCharCode(ls);for(var Xa=1;Xa<=12;Xa++)la[Xa+111]=la[Xa+63235]="F"+Xa;var qr={};qr.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"},qr.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"},qr.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"},qr.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"]},qr.default=i?qr.macDefault:qr.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var c,l,y,K,ee=0;ee<t.length-1;ee++){var ie=t[ee];if(/^(cmd|meta|m)$/i.test(ie))K=!0;else if(/^a(lt)?$/i.test(ie))c=!0;else if(/^(c|ctrl|control)$/i.test(ie))l=!0;else if(/^s(hift)?$/i.test(ie))y=!0;else throw new Error("Unrecognized modifier name: "+ie)}return c&&(e="Alt-"+e),l&&(e="Ctrl-"+e),K&&(e="Cmd-"+e),y&&(e="Shift-"+e),e}function Pl(e){var t={};for(var c in e)if(e.hasOwnProperty(c)){var l=e[c];if(/^(name|fallthrough|(de|at)tach)$/.test(c))continue;if(l=="..."){delete e[c];continue}for(var y=mt(c.split(" "),Dl),K=0;K<y.length;K++){var ee=void 0,ie=void 0;K==y.length-1?(ie=y.join(" "),ee=l):(ie=y.slice(0,K+1).join(" "),ee="...");var oe=t[ie];if(!oe)t[ie]=ee;else if(oe!=ee)throw new Error("Inconsistent bindings for "+ie)}delete e[c]}for(var ce in t)e[ce]=t[ce];return e}function Ca(e,t,c,l){t=us(t);var y=t.call?t.call(e,l):t[e];if(y===!1)return"nothing";if(y==="...")return"multi";if(y!=null&&c(y))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Ca(e,t.fallthrough,c,l);for(var K=0;K<t.fallthrough.length;K++){var ee=Ca(e,t.fallthrough[K],c,l);if(ee)return ee}}}function Ro(e){var t=typeof e=="string"?e:la[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Ao(e,t,c){var l=e;return t.altKey&&l!="Alt"&&(e="Alt-"+e),(T?t.metaKey:t.ctrlKey)&&l!="Ctrl"&&(e="Ctrl-"+e),(T?t.ctrlKey:t.metaKey)&&l!="Mod"&&(e="Cmd-"+e),!c&&t.shiftKey&&l!="Shift"&&(e="Shift-"+e),e}function Lo(e,t){if(m&&e.keyCode==34&&e.char)return!1;var c=la[e.keyCode];return c==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(c=e.code),Ao(c,e,t))}function us(e){return typeof e=="string"?qr[e]:e}function Oa(e,t){for(var c=e.doc.sel.ranges,l=[],y=0;y<c.length;y++){for(var K=t(c[y]);l.length&&kt(K.from,Ve(l).to)<=0;){var ee=l.pop();if(kt(ee.from,K.from)<0){K.from=ee.from;break}}l.push(K)}Pr(e,function(){for(var ie=l.length-1;ie>=0;ie--)Ta(e.doc,"",l[ie].from,l[ie].to,"+delete");_a(e)})}function As(e,t,c){var l=Te(e.text,t+c,c);return l<0||l>e.text.length?null:l}function Ls(e,t,c){var l=As(e,t.ch,c);return l==null?null:new Ze(t.line,l,c<0?"after":"before")}function Is(e,t,c,l,y){if(e){t.doc.direction=="rtl"&&(y=-y);var K=It(c,t.doc.direction);if(K){var ee=y<0?Ve(K):K[0],ie=y<0==(ee.level==1),oe=ie?"after":"before",ce;if(ee.level>0||t.doc.direction=="rtl"){var De=ti(t,c);ce=y<0?c.text.length-1:0;var Fe=Dn(t,De,ce).top;ce=We(function(tt){return Dn(t,De,tt).top==Fe},y<0==(ee.level==1)?ee.from:ee.to-1,ce),oe=="before"&&(ce=As(c,ce,1))}else ce=y<0?ee.to:ee.from;return new Ze(l,ce,oe)}}return new Ze(l,y<0?c.text.length:0,y<0?"before":"after")}function Ml(e,t,c,l){var y=It(t,e.doc.direction);if(!y)return Ls(t,c,l);c.ch>=t.text.length?(c.ch=t.text.length,c.sticky="before"):c.ch<=0&&(c.ch=0,c.sticky="after");var K=dt(y,c.ch,c.sticky),ee=y[K];if(e.doc.direction=="ltr"&&ee.level%2==0&&(l>0?ee.to>c.ch:ee.from<c.ch))return Ls(t,c,l);var ie=function(Qt,rn){return As(t,Qt instanceof Ze?Qt.ch:Qt,rn)},oe,ce=function(Qt){return e.options.lineWrapping?(oe=oe||ti(e,t),ca(e,t,oe,Qt)):{begin:0,end:t.text.length}},De=ce(c.sticky=="before"?ie(c,-1):c.ch);if(e.doc.direction=="rtl"||ee.level==1){var Fe=ee.level==1==l<0,tt=ie(c,Fe?1:-1);if(tt!=null&&(Fe?tt<=ee.to&&tt<=De.end:tt>=ee.from&&tt>=De.begin)){var Qe=Fe?"before":"after";return new Ze(c.line,tt,Qe)}}var St=function(Qt,rn,Zt){for(var cn=function(wi,nr){return nr?new Ze(c.line,ie(wi,1),"before"):new Ze(c.line,wi,"after")};Qt>=0&&Qt<y.length;Qt+=rn){var An=y[Qt],En=rn>0==(An.level!=1),Jn=En?Zt.begin:ie(Zt.end,-1);if(An.from<=Jn&&Jn<An.to)return cn(Jn,En);if(Jn=En?An.from:ie(An.to,-1),Zt.begin<=Jn&&Jn<Zt.end)return cn(Jn,En)}},Ft=St(K+l,l,De);if(Ft)return Ft;var Kt=l>0?De.end:ie(De.begin,-1);return Kt!=null&&!(l>0&&Kt==t.text.length)&&(Ft=St(l>0?0:y.length-1,l,ce(Kt)),Ft)?Ft:null}var Ya={selectAll:po,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Oe)},killLine:function(e){return Oa(e,function(t){if(t.empty()){var c=$(e.doc,t.head.line).text.length;return t.head.ch==c&&t.head.line<e.lastLine()?{from:t.head,to:Ze(t.head.line+1,0)}:{from:t.head,to:Ze(t.head.line,c)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Oa(e,function(t){return{from:Ze(t.from().line,0),to:R(e.doc,Ze(t.to().line+1,0))}})},delLineLeft:function(e){return Oa(e,function(t){return{from:Ze(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Oa(e,function(t){var c=e.charCoords(t.head,"div").top+5,l=e.coordsChar({left:0,top:c},"div");return{from:l,to:t.from()}})},delWrappedLineRight:function(e){return Oa(e,function(t){var c=e.charCoords(t.head,"div").top+5,l=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:c},"div");return{from:t.from(),to:l}})},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(Ze(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Ze(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Io(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Do(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 c=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:c},"div")},je)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var c=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:c},"div")},je)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var c=e.cursorCoords(t.head,"div").top+5,l=e.coordsChar({left:0,top:c},"div");return l.ch<e.getLine(l.line).search(/\S/)?Do(e,t.head):l},je)},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=[],c=e.listSelections(),l=e.options.tabSize,y=0;y<c.length;y++){var K=c[y].from(),ee=V(e.getLine(K.line),K.ch,l);t.push(be(l-ee%l))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Pr(e,function(){for(var t=e.listSelections(),c=[],l=0;l<t.length;l++){if(!t[l].empty())continue;var y=t[l].head,K=$(e.doc,y.line).text;if(K){if(y.ch==K.length&&(y=new Ze(y.line,y.ch-1)),y.ch>0)y=new Ze(y.line,y.ch+1),e.replaceRange(K.charAt(y.ch-1)+K.charAt(y.ch-2),Ze(y.line,y.ch-2),y,"+transpose");else if(y.line>e.doc.first){var ee=$(e.doc,y.line-1).text;ee&&(y=new Ze(y.line,1),e.replaceRange(K.charAt(0)+e.doc.lineSeparator()+ee.charAt(ee.length-1),Ze(y.line-1,ee.length-1),y,"+transpose"))}}c.push(new pi(y,y))}e.setSelections(c)})},newlineAndIndent:function(e){return Pr(e,function(){for(var t=e.listSelections(),c=t.length-1;c>=0;c--)e.replaceRange(e.doc.lineSeparator(),t[c].anchor,t[c].head,"+input");t=e.listSelections();for(var l=0;l<t.length;l++)e.indentLine(t[l].from().line,null,!0);_a(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Io(e,t){var c=$(e.doc,t),l=Xi(c);return l!=c&&(t=Pe(l)),Is(!0,e,l,t,1)}function kl(e,t){var c=$(e.doc,t),l=lr(c);return l!=c&&(t=Pe(l)),Is(!0,e,c,t,-1)}function Do(e,t){var c=Io(e,t.line),l=$(e.doc,c.line),y=It(l,e.doc.direction);if(!y||y[0].level==0){var K=Math.max(c.ch,l.text.search(/\S/)),ee=t.line==c.line&&t.ch<=K&&t.ch;return Ze(c.line,ee?0:K,c.sticky)}return c}function cs(e,t,c){if(typeof t=="string"&&(t=Ya[t],!t))return!1;e.display.input.ensurePolled();var l=e.display.shift,y=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),c&&(e.display.shift=!1),y=t(e)!=Ae}finally{e.display.shift=l,e.state.suppressEdits=!1}return y}function Nl(e,t,c){for(var l=0;l<e.state.keyMaps.length;l++){var y=Ca(t,e.state.keyMaps[l],c,e);if(y)return y}return e.options.extraKeys&&Ca(t,e.options.extraKeys,c,e)||Ca(t,e.options.keyMap,c,e)}var Ul=new te;function $a(e,t,c,l){var y=e.state.keySeq;if(y){if(Ro(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==y&&(e.state.keySeq=null,e.display.input.reset())}),Po(e,y+" "+t,c,l))return!0}return Po(e,t,c,l)}function Po(e,t,c,l){var y=Nl(e,t,l);return y=="multi"&&(e.state.keySeq=t),y=="handled"&&rt(e,"keyHandled",e,t,c),(y=="handled"||y=="multi")&&(ue(c),bn(e)),!!y}function Mo(e,t){var c=Lo(t,!0);return c?t.shiftKey&&!e.state.keySeq?$a(e,"Shift-"+c,t,function(l){return cs(e,l,!0)})||$a(e,c,t,function(l){if(typeof l=="string"?/^go[A-Z]/.test(l):l.motion)return cs(e,l)}):$a(e,c,t,function(l){return cs(e,l)}):!1}function Fl(e,t,c){return $a(e,"'"+c+"'",t,function(l){return cs(e,l,!0)})}var Ds=null;function ko(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=U(),$e(t,e))return;H&&N<11&&e.keyCode==27&&(e.returnValue=!1);var c=e.keyCode;t.display.shift=c==16||e.shiftKey;var l=Mo(t,e);m&&(Ds=l?c:null,!l&&c==88&&!He&&(i?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),M&&!i&&!l&&c==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),c==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&jl(t)}function jl(e){var t=e.display.lineDiv;j(t,"CodeMirror-crosshair");function c(l){(l.keyCode==18||!l.altKey)&&(v(t,"CodeMirror-crosshair"),ot(document,"keyup",c),ot(document,"mouseover",c))}ke(document,"keyup",c),ke(document,"mouseover",c)}function No(e){e.keyCode==16&&(this.doc.sel.shift=!1),$e(this,e)}function Uo(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Un(t.display,e)||$e(t,e)||e.ctrlKey&&!e.altKey||i&&e.metaKey)return;var c=e.keyCode,l=e.charCode;if(m&&c==Ds){Ds=null,ue(e);return}if(m&&(!e.which||e.which<10)&&Mo(t,e))return;var y=String.fromCharCode(l==null?c:l);if(y=="\b")return;if(Fl(t,e,y))return;t.display.input.onKeyPress(e)}var Bl=400,Ps=function(e,t,c){this.time=e,this.pos=t,this.button=c};Ps.prototype.compare=function(e,t,c){return this.time+Bl>e&&kt(t,this.pos)==0&&c==this.button};var Ja,Qa;function Wl(e,t){var c=+new Date;return Qa&&Qa.compare(c,e,t)?(Ja=Qa=null,"triple"):Ja&&Ja.compare(c,e,t)?(Qa=new Ps(c,e,t),Ja=null,"double"):(Ja=new Ps(c,e,t),Qa=null,"single")}function Fo(e){var t=this,c=t.display;if($e(t,e)||c.activeTouch&&c.input.supportsTouch())return;if(c.input.ensurePolled(),c.shift=e.shiftKey,Un(c,e)){n||(c.scroller.draggable=!1,setTimeout(function(){return c.scroller.draggable=!0},100));return}if(Ms(t,e))return;var l=$i(t,e),y=Xe(e),K=l?Wl(l,y):"single";if(window.focus(),y==1&&t.state.selectingText&&t.state.selectingText(e),l&&Hl(t,y,l,K,e))return;y==1?l?Gl(t,l,K,e):Le(e)==c.scroller&&ue(e):y==2?(l&&rs(t.doc,l),setTimeout(function(){return c.input.focus()},20)):y==3&&(A?t.display.input.onContextMenu(e):ya(t))}function Hl(e,t,c,l,y){var K="Click";return l=="double"?K="Double"+K:l=="triple"&&(K="Triple"+K),K=(t==1?"Left":t==2?"Middle":"Right")+K,$a(e,Ao(K,y),y,function(ee){if(typeof ee=="string"&&(ee=Ya[ee]),!ee)return!1;var ie=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ie=ee(e,c)!=Ae}finally{e.state.suppressEdits=!1}return ie})}function Kl(e,t,c){var l=e.getOption("configureMouse"),y=l?l(e,t,c):{};if(y.unit==null){var K=s?c.shiftKey&&c.metaKey:c.altKey;y.unit=K?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(y.extend==null||e.doc.extend)&&(y.extend=e.doc.extend||c.shiftKey),y.addNew==null&&(y.addNew=i?c.metaKey:c.ctrlKey),y.moveOnDrag==null&&(y.moveOnDrag=!(i?c.altKey:c.ctrlKey)),y}function Gl(e,t,c,l){H?setTimeout(B(na,e),0):e.curOp.focus=U();var y=Kl(e,c,l),K=e.doc.sel,ee;e.options.dragDrop&&ut&&!e.isReadOnly()&&c=="single"&&(ee=K.contains(t))>-1&&(kt((ee=K.ranges[ee]).from(),t)<0||t.xRel>0)&&(kt(ee.to(),t)>0||t.xRel<0)?zl(e,l,t,y):Vl(e,l,t,y)}function zl(e,t,c,l){var y=e.display,K=!1,ee=er(e,function(ce){n&&(y.scroller.draggable=!1),e.state.draggingText=!1,ot(y.wrapper.ownerDocument,"mouseup",ee),ot(y.wrapper.ownerDocument,"mousemove",ie),ot(y.scroller,"dragstart",oe),ot(y.scroller,"drop",ee),K||(ue(ce),l.addNew||rs(e.doc,c,null,null,l.extend),n&&!d||H&&N==9?setTimeout(function(){y.wrapper.ownerDocument.body.focus({preventScroll:!0}),y.input.focus()},20):y.input.focus())}),ie=function(ce){K=K||Math.abs(t.clientX-ce.clientX)+Math.abs(t.clientY-ce.clientY)>=10},oe=function(){return K=!0};n&&(y.scroller.draggable=!0),e.state.draggingText=ee,ee.copy=!l.moveOnDrag,y.scroller.dragDrop&&y.scroller.dragDrop(),ke(y.wrapper.ownerDocument,"mouseup",ee),ke(y.wrapper.ownerDocument,"mousemove",ie),ke(y.scroller,"dragstart",oe),ke(y.scroller,"drop",ee),ya(e),setTimeout(function(){return y.input.focus()},20)}function jo(e,t,c){if(c=="char")return new pi(t,t);if(c=="word")return e.findWordAt(t);if(c=="line")return new pi(Ze(t.line,0),R(e.doc,Ze(t.line+1,0)));var l=c(e,t);return new pi(l.from,l.to)}function Vl(e,t,c,l){var y=e.display,K=e.doc;ue(t);var ee,ie,oe=K.sel,ce=oe.ranges;if(l.addNew&&!l.extend?(ie=K.sel.contains(c),ie>-1?ee=ce[ie]:ee=new pi(c,c)):(ee=K.sel.primary(),ie=K.sel.primIndex),l.unit=="rectangle")l.addNew||(ee=new pi(c,c)),c=$i(e,t,!0,!0),ie=-1;else{var De=jo(e,c,l.unit);l.extend?ee=Os(ee,De.anchor,De.head,l.extend):ee=De}l.addNew?ie==-1?(ie=ce.length,ur(K,zr(e,ce.concat([ee]),ie),{scroll:!1,origin:"*mouse"})):ce.length>1&&ce[ie].empty()&&l.unit=="char"&&!l.extend?(ur(K,zr(e,ce.slice(0,ie).concat(ce.slice(ie+1)),0),{scroll:!1,origin:"*mouse"}),oe=K.sel):Rs(K,ie,ee,Ce):(ie=0,ur(K,new jr([ee],0),Ce),oe=K.sel);var Fe=c;function tt(Zt){if(kt(Fe,Zt)==0)return;if(Fe=Zt,l.unit=="rectangle"){for(var cn=[],An=e.options.tabSize,En=V($(K,c.line).text,c.ch,An),Jn=V($(K,Zt.line).text,Zt.ch,An),wi=Math.min(En,Jn),nr=Math.max(En,Jn),ki=Math.min(c.line,Zt.line),Mr=Math.min(e.lastLine(),Math.max(c.line,Zt.line));ki<=Mr;ki++){var Er=$(K,ki).text,Gi=Ue(Er,wi,An);wi==nr?cn.push(new pi(Ze(ki,Gi),Ze(ki,Gi))):Er.length>Gi&&cn.push(new pi(Ze(ki,Gi),Ze(ki,Ue(Er,nr,An))))}cn.length||cn.push(new pi(c,c)),ur(K,zr(e,oe.ranges.slice(0,ie).concat(cn),ie),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Zt)}else{var xr=ee,or=jo(e,Zt,l.unit),Qi=xr.anchor,zi;kt(or.anchor,Qi)>0?(zi=or.head,Qi=nn(xr.from(),or.anchor)):(zi=or.anchor,Qi=pn(xr.to(),or.head));var Fi=oe.ranges.slice(0);Fi[ie]=Xl(e,new pi(R(K,Qi),zi)),ur(K,zr(e,Fi,ie),Ce)}}var Qe=y.wrapper.getBoundingClientRect(),St=0;function Ft(Zt){var cn=++St,An=$i(e,Zt,!0,l.unit=="rectangle");if(!An)return;if(kt(An,Fe)!=0){e.curOp.focus=U(),tt(An);var En=Gr(y,K);(An.line>=En.to||An.line<En.from)&&setTimeout(er(e,function(){St==cn&&Ft(Zt)}),150)}else{var Jn=Zt.clientY<Qe.top?-20:Zt.clientY>Qe.bottom?20:0;Jn&&setTimeout(er(e,function(){if(St!=cn)return;y.scroller.scrollTop+=Jn,Ft(Zt)}),50)}}function Kt(Zt){e.state.selectingText=!1,St=Infinity,Zt&&(ue(Zt),y.input.focus()),ot(y.wrapper.ownerDocument,"mousemove",Qt),ot(y.wrapper.ownerDocument,"mouseup",rn),K.history.lastSelOrigin=null}var Qt=er(e,function(Zt){Zt.buttons===0||!Xe(Zt)?Kt(Zt):Ft(Zt)}),rn=er(e,Kt);e.state.selectingText=rn,ke(y.wrapper.ownerDocument,"mousemove",Qt),ke(y.wrapper.ownerDocument,"mouseup",rn)}function Xl(e,t){var c=t.anchor,l=t.head,y=$(e.doc,c.line);if(kt(c,l)==0&&c.sticky==l.sticky)return t;var K=It(y);if(!K)return t;var ee=dt(K,c.ch,c.sticky),ie=K[ee];if(ie.from!=c.ch&&ie.to!=c.ch)return t;var oe=ee+(ie.from==c.ch==(ie.level!=1)?0:1);if(oe==0||oe==K.length)return t;var ce;if(l.line!=c.line)ce=(l.line-c.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var De=dt(K,l.ch,l.sticky),Fe=De-ee||(l.ch-c.ch)*(ie.level==1?-1:1);De==oe-1||De==oe?ce=Fe<0:ce=Fe>0}var tt=K[oe+(ce?-1:0)],Qe=ce==(tt.level==1),St=Qe?tt.from:tt.to,Ft=Qe?"after":"before";return c.ch==St&&c.sticky==Ft?t:new pi(new Ze(c.line,St,Ft),l)}function Bo(e,t,c,l){var y,K;if(t.touches)y=t.touches[0].clientX,K=t.touches[0].clientY;else try{y=t.clientX,K=t.clientY}catch(tt){return!1}if(y>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;l&&ue(t);var ee=e.display,ie=ee.lineDiv.getBoundingClientRect();if(K>ie.bottom||!Se(e,c))return ye(t);K-=ie.top-ee.viewOffset;for(var oe=0;oe<e.display.gutterSpecs.length;++oe){var ce=ee.gutters.childNodes[oe];if(ce&&ce.getBoundingClientRect().right>=y){var De=ze(e.doc,K),Fe=e.display.gutterSpecs[oe];return Ge(e,c,e,De,Fe.className,t),ye(t)}}}function Ms(e,t){return Bo(e,t,"gutterClick",!0)}function Wo(e,t){if(Un(e.display,t)||Yl(e,t))return;if($e(e,t,"contextmenu"))return;A||e.display.input.onContextMenu(t)}function Yl(e,t){return Se(e,"gutterContextMenu")?Bo(e,t,"gutterContextMenu",!1):!1}function Ho(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),qt(e)}var Ra={toString:function(){return"CodeMirror.Init"}},Ko={},ds={};function $l(e){var t=e.optionHandlers;function c(l,y,K,ee){e.defaults[l]=y,K&&(t[l]=ee?function(ie,oe,ce){ce!=Ra&&K(ie,oe,ce)}:K)}e.defineOption=c,e.Init=Ra,c("value","",function(l,y){return l.setValue(y)},!0),c("mode",null,function(l,y){l.doc.modeOption=y,Ts(l)},!0),c("indentUnit",2,Ts,!0),c("indentWithTabs",!1),c("smartIndent",!0),c("tabSize",4,function(l){ja(l),qt(l),Pi(l)},!0),c("lineSeparator",null,function(l,y){if(l.doc.lineSep=y,!y)return;var K=[],ee=l.doc.first;l.doc.iter(function(oe){for(var ce=0;;){var De=oe.text.indexOf(y,ce);if(De==-1)break;ce=De+y.length,K.push(Ze(ee,De))}ee++});for(var ie=K.length-1;ie>=0;ie--)Ta(l.doc,y,K[ie],Ze(K[ie].line,K[ie].ch+y.length))}),c("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(l,y,K){l.state.specialChars=new RegExp(y.source+(y.test(" ")?"":"| "),"g"),K!=Ra&&l.refresh()}),c("specialCharPlaceholder",un,function(l){return l.refresh()},!0),c("electricChars",!0),c("inputStyle",a?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),c("spellcheck",!1,function(l,y){return l.getInputField().spellcheck=y},!0),c("autocorrect",!1,function(l,y){return l.getInputField().autocorrect=y},!0),c("autocapitalize",!1,function(l,y){return l.getInputField().autocapitalize=y},!0),c("rtlMoveVisually",!S),c("wholeLineUpdateBefore",!0),c("theme","default",function(l){Ho(l),Fa(l)},!0),c("keyMap","default",function(l,y,K){var ee=us(y),ie=K!=Ra&&us(K);ie&&ie.detach&&ie.detach(l,ee),ee.attach&&ee.attach(l,ie||null)}),c("extraKeys",null),c("configureMouse",null),c("lineWrapping",!1,Ql,!0),c("gutters",[],function(l,y){l.display.gutterSpecs=xs(y,l.options.lineNumbers),Fa(l)},!0),c("fixedGutter",!0,function(l,y){l.display.gutters.style.left=y?Vn(l.display)+"px":"0",l.refresh()},!0),c("coverGutterNextToScrollbar",!1,function(l){return ba(l)},!0),c("scrollbarStyle","native",function(l){Gs(l),ba(l),l.display.scrollbars.setScrollTop(l.doc.scrollTop),l.display.scrollbars.setScrollLeft(l.doc.scrollLeft)},!0),c("lineNumbers",!1,function(l,y){l.display.gutterSpecs=xs(l.options.gutters,y),Fa(l)},!0),c("firstLineNumber",1,Fa,!0),c("lineNumberFormatter",function(l){return l},Fa,!0),c("showCursorWhenSelecting",!1,In,!0),c("resetSelectionOnContextMenu",!0),c("lineWiseCopyCut",!0),c("pasteLinesPerSelection",!0),c("selectionsMayTouch",!1),c("readOnly",!1,function(l,y){y=="nocursor"&&(Ir(l),l.display.input.blur()),l.display.input.readOnlyChanged(y)}),c("screenReaderLabel",null,function(l,y){y=y===""?null:y,l.display.input.screenReaderLabelChanged(y)}),c("disableInput",!1,function(l,y){y||l.display.input.reset()},!0),c("dragDrop",!0,Jl),c("allowDropFileTypes",null),c("cursorBlinkRate",530),c("cursorScrollMargin",0),c("cursorHeight",1,In,!0),c("singleCursorHeightPerLine",!0,In,!0),c("workTime",100),c("workDelay",100),c("flattenSpans",!0,ja,!0),c("addModeClass",!1,ja,!0),c("pollInterval",100),c("undoDepth",200,function(l,y){return l.doc.history.undoDepth=y}),c("historyEventDelay",1250),c("viewportMargin",10,function(l){return l.refresh()},!0),c("maxHighlightLength",1e4,ja,!0),c("moveInputWithCursor",!0,function(l,y){y||l.display.input.resetPosition()}),c("tabindex",null,function(l,y){return l.display.input.getField().tabIndex=y||""}),c("autofocus",null),c("direction","ltr",function(l,y){return l.doc.setDirection(y)},!0),c("phrases",null)}function Jl(e,t,c){var l=c&&c!=Ra;if(!t!=!l){var y=e.display.dragFunctions,K=t?ke:ot;K(e.display.scroller,"dragstart",y.start),K(e.display.scroller,"dragenter",y.enter),K(e.display.scroller,"dragover",y.over),K(e.display.scroller,"dragleave",y.leave),K(e.display.scroller,"drop",y.drop)}}function Ql(e){e.options.lineWrapping?(j(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(v(e.display.wrapper,"CodeMirror-wrap"),$r(e)),Br(e),Pi(e),qt(e),setTimeout(function(){return ba(e)},100)}function Ii(e,t){var c=this;if(!(this instanceof Ii))return new Ii(e,t);this.options=t=t?O(t):{},O(Ko,t,!1);var l=t.value;typeof l=="string"?l=new br(l,t.mode,null,t.lineSeparator,t.direction):t.mode&&(l.modeOption=t.mode),this.doc=l;var y=new Ii.inputStyles[t.inputStyle](this),K=this.display=new cl(e,l,y,t);K.wrapper.CodeMirror=this,Ho(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Gs(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 te,keySeq:null,specialChars:null},t.autofocus&&!a&&K.input.focus(),H&&N<11&&setTimeout(function(){return c.display.input.reset(!0)},20),Zl(this),Al(),fa(this),this.curOp.forceUpdate=!0,eo(this,l),t.autofocus&&!a||this.hasFocus()?setTimeout(function(){c.hasFocus()&&!c.state.focused&&Wr(c)},20):Ir(this);for(var ee in ds)ds.hasOwnProperty(ee)&&ds[ee](this,t[ee],Ra);Xs(this),t.finishInit&&t.finishInit(this);for(var ie=0;ie<ks.length;++ie)ks[ie](this);pa(this),n&&t.lineWrapping&&getComputedStyle(K.lineDiv).textRendering=="optimizelegibility"&&(K.lineDiv.style.textRendering="auto")}Ii.defaults=Ko,Ii.optionHandlers=ds;function Zl(e){var t=e.display;ke(t.scroller,"mousedown",er(e,Fo)),H&&N<11?ke(t.scroller,"dblclick",er(e,function(oe){if($e(e,oe))return;var ce=$i(e,oe);if(!ce||Ms(e,oe)||Un(e.display,oe))return;ue(oe);var De=e.findWordAt(ce);rs(e.doc,De.anchor,De.head)})):ke(t.scroller,"dblclick",function(oe){return $e(e,oe)||ue(oe)}),ke(t.scroller,"contextmenu",function(oe){return Wo(e,oe)}),ke(t.input.getField(),"contextmenu",function(oe){t.scroller.contains(oe.target)||Wo(e,oe)});var c,l={end:0};function y(){t.activeTouch&&(c=setTimeout(function(){return t.activeTouch=null},1e3),l=t.activeTouch,l.end=+new Date)}function K(oe){if(oe.touches.length!=1)return!1;var ce=oe.touches[0];return ce.radiusX<=1&&ce.radiusY<=1}function ee(oe,ce){if(ce.left==null)return!0;var De=ce.left-oe.left,Fe=ce.top-oe.top;return De*De+Fe*Fe>20*20}ke(t.scroller,"touchstart",function(oe){if(!$e(e,oe)&&!K(oe)&&!Ms(e,oe)){t.input.ensurePolled(),clearTimeout(c);var ce=+new Date;t.activeTouch={start:ce,moved:!1,prev:ce-l.end<=300?l:null},oe.touches.length==1&&(t.activeTouch.left=oe.touches[0].pageX,t.activeTouch.top=oe.touches[0].pageY)}}),ke(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),ke(t.scroller,"touchend",function(oe){var ce=t.activeTouch;if(ce&&!Un(t,oe)&&ce.left!=null&&!ce.moved&&new Date-ce.start<300){var De=e.coordsChar(t.activeTouch,"page"),Fe;!ce.prev||ee(ce,ce.prev)?Fe=new pi(De,De):!ce.prev.prev||ee(ce,ce.prev.prev)?Fe=e.findWordAt(De):Fe=new pi(Ze(De.line,0),R(e.doc,Ze(De.line+1,0))),e.setSelection(Fe.anchor,Fe.head),e.focus(),ue(oe)}y()}),ke(t.scroller,"touchcancel",y),ke(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Ma(e,t.scroller.scrollTop),da(e,t.scroller.scrollLeft,!0),Ge(e,"scroll",e))}),ke(t.scroller,"mousewheel",function(oe){return Js(e,oe)}),ke(t.scroller,"DOMMouseScroll",function(oe){return Js(e,oe)}),ke(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(oe){$e(e,oe)||me(oe)},over:function(oe){$e(e,oe)||(Rl(e,oe),me(oe))},start:function(oe){return Ol(e,oe)},drop:er(e,Cl),leave:function(oe){$e(e,oe)||wo(e)}};var ie=t.input.getField();ke(ie,"keyup",function(oe){return No.call(e,oe)}),ke(ie,"keydown",er(e,ko)),ke(ie,"keypress",er(e,Uo)),ke(ie,"focus",function(oe){return Wr(e,oe)}),ke(ie,"blur",function(oe){return Ir(e,oe)})}var ks=[];Ii.defineInitHook=function(e){return ks.push(e)};function Za(e,t,c,l){var y=e.doc,K;c==null&&(c="add"),c=="smart"&&(y.mode.indent?K=Ot(e,t).state:c="prev");var ee=e.options.tabSize,ie=$(y,t),oe=V(ie.text,null,ee);ie.stateAfter&&(ie.stateAfter=null);var ce=ie.text.match(/^\s*/)[0],De;if(!l&&!/\S/.test(ie.text))De=0,c="not";else if(c=="smart"&&(De=y.mode.indent(K,ie.text.slice(ce.length),ie.text),De==Ae||De>150)){if(!l)return;c="prev"}c=="prev"?t>y.first?De=V($(y,t-1).text,null,ee):De=0:c=="add"?De=oe+e.options.indentUnit:c=="subtract"?De=oe-e.options.indentUnit:typeof c=="number"&&(De=oe+c),De=Math.max(0,De);var Fe="",tt=0;if(e.options.indentWithTabs)for(var Qe=Math.floor(De/ee);Qe;--Qe)tt+=ee,Fe+=" ";if(tt<De&&(Fe+=be(De-tt)),Fe!=ce)return Ta(y,Fe,Ze(t,0),Ze(t,ce.length),"+input"),ie.stateAfter=null,!0;for(var St=0;St<y.sel.ranges.length;St++){var Ft=y.sel.ranges[St];if(Ft.head.line==t&&Ft.head.ch<ce.length){var Kt=Ze(t,ce.length);Rs(y,St,new pi(Kt,Kt));break}}}var Vr=null;function hs(e){Vr=e}function Ns(e,t,c,l,y){var K=e.doc;e.display.shift=!1,l||(l=K.sel);var ee=+new Date-200,ie=y=="paste"||e.state.pasteIncoming>ee,oe=et(t),ce=null;if(ie&&l.ranges.length>1)if(Vr&&Vr.text.join(`
|
|
`)==t){if(l.ranges.length%Vr.text.length==0){ce=[];for(var De=0;De<Vr.text.length;De++)ce.push(K.splitLines(Vr.text[De]))}}else oe.length==l.ranges.length&&e.options.pasteLinesPerSelection&&(ce=mt(oe,function(Qt){return[Qt]}));for(var Fe=e.curOp.updateInput,tt=l.ranges.length-1;tt>=0;tt--){var Qe=l.ranges[tt],St=Qe.from(),Ft=Qe.to();Qe.empty()&&(c&&c>0?St=Ze(St.line,St.ch-c):e.state.overwrite&&!ie?Ft=Ze(Ft.line,Math.min($(K,Ft.line).text.length,Ft.ch+Ve(oe).length)):ie&&Vr&&Vr.lineWise&&Vr.text.join(`
|
|
`)==oe.join(`
|
|
`)&&(St=Ft=Ze(St.line,0)));var Kt={from:St,to:Ft,text:ce?ce[tt%ce.length]:oe,origin:y||(ie?"paste":e.state.cutIncoming>ee?"cut":"+input")};Sa(e.doc,Kt),rt(e,"inputRead",e,Kt)}t&&!ie&&zo(e,t),_a(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Fe),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Go(e,t){var c=e.clipboardData&&e.clipboardData.getData("Text");if(c)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Pr(t,function(){return Ns(t,c,0,null,"paste")}),!0}function zo(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var c=e.doc.sel,l=c.ranges.length-1;l>=0;l--){var y=c.ranges[l];if(y.head.ch>100||l&&c.ranges[l-1].head.line==y.head.line)continue;var K=e.getModeAt(y.head),ee=!1;if(K.electricChars){for(var ie=0;ie<K.electricChars.length;ie++)if(t.indexOf(K.electricChars.charAt(ie))>-1){ee=Za(e,y.head.line,"smart");break}}else K.electricInput&&(K.electricInput.test($(e.doc,y.head.line).text.slice(0,y.head.ch))&&(ee=Za(e,y.head.line,"smart")));ee&&rt(e,"electricInput",e,y.head.line)}}function Vo(e){for(var t=[],c=[],l=0;l<e.doc.sel.ranges.length;l++){var y=e.doc.sel.ranges[l].head.line,K={anchor:Ze(y,0),head:Ze(y+1,0)};c.push(K),t.push(e.getRange(K.anchor,K.head))}return{text:t,ranges:c}}function Xo(e,t,c,l){e.setAttribute("autocorrect",c?"":"off"),e.setAttribute("autocapitalize",l?"":"off"),e.setAttribute("spellcheck",!!t)}function Yo(){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"),h&&(e.style.border="1px solid black"),Xo(e),t}function ql(e){var t=e.optionHandlers,c=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(l,y){var K=this.options,ee=K[l];if(K[l]==y&&l!="mode")return;K[l]=y,t.hasOwnProperty(l)&&er(this,t[l])(this,y,ee),Ge(this,"optionChange",this,l)},getOption:function(l){return this.options[l]},getDoc:function(){return this.doc},addKeyMap:function(l,y){this.state.keyMaps[y?"push":"unshift"](us(l))},removeKeyMap:function(l){for(var y=this.state.keyMaps,K=0;K<y.length;++K)if(y[K]==l||y[K].name==l)return y.splice(K,1),!0},addOverlay:pr(function(l,y){var K=l.token?l:e.getMode(this.options,l);if(K.startState)throw new Error("Overlays may not be stateful.");yt(this.state.overlays,{mode:K,modeSpec:l,opaque:y&&y.opaque,priority:y&&y.priority||0},function(ee){return ee.priority}),this.state.modeGen++,Pi(this)}),removeOverlay:pr(function(l){for(var y=this.state.overlays,K=0;K<y.length;++K){var ee=y[K].modeSpec;if(ee==l||typeof l=="string"&&ee.name==l){y.splice(K,1),this.state.modeGen++,Pi(this);return}}}),indentLine:pr(function(l,y,K){typeof y!="string"&&typeof y!="number"&&(y==null?y=this.options.smartIndent?"smart":"prev":y=y?"add":"subtract"),Rt(this.doc,l)&&Za(this,l,y,K)}),indentSelection:pr(function(l){for(var y=this.doc.sel.ranges,K=-1,ee=0;ee<y.length;ee++){var ie=y[ee];if(ie.empty())ie.head.line>K&&(Za(this,ie.head.line,l,!0),K=ie.head.line,ee==this.doc.sel.primIndex&&_a(this));else{var oe=ie.from(),ce=ie.to(),De=Math.max(K,oe.line);K=Math.min(this.lastLine(),ce.line-(ce.ch?0:1))+1;for(var Fe=De;Fe<K;++Fe)Za(this,Fe,l);var tt=this.doc.sel.ranges;oe.ch==0&&y.length==tt.length&&tt[ee].from().ch>0&&Rs(this.doc,ee,new pi(oe,tt[ee].to()),Oe)}}}),getTokenAt:function(l,y){return Wn(this,l,y)},getLineTokens:function(l,y){return Wn(this,Ze(l),y,!0)},getTokenTypeAt:function(l){l=R(this.doc,l);var y=ht(this,$(this.doc,l.line)),K=0,ee=(y.length-1)/2,ie=l.ch,oe;if(ie==0)oe=y[2];else for(;;){var ce=K+ee>>1;if((ce?y[ce*2-1]:0)>=ie)ee=ce;else if(y[ce*2+1]<ie)K=ce+1;else{oe=y[ce*2+2];break}}var De=oe?oe.indexOf("overlay "):-1;return De<0?oe:De==0?null:oe.slice(0,De-1)},getModeAt:function(l){var y=this.doc.mode;return y.innerMode?e.innerMode(y,this.getTokenAt(l).state).mode:y},getHelper:function(l,y){return this.getHelpers(l,y)[0]},getHelpers:function(l,y){var K=[];if(!c.hasOwnProperty(y))return K;var ee=c[y],ie=this.getModeAt(l);if(typeof ie[y]=="string")ee[ie[y]]&&K.push(ee[ie[y]]);else if(ie[y])for(var oe=0;oe<ie[y].length;oe++){var ce=ee[ie[y][oe]];ce&&K.push(ce)}else ie.helperType&&ee[ie.helperType]?K.push(ee[ie.helperType]):ee[ie.name]&&K.push(ee[ie.name]);for(var De=0;De<ee._global.length;De++){var Fe=ee._global[De];Fe.pred(ie,this)&&re(K,Fe.val)==-1&&K.push(Fe.val)}return K},getStateAfter:function(l,y){var K=this.doc;return l=J(K,l==null?K.first+K.size-1:l),Ot(this,l+1,y).state},cursorCoords:function(l,y){var K,ee=this.doc.sel.primary();return l==null?K=ee.head:typeof l=="object"?K=R(this.doc,l):K=l?ee.from():ee.to(),li(this,K,y||"page")},charCoords:function(l,y){return Or(this,R(this.doc,l),y||"page")},coordsChar:function(l,y){return l=Hi(this,l,y||"page"),Kr(this,l.left,l.top)},lineAtHeight:function(l,y){return l=Hi(this,{top:l,left:0},y||"page").top,ze(this.doc,l+this.display.viewOffset)},heightAtLine:function(l,y,K){var ee=!1,ie;if(typeof l=="number"){var oe=this.doc.first+this.doc.size-1;l<this.doc.first?l=this.doc.first:l>oe&&(l=oe,ee=!0),ie=$(this.doc,l)}else ie=l;return qi(this,ie,{top:0,left:0},y||"page",K||ee).top+(ee?this.doc.height-vr(ie):0)},defaultTextHeight:function(){return zn(this.display)},defaultCharWidth:function(){return Yn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(l,y,K,ee,ie){var oe=this.display;l=li(this,R(this.doc,l));var ce=l.bottom,De=l.left;if(y.style.position="absolute",y.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(y),oe.sizer.appendChild(y),ee=="over")ce=l.top;else if(ee=="above"||ee=="near"){var Fe=Math.max(oe.wrapper.clientHeight,this.doc.height),tt=Math.max(oe.sizer.clientWidth,oe.lineSpace.clientWidth);(ee=="above"||l.bottom+y.offsetHeight>Fe)&&l.top>y.offsetHeight?ce=l.top-y.offsetHeight:l.bottom+y.offsetHeight<=Fe&&(ce=l.bottom),De+y.offsetWidth>tt&&(De=tt-y.offsetWidth)}y.style.top=ce+"px",y.style.left=y.style.right="",ie=="right"?(De=oe.sizer.clientWidth-y.offsetWidth,y.style.right="0px"):(ie=="left"?De=0:ie=="middle"&&(De=(oe.sizer.clientWidth-y.offsetWidth)/2),y.style.left=De+"px"),K&&Ji(this,{left:De,top:ce,right:De+y.offsetWidth,bottom:ce+y.offsetHeight})},triggerOnKeyDown:pr(ko),triggerOnKeyPress:pr(Uo),triggerOnKeyUp:No,triggerOnMouseDown:pr(Fo),execCommand:function(l){if(Ya.hasOwnProperty(l))return Ya[l].call(null,this)},triggerElectric:pr(function(l){zo(this,l)}),findPosH:function(l,y,K,ee){var ie=1;y<0&&(ie=-1,y=-y);for(var oe=R(this.doc,l),ce=0;ce<y&&!(oe=Us(this.doc,oe,ie,K,ee),oe.hitSide);++ce);return oe},moveH:pr(function(l,y){var K=this;this.extendSelectionsBy(function(ee){return K.display.shift||K.doc.extend||ee.empty()?Us(K.doc,ee.head,l,y,K.options.rtlMoveVisually):l<0?ee.from():ee.to()},je)}),deleteH:pr(function(l,y){var K=this.doc.sel,ee=this.doc;K.somethingSelected()?ee.replaceSelection("",null,"+delete"):Oa(this,function(ie){var oe=Us(ee,ie.head,l,y,!1);return l<0?{from:oe,to:ie.head}:{from:ie.head,to:oe}})}),findPosV:function(l,y,K,ee){var ie=1,oe=ee;y<0&&(ie=-1,y=-y);for(var ce=R(this.doc,l),De=0;De<y;++De){var Fe=li(this,ce,"div");if(oe==null?oe=Fe.left:Fe.left=oe,ce=$o(this,Fe,ie,K),ce.hitSide)break}return ce},moveV:pr(function(l,y){var K=this,ee=this.doc,ie=[],oe=!this.display.shift&&!ee.extend&&ee.sel.somethingSelected();if(ee.extendSelectionsBy(function(De){if(oe)return l<0?De.from():De.to();var Fe=li(K,De.head,"div");De.goalColumn!=null&&(Fe.left=De.goalColumn),ie.push(Fe.left);var tt=$o(K,Fe,l,y);return y=="page"&&De==ee.sel.primary()&&vs(K,Or(K,tt,"div").top-Fe.top),tt},je),ie.length)for(var ce=0;ce<ee.sel.ranges.length;ce++)ee.sel.ranges[ce].goalColumn=ie[ce]}),findWordAt:function(l){var y=this.doc,K=$(y,l.line).text,ee=l.ch,ie=l.ch;if(K){var oe=this.getHelper(l,"wordChars");(l.sticky=="before"||ie==K.length)&&ee?--ee:++ie;for(var ce=K.charAt(ee),De=wt(ce,oe)?function(Fe){return wt(Fe,oe)}:/\s/.test(ce)?function(Fe){return/\s/.test(Fe)}:function(Fe){return!/\s/.test(Fe)&&!wt(Fe)};ee>0&&De(K.charAt(ee-1));)--ee;for(;ie<K.length&&De(K.charAt(ie));)++ie}return new pi(Ze(l.line,ee),Ze(l.line,ie))},toggleOverwrite:function(l){if(l!=null&&l==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?j(this.display.cursorDiv,"CodeMirror-overwrite"):v(this.display.cursorDiv,"CodeMirror-overwrite"),Ge(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==U()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:pr(function(l,y){Pa(this,l,y)}),getScrollInfo:function(){var l=this.display.scroller;return{left:l.scrollLeft,top:l.scrollTop,height:l.scrollHeight-kn(this)-this.display.barHeight,width:l.scrollWidth-kn(this)-this.display.barWidth,clientHeight:Gn(this),clientWidth:ei(this)}},scrollIntoView:pr(function(l,y){l==null?(l={from:this.doc.sel.primary().head,to:null},y==null&&(y=this.options.cursorScrollMargin)):typeof l=="number"?l={from:Ze(l,0),to:null}:l.from==null&&(l={from:l,to:null}),l.to||(l.to=l.from),l.margin=y||0,l.from.line!=null?Qo(this,l):Bs(this,l.from,l.to,l.margin)}),setSize:pr(function(l,y){var K=this,ee=function(oe){return typeof oe=="number"||/^\d+$/.test(String(oe))?oe+"px":oe};l!=null&&(this.display.wrapper.style.width=ee(l)),y!=null&&(this.display.wrapper.style.height=ee(y)),this.options.lineWrapping&&Ht(this);var ie=this.display.viewFrom;this.doc.iter(ie,this.display.viewTo,function(oe){if(oe.widgets){for(var ce=0;ce<oe.widgets.length;ce++)if(oe.widgets[ce].noHScroll){sr(K,ie,"widget");break}}++ie}),this.curOp.forceUpdate=!0,Ge(this,"refresh",this)}),operation:function(l){return Pr(this,l)},startOperation:function(){return fa(this)},endOperation:function(){return pa(this)},refresh:pr(function(){var l=this.display.cachedTextHeight;Pi(this),this.curOp.forceUpdate=!0,qt(this),Pa(this,this.doc.scrollLeft,this.doc.scrollTop),bs(this.display),(l==null||Math.abs(l-zn(this.display))>.5||this.options.lineWrapping)&&Br(this),Ge(this,"refresh",this)}),swapDoc:pr(function(l){var y=this.doc;return y.cm=null,this.state.selectingText&&this.state.selectingText(),eo(this,l),qt(this),this.display.input.reset(),Pa(this,l.scrollLeft,l.scrollTop),this.curOp.forceScroll=!0,rt(this,"swapDoc",this,y),y}),phrase:function(l){var y=this.options.phrases;return y&&Object.prototype.hasOwnProperty.call(y,l)?y[l]:l},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}},Ee(e),e.registerHelper=function(l,y,K){c.hasOwnProperty(l)||(c[l]=e[l]={_global:[]}),c[l][y]=K},e.registerGlobalHelper=function(l,y,K,ee){e.registerHelper(l,y,ee),c[l]._global.push({pred:K,val:ee})}}function Us(e,t,c,l,y){var K=t,ee=c,ie=$(e,t.line),oe=y&&e.direction=="rtl"?-c:c;function ce(){var rn=t.line+oe;return rn<e.first||rn>=e.first+e.size?!1:(t=new Ze(rn,t.ch,t.sticky),ie=$(e,rn))}function De(rn){var Zt;if(l=="codepoint"){var cn=ie.text.charCodeAt(t.ch+(l>0?0:-1));isNaN(cn)?Zt=null:Zt=new Ze(t.line,Math.max(0,Math.min(ie.text.length,t.ch+c*(cn>=55296&&cn<56320?2:1))),-c)}else y?Zt=Ml(e.cm,ie,t,c):Zt=Ls(ie,t,c);if(Zt==null)if(!rn&&ce())t=Is(y,e.cm,ie,t.line,oe);else return!1;else t=Zt;return!0}if(l=="char"||l=="codepoint")De();else if(l=="column")De(!0);else if(l=="word"||l=="group")for(var Fe=null,tt=l=="group",Qe=e.cm&&e.cm.getHelper(t,"wordChars"),St=!0;!(c<0&&!De(!St));St=!1){var Ft=ie.text.charAt(t.ch)||`
|
|
`,Kt=wt(Ft,Qe)?"w":tt&&Ft==`
|
|
`?"n":!tt||/\s/.test(Ft)?null:"p";if(tt&&!St&&!Kt&&(Kt="s"),Fe&&Fe!=Kt){c<0&&(c=1,De(),t.sticky="after");break}if(Kt&&(Fe=Kt),c>0&&!De(!St))break}var Qt=ss(e,t,K,ee,!0);return an(K,Qt)&&(Qt.hitSide=!0),Qt}function $o(e,t,c,l){var y=e.doc,K=t.left,ee;if(l=="page"){var ie=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),oe=Math.max(ie-.5*zn(e.display),3);ee=(c>0?t.bottom:t.top)+c*oe}else l=="line"&&(ee=c>0?t.bottom+3:t.top-3);for(var ce;!(ce=Kr(e,K,ee),!ce.outside);){if(c<0?ee<=0:ee>=y.height){ce.hitSide=!0;break}ee+=c*5}return ce}var xi=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new te,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};xi.prototype.init=function(e){var t=this,c=this,l=c.cm,y=c.div=e.lineDiv;Xo(y,l.options.spellcheck,l.options.autocorrect,l.options.autocapitalize);function K(ie){for(var oe=ie.target;oe;oe=oe.parentNode){if(oe==y)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(oe.className))break}return!1}ke(y,"paste",function(ie){if(!K(ie)||$e(l,ie)||Go(ie,l))return;N<=11&&setTimeout(er(l,function(){return t.updateFromDOM()}),20)}),ke(y,"compositionstart",function(ie){t.composing={data:ie.data,done:!1}}),ke(y,"compositionupdate",function(ie){t.composing||(t.composing={data:ie.data,done:!1})}),ke(y,"compositionend",function(ie){t.composing&&(ie.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),ke(y,"touchstart",function(){return c.forceCompositionEnd()}),ke(y,"input",function(){t.composing||t.readFromDOMSoon()});function ee(ie){if(!K(ie)||$e(l,ie))return;if(l.somethingSelected())hs({lineWise:!1,text:l.getSelections()}),ie.type=="cut"&&l.replaceSelection("",null,"cut");else if(l.options.lineWiseCopyCut){var oe=Vo(l);hs({lineWise:!0,text:oe.text}),ie.type=="cut"&&l.operation(function(){l.setSelections(oe.ranges,0,Oe),l.replaceSelection("",null,"cut")})}else return;if(ie.clipboardData){ie.clipboardData.clearData();var ce=Vr.text.join(`
|
|
`);if(ie.clipboardData.setData("Text",ce),ie.clipboardData.getData("Text")==ce){ie.preventDefault();return}}var De=Yo(),Fe=De.firstChild;l.display.lineSpace.insertBefore(De,l.display.lineSpace.firstChild),Fe.value=Vr.text.join(`
|
|
`);var tt=document.activeElement;G(Fe),setTimeout(function(){l.display.lineSpace.removeChild(De),tt.focus(),tt==y&&c.showPrimarySelection()},50)}ke(y,"copy",ee),ke(y,"cut",ee)},xi.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},xi.prototype.prepareSelection=function(){var e=Ei(this.cm,!1);return e.focus=document.activeElement==this.div,e},xi.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},xi.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},xi.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,c=t.doc.sel.primary(),l=c.from(),y=c.to();if(t.display.viewTo==t.display.viewFrom||l.line>=t.display.viewTo||y.line<t.display.viewFrom){e.removeAllRanges();return}var K=fs(t,e.anchorNode,e.anchorOffset),ee=fs(t,e.focusNode,e.focusOffset);if(K&&!K.bad&&ee&&!ee.bad&&kt(nn(K,ee),l)==0&&kt(pn(K,ee),y)==0)return;var ie=t.display.view,oe=l.line>=t.display.viewFrom&&Jo(t,l)||{node:ie[0].measure.map[2],offset:0},ce=y.line<t.display.viewTo&&Jo(t,y);if(!ce){var De=ie[ie.length-1].measure,Fe=De.maps?De.maps[De.maps.length-1]:De.map;ce={node:Fe[Fe.length-1],offset:Fe[Fe.length-2]-Fe[Fe.length-3]}}if(!oe||!ce){e.removeAllRanges();return}var tt=e.rangeCount&&e.getRangeAt(0),Qe;try{Qe=E(oe.node,oe.offset,ce.offset,ce.node)}catch(St){}Qe&&(!M&&t.state.focused?(e.collapse(oe.node,oe.offset),Qe.collapsed||(e.removeAllRanges(),e.addRange(Qe))):(e.removeAllRanges(),e.addRange(Qe)),tt&&e.anchorNode==null?e.addRange(tt):M&&this.startGracePeriod()),this.rememberSelection()},xi.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)},xi.prototype.showMultipleSelections=function(e){g(this.cm.display.cursorDiv,e.cursors),g(this.cm.display.selectionDiv,e.selection)},xi.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},xi.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return _(this.div,t)},xi.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},xi.prototype.blur=function(){this.div.blur()},xi.prototype.getField=function(){return this.div},xi.prototype.supportsTouch=function(){return!0},xi.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Pr(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)},xi.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},xi.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(r&&p&&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 c=fs(t,e.anchorNode,e.anchorOffset),l=fs(t,e.focusNode,e.focusOffset);c&&l&&Pr(t,function(){ur(t.doc,ra(c,l),Oe),(c.bad||l.bad)&&(t.curOp.selectionChanged=!0)})},xi.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,c=e.doc.sel.primary(),l=c.from(),y=c.to();if(l.ch==0&&l.line>e.firstLine()&&(l=Ze(l.line-1,$(e.doc,l.line-1).length)),y.ch==$(e.doc,y.line).text.length&&y.line<e.lastLine()&&(y=Ze(y.line+1,0)),l.line<t.viewFrom||y.line>t.viewTo-1)return!1;var K,ee,ie;l.line==t.viewFrom||(K=Lr(e,l.line))==0?(ee=Pe(t.view[0].line),ie=t.view[0].node):(ee=Pe(t.view[K].line),ie=t.view[K-1].node.nextSibling);var oe=Lr(e,y.line),ce,De;if(oe==t.view.length-1?(ce=t.viewTo-1,De=t.lineDiv.lastChild):(ce=Pe(t.view[oe+1].line)-1,De=t.view[oe+1].node.previousSibling),!ie)return!1;for(var Fe=e.doc.splitLines(tu(e,ie,De,ee,ce)),tt=Z(e.doc,Ze(ee,0),Ze(ce,$(e.doc,ce).text.length));Fe.length>1&&tt.length>1;)if(Ve(Fe)==Ve(tt))Fe.pop(),tt.pop(),ce--;else if(Fe[0]==tt[0])Fe.shift(),tt.shift(),ee++;else break;for(var Qe=0,St=0,Ft=Fe[0],Kt=tt[0],Qt=Math.min(Ft.length,Kt.length);Qe<Qt&&Ft.charCodeAt(Qe)==Kt.charCodeAt(Qe);)++Qe;for(var rn=Ve(Fe),Zt=Ve(tt),cn=Math.min(rn.length-(Fe.length==1?Qe:0),Zt.length-(tt.length==1?Qe:0));St<cn&&rn.charCodeAt(rn.length-St-1)==Zt.charCodeAt(Zt.length-St-1);)++St;if(Fe.length==1&&tt.length==1&&ee==l.line)for(;Qe&&Qe>l.ch&&rn.charCodeAt(rn.length-St-1)==Zt.charCodeAt(Zt.length-St-1);)Qe--,St++;Fe[Fe.length-1]=rn.slice(0,rn.length-St).replace(/^\u200b+/,""),Fe[0]=Fe[0].slice(Qe).replace(/\u200b+$/,"");var An=Ze(ee,Qe),En=Ze(ce,tt.length?Ve(tt).length-St:0);if(Fe.length>1||Fe[0]||kt(An,En))return Ta(e.doc,Fe,An,En,"+input"),!0},xi.prototype.ensurePolled=function(){this.forceCompositionEnd()},xi.prototype.reset=function(){this.forceCompositionEnd()},xi.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},xi.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)},xi.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Pr(this.cm,function(){return Pi(e.cm)})},xi.prototype.setUneditable=function(e){e.contentEditable="false"},xi.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||er(this.cm,Ns)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},xi.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},xi.prototype.onContextMenu=function(){},xi.prototype.resetPosition=function(){},xi.prototype.needsContentAttribute=!0;function Jo(e,t){var c=ui(e,t.line);if(!c||c.hidden)return null;var l=$(e.doc,t.line),y=Tn(c,l,t.line),K=It(l,e.doc.direction),ee="left";if(K){var ie=dt(K,t.ch);ee=ie%2?"right":"left"}var oe=Rn(y.map,t.ch,ee);return oe.offset=oe.collapse=="right"?oe.end:oe.start,oe}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Aa(e,t){return t&&(e.bad=!0),e}function tu(e,t,c,l,y){var K="",ee=!1,ie=e.doc.lineSeparator(),oe=!1;function ce(Qe){return function(St){return St.id==Qe}}function De(){ee&&(K+=ie,oe&&(K+=ie),ee=oe=!1)}function Fe(Qe){Qe&&(De(),K+=Qe)}function tt(Qe){if(Qe.nodeType==1){var St=Qe.getAttribute("cm-text");if(St){Fe(St);return}var Ft=Qe.getAttribute("cm-marker"),Kt;if(Ft){var Qt=e.findMarks(Ze(l,0),Ze(y+1,0),ce(+Ft));Qt.length&&(Kt=Qt[0].find(0))&&Fe(Z(e.doc,Kt.from,Kt.to).join(ie));return}if(Qe.getAttribute("contenteditable")=="false")return;var rn=/^(pre|div|p|li|table|br)$/i.test(Qe.nodeName);if(!/^br$/i.test(Qe.nodeName)&&Qe.textContent.length==0)return;rn&&De();for(var Zt=0;Zt<Qe.childNodes.length;Zt++)tt(Qe.childNodes[Zt]);/^(pre|p)$/i.test(Qe.nodeName)&&(oe=!0),rn&&(ee=!0)}else Qe.nodeType==3&&Fe(Qe.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(tt(t),t==c);)t=t.nextSibling,oe=!1;return K}function fs(e,t,c){var l;if(t==e.display.lineDiv){if(l=e.display.lineDiv.childNodes[c],!l)return Aa(e.clipPos(Ze(e.display.viewTo-1)),!0);t=null,c=0}else for(l=t;;l=l.parentNode){if(!l||l==e.display.lineDiv)return null;if(l.parentNode&&l.parentNode==e.display.lineDiv)break}for(var y=0;y<e.display.view.length;y++){var K=e.display.view[y];if(K.node==l)return nu(K,t,c)}}function nu(e,t,c){var l=e.text.firstChild,y=!1;if(!t||!_(l,t))return Aa(Ze(Pe(e.line),0),!0);if(t==l&&(y=!0,t=l.childNodes[c],c=0,!t)){var K=e.rest?Ve(e.rest):e.line;return Aa(Ze(Pe(K),K.text.length),y)}var ee=t.nodeType==3?t:null,ie=t;for(!ee&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(ee=t.firstChild,c&&(c=ee.nodeValue.length));ie.parentNode!=l;)ie=ie.parentNode;var oe=e.measure,ce=oe.maps;function De(Kt,Qt,rn){for(var Zt=-1;Zt<(ce?ce.length:0);Zt++)for(var cn=Zt<0?oe.map:ce[Zt],An=0;An<cn.length;An+=3){var En=cn[An+2];if(En==Kt||En==Qt){var Jn=Pe(Zt<0?e.line:e.rest[Zt]),wi=cn[An]+rn;return(rn<0||En!=Kt)&&(wi=cn[An+(rn?1:0)]),Ze(Jn,wi)}}}var Fe=De(ee,ie,c);if(Fe)return Aa(Fe,y);for(var tt=ie.nextSibling,Qe=ee?ee.nodeValue.length-c:0;tt;tt=tt.nextSibling){if(Fe=De(tt,tt.firstChild,0),Fe)return Aa(Ze(Fe.line,Fe.ch-Qe),y);Qe+=tt.textContent.length}for(var St=ie.previousSibling,Ft=c;St;St=St.previousSibling){if(Fe=De(St,St.firstChild,-1),Fe)return Aa(Ze(Fe.line,Fe.ch+Ft),y);Ft+=St.textContent.length}}var Bi=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new te,this.hasSelection=!1,this.composing=null};Bi.prototype.init=function(e){var t=this,c=this,l=this.cm;this.createField(e);var y=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),h&&(y.style.width="0px"),ke(y,"input",function(){H&&N>=9&&t.hasSelection&&(t.hasSelection=null),c.poll()}),ke(y,"paste",function(ee){if($e(l,ee)||Go(ee,l))return;l.state.pasteIncoming=+new Date,c.fastPoll()});function K(ee){if($e(l,ee))return;if(l.somethingSelected())hs({lineWise:!1,text:l.getSelections()});else if(l.options.lineWiseCopyCut){var ie=Vo(l);hs({lineWise:!0,text:ie.text}),ee.type=="cut"?l.setSelections(ie.ranges,null,Oe):(c.prevInput="",y.value=ie.text.join(`
|
|
`),G(y))}else return;ee.type=="cut"&&(l.state.cutIncoming=+new Date)}ke(y,"cut",K),ke(y,"copy",K),ke(e.scroller,"paste",function(ee){if(Un(e,ee)||$e(l,ee))return;if(!y.dispatchEvent){l.state.pasteIncoming=+new Date,c.focus();return}var ie=new Event("paste");ie.clipboardData=ee.clipboardData,y.dispatchEvent(ie)}),ke(e.lineSpace,"selectstart",function(ee){Un(e,ee)||ue(ee)}),ke(y,"compositionstart",function(){var ee=l.getCursor("from");c.composing&&c.composing.range.clear(),c.composing={start:ee,range:l.markText(ee,l.getCursor("to"),{className:"CodeMirror-composing"})}}),ke(y,"compositionend",function(){c.composing&&(c.poll(),c.composing.range.clear(),c.composing=null)})},Bi.prototype.createField=function(e){this.wrapper=Yo(),this.textarea=this.wrapper.firstChild},Bi.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Bi.prototype.prepareSelection=function(){var e=this.cm,t=e.display,c=e.doc,l=Ei(e);if(e.options.moveInputWithCursor){var y=li(e,c.sel.primary().head,"div"),K=t.wrapper.getBoundingClientRect(),ee=t.lineDiv.getBoundingClientRect();l.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,y.top+ee.top-K.top)),l.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,y.left+ee.left-K.left))}return l},Bi.prototype.showSelection=function(e){var t=this.cm,c=t.display;g(c.cursorDiv,e.cursors),g(c.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Bi.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var c=t.getSelection();this.textarea.value=c,t.state.focused&&G(this.textarea),H&&N>=9&&(this.hasSelection=c)}else e||(this.prevInput=this.textarea.value="",H&&N>=9&&(this.hasSelection=null))},Bi.prototype.getField=function(){return this.textarea},Bi.prototype.supportsTouch=function(){return!1},Bi.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!a||U()!=this.textarea))try{this.textarea.focus()}catch(e){}},Bi.prototype.blur=function(){this.textarea.blur()},Bi.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Bi.prototype.receivedFocus=function(){this.slowPoll()},Bi.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()})},Bi.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function c(){var l=t.poll();!l&&!e?(e=!0,t.polling.set(60,c)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,c)},Bi.prototype.poll=function(){var e=this,t=this.cm,c=this.textarea,l=this.prevInput;if(this.contextMenuPending||!t.state.focused||st(c)&&!l&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var y=c.value;if(y==l&&!t.somethingSelected())return!1;if(H&&N>=9&&this.hasSelection===y||i&&/[\uf700-\uf7ff]/.test(y))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var K=y.charCodeAt(0);if(K==8203&&!l&&(l="\u200B"),K==8666)return this.reset(),this.cm.execCommand("undo")}for(var ee=0,ie=Math.min(l.length,y.length);ee<ie&&l.charCodeAt(ee)==y.charCodeAt(ee);)++ee;return Pr(t,function(){Ns(t,y.slice(ee),l.length-ee,null,e.composing?"*compose":null),y.length>1e3||y.indexOf(`
|
|
`)>-1?c.value=e.prevInput="":e.prevInput=y,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Bi.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Bi.prototype.onKeyPress=function(){H&&N>=9&&(this.hasSelection=null),this.fastPoll()},Bi.prototype.onContextMenu=function(e){var t=this,c=t.cm,l=c.display,y=t.textarea;t.contextMenuPending&&t.contextMenuPending();var K=$i(c,e),ee=l.scroller.scrollTop;if(!K||m)return;var ie=c.options.resetSelectionOnContextMenu;ie&&c.doc.sel.contains(K)==-1&&er(c,ur)(c.doc,ra(K),Oe);var oe=y.style.cssText,ce=t.wrapper.style.cssText,De=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",y.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-De.top-5)+"px; left: "+(e.clientX-De.left-5)+`px;
|
|
z-index: 1000; background: `+(H?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Fe;n&&(Fe=window.scrollY),l.input.focus(),n&&window.scrollTo(null,Fe),l.input.reset(),c.somethingSelected()||(y.value=t.prevInput=" "),t.contextMenuPending=Qe,l.selForContextMenu=c.doc.sel,clearTimeout(l.detectingSelectAll);function tt(){if(y.selectionStart!=null){var Ft=c.somethingSelected(),Kt="\u200B"+(Ft?y.value:"");y.value="\u21DA",y.value=Kt,t.prevInput=Ft?"":"\u200B",y.selectionStart=1,y.selectionEnd=Kt.length,l.selForContextMenu=c.doc.sel}}function Qe(){if(t.contextMenuPending!=Qe)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=ce,y.style.cssText=oe,H&&N<9&&l.scrollbars.setScrollTop(l.scroller.scrollTop=ee),y.selectionStart!=null){(!H||H&&N<9)&&tt();var Ft=0,Kt=function(){l.selForContextMenu==c.doc.sel&&y.selectionStart==0&&y.selectionEnd>0&&t.prevInput=="\u200B"?er(c,po)(c):Ft++<10?l.detectingSelectAll=setTimeout(Kt,500):(l.selForContextMenu=null,l.input.reset())};l.detectingSelectAll=setTimeout(Kt,200)}}if(H&&N>=9&&tt(),A){me(e);var St=function(){ot(window,"mouseup",St),setTimeout(Qe,20)};ke(window,"mouseup",St)}else setTimeout(Qe,50)},Bi.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Bi.prototype.setUneditable=function(){},Bi.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?O(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 c=U();t.autofocus=c==e||e.getAttribute("autofocus")!=null&&c==document.body}function l(){e.value=ie.getValue()}var y;if(e.form&&(ke(e.form,"submit",l),!t.leaveSubmitMethodAlone)){var K=e.form;y=K.submit;try{var ee=K.submit=function(){l(),K.submit=y,K.submit(),K.submit=ee}}catch(oe){}}t.finishInit=function(oe){oe.save=l,oe.getTextArea=function(){return e},oe.toTextArea=function(){oe.toTextArea=isNaN,l(),e.parentNode.removeChild(oe.getWrapperElement()),e.style.display="",e.form&&(ot(e.form,"submit",l),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=y))}},e.style.display="none";var ie=Ii(function(oe){return e.parentNode.insertBefore(oe,e.nextSibling)},t);return ie}function ru(e){e.off=ot,e.on=ke,e.wheelEventPixels=dl,e.Doc=br,e.splitLines=et,e.countColumn=V,e.findColumn=Ue,e.isWordChar=ct,e.Pass=Ae,e.signal=Ge,e.Line=fr,e.changeEnd=aa,e.scrollbarModel=Ks,e.Pos=Ze,e.cmpPos=kt,e.modes=lt,e.mimeModes=Ye,e.resolveMode=Ke,e.getMode=gt,e.modeExtensions=bt,e.extendMode=Tt,e.copyState=Wt,e.startState=se,e.innerMode=fe,e.commands=Ya,e.keyMap=qr,e.keyName=Lo,e.isModifierKey=Ro,e.lookupKey=Ca,e.normalizeKeyMap=Pl,e.StringStream=W,e.SharedTextMarker=za,e.TextMarker=oa,e.LineWidget=Ga,e.e_preventDefault=ue,e.e_stopPropagation=de,e.e_stop=me,e.addClass=j,e.contains=_,e.rmClass=v,e.keyNames=la}$l(Ii),ql(Ii);var au="iter insert remove copy getEditor constructor".split(" ");for(var ps in br.prototype)br.prototype.hasOwnProperty(ps)&&re(au,ps)<0&&(Ii.prototype[ps]=function(e){return function(){return e.apply(this.doc,arguments)}}(br.prototype[ps]));return Ee(br),Ii.inputStyles={textarea:Bi,contenteditable:xi},Ii.defineMode=function(e){!Ii.defaults.mode&&e!="null"&&(Ii.defaults.mode=e),Pt.apply(this,arguments)},Ii.defineMIME=Nt,Ii.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ii.defineMIME("text/plain","null"),Ii.defineExtension=function(e,t){Ii.prototype[e]=t},Ii.defineDocExtension=function(e,t){br.prototype[e]=t},Ii.fromTextArea=iu,ru(Ii),Ii.version="5.58.2",Ii})},W7jJ:function(Be,le,D){"use strict";D.r(le);var Q=D("0Owb"),z=D("PpiC"),M=D("OaEy"),X=D("2fM7"),F=D("T2oS"),I=D("W9HT"),H=D("miYZ"),N=D("tsqr"),n=D("2qtc"),P=D("kLXV"),p=D("9og8"),m=D("tJVT"),d=D("k1fw"),u=D("aHsQ"),o=D("sGsY"),h=D("WmNS"),r=D.n(h),a=D("q1tI"),i=D.n(a),s=D("Fvcw"),S=D("GIiI"),x=D("Ty5D"),T=D("9kvl"),A=D("55Ip"),w=D("7qur"),v=D("cDPC"),b=D("m3rI"),g=D("RCxd"),f=D("EHPI"),C=D("J66h"),E=D("uMZB"),_=D.n(E),U=D("sNtx"),j=D("RpDr"),L=D("+L6B"),G=D("2/Rp"),B=D("y8nQ"),O=D("Vl3Y"),V=D("5NDa"),te=D("5rEg"),re=te.a.TextArea,ge=5e3,Ae=function(qe){var vt=qe.callback,Gt=qe.onCancel,fn=qe.notes;function tn(Yt){vt(Yt)}return i.a.createElement(O.a,{className:"note-form-panel",onFinish:tn,initialValues:{notes:fn}},i.a.createElement(O.a.Item,{name:"notes",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9"},{max:ge,message:"\u7B14\u8BB0\u6700\u5927\u5B57\u6570\u4E3A".concat(ge)}]},i.a.createElement(re,{placeholder:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9",rows:5})),i.a.createElement(O.a.Item,{style:{textAlign:"right"}},i.a.createElement(G.a,{type:"ghost",onClick:Gt,style:{marginRight:10}}," ","\u53D6\u6D88"," "),i.a.createElement(G.a,{type:"primary",htmlType:"submit"}," ","\u63D0\u4EA4"," ")))},Oe=D("ZsLC"),Ce=D.n(Oe),je=D("DjyN"),Ue=D("NUBc"),xe=D("g9YV"),be=D("wCAj"),Ve=D("Hw79"),mt=D.n(Ve),yt=D("ye1Q"),_t=D("lfch"),xt=D("bdLU"),nt=D("1vsH"),ct=D("wd/R"),wt=D.n(ct),_e=be.a.Column,Me=function(qe){var vt=qe.submitResult,Gt=qe.submitting,fn=qe.submitRecords,tn=qe.page,Yt=qe.onPageChange,rt=qe.topicId,Et=vt||{},dn=Et.status,pt=Et.id,hn=Et.input,Bt=Et.output,vn=Et.expected_output,Kn=Et.is_file,Mn=Et.input_file_url,Sn=Et.output_file_url,ni=Et.expected_output_file_url,Ln=Et.error_msg,Zn=fn||{},qn=Zn.records,bi=Zn.records_count,Un=Object(x.i)();function mi(){Kn?navigator.clipboard.writeText(C.Base64.decode(Ln)).then(function(){N.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")}):navigator.clipboard.writeText(C.Base64.decode(Bt)).then(function(){N.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")})}return i.a.createElement(I.a,{spinning:Gt,tip:"\u8BC4\u6D4B\u4E2D...",indicator:i.a.createElement(yt.a,{style:{fontSize:24},spin:!0})},pt?i.a.createElement(i.a.Fragment,null,i.a.createElement("ul",{className:mt.a.info},i.a.createElement("li",null,"\u6267\u884C\u7ED3\u679C\uFF1A",i.a.createElement("span",{className:dn===xt.a.OK?"c-green":"c-red"},j.a[dn])),i.a.createElement("li",{className:mt.a.error},i.a.createElement("a",{onClick:mi},"\u590D\u5236\u9519\u8BEF\u4FE1\u606F ",i.a.createElement(_t.a,null)," ")),i.a.createElement("li",null,i.a.createElement(A.a,{to:"/problems/".concat(rt,"/record-detail/").concat(pt,"?backId=").concat(Un==null?void 0:Un.save_identifier)},"\u663E\u793A\u8BE6\u60C5 >"," "))),dn!==xt.a.OK?i.a.createElement(i.a.Fragment,null,i.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),i.a.createElement("pre",null,!Kn&&hn,Kn&&i.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(nt.y)(Mn,hn)}},hn)),i.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),i.a.createElement("pre",null,(dn===4||dn===5)&&C.Base64.decode(Ln),dn!=4&&dn!=5&&(Kn?i.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(nt.y)(Sn,Bt)}},Bt):C.Base64.decode(Bt))),i.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),i.a.createElement("pre",null,!Kn&&C.Base64.decode(vn),Kn&&i.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(nt.y)(ni,vn)}},vn))):null):null,(qn==null?void 0:qn.length)>0?i.a.createElement(be.a,{dataSource:qn,rowKey:"id",pagination:!1},i.a.createElement(_e,{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"created_at",key:"created_at",render:function(ai,kn){return i.a.createElement("span",null," ",wt()(ai).format("YYYY-MM-DD HH:mm:ss"))}}),i.a.createElement(_e,{title:"\u63D0\u4EA4\u7ED3\u679C",dataIndex:"status",key:"status",render:function(ai,kn){var ei;return i.a.createElement(A.a,{className:ai===0?"c-green":"c-red",to:"/problems/".concat(rt,"/record-detail/").concat(kn.id,"?backId=").concat(Un==null?void 0:Un.save_identifier)},(ei=j.a[ai])===null||ei===void 0?void 0:ei.replace("\u8C03\u8BD5","\u8BC4\u6D4B"))}}),i.a.createElement(_e,{title:"\u6267\u884C\u7528\u65F6 (S)",dataIndex:"execute_time",key:"execute_time"}),i.a.createElement(_e,{title:"\u5185\u5B58\u6D88\u8017\uFF08MB\uFF09",dataIndex:"execute_memory",key:"execute_memory"}),i.a.createElement(_e,{title:"\u8BED\u8A00",dataIndex:"language",key:"language"})):null,bi>15?i.a.createElement(Ue.a,{className:mt.a.pagination,current:tn,pageSize:15,total:bi,onChange:Yt}):null)},ve=D("BdwD"),Te=D("DYRE"),We=D("zeV3"),Je=D("+BJd"),at=D("mr32"),dt=D("TcMa"),Lt=D.n(dt),It=D("9Bee"),Ne={1:{name:"\u7B80\u5355",color:"#52c41a"},2:{name:"\u9002\u4E2D",color:"#faad14"},3:{name:"\u56F0\u96BE",color:"#f5222d"}},ke=function(qe){var vt=qe.hack,Gt=qe.onTriggerPraise,fn=qe.toDiscuss,tn=vt.language,Yt=vt.difficulty,rt=vt.time_limit,Et=vt.username,dn=vt.user_path,pt=vt.user_praise,hn=vt.comments_count,Bt=vt.praises_count,vn=vt.description,Kn=vt.pass_count,Mn=vt.submit_count,Sn=Object(x.h)();console.log(vt.language,"language");var ni=Ne[Yt];return i.a.createElement(i.a.Fragment,null,i.a.createElement("ul",{className:Lt.a.info},i.a.createElement("li",null,"\u96BE\u5EA6\uFF1A",i.a.createElement(at.a,{color:ni.color},ni.name)),i.a.createElement("li",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236\uFF1A",i.a.createElement("b",null,rt,"\u79D2"))),i.a.createElement(It.a,{value:vn,className:Lt.a.desc}),i.a.createElement("ul",{className:Lt.a["commit-info"]},i.a.createElement("li",null,i.a.createElement(We.a,{size:4},i.a.createElement("span",null,"\u901A\u8FC7\u6B21\u6570")," ",i.a.createElement("b",null,Kn))),i.a.createElement("li",null,i.a.createElement(We.a,{size:4},i.a.createElement("span",null,"\u63D0\u4EA4\u6B21\u6570")," ",i.a.createElement("b",null,Mn))," "),i.a.createElement("li",{style:{flex:"1 0 0"}}),i.a.createElement("li",null,i.a.createElement(We.a,{size:4},i.a.createElement("i",{className:"iconfont icon-huifu1",onClick:fn})," ",i.a.createElement("b",null,hn))," ")))},it=D("dhSg"),ot=D("ps8w"),Ge=D.n(ot),$e=D("oBTY"),we=D("M8RZ"),Se=D("OkW/"),Ee=D("ErOA");function ue(qe){return Object(Ee.c)("comments.json",qe)}function de(qe){return Object(Ee.f)("/discusses/".concat(qe,"/plus.json"),{container_type:"Discuss",type:1})}function ye(qe){return Object(Ee.f)("comments/reply.json",qe)}function me(qe){return Object(Ee.f)("comments.json",qe)}function Le(qe){return Object(Ee.f)("comments/".concat(qe==null?void 0:qe.id,"/hidden.json"),qe)}function Xe(qe){return Object(Ee.b)("comments/".concat(qe==null?void 0:qe.id,".json"))}var ut=D("GgEA"),Dt=D("AMnG"),jt=D("xKgJ");function Ut(qe){var vt=qe.author;return i.a.createElement("a",{href:"/users/".concat(vt.login),target:"_blank"},i.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"50",style:{borderRadius:"50%"},src:"".concat(b.a.IMG_SERVER,"/images/").concat(vt.image_url),width:"50"}))}function Ct(qe){var vt=qe.data,Gt=qe.index,fn=qe.parentDiscussIndex,tn=qe.user,Yt=qe.onSetActionType,rt=vt.author,Et=vt.can_delete,dn=vt.content,pt=vt.id,hn=vt.time;function Bt(){Yt({id:pt,index:Gt,type:"delete-discuss",parentDiscussIndex:fn,message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}var vn=tn.admin||Et||rt.user_id===tn.user_id;return i.a.createElement("div",{className:"discuss-item-container second-discuss "},i.a.createElement(Ut,{author:rt}),i.a.createElement("section",null,i.a.createElement("div",{className:"discuss-info"},i.a.createElement("a",{href:"/users/".concat(rt.login),target:"_blank"},rt.name),i.a.createElement("span",{className:"grey"},hn),i.a.createElement("div",{className:"btn-group",style:{marginBottom:0}},vn?i.a.createElement("a",{onClick:Bt,title:"\u5220\u9664"},i.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),i.a.createElement(It.a,{className:"discuss-content",value:dn})))}var et=function(qe){var vt=qe.user,Gt=qe.data,fn=qe.index,tn=qe.onPlusDiscuss,Yt=qe.onSetActionType,rt=qe.activeDiscussIndex,Et=qe.onReplyDiscuss,dn=qe.onSetActiveDiscussIndex,pt=Gt.content,hn=Gt.children,Bt=Gt.hidden,vn=Gt.id,Kn=Gt.praise_count,Mn=Gt.time,Sn=Gt.user_praise,ni=Gt.can_delete,Ln=Gt.author;console.log(ni&&(!hn||hn.length==0),"children22");function Zn(){dn(vn)}function qn(){tn(vn,!Sn,fn)}function bi(){Yt({id:vn,index:fn,type:"delete-discuss",message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}function Un(){Yt({id:vn,index:fn,params:{hidden:Bt?"0":"1"},type:"hidden-discuss",message:Bt?"\u786E\u5B9A\u8981\u53D6\u6D88\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417":"\u786E\u5B9A\u8981\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417"})}var mi=vt.admin||vt.user_id===Ln.user_id;return i.a.createElement("div",{className:"discuss-item-container",key:vn},i.a.createElement(Ut,{author:Ln}),i.a.createElement("section",null,i.a.createElement("div",{className:"discuss-info"},i.a.createElement("a",{href:"/users/".concat(Ln.login),target:"_blank"}," ",Ln.name," "),i.a.createElement("span",{className:"grey"},Mn)),i.a.createElement(It.a,{className:"discuss-content",value:pt}),hn&&hn.length>0?i.a.createElement("div",{className:"reply-discuss-container"},hn.map(function(gi,ai){return i.a.createElement(Ct,{key:gi.id,data:gi,index:ai,user:vt,onSetActionType:Yt,parentDiscussIndex:fn})})):null,i.a.createElement("div",{className:"btn-group"},Object(jt.v)()?i.a.createElement("a",{onClick:Un,title:Bt?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF\u8BC4\u8BBA"},i.a.createElement("i",{className:Bt?"iconfont icon-yincangbiyan":"fa fa-eye"})):null,ni&&(!hn||hn.length==0)?i.a.createElement("a",{onClick:bi,title:"\u5220\u9664"},i.a.createElement("i",{className:"iconfont icon-shanchu"})):null,i.a.createElement("a",{onClick:Zn,title:"\u56DE\u590D"}," ",i.a.createElement("i",{className:"iconfont icon-huifu1"})," "),i.a.createElement("a",{onClick:qn,className:Sn?"c-orange":""},i.a.createElement("i",{className:Sn?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),i.a.createElement("span",null,Kn||""))),i.a.createElement(Dt.a,{id:vn,activeDiscussIndex:rt,onReplyDiscuss:Et})))},st=D("kaH+"),He=D("Wx9E"),pe=D("Ot1p"),Re=function(qe){var vt=qe.user_praise,Gt=qe.praise_count,fn=qe.praisePlus,tn=qe.onCreateDiscuss,Yt=qe.discuss_count,rt=Object(a.useState)(!1),Et=Object(m.a)(rt,2),dn=Et[0],pt=Et[1],hn=Object(a.useState)(""),Bt=Object(m.a)(hn,2),vn=Bt[0],Kn=Bt[1];function Mn(qn){Kn(qn)}function Sn(){pt(!0)}function ni(){pt(!1)}function Ln(){return Zn.apply(this,arguments)}function Zn(){return Zn=Object(p.a)(r.a.mark(function qn(){return r.a.wrap(function(Un){for(;;)switch(Un.prev=Un.next){case 0:tn(vn),Kn(""),pt(!1);case 3:case"end":return Un.stop()}},qn)})),Zn.apply(this,arguments)}return i.a.createElement("div",{className:"dis-input-editor-container ".concat(dn?"active":""," ")},i.a.createElement("div",{className:dn?"text-area hide":"text-area"},i.a.createElement("input",{placeholder:"\u8BF4\u70B9\u4EC0\u4E48",onClick:Sn}),i.a.createElement("a",{style:{alignItems:"center"}}," ",i.a.createElement("i",{className:"iconfont icon-huifu1"})," \xA0 \xA0",Yt," "),i.a.createElement("a",{className:"c-light-black",onClick:fn,style:{alignItems:"center"},title:vt?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},i.a.createElement("i",{className:"mr3 ".concat(vt?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),Gt?i.a.createElement("span",null,Gt):"")),dn?i.a.createElement("div",{className:"input-mask",onClick:ni}):null,i.a.createElement("div",{className:dn?"md-container":"md-container hide"},i.a.createElement(pe.a,{id:"discuss-input-editor",miniToolbar:!0,watch:!1,noStorage:!0,defaultValue:vn,height:240,onChange:Mn}),i.a.createElement("div",{className:"tip-container",onClick:ni},i.a.createElement("a",{className:"btn-send",onClick:Ln}," ","\u53D1\u9001"," "))))},lt={loading:!1,page:1,data:[],count:0,actionType:null,activeDiscussIndex:null},Ye;(function(qe){qe[qe.GET_DISCUSSES=0]="GET_DISCUSSES",qe[qe.TOP_OR_DOWN_DISCUSS=1]="TOP_OR_DOWN_DISCUSS",qe[qe.ACTIVE_DISCUSS_INDEX=2]="ACTIVE_DISCUSS_INDEX",qe[qe.PLUS_DISCUSS=3]="PLUS_DISCUSS",qe[qe.SET_ACTION_TYPE=4]="SET_ACTION_TYPE",qe[qe.SET_PAGE=5]="SET_PAGE",qe[qe.SHOW_DISCUSSES_LOADING=6]="SHOW_DISCUSSES_LOADING"})(Ye||(Ye={}));function Pt(qe,vt){switch(vt.type){case Ye.SHOW_DISCUSSES_LOADING:return Object(d.a)(Object(d.a)({},qe),{},{loading:!0});case Ye.GET_DISCUSSES:return Object(d.a)(Object(d.a)({},qe),vt.payload);case Ye.TOP_OR_DOWN_DISCUSS:return Object(d.a)(Object(d.a)({},qe),vt.payload);case Ye.SET_ACTION_TYPE:return Object(d.a)(Object(d.a)({},qe),vt.payload);case Ye.PLUS_DISCUSS:return Object(d.a)(Object(d.a)({},qe),vt.payload);case Ye.SET_PAGE:return Object(d.a)(Object(d.a)({},qe),{},{page:vt.payload});case Ye.ACTIVE_DISCUSS_INDEX:return Object(d.a)(Object(d.a)({},qe),vt.payload);default:throw new Error}}var Nt=function(qe){var vt=qe.user,Gt=qe.identifier,fn=qe.hack,tn=qe.onTriggerPraise,Yt=qe.setDiscussTotal,rt=Object(a.useReducer)(Pt,lt),Et=Object(m.a)(rt,2),dn=Et[0],pt=Et[1],hn=dn.loading,Bt=dn.page,vn=dn.data,Kn=dn.count,Mn=dn.actionType,Sn=dn.activeDiscussIndex,ni=Object(a.useCallback)(Object(p.a)(r.a.mark(function Tn(){var oi,vi,ui;return r.a.wrap(function(Dn){for(;;)switch(Dn.prev=Dn.next){case 0:return pt({type:Ye.SHOW_DISCUSSES_LOADING}),Dn.next=3,ue({container_type:"Practice",container_identifier:Gt,limit:10,page:Bt});case 3:oi=Dn.sent,vi=oi.comments,ui=oi.disscuss_count,pt({type:Ye.GET_DISCUSSES,payload:{data:vi,count:ui,loading:!1}}),Yt(ui);case 7:case"end":return Dn.stop()}},Tn)})),[Bt,Gt]);Object(a.useEffect)(function(){ni()},[Gt,Bt]);function Ln(Tn){pt({type:Ye.SET_PAGE,page:Tn})}function Zn(Tn){pt({type:Ye.SET_ACTION_TYPE,payload:{actionType:Tn}})}function qn(Tn){Sn===Tn?pt({type:Ye.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}):pt({type:Ye.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:Tn}})}function bi(Tn,oi,vi){return Un.apply(this,arguments)}function Un(){return Un=Object(p.a)(r.a.mark(function Tn(oi,vi,ui){var ti;return r.a.wrap(function(_n){for(;;)switch(_n.prev=_n.next){case 0:return _n.prev=0,_n.next=3,de(oi);case 3:ti=_n.sent,vn[ui].user_praise=vi,vn[ui].praise_count=ti.praise_count,pt({type:Ye.PLUS_DISCUSS,payload:{data:Object($e.a)(vn)}}),_n.next=12;break;case 9:_n.prev=9,_n.t0=_n.catch(0),console.log(_n.t0);case 12:case"end":return _n.stop()}},Tn,null,[[0,9]])})),Un.apply(this,arguments)}function mi(){return gi.apply(this,arguments)}function gi(){return gi=Object(p.a)(r.a.mark(function Tn(){var oi,vi,ui,ti,Dn;return r.a.wrap(function(Rn){for(;;)switch(Rn.prev=Rn.next){case 0:if(oi=Mn.id,vi=Mn.params,ui=Mn.type,ti=Mn.index,Dn=Mn.parentDiscussIndex,!(ui==="hidden-discuss")){Rn.next=7;break}return console.log(vi,"params"),Rn.next=5,Le(Object(d.a)({id:oi,container_type:"Practice",container_identifier:Gt},vi));case 5:Dn?vn[Dn].children[ti].hidden=vi.hidden==1:vn[ti].hidden=vi.hidden==1,pt({type:Ye.SET_ACTION_TYPE,payload:{actionType:null,data:Object($e.a)(vn)}});case 7:if(!(ui==="delete-discuss")){Rn.next=13;break}return Rn.next=10,Xe({id:oi,container_type:"Practice",container_identifier:Gt});case 10:return pt({type:Ye.SET_ACTION_TYPE,payload:{actionType:null}}),Rn.next=13,ni();case 13:case"end":return Rn.stop()}},Tn)})),gi.apply(this,arguments)}function ai(){pt({type:Ye.SET_ACTION_TYPE,payload:{actionType:null}})}function kn(Tn,oi){return ei.apply(this,arguments)}function ei(){return ei=Object(p.a)(r.a.mark(function Tn(oi,vi){return r.a.wrap(function(ti){for(;;)switch(ti.prev=ti.next){case 0:return ti.prev=0,ti.next=3,ye({container_type:"Practice",container_identifier:Gt,comments:{content:vi,parent_id:oi}});case 3:ni(),ti.next=9;break;case 6:ti.prev=6,ti.t0=ti.catch(0),console.log(ti.t0);case 9:case"end":return ti.stop()}},Tn,null,[[0,6]])})),ei.apply(this,arguments)}function Gn(Tn){return Xt.apply(this,arguments)}function Xt(){return Xt=Object(p.a)(r.a.mark(function Tn(oi){return r.a.wrap(function(ui){for(;;)switch(ui.prev=ui.next){case 0:return pt({type:Ye.SHOW_DISCUSSES_LOADING}),ui.next=3,me({comments:{content:oi},container_type:"Practice",container_identifier:Gt});case 3:ni();case 4:case"end":return ui.stop()}},Tn)})),Xt.apply(this,arguments)}return i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"discuss-panel"},vn.length===0?i.a.createElement(ve.a,null):vn.map(function(Tn,oi){return i.a.createElement(et,{onReplyDiscuss:kn,onPlusDiscuss:bi,onSetActiveDiscussIndex:qn,onSetActionType:Zn,data:Tn,index:oi,user:vt,activeDiscussIndex:Sn})}),Kn>10?i.a.createElement("div",{className:"pagination-container"},i.a.createElement(Ue.a,{showQuickJumper:!0,onChange:Ln,current:Bt,total:Kn})):null),i.a.createElement(Re,{user_praise:fn.user_praise,praise_count:fn.praises_count,praisePlus:tn,discuss_count:fn.comments_count,onCreateDiscuss:Gn}),i.a.createElement(we.a,null,i.a.createElement(P.a,{centered:!0,title:"\u63D0\u793A",visible:!!Mn,onOk:mi,onCancel:ai},i.a.createElement("p",null,Mn?Mn.message:"")),i.a.createElement(st.a,null)))},Ke=D("1FX+"),gt=D.n(Ke),bt=D("pYxM"),Tt=D.n(bt),Wt=D("sB/4"),fe=D.n(Wt),se=D("Wtmd"),W=D.n(se),$=D("CNDd"),Z=D.n($),ne=D("nCk5"),he=D.n(ne),Pe=D("kovY"),ze=D.n(Pe),Rt=function(vt){var Gt=vt.style,fn=Gt===void 0?{}:Gt,tn=vt.onClick,Yt=vt.onAssist,rt=vt.onHide,Et=vt.data,dn=vt.active,pt=vt.showLine;return i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:dn===(Et==null?void 0:Et.id)?"".concat(Tt.a.list," ").concat(Tt.a.active):Tt.a.list,style:fn,onClick:function(){return tn(Et)}},(Et==null?void 0:Et.video)&&i.a.createElement("div",{className:Tt.a.left},i.a.createElement("img",{src:Et==null?void 0:Et.video_cover}),i.a.createElement("div",null,i.a.createElement("img",{src:fe.a}),i.a.createElement("span",null,Et==null?void 0:Et.video_duration)),i.a.createElement("div",{className:Tt.a.mask})),i.a.createElement("div",{className:Tt.a.right},i.a.createElement("div",{className:Tt.a.name},i.a.createElement("img",{src:b.a.IMG_SERVER+"/images/"+(Et==null?void 0:Et.image_url),width:30,height:30}),i.a.createElement("div",{title:Et==null?void 0:Et.name,className:Tt.a.title},Et==null?void 0:Et.name),(Et==null?void 0:Et.is_authority)&&i.a.createElement("div",{className:Tt.a.b},"\u5B98\u65B9"),(Et==null?void 0:Et.is_excellent)&&i.a.createElement("div",{className:Tt.a.a},"\u7CBE\u9009")),i.a.createElement("div",{className:Tt.a.des},i.a.createElement(It.a,{showLines:2,showTextOnly:!0,value:(Et==null?void 0:Et.content)||"\u6682\u65E0\u5185\u5BB9"})),i.a.createElement("div",{className:Tt.a.tag},i.a.createElement("span",{className:"current",onClick:function(Bt){Bt.stopPropagation(),Yt(Et)}},i.a.createElement("img",{src:Et!=null&&Et.user_liker?Z.a:W.a}),i.a.createElement("span",{style:{color:Et!=null&&Et.user_liker?"#0152d9":"#656f87"}},Et==null?void 0:Et.praises_count)),i.a.createElement("span",null,i.a.createElement("img",{src:he.a}),i.a.createElement("span",null,Et==null?void 0:Et.discusses_count)),i.a.createElement("span",null,i.a.createElement("img",{src:ze.a}),i.a.createElement("span",null,Et==null?void 0:Et.viewed_count)),Object(jt.v)()&&i.a.createElement("span",{className:"current",style:{color:"#0152d9",marginRight:0,userSelect:"none"},onClick:function(Bt){Bt.stopPropagation(),rt(Et)}},Et!=null&&Et.is_hidden?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF")))),pt&&i.a.createElement("div",{className:Tt.a.line}))},Mt=Rt,Ze=D("5Dmo"),kt=D("3S7+"),an=D("Z8dc"),At=D.n(an),pn=D("7+5b"),nn=D.n(pn),J=D("twBr"),R=D.n(J),k=D("oE5q"),Y=D.n(k),ae=D("9+Du"),q=function(vt){var Gt,fn=vt.onClose,tn=vt.onOk,Yt=vt.identifier,rt=vt.active,Et=O.a.useForm(),dn=Object(m.a)(Et,1),pt=dn[0],hn=Object(a.useState)({}),Bt=Object(m.a)(hn,2),vn=Bt[0],Kn=Bt[1],Mn=Object(a.useState)(!1),Sn=Object(m.a)(Mn,2),ni=Sn[0],Ln=Sn[1],Zn=Object(a.useState)(!1),qn=Object(m.a)(Zn,2),bi=qn[0],Un=qn[1],mi=Object(a.useState)([]),gi=Object(m.a)(mi,2),ai=gi[0],kn=gi[1],ei=Object(jt.x)(),Gn=Object(x.i)();Object(a.useEffect)(function(){rt&&Xt()},[rt]);var Xt=function(){var ln=Object(p.a)(r.a.mark(function Ht(){var qt,gn,di,Li,qi,Hi,Or,li,Rr,Nr,Kr,Ur;return r.a.wrap(function(_r){for(;;)switch(_r.prev=_r.next){case 0:return _r.next=2,Object(w.k)(Yt,{active:rt});case 2:qt=_r.sent,(qt==null?void 0:qt.status)===0&&(Hi={name:qt==null||((gn=qt.data)===null||gn===void 0)?void 0:gn.name,content:qt==null||((di=qt.data)===null||di===void 0)?void 0:di.content},pt.setFieldsValue(Hi),Kn(Hi),qt!=null&&(Li=qt.data)!==null&&Li!==void 0&&(qi=Li.videos)!==null&&qi!==void 0&&qi[0]&&kn([{video_id:qt==null||((Or=qt.data)===null||Or===void 0||((li=Or.videos)===null||li===void 0||((Rr=li[0])===null||Rr===void 0)))?void 0:Rr.video_id,name:qt==null||((Nr=qt.data)===null||Nr===void 0||((Kr=Nr.videos)===null||Kr===void 0||((Ur=Kr[0])===null||Ur===void 0)))?void 0:Ur.title,loaded:100}]));case 4:case"end":return _r.stop()}},Ht)}));return function(){return ln.apply(this,arguments)}}(),Tn=function(Ht,qt){Kn(Object(d.a)({},qt))},oi=function(){var ln=Object(p.a)(r.a.mark(function Ht(qt){var gn,di,Li,qi,Hi;return r.a.wrap(function(li){for(;;)switch(li.prev=li.next){case 0:if(di={videos:ai,articles:qt},Un(!0),!rt){li.next=9;break}return di.active=rt,li.next=6,Object(w.j)(Yt,di);case 6:Li=li.sent,li.next=12;break;case 9:return li.next=11,Object(w.a)(Yt,di);case 11:Li=li.sent;case 12:((gn=Li)===null||gn===void 0?void 0:gn.status)===0&&(console.log(rt||((qi=Li)===null||qi===void 0?void 0:qi.id),44),tn(rt||((Hi=Li)===null||Hi===void 0?void 0:Hi.id))),Un(!1);case 14:case"end":return li.stop()}},Ht)}));return function(qt){return ln.apply(this,arguments)}}(),vi=function(Ht){var qt=1024,gn=Ht.name.toLowerCase();return gn&&gn.indexOf(".avi")==-1&&gn.indexOf(".flv")==-1&&gn.indexOf(".f4v")==-1&&gn.indexOf(".m4v")==-1&&gn.indexOf(".mov")==-1&&gn.indexOf(".mp4")==-1&&gn.indexOf(".rmvb")==-1&&gn.indexOf(".swf")==-1&&gn.indexOf(".webm")==-1&&gn.indexOf(".wmv")==-1?(N.b.info("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u683C\u5F0F"),!0):Ht.size>qt*1024*1024?(N.b.info("\u89C6\u9891\u5927\u5C0F\u8D85\u8FC7".concat(qt,"M")),!0):ai!=null&&ai.find(function(di){return di.name===Ht.name})?(N.b.info("\u4F60\u4E0D\u80FD\u4E0A\u4F20\u540C\u4E00\u4E2A\u89C6\u9891\u6587\u4EF6\u540D\u79F0\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002"),!0):!1},ui=function(Ht,qt){P.a.confirm({title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:i.a.createElement("div",{className:"tc"},"\u60A8\u786E\u8BA4\u8981",qt?"\u5220\u9664":"\u53D6\u6D88\u4E0A\u4F20","\u8BE5\u89C6\u9891\u5417\uFF1F"),onOk:function(){kn([])}})},ti={accept:".mkv, .flv, .f4v, .rmvb, .swf, video/mp4,video/x-m4v,video/flv,video/f4v,video/rmvb,video/swf,video/*",onBefore:vi,onBeginInitFile:function(Ht){Ln(!0),kn([{name:Ht.filename,loaded:0}])},onComplete:function(Ht){kn([{name:Ht.filename,loaded:Ht.percent,video_id:Ht.id}]),Ln(!1)},onError:function(){kn([]),Ln(!1)},onProgress:function(Ht){kn([{name:Ht.filename,loaded:Ht.percent}])},chunkSize:1024*1024*2,options:{user_id:ei==null?void 0:ei.user_id}},Dn=function(){return i.a.createElement(ae.a,ti,i.a.createElement("div",{className:At.a.main},i.a.createElement("img",{src:nn.a,alt:""}),i.a.createElement("span",null,"\u4E0A\u4F20\u89C6\u9891")))},_n=function(Ht){return i.a.createElement("div",{className:At.a.mainLoading},i.a.createElement("div",{className:At.a.proWarp},i.a.createElement("div",{className:At.a.pro},i.a.createElement("div",{style:{width:Ht}})),i.a.createElement("span",null,Ht||0,"%")),i.a.createElement("aside",null,"\u4E0A\u4F20\u4E2D"),i.a.createElement("div",{className:At.a.tip},i.a.createElement(kt.a,{getPopupContainer:function(gn){return gn.parentNode},title:i.a.createElement("div",null,i.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",i.a.createElement("a",{className:"current c-light-primary",target:"_blank",href:"/users/innov/videos/protocol"},"\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"),"\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"),i.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),i.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},i.a.createElement("img",{src:Y.a,alt:""}))))},Rn=function(Ht){return i.a.createElement("div",{className:At.a.mainSucceed},i.a.createElement("img",{src:R.a,alt:""}),i.a.createElement("span",null,"\u4E0A\u4F20\u6210\u529F"),i.a.createElement("div",{className:At.a.tip},i.a.createElement(kt.a,{getPopupContainer:function(gn){return gn.parentNode},title:i.a.createElement("div",null,i.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",i.a.createElement("a",{className:"current c-light-primary",target:"_blank",href:"/users/innov/videos/protocol"},"\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"),"\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"),i.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),i.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},i.a.createElement("img",{src:Y.a,alt:""}))),i.a.createElement("div",{className:At.a.del,onClick:function(){return ui(Ht.name,Ht.loaded==100)}},i.a.createElement("i",{className:"iconfont icon-shanchu7 mr5"}),"\u5220\u9664\u89C6\u9891"))},Vt=function(){return i.a.createElement(i.a.Fragment,null,ai==null?void 0:ai.map(function(Ht,qt){return i.a.createElement(i.a.Fragment,{key:qt},Ht.loaded==100?Rn(Ht):_n(Ht.loaded))}))},Jt=function(){P.a.confirm({centered:!0,width:500,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u6CE8\u610F",icon:null,className:"custom-modal-divider",content:"\u60A8\u6B63\u5728\u7F16\u5199\u9898\u89E3\uFF0C\u70B9\u51FB\u5173\u95ED\u540E\uFF0C\u60A8\u7684\u9898\u89E3\u5185\u5BB9\u5C06\u4E0D\u4F1A\u8FDB\u884C\u4FDD\u5B58\u3002",onOk:fn})},sn=ai==null?void 0:ai.length;return i.a.createElement("div",{className:At.a.listForm},i.a.createElement("header",null,rt?"\u7F16\u8F91":"\u53D1\u5E03","\u9898\u89E3"),i.a.createElement("section",{className:At.a.scroll,id:"sss"},i.a.createElement("div",{className:At.a.formWrap}," ",i.a.createElement(O.a,{form:pt,scrollToFirstError:!0,layout:"vertical",onValuesChange:Tn,onFinish:oi},i.a.createElement(O.a.Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0"},{max:60,message:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}]},i.a.createElement(te.a,{bordered:!1,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26",suffix:"".concat(((Gt=vn.name)===null||Gt===void 0?void 0:Gt.length)||0,"/60")})),i.a.createElement(O.a.Item,{name:"content",label:"\u5185\u5BB9:"},i.a.createElement(pe.a,{defaultValue:vn.content||"",watch:!0})))),i.a.createElement("div",{className:At.a.upload},sn?Vt():Dn())),i.a.createElement("div",{className:At.a.btns},i.a.createElement(G.a,{onClick:Jt,type:"primary",ghost:!0},"\u5173\u95ED"),i.a.createElement(G.a,{loading:bi,disabled:ni,onClick:function(){return pt.submit()},type:"primary"},"\u53D1\u5E03\u9898\u89E3")))},Ie=q,ht=D("cWXX"),Ot=D("/ezw"),$t=D("CaVn"),ft=D.n($t),zt=D("s8/Y"),on=D.n(zt),Wn=D("JOrW"),Si=D.n(Wn),hi=D("gqXR"),Fn=D.n(hi),ci=D("14J3"),Zi=D("BMrR"),yi=D("jCWc"),ri=D("kPKH"),Ci=D("wW8i"),Di=D.n(Ci),Oi=D("MVJL"),Ri=D.n(Oi),Vi=function(vt){var Gt=vt.id,fn=vt.cb,tn=Object(a.useState)(""),Yt=Object(m.a)(tn,2),rt=Yt[0],Et=Yt[1];return i.a.createElement("aside",{className:"mt10"},i.a.createElement(pe.a,{defaultValue:rt,id:"writeForumsReviewId",onChange:function(pt){Et(pt)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),i.a.createElement(Zi.a,null,i.a.createElement(ri.a,{flex:"1"}),i.a.createElement(ri.a,null,i.a.createElement(G.a,{type:"primary",size:"large",onClick:Object(p.a)(r.a.mark(function dn(){return r.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:rt===""?N.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"):fn(Gt,rt);case 1:case"end":return hn.stop()}},dn)}))},"\u53D1\u9001"))))},dr=function(vt){var Gt,fn=vt.data;return i.a.createElement("div",{className:Ri.a.thirdlyLevelDiscuss},i.a.createElement("span",{className:"c-grey-333"},i.a.createElement("span",{className:"font 14 c-light-primary"},fn==null||((Gt=fn.author)===null||Gt===void 0)?void 0:Gt.name),"@",i.a.createElement("span",{className:"font 14 c-light-primary"},fn==null?void 0:fn.parent_name),":"),i.a.createElement(It.a,{value:fn==null?void 0:fn.content}))},rr=function(vt){var Gt,fn,tn,Yt,rt=vt.data,Et=vt.onReplyDiscuss,dn=vt.thirdlyReply,pt=vt.setThirdlyReply,hn=Object(jt.x)();return console.log(hn,"user"),i.a.createElement("div",{className:Ri.a.list},i.a.createElement("img",{src:b.a.IMG_SERVER+"/images/"+(rt==null||((Gt=rt.author)===null||Gt===void 0)?void 0:Gt.image_url)}),i.a.createElement("div",{className:Ri.a.wrap},i.a.createElement("div",{className:"font14",style:{marginBottom:6}},i.a.createElement("span",{className:"c-grey-333"},rt==null||((fn=rt.author)===null||fn===void 0)?void 0:fn.name),(hn==null?void 0:hn.login)!==(rt==null||((tn=rt.author)===null||tn===void 0)?void 0:tn.login)&&i.a.createElement("span",{onClick:function(){return pt(rt==null?void 0:rt.id)},className:"c-grey-999 current",style:{float:"right"}},i.a.createElement("i",{className:"iconfont icon-huifu3 mr3 font12"}),i.a.createElement("span",null,"\u56DE\u590D"))),i.a.createElement(It.a,{value:rt==null?void 0:rt.content}),rt==null||((Yt=rt.children)===null||Yt===void 0)?void 0:Yt.map(function(Bt){return i.a.createElement(dr,{key:Bt.id,data:Bt})}),dn===(rt==null?void 0:rt.id)&&i.a.createElement("div",null,i.a.createElement(Vi,{id:rt==null?void 0:rt.id,cb:Et}),i.a.createElement("div",{style:{textAlign:"end",paddingTop:20},onClick:function(){return pt(null)},className:"c-light-primary current"},i.a.createElement("i",{style:{transform:"scale(0.7)",display:"inline-block"},className:"iconfont icon-shouqi font12"}),"\u6536\u8D77\u56DE\u590D")),i.a.createElement("div",{className:Ri.a.line})))},ji=function(vt){var Gt,fn,tn,Yt,rt=vt.data,Et=vt.onReplyDiscuss,dn=vt.secondReply,pt=vt.setSecondReply,hn=vt.thirdlyReply,Bt=vt.setThirdlyReply,vn=vt.onPlusDiscuss,Kn=Object(a.useState)(!1),Mn=Object(m.a)(Kn,2),Sn=Mn[0],ni=Mn[1];return console.log(rt,"data"),i.a.createElement("div",{className:Ri.a.discussItem},i.a.createElement("div",{className:Ri.a.list},i.a.createElement("img",{src:b.a.IMG_SERVER+"/images/"+(rt==null||((Gt=rt.author)===null||Gt===void 0)?void 0:Gt.image_url)}),i.a.createElement("div",{className:Ri.a.wrap},i.a.createElement("div",{className:"font14",style:{marginBottom:6}},i.a.createElement("span",{className:"c-grey-333 mr30"},rt==null||((fn=rt.author)===null||fn===void 0)?void 0:fn.name),i.a.createElement("span",{className:"c-grey-999"},rt==null?void 0:rt.time)),i.a.createElement(It.a,{value:rt==null?void 0:rt.content}),i.a.createElement("div",{className:Ri.a.btns},i.a.createElement("div",{onClick:function(){return vn(rt==null?void 0:rt.id)},className:rt!=null&&rt.user_praise?"c-light-primary":"c-grey-999"},i.a.createElement("i",{className:"iconfont icon-xiaodianzan2 mr3"}),i.a.createElement("span",null,rt==null?void 0:rt.praise_count)),i.a.createElement("div",{onClick:function(){var Zn;if((rt==null||((Zn=rt.children)===null||Zn===void 0)?void 0:Zn.length)===0)return;pt(null),ni(!Sn)},style:{color:Sn?"#0152d9":"#999999"}},i.a.createElement("i",{className:"iconfont icon-xiaopinglun2 mr3"}),i.a.createElement("span",null,Sn?"\u6536\u8D77\u8BC4\u8BBA":rt==null||((tn=rt.children)===null||tn===void 0)?void 0:tn.length)),i.a.createElement("div",{onClick:function(){ni(!1),pt(dn===(rt==null?void 0:rt.id)?null:rt==null?void 0:rt.id)},style:{color:dn===(rt==null?void 0:rt.id)?"#0152d9":"#999999"}},i.a.createElement("i",{className:"iconfont icon-huifu3 mr3"}),i.a.createElement("span",null,dn===(rt==null?void 0:rt.id)?"\u6536\u8D77\u56DE\u590D":"\u56DE\u590D"))),dn===(rt==null?void 0:rt.id)&&i.a.createElement(Vi,{id:rt==null?void 0:rt.id,cb:function(Zn,qn){Et(Zn,qn),ni(!0)}}),Sn&&i.a.createElement("div",{className:Ri.a.secondLevelDiscuss},rt==null||((Yt=rt.children)===null||Yt===void 0)?void 0:Yt.map(function(Ln){return i.a.createElement(rr,{thirdlyReply:hn,setThirdlyReply:Bt,key:Ln.id,data:Ln,onReplyDiscuss:Et})})))))},Wi=ji,hr=function(vt){var Gt=vt.identifier,fn=vt.active,tn=vt.onOk,Yt=Object(a.useState)(""),rt=Object(m.a)(Yt,2),Et=rt[0],dn=rt[1],pt=Object(a.useState)(1),hn=Object(m.a)(pt,2),Bt=hn[0],vn=hn[1],Kn=Object(a.useState)([]),Mn=Object(m.a)(Kn,2),Sn=Mn[0],ni=Mn[1],Ln=Object(a.useState)(0),Zn=Object(m.a)(Ln,2),qn=Zn[0],bi=Zn[1],Un=Object(a.useState)(null),mi=Object(m.a)(Un,2),gi=mi[0],ai=mi[1],kn=Object(a.useState)(null),ei=Object(m.a)(kn,2),Gn=ei[0],Xt=ei[1];Object(a.useEffect)(function(){Tn(1),vn(1)},[fn]);var Tn=function(){var Dn=Object(p.a)(r.a.mark(function _n(Rn){var Vt;return r.a.wrap(function(sn){for(;;)switch(sn.prev=sn.next){case 0:return sn.next=2,ue({container_type:"QuestionSolutionArticle",container_identifier:fn,limit:5,page:Rn});case 2:Vt=sn.sent,Vt!=null&&Vt.comments&&(ni((Vt==null?void 0:Vt.comments)||[]),vn(Rn),bi(Vt==null?void 0:Vt.disscuss_count));case 4:case"end":return sn.stop()}},_n)}));return function(Rn){return Dn.apply(this,arguments)}}(),oi=function(){var Dn=Object(p.a)(r.a.mark(function _n(){var Rn;return r.a.wrap(function(Jt){for(;;)switch(Jt.prev=Jt.next){case 0:if(!(Et==="")){Jt.next=3;break}return N.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Jt.abrupt("return");case 3:return Jt.next=5,me({comments:{content:Et},container_type:"QuestionSolutionArticle",container_identifier:fn});case 5:Rn=Jt.sent,Rn!=null&&Rn.discuss&&(dn(""),Tn(Bt),tn());case 7:case"end":return Jt.stop()}},_n)}));return function(){return Dn.apply(this,arguments)}}(),vi=function(){var Dn=Object(p.a)(r.a.mark(function _n(Rn,Vt,Jt){var sn;return r.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:return Ht.next=2,ye({container_type:"QuestionSolutionArticle",container_identifier:fn,comments:{content:Vt,parent_id:Rn}});case 2:sn=Ht.sent,ai(null),Xt(null),Tn(Bt);case 6:case"end":return Ht.stop()}},_n)}));return function(Rn,Vt,Jt){return Dn.apply(this,arguments)}}(),ui=function(){var Dn=Object(p.a)(r.a.mark(function _n(Rn){var Vt;return r.a.wrap(function(sn){for(;;)switch(sn.prev=sn.next){case 0:return sn.next=2,de(Rn);case 2:Vt=sn.sent,Tn(Bt);case 4:case"end":return sn.stop()}},_n)}));return function(Rn){return Dn.apply(this,arguments)}}(),ti=function(_n){vn(_n),Tn(_n)};return i.a.createElement("div",{className:Di.a.discuss},i.a.createElement("aside",{className:Di.a.reply,style:{borderWidth:qn?1:0}},i.a.createElement(pe.a,{defaultValue:Et,id:"writeForumsReviewId",onChange:function(_n){dn(_n)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),i.a.createElement(Zi.a,null,i.a.createElement(ri.a,{flex:"1"}),i.a.createElement(ri.a,null,i.a.createElement(G.a,{type:"primary",size:"large",onClick:function(){return oi()}},"\u53D1\u9001")))),Sn==null?void 0:Sn.map(function(Dn){return i.a.createElement(Wi,{secondReply:gi,setSecondReply:ai,thirdlyReply:Gn,setThirdlyReply:Xt,key:Dn.id,data:Dn,onReplyDiscuss:vi,onPlusDiscuss:ui})}),i.a.createElement(Ue.a,{className:Di.a.pagination,showTotal:function(_n){return i.a.createElement("span",{style:{color:"#656F87"}},"\u5171",i.a.createElement("span",{className:"c-light-primary"},_n),"\u6761\u6570\u636E")},current:Bt,onChange:ti,total:qn,showSizeChanger:!1,showQuickJumper:!0,hideOnSinglePage:!0,pageSize:5}))},Tr=hr,ar=D("hgre"),Hn=function(vt){var Gt,fn,tn,Yt,rt,Et,dn,pt,hn,Bt,vn=vt.active,Kn=vt.identifier,Mn=vt.onAssist,Sn=vt.onEdit,ni=vt.onArticlesSkip,Ln=vt.onClose,Zn=vt.onOk,qn=vt.onDelete,bi=vt.detailsIndex,Un=vt.btnShowStatus,mi=Object(a.useState)(!0),gi=Object(m.a)(mi,2),ai=gi[0],kn=gi[1],ei=Object(a.useState)({}),Gn=Object(m.a)(ei,2),Xt=Gn[0],Tn=Gn[1];Object(a.useEffect)(function(){vn&&oi()},[vn,bi]);var oi=function(){var _n=Object(p.a)(r.a.mark(function Rn(){var Vt,Jt,sn=arguments;return r.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:return Vt=sn.length>0&&sn[0]!==void 0?sn[0]:!0,Vt&&kn(!0),Ht.next=4,Object(w.d)(Kn,{active:vn});case 4:Jt=Ht.sent,(Jt==null?void 0:Jt.status)===0&&Tn((Jt==null?void 0:Jt.data)||{}),kn(!1);case 7:case"end":return Ht.stop()}},Rn)}));return function(){return _n.apply(this,arguments)}}(),vi=function(){var _n=Object(p.a)(r.a.mark(function Rn(Vt){var Jt;return r.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:return ln.next=2,Object(w.g)(Kn,Object(d.a)({active:vn},Vt));case 2:Jt=ln.sent,(Jt==null?void 0:Jt.status)===0&&(oi(!1),Zn());case 4:case"end":return ln.stop()}},Rn)}));return function(Vt){return _n.apply(this,arguments)}}(),ui=function(){var _n=Object(p.a)(r.a.mark(function Rn(Vt){var Jt;return r.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:return ln.next=2,Object(w.c)(Kn,{active:Vt==null?void 0:Vt.id});case 2:Jt=ln.sent,Jt.status===0&&(oi(!1),Zn());case 4:case"end":return ln.stop()}},Rn)}));return function(Vt){return _n.apply(this,arguments)}}(),ti=function(Rn){P.a.confirm({centered:!0,width:500,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",icon:null,className:"custom-modal-divider",content:"\u786E\u8BA4\u8981\u5220\u9664\u8BE5\u9898\u89E3\u5417?",onOk:function(){return qn(Rn)}})},Dn=function(){oi(!1),Zn()};return i.a.createElement("div",{className:ft.a.listDetails},i.a.createElement(Ot.a,{className:"pt20 pl20 pr20",loading:ai,active:!0,paragraph:{rows:5}},i.a.createElement("div",{className:ft.a.head},i.a.createElement("div",{className:ft.a.name},i.a.createElement("div",{title:Xt==null?void 0:Xt.name,className:ft.a.title},Xt==null?void 0:Xt.name),(Xt==null?void 0:Xt.is_authority)&&i.a.createElement("div",{className:ft.a.b},"\u5B98\u65B9"),(Xt==null?void 0:Xt.is_excellent)&&i.a.createElement("div",{className:ft.a.a},"\u7CBE\u9009")),i.a.createElement("div",{className:ft.a.tag},i.a.createElement("img",{src:b.a.IMG_SERVER+"/images/"+(Xt==null?void 0:Xt.image_url)}),i.a.createElement("div",{className:"c-grey-333 ml5 mr20 font14"},Xt==null?void 0:Xt.username),i.a.createElement("div",{style:{display:"inline-block",marginBottom:-2},className:"c-grey-999 mr20 font12"},"\u53D1\u5E03\u4E8E",wt()(Xt==null?void 0:Xt.created_at).format("YYYY-MM-DD")),i.a.createElement("span",null,i.a.createElement("img",{src:W.a}),i.a.createElement("span",null,Xt==null?void 0:Xt.praises_count)),i.a.createElement("span",null,i.a.createElement("img",{src:he.a}),i.a.createElement("span",null,Xt==null?void 0:Xt.discusses_count)),i.a.createElement("span",null,i.a.createElement("img",{src:ze.a}),i.a.createElement("span",null,Xt==null?void 0:Xt.viewed_count)),i.a.createElement("div",{className:ft.a.btn},(Object(jt.v)()||(Xt==null?void 0:Xt.is_self))&&i.a.createElement(i.a.Fragment,null,i.a.createElement(G.a,{onClick:function(){return ti(Xt)},type:"primary",ghost:!0},"\u5220\u9664"),i.a.createElement(G.a,{onClick:function(){return Sn(Xt)},type:"primary",ghost:!0},"\u7F16\u8F91")),Object(jt.v)()&&i.a.createElement(G.a,{onClick:function(){return vi({is_authority:!(Xt!=null&&Xt.is_authority)})},type:"primary"},i.a.createElement("img",{src:Si.a}),Xt!=null&&Xt.is_authority?"\u53D6\u6D88":"\u8BBE\u4E3A","\u5B98\u65B9"),Object(jt.v)()&&i.a.createElement(G.a,{onClick:function(){return vi({is_excellent:!(Xt!=null&&Xt.is_excellent)})},type:"primary"},i.a.createElement("img",{src:on.a}),Xt!=null&&Xt.is_excellent?"\u53D6\u6D88":"\u8BBE\u4E3A","\u7CBE\u9009")))),i.a.createElement("div",{className:ft.a.scroll},(Xt==null||((Gt=Xt.videos)===null||Gt===void 0||((fn=Gt[0])===null||fn===void 0))?void 0:fn.id)&&i.a.createElement("div",{className:ft.a.video},i.a.createElement(I.a,{tip:"\u6B63\u5728\u8F6C\u7801\uFF0C\u8BF7\u7A0D\u7B49...",spinning:!(Xt!=null&&(tn=Xt.videos)!==null&&tn!==void 0&&(Yt=tn[0])!==null&&Yt!==void 0&&Yt.transcoded)},i.a.createElement(ar.a,{poster:Xt==null||((rt=Xt.videos)===null||rt===void 0||((Et=rt[0])===null||Et===void 0))?void 0:Et.cover_url,src:(Xt==null||((dn=Xt.videos)===null||dn===void 0||((pt=dn[0])===null||pt===void 0))?void 0:pt.play_url)||"",videoId:Xt==null||((hn=Xt.videos)===null||hn===void 0||((Bt=hn[0])===null||Bt===void 0))?void 0:Bt.id,logWatchHistory:function(){}}))),i.a.createElement(It.a,{className:ft.a.html,value:(Xt==null?void 0:Xt.content)||""}),i.a.createElement("div",{onClick:function(){return ui(Xt)},className:ft.a.g},i.a.createElement("img",{className:"mr10",src:(Xt!=null&&Xt.user_liker,Fn.a)}),i.a.createElement("span",null,Xt==null?void 0:Xt.praises_count)),i.a.createElement(Tr,{onOk:Dn,active:vn,identifier:Kn})),i.a.createElement("div",{className:ft.a.btns},i.a.createElement(G.a,{onClick:function(){return Ln()},type:"primary",ghost:!0},"\u5173\u95ED"),Un[0]&&i.a.createElement(G.a,{onClick:function(Rn){return ni(Rn,"prev")},style:{marginLeft:20},type:"primary"},"\u4E0A\u4E00\u9898\u89E3"),Un[1]&&i.a.createElement(G.a,{onClick:function(Rn){return ni(Rn,"next")},style:{marginLeft:20},type:"primary"},"\u4E0B\u4E00\u9898\u89E3"))))},wn=Hn,_i=D("3tLw"),Nn=D.n(_i),Ti=D("ek7X"),ii=D("0NbB"),wr=function(vt){var Gt=vt.identifier,fn=vt.tabStatus,tn=vt.setFilterListTotal,Yt=vt.setListStatus,rt={page:1,limit:10,total:0,search:"",save_search:"",sort_by:"updated_at",sort_direction:null},Et=Object(a.useState)(Object(d.a)({},rt)),dn=Object(m.a)(Et,2),pt=dn[0],hn=dn[1],Bt=Object(a.useState)(!1),vn=Object(m.a)(Bt,2),Kn=vn[0],Mn=vn[1],Sn=Object(a.useState)(0),ni=Object(m.a)(Sn,2),Ln=ni[0],Zn=ni[1],qn=Object(a.useState)(1),bi=Object(m.a)(qn,2),Un=bi[0],mi=bi[1],gi=Object(a.useState)(null),ai=Object(m.a)(gi,2),kn=ai[0],ei=ai[1],Gn=Object(a.useState)([]),Xt=Object(m.a)(Gn,2),Tn=Xt[0],oi=Xt[1],vi=Object(a.useState)([!0,!0]),ui=Object(m.a)(vi,2),ti=ui[0],Dn=ui[1],_n=Object(a.useState)(0),Rn=Object(m.a)(_n,2),Vt=Rn[0],Jt=Rn[1],sn=Object(a.useRef)(null);Object(a.useEffect)(function(){li()},[fn]),Object(a.useEffect)(function(){ln()},[kn]),Object(a.useEffect)(function(){qt(Object(d.a)({},rt)),li()},[Gt]),Object(a.useEffect)(function(){return window.addEventListener("resize",Ht),Yt(Vt),function(){window.removeEventListener("resize",Ht)}},[Vt]);var ln=function(){var fi=Object(p.a)(r.a.mark(function xn(){var zn,Yn;return r.a.wrap(function(Vn){for(;;)switch(Vn.prev=Vn.next){case 0:if(kn){Vn.next=3;break}return Dn([!0,!0]),Vn.abrupt("return");case 3:zn=[!0,!0],Yn=Tn==null?void 0:Tn.findIndex(function(Ar){return Ar.id===kn}),Yn===0&&pt.page===1&&(zn[0]=!1),(pt.page-1)*pt.limit+(Yn+1)===pt.total&&(zn[1]=!1),Dn(zn);case 8:case"end":return Vn.stop()}},xn)}));return function(){return fi.apply(this,arguments)}}(),Ht=function(){if(Vt){var xn,zn=window.innerWidth-((xn=sn.current)===null||xn===void 0?void 0:xn.clientWidth);Zn(zn)}},qt=function(){var fi=Object(p.a)(r.a.mark(function xn(zn){var Yn,Ui,Vn,Ar;return r.a.wrap(function($i){for(;;)switch($i.prev=$i.next){case 0:return Mn(!0),$i.next=3,Object(w.f)(Gt,zn);case 3:return Yn=$i.sent,(Yn==null?void 0:Yn.status)===0&&(oi((Yn==null||((Ui=Yn.data)===null||Ui===void 0)?void 0:Ui.articles)||[]),hn(Object(d.a)(Object(d.a)({},zn),{},{total:Yn==null||((Vn=Yn.data)===null||Vn===void 0)?void 0:Vn.articles_count})),tn(Yn==null||((Ar=Yn.data)===null||Ar===void 0)?void 0:Ar.articles_count)),Mn(!1),$i.abrupt("return",Yn);case 7:case"end":return $i.stop()}},xn)}));return function(zn){return fi.apply(this,arguments)}}(),gn=function(){(pt==null?void 0:pt.sort_direction)===null?pt.sort_direction="asc":(pt==null?void 0:pt.sort_direction)==="asc"?pt.sort_direction="desc":(pt==null?void 0:pt.sort_direction)==="desc"&&(pt.sort_direction=null),pt.page=1,li(),hn(Object(d.a)({},pt)),qt(pt)},di=function(){pt.page=1,pt.search=pt==null?void 0:pt.save_search,li(),hn(Object(d.a)({},pt)),qt(pt)},Li=function(){var xn,zn=document.getElementsByClassName("btn-resize");zn[0].style.visibility="hidden";var Yn=window.innerWidth-((xn=sn.current)===null||xn===void 0?void 0:xn.clientWidth);Zn(Yn)},qi=function(){Li(),Jt(1)},Hi=function(xn){Li(),ei(xn==null?void 0:xn.id),Jt(3)},Or=function(xn){Li(),ei(xn==null?void 0:xn.id),Jt(2)},li=function(){var xn=document.getElementsByClassName("btn-resize");xn[0].style.visibility="visible",Zn(0),Jt(0),ei(null)},Rr=function(xn){Jt(3),ei(xn),pt.page=1,hn(Object(d.a)({},pt)),qt(pt)},Nr=function(xn){Jt(3),ei(xn),hn(Object(d.a)({},pt)),qt(pt)},Kr=function(xn){hn(Object(d.a)({},pt)),qt(pt)},Ur=function(){var fi=Object(p.a)(r.a.mark(function xn(zn){var Yn;return r.a.wrap(function(Vn){for(;;)switch(Vn.prev=Vn.next){case 0:return Vn.next=2,Object(w.c)(Gt,{active:zn==null?void 0:zn.id});case 2:Yn=Vn.sent,Yn.status===0&&(qt(pt),mi(Un+1));case 4:case"end":return Vn.stop()}},xn)}));return function(zn){return fi.apply(this,arguments)}}(),ca=function(){var fi=Object(p.a)(r.a.mark(function xn(zn){var Yn;return r.a.wrap(function(Vn){for(;;)switch(Vn.prev=Vn.next){case 0:return Vn.next=2,Object(w.e)(Gt,{active:zn==null?void 0:zn.id});case 2:Yn=Vn.sent,Yn.status===0&&(qt(pt),mi(Un+1));case 4:case"end":return Vn.stop()}},xn)}));return function(zn){return fi.apply(this,arguments)}}(),_r=function(){var fi=Object(p.a)(r.a.mark(function xn(zn){var Yn;return r.a.wrap(function(Vn){for(;;)switch(Vn.prev=Vn.next){case 0:return Vn.next=2,Object(w.i)(Gt,{active:zn==null?void 0:zn.id});case 2:Yn=Vn.sent,Yn.status===0&&(li(),qt(pt));case 4:case"end":return Vn.stop()}},xn)}));return function(zn){return fi.apply(this,arguments)}}(),ta=function(xn){pt.page=xn,hn(Object(d.a)({},pt)),qt(pt)},Da=function(){var fi=Object(p.a)(r.a.mark(function xn(zn,Yn){var Ui,Vn,Ar,Br,$i,Lr,Pi,sr,Pn,Cn,$n;return r.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:if(Ui=Tn==null?void 0:Tn.findIndex(function(Ei){return Ei.id===kn}),console.log(Ui,Yn,22),!(Yn==="prev")){In.next=21;break}if(!(Ui===void 0)){In.next=6;break}return N.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),In.abrupt("return");case 6:if(!(Ui===0)){In.next=19;break}if(!(pt.page===1)){In.next=10;break}return N.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),In.abrupt("return");case 10:if(!(pt.page!==1)){In.next=17;break}return pt.page=pt.page-1,hn(Object(d.a)({},pt)),In.next=15,qt(pt);case 15:Vn=In.sent,(Vn==null?void 0:Vn.status)===0&&(Lr=Vn==null||((Ar=Vn.data)===null||Ar===void 0)?void 0:Ar.articles[(Vn==null||((Br=Vn.data)===null||Br===void 0||(($i=Br.articles)===null||$i===void 0))?void 0:$i.length)-1],ei(Lr==null?void 0:Lr.id),console.log(zn.target,555));case 17:In.next=21;break;case 19:Pi=Tn[Ui-1],ei(Pi==null?void 0:Pi.id);case 21:if(!(Yn==="next")){In.next=39;break}if(!(Ui===void 0)){In.next=25;break}return N.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),In.abrupt("return");case 25:if(!((pt.page-1)*pt.limit+(Ui+1)===pt.total)){In.next=28;break}return N.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),In.abrupt("return");case 28:if(!(Ui+1===pt.limit)){In.next=37;break}return pt.page=pt.page+1,hn(Object(d.a)({},pt)),In.next=33,qt(pt);case 33:sr=In.sent,(sr==null?void 0:sr.status)===0&&(Cn=sr==null||((Pn=sr.data)===null||Pn===void 0)?void 0:Pn.articles[0],ei(Cn==null?void 0:Cn.id)),In.next=39;break;case 37:$n=Tn[Ui+1],ei($n==null?void 0:$n.id);case 39:case"end":return In.stop()}},xn)}));return function(zn,Yn){return fi.apply(this,arguments)}}();return i.a.createElement("div",{className:gt.a.wrap,ref:sn},i.a.createElement("div",{className:gt.a.head},i.a.createElement("div",{className:gt.a.sort,onClick:gn},i.a.createElement("span",null,"\u6700\u65B0"),i.a.createElement("aside",null,i.a.createElement(Ti.a,{style:{color:(pt==null?void 0:pt.sort_direction)==="asc"?"#0152d9":"#bfbfbf"}}),i.a.createElement(ii.a,{style:{color:(pt==null?void 0:pt.sort_direction)==="desc"?"#0152d9":"#bfbfbf"}}))),i.a.createElement(te.a.Search,{value:pt.save_search,className:gt.a["oj-width-input"],placeholder:"\u641C\u7D22\u9898\u89E3",onChange:function(xn){pt.save_search=xn.target.value,hn(Object(d.a)({},pt))},onSearch:di}),i.a.createElement("div",{onClick:qi,className:gt.a.btn},i.a.createElement("img",{src:Nn.a}),"\u5199\u9898\u89E3")),i.a.createElement("div",{className:gt.a.listWarp},i.a.createElement(I.a,{spinning:Kn,className:"mt20"},Tn==null?void 0:Tn.map(function(fi,xn){var zn=!0;return xn+1===Tn.length&&xn!==0&&(zn=!1),i.a.createElement(Mt,{active:kn,key:fi.id,data:fi,showLine:zn,onClick:Hi,onAssist:Ur,onHide:ca})}),(Tn==null?void 0:Tn.length)===0&&i.a.createElement(ve.a,{customText:"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"}))),i.a.createElement(Ue.a,{className:gt.a.pagination,showTotal:function(xn){return i.a.createElement("span",{style:{color:"#656F87"}},"\u5171",i.a.createElement("span",{className:"c-light-primary"},xn),"\u6761\u6570\u636E")},total:pt.total,showSizeChanger:!1,current:pt==null?void 0:pt.page,onChange:ta,hideOnSinglePage:!0,showQuickJumper:!0}),Vt>0&&i.a.createElement("div",{className:gt.a.fixedRight,style:{width:Ln}},Vt===1&&i.a.createElement(Ie,{identifier:Gt,onClose:li,onOk:Rr}),Vt===2&&i.a.createElement(Ie,{active:kn,identifier:Gt,onClose:li,onOk:Nr}),Vt===3&&i.a.createElement(wn,{btnShowStatus:ti,onArticlesSkip:Da,detailsIndex:Un,active:kn,identifier:Gt,onClose:li,onOk:Kr,onEdit:Or,onAssist:Ur,onDelete:_r})))},Ni=wr,Xi=D("VEzc"),lr=D.n(Xi),gr=function(vt){var Gt,fn=vt.visible,tn=vt.onVisible,Yt=vt.value,rt=vt.onChange,Et=vt.setIndex,dn={page:1,per_page:30,total:0,tag_discipline_id:[],search:"",save_search:"",difficulty:null},pt=Object(a.useState)(dn),hn=Object(m.a)(pt,2),Bt=hn[0],vn=hn[1],Kn=Object(a.useState)([]),Mn=Object(m.a)(Kn,2),Sn=Mn[0],ni=Mn[1],Ln=Object(a.useState)([]),Zn=Object(m.a)(Ln,2),qn=Zn[0],bi=Zn[1],Un=Object(a.useState)(!1),mi=Object(m.a)(Un,2),gi=mi[0],ai=mi[1],kn=Object(a.useRef)([]),ei=Object(a.useRef)(null),Gn=Object(x.i)();Object(a.useEffect)(function(){return Gn!=null&&Gn.id&&(ei.current=setInterval(function(){Xt(30)},3e4)),function(){clearInterval(ei.current)}},[]);var Xt=function(){var Vt=Object(p.a)(r.a.mark(function Jt(sn){var ln;return r.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:return qt.next=2,Object(w.r)(Gn==null?void 0:Gn.id,{practice_time:sn});case 2:ln=qt.sent;case 3:case"end":return qt.stop()}},Jt)}));return function(sn){return Vt.apply(this,arguments)}}();Object(a.useEffect)(function(){Dn(Bt),ui()},[]),Object(a.useEffect)(function(){return window.addEventListener("click",oi),function(){window.removeEventListener("click",oi)}},[Gn==null?void 0:Gn.save_identifier,fn]),Object(a.useEffect)(function(){var Vt=kn.current.findIndex(function(qt){return qt.identifier===(Gn==null?void 0:Gn.save_identifier)}),Jt=kn.current[Vt-1],sn=kn.current[Vt+1],ln=document.getElementById("oj-prev"),Ht=document.getElementById("oj-next");Jt?ln.style.display="block":ln.style.display="none",sn?Ht.style.display="block":Ht.style.display="none"},[Gn==null?void 0:Gn.save_identifier,kn.current]);var Tn=function(Jt,sn){if(Jt.id===sn)return Jt;for(var ln=0,Ht=Jt;Ht=Ht.parentNode;ln++){if(Ht.id===sn)return Ht;if(Ht==document.documentElement)return!1}},oi=function(){var Vt=Object(p.a)(r.a.mark(function Jt(sn){var ln,Ht,qt;return r.a.wrap(function(di){for(;;)switch(di.prev=di.next){case 0:if(!Tn(sn.target,"oj-drawer")&&fn&&tn(!1),ln=kn.current.findIndex(function(Li){return Li.identifier===(Gn==null?void 0:Gn.save_identifier)}),Ht=kn.current[ln-1],qt=kn.current[ln+1],!(sn.target.id==="oj-prev")){di.next=14;break}if(!(!Ht||ln===-1)){di.next=8;break}return N.b.warn("\u4E0A\u4E00\u9898\u4E0D\u5B58\u5728"),di.abrupt("return");case 8:return sn.target.style.pointerEvents="none",sn.target.style.cursor="not-allowed",di.next=12,_n(Ht==null?void 0:Ht.identifier);case 12:Et("0"),setTimeout(function(){sn.target.style.pointerEvents="auto",sn.target.style.cursor="pointer"},400);case 14:if(!(sn.target.id==="oj-next"||sn.target.id==="oj-modal-next")){di.next=24;break}if(!(!qt||ln===-1)){di.next=18;break}return N.b.warn("\u4E0B\u4E00\u9898\u4E0D\u5B58\u5728"),di.abrupt("return");case 18:return sn.target.style.pointerEvents="none",sn.target.style.cursor="not-allowed",di.next=22,_n(qt==null?void 0:qt.identifier);case 22:Et("0"),setTimeout(function(){sn.target.style.pointerEvents="auto",sn.target.style.cursor="pointer"},400);case 24:case"end":return di.stop()}},Jt)}));return function(sn){return Vt.apply(this,arguments)}}();Object(a.useEffect)(function(){rt(Gn==null?void 0:Gn.save_identifier);var Vt=qn.findIndex(function(Jt){return Jt.some(function(sn){return sn.identifier===(Gn==null?void 0:Gn.save_identifier)})});Vt===-1?vn(Object(d.a)(Object(d.a)({},Bt),{},{page:1})):vn(Object(d.a)(Object(d.a)({},Bt),{},{page:Vt+1}))},[Gn==null?void 0:Gn.save_identifier,qn]);var vi=function(Jt){Bt.page=1,Bt.tag_discipline_id=Jt,vn(Object(d.a)({},Bt)),Dn(Bt)},ui=function(){var Vt=Object(p.a)(r.a.mark(function Jt(){var sn;return r.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:return Ht.next=2,Object(Ee.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice",position:"index"}});case 2:sn=Ht.sent,ni(sn.tag_disciplines||[]);case 4:case"end":return Ht.stop()}},Jt)}));return function(){return Vt.apply(this,arguments)}}(),ti=function(Jt){Bt.page=1,Bt.difficulty=typeof Jt=="number"?Jt:null,vn(Object(d.a)({},Bt)),Dn(Bt)},Dn=function(){var Vt=Object(p.a)(r.a.mark(function Jt(sn){var ln,Ht,qt,gn,di,Li;return r.a.wrap(function(Hi){for(;;)switch(Hi.prev=Hi.next){case 0:return ai(!0),Hi.next=3,Object(w.p)(sn);case 3:if(ln=Hi.sent,ln!=null&&ln.practices_list){for(qt=ln==null||((Ht=ln.practices_list)===null||Ht===void 0)?void 0:Ht.length,gn=[],di=0;di<qt;di+=Bt==null?void 0:Bt.per_page)gn.push(ln==null||((Li=ln.practices_list)===null||Li===void 0)?void 0:Li.slice(di,di+(Bt==null?void 0:Bt.per_page)));vn(Object(d.a)(Object(d.a)({},Bt),{},{total:ln==null?void 0:ln.practices_count})),kn.current=(ln==null?void 0:ln.practices_list)||[],bi(gn)}ai(!1);case 6:case"end":return Hi.stop()}},Jt)}));return function(sn){return Vt.apply(this,arguments)}}(),_n=function(){var Vt=Object(p.a)(r.a.mark(function Jt(sn,ln){var Ht;return r.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:return gn.next=2,Object(Ee.a)("/api/practices/".concat(sn,"/start"),{method:"get"});case 2:Ht=gn.sent,(Ht==null?void 0:Ht.status)===0&&T.d.push("/problems/".concat(Ht==null?void 0:Ht.identifier,"/oj/").concat(sn));case 4:case"end":return gn.stop()}},Jt)}));return function(sn,ln){return Vt.apply(this,arguments)}}(),Rn=function(Jt){Bt.page=Jt,vn(Object(d.a)({},Bt))};return i.a.createElement("div",{className:lr.a.wrap,id:"oj-drawer",style:{left:fn?0:-700}},i.a.createElement("div",{className:lr.a.head},i.a.createElement("div",{className:lr.a.title},"\u9898\u76EE\u5217\u8868"),i.a.createElement(te.a.Search,{value:Bt==null?void 0:Bt.save_search,placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0\u641C\u7D22",style:{width:178,marginLeft:"auto",marginRight:10},onChange:function(Jt){Bt.save_search=Jt.target.value,vn(Object(d.a)({},Bt))},onSearch:function(){Bt.page=1,Bt.search=Bt.save_search,vn(Object(d.a)({},Bt)),Dn(Bt)}}),i.a.createElement(X.a,{value:Bt==null?void 0:Bt.tag_discipline_id,style:{width:210},mode:"multiple",placeholder:"\u9009\u62E9\u77E5\u8BC6\u70B9",showSearch:!1,showArrow:!0,getPopupContainer:function(Jt){return Jt.parentNode},maxTagTextLength:2,maxTagCount:2,onChange:vi},Sn.map(function(Vt){return i.a.createElement(X.a.Option,{key:Vt.id,value:Vt.id},Vt.name)})),i.a.createElement(X.a,{style:{width:70,marginLeft:10},allowClear:!0,placeholder:"\u96BE\u5EA6",getPopupContainer:function(Jt){return Jt.parentNode},value:Bt==null?void 0:Bt.difficulty,onChange:ti},i.a.createElement(X.a.Option,{value:1},"\u7B80\u5355"),i.a.createElement(X.a.Option,{value:2},"\u9002\u4E2D"),i.a.createElement(X.a.Option,{value:3},"\u56F0\u96BE"))),i.a.createElement("div",{className:lr.a.content},i.a.createElement(I.a,{spinning:gi},qn==null||((Gt=qn[Bt.page-1])===null||Gt===void 0)?void 0:Gt.map(function(Vt){return i.a.createElement("div",{key:Vt.identifier,className:lr.a.list,onClick:function(sn){return _n(Vt.identifier,sn)}},i.a.createElement("i",{style:{visibility:Yt===Vt.identifier?"visible":"hidden"},className:"iconfont icon-wancheng1 c-green-29b"}),i.a.createElement("span",{style:{fontWeight:Yt===Vt.identifier?"bold":400,color:Yt===Vt.identifier?"#ffffff":"#bac4cd"},title:Vt==null?void 0:Vt.name},Vt.name),(Vt==null?void 0:Vt.difficulty)===1&&i.a.createElement("b",{style:{color:"#2FA34F"}},"\u7B80\u5355"),(Vt==null?void 0:Vt.difficulty)===2&&i.a.createElement("b",{style:{color:"#0152d9"}},"\u9002\u4E2D"),(Vt==null?void 0:Vt.difficulty)===3&&i.a.createElement("b",{style:{color:"#FA6400"}},"\u56F0\u96BE"))}))),i.a.createElement("div",{className:lr.a.footer},i.a.createElement(Ue.a,{showTotal:function(Jt){return i.a.createElement("span",{style:{color:"#656F87"}},"\u5171",i.a.createElement("span",{className:"c-light-primary"},Jt),"\u6761\u6570\u636E")},total:Bt.total,pageSize:Bt==null?void 0:Bt.per_page,current:Bt==null?void 0:Bt.page,showSizeChanger:!1,onChange:Rn,showQuickJumper:!0,hideOnSinglePage:!0})))},Hr=gr,kr=function(qe){var vt,Gt=qe.hack,fn=qe.onTriggerPraise,tn=qe.topicId,Yt=qe.page,rt=qe.onPageChange,Et=qe.user,dn=qe.submitRecords,pt=qe.submitting,hn=qe.submitResult,Bt=Object(x.h)(),vn=Object(a.useState)((Bt==null||((vt=Bt.query)===null||vt===void 0)?void 0:vt.tab)||"0"),Kn=Object(m.a)(vn,2),Mn=Kn[0],Sn=Kn[1],ni=Object(a.useState)(0),Ln=Object(m.a)(ni,2),Zn=Ln[0],qn=Ln[1],bi=Object(a.useState)(0),Un=Object(m.a)(bi,2),mi=Un[0],gi=Un[1],ai=Object(a.useState)(0),kn=Object(m.a)(ai,2),ei=kn[0],Gn=kn[1],Xt=Object(a.useState)(),Tn=Object(m.a)(Xt,2),oi=Tn[0],vi=Tn[1],ui=Object(a.useState)(!1),ti=Object(m.a)(ui,2),Dn=ti[0],_n=ti[1];function Rn(Jt){var sn=Jt.target.id;if(Mn==="3"&&sn!==Mn&&(mi===1||mi===2)){P.a.confirm({centered:!0,width:500,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u6CE8\u610F",icon:null,className:"custom-modal-divider",content:"\u60A8\u6B63\u5728\u7F16\u5199\u9898\u89E3\uFF0C\u70B9\u51FB\u5173\u95ED\u540E\uFF0C\u60A8\u7684\u9898\u89E3\u5185\u5BB9\u5C06\u4E0D\u4F1A\u8FDB\u884C\u4FDD\u5B58\u3002",onOk:function(){Sn(sn)}});return}Sn(sn)}Object(a.useEffect)(function(){var Jt=it.a.subscribe("to-commit-info",function(){Sn("1")});return Jt},[]);function Vt(){Sn("2")}return i.a.createElement("div",{className:Ce.a["left-panel"]},i.a.createElement("ul",{className:"".concat(Ce.a["s-navs"]," ").concat(Ce.a["bg-white"]," ").concat(Ce.a.b1)},i.a.createElement("li",{className:"mr40 current"},i.a.createElement("img",{onClick:function(){return _n(!0)},src:Ge.a})),i.a.createElement("li",{className:Ce.a["oj-mr"]},i.a.createElement("a",{className:Mn==="0"?Ce.a.active:"",id:"0",onClick:Rn},"\u4EFB\u52A1\u63CF\u8FF0")),i.a.createElement("li",{className:Ce.a["oj-mr"]},i.a.createElement("a",{className:Mn==="3"?Ce.a.active:"",id:"3",onClick:Rn},"\u9898\u89E3",ei?"(".concat(ei,")"):"")),i.a.createElement("li",{className:Ce.a["oj-mr"]},i.a.createElement("a",{className:Mn==="2"?Ce.a.active:"",id:"2",onClick:Rn},"\u8BC4\u8BBA",Zn?"(".concat(Zn,")"):"")),i.a.createElement("li",null,i.a.createElement("a",{className:Mn==="1"?Ce.a.active:"",id:"1",onClick:Rn},"\u63D0\u4EA4\u8BB0\u5F55"))),i.a.createElement("div",{className:"".concat(Ce.a["tab-panel-body"]," ").concat(Mn==="0"?"":"hide"),style:{padding:"0 0 0 16px"}},i.a.createElement(ke,{hack:Gt,onTriggerPraise:fn,toDiscuss:Vt})),i.a.createElement("div",{className:"".concat(Ce.a["tab-panel-body"]," ").concat(Mn==="1"?"":"hide")},dn!=null&&dn.records_count?i.a.createElement(Me,{page:Yt,onPageChange:rt,topicId:tn,submitting:pt,submitRecords:dn,submitResult:hn}):i.a.createElement(ve.a,null)),i.a.createElement("div",{className:"".concat(Ce.a["tab-panel-body"]," ").concat(Mn==="2"?"":"hide"),style:{padding:0}},i.a.createElement(Nt,{setDiscussTotal:qn,user:Et,identifier:Gt.identifier,hack:Gt,onTriggerPraise:fn})),i.a.createElement("div",{className:"".concat(Ce.a["tab-panel-body"]," ").concat(Mn==="3"?"":"hide"),style:{padding:0}},i.a.createElement(Ni,{setListStatus:gi,setFilterListTotal:Gn,tabStatus:Mn,identifier:Gt.identifier})),i.a.createElement(Hr,{visible:Dn,setIndex:Sn,onVisible:function(sn){return _n(sn)},value:oi,onChange:function(sn){return vi(sn)}}))},Cr=D("+aKw"),Xr=D("oFv4"),vr=D.n(Xr),Yr=D("S/kP"),$r=D.n(Yr),fr=D("t/PP"),Qr=D.n(fr),mn=D("LvDl"),On=D.n(mn),yn=D("P5Jw"),jn=o.a.Countdown,Qn={Java:"java",C:"c",Python:"py","C++":"c"},un;(function(qe){qe[qe.SET_LOADING=0]="SET_LOADING",qe[qe.GET_DATA=1]="GET_DATA",qe[qe.GET_SUBMIT_RECORDS=2]="GET_SUBMIT_RECORDS",qe[qe.SET_DATA=3]="SET_DATA",qe[qe.SET_DEBUGING=4]="SET_DEBUGING",qe[qe.SET_SUBMITING=5]="SET_SUBMITING",qe[qe.SET_EXECUTE_MESSAGE=6]="SET_EXECUTE_MESSAGE",qe[qe.SET_EXECUTE_RESULT=7]="SET_EXECUTE_RESULT",qe[qe.SET_SUBMIT_RESULT=8]="SET_SUBMIT_RESULT",qe[qe.SET_SHOW_NOTE=9]="SET_SHOW_NOTE",qe[qe.SET_PAGE=10]="SET_PAGE",qe[qe.GET_LANGUAGE=11]="GET_LANGUAGE",qe[qe.GET_DRAWER=12]="GET_DRAWER"})(un||(un={}));function Bn(){return new Date().getTime()}var Ai={loading:!0,data:void 0,showNote:!1,debugResult:void 0,submitResult:void 0,debuging:!1,submitting:!1,submitRecords:void 0,submitRecordPage:1,executingMessage:"",languageValue:"",languageList:[],drawerData:[]};function Yi(qe,vt){switch(vt.type){case un.GET_DATA:return Object(d.a)(Object(d.a)({},qe),vt.payload);case un.SET_DATA:return Object(d.a)(Object(d.a)({},qe),{},{data:vt.payload});case un.SET_LOADING:return Object(d.a)(Object(d.a)({},qe),{},{loading:vt.payload});case un.GET_LANGUAGE:return Object(d.a)(Object(d.a)({},qe),{},{languageList:vt.payload});case un.GET_DRAWER:return Object(d.a)(Object(d.a)({},qe),{},{drawerData:vt.payload});case un.SET_SHOW_NOTE:return Object(d.a)(Object(d.a)({},qe),{},{showNote:vt.payload});case un.SET_DEBUGING:return Object(d.a)(Object(d.a)({},qe),{},{debuging:vt.payload});case un.SET_SUBMITING:return Object(d.a)(Object(d.a)({},qe),{},{submitting:vt.payload});case un.GET_SUBMIT_RECORDS:return Object(d.a)(Object(d.a)({},qe),{},{submitRecords:vt.payload});case un.SET_PAGE:return Object(d.a)(Object(d.a)({},qe),{},{submitRecordPage:vt.payload});case un.SET_EXECUTE_MESSAGE:return Object(d.a)(Object(d.a)({},qe),{},{executingMessage:vt.payload});case un.SET_EXECUTE_RESULT:return Object(d.a)(Object(d.a)({},qe),vt.payload);case un.SET_SUBMIT_RESULT:return Object(d.a)(Object(d.a)({},qe),vt.payload);default:throw new Error}}var Xn=le.default=function(qe){var vt,Gt,fn=qe.children,tn=Object(a.useReducer)(Yi,Ai),Yt=Object(m.a)(tn,2),rt=Yt[0],Et=Yt[1],dn=Object(x.i)(),pt=dn.id,hn=Object(x.g)(),Bt=Object(x.h)(),vn=rt.languageValue,Kn=rt.languageList,Mn=rt.loading,Sn=rt.data,ni=rt.debugResult,Ln=rt.submitResult,Zn=rt.submitRecords,qn=rt.submitRecordPage,bi=rt.showNote,Un=rt.debuging,mi=rt.submitting,gi=rt.executingMessage,ai=Object(a.useState)("#FFF"),kn=Object(m.a)(ai,2),ei=kn[0],Gn=kn[1],Xt=Object(a.useState)(null),Tn=Object(m.a)(Xt,2),oi=Tn[0],vi=Tn[1],ui=Object(a.useState)({}),ti=Object(m.a)(ui,2),Dn=ti[0],_n=ti[1],Rn=Object(a.useState)(!1),Vt=Object(m.a)(Rn,2),Jt=Vt[0],sn=Vt[1],ln=Object(a.useRef)(null),Ht=Object(a.useRef)(null),qt=Sn==null?void 0:Sn.user,gn=Sn==null?void 0:Sn.hack;Object(a.useEffect)(function(){return Object(T.c)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!1}),Object(T.c)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),function(){Object(T.c)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!0}),Object(T.c)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!1})}},[]),Object(a.useEffect)(function(){setTimeout(function(){document.title="\u5728\u7EBF\u5237\u9898"},400)}),Object(a.useEffect)(function(){if(Jt){var Pn,Cn=document.getElementById("oj-next"),$n=document.getElementById("oj-modal-next");(Cn==null||((Pn=Cn.style)===null||Pn===void 0)?void 0:Pn.display)==="none"?$n.style.display="none":$n.style.display="block"}},[Jt]),Object(a.useEffect)(function(){function Pn(){return Cn.apply(this,arguments)}function Cn(){return Cn=Object(p.a)(r.a.mark(function $n(){var en,In,Ei,Ki,Mi;return r.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return bn.next=2,Object(w.m)(pt);case 2:en=bn.sent,en.status===401?document.location.href="/user/login":(en.hack=en.practice,en.hack.code=C.Base64.decode(en==null||((In=en.hack)===null||In===void 0)?void 0:In.code),Mi="".concat(qt==null?void 0:qt.login,"-language"),localStorage.getItem(Mi)&&(en.hack.language=localStorage.getItem(Mi)),Ht.current=On.a.cloneDeep(en),Ht.current.language=en==null||((Ei=en.hack)===null||Ei===void 0)?void 0:Ei.language,Et({type:un.GET_DATA,payload:{loading:!1,data:en}}),Et({type:un.SET_SUBMIT_RESULT,payload:{languageValue:en==null||((Ki=en.hack)===null||Ki===void 0)?void 0:Ki.language}}));case 4:case"end":return bn.stop()}},$n)})),Cn.apply(this,arguments)}pt&&Pn()},[pt]),Object(a.useEffect)(function(){Et({type:un.SET_SUBMIT_RESULT,payload:{debugResult:void 0}}),Hi(),sn(!1)},[pt]),Object(a.useEffect)(function(){clearTimeout(ln.current)},[pt]),Object(a.useEffect)(function(){Li()},[pt,qn]);var di=function(){window.parent.postMessage("backExercise","*")};function Li(){return qi.apply(this,arguments)}function qi(){return qi=Object(p.a)(r.a.mark(function Pn(){var Cn;return r.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return en.prev=0,en.next=3,Object(w.o)(pt,{limit:15,page:qn});case 3:Cn=en.sent,Et({type:un.GET_SUBMIT_RECORDS,payload:Cn}),en.next=10;break;case 7:en.prev=7,en.t0=en.catch(0),console.log(en.t0);case 10:case"end":return en.stop()}},Pn,null,[[0,7]])})),qi.apply(this,arguments)}function Hi(){return Or.apply(this,arguments)}function Or(){return Or=Object(p.a)(r.a.mark(function Pn(){var Cn;return r.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return en.prev=0,en.next=3,Object(w.w)(pt);case 3:Cn=en.sent,Et({type:un.GET_LANGUAGE,payload:Cn==null?void 0:Cn.data}),en.next=10;break;case 7:en.prev=7,en.t0=en.catch(0),console.log(en.t0);case 10:case"end":return en.stop()}},Pn,null,[[0,7]])})),Or.apply(this,arguments)}function li(Pn){Et({type:un.SET_PAGE,payload:Pn})}function Rr(Pn){return Nr.apply(this,arguments)}function Nr(){return Nr=Object(p.a)(r.a.mark(function Pn(Cn){var $n,en,In,Ei,Ki,Mi;return r.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return Ki=(($n=window)===null||$n===void 0||((en=$n.location)===null||en===void 0||((In=en.pathname)===null||In===void 0||((Ei=In.split("/"))===null||Ei===void 0)))?void 0:Ei[2])||pt,bn.next=3,Object(w.v)(Ki,Cn||{code:C.Base64.encode(gn.code),language:vn});case 3:return Mi=bn.sent,bn.abrupt("return",Mi);case 5:case"end":return bn.stop()}},Pn)})),Nr.apply(this,arguments)}function Kr(){return Ur.apply(this,arguments)}function Ur(){return Ur=Object(p.a)(r.a.mark(function Pn(){var Cn,$n,en,In,Ei,Ki,Mi;return r.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:if(!mi){bn.next=2;break}return bn.abrupt("return");case 2:return Et({type:un.SET_SUBMITING,payload:!0}),bn.prev=3,it.a.publish("to-commit-info"),bn.next=7,Rr();case 7:if(Cn=bn.sent,!(Cn.status===0)){bn.next=21;break}return Mi=function(){return Mi=Object(p.a)(r.a.mark(function ya(){var Wr,Ir,Dr,Zr,Gr,ia;return r.a.wrap(function(Ji){for(;;)switch(Ji.prev=Ji.next){case 0:return Ji.next=2,Object(w.l)(pt,"submit");case 2:if(Wr=Ji.sent,Ir=Wr.status,Dr=Wr.data,Zr=Bn(),Gr=Zr-Ei>(In+3)*1e3,Ir!==0&&!Gr&&setTimeout(Ki,1e3),!Gr){Ji.next=12;break}return P.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),Et({type:un.SET_SUBMITING,payload:!1}),Ji.abrupt("return");case 12:if(!(Ir===0)){Ji.next=19;break}return Dr.status===2&&P.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),Ji.next=16,Object(w.o)(pt,{limit:15,page:qn});case 16:ia=Ji.sent,Et({type:un.SET_SUBMIT_RESULT,payload:Object(d.a)(Object(d.a)({},rt),{},{submitResult:Dr,submitting:!1,submitRecords:ia})}),(Dr==null?void 0:Dr.status)===0&&sn(!0);case 19:case"end":return Ji.stop()}},ya)})),Mi.apply(this,arguments)},Ki=function(){return Mi.apply(this,arguments)},$n={},bn.next=14,Object(w.s)(pt,$n);case 14:if(en=bn.sent,!(en.status===-1)){bn.next=18;break}return window.parent.location.href="/classrooms/".concat(Bt.query.coursesId,"/exercise/").concat(Bt.query.exercisesId,"/detail"),bn.abrupt("return");case 18:In=gn.time_limit,Ei=Bn(),Ki();case 21:bn.next=26;break;case 23:bn.prev=23,bn.t0=bn.catch(3),Et({type:un.SET_SUBMITING,payload:!1});case 26:case"end":return bn.stop()}},Pn,null,[[3,23]])})),Ur.apply(this,arguments)}function ca(){return _r.apply(this,arguments)}function _r(){return _r=Object(p.a)(r.a.mark(function Pn(){var Cn,$n,en,In,Ei,Ki,Mi;return r.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return rt.debuging=!0,Et({type:un.SET_DEBUGING,payload:!0}),bn.prev=2,bn.next=5,Rr();case 5:if(Cn=bn.sent,!(Cn.status===0)){bn.next=21;break}return Mi=function(){return Mi=Object(p.a)(r.a.mark(function ya(){var Wr,Ir,Dr,Zr,Gr,ia;return r.a.wrap(function(Ji){for(;;)switch(Ji.prev=Ji.next){case 0:return Ji.next=2,Object(w.l)(pt,"debug");case 2:if(Wr=Ji.sent,Ir=Wr.status,Dr=Wr.message,Zr=Wr.data,Gr=Bn(),ia=Gr-Ei>($n+3)*1e3,Ir!==0&&!ia&&(Et({type:un.SET_EXECUTE_MESSAGE,payload:Dr}),setTimeout(Ki,1e3)),!ia){Ji.next=13;break}return P.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),Et({type:un.SET_DEBUGING,payload:!1}),Ji.abrupt("return");case 13:Ir===0&&(Et({type:un.SET_DEBUGING,payload:!1}),Zr.status===2&&P.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),Et({type:un.SET_EXECUTE_RESULT,payload:Object(d.a)(Object(d.a)({},rt),{},{debugResult:Zr,debuging:!1})}));case 14:case"end":return Ji.stop()}},ya)})),Mi.apply(this,arguments)},Ki=function(){return Mi.apply(this,arguments)},$n=gn.time_limit,en={input:encodeURIComponent(Sn.test_case.input)},bn.next=13,Object(w.h)(pt,en);case 13:if(In=bn.sent,!(In.status===-1)){bn.next=17;break}return window.parent.location.href="/classrooms/".concat(Bt.query.coursesId,"/exercise/").concat(Bt.query.exercisesId,"/detail"),bn.abrupt("return");case 17:Ei=Bn(),Ki(),bn.next=22;break;case 21:Et({type:un.SET_DEBUGING,payload:!1});case 22:bn.next=27;break;case 24:bn.prev=24,bn.t0=bn.catch(2),console.log(bn.t0);case 27:return bn.prev=27,bn.finish(27);case 29:case"end":return bn.stop()}},Pn,null,[[2,24,27,29]])})),_r.apply(this,arguments)}function ta(Pn){var Cn;clearTimeout(ln.current),ln.current=setTimeout(function(){var $n;Rr({code:C.Base64.encode(Pn),language:Ht==null||(($n=Ht.current)===null||$n===void 0)?void 0:$n.language})},2e3),Et({type:un.SET_DATA,payload:Object(d.a)(Object(d.a)({},Ht==null?void 0:Ht.current),{},{hack:Object(d.a)(Object(d.a)({},Ht==null||((Cn=Ht.current)===null||Cn===void 0)?void 0:Cn.hack),{},{code:Pn})})})}function Da(Pn){var Cn=Pn.target.value;Et({type:un.SET_DATA,payload:Object(d.a)(Object(d.a)({},Sn),{},{test_case:{input:Cn}})})}var fi=function(){var Pn=Object(p.a)(r.a.mark(function Cn($n){var en,In,Ei,Ki,Mi;return r.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return Et({type:un.SET_LOADING,payload:!0}),bn.next=3,Rr();case 3:if(en=bn.sent,!(en.status===0)){bn.next=14;break}return Et({type:un.SET_SUBMIT_RESULT,payload:{languageValue:$n}}),Ht.current.language=$n,In="".concat(qt==null?void 0:qt.login,"-language"),localStorage.setItem(In,$n),bn.next=11,Object(w.w)(pt);case 11:Ei=bn.sent,Ei.status===0&&(Mi=Ei==null||((Ki=Ei.data)===null||Ki===void 0)?void 0:Ki.find(function(na){return na.language===$n}),ta(C.Base64.decode(Mi.code))),setTimeout(function(){Et({type:un.SET_LOADING,payload:!1})},300);case 14:case"end":return bn.stop()}},Cn)}));return function($n){return Pn.apply(this,arguments)}}();function xn(){return zn.apply(this,arguments)}function zn(){return zn=Object(p.a)(r.a.mark(function Pn(){var Cn;return r.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return en.prev=0,en.next=3,Object(w.q)(pt,{language:vn});case 3:Cn=en.sent,Cn.status===401?hn.replace("/login",{from:Bt.pathname}):(ta(C.Base64.decode(Cn.code)),Hi()),en.next=10;break;case 7:en.prev=7,en.t0=en.catch(0),console.log(en.t0);case 10:case"end":return en.stop()}},Pn,null,[[0,7]])})),zn.apply(this,arguments)}function Yn(){P.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:i.a.createElement("p",null,"\u521D\u59CB\u4EE3\u7801\u6709\u4FEE\u6539\uFF0C\u66F4\u65B0\u540E\u5C06\u8986\u76D6\u73B0\u6709\u4EE3\u7801\u54E6~ ",i.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(p.a)(r.a.mark(function Cn(){var $n;return r.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:return In.next=2,Object(w.t)(pt,{language:vn});case 2:$n=In.sent,$n.status===401?hn.replace("/login",{from:Bt.pathname}):ta(C.Base64.decode($n.code));case 4:case"end":return In.stop()}},Cn)}))()}})}function Ui(){Et({type:un.SET_SHOW_NOTE,payload:!0})}function Vn(){Et({type:un.SET_SHOW_NOTE,payload:!1})}function Ar(Pn){return Br.apply(this,arguments)}function Br(){return Br=Object(p.a)(r.a.mark(function Pn(Cn){return r.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return en.next=2,Object(w.b)(pt,Cn);case 2:Et({type:un.GET_DATA,payload:{showNote:!1,data:Object(d.a)(Object(d.a)({},Sn),{},{hack:Object(d.a)(Object(d.a)({},gn),{},{notes:Cn.notes})})}});case 3:case"end":return en.stop()}},Pn)})),Br.apply(this,arguments)}var $i={input:Sn==null||((vt=Sn.test_case)===null||vt===void 0)?void 0:vt.input,language:gn==null?void 0:gn.language,code:gn==null?void 0:gn.code,title:"main."+Qn[gn==null?void 0:gn.language],modify_code:gn==null?void 0:gn.modify_code,notes:gn==null?void 0:gn.notes,debugResult:ni,debuging:Un,submitting:mi,executingMessage:gi,id:pt,languageValue:vn,languageList:Kn,onChangeLanguage:fi,onCancelNote:Vn,onAddNote:Ar,showNote:bi,onShowNote:Ui,onSubmitCode:Kr,onChangeCode:ta,onChangeInput:Da,onDebugCode:ca,onResetCode:xn,onSyncCode:Yn,onUpdateCode:Rr};function Lr(){return Pi.apply(this,arguments)}function Pi(){return Pi=Object(p.a)(r.a.mark(function Pn(){var Cn,$n,en;return r.a.wrap(function(Ei){for(;;)switch(Ei.prev=Ei.next){case 0:return Ei.next=2,Object(w.u)(gn.id,{container_type:"Hack",type:1});case 2:Cn=Ei.sent,$n=Cn.praise_count,en=Object(d.a)(Object(d.a)({},Sn),{},{hack:Object(d.a)(Object(d.a)({},gn),{},{praises_count:$n,user_praise:!gn.user_praise})}),Et({type:un.SET_DATA,payload:en});case 6:case"end":return Ei.stop()}},Pn)})),Pi.apply(this,arguments)}var sr={topicId:pt,submitResult:Ln,submitRecords:Zn,submitting:mi,page:qn,onPageChange:li,hack:gn,user:Sn==null?void 0:Sn.user,onTriggerPraise:Lr};return console.log(Sn,Ht==null?void 0:Ht.current,"data--------"),i.a.createElement(i.a.Fragment,null,i.a.createElement(I.a,{className:"oj-custom-large-spin",size:"large",spinning:Mn},Sn?i.a.createElement("div",{className:"oj-custom-warp"},i.a.createElement("header",{className:_.a.header,style:{minWidth:1200}},i.a.createElement("div",null,i.a.createElement("img",{src:"".concat(b.a.IMG_SERVER,"/images/").concat(qt.image_url),alt:"user",width:30}),i.a.createElement("span",null,qt.name)),i.a.createElement("h2",{className:"flex-wrp flex_box_column flex_box_center"},i.a.createElement("div",null,gn.name),i.a.createElement(Cr.a,{onChange:function(Cn){},className:"font12 c-grey-999"})),i.a.createElement(yn.CopyToClipboard,{text:"".concat((Gt=window.location)===null||Gt===void 0?void 0:Gt.origin,"/problems/").concat(gn.identifier,"/share"),onCopy:function(){return N.b.success("\u590D\u5236\u9898\u76EE\u94FE\u63A5\u6210\u529F")}},i.a.createElement("span",{className:_.a.btn_back,style:{marginRight:10,cursor:"pointer"}}," ",i.a.createElement("i",{className:"iconfont icon-fenxiang1 font14 mr5"}),"\u5206\u4EAB\u9898\u76EE")),gn.edit_privilege?i.a.createElement(A.a,{className:_.a.btn_back,to:"/problems/".concat(gn.identifier,"/ojedit"),style:{marginRight:10}}," ",i.a.createElement(s.a,null)," \u7F16\u8F91"):null,i.a.createElement(A.a,{className:_.a.btn_back,onClick:function(){},to:"/problems"}," ",i.a.createElement(S.a,null),"\u9000\u51FA")),i.a.createElement(v.a,{hideResize:!0,className:"my-problems oj-problems",leftChild:i.a.createElement(kr,sr),rightChild:i.a.createElement(si,$i)})):null),i.a.createElement(P.a,{centered:!0,closable:!1,width:680,footer:null,visible:Jt,className:"oj-modal"},i.a.createElement("section",{className:"oj-modal-content"},i.a.createElement("div",{className:"oj-modal-head"},i.a.createElement("img",{src:vr.a,alt:""}),i.a.createElement("i",{onClick:function(){return sn(!1)},className:"iconfont icon-guanbi1"})),i.a.createElement("aside",null,i.a.createElement("img",{className:"mr30",src:Qr.a}),"\u8FD0\u884C\u65F6\u95F4:\xA0",i.a.createElement("span",{style:{color:"#75d6ba",marginRight:100}},Ln==null?void 0:Ln.execute_time,"s"),"\u4F18\u4E8E",i.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Ln==null?void 0:Ln.time_better_than)||100,"%"),"\u7684\u7528\u6237"),i.a.createElement("aside",{className:"mb50"},i.a.createElement("img",{src:$r.a,className:"mr30"}),i.a.createElement("span",{className:"oj-modal-tt"},i.a.createElement("span",null,i.a.createElement("span",null,"\u5360\u7528\u5185\u5B58:\xA0"),i.a.createElement("span",{className:"c-light-primary"},Ln==null?void 0:Ln.execute_memory,"mb")),i.a.createElement("span",null,i.a.createElement("span",null))),"\u4F18\u4E8E",i.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Ln==null?void 0:Ln.memory_better_than)||100,"%"),"\u7684\u7528\u6237"),i.a.createElement("div",{id:"oj-modal-next",className:"oj-modal-btn"},"\u8FDB\u5165\u4E0B\u4E00\u9898"))))};function yr(qe){var vt=qe.languageValue,Gt=qe.languageList,fn=qe.onChangeLanguage,tn=qe.title,Yt=qe.modify_code,rt=qe.onSyncCode,Et=qe.onShowCodeSetting,dn=qe.onResetCode,pt=Object(x.h)(),hn=function(){P.a.confirm({title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",icon:i.a.createElement(g.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:dn})};return i.a.createElement("div",{className:"action-bar"},i.a.createElement(X.a,{className:"oj-select",value:vt,style:{width:100},placeholder:"\u9009\u62E9\u8BED\u8A00",onChange:fn},Gt==null?void 0:Gt.map(function(Bt){return i.a.createElement(X.a.Option,{key:Bt.language,value:Bt.language},Bt.language)})),i.a.createElement("span",null),i.a.createElement("a",{title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",onClick:hn},i.a.createElement("i",{className:"iconfont icon-zhongzhi font-20 "})),i.a.createElement("a",{onClick:Et},i.a.createElement("i",{className:"iconfont icon-shezhi"})))}function si(qe){var vt=qe.id,Gt=qe.input,fn=qe.showNote,tn=qe.onShowNote,Yt=qe.notes,rt=qe.onCancelNote,Et=qe.onAddNote,dn=qe.debugResult,pt=qe.language,hn=qe.debuging,Bt=qe.submitting,vn=qe.executingMessage,Kn=qe.code,Mn=qe.onSubmitCode,Sn=qe.onDebugCode,ni=qe.onChangeCode,Ln=qe.onChangeInput,Zn=qe.onUpdateCode,qn=Object(z.a)(qe,["id","input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode"]);function bi(mi){return i.a.createElement(yr,Object(Q.a)({},qn,{onShowCodeSetting:mi}))}var Un={id:vt,input:Gt,debugResult:dn,debuging:hn,submitting:Bt,executingMessage:vn,onDebugCode:Sn,onChangeCode:ni,onSubmitCode:Mn,onChangeInput:Ln};return i.a.createElement("div",{className:"right-panel"},i.a.createElement(f.a,{language:pt,value:Kn,onChange:ni,ActionBarRender:bi}),i.a.createElement("div",{className:"note-form-area ".concat(fn?"active":"")},i.a.createElement(Ae,{onCancel:rt,notes:Yt,callback:Et})),i.a.createElement(j.b,Un))}},WaYH:function(Be,le,D){"use strict";var Q=D("rePB"),z=D("Ff2n"),M=D("VTBJ"),X=D("1OyB"),F=D("vuIU"),I=D("JX7q"),H=D("Ji7U"),N=D("LK+K"),n=D("q1tI"),P=D("TSYQ"),p=D.n(P),m=D("sboe"),d=D("OZM5"),u=function(A){var w=A.prefixCls,v=A.level,b=A.isStart,g=A.isEnd;if(!v)return null;for(var f="".concat(w,"-indent-unit"),C=[],E=0;E<v;E+=1){var _;C.push(n.createElement("span",{key:E,className:p()(f,(_={},Object(Q.a)(_,"".concat(f,"-start"),b[E+1]),Object(Q.a)(_,"".concat(f,"-end"),g[E+1]),Object(Q.a)(_,"".concat(f,"-end-first-level"),!E&&g[0]),_))}))}return n.createElement("span",{"aria-hidden":"true",className:"".concat(w,"-indent")},C)},o=u,h=D("815F"),r="open",a="close",i="---",s=function(T){Object(H.a)(w,T);var A=Object(N.a)(w);function w(){var v;return Object(X.a)(this,w),v=A.apply(this,arguments),v.state={dragNodeHighlight:!1},v.onSelectorClick=function(b){var g=v.props.context.onNodeClick;g(b,Object(h.b)(v.props)),v.isSelectable()?v.onSelect(b):v.onCheck(b)},v.onSelectorDoubleClick=function(b){var g=v.props.context.onNodeDoubleClick;g(b,Object(h.b)(v.props))},v.onSelect=function(b){if(v.isDisabled())return;var g=v.props.context.onNodeSelect;b.preventDefault(),g(b,Object(h.b)(v.props))},v.onCheck=function(b){if(v.isDisabled())return;var g=v.props,f=g.disableCheckbox,C=g.checked,E=v.props.context.onNodeCheck;if(!v.isCheckable()||f)return;b.preventDefault();var _=!C;E(b,Object(h.b)(v.props),_)},v.onMouseEnter=function(b){var g=v.props.context.onNodeMouseEnter;g(b,Object(h.b)(v.props))},v.onMouseLeave=function(b){var g=v.props.context.onNodeMouseLeave;g(b,Object(h.b)(v.props))},v.onContextMenu=function(b){var g=v.props.context.onNodeContextMenu;g(b,Object(h.b)(v.props))},v.onDragStart=function(b){var g=v.props.context.onNodeDragStart;b.stopPropagation(),v.setState({dragNodeHighlight:!0}),g(b,Object(I.a)(v));try{b.dataTransfer.setData("text/plain","")}catch(f){}},v.onDragEnter=function(b){var g=v.props.context.onNodeDragEnter;b.preventDefault(),b.stopPropagation(),g(b,Object(I.a)(v))},v.onDragOver=function(b){var g=v.props.context.onNodeDragOver;b.preventDefault(),b.stopPropagation(),g(b,Object(I.a)(v))},v.onDragLeave=function(b){var g=v.props.context.onNodeDragLeave;b.stopPropagation(),g(b,Object(I.a)(v))},v.onDragEnd=function(b){var g=v.props.context.onNodeDragEnd;b.stopPropagation(),v.setState({dragNodeHighlight:!1}),g(b,Object(I.a)(v))},v.onDrop=function(b){var g=v.props.context.onNodeDrop;b.preventDefault(),b.stopPropagation(),v.setState({dragNodeHighlight:!1}),g(b,Object(I.a)(v))},v.onExpand=function(b){var g=v.props.context.onNodeExpand;g(b,Object(h.b)(v.props))},v.setSelectHandle=function(b){v.selectHandle=b},v.getNodeState=function(){var b=v.props.expanded;return v.isLeaf()?null:b?r:a},v.hasChildren=function(){var b=v.props.eventKey,g=v.props.context.keyEntities,f=g[b]||{},C=f.children;return!!(C||[]).length},v.isLeaf=function(){var b=v.props,g=b.isLeaf,f=b.loaded,C=v.props.context.loadData,E=v.hasChildren();return g===!1?!1:g||!C&&!E||C&&f&&!E},v.isDisabled=function(){var b=v.props.disabled,g=v.props.context.disabled;return!!(g||b)},v.isCheckable=function(){var b=v.props.checkable,g=v.props.context.checkable;return!g||b===!1?!1:g},v.syncLoadData=function(b){var g=b.expanded,f=b.loading,C=b.loaded,E=v.props.context,_=E.loadData,U=E.onNodeLoad;if(f)return;_&&g&&!v.isLeaf()&&(!v.hasChildren()&&!C&&U(Object(h.b)(v.props)))},v.renderSwitcher=function(){var b=v.props,g=b.expanded,f=b.switcherIcon,C=v.props.context,E=C.prefixCls,_=C.switcherIcon,U=f||_;if(v.isLeaf())return n.createElement("span",{className:p()("".concat(E,"-switcher"),"".concat(E,"-switcher-noop"))},typeof U=="function"?U(Object(M.a)(Object(M.a)({},v.props),{},{isLeaf:!0})):U);var j=p()("".concat(E,"-switcher"),"".concat(E,"-switcher_").concat(g?r:a));return n.createElement("span",{onClick:v.onExpand,className:j},typeof U=="function"?U(Object(M.a)(Object(M.a)({},v.props),{},{isLeaf:!1})):U)},v.renderCheckbox=function(){var b=v.props,g=b.checked,f=b.halfChecked,C=b.disableCheckbox,E=v.props.context.prefixCls,_=v.isDisabled(),U=v.isCheckable();if(!U)return null;var j=typeof U!="boolean"?U:null;return n.createElement("span",{className:p()("".concat(E,"-checkbox"),g&&"".concat(E,"-checkbox-checked"),!g&&f&&"".concat(E,"-checkbox-indeterminate"),(_||C)&&"".concat(E,"-checkbox-disabled")),onClick:v.onCheck},j)},v.renderIcon=function(){var b=v.props.loading,g=v.props.context.prefixCls;return n.createElement("span",{className:p()("".concat(g,"-iconEle"),"".concat(g,"-icon__").concat(v.getNodeState()||"docu"),b&&"".concat(g,"-icon_loading"))})},v.renderSelector=function(){var b=v.state.dragNodeHighlight,g=v.props,f=g.title,C=g.selected,E=g.icon,_=g.loading,U=g.data,j=v.props.context,L=j.prefixCls,G=j.showIcon,B=j.icon,O=j.draggable,V=j.loadData,te=j.titleRender,re=v.isDisabled(),ge="".concat(L,"-node-content-wrapper"),Ae;if(G){var Oe=E||B;Ae=Oe?n.createElement("span",{className:p()("".concat(L,"-iconEle"),"".concat(L,"-icon__customize"))},typeof Oe=="function"?Oe(v.props):Oe):v.renderIcon()}else V&&_&&(Ae=v.renderIcon());var Ce;typeof f=="function"?Ce=f(U):te?Ce=te(U):Ce=f;var je=n.createElement("span",{className:"".concat(L,"-title")},Ce);return n.createElement("span",{ref:v.setSelectHandle,title:typeof f=="string"?f:"",className:p()("".concat(ge),"".concat(ge,"-").concat(v.getNodeState()||"normal"),!re&&(C||b)&&"".concat(L,"-node-selected"),!re&&O&&"draggable"),draggable:!re&&O||void 0,"aria-grabbed":!re&&O||void 0,onMouseEnter:v.onMouseEnter,onMouseLeave:v.onMouseLeave,onContextMenu:v.onContextMenu,onClick:v.onSelectorClick,onDoubleClick:v.onSelectorDoubleClick,onDragStart:O?v.onDragStart:void 0},Ae,je)},v}return Object(F.a)(w,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var b=this.props.selectable,g=this.props.context.selectable;return typeof b=="boolean"?b:g}},{key:"render",value:function(){var b,g=this.props,f=g.eventKey,C=g.className,E=g.style,_=g.dragOver,U=g.dragOverGapTop,j=g.dragOverGapBottom,L=g.isLeaf,G=g.isStart,B=g.isEnd,O=g.expanded,V=g.selected,te=g.checked,re=g.halfChecked,ge=g.loading,Ae=g.domRef,Oe=g.active,Ce=g.onMouseMove,je=Object(z.a)(g,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Ue=this.props.context,xe=Ue.prefixCls,be=Ue.filterTreeNode,Ve=Ue.draggable,mt=Ue.keyEntities,yt=this.isDisabled(),_t=Object(d.f)(je),xt=mt[f]||{},nt=xt.level,ct=B[B.length-1];return n.createElement("div",Object.assign({ref:Ae,className:p()(C,"".concat(xe,"-treenode"),(b={},Object(Q.a)(b,"".concat(xe,"-treenode-disabled"),yt),Object(Q.a)(b,"".concat(xe,"-treenode-switcher-").concat(O?"open":"close"),!L),Object(Q.a)(b,"".concat(xe,"-treenode-checkbox-checked"),te),Object(Q.a)(b,"".concat(xe,"-treenode-checkbox-indeterminate"),re),Object(Q.a)(b,"".concat(xe,"-treenode-selected"),V),Object(Q.a)(b,"".concat(xe,"-treenode-loading"),ge),Object(Q.a)(b,"".concat(xe,"-treenode-active"),Oe),Object(Q.a)(b,"".concat(xe,"-treenode-leaf-last"),ct),Object(Q.a)(b,"drag-over",!yt&&_),Object(Q.a)(b,"drag-over-gap-top",!yt&&U),Object(Q.a)(b,"drag-over-gap-bottom",!yt&&j),Object(Q.a)(b,"filter-node",be&&be(Object(h.b)(this.props))),b)),style:E,onDragEnter:Ve?this.onDragEnter:void 0,onDragOver:Ve?this.onDragOver:void 0,onDragLeave:Ve?this.onDragLeave:void 0,onDrop:Ve?this.onDrop:void 0,onDragEnd:Ve?this.onDragEnd:void 0,onMouseMove:Ce},_t),n.createElement(o,{prefixCls:xe,level:nt,isStart:G,isEnd:B}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),w}(n.Component),S=function(A){return n.createElement(m.a.Consumer,null,function(w){return n.createElement(s,Object.assign({},A,{context:w}))})};S.displayName="TreeNode",S.defaultProps={title:i},S.isTreeNode=1;var x=le.a=S},Wtmd:function(Be,le,D){Be.exports=D.p+"static/c.449b07b7.svg"},Wx9E:function(Be,le,D){},XIdC:function(Be,le,D){"use strict";var Q=D("rePB"),z=D("ODXe"),M=D("Ff2n"),X=D("q1tI"),F=D.n(X),I=D("TSYQ"),H=D.n(I),N=D("6cGi"),n=D("4IlW"),P=X.forwardRef(function(p,m){var d,u=p.prefixCls,o=u===void 0?"rc-switch":u,h=p.className,r=p.checked,a=p.defaultChecked,i=p.disabled,s=p.loadingIcon,S=p.checkedChildren,x=p.unCheckedChildren,T=p.onClick,A=p.onChange,w=p.onKeyDown,v=Object(M.a)(p,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),b=Object(N.a)(!1,{value:r,defaultValue:a}),g=Object(z.a)(b,2),f=g[0],C=g[1];function E(L,G){var B=f;return i||(B=L,C(B),A==null||A(B,G)),B}function _(L){L.which===n.a.LEFT?E(!1,L):L.which===n.a.RIGHT&&E(!0,L),w==null||w(L)}function U(L){var G=E(!f,L);T==null||T(G,L)}var j=H()(o,h,(d={},Object(Q.a)(d,"".concat(o,"-checked"),f),Object(Q.a)(d,"".concat(o,"-disabled"),i),d));return X.createElement("button",Object.assign({},v,{type:"button",role:"switch","aria-checked":f,disabled:i,className:j,ref:m,onKeyDown:_,onClick:U}),s,X.createElement("span",{className:"".concat(o,"-inner")},f?S:x))});P.displayName="Switch",le.a=P},Y1PL:function(Be,le,D){"use strict";D.r(le),D.d(le,"ResizableTextArea",function(){return re});var Q=D("wx14"),z=D("1OyB"),M=D("vuIU"),X=D("Ji7U"),F=D("LK+K"),I=D("q1tI"),H=D("VTBJ"),N=D("rePB"),n=D("Zm9Q"),P=D("Kwbf"),p=D("c+Xe"),m=D("m+aA"),d=D("bdgK"),u=new Map;function o(Oe){Oe.forEach(function(Ce){var je,Ue=Ce.target;(je=u.get(Ue))===null||je===void 0||je.forEach(function(xe){return xe(Ue)})})}var h=new d.default(o),r=null,a=null;function i(Oe,Ce){u.has(Oe)||(u.set(Oe,new Set),h.observe(Oe)),u.get(Oe).add(Ce)}function s(Oe,Ce){u.has(Oe)&&(u.get(Oe).delete(Ce),u.get(Oe).size||(h.unobserve(Oe),u.delete(Oe)))}var S=function(Oe){Object(X.a)(je,Oe);var Ce=Object(F.a)(je);function je(){return Object(z.a)(this,je),Ce.apply(this,arguments)}return Object(M.a)(je,[{key:"render",value:function(){return this.props.children}}]),je}(I.Component),x=I.createContext(null);function T(Oe){var Ce=Oe.children,je=Oe.onBatchResize,Ue=I.useRef(0),xe=I.useRef([]),be=I.useContext(x),Ve=I.useCallback(function(mt,yt,_t){Ue.current+=1;var xt=Ue.current;xe.current.push({size:mt,element:yt,data:_t}),Promise.resolve().then(function(){xt===Ue.current&&(je==null||je(xe.current),xe.current=[])}),be==null||be(mt,yt,_t)},[je,be]);return I.createElement(x.Provider,{value:Ve},Ce)}function A(Oe){var Ce=Oe.children,je=Oe.disabled,Ue=I.useRef(null),xe=I.useRef(null),be=I.useContext(x),Ve=I.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),mt=I.isValidElement(Ce)&&Object(p.c)(Ce),yt=mt?Ce.ref:null,_t=I.useMemo(function(){return Object(p.a)(yt,Ue)},[yt,Ue]),xt=I.useRef(Oe);xt.current=Oe;var nt=I.useCallback(function(ct){var wt=xt.current,_e=wt.onResize,Me=wt.data,ve=ct.getBoundingClientRect(),Te=ve.width,We=ve.height,Je=ct.offsetWidth,at=ct.offsetHeight,dt=Math.floor(Te),Lt=Math.floor(We);if(Ve.current.width!==dt||Ve.current.height!==Lt||Ve.current.offsetWidth!==Je||Ve.current.offsetHeight!==at){var It={width:dt,height:Lt,offsetWidth:Je,offsetHeight:at};Ve.current=It;var Ne=Je===Math.round(Te)?Te:Je,ke=at===Math.round(We)?We:at,it=Object(H.a)(Object(H.a)({},It),{},{offsetWidth:Ne,offsetHeight:ke});be==null||be(it,ct,Me),_e&&Promise.resolve().then(function(){_e(it,ct)})}},[]);return I.useEffect(function(){var ct=Object(m.a)(Ue.current)||Object(m.a)(xe.current);return ct&&!je&&i(ct,nt),function(){return s(ct,nt)}},[Ue.current,je]),I.createElement(S,{ref:xe},mt?I.cloneElement(Ce,{ref:_t}):Ce)}var w="rc-observer-key";function v(Oe){var Ce=Oe.children,je=Object(n.a)(Ce);return je.map(function(Ue,xe){var be=(Ue==null?void 0:Ue.key)||"".concat(w,"-").concat(xe);return I.createElement(A,Object(Q.a)({},Oe,{key:be}),Ue)})}v.Collection=T;var b=v,g=D("bT9E"),f=D("TSYQ"),C=D.n(f),E=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important
|
|
`,_=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],U={},j;function L(Oe){var Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,je=Oe.getAttribute("id")||Oe.getAttribute("data-reactid")||Oe.getAttribute("name");if(Ce&&U[je])return U[je];var Ue=window.getComputedStyle(Oe),xe=Ue.getPropertyValue("box-sizing")||Ue.getPropertyValue("-moz-box-sizing")||Ue.getPropertyValue("-webkit-box-sizing"),be=parseFloat(Ue.getPropertyValue("padding-bottom"))+parseFloat(Ue.getPropertyValue("padding-top")),Ve=parseFloat(Ue.getPropertyValue("border-bottom-width"))+parseFloat(Ue.getPropertyValue("border-top-width")),mt=_.map(function(_t){return"".concat(_t,":").concat(Ue.getPropertyValue(_t))}).join(";"),yt={sizingStyle:mt,paddingSize:be,borderSize:Ve,boxSizing:xe};return Ce&&je&&(U[je]=yt),yt}function G(Oe){var Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,je=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ue=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;j||(j=document.createElement("textarea"),j.setAttribute("tab-index","-1"),j.setAttribute("aria-hidden","true"),document.body.appendChild(j)),Oe.getAttribute("wrap")?j.setAttribute("wrap",Oe.getAttribute("wrap")):j.removeAttribute("wrap");var xe=L(Oe,Ce),be=xe.paddingSize,Ve=xe.borderSize,mt=xe.boxSizing,yt=xe.sizingStyle;j.setAttribute("style","".concat(yt,";").concat(E)),j.value=Oe.value||Oe.placeholder||"";var _t=Number.MIN_SAFE_INTEGER,xt=Number.MAX_SAFE_INTEGER,nt=j.scrollHeight,ct;if(mt==="border-box"?nt+=Ve:mt==="content-box"&&(nt-=be),je!==null||Ue!==null){j.value=" ";var wt=j.scrollHeight-be;je!==null&&(_t=wt*je,mt==="border-box"&&(_t=_t+be+Ve),nt=Math.max(_t,nt)),Ue!==null&&(xt=wt*Ue,mt==="border-box"&&(xt=xt+be+Ve),ct=nt>xt?"":"hidden",nt=Math.min(xt,nt))}return{height:nt,minHeight:_t,maxHeight:xt,overflowY:ct,resize:"none"}}var B=D("Gytx"),O=D.n(B),V;(function(Oe){Oe[Oe.NONE=0]="NONE",Oe[Oe.RESIZING=1]="RESIZING",Oe[Oe.RESIZED=2]="RESIZED"})(V||(V={}));var te=function(Oe){Object(X.a)(je,Oe);var Ce=Object(F.a)(je);function je(Ue){var xe;return Object(z.a)(this,je),xe=Ce.call(this,Ue),xe.nextFrameActionId=void 0,xe.resizeFrameId=void 0,xe.textArea=void 0,xe.saveTextArea=function(be){xe.textArea=be},xe.handleResize=function(be){var Ve=xe.state.resizeStatus,mt=xe.props,yt=mt.autoSize,_t=mt.onResize;if(Ve!==V.NONE)return;typeof _t=="function"&&_t(be),yt&&xe.resizeOnNextFrame()},xe.resizeOnNextFrame=function(){cancelAnimationFrame(xe.nextFrameActionId),xe.nextFrameActionId=requestAnimationFrame(xe.resizeTextarea)},xe.resizeTextarea=function(){var be=xe.props.autoSize;if(!be||!xe.textArea)return;var Ve=be.minRows,mt=be.maxRows,yt=G(xe.textArea,!1,Ve,mt);xe.setState({textareaStyles:yt,resizeStatus:V.RESIZING},function(){cancelAnimationFrame(xe.resizeFrameId),xe.resizeFrameId=requestAnimationFrame(function(){xe.setState({resizeStatus:V.RESIZED},function(){xe.resizeFrameId=requestAnimationFrame(function(){xe.setState({resizeStatus:V.NONE}),xe.fixFirefoxAutoScroll()})})})})},xe.renderTextArea=function(){var be=xe.props,Ve=be.prefixCls,mt=Ve===void 0?"rc-textarea":Ve,yt=be.autoSize,_t=be.onResize,xt=be.className,nt=be.disabled,ct=xe.state,wt=ct.textareaStyles,_e=ct.resizeStatus,Me=Object(g.a)(xe.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),ve=C()(mt,xt,Object(N.a)({},"".concat(mt,"-disabled"),nt));"value"in Me&&(Me.value=Me.value||"");var Te=Object(H.a)(Object(H.a)(Object(H.a)({},xe.props.style),wt),_e===V.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return I.createElement(b,{onResize:xe.handleResize,disabled:!(yt||_t)},I.createElement("textarea",Object(Q.a)({},Me,{className:ve,style:Te,ref:xe.saveTextArea})))},xe.state={textareaStyles:{},resizeStatus:V.NONE},xe}return Object(M.a)(je,[{key:"componentDidUpdate",value:function(xe){(xe.value!==this.props.value||!O()(xe.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 xe=this.textArea.selectionStart,be=this.textArea.selectionEnd;this.textArea.setSelectionRange(xe,be)}}catch(Ve){}}},{key:"render",value:function(){return this.renderTextArea()}}]),je}(I.Component),re=te,ge=function(Oe){Object(X.a)(je,Oe);var Ce=Object(F.a)(je);function je(Ue){var xe;Object(z.a)(this,je),xe=Ce.call(this,Ue),xe.resizableTextArea=void 0,xe.focus=function(){xe.resizableTextArea.textArea.focus()},xe.saveTextArea=function(Ve){xe.resizableTextArea=Ve},xe.handleChange=function(Ve){var mt=xe.props.onChange;xe.setValue(Ve.target.value,function(){xe.resizableTextArea.resizeTextarea()}),mt&&mt(Ve)},xe.handleKeyDown=function(Ve){var mt=xe.props,yt=mt.onPressEnter,_t=mt.onKeyDown;Ve.keyCode===13&&yt&&yt(Ve),_t&&_t(Ve)};var be=typeof Ue.value=="undefined"||Ue.value===null?Ue.defaultValue:Ue.value;return xe.state={value:be},xe}return Object(M.a)(je,[{key:"setValue",value:function(xe,be){"value"in this.props||this.setState({value:xe},be)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return I.createElement(re,Object(Q.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(xe){return"value"in xe?{value:xe.value}:null}}]),je}(I.Component),Ae=le.default=ge},Z8dc:function(Be,le,D){Be.exports={flex_box_center:"flex_box_center___3U5jH",flex_space_between:"flex_space_between___10tgP",flex_box_vertical_center:"flex_box_vertical_center___1e5pu",flex_box_center_end:"flex_box_center_end___WDBuM",flex_box_column:"flex_box_column___3TSEG",listForm:"listForm___264Pu",scroll:"scroll___CK9uS",formWrap:"formWrap___2n6e2",btns:"btns___2wuct",main:"main___1WFqr",mainLoading:"mainLoading___1kJWi",tip:"tip___10JaH",proWarp:"proWarp___TMP84",pro:"pro___1CLLm",mainSucceed:"mainSucceed___3NYgf",del:"del___34rdE"}},ZD9Y:function(Be,le,D){"use strict";var Q=D("BoS7"),z=D("Sdc0"),M=D("OaEy"),X=D("2fM7"),F=D("q1tI"),I=D.n(F),H=D("lOMy"),N=D.n(H),n=X.a.Option;le.a=function(P){var p=P.onFontSizeChange,m=P.cmFontSize,d=P.cmCodeMode,u=P.onCodeModeChange,o=P.onTabToSpace,h=P.className,r=h===void 0?"":h,a=P.tabToSpace,i=P.children;return I.a.createElement("div",{className:"tpi-code-setting ".concat(r)},I.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),I.a.createElement("section",null,I.a.createElement("div",{className:"file-item"},I.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),I.a.createElement(X.a,{bordered:!1,size:"small",value:d,onChange:u},I.a.createElement(n,{value:"vs"},"\u767D\u8272\u80CC\u666F"),I.a.createElement(n,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),I.a.createElement("div",{className:"file-item"},I.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),I.a.createElement(X.a,{bordered:!1,size:"small",value:m,onChange:p},I.a.createElement(n,{value:12},"12px"),I.a.createElement(n,{value:14},"14px"),I.a.createElement(n,{value:16},"16px"),I.a.createElement(n,{value:18},"18px"),I.a.createElement(n,{value:20},"20px"),I.a.createElement(n,{value:22},"22px"))),I.a.createElement("div",{className:"file-item"},I.a.createElement("b",null,"Tab\u8F6C\u6362"),I.a.createElement(z.a,{checked:a,onChange:o}))),I.a.createElement("h3",null,"\u5FEB\u6377\u952E"),I.a.createElement("section",null,I.a.createElement("div",{className:"file-item"},I.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),I.a.createElement("span",null,"Ctrl + S")),I.a.createElement("div",{className:"file-item"},I.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),I.a.createElement("span",null,"F1 / Alt + F1")),I.a.createElement("div",{className:"file-item"},I.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),I.a.createElement("span",null,"Ctrl + ]/[")),I.a.createElement("div",{className:"file-item"},I.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),I.a.createElement("span",null,"Ctrl + Shift + \\")),I.a.createElement("div",{className:"file-item"},I.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),I.a.createElement("span",null,"Home")),I.a.createElement("div",{className:"file-item"},I.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),I.a.createElement("span",null,"End"))),i)}},ZW9T:function(Be,le,D){"use strict";D.d(le,"a",function(){return B});var Q=D("k1fw"),z=D("oBTY"),M=D("miYZ"),X=D("tsqr"),F=D("rAM+"),I=D("tJVT"),H=D("PpiC"),N=D("q1tI"),n=D.n(N),P=D("bdgK"),p=D("9og8"),m=D("WmNS"),d=D.n(m),u={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"]},o={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"]},h={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(`
|
|
`)}]},r={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(`
|
|
`)}]},a=D("5VLF"),i=D.n(a),s={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"]}},S=function(V,te){return te.map(function(re){return{label:re,kind:V.languages.CompletionItemKind.Keyword,insertText:re}})},x=function(V){return Object.keys(s.tables).map(function(te){return{label:te,kind:V.languages.CompletionItemKind.Variable,insertText:te}})},T=function(V,te){var re=s.tables[V];return re?re.map(function(ge){return{label:ge,kind:te.languages.CompletionItemKind.Field,insertText:ge}}):[]};function A(O,V,te,re,ge){var Ae=V.getWordUntilPosition(te),Oe={startLineNumber:te.lineNumber,endLineNumber:te.lineNumber,startColumn:Ae.startColumn,endColumn:Ae.endColumn},Ce=re.map(function(je){return{label:je,kind:O.languages.CompletionItemKind.Keyword,insertText:je,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Oe}});return ge.map(function(je){Ce.push(Object(Q.a)(Object(Q.a)({},je),{},{range:Oe}))}),Ce}var w=function(O){s.languages.map(function(ge){return O.languages.registerDocumentFormattingEditProvider(ge,{provideDocumentFormattingEdits:function(Oe,Ce,je){return Object(p.a)(d.a.mark(function Ue(){var xe;return d.a.wrap(function(Ve){for(;;)switch(Ve.prev=Ve.next){case 0:return xe=i()(Oe.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}),Ve.abrupt("return",[{range:Oe.getFullModelRange(),text:xe}]);case 2:case"end":return Ve.stop()}},Ue)}))()}}),ge});var V=h.quickKey.map(function(ge){return{label:ge.label,kind:O.languages.CompletionItemKind.Method,insertText:ge.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),te=r.quickKey.map(function(ge){return{label:ge.label,kind:O.languages.CompletionItemKind.Method,insertText:ge.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),re=o.quickKey.map(function(ge){return{label:ge.label,kind:O.languages.CompletionItemKind.Method,insertText:ge.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet}});O.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Ae,Oe){var Ce=Ae.getWordUntilPosition(Oe),je={startLineNumber:Oe.lineNumber,endLineNumber:Oe.lineNumber,startColumn:Ce.startColumn,endColumn:Ce.endColumn},Ue=Ae.getLineContent(Oe.lineNumber).substring(Ce.startColumn-2,Ce.endColumn);return{suggestions:[].concat(Object(z.a)(h.keywords.map(function(xe){return{label:xe,kind:O.languages.CompletionItemKind.Function,documentation:xe,insertText:xe,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:je}})),Object(z.a)(h.quickKey.map(function(xe){return{label:xe.label,kind:O.languages.CompletionItemKind.Function,documentation:xe.content,insertText:Ue.startsWith("#")?xe.content.replace(/#/,""):xe.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:je}})))}}}),O.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Ae,Oe){var Ce=Ae.getWordUntilPosition(Oe),je={startLineNumber:Oe.lineNumber,endLineNumber:Oe.lineNumber,startColumn:Ce.startColumn,endColumn:Ce.endColumn};return{suggestions:Object(z.a)(u.keywords.map(function(Ue){return{label:Ue,kind:O.languages.CompletionItemKind.Function,documentation:Ue,insertText:Ue,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:je}}))}}}),O.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Ae,Oe){var Ce=Ae.getWordUntilPosition(Oe),je={startLineNumber:Oe.lineNumber,endLineNumber:Oe.lineNumber,startColumn:Ce.startColumn,endColumn:Ce.endColumn},Ue=Ae.getLineContent(Oe.lineNumber).substring(Ce.startColumn-2,Ce.endColumn);return{suggestions:[].concat(Object(z.a)(o.keywords.map(function(xe){return{label:xe,kind:O.languages.CompletionItemKind.Function,documentation:xe,insertText:xe,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:je}})),Object(z.a)(o.quickKey.map(function(xe){return{label:xe.label,kind:O.languages.CompletionItemKind.Function,documentation:xe.content,insertText:Ue.startsWith("#")?xe.content.replace(/#/,""):xe.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:je}})))}}}),O.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Ae,Oe){var Ce=Ae.getWordUntilPosition(Oe),je={startLineNumber:Oe.lineNumber,endLineNumber:Oe.lineNumber,startColumn:Ce.startColumn,endColumn:Ce.endColumn},Ue=Ae.getLineContent(Oe.lineNumber).substring(Ce.startColumn-2,Ce.endColumn);return{suggestions:[].concat(Object(z.a)(r.keywords.map(function(xe){return{label:xe,kind:O.languages.CompletionItemKind.Function,documentation:xe,insertText:xe,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:je}})),Object(z.a)(r.quickKey.map(function(xe){return{label:xe.label,kind:O.languages.CompletionItemKind.Function,documentation:xe.content,insertText:Ue.startsWith("#")?xe.content.replace(/#/,""):xe.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:je}})))}}})},v="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",b=D("fjLI"),g=D("LvDl"),f=D("+ua5");function C(O){return/^\d+$/.test(O)?"".concat(O,"px"):O}function E(){}var _=!1,U={"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 j(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],V=O;if(Array.isArray(O)){for(var te=0;te<O.length;te++){var re=U[O[te]];if(re)return re}return V[0]}return U[V]||V}var L=null,G=le.b=function(O){var V=O.width,te=V===void 0?"100%":V,re=O.height,ge=re===void 0?"100%":re,Ae=O.value,Oe=O.language,Ce=Oe===void 0?"javascript":Oe,je=O.style,Ue=je===void 0?{}:je,xe=O.options,be=xe===void 0?{}:xe,Ve=O.overrideServices,mt=Ve===void 0?{}:Ve,yt=O.theme,_t=yt===void 0?"vs-dark":yt,xt=O.onEditBlur,nt=O.onSave,ct=O.autoHeight,wt=ct===void 0?!1:ct,_e=O.forbidCopy,Me=_e===void 0?!1:_e,ve=O.onChange,Te=ve===void 0?E:ve,We=O.editorDidMount,Je=We===void 0?E:We,at=O.onFocus,dt=at===void 0?E:at,Lt=O.filename,It=Lt===void 0?"educoder.txt":Lt,Ne=O.errorLine,ke=O.errorContent,it=ke===void 0?"":ke,ot=Object(H.a)(O,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),Ge=Object(N.useRef)(),$e=Object(N.useRef)({}),we=Object(N.useRef)(),Se=Object(N.useRef)(),Ee=Object(N.useRef)(!1),ue=Object(N.useRef)(),de=Object(N.useState)(!1),ye=Object(I.a)(de,2),me=ye[0],Le=ye[1];function Xe(){var bt;return Ge.current&&(bt=new P.default(function(Tt){var Wt=Object(F.a)(Tt),fe;try{for(Wt.s();!(fe=Wt.n()).done;){var se=fe.value;(se.target.offsetHeight>0||se.target.offsetWidth>0)&&$e.current.instance.layout()}}catch(W){Wt.e(W)}finally{Wt.f()}}),bt.observe(Ge.current)),bt}function ut(){X.b.warn(decodeURIComponent(v))}var Dt=function(){var Tt=$e.current.instance;if(Ae!=null&&Tt&&me){var Wt=Tt.getModel();Wt&&Ae!==Wt.getValue()&&(_=!0,Wt.setValue(Ae),Tt.layout(),_=!1)}};Object(N.useEffect)(function(){Se.current&&clearTimeout(Se.current),Se.current=setTimeout(function(){Dt()},500)},[Ae,me,$e.current]),Object(N.useEffect)(function(){if(Ne&&$e.current&&$e.current.instance){var bt=$e.current.instance;bt.changeViewZones(function(Wt){var fe=document.createElement("div");fe.style.padding="10px 20px",fe.style.width="calc(100% - 20px)",fe.className="my-error-line-wrp",fe.innerHTML=it,Wt.addZone({afterLineNumber:Ne||11,heightInLines:3,domNode:fe})});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}};bt.addOverlayWidget(Tt),bt.revealPositionInCenter({lineNumber:20,column:1})}},[Ne,$e.current,me]);function jt(){var bt=$e.current.instance;if(bt){var Tt=bt.getSelection(),Wt=$e.current.pastePos||{},fe=new L.Range(Wt.startLineNumber||Tt.endLineNumber,Wt.startColumn||Tt.endColumn,Wt.endLineNumber||Tt.endLineNumber,Wt.endColumn||Tt.endColumn);setTimeout(function(){bt.executeEdits("",[{range:fe,text:""}])},300)}}function Ut(bt){(window.navigator.platform.match("Mac")?bt.metaKey:bt.ctrlKey)&&bt.keyCode==83&&(bt.preventDefault(),nt())}var Ct=function(){if(wt&&$e.current.instance){var Tt=$e.current.instance.getContentHeight();Ke(Tt<ge?ge:Tt)}else Ke(ge)};function et(bt){var Tt=document.createEvent("MouseEvents");Tt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),bt.dispatchEvent(Tt)}function st(bt,Tt){var Wt=window.URL||window.webkitURL||window,fe=new Blob([Tt]),se=document.createElementNS("http://www.w3.org/1999/xhtml","a");se.href=Wt.createObjectURL(fe),se.download=bt,et(se)}Object(N.useEffect)(function(){Ct()},[Ct]),Object(N.useEffect)(function(){Ge.current&&!me&&Promise.all([D.e(16),D.e(28)]).then(D.t.bind(null,"M/lh",7)).then(function(bt){try{L=bt,$e.current.instance=L.editor.create(Ge.current,{value:Ae,language:j(Ce),theme:_t,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},mt);var Tt=$e.current.instance,Wt=b.d._menuItems,fe=Object(z.a)(Wt).find(function(ne){return ne[0]._debugName=="EditorContext"}),se=fe[1],W=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],$=function(he,Pe){var ze=he._first;do{var Rt,Mt,Ze=Pe.includes((Rt=ze.element)===null||Rt===void 0||((Mt=Rt.command)===null||Mt===void 0)?void 0:Mt.id);Ze&&he._remove(ze)}while(ze=ze.next)};if(Je(Tt,L),setTimeout(function(){Ct(),$e.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){st(It||"educoder.txt",Tt.getValue())}}),Tt.getDomNode().addEventListener("input",function(){we.current.autoFormat&&Tt.getAction("editor.action.formatDocument").run()})},500),$e.current.subscription=Tt.onDidChangeModelContent(function(ne){Ee.current?clearTimeout(ue.current):(Ct(),Te(Tt.getValue(),ne)),ue.current=setTimeout(function(){Ee.current=!1},500)}),window.Monaco||w(L,j(Ce)),Me&&($(se,W),Ge.current.classList.add("noCopyPaste"),Tt.onKeyDown(function(ne){var he=ne.keyCode,Pe=ne.ctrlKey,ze=ne.metaKey;(he===33||he===52)&&(ze||Pe)&&(ut(),ne.preventDefault())})),window.Monaco=L,xt&&Tt.onDidBlurEditorWidget(function(){xt(Tt.getValue())}),dt&&Tt.onDidFocusEditorText(function(){dt(Tt.getValue())}),Me){Tt.addCommand(L.KeyMod.CtrlCmd|L.KeyCode.KEY_V,function(){return ut(),null}),Tt.onDidPaste(function(ne){$e.current.pastePos=ne});try{window.addEventListener("paste",jt)}catch(ne){}}var Z=Xe();return Le(!0),function(){var ne=$e.current.instance;ne.dispose();var he=ne.getModel();he&&he.dispose(),$e.current.subscription&&$e.current.subscription.dispose(),Me&&window.removeEventListener("paste",jt),Z.unobserve(Ge.current)}}catch(ne){}})},[]),Object(N.useEffect)(function(){var bt=$e.current.instance;if(bt&&me)return document.addEventListener("keydown",Ut,!1),function(){document.removeEventListener("keydown",Ut)}},[nt,me]),Object(N.useEffect)(function(){var bt=$e.current.instance;if(bt&&me){var Tt=j(Ce);L.editor.setModelLanguage(bt.getModel(),Tt),console.log("language:",Ce,bt.getModel(),Tt)}},[Ce,me]),Object(N.useEffect)(function(){var bt=$e.current.instance;bt&&me&&L.editor.setTheme(_t)},[_t,me]),Object(N.useEffect)(function(){var bt=$e.current.instance;we.current=be,bt&&me&&(bt.updateOptions(Object(Q.a)({},be)),setTimeout(function(){bt.getModel().updateOptions(Object(Q.a)({},be))},200))},[JSON.stringify(be),me]),Object(N.useEffect)(function(){var bt=$e.current.instance;bt&&me&&bt.layout()},[te,ge,me]);var He=Object(N.useState)(C(te)),pe=Object(I.a)(He,2),Re=pe[0],lt=pe[1],Ye=Object(N.useState)(C(ge)),Pt=Object(I.a)(Ye,2),Nt=Pt[0],Ke=Pt[1],gt=Object(Q.a)(Object(Q.a)({},Ue),{},{width:Re,height:Nt});return n.a.createElement("div",{className:"my-monaco-editor",ref:Ge,style:gt})};function B(O){var V=O.width,te=V===void 0?"100%":V,re=O.height,ge=re===void 0?"100%":re,Ae=O.original,Oe=O.modified,Ce=O.language,je=O.options,Ue=je===void 0?{}:je,xe=Object(N.useRef)(),be=Object(N.useState)(null),Ve=Object(I.a)(be,2),mt=Ve[0],yt=Ve[1];function _t(wt){var _e;return xe.current&&(_e=new P.default(function(Me){var ve=Object(F.a)(Me),Te;try{for(ve.s();!(Te=ve.n()).done;){var We=Te.value;(We.target.offsetHeight>0||We.target.offsetWidth>0)&&wt.layout()}}catch(Je){ve.e(Je)}finally{ve.f()}}),_e.observe(xe.current)),_e}Object(N.useEffect)(function(){xe.current&&Promise.all([D.e(16),D.e(28)]).then(D.t.bind(null,"M/lh",7)).then(function(wt){L=wt;var _e=L.editor.createDiffEditor(xe.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},Ue),{},{wordWrap:!0}));yt(_e);var Me=_t(_e);return function(){_e.dispose();var ve=_e.getModel();ve&&ve.dispose(),Me.unobserve(xe.current)}})},[]),Object(N.useEffect)(function(){mt&&mt.setModel({original:L.editor.createModel(Ae,Ce),modified:L.editor.createModel(Oe,Ce)})},[Ae,Oe,Ce,mt]);var xt=C(te),nt=C(ge),ct={width:xt,height:nt};return n.a.createElement("div",{className:"my-diff-editor",ref:xe,style:ct})}},ZpRC:function(Be,le,D){"use strict";function Q(p){return typeof p=="object"&&p!=null&&p.nodeType===1}function z(p,m){return(!m||p!=="hidden")&&p!=="visible"&&p!=="clip"}function M(p,m){if(p.clientHeight<p.scrollHeight||p.clientWidth<p.scrollWidth){var d=getComputedStyle(p,null);return z(d.overflowY,m)||z(d.overflowX,m)||function(u){var o=function(h){if(!h.ownerDocument||!h.ownerDocument.defaultView)return null;try{return h.ownerDocument.defaultView.frameElement}catch(r){return null}}(u);return!!o&&(o.clientHeight<u.scrollHeight||o.clientWidth<u.scrollWidth)}(p)}return!1}function X(p,m,d,u,o,h,r,a){return h<p&&r>m||h>p&&r<m?0:h<=p&&a<=d||r>=m&&a>=d?h-p-u:r>m&&a<d||h<p&&a>d?r-m+o:0}var F=function(p,m){var d=window,u=m.scrollMode,o=m.block,h=m.inline,r=m.boundary,a=m.skipOverflowHiddenElements,i=typeof r=="function"?r:function(wt){return wt!==r};if(!Q(p))throw new TypeError("Invalid target");for(var s=document.scrollingElement||document.documentElement,S=[],x=p;Q(x)&&i(x);){if((x=x.parentElement)===s){S.push(x);break}x!=null&&x===document.body&&M(x)&&!M(document.documentElement)||x!=null&&M(x,a)&&S.push(x)}for(var T=d.visualViewport?d.visualViewport.width:innerWidth,A=d.visualViewport?d.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,b=p.getBoundingClientRect(),g=b.height,f=b.width,C=b.top,E=b.right,_=b.bottom,U=b.left,j=o==="start"||o==="nearest"?C:o==="end"?_:C+g/2,L=h==="center"?U+f/2:h==="end"?E:U,G=[],B=0;B<S.length;B++){var O=S[B],V=O.getBoundingClientRect(),te=V.height,re=V.width,ge=V.top,Ae=V.right,Oe=V.bottom,Ce=V.left;if(u==="if-needed"&&C>=0&&U>=0&&_<=A&&E<=T&&C>=ge&&_<=Oe&&U>=Ce&&E<=Ae)return G;var je=getComputedStyle(O),Ue=parseInt(je.borderLeftWidth,10),xe=parseInt(je.borderTopWidth,10),be=parseInt(je.borderRightWidth,10),Ve=parseInt(je.borderBottomWidth,10),mt=0,yt=0,_t="offsetWidth"in O?O.offsetWidth-O.clientWidth-Ue-be:0,xt="offsetHeight"in O?O.offsetHeight-O.clientHeight-xe-Ve:0;if(s===O)mt=o==="start"?j:o==="end"?j-A:o==="nearest"?X(v,v+A,A,xe,Ve,v+j,v+j+g,g):j-A/2,yt=h==="start"?L:h==="center"?L-T/2:h==="end"?L-T:X(w,w+T,T,Ue,be,w+L,w+L+f,f),mt=Math.max(0,mt+v),yt=Math.max(0,yt+w);else{mt=o==="start"?j-ge-xe:o==="end"?j-Oe+Ve+xt:o==="nearest"?X(ge,Oe,te,xe,Ve+xt,j,j+g,g):j-(ge+te/2)+xt/2,yt=h==="start"?L-Ce-Ue:h==="center"?L-(Ce+re/2)+_t/2:h==="end"?L-Ae+be+_t:X(Ce,Ae,re,Ue,be+_t,L,L+f,f);var nt=O.scrollLeft,ct=O.scrollTop;j+=ct-(mt=Math.max(0,Math.min(ct+mt,O.scrollHeight-te+xt))),L+=nt-(yt=Math.max(0,Math.min(nt+yt,O.scrollWidth-re+_t)))}G.push({el:O,top:mt,left:yt})}return G};function I(p){return p===Object(p)&&Object.keys(p).length!==0}function H(p,m){m===void 0&&(m="auto");var d="scrollBehavior"in document.body.style;p.forEach(function(u){var o=u.el,h=u.top,r=u.left;o.scroll&&d?o.scroll({top:h,left:r,behavior:m}):(o.scrollTop=h,o.scrollLeft=r)})}function N(p){return p===!1?{block:"end",inline:"nearest"}:I(p)?p:{block:"start",inline:"nearest"}}function n(p,m){var d=!p.ownerDocument.documentElement.contains(p);if(I(m)&&typeof m.behavior=="function")return m.behavior(d?[]:F(p,m));if(d)return;var u=N(m);return H(F(p,u),u.behavior)}var P=le.a=n},ZsLC:function(Be,le,D){Be.exports={"left-panel":"left-panel___FTwwW","tab-panel-body":"tab-panel-body___2YSOx",b1:"b1___3qx3o","oj-mr":"oj-mr___1GA9N","oj-width-input":"oj-width-input___3GkyP","s-navs":"s-navs___1fGGf","bg-white":"bg-white___1ZAy0",active:"active___39N6D"}},bCnd:function(Be,le,D){"use strict";D.d(le,"b",function(){return X}),D.d(le,"a",function(){return F});var Q=D("je13"),z=D.n(Q),M=!1;function X(I,H){var N=z.a.get("__ec");N||(N={}),N[I]=H,z.a.set("__ec",N)}function F(I,H){var N=z.a.get("__ec");return N?N[I]===void 0?H:N[I]:H}},bT9E:function(Be,le,D){"use strict";D.d(le,"a",function(){return z});var Q=D("VTBJ");function z(M,X){var F=Object(Q.a)({},M);return Array.isArray(X)&&X.forEach(function(I){delete F[I]}),F}},bdLU:function(Be,le,D){"use strict";D.d(le,"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={}))},biw7:function(Be,le,D){"use strict";var Q=D("q1tI"),z=D.n(Q),M=Q.createContext(null);le.a=M},c5Ni:function(Be,le,D){},cDPC:function(Be,le,D){"use strict";var Q=D("tJVT"),z=D("q1tI"),M=D.n(z),X=D("i3hx"),F=D.n(X);le.a=function(I){var H=I.defaultX,N=H===void 0?"40%":H,n=I.leftChild,P=I.rightChild,p=I.className,m=I.hideResize,d=m===void 0?!1:m,u=Object(z.useState)(N),o=Object(Q.a)(u,2),h=o[0],r=o[1],a=Object(z.useRef)();function i(){a.current=!0}Object(z.useEffect)(function(){function x(A){a.current&&r(A.pageX)}function T(){a.current=!1}return window.addEventListener("mousemove",x),window.addEventListener("mouseup",T),function(){window.removeEventListener("mousemove",x),window.removeEventListener("mouseup",T)}},[]);var s=typeof h=="number"&&h!==.01?"".concat(h,"px"):N,S="calc(100% - ".concat(d?"0px":"4px"," - ").concat(s,")");return M.a.createElement("div",{className:"split-panel-container ".concat(p)},M.a.createElement("section",{style:{width:s,display:h===.01?"none":""}},n),M.a.createElement("section",{className:"resize-x-bar",onMouseDown:i},M.a.createElement("a",{className:"btn-resize"},M.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},M.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"})))),M.a.createElement("section",{style:{width:S}},P))}},dejd:function(Be,le,D){},dmUQ:function(Be,le,D){"use strict";var Q=D("Ff2n"),z=D("rePB"),M=D("1OyB"),X=D("vuIU"),F=D("Ji7U"),I=D("md7G"),H=D("foSv"),N=D("q1tI"),n=D.n(N),P=D("TSYQ"),p=D.n(P),m=D("4IlW");function d(g,f){var C=Object.keys(g);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(g);f&&(E=E.filter(function(_){return Object.getOwnPropertyDescriptor(g,_).enumerable})),C.push.apply(C,E)}return C}function u(g){for(var f=1;f<arguments.length;f++){var C=arguments[f]!=null?arguments[f]:{};f%2?d(Object(C),!0).forEach(function(E){Object(z.a)(g,E,C[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(C)):d(Object(C)).forEach(function(E){Object.defineProperty(g,E,Object.getOwnPropertyDescriptor(C,E))})}return g}function o(g){var f=h();return function(){var E=Object(H.a)(g),_;if(f){var U=Object(H.a)(this).constructor;_=Reflect.construct(E,arguments,U)}else _=E.apply(this,arguments);return Object(I.a)(this,_)}}function h(){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(g){return!1}}function r(){}function a(g){g.preventDefault()}var i=function(f){return f.replace(/[^\w.-]+/g,"")},s=200,S=600,x=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,T=function(f){return f!=null},A=function(f,C){return C===f||typeof C=="number"&&typeof f=="number"&&isNaN(C)&&isNaN(f)},w=function(g){Object(F.a)(C,g);var f=o(C);function C(E){var _;Object(M.a)(this,C),_=f.call(this,E),_.onKeyDown=function(L){var G=_.props,B=G.onKeyDown,O=G.onPressEnter;if(L.keyCode===m.a.UP){var V=_.getRatio(L);_.up(L,V,null),_.stop()}else if(L.keyCode===m.a.DOWN){var te=_.getRatio(L);_.down(L,te,null),_.stop()}else L.keyCode===m.a.ENTER&&O&&O(L);if(_.recordCursorPosition(),_.lastKeyCode=L.keyCode,B){for(var re=arguments.length,ge=new Array(re>1?re-1:0),Ae=1;Ae<re;Ae++)ge[Ae-1]=arguments[Ae];B.apply(void 0,[L].concat(ge))}},_.onKeyUp=function(L){var G=_.props.onKeyUp;if(_.stop(),_.recordCursorPosition(),G){for(var B=arguments.length,O=new Array(B>1?B-1:0),V=1;V<B;V++)O[V-1]=arguments[V];G.apply(void 0,[L].concat(O))}},_.onChange=function(L){var G=_.props.onChange;_.state.focused&&(_.inputting=!0),_.rawInput=_.props.parser(_.getValueFromEvent(L)),_.setState({inputValue:_.rawInput}),G(_.toNumber(_.rawInput))},_.onMouseUp=function(){var L=_.props.onMouseUp;_.recordCursorPosition(),L&&L.apply(void 0,arguments)},_.onFocus=function(){var L;_.setState({focused:!0}),(L=_.props).onFocus.apply(L,arguments)},_.onBlur=function(){var L=_.props.onBlur;_.inputting=!1,_.setState({focused:!1});var G=_.getCurrentValidValue(_.state.inputValue),B=_.setValue(G,r);if(L){var O=_.input.value,V=_.getInputDisplayValue({focus:!1,value:B});_.input.value=V&&Number(V),L.apply(void 0,arguments),_.input.value=O}},_.getRatio=function(L){var G=1;return L.metaKey||L.ctrlKey?G=.1:L.shiftKey&&(G=10),G},_.getFullNum=function(L){return isNaN(L)?L:/e/i.test(String(L))?Number(L).toFixed(18).replace(/\.?0+$/,""):L},_.getPrecision=function(L){if(T(_.props.precision))return _.props.precision;var G=String(L);if(G.indexOf("e-")>=0)return parseInt(G.slice(G.indexOf("e-")+2),10);var B=0;return G.indexOf(".")>=0&&(B=G.length-G.indexOf(".")-1),B},_.getInputDisplayValue=function(L){var G=L||_.state,B=G.focused,O=G.inputValue,V=G.value,te;B?te=O:te=_.toPrecisionAsStep(V),te==null&&(te="");var re=_.formatWrapper(te);return T(_.props.decimalSeparator)&&(re=re.toString().replace(".",_.props.decimalSeparator)),re},_.recordCursorPosition=function(){try{_.cursorStart=_.input.selectionStart,_.cursorEnd=_.input.selectionEnd,_.currentValue=_.input.value,_.cursorBefore=_.input.value.substring(0,_.cursorStart),_.cursorAfter=_.input.value.substring(_.cursorEnd)}catch(L){}},_.restoreByAfter=function(L){if(L===void 0)return!1;var G=_.input.value,B=G.lastIndexOf(L);if(B===-1)return!1;var O=_.cursorBefore.length;return _.lastKeyCode===m.a.DELETE&&_.cursorBefore.charAt(O-1)===L[0]?(_.fixCaret(O,O),!0):B+L.length===G.length?(_.fixCaret(B,B),!0):!1},_.partRestoreByAfter=function(L){return L===void 0?!1:Array.prototype.some.call(L,function(G,B){var O=L.substring(B);return _.restoreByAfter(O)})},_.isNotCompleteNumber=function(L){return isNaN(L)||L===""||L===null||L&&L.toString().indexOf(".")===L.toString().length-1},_.stop=function(){_.autoStepTimer&&clearTimeout(_.autoStepTimer)},_.down=function(L,G,B){_.pressingUpOrDown=!0,_.step("down",L,G,B)},_.up=function(L,G,B){_.pressingUpOrDown=!0,_.step("up",L,G,B)},_.saveInput=function(L){_.input=L};var U=E.value;U===void 0&&(U=E.defaultValue),_.state={focused:E.autoFocus};var j=_.getValidValue(_.toNumber(U));return _.state=u(u({},_.state),{},{inputValue:_.toPrecisionAsStep(j),value:j}),_}return Object(X.a)(C,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(_){var U=this.props,j=U.value,L=U.onChange,G=U.max,B=U.min,O=this.state.focused;if(_){if(!A(_.value,j)||!A(_.max,G)||!A(_.min,B)){var V=O?j:this.getValidValue(j),te;this.pressingUpOrDown?te=V:this.inputting?te=this.rawInput:te=this.toPrecisionAsStep(V),this.setState({value:V,inputValue:te})}var re="value"in this.props?j:this.state.value;"max"in this.props&&_.max!==G&&typeof re=="number"&&re>G&&L&&L(G),"min"in this.props&&_.min!==B&&typeof re=="number"&&re<B&&L&&L(B)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ge=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===m.a.BACKSPACE?ge=this.cursorStart-1:this.lastKeyCode===m.a.DELETE&&(ge=this.cursorStart):ge=this.input.value.length,this.fixCaret(ge,ge)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case m.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case m.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Ae){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(_){var U=_;return U===""?U="":this.isNotCompleteNumber(parseFloat(U))?U=this.state.value:U=this.getValidValue(U),this.toNumber(U)}},{key:"getValueFromEvent",value:function(_){var U=_.target.value.trim().replace(/。/g,".");return T(this.props.decimalSeparator)&&(U=U.replace(this.props.decimalSeparator,".")),U}},{key:"getValidValue",value:function(_){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,L=parseFloat(_);return isNaN(L)?_:(L<U&&(L=U),L>j&&(L=j),L)}},{key:"setValue",value:function(_,U){var j=this.props.precision,L=this.isNotCompleteNumber(parseFloat(_))?null:parseFloat(_),G=this.state.value,B=G===void 0?null:G,O=this.state.inputValue,V=O===void 0?null:O,te=typeof L=="number"?L.toFixed(j):"".concat(L),re=L!==B||te!=="".concat(V);return"value"in this.props?(V=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:V},U)):this.setState({value:L,inputValue:this.toPrecisionAsStep(_)},U),re&&this.props.onChange(L),L}},{key:"getMaxPrecision",value:function(_){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,j=this.props,L=j.precision,G=j.step;if(T(L))return L;var B=this.getPrecision(U),O=this.getPrecision(G),V=this.getPrecision(_);return _?Math.max(V,B+O):B+O}},{key:"getPrecisionFactor",value:function(_){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,j=this.getMaxPrecision(_,U);return Math.pow(10,j)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(_){return this.props.formatter?this.props.formatter(_):_}},{key:"toPrecisionAsStep",value:function(_){if(this.isNotCompleteNumber(_)||_==="")return _;var U=Math.abs(this.getMaxPrecision(_));return isNaN(U)?_.toString():Number(_).toFixed(U)}},{key:"toNumber",value:function(_){var U=this.props.precision,j=this.state.focused,L=_&&_.length>16&&j;return this.isNotCompleteNumber(_)||L?_:T(U)?Math.round(_*Math.pow(10,U))/Math.pow(10,U):Number(_)}},{key:"upStep",value:function(_,U){var j=this.props.step,L=this.getPrecisionFactor(_,U),G=Math.abs(this.getMaxPrecision(_,U)),B=((L*_+L*j*U)/L).toFixed(G);return this.toNumber(B)}},{key:"downStep",value:function(_,U){var j=this.props.step,L=this.getPrecisionFactor(_,U),G=Math.abs(this.getMaxPrecision(_,U)),B=((L*_-L*j*U)/L).toFixed(G);return this.toNumber(B)}},{key:"step",value:function(_,U){var j=this,L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,G=arguments.length>3?arguments[3]:void 0;this.stop(),U&&(U.persist(),U.preventDefault());var B=this.props;if(B.disabled)return;var O=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(O))return;var V=this["".concat(_,"Step")](O,L),te=V>B.max||V<B.min;if(V>B.max?V=B.max:V<B.min&&(V=B.min),this.setValue(V,null),this.setState({focused:!0},function(){j.pressingUpOrDown=!1}),te)return;this.autoStepTimer=setTimeout(function(){j[_](U,L,!0)},G?s:S)}},{key:"fixCaret",value:function(_,U){if(_===void 0||U===void 0||!this.input||!this.input.value)return;try{var j=this.input.selectionStart,L=this.input.selectionEnd;(_!==j||U!==L)&&this.input.setSelectionRange(_,U)}catch(G){}}},{key:"render",value:function(){var _,U=this.props,j=U.prefixCls,L=U.disabled,G=U.readOnly,B=U.useTouch,O=U.autoComplete,V=U.upHandler,te=U.downHandler,re=U.className,ge=U.max,Ae=U.min,Oe=U.style,Ce=U.title,je=U.onMouseEnter,Ue=U.onMouseLeave,xe=U.onMouseOver,be=U.onMouseOut,Ve=U.required,mt=U.onClick,yt=U.tabIndex,_t=U.type,xt=U.placeholder,nt=U.id,ct=U.inputMode,wt=U.pattern,_e=U.step,Me=U.maxLength,ve=U.autoFocus,Te=U.name,We=U.onPaste,Je=U.onInput,at=Object(Q.a)(U,["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"]),dt=this.state,Lt=dt.value,It=dt.focused,Ne=p()(j,(_={},Object(z.a)(_,re,!!re),Object(z.a)(_,"".concat(j,"-disabled"),L),Object(z.a)(_,"".concat(j,"-focused"),It),_)),ke={};Object.keys(at).forEach(function(me){(me.substr(0,5)==="data-"||me.substr(0,5)==="aria-"||me==="role")&&(ke[me]=at[me])});var it=!G&&!L,ot=this.getInputDisplayValue(null),Ge=(Lt||Lt===0)&&(isNaN(Lt)||Number(Lt)>=ge),$e=(Lt||Lt===0)&&(isNaN(Lt)||Number(Lt)<=Ae),we=Ge||L||G,Se=$e||L||G,Ee=p()("".concat(j,"-handler"),"".concat(j,"-handler-up"),Object(z.a)({},"".concat(j,"-handler-up-disabled"),we)),ue=p()("".concat(j,"-handler"),"".concat(j,"-handler-down"),Object(z.a)({},"".concat(j,"-handler-down-disabled"),Se)),de=B?{onTouchStart:we?r:this.up,onTouchEnd:this.stop}:{onMouseDown:we?r:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},ye=B?{onTouchStart:Se?r:this.down,onTouchEnd:this.stop}:{onMouseDown:Se?r:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return n.a.createElement("div",{className:Ne,style:Oe,title:Ce,onMouseEnter:je,onMouseLeave:Ue,onMouseOver:xe,onMouseOut:be,onFocus:function(){return null},onBlur:function(){return null}},n.a.createElement("div",{className:"".concat(j,"-handler-wrap")},n.a.createElement("span",Object.assign({unselectable:"on"},de,{role:"button","aria-label":"Increase Value","aria-disabled":we,className:Ee}),V||n.a.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-up-inner"),onClick:a})),n.a.createElement("span",Object.assign({unselectable:"on"},ye,{role:"button","aria-label":"Decrease Value","aria-disabled":Se,className:ue}),te||n.a.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-down-inner"),onClick:a}))),n.a.createElement("div",{className:"".concat(j,"-input-wrap")},n.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Ae,"aria-valuemax":ge,"aria-valuenow":Lt,required:Ve,type:_t,placeholder:xt,onPaste:We,onClick:mt,onMouseUp:this.onMouseUp,className:"".concat(j,"-input"),tabIndex:yt,autoComplete:O,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:it?this.onKeyDown:r,onKeyUp:it?this.onKeyUp:r,autoFocus:ve,maxLength:Me,readOnly:G,disabled:L,max:ge,min:Ae,step:_e,name:Te,title:Ce,id:nt,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ot),pattern:wt,inputMode:ct,onInput:Je},ke))))}}]),C}(n.a.Component);w.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:x,min:-x,step:1,style:{},onChange:r,onKeyDown:r,onPressEnter:r,onFocus:r,onBlur:r,parser:i,required:!1,autoComplete:"off"};var v=w,b=le.a=v},fcSX:function(Be,le,D){"use strict";var Q=D("Ff2n"),z=D("1OyB"),M=D("vuIU"),X=D("Ji7U"),F=D("md7G"),I=D("foSv"),H=D("1W/9"),N=D("q1tI"),n=D("rePB"),P=D("JX7q"),p=D("TSYQ"),m=D.n(p),d=D("qx4F"),u=D("4IlW");function o(L){return Array.isArray(L)?L:[L]}var h={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},r=Object.keys(h).filter(function(L){if(typeof document=="undefined")return!1;var G=document.getElementsByTagName("html")[0];return L in(G?G.style:{})})[0],a=h[r];function i(L,G,B,O){L.addEventListener?L.addEventListener(G,B,O):L.attachEvent&&L.attachEvent("on".concat(G),B)}function s(L,G,B,O){L.removeEventListener?L.removeEventListener(G,B,O):L.attachEvent&&L.detachEvent("on".concat(G),B)}function S(L,G){var B=typeof L=="function"?L(G):L;return Array.isArray(B)?B.length===2?B:[B[0],B[1]]:[B]}var x=function(G){return!isNaN(parseFloat(G))&&isFinite(G)},T=!(typeof window!="undefined"&&window.document&&window.document.createElement),A=function L(G,B,O,V){if(!B||B===document||B instanceof Document)return!1;if(B===G.parentNode)return!0;var te=Math.max(Math.abs(O),Math.abs(V))===Math.abs(V),re=Math.max(Math.abs(O),Math.abs(V))===Math.abs(O),ge=B.scrollHeight-B.clientHeight,Ae=B.scrollWidth-B.clientWidth,Oe=document.defaultView.getComputedStyle(B),Ce=Oe.overflowY==="auto"||Oe.overflowY==="scroll",je=Oe.overflowX==="auto"||Oe.overflowX==="scroll",Ue=ge&&Ce,xe=Ae&&je;return te&&(!Ue||Ue&&(B.scrollTop>=ge&&V<0||B.scrollTop<=0&&V>0))||re&&(!xe||xe&&(B.scrollLeft>=Ae&&O<0||B.scrollLeft<=0&&O>0))?L(G,B.parentNode,O,V):!1};function w(L){var G=v();return function(){var O=Object(I.a)(L),V;if(G){var te=Object(I.a)(this).constructor;V=Reflect.construct(O,arguments,te)}else V=O.apply(this,arguments);return Object(F.a)(this,V)}}function v(){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(L){return!1}}var b={},g=function(L){Object(X.a)(B,L);var G=w(B);function B(O){var V;return Object(z.a)(this,B),V=G.call(this,O),V.domFocus=function(){V.dom&&V.dom.focus()},V.removeStartHandler=function(te){if(te.touches.length>1)return;V.startPos={x:te.touches[0].clientX,y:te.touches[0].clientY}},V.removeMoveHandler=function(te){if(te.changedTouches.length>1)return;var re=te.currentTarget,ge=te.changedTouches[0].clientX-V.startPos.x,Ae=te.changedTouches[0].clientY-V.startPos.y;(re===V.maskDom||re===V.handlerDom||re===V.contentDom&&A(re,te.target,ge,Ae))&&te.cancelable&&te.preventDefault()},V.transitionEnd=function(te){var re=te.target;s(re,a,V.transitionEnd),re.style.transition=""},V.onKeyDown=function(te){if(te.keyCode===u.a.ESC){var re=V.props.onClose;te.stopPropagation(),re&&re(te)}},V.onWrapperTransitionEnd=function(te){var re=V.props,ge=re.open,Ae=re.afterVisibleChange;te.target===V.contentWrapper&&te.propertyName.match(/transform$/)&&(V.dom.style.transition="",!ge&&V.getCurrentDrawerSome()&&(document.body.style.overflowX="",V.maskDom&&(V.maskDom.style.left="",V.maskDom.style.width="")),Ae&&Ae(!!ge))},V.openLevelTransition=function(){var te=V.props,re=te.open,ge=te.width,Ae=te.height,Oe=V.getHorizontalBoolAndPlacementName(),Ce=Oe.isHorizontal,je=Oe.placementName,Ue=V.contentDom?V.contentDom.getBoundingClientRect()[Ce?"width":"height"]:0,xe=(Ce?ge:Ae)||Ue;V.setLevelAndScrolling(re,je,xe)},V.setLevelTransform=function(te,re,ge,Ae){var Oe=V.props,Ce=Oe.placement,je=Oe.levelMove,Ue=Oe.duration,xe=Oe.ease,be=Oe.showMask;V.levelDom.forEach(function(Ve){Ve.style.transition="transform ".concat(Ue," ").concat(xe),i(Ve,a,V.transitionEnd);var mt=te?ge:0;if(je){var yt=S(je,{target:Ve,open:te});mt=te?yt[0]:yt[1]||0}var _t=typeof mt=="number"?"".concat(mt,"px"):mt,xt=Ce==="left"||Ce==="top"?_t:"-".concat(_t);xt=be&&Ce==="right"&&Ae?"calc(".concat(xt," + ").concat(Ae,"px)"):xt,Ve.style.transform=mt?"".concat(re,"(").concat(xt,")"):""})},V.setLevelAndScrolling=function(te,re,ge){var Ae=V.props.onChange;if(!T){var Oe=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(d.a)(!0):0;V.setLevelTransform(te,re,ge,Oe),V.toggleScrollingToDrawerAndBody(Oe)}Ae&&Ae(te)},V.toggleScrollingToDrawerAndBody=function(te){var re=V.props,ge=re.getOpenCount,Ae=re.getContainer,Oe=re.showMask,Ce=re.open,je=Ae&&Ae(),Ue=ge&&ge();if(je&&je.parentNode===document.body&&Oe){var xe=["touchstart"],be=[document.body,V.maskDom,V.handlerDom,V.contentDom];Ce&&document.body.style.overflow!=="hidden"?(te&&V.addScrollingEffect(te),Ue===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",be.forEach(function(Ve,mt){if(!Ve)return;i(Ve,xe[mt]||"touchmove",mt?V.removeMoveHandler:V.removeStartHandler,V.passive)})):V.getCurrentDrawerSome()&&(Ue||(document.body.style.overflow=""),document.body.style.touchAction="",te&&V.remScrollingEffect(te),be.forEach(function(Ve,mt){if(!Ve)return;s(Ve,xe[mt]||"touchmove",mt?V.removeMoveHandler:V.removeStartHandler,V.passive)}))}},V.addScrollingEffect=function(te){var re=V.props,ge=re.placement,Ae=re.duration,Oe=re.ease,Ce=re.getOpenCount,je=re.switchScrollingEffect,Ue=Ce&&Ce();Ue===1&&je();var xe="width ".concat(Ae," ").concat(Oe),be="transform ".concat(Ae," ").concat(Oe);V.dom.style.transition="none";switch(ge){case"right":V.dom.style.transform="translateX(-".concat(te,"px)");break;case"top":case"bottom":V.dom.style.width="calc(100% - ".concat(te,"px)"),V.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(V.timeout),V.timeout=setTimeout(function(){V.dom&&(V.dom.style.transition="".concat(be,",").concat(xe),V.dom.style.width="",V.dom.style.transform="")})},V.remScrollingEffect=function(te){var re=V.props,ge=re.placement,Ae=re.duration,Oe=re.ease,Ce=re.getOpenCount,je=re.switchScrollingEffect,Ue=Ce&&Ce();Ue||je(!0),r&&(document.body.style.overflowX="hidden"),V.dom.style.transition="none";var xe,be="width ".concat(Ae," ").concat(Oe),Ve="transform ".concat(Ae," ").concat(Oe);switch(ge){case"left":{V.dom.style.width="100%",be="width 0s ".concat(Oe," ").concat(Ae);break}case"right":{V.dom.style.transform="translateX(".concat(te,"px)"),V.dom.style.width="100%",be="width 0s ".concat(Oe," ").concat(Ae),V.maskDom&&(V.maskDom.style.left="-".concat(te,"px"),V.maskDom.style.width="calc(100% + ".concat(te,"px)"));break}case"top":case"bottom":{V.dom.style.width="calc(100% + ".concat(te,"px)"),V.dom.style.height="100%",V.dom.style.transform="translateZ(0)",xe="height 0s ".concat(Oe," ").concat(Ae);break}default:break}clearTimeout(V.timeout),V.timeout=setTimeout(function(){V.dom&&(V.dom.style.transition="".concat(Ve,",").concat(xe?"".concat(xe,","):"").concat(be),V.dom.style.transform="",V.dom.style.width="",V.dom.style.height="")})},V.getCurrentDrawerSome=function(){return!Object.keys(b).some(function(te){return b[te]})},V.getLevelDom=function(te){var re=te.level,ge=te.getContainer;if(T)return;var Ae=ge&&ge(),Oe=Ae?Ae.parentNode:null;if(V.levelDom=[],re==="all"){var Ce=Oe?Array.prototype.slice.call(Oe.children):[];Ce.forEach(function(je){je.nodeName!=="SCRIPT"&&je.nodeName!=="STYLE"&&je.nodeName!=="LINK"&&je!==Ae&&V.levelDom.push(je)})}else re&&o(re).forEach(function(je){document.querySelectorAll(je).forEach(function(Ue){V.levelDom.push(Ue)})})},V.getHorizontalBoolAndPlacementName=function(){var te=V.props.placement,re=te==="left"||te==="right",ge="translate".concat(re?"X":"Y");return{isHorizontal:re,placementName:ge}},V.state={_self:Object(P.a)(V)},V}return Object(M.a)(B,[{key:"componentDidMount",value:function(){var V=this;if(!T){var te=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return te=!0,null}}))}catch(Ce){}this.passive=te?{passive:!1}:!1}var re=this.props,ge=re.open,Ae=re.getContainer,Oe=Ae&&Ae();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),ge&&(Oe&&Oe.parentNode===document.body&&(b[this.drawerId]=ge),this.openLevelTransition(),this.forceUpdate(function(){V.domFocus()}))}},{key:"componentDidUpdate",value:function(V){var te=this.props,re=te.open,ge=te.getContainer,Ae=ge&&ge();re!==V.open&&(re&&this.domFocus(),Ae&&Ae.parentNode===document.body&&(b[this.drawerId]=!!re),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var V=this.props,te=V.getOpenCount,re=V.open,ge=V.switchScrollingEffect,Ae=typeof te=="function"&&te();delete b[this.drawerId],re&&(this.setLevelTransform(!1),document.body.style.touchAction=""),Ae||(document.body.style.overflow="",ge(!0))}},{key:"render",value:function(){var V,te=this,re=this.props,ge=re.className,Ae=re.children,Oe=re.style,Ce=re.width,je=re.height,Ue=re.defaultOpen,xe=re.open,be=re.prefixCls,Ve=re.placement,mt=re.level,yt=re.levelMove,_t=re.ease,xt=re.duration,nt=re.getContainer,ct=re.handler,wt=re.onChange,_e=re.afterVisibleChange,Me=re.showMask,ve=re.maskClosable,Te=re.maskStyle,We=re.onClose,Je=re.onHandleClick,at=re.keyboard,dt=re.getOpenCount,Lt=re.switchScrollingEffect,It=Object(Q.a)(re,["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"]),Ne=this.dom?xe:!1,ke=m()(be,(V={},Object(n.a)(V,"".concat(be,"-").concat(Ve),!0),Object(n.a)(V,"".concat(be,"-open"),Ne),Object(n.a)(V,ge||"",!!ge),Object(n.a)(V,"no-mask",!Me),V)),it=this.getHorizontalBoolAndPlacementName(),ot=it.placementName,Ge=Ve==="left"||Ve==="top"?"-100%":"100%",$e=Ne?"":"".concat(ot,"(").concat(Ge,")"),we=ct&&N.cloneElement(ct,{onClick:function(Ee){ct.props.onClick&&ct.props.onClick(),Je&&Je(Ee)},ref:function(Ee){te.handlerDom=Ee}});return N.createElement("div",Object.assign({},It,{tabIndex:-1,className:ke,style:Oe,ref:function(Ee){te.dom=Ee},onKeyDown:Ne&&at?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),Me&&N.createElement("div",{className:"".concat(be,"-mask"),onClick:ve?We:void 0,style:Te,ref:function(Ee){te.maskDom=Ee}}),N.createElement("div",{className:"".concat(be,"-content-wrapper"),style:{transform:$e,msTransform:$e,width:x(Ce)?"".concat(Ce,"px"):Ce,height:x(je)?"".concat(je,"px"):je},ref:function(Ee){te.contentWrapper=Ee}},N.createElement("div",{className:"".concat(be,"-content"),ref:function(Ee){te.contentDom=Ee},onTouchStart:Ne&&Me?this.removeStartHandler:void 0,onTouchMove:Ne&&Me?this.removeMoveHandler:void 0},Ae),we))}}],[{key:"getDerivedStateFromProps",value:function(V,te){var re=te.prevProps,ge=te._self,Ae={prevProps:V};if(re!==void 0){var Oe=V.placement,Ce=V.level;Oe!==re.placement&&(ge.contentDom=null),Ce!==re.level&&ge.getLevelDom(V)}return Ae}}]),B}(N.Component);g.defaultProps={switchScrollingEffect:function(){}};var f=g;function C(L){var G=E();return function(){var O=Object(I.a)(L),V;if(G){var te=Object(I.a)(this).constructor;V=Reflect.construct(O,arguments,te)}else V=O.apply(this,arguments);return Object(F.a)(this,V)}}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(L){return!1}}var _=function(L){Object(X.a)(B,L);var G=C(B);function B(O){var V;Object(z.a)(this,B),V=G.call(this,O),V.onHandleClick=function(re){var ge=V.props,Ae=ge.onHandleClick,Oe=ge.open;if(Ae&&Ae(re),typeof Oe=="undefined"){var Ce=V.state.open;V.setState({open:!Ce})}},V.onClose=function(re){var ge=V.props,Ae=ge.onClose,Oe=ge.open;Ae&&Ae(re),typeof Oe=="undefined"&&V.setState({open:!1})};var te=typeof O.open!="undefined"?O.open:!!O.defaultOpen;return V.state={open:te},"onMaskClick"in O&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),V}return Object(M.a)(B,[{key:"render",value:function(){var V=this,te=this.props,re=te.defaultOpen,ge=te.getContainer,Ae=te.wrapperClassName,Oe=te.forceRender,Ce=te.handler,je=Object(Q.a)(te,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),Ue=this.state.open;if(!ge)return N.createElement("div",{className:Ae,ref:function(Ve){V.dom=Ve}},N.createElement(f,Object.assign({},je,{open:Ue,handler:Ce,getContainer:function(){return V.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var xe=!!Ce||Oe;return N.createElement(H.a,{visible:Ue,forceRender:xe,getContainer:ge,wrapperClassName:Ae},function(be){var Ve=be.visible,mt=be.afterClose,yt=Object(Q.a)(be,["visible","afterClose"]);return N.createElement(f,Object.assign({},je,yt,{open:Ve!==void 0?Ve:Ue,afterVisibleChange:mt!==void 0?mt:je.afterVisibleChange,handler:Ce,onClose:V.onClose,onHandleClick:V.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(V,te){var re=te.prevProps,ge={prevProps:V};return typeof re!="undefined"&&V.open!==re.open&&(ge.open=V.open),ge}}]),B}(N.Component);_.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:N.createElement("div",{className:"drawer-handle"},N.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var U=_,j=le.a=U},fcyK:function(Be,le,D){},fjLI:function(Be,le,D){"use strict";D.d(le,"f",function(){return d}),D.d(le,"b",function(){return u}),D.d(le,"a",function(){return o}),D.d(le,"d",function(){return h}),D.d(le,"e",function(){return r}),D.d(le,"c",function(){return a});var Q=D("8HAY"),z=D("Vhoy"),M=D("MI8n"),X=D("JYp7"),F=D("pmY6"),I=D("24hK"),H=D("nnTU"),N=D("T8No"),n=D("Cg/j"),P=D("t9D7"),p=function(i,s,S,x){var T=arguments.length,A=T<3?s:x===null?x=Object.getOwnPropertyDescriptor(s,S):x,w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(i,s,S,x);else for(var v=i.length-1;v>=0;v--)(w=i[v])&&(A=(T<3?w(A):T>3?w(s,S,A):w(s,S))||A);return T>3&&A&&Object.defineProperty(s,S,A),A},m=function(i,s){return function(S,x){s(S,x,i)}};function d(i){return i.command!==void 0}class u{constructor(i){this.id=u._idPool++,this._debugName=i}}u._idPool=0,u.CommandPalette=new u("CommandPalette"),u.EditorContext=new u("EditorContext"),u.SimpleEditorContext=new u("SimpleEditorContext"),u.EditorContextCopy=new u("EditorContextCopy"),u.EditorContextPeek=new u("EditorContextPeek"),u.MenubarEditMenu=new u("MenubarEditMenu"),u.MenubarCopy=new u("MenubarCopy"),u.MenubarGoMenu=new u("MenubarGoMenu"),u.MenubarSelectionMenu=new u("MenubarSelectionMenu"),u.InlineCompletionsActions=new u("InlineCompletionsActions");const o=Object(n.c)("menuService"),h=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new M.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:i=>i===u.CommandPalette}}addCommand(i){return this.addCommands(X.a.single(i))}addCommands(i){for(const s of i)this._commands.set(s.id,s);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(F.i)(()=>{let s=!1;for(const S of i)s=this._commands.delete(S.id)||s;s&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(i){return this._commands.get(i)}getCommands(){const i=new Map;return this._commands.forEach((s,S)=>i.set(S,s)),i}appendMenuItem(i,s){return this.appendMenuItems(X.a.single({id:i,item:s}))}appendMenuItems(i){const s=new Set,S=new I.a;for(const{id:x,item:T}of i){let A=this._menuItems.get(x);A||(A=new I.a,this._menuItems.set(x,A)),S.push(A.push(T)),s.add(x)}return this._onDidChangeMenu.fire(s),Object(F.i)(()=>{if(S.size>0){for(let x of S)x();this._onDidChangeMenu.fire(s),S.clear()}})}getMenuItems(i){let s;return this._menuItems.has(i)?s=[...this._menuItems.get(i)]:s=[],i===u.CommandPalette&&this._appendImplicitItems(s),s}_appendImplicitItems(i){const s=new Set;for(const S of i)d(S)&&(s.add(S.command.id),S.alt&&s.add(S.alt.id));this._commands.forEach((S,x)=>{s.has(x)||i.push({command:S})})}};class r extends Q.e{constructor(i,s,S,x){super(`submenuitem.${i.submenu.id}`,typeof i.title=="string"?i.title:i.title.value,[],"submenu");this.item=i,this._menuService=s,this._contextKeyService=S,this._options=x}get actions(){const i=[],s=this._menuService.createMenu(this.item.submenu,this._contextKeyService),S=s.getActions(this._options);s.dispose();for(const[,x]of S)x.length>0&&(i.push(...x),i.push(new Q.d));return i.length&&i.pop(),i}}let a=class i{constructor(s,S,x,T,A){var w,v;if(this._commandService=A,this.id=s.id,this.label=(x==null?void 0:x.renderShortTitle)&&s.shortTitle?typeof s.shortTitle=="string"?s.shortTitle:s.shortTitle.value:typeof s.title=="string"?s.title:s.title.value,this.tooltip=(v=typeof s.tooltip=="string"?s.tooltip:(w=s.tooltip)===null||w===void 0?void 0:w.value)!==null&&v!==void 0?v:"",this.enabled=!s.precondition||T.contextMatchesRules(s.precondition),this.checked=void 0,s.toggled){const b=s.toggled.condition?s.toggled:{condition:s.toggled};this.checked=T.contextMatchesRules(b.condition),this.checked&&b.tooltip&&(this.tooltip=typeof b.tooltip=="string"?b.tooltip:b.tooltip.value),b.title&&(this.label=typeof b.title=="string"?b.title:b.title.value)}this.item=s,this.alt=S?new i(S,void 0,x,T,A):void 0,this._options=x,P.d.isThemeIcon(s.icon)&&(this.class=z.a.asClassName(s.icon))}dispose(){}run(...s){var S,x;let T=[];return((S=this._options)===null||S===void 0?void 0:S.arg)&&(T=[...T,this._options.arg]),((x=this._options)===null||x===void 0?void 0:x.shouldForwardArgs)&&(T=[...T,...s]),this._commandService.executeCommand(this.id,...T)}};a=p([m(3,N.b),m(4,H.b)],a)},fyJ8:function(Be,le,D){"use strict";var Q=D("rePB"),z=D("VTBJ"),M=D("Ff2n"),X=D("U8pU"),F=D("q1tI"),I=D.n(F),H=D("TSYQ"),N=D.n(H),n=D("c+Xe"),P=D("sR1s");function p(h){return h&&Object(X.a)(h)==="object"&&!Array.isArray(h)&&!F.isValidElement(h)}function m(h){return typeof h=="string"?!0:Object(n.c)(h)}function d(h,r){var a,i=h.prefixCls,s=h.className,S=h.record,x=h.index,T=h.dataIndex,A=h.render,w=h.children,v=h.component,b=v===void 0?"td":v,g=h.colSpan,f=h.rowSpan,C=h.fixLeft,E=h.fixRight,_=h.firstFixLeft,U=h.lastFixLeft,j=h.firstFixRight,L=h.lastFixRight,G=h.appendNode,B=h.additionalProps,O=B===void 0?{}:B,V=h.ellipsis,te=h.align,re=h.rowType,ge=h.isSticky,Ae="".concat(i,"-cell"),Oe,Ce;if(w)Ce=w;else{var je=Object(P.b)(S,T);if(Ce=je,A){var Ue=A(je,S,x);p(Ue)?(Ce=Ue.children,Oe=Ue.props):Ce=Ue}}Object(X.a)(Ce)==="object"&&!Array.isArray(Ce)&&!F.isValidElement(Ce)&&(Ce=null),V&&(U||j)&&(Ce=F.createElement("span",{className:"".concat(Ae,"-content")},Ce));var xe=Oe||{},be=xe.colSpan,Ve=xe.rowSpan,mt=xe.style,yt=xe.className,_t=Object(M.a)(xe,["colSpan","rowSpan","style","className"]),xt=be!==void 0?be:g,nt=Ve!==void 0?Ve:f;if(xt===0||nt===0)return null;var ct={},wt=typeof C=="number",_e=typeof E=="number";wt&&(ct.position="sticky",ct.left=C),_e&&(ct.position="sticky",ct.right=E);var Me={};te&&(Me.textAlign=te);var ve,Te=V===!0?{showTitle:!0}:V;Te&&(Te.showTitle||re==="header")&&(typeof Ce=="string"||typeof Ce=="number"?ve=Ce.toString():F.isValidElement(Ce)&&typeof Ce.props.children=="string"&&(ve=Ce.props.children));var We=Object(z.a)(Object(z.a)(Object(z.a)({title:ve},_t),O),{},{colSpan:xt&&xt!==1?xt:null,rowSpan:nt&&nt!==1?nt:null,className:N()(Ae,s,(a={},Object(Q.a)(a,"".concat(Ae,"-fix-left"),wt),Object(Q.a)(a,"".concat(Ae,"-fix-left-first"),_),Object(Q.a)(a,"".concat(Ae,"-fix-left-last"),U),Object(Q.a)(a,"".concat(Ae,"-fix-right"),_e),Object(Q.a)(a,"".concat(Ae,"-fix-right-first"),j),Object(Q.a)(a,"".concat(Ae,"-fix-right-last"),L),Object(Q.a)(a,"".concat(Ae,"-ellipsis"),V),Object(Q.a)(a,"".concat(Ae,"-with-append"),G),Object(Q.a)(a,"".concat(Ae,"-fix-sticky"),(wt||_e)&&ge),a),O.className,yt),style:Object(z.a)(Object(z.a)(Object(z.a)(Object(z.a)({},O.style),Me),ct),mt),ref:m(b)?r:null});return F.createElement(b,Object.assign({},We),G,Ce)}var u=F.forwardRef(d);u.displayName="Cell";var o=F.memo(u,function(h,r){return r.shouldCellUpdate?!r.shouldCellUpdate(r.record,h.record):!1});le.a=o},gRFJ:function(Be,le,D){Be.exports=[D("rdUC"),D("ynwM"),D("RELg"),D("DlR+"),D("CrYA"),D("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(Be){return Be<10?"0"+Be:Be}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(Be){return rx_escapable.lastIndex=0,rx_escapable.test(Be)?'"'+Be.replace(rx_escapable,function(le){var D=meta[le];return typeof D=="string"?D:"\\u"+("0000"+le.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+Be+'"'}function str(Be,le){var D,Q,z,M,X=gap,F,I=le[Be];I&&typeof I=="object"&&typeof I.toJSON=="function"&&(I=I.toJSON(Be)),typeof rep=="function"&&(I=rep.call(le,Be,I));switch(typeof I){case"string":return quote(I);case"number":return isFinite(I)?String(I):"null";case"boolean":case"null":return String(I);case"object":if(!I)return"null";if(gap+=indent,F=[],Object.prototype.toString.apply(I)==="[object Array]"){for(M=I.length,D=0;D<M;D+=1)F[D]=str(D,I)||"null";return z=F.length===0?"[]":gap?`[
|
|
`+gap+F.join(`,
|
|
`+gap)+`
|
|
`+X+"]":"["+F.join(",")+"]",gap=X,z}if(rep&&typeof rep=="object")for(M=rep.length,D=0;D<M;D+=1)typeof rep[D]=="string"&&(Q=rep[D],z=str(Q,I),z&&F.push(quote(Q)+(gap?": ":":")+z));else for(Q in I)Object.prototype.hasOwnProperty.call(I,Q)&&(z=str(Q,I),z&&F.push(quote(Q)+(gap?": ":":")+z));return z=F.length===0?"{}":gap?`{
|
|
`+gap+F.join(`,
|
|
`+gap)+`
|
|
`+X+"}":"{"+F.join(",")+"}",gap=X,z}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(Be,le,D){var Q;if(gap="",indent="",typeof D=="number")for(Q=0;Q<D;Q+=1)indent+=" ";else typeof D=="string"&&(indent=D);if(rep=le,le&&typeof le!="function"&&(typeof le!="object"||typeof le.length!="number"))throw new Error("JSON.stringify");return str("",{"":Be})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(Be,le){var D,Q,z=Be[le];if(z&&typeof z=="object")for(D in z)Object.prototype.hasOwnProperty.call(z,D)&&(Q=walk(z,D),Q!==void 0?z[D]=Q:delete z[D]);return reviver.call(Be,le,z)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(Be){return"\\u"+("0000"+Be.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")})}()},gqXR:function(Be,le,D){Be.exports=D.p+"static/g.37db56e1.svg"},hW8S:function(Be,le,D){"use strict";D.d(le,"a",function(){return X}),D.d(le,"c",function(){return F}),D.d(le,"b",function(){return I});var Q=D("VTBJ"),z=D("Ff2n"),M=D("Kwbf"),X="RC_TABLE_INTERNAL_COL_DEFINE";function F(H){var N=H.expandable,n=Object(z.a)(H,["expandable"]);return"expandable"in H?Object(Q.a)(Object(Q.a)({},n),N):n}function I(H){return Object.keys(H).reduce(function(N,n){return(n.substr(0,5)==="data-"||n.substr(0,5)==="aria-")&&(N[n]=H[n]),N},{})}},hgre:function(Be,le,D){"use strict";var Q=D("miYZ"),z=D("tsqr"),M=D("9og8"),X=D("WmNS"),F=D.n(X),I=D("q1tI"),H=D.n(I),N=D("GUcZ"),n=D("ulZh"),P=D.n(n),p=D("xKgJ"),m=D("P5Jw"),d=D.n(m),u=D("bntm"),o=D("4xil"),h=D.n(o);function r(S){if(isNaN(S))return{minutes:"00",seconds:"00"};var x=new Date(S*1e3).toISOString().substr(11,8);return{hour:x.substr(0,2),minutes:x.substr(3,2),seconds:x.substr(6,2)}}Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2}});function a(S,x){return S-x}function i(S){S.sort(a);for(var x=0,T=0;T<S.length-1;T++){var A=Math.abs(S[T+1]-S[T]);A<21&&(x+=A)}return x}var s=/(android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini)/i;le.a=Object(I.forwardRef)(function(S,x){var T,A=S.src,w=S.toLog,v=S.videoId,b=S.logWatchHistory,g=S.courseId,f=g===void 0?null:g,C=S.startTime,E=S.handlePause,_=E===void 0?function(){}:E,U=S.handlePlay,j=U===void 0?function(){}:U,L=S.handlePlayEnded,G=L===void 0?function(){}:L,B=S.videoSpeed,O=B===void 0?1:B,V=A==null||((T=A.split("."))===null||T===void 0)?void 0:T.pop(),te=V==="flv",re=Object(I.useRef)(),ge=Object(I.useRef)(),Ae=Object(I.useRef)(),Oe=Object(I.useRef)(),Ce=Object(I.useRef)(),je=Object(I.useRef)(),Ue=Object(I.useRef)(),xe=Object(I.useRef)(),be=Object(I.useRef)(),Ve=Object(I.useRef)(),mt=Object(I.useRef)(),yt=Object(I.useRef)(),_t=Object(I.useRef)(),xt=Object(I.useRef)(),nt=navigator.userAgent.toLowerCase().match(s),ct=nt?nt[0]:"pc",wt=Object(I.useRef)(!1),_e=Object(p.x)(),Me=0,ve=0,Te=0,We=null,Je=!1,at=20,dt=1,Lt=!1,It=!1,Ne=[];Object(I.useImperativeHandle)(x,function(){return{getLastUpdatedTime:function(){return re.current.currentTime},getDuration:function(){return re.current.duration}}});var ke=Object(I.useCallback)(function(we){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ee={point:re.current.currentTime};We?(Ee.log_id=We,Ee.watch_duration=i(Ne),Ee.total_duration=ve):(f?(Ee.video_id=parseInt(v,10),Ee.course_id=f):Ee.video_id=v,Ee.duration=Me,Ee.device=ct),Se&&(Ee.ed="1");function ue(){return de.apply(this,arguments)}function de(){return de=Object(M.a)(F.a.mark(function ye(){var me;return F.a.wrap(function(Xe){for(;;)switch(Xe.prev=Xe.next){case 0:return Lt=!0,Xe.next=3,b(Ee);case 3:me=Xe.sent,We=me,Lt=!1,we&&we();case 7:case"end":return Xe.stop()}},ye)})),de.apply(this,arguments)}ue()},[v,f]);Object(I.useEffect)(function(){z.b.destroy();var we=null;return N.a.isSupported&&te&&A&&(A==null?void 0:A.indexOf(".m3u8"))<0?(we=N.a.createPlayer({type:"flv",volume:.8,cors:!0,url:A,muted:!1}),re.current&&(we.attachMediaElement(re.current),we.load())):re.current.setAttribute("src",A),ot(),function(){we&&(we.unload(),we.pause(),we.destroy(),we=null)}},[re,te,A]);function it(){re.current.paused?(Oe.current.style.display="none",Ce.current.style.display="block"):(Oe.current.style.display="block",Ce.current.style.display="none")}function ot(){mt.current.style.display="none",_t.current.style.display="none",yt.current.style.display="none",re.current.muted||re.current.volume===0?mt.current.style.display="block":re.current.volume>0&&re.current.volume<=.5?_t.current.style.display="block":yt.current.style.display="block"}Object(I.useEffect)(function(){var we=document.getElementById("play"),Se=document.querySelectorAll(".playback-icons use");function Ee(){j(),C&&!wt.current&&(re.current.currentTime=C),wt.current=!0,Ne.push(re.current.currentTime),Je||(Je=!0,w&&ke())}function ue(){return de.apply(this,arguments)}function de(){return de=Object(M.a)(F.a.mark(function He(){return F.a.wrap(function(Re){for(;;)switch(Re.prev=Re.next){case 0:it(),Ne.push(re.current.currentTime),w&&ke(function(){We=null,Te=0,Je=!1,Lt=!1,It=!1,Ne=[],ve=0,dt=1},!0);case 3:case"end":return Re.stop()}},He)})),de.apply(this,arguments)}function ye(){je.current.value=Math.round(re.current.currentTime),Ue.current.value=Math.round(re.current.currentTime)}function me(){var He=r(Math.round(re.current.currentTime));be.current.innerText="".concat(He.hour>0?He.hour+":":"").concat(He.minutes,":").concat(He.seconds),be.current.setAttribute("datetime","".concat(He.hour>0?" "+He.hour+" ":"").concat(He.minutes,"m ").concat(He.seconds,"s"))}function Le(){var He=Math.round(re.current.duration);je.current.setAttribute("max",He),Ue.current.setAttribute("max",He);var pe=r(He);xe.current.innerText="".concat(pe.hour>0?pe.hour+":":"").concat(pe.minutes,":").concat(pe.seconds),xe.current.setAttribute("datetime","".concat(pe.hour>0?" "+pe.hour+" ":"").concat(pe.minutes,"m ").concat(pe.seconds,"s"))}function Xe(){var He=Math.round(re.current.duration);je.current.setAttribute("max",He),Ue.current.setAttribute("max",He);var pe=r(He);xe.current.innerText="".concat(pe.hour>0?pe.hour+":":"").concat(pe.minutes,":").concat(pe.seconds),xe.current.setAttribute("datetime","".concat(pe.hour>0?" "+pe.hour+" ":"").concat(pe.minutes,"m ").concat(pe.seconds,"s")),ye(),me();var Re=ge.current.getBoundingClientRect(),lt=Re.width,Ye=Re.height,Pt=Re.x,Nt=Re.y;if(Pt<0||Nt<0||!lt)return;if(!It){var Ke=re.current.currentTime,gt=Ke-Te;Math.abs(gt)<10?(ve+=Math.abs(gt),Te=Ke,Lt||ve-dt*at>=0&&(dt++,Ne.push(Te),w&&ke())):(Te=Ke,w&&ke())}}function ut(){It=!0}function Dt(){re.current.playing&&Ne.push(re.current.currentTime,Te),Te=re.current.currentTime,It=!1}function jt(){Me=re.current.duration,Me<=20&&(at=Me/3),re.current.addEventListener("play",Ee)}function Ut(He){He.preventDefault(),Object(u.a)()?(re.current.style.width="100%",re.current.style.height="100%"):re.current.style.cssText=""}function Ct(){_()}function et(He){var pe=He.target.dataset.seek?He.target.dataset.seek:He.target.value;re.current.currentTime=pe,Ue.current.value=pe,je.current.value=pe}function st(He){var pe=Math.round(He.offsetX/He.target.clientWidth*parseInt(He.target.getAttribute("max"),10));je.current.setAttribute("data-seek",pe);var Re=r(pe);Ve.current.textContent="".concat(Re.hour>0?Re.hour+":":"").concat(Re.minutes,":").concat(Re.seconds);var lt=re.current.getBoundingClientRect();Ve.current.style.left="".concat(He.pageX-lt.left,"px")}return Ae.current.addEventListener(Object(u.c)(),Ut),re.current.addEventListener("canplay",jt),re.current.addEventListener("ended",ue),re.current.addEventListener("seeking",ut),re.current.addEventListener("seeked",Dt),re.current.addEventListener("loadedmetadata",Le),je.current.addEventListener("mousemove",st),je.current.addEventListener("input",et),re.current.addEventListener("timeupdate",Xe),re.current.addEventListener("pause",Ct),re.current.addEventListener("volumechange",ot),function(){re.current.removeEventListener("canplay",jt),re.current.removeEventListener("play",Ee),re.current.removeEventListener("ended",ue),re.current.removeEventListener("seeking",ut),re.current.removeEventListener("seeked",Dt),je.current.removeEventListener("mousemove",st),je.current.removeEventListener("input",et),re.current.removeEventListener("timeupdate",Xe),re.current.removeEventListener("pause",Ct),re.current.removeEventListener("loadedmetadata",Le),re.current.removeEventListener("volumechange",ot),re.current.playing&&(Ne.push(Te,re.current.currentTime),w&&ke())}},[re,A]),Object(I.useEffect)(function(){if(re.current.onended=function(){G(re)},re.current.oncontextmenu=function(){return!1},(A==null?void 0:A.indexOf(".m3u8"))>-1){if(re.current.canPlayType("application/vnd.apple.mpegurl"))re.current.src=A;else if(P.a.isSupported()){var we=new P.a;we.loadSource(A),we.attachMedia(re.current)}}},[A]),Object(I.useEffect)(function(){re.current.playbackRate=O},[O]);var Ge=function(){re.current.paused||re.current.ended?re.current.play():re.current.pause(),it()};function $e(){re.current.muted=!re.current.muted,re.current.muted?(xt.current.setAttribute("data-volume",volume.value),xt.current.value=0):xt.current.value=xt.current.dataset.volume}return H.a.createElement("div",{style:{position:"relative"},ref:Ae},H.a.createElement("div",{ref:ge,className:"".concat(h.a.watermark," animated_alternate animate__animated_10s animate__infinite animate__stepstart ").concat(h.a.animate__loop)},_e?_e.login:" "),H.a.createElement("div",{className:h.a.container},H.a.createElement("div",{className:h.a["video-container"],id:"video-container"},H.a.createElement("div",{className:h.a["playback-animation"],id:"playback-animation"},H.a.createElement("svg",{className:h.a["playback-icons"]},H.a.createElement("use",{className:"hidden",href:"#play-icon"}),H.a.createElement("use",{href:"#pause"}))),H.a.createElement("video",{className:h.a.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:re,autoPlay:!1}),H.a.createElement("div",{className:"".concat(h.a["video-controls"]," "),id:"video-controls"},H.a.createElement("div",{className:h.a["bottom-controls"]},H.a.createElement("div",{className:h.a["left-controls"]},H.a.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:Ge},H.a.createElement("svg",{className:h.a["playback-icons"]},H.a.createElement("use",{ref:Ce,href:"#play-icon"}),H.a.createElement("use",{ref:Oe,style:{display:"none"},href:"#pause"}))),H.a.createElement("div",{className:h.a.time},H.a.createElement("time",{id:"time-elapsed",ref:be},"00:00"),H.a.createElement("span",null," / "),H.a.createElement("time",{id:"duration",ref:xe},"00:00"))),H.a.createElement("div",{className:h.a["right-controls"]},H.a.createElement(m.CopyToClipboard,{text:A,onCopy:function(){return z.b.success("\u590D\u5236\u6210\u529F")}},H.a.createElement("button",{"data-title":"\u590D\u5236\u94FE\u63A5"},H.a.createElement("i",{className:"icon-lianjie2 iconfont",style:{fontSize:"12px",color:"white"}}))),H.a.createElement("div",{className:h.a["volume-controls"]},H.a.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:h.a["volume-button"],id:"volume-button",onClick:$e},H.a.createElement("i",{ref:mt,className:"icon-a-bianzu8 iconfont",style:{fontSize:"14px",color:"white"}}),H.a.createElement("i",{ref:_t,className:"icon-shengyinkaibeifen iconfont",style:{fontSize:"14px",color:"white"}}),H.a.createElement("i",{ref:yt,className:"icon-shengyinkai iconfont",style:{fontSize:"14px",color:"white"}})),H.a.createElement("input",{className:h.a.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:xt,style:{display:"none"},onClick:ot})),H.a.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:h.a["fullscreen-button"],onClick:function(){Object(u.a)()?Object(u.b)():Object(u.d)(Ae.current)}},H.a.createElement("i",{className:"icon-fangda1 iconfont",style:{fontSize:"12px",color:"white"}})))),H.a.createElement("div",{className:h.a["video-progress"]},H.a.createElement("progress",{ref:Ue,value:"0",min:"0"}),H.a.createElement("input",{className:h.a.seek,ref:je,value:"0",min:"0",type:"range",step:"1"}),H.a.createElement("div",{className:h.a["seek-tooltip"],ref:Ve,id:"seek-tooltip"},"00:00"))))),H.a.createElement("svg",{style:{display:"none"}},H.a.createElement("defs",null,H.a.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},H.a.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),H.a.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},H.a.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),H.a.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},H.a.createElement("path",{d:"M14.016 3.234q3.047 0.656 5.016 3.117t1.969 5.648-1.969 5.648-5.016 3.117v-2.063q2.203-0.656 3.586-2.484t1.383-4.219-1.383-4.219-3.586-2.484v-2.063zM16.5 12q0 2.813-2.484 4.031v-8.063q1.031 0.516 1.758 1.688t0.727 2.344zM3 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6z"})),H.a.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},H.a.createElement("path",{d:"M5.016 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6zM18.516 12q0 2.766-2.531 4.031v-8.063q1.031 0.516 1.781 1.711t0.75 2.32z"})),H.a.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},H.a.createElement("path",{d:"M12 3.984v4.219l-2.109-2.109zM4.266 3l16.734 16.734-1.266 1.266-2.063-2.063q-1.547 1.313-3.656 1.828v-2.063q1.172-0.328 2.25-1.172l-4.266-4.266v6.75l-5.016-5.016h-3.984v-6h4.734l-4.734-4.734zM18.984 12q0-2.391-1.383-4.219t-3.586-2.484v-2.063q3.047 0.656 5.016 3.117t1.969 5.648q0 2.203-1.031 4.172l-1.5-1.547q0.516-1.266 0.516-2.625zM16.5 12q0 0.422-0.047 0.609l-2.438-2.438v-2.203q1.031 0.516 1.758 1.688t0.727 2.344z"})),H.a.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},H.a.createElement("path",{d:"M14.016 5.016h4.969v4.969h-1.969v-3h-3v-1.969zM17.016 17.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 9.984v-4.969h4.969v1.969h-3v3h-1.969zM6.984 14.016v3h3v1.969h-4.969v-4.969h1.969z"})),H.a.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},H.a.createElement("path",{d:"M15.984 8.016h3v1.969h-4.969v-4.969h1.969v3zM14.016 18.984v-4.969h4.969v1.969h-3v3h-1.969zM8.016 8.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 15.984v-1.969h4.969v4.969h-1.969v-3h-3z"})),H.a.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},H.a.createElement("path",{d:"M21 19.031v-14.063h-18v14.063h18zM23.016 18.984q0 0.797-0.609 1.406t-1.406 0.609h-18q-0.797 0-1.406-0.609t-0.609-1.406v-14.016q0-0.797 0.609-1.383t1.406-0.586h18q0.797 0 1.406 0.586t0.609 1.383v14.016zM18.984 11.016v6h-7.969v-6h7.969z"})))))})},i3hx:function(Be,le,D){},ic2d:function(Be,le,D){"use strict";D.d(le,"a",function(){return X});var Q=D("FWmy"),z=D("746U");class M{constructor(){this.data=new Map}add(F,I){Q.a(z.l(F)),Q.a(z.k(I)),Q.a(!this.data.has(F),"There is already an extension with this id"),this.data.set(F,I)}as(F){return this.data.get(F)||null}}const X=new M},je13:function(Be,le,D){var Q=D("5nXd"),z=D("gRFJ"),M=[D("uQRt")];Be.exports=Q.createStore(z,M)},kSUc:function(Be,le,D){},"kaH+":function(Be,le,D){"use strict";var Q=D("+L6B"),z=D("2/Rp"),M=D("tJVT"),X=D("q1tI"),F=D.n(X),I=D("UZu5"),H=D.n(I),N=D("dhSg"),n=D("rLCj"),P=D("dF/Y"),p=D("4i/N");le.a=function(){var m=Object(X.useState)(""),d=Object(M.a)(m,2),u=d[0],o=d[1],h=Object(X.useState)(0),r=Object(M.a)(h,2),a=r[0],i=r[1],s=Object(X.useRef)("");Object(X.useEffect)(function(){var b=N.a.subscribe("preview-image",function(g){o(g),document.body.style.overflow="hidden"});return b},[]),Object(X.useEffect)(function(){return document.addEventListener("keydown",S),function(){document.removeEventListener("keydown",S)}},[]),Object(X.useEffect)(function(){s.current=u},[u]);function S(b){b.keyCode==27&&s.current&&x()}function x(){document.body.style.overflow="auto",o("")}function T(){i(a+90)}var A=Object(X.useRef)(),w=Object(X.useRef)(),v=function(g){(g.nativeEvent.target===A.current||g.nativeEvent.target===w.current)&&x()};return F.a.createElement(X.Fragment,null,u?F.a.createElement("div",{className:"image-preview-container",ref:A,onClick:v},F.a.createElement("div",{className:"button-group"},F.a.createElement(z.a,{onClick:T},"\u65CB\u8F6C",F.a.createElement(n.a,null)),F.a.createElement(z.a,{href:u},"\u4E0B\u8F7D",F.a.createElement(P.a,null)),F.a.createElement(z.a,{onClick:x},"\u5173\u95ED",F.a.createElement(p.a,null))),F.a.createElement("div",{className:"preview-wrp-group",ref:w},F.a.createElement("img",{className:"image-preview",src:u,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(a,"deg)")}}))):null)}},kovY:function(Be,le,D){Be.exports=D.p+"static/e.528a21cb.svg"},lOMy:function(Be,le,D){},lZu9:function(Be,le,D){(function(Q){Q(D("VrN/"),D("1eCo"),D("8EBN"))})(function(Q){"use strict";Q.defineMode("markdown",function(z,M){var X=Q.getMode(z,"text/html"),F=X.name=="null";function I(B){if(Q.findModeByName){var O=Q.findModeByName(B);O&&(B=O.mime||O.mimes[0])}var V=Q.getMode(z,B);return V.name=="null"?null:V}M.highlightFormatting===void 0&&(M.highlightFormatting=!1),M.maxBlockquoteDepth===void 0&&(M.maxBlockquoteDepth=0),M.taskLists===void 0&&(M.taskLists=!1),M.strikethrough===void 0&&(M.strikethrough=!1),M.emoji===void 0&&(M.emoji=!1),M.fencedCodeBlockHighlighting===void 0&&(M.fencedCodeBlockHighlighting=!0),M.fencedCodeBlockDefaultMode===void 0&&(M.fencedCodeBlockDefaultMode="text/plain"),M.xml===void 0&&(M.xml=!0),M.tokenTypeOverrides===void 0&&(M.tokenTypeOverrides={});var H={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 N in H)H.hasOwnProperty(N)&&M.tokenTypeOverrides[N]&&(H[N]=M.tokenTypeOverrides[N]);var n=/^([*\-_])(?:\s*\1){2,}\s*$/,P=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,p=/^\[(x| )\](?=\s)/i,m=M.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,d=/^ {0,3}(?:\={1,}|-{2,})\s*$/,u=/^[^#!\[\]*_\\<>` "'(~:]+/,o=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,h=/^\s*\[[^\]]+?\]:.*$/,r=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,a=" ";function i(B,O,V){return O.f=O.inline=V,V(B,O)}function s(B,O,V){return O.f=O.block=V,V(B,O)}function S(B){return!B||!/\S/.test(B.string)}function x(B){if(B.linkTitle=!1,B.linkHref=!1,B.linkText=!1,B.em=!1,B.strong=!1,B.strikethrough=!1,B.quote=0,B.indentedCode=!1,B.f==A){var O=F;if(!O){var V=Q.innerMode(X,B.htmlState);O=V.mode.name=="xml"&&V.state.tagStart===null&&!V.state.context&&V.state.tokenize.isInText}O&&(B.f=g,B.block=T,B.htmlState=null)}return B.trailingSpace=0,B.trailingSpaceNewLine=!1,B.prevLine=B.thisLine,B.thisLine={stream:null},null}function T(B,O){var V=B.column()===O.indentation,te=S(O.prevLine.stream),re=O.indentedCode,ge=O.prevLine.hr,Ae=O.list!==!1,Oe=(O.listStack[O.listStack.length-1]||0)+3;O.indentedCode=!1;var Ce=O.indentation;if(O.indentationDiff===null&&(O.indentationDiff=O.indentation,Ae)){for(O.list=null;Ce<O.listStack[O.listStack.length-1];)O.listStack.pop(),O.listStack.length?O.indentation=O.listStack[O.listStack.length-1]:O.list=!1;O.list!==!1&&(O.indentationDiff=Ce-O.listStack[O.listStack.length-1])}var je=!te&&!ge&&!O.prevLine.header&&(!Ae||!re)&&!O.prevLine.fencedCodeEnd,Ue=(O.list===!1||ge||te)&&O.indentation<=Oe&&B.match(n),xe=null;if(O.indentationDiff>=4&&(re||O.prevLine.fencedCodeEnd||O.prevLine.header||te))return B.skipToEnd(),O.indentedCode=!0,H.code;if(B.eatSpace())return null;if(V&&O.indentation<=Oe&&(xe=B.match(m))&&xe[1].length<=6)return O.quote=0,O.header=xe[1].length,O.thisLine.header=!0,M.highlightFormatting&&(O.formatting="header"),O.f=O.inline,v(O);if(O.indentation<=Oe&&B.eat(">"))return O.quote=V?1:O.quote+1,M.highlightFormatting&&(O.formatting="quote"),B.eatSpace(),v(O);if(!Ue&&!O.setext&&V&&O.indentation<=Oe&&(xe=B.match(P))){var be=xe[1]?"ol":"ul";return O.indentation=Ce+B.current().length,O.list=!0,O.quote=0,O.listStack.push(O.indentation),O.em=!1,O.strong=!1,O.code=!1,O.strikethrough=!1,M.taskLists&&B.match(p,!1)&&(O.taskList=!0),O.f=O.inline,M.highlightFormatting&&(O.formatting=["list","list-"+be]),v(O)}else{if(V&&O.indentation<=Oe&&(xe=B.match(o,!0)))return O.quote=0,O.fencedEndRE=new RegExp(xe[1]+"+ *$"),O.localMode=M.fencedCodeBlockHighlighting&&I(xe[2]||M.fencedCodeBlockDefaultMode),O.localMode&&(O.localState=Q.startState(O.localMode)),O.f=O.block=w,M.highlightFormatting&&(O.formatting="code-block"),O.code=-1,v(O);if(O.setext||(!je||!Ae)&&!O.quote&&O.list===!1&&!O.code&&!Ue&&!h.test(B.string)&&(xe=B.lookAhead(1))&&(xe=xe.match(d)))return O.setext?(O.header=O.setext,O.setext=0,B.skipToEnd(),M.highlightFormatting&&(O.formatting="header")):(O.header=xe[0].charAt(0)=="="?1:2,O.setext=O.header),O.thisLine.header=!0,O.f=O.inline,v(O);if(Ue)return B.skipToEnd(),O.hr=!0,O.thisLine.hr=!0,H.hr;if(B.peek()==="[")return i(B,O,U)}return i(B,O,O.inline)}function A(B,O){var V=X.token(B,O.htmlState);if(!F){var te=Q.innerMode(X,O.htmlState);(te.mode.name=="xml"&&te.state.tagStart===null&&!te.state.context&&te.state.tokenize.isInText||O.md_inside&&B.current().indexOf(">")>-1)&&(O.f=g,O.block=T,O.htmlState=null)}return V}function w(B,O){var V=O.listStack[O.listStack.length-1]||0,te=O.indentation<V,re=V+3;if(O.fencedEndRE&&O.indentation<=re&&(te||B.match(O.fencedEndRE))){M.highlightFormatting&&(O.formatting="code-block");var ge;return te||(ge=v(O)),O.localMode=O.localState=null,O.block=T,O.f=g,O.fencedEndRE=null,O.code=0,O.thisLine.fencedCodeEnd=!0,te?s(B,O,O.block):ge}else return O.localMode?O.localMode.token(B,O.localState):(B.skipToEnd(),H.code)}function v(B){var O=[];if(B.formatting){O.push(H.formatting),typeof B.formatting=="string"&&(B.formatting=[B.formatting]);for(var V=0;V<B.formatting.length;V++)O.push(H.formatting+"-"+B.formatting[V]),B.formatting[V]==="header"&&O.push(H.formatting+"-"+B.formatting[V]+"-"+B.header),B.formatting[V]==="quote"&&(!M.maxBlockquoteDepth||M.maxBlockquoteDepth>=B.quote?O.push(H.formatting+"-"+B.formatting[V]+"-"+B.quote):O.push("error"))}if(B.taskOpen)return O.push("meta"),O.length?O.join(" "):null;if(B.taskClosed)return O.push("property"),O.length?O.join(" "):null;if(B.linkHref?O.push(H.linkHref,"url"):(B.strong&&O.push(H.strong),B.em&&O.push(H.em),B.strikethrough&&O.push(H.strikethrough),B.emoji&&O.push(H.emoji),B.linkText&&O.push(H.linkText),B.code&&O.push(H.code),B.image&&O.push(H.image),B.imageAltText&&O.push(H.imageAltText,"link"),B.imageMarker&&O.push(H.imageMarker)),B.header&&O.push(H.header,H.header+"-"+B.header),B.quote&&(O.push(H.quote),!M.maxBlockquoteDepth||M.maxBlockquoteDepth>=B.quote?O.push(H.quote+"-"+B.quote):O.push(H.quote+"-"+M.maxBlockquoteDepth)),B.list!==!1){var te=(B.listStack.length-1)%3;te?te===1?O.push(H.list2):O.push(H.list3):O.push(H.list1)}return B.trailingSpaceNewLine?O.push("trailing-space-new-line"):B.trailingSpace&&O.push("trailing-space-"+(B.trailingSpace%2?"a":"b")),O.length?O.join(" "):null}function b(B,O){return B.match(u,!0)?v(O):void 0}function g(B,O){var V=O.text(B,O);if(typeof V!="undefined")return V;if(O.list)return O.list=null,v(O);if(O.taskList){var te=B.match(p,!0)[1]===" ";return te?O.taskOpen=!0:O.taskClosed=!0,M.highlightFormatting&&(O.formatting="task"),O.taskList=!1,v(O)}if(O.taskOpen=!1,O.taskClosed=!1,O.header&&B.match(/^#+$/,!0))return M.highlightFormatting&&(O.formatting="header"),v(O);var re=B.next();if(O.linkTitle){O.linkTitle=!1;var ge=re;re==="("&&(ge=")"),ge=(ge+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ae="^\\s*(?:[^"+ge+"\\\\]+|\\\\\\\\|\\\\.)"+ge;if(B.match(new RegExp(Ae),!0))return H.linkHref}if(re==="`"){var Oe=O.formatting;M.highlightFormatting&&(O.formatting="code"),B.eatWhile("`");var Ce=B.current().length;if(O.code==0&&(!O.quote||Ce==1))return O.code=Ce,v(O);if(Ce==O.code){var je=v(O);return O.code=0,je}else return O.formatting=Oe,v(O)}else if(O.code)return v(O);if(re==="\\"&&(B.next(),M.highlightFormatting)){var Ue=v(O),xe=H.formatting+"-escape";return Ue?Ue+" "+xe:xe}if(re==="!"&&B.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return O.imageMarker=!0,O.image=!0,M.highlightFormatting&&(O.formatting="image"),v(O);if(re==="["&&O.imageMarker&&B.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return O.imageMarker=!1,O.imageAltText=!0,M.highlightFormatting&&(O.formatting="image"),v(O);if(re==="]"&&O.imageAltText){M.highlightFormatting&&(O.formatting="image");var Ue=v(O);return O.imageAltText=!1,O.image=!1,O.inline=O.f=C,Ue}if(re==="["&&!O.image)return O.linkText&&B.match(/^.*?\]/)||(O.linkText=!0,M.highlightFormatting&&(O.formatting="link")),v(O);if(re==="]"&&O.linkText){M.highlightFormatting&&(O.formatting="link");var Ue=v(O);return O.linkText=!1,O.inline=O.f=B.match(/\(.*?\)| ?\[.*?\]/,!1)?C:g,Ue}if(re==="<"&&B.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){O.f=O.inline=f,M.highlightFormatting&&(O.formatting="link");var Ue=v(O);return Ue?Ue+=" ":Ue="",Ue+H.linkInline}if(re==="<"&&B.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){O.f=O.inline=f,M.highlightFormatting&&(O.formatting="link");var Ue=v(O);return Ue?Ue+=" ":Ue="",Ue+H.linkEmail}if(M.xml&&re==="<"&&B.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var be=B.string.indexOf(">",B.pos);if(be!=-1){var Ve=B.string.substring(B.start,be);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ve)&&(O.md_inside=!0)}return B.backUp(1),O.htmlState=Q.startState(X),s(B,O,A)}if(M.xml&&re==="<"&&B.match(/^\/\w*?>/))return O.md_inside=!1,"tag";if(re==="*"||re==="_"){for(var mt=1,yt=B.pos==1?" ":B.string.charAt(B.pos-2);mt<3&&B.eat(re);)mt++;var _t=B.peek()||" ",xt=!/\s/.test(_t)&&(!r.test(_t)||/\s/.test(yt)||r.test(yt)),nt=!/\s/.test(yt)&&(!r.test(yt)||/\s/.test(_t)||r.test(_t)),ct=null,wt=null;if(mt%2&&(!O.em&&xt&&(re==="*"||!nt||r.test(yt))?ct=!0:O.em==re&&nt&&(re==="*"||!xt||r.test(_t))&&(ct=!1)),mt>1&&(!O.strong&&xt&&(re==="*"||!nt||r.test(yt))?wt=!0:O.strong==re&&nt&&(re==="*"||!xt||r.test(_t))&&(wt=!1)),wt!=null||ct!=null){M.highlightFormatting&&(O.formatting=ct==null?"strong":wt==null?"em":"strong em"),ct===!0&&(O.em=re),wt===!0&&(O.strong=re);var je=v(O);return ct===!1&&(O.em=!1),wt===!1&&(O.strong=!1),je}}else if(re===" "&&(B.eat("*")||B.eat("_"))){if(B.peek()===" ")return v(O);B.backUp(1)}if(M.strikethrough){if(re==="~"&&B.eatWhile(re)){if(O.strikethrough){M.highlightFormatting&&(O.formatting="strikethrough");var je=v(O);return O.strikethrough=!1,je}else if(B.match(/^[^\s]/,!1))return O.strikethrough=!0,M.highlightFormatting&&(O.formatting="strikethrough"),v(O)}else if(re===" "&&B.match(/^~~/,!0)){if(B.peek()===" ")return v(O);B.backUp(2)}}if(M.emoji&&re===":"&&B.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){O.emoji=!0,M.highlightFormatting&&(O.formatting="emoji");var _e=v(O);return O.emoji=!1,_e}return re===" "&&(B.match(/^ +$/,!1)?O.trailingSpace++:O.trailingSpace&&(O.trailingSpaceNewLine=!0)),v(O)}function f(B,O){var V=B.next();if(V===">"){O.f=O.inline=g,M.highlightFormatting&&(O.formatting="link");var te=v(O);return te?te+=" ":te="",te+H.linkInline}return B.match(/^[^>]+/,!0),H.linkInline}function C(B,O){if(B.eatSpace())return null;var V=B.next();return V==="("||V==="["?(O.f=O.inline=_(V==="("?")":"]"),M.highlightFormatting&&(O.formatting="link-string"),O.linkHref=!0,v(O)):"error"}var E={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function _(B){return function(O,V){var te=O.next();if(te===B){V.f=V.inline=g,M.highlightFormatting&&(V.formatting="link-string");var re=v(V);return V.linkHref=!1,re}return O.match(E[B]),V.linkHref=!0,v(V)}}function U(B,O){return B.match(/^([^\]\\]|\\.)*\]:/,!1)?(O.f=j,B.next(),M.highlightFormatting&&(O.formatting="link"),O.linkText=!0,v(O)):i(B,O,g)}function j(B,O){if(B.match(/^\]:/,!0)){O.f=O.inline=L,M.highlightFormatting&&(O.formatting="link");var V=v(O);return O.linkText=!1,V}return B.match(/^([^\]\\]|\\.)+/,!0),H.linkText}function L(B,O){return B.eatSpace()?null:(B.match(/^[^\s]+/,!0),B.peek()===void 0?O.linkTitle=!0:B.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),O.f=O.inline=g,H.linkHref+" url")}var G={startState:function(){return{f:T,prevLine:{stream:null},thisLine:{stream:null},block:T,htmlState:null,indentation:0,inline:g,text:b,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(B){return{f:B.f,prevLine:B.prevLine,thisLine:B.thisLine,block:B.block,htmlState:B.htmlState&&Q.copyState(X,B.htmlState),indentation:B.indentation,localMode:B.localMode,localState:B.localMode?Q.copyState(B.localMode,B.localState):null,inline:B.inline,text:B.text,formatting:!1,linkText:B.linkText,linkTitle:B.linkTitle,linkHref:B.linkHref,code:B.code,em:B.em,strong:B.strong,strikethrough:B.strikethrough,emoji:B.emoji,header:B.header,setext:B.setext,hr:B.hr,taskList:B.taskList,list:B.list,listStack:B.listStack.slice(0),quote:B.quote,indentedCode:B.indentedCode,trailingSpace:B.trailingSpace,trailingSpaceNewLine:B.trailingSpaceNewLine,md_inside:B.md_inside,fencedEndRE:B.fencedEndRE}},token:function(B,O){if(O.formatting=!1,B!=O.thisLine.stream){if(O.header=0,O.hr=!1,B.match(/^\s*$/,!0))return x(O),null;if(O.prevLine=O.thisLine,O.thisLine={stream:B},O.taskList=!1,O.trailingSpace=0,O.trailingSpaceNewLine=!1,!O.localState&&(O.f=O.block,O.f!=A)){var V=B.match(/^\s*/,!0)[0].replace(/\t/g,a).length;if(O.indentation=V,O.indentationDiff=null,V>0)return null}}return O.f(B,O)},innerMode:function(B){return B.block==A?{state:B.htmlState,mode:X}:B.localState?{state:B.localState,mode:B.localMode}:{state:B,mode:G}},indent:function(B,O,V){return B.block==A&&X.indent?X.indent(B.htmlState,O,V):B.localState&&B.localMode.indent?B.localMode.indent(B.localState,O,V):Q.Pass},blankLine:x,getType:v,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return G},"xml"),Q.defineMIME("text/markdown","markdown"),Q.defineMIME("text/x-markdown","markdown")})},n6Qo:function(Be,le,D){"use strict";D.d(le,"a",function(){return N});var Q=D("q1tI"),z=D("biw7"),M=D("fyJ8");function X(n){var P=n.className,p=n.index,m=n.children,d=n.colSpan,u=n.rowSpan,o=Q.useContext(z.a),h=o.prefixCls,r=o.fixedInfoList,a=r[p];return Q.createElement(M.a,Object.assign({className:P,index:p,component:"td",prefixCls:h,record:null,dataIndex:null,render:function(){return{children:m,props:{colSpan:d,rowSpan:u}}}},a))}function F(n){return Q.createElement("tr",Object.assign({},n))}function I(n){var P=n.children,p=Q.useContext(z.a),m=p.prefixCls;return Q.createElement("tfoot",{className:"".concat(m,"-summary")},P)}var H=le.b=I,N={Cell:X,Row:F}},nCk5:function(Be,le,D){Be.exports=D.p+"static/d.d198d73b.svg"},nEHx:function(Be,le,D){"use strict";D.d(le,"a",function(){return Q});var Q;(function(z){z.DARK="dark",z.LIGHT="light",z.HIGH_CONTRAST="hc"})(Q||(Q={}))},nWbc:function(Be,le,D){},nnTU:function(Be,le,D){"use strict";D.d(le,"b",function(){return H}),D.d(le,"a",function(){return N});var Q=D("MI8n"),z=D("JYp7"),M=D("pmY6"),X=D("24hK"),F=D("746U"),I=D("Cg/j");const H=Object(I.c)("commandService"),N=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Q.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,P){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!P)throw new Error("invalid command");return this.registerCommand({id:n,handler:P})}if(n.description){const o=[];for(let r of n.description.args)o.push(r.constraint);const h=n.handler;n.handler=function(r,...a){return Object(F.o)(a,o),h(r,...a)}}const{id:p}=n;let m=this._commands.get(p);m||(m=new X.a,this._commands.set(p,m));let d=m.unshift(n),u=Object(M.i)(()=>{d();const o=this._commands.get(p);(o==null?void 0:o.isEmpty())&&this._commands.delete(p)});return this._onDidRegisterCommand.fire(p),u}registerCommandAlias(n,P){return N.registerCommand(n,(p,...m)=>p.get(H).executeCommand(P,...m))}getCommand(n){const P=this._commands.get(n);return!P||P.isEmpty()?void 0:z.a.first(P)}getCommands(){const n=new Map;for(const P of this._commands.keys()){const p=this.getCommand(P);p&&n.set(P,p)}return n}};N.registerCommand("noop",()=>{})},oE5q:function(Be,le,D){Be.exports=D.p+"static/t.bba328b8.svg"},oFv4:function(Be,le,D){Be.exports=D.p+"static/internal.da228387.png"},osHv:function(Be,le,D){(function(Q){Q(D("VrN/"))})(function(Q){"use strict";var z=Q.Pos;function M(r,a){return r.line-a.line||r.ch-a.ch}var X="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",F=X+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",I=new RegExp("<(/?)(["+X+"]["+F+"]*)","g");function H(r,a,i,s){this.line=a,this.ch=i,this.cm=r,this.text=r.getLine(a),this.min=s?Math.max(s.from,r.firstLine()):r.firstLine(),this.max=s?Math.min(s.to-1,r.lastLine()):r.lastLine()}function N(r,a){var i=r.cm.getTokenTypeAt(z(r.line,a));return i&&/\btag\b/.test(i)}function n(r){return r.line>=r.max?void 0:(r.ch=0,r.text=r.cm.getLine(++r.line),!0)}function P(r){return r.line<=r.min?void 0:(r.text=r.cm.getLine(--r.line),r.ch=r.text.length,!0)}function p(r){for(;;){var a=r.text.indexOf(">",r.ch);if(a==-1){if(n(r))continue;return}if(!N(r,a+1)){r.ch=a+1;continue}var i=r.text.lastIndexOf("/",a),s=i>-1&&!/\S/.test(r.text.slice(i+1,a));return r.ch=a+1,s?"selfClose":"regular"}}function m(r){for(;;){var a=r.ch?r.text.lastIndexOf("<",r.ch-1):-1;if(a==-1){if(P(r))continue;return}if(!N(r,a+1)){r.ch=a;continue}I.lastIndex=a,r.ch=a;var i=I.exec(r.text);if(i&&i.index==a)return i}}function d(r){for(;;){I.lastIndex=r.ch;var a=I.exec(r.text);if(!a){if(n(r))continue;return}if(!N(r,a.index+1)){r.ch=a.index+1;continue}return r.ch=a.index+a[0].length,a}}function u(r){for(;;){var a=r.ch?r.text.lastIndexOf(">",r.ch-1):-1;if(a==-1){if(P(r))continue;return}if(!N(r,a+1)){r.ch=a;continue}var i=r.text.lastIndexOf("/",a),s=i>-1&&!/\S/.test(r.text.slice(i+1,a));return r.ch=a+1,s?"selfClose":"regular"}}function o(r,a){for(var i=[];;){var s=d(r),S,x=r.line,T=r.ch-(s?s[0].length:0);if(!s||!(S=p(r)))return;if(S=="selfClose")continue;if(s[1]){for(var A=i.length-1;A>=0;--A)if(i[A]==s[2]){i.length=A;break}if(A<0&&(!a||a==s[2]))return{tag:s[2],from:z(x,T),to:z(r.line,r.ch)}}else i.push(s[2])}}function h(r,a){for(var i=[];;){var s=u(r);if(!s)return;if(s=="selfClose"){m(r);continue}var S=r.line,x=r.ch,T=m(r);if(!T)return;if(T[1])i.push(T[2]);else{for(var A=i.length-1;A>=0;--A)if(i[A]==T[2]){i.length=A;break}if(A<0&&(!a||a==T[2]))return{tag:T[2],from:z(r.line,r.ch),to:z(S,x)}}}}Q.registerHelper("fold","xml",function(r,a){for(var i=new H(r,a.line,0);;){var s=d(i);if(!s||i.line!=a.line)return;var S=p(i);if(!S)return;if(!s[1]&&S!="selfClose"){var x=z(i.line,i.ch),T=o(i,s[2]);return T&&M(T.from,x)>0?{from:x,to:T.from}:null}}}),Q.findMatchingTag=function(r,a,i){var s=new H(r,a.line,a.ch,i);if(s.text.indexOf(">")==-1&&s.text.indexOf("<")==-1)return;var S=p(s),x=S&&z(s.line,s.ch),T=S&&m(s);if(!S||!T||M(s,a)>0)return;var A={from:z(s.line,s.ch),to:x,tag:T[2]};return S=="selfClose"?{open:A,close:null,at:"open"}:T[1]?{open:h(s,T[2]),close:A,at:"close"}:(s=new H(r,x.line,x.ch,i),{open:A,close:o(s,T[2]),at:"open"})},Q.findEnclosingTag=function(r,a,i,s){for(var S=new H(r,a.line,a.ch,i);;){var x=h(S,s);if(!x)break;var T=new H(r,a.line,a.ch,i),A=o(T,x.tag);if(A)return{open:x,close:A}}},Q.scanForClosingTag=function(r,a,i,s){var S=new H(r,a.line,a.ch,s?{from:0,to:s}:null);return o(S,i)}})},p5ED:function(Be,le,D){"use strict";var Q=D("+L6B"),z=D("2/Rp"),M=D("5Dmo"),X=D("3S7+"),F=D("k1fw"),I=D("9og8"),H=D("tJVT"),N=D("WmNS"),n=D.n(N),P=D("q1tI"),p=D.n(P),m=D("vHTk"),d=D.n(m),u=D("yEEn"),o=D("ZW9T"),h=D("1vsH"),r=D("V0Rq"),a=D("m3rI");le.a=function(i){var s,S,x,T,A,w,v,b=i.editOffice,g=b===void 0?"view":b,f=i.data,C=i.theme,E=i.type,_=i.filename,U=i.monacoEditor,j=i.className,L=i.style,G=i.close,B=i.onClose,O=i.hasMask,V=i.disabledDownload,te=Object(P.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),re=Object(H.a)(te,2),ge=re[0],Ae=re[1],Oe=Object(P.useState)(""),Ce=Object(H.a)(Oe,2),je=Ce[0],Ue=Ce[1],xe=Object(P.useState)(),be=Object(H.a)(xe,2),Ve=be[0],mt=be[1],yt=window.ENV==="build"?"/react/build":"",_t=a.a.PROXY_SERVER||location.origin,xt,nt=1024*1024,ct=10*nt,wt=Object(P.useRef)();(s=f)!==null&&s!==void 0&&s.startsWith("/api")&&E!=="txt"&&(f=a.a.API_SERVER+f),E==="office"&&(xt=Object(h.T)(f).filesize,xt>ct&&(E="other")),_&&U&&(U.filename=_),Object(P.useEffect)(function(){var Te,We,Je=(Te=document.cookie)===null||Te===void 0||((We=Te.replace(/\s/g,""))===null||We===void 0)?void 0:We.split(";");Je==null||Je.map(function(at){var dt=at.split("=");dt[0]==="_educoder_session"&&Ue(dt[1])})},[]),Object(P.useEffect)(function(){E==="office"&&_e()},[E,f]);var _e=function(){var Te=Object(I.a)(n.a.mark(function We(){var Je,at,dt;return n.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:return console.log("data:",f),Je=f,f.startsWith("http")||(Je=location.origin+Je),at=new URL(Je).pathname.split("/").pop(),It.next=6,Object(r.V)({attachment_id:at});case 6:dt=It.sent,mt(dt);case 8:case"end":return It.stop()}},We)}));return function(){return Te.apply(this,arguments)}}(),Me=function(){if(f.startsWith("http")||f.startsWith("blob:")){ve();return}Object(h.z)(_||"educoder",f,_)},ve=function(){Object(h.x)(_||"educoder",decodeURIComponent(f))};return p.a.createElement("div",{style:Object(F.a)({},L||{}),className:"".concat(O&&d.a.bgBlack," ").concat(E?d.a.wrp:"hide")},G&&p.a.createElement("div",{className:d.a.close,ref:wt},!V&&p.a.createElement(X.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return wt.current}},p.a.createElement("span",{onClick:ve},p.a.createElement("i",{className:"icon-quxiaozhiding"}))),p.a.createElement(X.a,{title:"\u5173\u95ED",getPopupContainer:function(){return wt.current}},p.a.createElement("span",{className:"",onClick:B},p.a.createElement("i",{className:"icon-guanbi1"})))),p.a.createElement("div",{className:"".concat(d.a[j]," ").concat(j," ").concat(d.a.monaco," ").concat(E==="txt"?"show":"hide")},E==="txt"&&p.a.createElement(o.b,U)),E==="audio"&&p.a.createElement("audio",{src:"".concat(((S=f)===null||S===void 0?void 0:S.indexOf("http://"))>-1||((x=f)===null||x===void 0?void 0:x.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(f),autoPlay:!0}),E==="video"&&p.a.createElement(p.a.Fragment,null,((T=f)===null||T===void 0?void 0:T.indexOf("http"))>-1?p.a.createElement("video",{controls:!0,src:"".concat(f),autoPlay:!0}):p.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(f),autoPlay:!0})),E==="office"&&Ve&&p.a.createElement("iframe",{src:"".concat(yt,"/office.html?key=").concat(Ve.key,"&url=").concat(_t+Ve.url,"&callbackUrl=").concat(_t+Ve.callbackUrl,"&fileType=").concat(Ve.fileType,"&title=").concat(Ve.title,"&model=").concat(g,"&officeServer=").concat(a.a.OFFICE_SERVER,"&disabledDownload=").concat(!!V)}),E==="html"&&p.a.createElement("iframe",{src:f+"&disposition=inline"}),E==="pdf"&&p.a.createElement("iframe",{src:"".concat(yt,"/js/pdfview/index.html?url=").concat(f,"&disabledDownload=").concat(!!V)}),E==="image"&&p.a.createElement("img",{src:"".concat(((A=f)===null||A===void 0?void 0:A.indexOf("http://"))>-1||((w=f)===null||w===void 0?void 0:w.indexOf("https://"))>-1||(v=f)!==null&&v!==void 0&&v.startsWith("/api")?"":"data:image/png;base64,").concat(f)}),E==="other"&&p.a.createElement("div",null,p.a.createElement(z.a,{type:"primary",size:"large",onClick:Me},p.a.createElement(u.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),E==="download"&&p.a.createElement(z.a,{type:"primary",size:"large",onClick:Me},p.a.createElement(u.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Be,le,D){},pYxM:function(Be,le,D){Be.exports={flex_box_center:"flex_box_center___v-DUT",flex_space_between:"flex_space_between___1bRJc",flex_box_vertical_center:"flex_box_vertical_center___k_OZG",flex_box_center_end:"flex_box_center_end___2lt4j",flex_box_column:"flex_box_column___3fVE5",active:"active___-vjVj",line:"line___3pg8N",list:"list___3yqVJ",left:"left___2dr70",mask:"mask___186YH",right:"right___17A6Y",name:"name___v6M7T",title:"title___1BhMz",a:"a___3T4cN",b:"b___1z1Bk",des:"des___29QAn",tag:"tag___FfUI2"}},pmY6:function(Be,le,D){"use strict";D.d(le,"h",function(){return P}),D.d(le,"g",function(){return m}),D.d(le,"f",function(){return d}),D.d(le,"e",function(){return u}),D.d(le,"i",function(){return o}),D.d(le,"b",function(){return h}),D.d(le,"a",function(){return r}),D.d(le,"d",function(){return a}),D.d(le,"c",function(){return i});var Q=D("C/vA"),z=D("JYp7");const M=!1;let X=null;function F(s){X=s}if(M){const s="__is_disposable_tracked__";F(new class{trackDisposable(S){const x=new Error("Potentially leaked disposable").stack;setTimeout(()=>{S[s]||console.log(x)},3e3)}setParent(S,x){if(S&&S!==r.None)try{S[s]=!0}catch(T){}}markAsDisposed(S){if(S&&S!==r.None)try{S[s]=!0}catch(x){}}markAsSingleton(S){}})}function I(s){return X==null||X.trackDisposable(s),s}function H(s){X==null||X.markAsDisposed(s)}function N(s,S){X==null||X.setParent(s,S)}function n(s,S){if(!X)return;for(const x of s)X.setParent(x,S)}function P(s){return X==null||X.markAsSingleton(s),s}class p extends Error{constructor(s){super(`Encountered errors while disposing of store. Errors: [${s.join(", ")}]`);this.errors=s}}function m(s){return typeof s.dispose=="function"&&s.dispose.length===0}function d(s){if(z.a.is(s)){let S=[];for(const x of s)if(x)try{x.dispose()}catch(T){S.push(T)}if(S.length===1)throw S[0];if(S.length>1)throw new p(S);return Array.isArray(s)?[]:s}else if(s)return s.dispose(),s}function u(...s){const S=o(()=>d(s));return n(s,S),S}function o(s){const S=I({dispose:Object(Q.a)(()=>{H(S),s()})});return S}class h{constructor(){this._toDispose=new Set,this._isDisposed=!1,I(this)}dispose(){if(this._isDisposed)return;H(this),this._isDisposed=!0,this.clear()}clear(){try{d(this._toDispose.values())}finally{this._toDispose.clear()}}add(s){if(!s)return s;if(s===this)throw new Error("Cannot register a disposable on itself!");return N(s,this),this._isDisposed?h.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(s),s}}h.DISABLE_DISPOSED_WARNING=!1;class r{constructor(){this._store=new h,I(this),N(this._store,this)}dispose(){H(this),this._store.dispose()}_register(s){if(s===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(s)}}r.None=Object.freeze({dispose(){}});class a{constructor(){this._isDisposed=!1,I(this)}get value(){return this._isDisposed?void 0:this._value}set value(s){var S;if(this._isDisposed||s===this._value)return;(S=this._value)===null||S===void 0||S.dispose(),s&&N(s,this),this._value=s}clear(){this.value=void 0}dispose(){var s;this._isDisposed=!0,H(this),(s=this._value)===null||s===void 0||s.dispose(),this._value=void 0}clearAndLeak(){const s=this._value;return this._value=void 0,s&&N(s,null),s}}class i{constructor(s){this.object=s}dispose(){}}},ps8w:function(Be,le,D){Be.exports=D.p+"static/show.76eb9b3c.svg"},psGv:function(Be,le,D){var Q,z;(function(){var M;(function(){"use strict";var H=[,,function(p){function m(o){this.__parent=o,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}m.prototype.clone_empty=function(){var o=new m(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},m.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},m.prototype.has_match=function(o){for(var h=this.__items.length-1;h>=0;h--)if(this.__items[h].match(o))return!0;return!1},m.prototype.set_indent=function(o,h){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},m.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},m.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},m.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var o=this.__parent.current_line;return o.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),o.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),o.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,o.__items[0]===" "&&(o.__items.splice(0,1),o.__character_count-=1),!0}return!1},m.prototype.is_empty=function(){return this.__items.length===0},m.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},m.prototype.push=function(o){this.__items.push(o);var h=o.lastIndexOf(`
|
|
`);h!==-1?this.__character_count=o.length-h:this.__character_count+=o.length},m.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},m.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},m.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},m.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},m.prototype.toString=function(){var o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function d(o,h){this.__cache=[""],this.__indent_size=o.indent_size,this.__indent_string=o.indent_char,o.indent_with_tabs||(this.__indent_string=new Array(o.indent_size+1).join(o.indent_char)),h=h||"",o.indent_level>0&&(h=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}d.prototype.get_indent_size=function(o,h){var r=this.__base_string_length;return h=h||0,o<0&&(r=0),r+=o*this.__indent_size,r+=h,r},d.prototype.get_indent_string=function(o,h){var r=this.__base_string;return h=h||0,o<0&&(o=0,r=""),h+=o*this.__indent_size,this.__ensure_cache(h),r+=this.__cache[h],r},d.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},d.prototype.__add_column=function(){var o=this.__cache.length,h=0,r="";this.__indent_size&&o>=this.__indent_size&&(h=Math.floor(o/this.__indent_size),o-=h*this.__indent_size,r=new Array(h+1).join(this.__indent_string)),o&&(r+=new Array(o+1).join(" ")),this.__cache.push(r)};function u(o,h){this.__indent_cache=new d(o,h),this.raw=!1,this._end_with_newline=o.end_with_newline,this.indent_size=o.indent_size,this.wrap_line_length=o.wrap_line_length,this.indent_empty_lines=o.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new m(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}u.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},u.prototype.get_line_number=function(){return this.__lines.length},u.prototype.get_indent_string=function(o,h){return this.__indent_cache.get_indent_string(o,h)},u.prototype.get_indent_size=function(o,h){return this.__indent_cache.get_indent_size(o,h)},u.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},u.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},u.prototype.get_code=function(o){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===`
|
|
`&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var r=this.__lines.join(`
|
|
`);return o!==`
|
|
`&&(r=r.replace(/[\n]/g,o)),r},u.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},u.prototype.set_indent=function(o,h){return o=o||0,h=h||0,this.next_line.set_indent(o,h),this.__lines.length>1?(this.current_line.set_indent(o,h),!0):(this.current_line.set_indent(),!1)},u.prototype.add_raw_token=function(o){for(var h=0;h<o.newlines;h++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(o.whitespace_before),this.current_line.push(o.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},u.prototype.add_token=function(o){this.__add_space_before_token(),this.current_line.push(o),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},u.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(" "))},u.prototype.remove_indent=function(o){for(var h=this.__lines.length;o<h;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},u.prototype.trim=function(o){for(o=o===void 0?!1:o,this.current_line.trim();o&&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},u.prototype.just_added_newline=function(){return this.current_line.is_empty()},u.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},u.prototype.ensure_empty_line_above=function(o,h){for(var r=this.__lines.length-2;r>=0;){var a=this.__lines[r];if(a.is_empty())break;if(a.item(0).indexOf(o)!==0&&a.item(-1)!==h){this.__lines.splice(r+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},p.exports.Output=u},function(p){function m(d,u,o,h){this.type=d,this.text=u,this.comments_before=null,this.newlines=o||0,this.whitespace_before=h||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}p.exports.Token=m},,,function(p){function m(o,h){this.raw_options=d(o,h),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}m.prototype._get_array=function(o,h){var r=this.raw_options[o],a=h||[];return typeof r=="object"?r!==null&&typeof r.concat=="function"&&(a=r.concat()):typeof r=="string"&&(a=r.split(/[^a-zA-Z0-9_\/\-]+/)),a},m.prototype._get_boolean=function(o,h){var r=this.raw_options[o],a=r===void 0?!!h:!!r;return a},m.prototype._get_characters=function(o,h){var r=this.raw_options[o],a=h||"";return typeof r=="string"&&(a=r.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),a},m.prototype._get_number=function(o,h){var r=this.raw_options[o];h=parseInt(h,10),isNaN(h)&&(h=0);var a=parseInt(r,10);return isNaN(a)&&(a=h),a},m.prototype._get_selection=function(o,h,r){var a=this._get_selection_list(o,h,r);if(a.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
|
|
`+h+`
|
|
You passed in: '`+this.raw_options[o]+"'");return a[0]},m.prototype._get_selection_list=function(o,h,r){if(!h||h.length===0)throw new Error("Selection list cannot be empty.");if(r=r||[h[0]],!this._is_valid_selection(r,h))throw new Error("Invalid Default Value!");var a=this._get_array(o,r);if(!this._is_valid_selection(a,h))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
|
|
`+h+`
|
|
You passed in: '`+this.raw_options[o]+"'");return a},m.prototype._is_valid_selection=function(o,h){return o.length&&h.length&&!o.some(function(r){return h.indexOf(r)===-1})};function d(o,h){var r={};o=u(o);var a;for(a in o)a!==h&&(r[a]=o[a]);if(h&&o[h])for(a in o[h])r[a]=o[h][a];return r}function u(o){var h={},r;for(r in o){var a=r.replace(/-/g,"_");h[a]=o[r]}return h}p.exports.Options=m,p.exports.normalizeOpts=u,p.exports.mergeOpts=d},,function(p){var m=RegExp.prototype.hasOwnProperty("sticky");function d(u){this.__input=u||"",this.__input_length=this.__input.length,this.__position=0}d.prototype.restart=function(){this.__position=0},d.prototype.back=function(){this.__position>0&&(this.__position-=1)},d.prototype.hasNext=function(){return this.__position<this.__input_length},d.prototype.next=function(){var u=null;return this.hasNext()&&(u=this.__input.charAt(this.__position),this.__position+=1),u},d.prototype.peek=function(u){var o=null;return u=u||0,u+=this.__position,u>=0&&u<this.__input_length&&(o=this.__input.charAt(u)),o},d.prototype.__match=function(u,o){u.lastIndex=o;var h=u.exec(this.__input);return h&&!(m&&u.sticky)&&(h.index!==o&&(h=null)),h},d.prototype.test=function(u,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(u,o):!1},d.prototype.testChar=function(u,o){var h=this.peek(o);return u.lastIndex=0,h!==null&&u.test(h)},d.prototype.match=function(u){var o=this.__match(u,this.__position);return o?this.__position+=o[0].length:o=null,o},d.prototype.read=function(u,o,h){var r="",a;return u&&(a=this.match(u),a&&(r+=a[0])),o&&(a||!u)&&(r+=this.readUntil(o,h)),r},d.prototype.readUntil=function(u,o){var h="",r=this.__position;u.lastIndex=this.__position;var a=u.exec(this.__input);return a?(r=a.index,o&&(r+=a[0].length)):r=this.__input_length,h=this.__input.substring(this.__position,r),this.__position=r,h},d.prototype.readUntilAfter=function(u){return this.readUntil(u,!0)},d.prototype.get_regexp=function(u,o){var h=null,r="g";return o&&m&&(r="y"),typeof u=="string"&&u!==""?h=new RegExp(u,r):u&&(h=new RegExp(u.source,r)),h},d.prototype.get_literal_regexp=function(u){return RegExp(u.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},d.prototype.peekUntilAfter=function(u){var o=this.__position,h=this.readUntilAfter(u);return this.__position=o,h},d.prototype.lookBack=function(u){var o=this.__position-1;return o>=u.length&&this.__input.substring(o-u.length,o).toLowerCase()===u},p.exports.InputScanner=d},function(p,m,d){var u=d(8).InputScanner,o=d(3).Token,h=d(10).TokenStream,r=d(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(s,S){this._input=new u(s),this._options=S||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new r(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new h,this._reset();for(var s,S=new o(a.START,""),x=null,T=[],A=new h;S.type!==a.EOF;){for(s=this._get_next_token(S,x);this._is_comment(s);)A.add(s),s=this._get_next_token(S,x);A.isEmpty()||(s.comments_before=A,A=new h),s.parent=x,this._is_opening(s)?(T.push(x),x=s):x&&this._is_closing(s,x)&&(s.opened=x,x.closed=s,x=T.pop(),s.parent=x),s.previous=S,S.next=s,this.__tokens.add(s),S=s}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(s,S){this._readWhitespace();var x=this._input.read(/.+/g);return x?this._create_token(a.RAW,x):this._create_token(a.EOF,"")},i.prototype._is_comment=function(s){return!1},i.prototype._is_opening=function(s){return!1},i.prototype._is_closing=function(s,S){return!1},i.prototype._create_token=function(s,S){var x=new o(s,S,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return x},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},p.exports.Tokenizer=i,p.exports.TOKEN=a},function(p){function m(d){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=d}m.prototype.restart=function(){this.__position=0},m.prototype.isEmpty=function(){return this.__tokens_length===0},m.prototype.hasNext=function(){return this.__position<this.__tokens_length},m.prototype.next=function(){var d=null;return this.hasNext()&&(d=this.__tokens[this.__position],this.__position+=1),d},m.prototype.peek=function(d){var u=null;return d=d||0,d+=this.__position,d>=0&&d<this.__tokens_length&&(u=this.__tokens[d]),u},m.prototype.add=function(d){this.__parent_token&&(d.parent=this.__parent_token),this.__tokens.push(d),this.__tokens_length+=1},p.exports.TokenStream=m},function(p,m,d){var u=d(12).Pattern;function o(h,r){u.call(this,h,r),r?this._line_regexp=this._input.get_regexp(r._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}o.prototype=new u,o.prototype.__set_whitespace_patterns=function(h,r){h+="\\t ",r+="\\n\\r",this._match_pattern=this._input.get_regexp("["+h+r+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+r+"]")},o.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var h=this._input.read(this._match_pattern);if(h===" ")this.whitespace_before_token=" ";else if(h){var r=this.__split(this._newline_regexp,h);this.newline_count=r.length-1,this.whitespace_before_token=r[this.newline_count]}return h},o.prototype.matching=function(h,r){var a=this._create();return a.__set_whitespace_patterns(h,r),a._update(),a},o.prototype._create=function(){return new o(this._input,this)},o.prototype.__split=function(h,r){h.lastIndex=0;for(var a=0,i=[],s=h.exec(r);s;)i.push(r.substring(a,s.index)),a=s.index+s[0].length,s=h.exec(r);return a<r.length?i.push(r.substring(a,r.length)):i.push(""),i},p.exports.WhitespacePattern=o},function(p){function m(d,u){this._input=d,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,u&&(this._starting_pattern=this._input.get_regexp(u._starting_pattern,!0),this._match_pattern=this._input.get_regexp(u._match_pattern,!0),this._until_pattern=this._input.get_regexp(u._until_pattern),this._until_after=u._until_after)}m.prototype.read=function(){var d=this._input.read(this._starting_pattern);return(!this._starting_pattern||d)&&(d+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),d},m.prototype.read_match=function(){return this._input.match(this._match_pattern)},m.prototype.until_after=function(d){var u=this._create();return u._until_after=!0,u._until_pattern=this._input.get_regexp(d),u._update(),u},m.prototype.until=function(d){var u=this._create();return u._until_after=!1,u._until_pattern=this._input.get_regexp(d),u._update(),u},m.prototype.starting_with=function(d){var u=this._create();return u._starting_pattern=this._input.get_regexp(d,!0),u._update(),u},m.prototype.matching=function(d){var u=this._create();return u._match_pattern=this._input.get_regexp(d,!0),u._update(),u},m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){},p.exports.Pattern=m},function(p){function m(d,u){d=typeof d=="string"?d:d.source,u=typeof u=="string"?u:u.source,this.__directives_block_pattern=new RegExp(d+/ beautify( \w+[:]\w+)+ /.source+u,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(d+/\sbeautify\signore:end\s/.source+u,"g")}m.prototype.get_directives=function(d){if(!d.match(this.__directives_block_pattern))return null;var u={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(d);o;)u[o[1]]=o[2],o=this.__directive_pattern.exec(d);return u},m.prototype.readIgnored=function(d){return d.readUntilAfter(this.__directives_end_ignore_pattern)},p.exports.Directives=m},function(p,m,d){var u=d(12).Pattern,o={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function h(r,a){u.call(this,r,a),this.__template_pattern=null,this._disabled=Object.assign({},o),this._excluded=Object.assign({},o),a&&(this.__template_pattern=this._input.get_regexp(a.__template_pattern),this._excluded=Object.assign(this._excluded,a._excluded),this._disabled=Object.assign(this._disabled,a._disabled));var i=new u(r);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}/)}}h.prototype=new u,h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){this.__set_templated_pattern()},h.prototype.disable=function(r){var a=this._create();return a._disabled[r]=!0,a._update(),a},h.prototype.read_options=function(r){var a=this._create();for(var i in o)a._disabled[i]=r.templating.indexOf(i)===-1;return a._update(),a},h.prototype.exclude=function(r){var a=this._create();return a._excluded[r]=!0,a._update(),a},h.prototype.read=function(){var r="";this._match_pattern?r=this._input.read(this._starting_pattern):r=this._input.read(this._starting_pattern,this.__template_pattern);for(var a=this._read_template();a;)this._match_pattern?a+=this._input.read(this._match_pattern):a+=this._input.readUntil(this.__template_pattern),r+=a,a=this._read_template();return this._until_after&&(r+=this._input.readUntilAfter(this._until_pattern)),r},h.prototype.__set_templated_pattern=function(){var r=[];this._disabled.php||r.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||r.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||r.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(r.push(this.__patterns.django._starting_pattern.source),r.push(this.__patterns.django_value._starting_pattern.source),r.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||r.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&r.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+r.join("|")+")")},h.prototype._read_template=function(){var r="",a=this._input.peek();if(a==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(r=r||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(r=r||this.__patterns.erb.read())}else a==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(r=r||this.__patterns.handlebars_comment.read(),r=r||this.__patterns.handlebars_unescaped.read(),r=r||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(r=r||this.__patterns.django_value.read()),this._excluded.django||(r=r||this.__patterns.django_comment.read(),r=r||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(r=r||this.__patterns.smarty_comment.read(),r=r||this.__patterns.smarty_literal.read(),r=r||this.__patterns.smarty.read()));return r},p.exports.TemplatablePattern=h},,,,function(p,m,d){var u=d(19).Beautifier,o=d(20).Options;function h(r,a,i,s){var S=new u(r,a,i,s);return S.beautify()}p.exports=h,p.exports.defaultOptions=function(){return new o}},function(p,m,d){var u=d(20).Options,o=d(2).Output,h=d(21).Tokenizer,r=d(21).TOKEN,a=/\r\n|[\r\n]/,i=/\r\n|[\r\n]/g,s=function(C,E){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=C.max_preserve_newlines,this.preserve_newlines=C.preserve_newlines,this._output=new o(C,E)};s.prototype.current_line_has_match=function(C){return this._output.current_line.has_match(C)},s.prototype.set_space_before_token=function(C,E){this._output.space_before_token=C,this._output.non_breaking_space=E},s.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},s.prototype.add_raw_token=function(C){this._output.add_raw_token(C)},s.prototype.print_preserved_newlines=function(C){var E=0;C.type!==r.TEXT&&C.previous.type!==r.TEXT&&(E=C.newlines?1:0),this.preserve_newlines&&(E=C.newlines<this.max_preserve_newlines+1?C.newlines:this.max_preserve_newlines+1);for(var _=0;_<E;_++)this.print_newline(_>0);return E!==0},s.prototype.traverse_whitespace=function(C){return C.whitespace_before||C.newlines?(this.print_preserved_newlines(C)||(this._output.space_before_token=!0),!0):!1},s.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},s.prototype.print_newline=function(C){this._output.add_new_line(C)},s.prototype.print_token=function(C){C.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(C.text))},s.prototype.indent=function(){this.indent_level++},s.prototype.get_full_indent=function(C){return C=this.indent_level+(C||0),C<1?"":this._output.get_indent_string(C)};var S=function(C){for(var E=null,_=C.next;_.type!==r.EOF&&C.closed!==_;){if(_.type===r.ATTRIBUTE&&_.text==="type"){_.next&&_.next.type===r.EQUALS&&_.next.next&&_.next.next.type===r.VALUE&&(E=_.next.next.text);break}_=_.next}return E},x=function(C,E){var _=null,U=null;return E.closed?(C==="script"?_="text/javascript":C==="style"&&(_="text/css"),_=S(E)||_,_.search("text/css")>-1?U="css":_.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?U="javascript":_.search(/(text|application|dojo)\/(x-)?(html)/)>-1?U="html":_.search(/test\/null/)>-1&&(U="null"),U):null};function T(C,E){return E.indexOf(C)!==-1}function A(C,E,_){this.parent=C||null,this.tag=E?E.tag_name:"",this.indent_level=_||0,this.parser_token=E||null}function w(C){this._printer=C,this._current_frame=null}w.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},w.prototype.record_tag=function(C){var E=new A(this._current_frame,C,this._printer.indent_level);this._current_frame=E},w.prototype._try_pop_frame=function(C){var E=null;return C&&(E=C.parser_token,this._printer.indent_level=C.indent_level,this._current_frame=C.parent),E},w.prototype._get_frame=function(C,E){for(var _=this._current_frame;_&&!(C.indexOf(_.tag)!==-1);){if(E&&E.indexOf(_.tag)!==-1){_=null;break}_=_.parent}return _},w.prototype.try_pop=function(C,E){var _=this._get_frame([C],E);return this._try_pop_frame(_)},w.prototype.indent_to_tag=function(C){var E=this._get_frame(C);E&&(this._printer.indent_level=E.indent_level)};function v(C,E,_,U){this._source_text=C||"",E=E||{},this._js_beautify=_,this._css_beautify=U,this._tag_stack=null;var j=new u(E,"html");this._options=j,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"}v.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var C=this._source_text,E=this._options.eol;this._options.eol==="auto"&&(E=`
|
|
`,C&&a.test(C)&&(E=C.match(a)[0])),C=C.replace(i,`
|
|
`);var _=C.match(/^[\t ]*/)[0],U={text:"",type:""},j=new b,L=new s(this._options,_),G=new h(C,this._options).tokenize();this._tag_stack=new w(L);for(var B=null,O=G.next();O.type!==r.EOF;)O.type===r.TAG_OPEN||O.type===r.COMMENT?(B=this._handle_tag_open(L,O,j,U),j=B):O.type===r.ATTRIBUTE||O.type===r.EQUALS||O.type===r.VALUE||O.type===r.TEXT&&!j.tag_complete?B=this._handle_inside_tag(L,O,j,G):O.type===r.TAG_CLOSE?B=this._handle_tag_close(L,O,j):O.type===r.TEXT?B=this._handle_text(L,O,j):L.add_raw_token(O),U=B,O=G.next();var V=L._output.get_code(E);return V},v.prototype._handle_tag_close=function(C,E,_){var U={text:E.text,type:E.type};return C.alignment_size=0,_.tag_complete=!0,C.set_space_before_token(E.newlines||E.whitespace_before!=="",!0),_.is_unformatted?C.add_raw_token(E):(_.tag_start_char==="<"&&(C.set_space_before_token(E.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&_.has_wrapped_attrs&&C.print_newline(!1)),C.print_token(E)),_.indent_content&&!(_.is_unformatted||_.is_content_unformatted)&&(C.indent(),_.indent_content=!1),!_.is_inline_element&&!(_.is_unformatted||_.is_content_unformatted)&&C.set_wrap_point(),U},v.prototype._handle_inside_tag=function(C,E,_,U){var j=_.has_wrapped_attrs,L={text:E.text,type:E.type};if(C.set_space_before_token(E.newlines||E.whitespace_before!=="",!0),_.is_unformatted)C.add_raw_token(E);else if(_.tag_start_char==="{"&&E.type===r.TEXT)C.print_preserved_newlines(E)?(E.newlines=0,C.add_raw_token(E)):C.print_token(E);else{if(E.type===r.ATTRIBUTE?(C.set_space_before_token(!0),_.attr_count+=1):(E.type===r.EQUALS||E.type===r.VALUE&&E.previous.type===r.EQUALS)&&C.set_space_before_token(!1),E.type===r.ATTRIBUTE&&_.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(C.traverse_whitespace(E),j=j||E.newlines!==0),this._is_wrap_attributes_force)){var G=_.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&_.attr_count===1){var B=!0,O=0,V;do{if(V=U.peek(O),V.type===r.ATTRIBUTE){B=!1;break}O+=1}while(O<4&&V.type!==r.EOF&&V.type!==r.TAG_CLOSE);G=!B}G&&(C.print_newline(!1),j=!0)}C.print_token(E),j=j||C.previous_token_wrapped(),_.has_wrapped_attrs=j}return L},v.prototype._handle_text=function(C,E,_){var U={text:E.text,type:"TK_CONTENT"};return _.custom_beautifier_name?this._print_custom_beatifier_text(C,E,_):_.is_unformatted||_.is_content_unformatted?C.add_raw_token(E):(C.traverse_whitespace(E),C.print_token(E)),U},v.prototype._print_custom_beatifier_text=function(C,E,_){var U=this;if(E.text!==""){var j=E.text,L,G=1,B="",O="";_.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?L=this._js_beautify:_.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?L=this._css_beautify:_.custom_beautifier_name==="html"&&(L=function(Oe,Ce){var je=new v(Oe,Ce,U._js_beautify,U._css_beautify);return je.beautify()}),this._options.indent_scripts==="keep"?G=0:this._options.indent_scripts==="separate"&&(G=-C.indent_level);var V=C.get_full_indent(G);if(j=j.replace(/\n[ \t]*$/,""),_.custom_beautifier_name!=="html"&&j[0]==="<"&&j.match(/^(<!--|<!\[CDATA\[)/)){var te=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(j);if(!te){C.add_raw_token(E);return}B=V+te[1]+`
|
|
`,j=te[4],te[5]&&(O=V+te[5]),j=j.replace(/\n[ \t]*$/,""),(te[2]||te[3].indexOf(`
|
|
`)!==-1)&&(te=te[3].match(/[ \t]+$/),te&&(E.whitespace_before=te[0]))}if(j)if(L){var re=function(){this.eol=`
|
|
`};re.prototype=this._options.raw_options;var ge=new re;j=L(V+j,ge)}else{var Ae=E.whitespace_before;Ae&&(j=j.replace(new RegExp(`
|
|
(`+Ae+")?","g"),`
|
|
`)),j=V+j.replace(/\n/g,`
|
|
`+V)}B&&(j?j=B+j+`
|
|
`+O:j=B+O),C.print_newline(!1),j&&(E.text=j,E.whitespace_before="",E.newlines=0,C.add_raw_token(E),C.print_newline(!0))}},v.prototype._handle_tag_open=function(C,E,_,U){var j=this._get_tag_open_token(E);return(_.is_unformatted||_.is_content_unformatted)&&!_.is_empty_element&&E.type===r.TAG_OPEN&&E.text.indexOf("</")===0?(C.add_raw_token(E),j.start_tag_token=this._tag_stack.try_pop(j.tag_name)):(C.traverse_whitespace(E),this._set_tag_position(C,E,j,_,U),j.is_inline_element||C.set_wrap_point(),C.print_token(E)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(j.alignment_size=E.text.length+1),!j.tag_complete&&!j.is_unformatted&&(C.alignment_size=j.alignment_size),j};var b=function(C,E){if(this.parent=C||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="",!E)this.tag_complete=!0;else{var _;this.tag_start_char=E.text[0],this.text=E.text,this.tag_start_char==="<"?(_=E.text.match(/^<([^\s>]*)/),this.tag_check=_?_[1]:""):(_=E.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=_?_[1]:"",(E.text.startsWith("{{#>")||E.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&E.next!==null?this.tag_check=E.next.text.split(" ")[0]:this.tag_check=E.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),E.type===r.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||E.closed&&E.closed.text==="/>";var U=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(U=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(U)))}};v.prototype._get_tag_open_token=function(C){var E=new b(this._tag_stack.get_parser_token(),C);return E.alignment_size=this._options.wrap_attributes_indent_size,E.is_end_tag=E.is_end_tag||T(E.tag_check,this._options.void_elements),E.is_empty_element=E.tag_complete||E.is_start_tag&&E.is_end_tag,E.is_unformatted=!E.tag_complete&&T(E.tag_check,this._options.unformatted),E.is_content_unformatted=!E.is_empty_element&&T(E.tag_check,this._options.content_unformatted),E.is_inline_element=T(E.tag_name,this._options.inline)||E.tag_name.includes("-")||E.tag_start_char==="{",E},v.prototype._set_tag_position=function(C,E,_,U,j){if(_.is_empty_element||(_.is_end_tag?_.start_tag_token=this._tag_stack.try_pop(_.tag_name):(this._do_optional_end_element(_)&&(_.is_inline_element||C.print_newline(!1)),this._tag_stack.record_tag(_),(_.tag_name==="script"||_.tag_name==="style")&&!(_.is_unformatted||_.is_content_unformatted)&&(_.custom_beautifier_name=x(_.tag_check,E)))),T(_.tag_check,this._options.extra_liners)&&(C.print_newline(!1),C._output.just_added_blankline()||C.print_newline(!0)),_.is_empty_element){if(_.tag_start_char==="{"&&_.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),_.indent_content=!0;var L=C.current_line_has_match(/{{#if/);L||C.print_newline(!1)}_.tag_name==="!--"&&j.type===r.TAG_CLOSE&&U.is_end_tag&&_.text.indexOf(`
|
|
`)===-1||(_.is_inline_element||_.is_unformatted||C.print_newline(!1),this._calcluate_parent_multiline(C,_))}else if(_.is_end_tag){var G=!1;G=_.start_tag_token&&_.start_tag_token.multiline_content,G=G||!_.is_inline_element&&!(U.is_inline_element||U.is_unformatted)&&!(j.type===r.TAG_CLOSE&&_.start_tag_token===U)&&j.type!=="TK_CONTENT",(_.is_content_unformatted||_.is_unformatted)&&(G=!1),G&&C.print_newline(!1)}else _.indent_content=!_.custom_beautifier_name,_.tag_start_char==="<"&&(_.tag_name==="html"?_.indent_content=this._options.indent_inner_html:_.tag_name==="head"?_.indent_content=this._options.indent_head_inner_html:_.tag_name==="body"&&(_.indent_content=this._options.indent_body_inner_html)),!(_.is_inline_element||_.is_unformatted)&&(j.type!=="TK_CONTENT"||_.is_content_unformatted)&&C.print_newline(!1),this._calcluate_parent_multiline(C,_)},v.prototype._calcluate_parent_multiline=function(C,E){E.parent&&C._output.just_added_newline()&&!((E.is_inline_element||E.is_unformatted)&&E.parent.is_inline_element)&&(E.parent.multiline_content=!0)};var g=["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"];v.prototype._do_optional_end_element=function(C){var E=null;if(C.is_empty_element||!C.is_start_tag||!C.parent)return;if(C.tag_name==="body")E=E||this._tag_stack.try_pop("head");else if(C.tag_name==="li")E=E||this._tag_stack.try_pop("li",["ol","ul"]);else if(C.tag_name==="dd"||C.tag_name==="dt")E=E||this._tag_stack.try_pop("dt",["dl"]),E=E||this._tag_stack.try_pop("dd",["dl"]);else if(C.parent.tag_name==="p"&&g.indexOf(C.tag_name)!==-1){var _=C.parent.parent;(!_||f.indexOf(_.tag_name)===-1)&&(E=E||this._tag_stack.try_pop("p"))}else C.tag_name==="rp"||C.tag_name==="rt"?(E=E||this._tag_stack.try_pop("rt",["ruby","rtc"]),E=E||this._tag_stack.try_pop("rp",["ruby","rtc"])):C.tag_name==="optgroup"?E=E||this._tag_stack.try_pop("optgroup",["select"]):C.tag_name==="option"?E=E||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):C.tag_name==="colgroup"?E=E||this._tag_stack.try_pop("caption",["table"]):C.tag_name==="thead"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"])):C.tag_name==="tbody"||C.tag_name==="tfoot"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"]),E=E||this._tag_stack.try_pop("thead",["table"]),E=E||this._tag_stack.try_pop("tbody",["table"])):C.tag_name==="tr"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"]),E=E||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(C.tag_name==="th"||C.tag_name==="td")&&(E=E||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),E=E||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return C.parent=this._tag_stack.get_parser_token(),E},p.exports.Beautifier=v},function(p,m,d){var u=d(6).Options;function o(h){u.call(this,h,"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"])}o.prototype=new u,p.exports.Options=o},function(p,m,d){var u=d(9).Tokenizer,o=d(9).TOKEN,h=d(13).Directives,r=d(14).TemplatablePattern,a=d(12).Pattern,i={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:o.START,RAW:o.RAW,EOF:o.EOF},s=new h(/<\!--/,/-->/),S=function(x,T){u.call(this,x,T),this._current_tag_name="";var A=new r(this._input).read_options(this._options),w=new a(this._input);if(this.__patterns={word:A.until(/[\n\r\t <]/),single_quote:A.until_after(/'/),double_quote:A.until_after(/"/),attribute:A.until(/[\n\r\t =>]|\/>/),element_name:A.until(/[\n\r\t >\/]/),handlebars_comment:w.starting_with(/{{!--/).until_after(/--}}/),handlebars:w.starting_with(/{{/).until_after(/}}/),handlebars_open:w.until(/[\n\r\t }]/),handlebars_raw_close:w.until(/}}/),comment:w.starting_with(/<!--/).until_after(/-->/),cdata:w.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:w.starting_with(/<!\[/).until_after(/]>/),processing:w.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 v=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=w.matching(v).until_after(v)}};S.prototype=new u,S.prototype._is_comment=function(x){return!1},S.prototype._is_opening=function(x){return x.type===i.TAG_OPEN},S.prototype._is_closing=function(x,T){return x.type===i.TAG_CLOSE&&T&&((x.text===">"||x.text==="/>")&&T.text[0]==="<"||x.text==="}}"&&T.text[0]==="{"&&T.text[1]==="{")},S.prototype._reset=function(){this._current_tag_name=""},S.prototype._get_next_token=function(x,T){var A=null;this._readWhitespace();var w=this._input.peek();return w===null?this._create_token(i.EOF,""):(A=A||this._read_open_handlebars(w,T),A=A||this._read_attribute(w,x,T),A=A||this._read_close(w,T),A=A||this._read_raw_content(w,x,T),A=A||this._read_content_word(w),A=A||this._read_comment_or_cdata(w),A=A||this._read_processing(w),A=A||this._read_open(w,T),A=A||this._create_token(i.UNKNOWN,this._input.next()),A)},S.prototype._read_comment_or_cdata=function(x){var T=null,A=null,w=null;if(x==="<"){var v=this._input.peek(1);v==="!"&&(A=this.__patterns.comment.read(),A?(w=s.get_directives(A),w&&w.ignore==="start"&&(A+=s.readIgnored(this._input))):A=this.__patterns.cdata.read()),A&&(T=this._create_token(i.COMMENT,A),T.directives=w)}return T},S.prototype._read_processing=function(x){var T=null,A=null,w=null;if(x==="<"){var v=this._input.peek(1);(v==="!"||v==="?")&&(A=this.__patterns.conditional_comment.read(),A=A||this.__patterns.processing.read()),A&&(T=this._create_token(i.COMMENT,A),T.directives=w)}return T},S.prototype._read_open=function(x,T){var A=null,w=null;return T||x==="<"&&(A=this._input.next(),this._input.peek()==="/"&&(A+=this._input.next()),A+=this.__patterns.element_name.read(),w=this._create_token(i.TAG_OPEN,A)),w},S.prototype._read_open_handlebars=function(x,T){var A=null,w=null;return T||this._options.indent_handlebars&&x==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(A=this.__patterns.handlebars_comment.read(),A=A||this.__patterns.handlebars.read(),w=this._create_token(i.COMMENT,A)):(A=this.__patterns.handlebars_open.read(),w=this._create_token(i.TAG_OPEN,A))),w},S.prototype._read_close=function(x,T){var A=null,w=null;return T&&(T.text[0]==="<"&&(x===">"||x==="/"&&this._input.peek(1)===">")?(A=this._input.next(),x==="/"&&(A+=this._input.next()),w=this._create_token(i.TAG_CLOSE,A)):T.text[0]==="{"&&x==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),w=this._create_token(i.TAG_CLOSE,"}}"))),w},S.prototype._read_attribute=function(x,T,A){var w=null,v="";if(A&&A.text[0]==="<")if(x==="=")w=this._create_token(i.EQUALS,this._input.next());else if(x==='"'||x==="'"){var b=this._input.next();x==='"'?b+=this.__patterns.double_quote.read():b+=this.__patterns.single_quote.read(),w=this._create_token(i.VALUE,b)}else v=this.__patterns.attribute.read(),v&&(T.type===i.EQUALS?w=this._create_token(i.VALUE,v):w=this._create_token(i.ATTRIBUTE,v));return w},S.prototype._is_content_unformatted=function(x){return this._options.void_elements.indexOf(x)===-1&&(this._options.content_unformatted.indexOf(x)!==-1||this._options.unformatted.indexOf(x)!==-1)},S.prototype._read_raw_content=function(x,T,A){var w="";if(A&&A.text[0]==="{")w=this.__patterns.handlebars_raw_close.read();else if(T.type===i.TAG_CLOSE&&T.opened.text[0]==="<"&&T.text[0]!=="/"){var v=T.opened.text.substr(1).toLowerCase();if(v==="script"||v==="style"){var b=this._read_comment_or_cdata(x);if(b)return b.type=i.TEXT,b;w=this._input.readUntil(new RegExp("</"+v+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(v)&&(w=this._input.readUntil(new RegExp("</"+v+"[\\n\\r\\t ]*?>","ig")))}return w?this._create_token(i.TEXT,w):null},S.prototype._read_content_word=function(x){var T="";if(this._options.unformatted_content_delimiter&&(x===this._options.unformatted_content_delimiter[0]&&(T=this.__patterns.unformatted_content_delimiter.read())),T||(T=this.__patterns.word.read()),T)return this._create_token(i.TEXT,T)},p.exports.Tokenizer=S,p.exports.TOKEN=i}],N={};function n(p){var m=N[p];if(m!==void 0)return m.exports;var d=N[p]={exports:{}};return H[p](d,d.exports,n),d.exports}var P=n(18);M=P})();var X=M;if(!0)!(Q=[D,D("6UM0"),D("TXwP")],z=function(H){var N=D("6UM0"),n=D("TXwP");return{html_beautify:function(P,p){return X(P,p,N.js_beautify,n.css_beautify)}}}.apply(le,Q),z!==void 0&&(Be.exports=z));else var F,I})()},"rAM+":function(Be,le,D){"use strict";D.d(le,"a",function(){return z});var Q=D("Qw5x");function z(M,X){var F;if(typeof Symbol=="undefined"||M[Symbol.iterator]==null){if(Array.isArray(M)||(F=Object(Q.a)(M))||X&&M&&typeof M.length=="number"){F&&(M=F);var I=0,H=function(){};return{s:H,n:function(){return I>=M.length?{done:!0}:{done:!1,value:M[I++]}},e:function(m){throw m},f:H}}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 N=!0,n=!1,P;return{s:function(){F=M[Symbol.iterator]()},n:function(){var m=F.next();return N=m.done,m},e:function(m){n=!0,P=m},f:function(){try{!N&&F.return!=null&&F.return()}finally{if(n)throw P}}}}},rHrb:function(Be,le,D){"use strict";Object.defineProperty(le,"__esModule",{value:!0}),le.CopyToClipboard=void 0;var Q=M(D("q1tI")),z=M(D("+QRC"));function M(i){return i&&i.__esModule?i:{default:i}}function X(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?X=function(S){return typeof S}:X=function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},X(i)}function F(i,s){var S=Object.keys(i);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(i);s&&(x=x.filter(function(T){return Object.getOwnPropertyDescriptor(i,T).enumerable})),S.push.apply(S,x)}return S}function I(i){for(var s=1;s<arguments.length;s++){var S=arguments[s]!=null?arguments[s]:{};s%2?F(S,!0).forEach(function(x){r(i,x,S[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(S)):F(S).forEach(function(x){Object.defineProperty(i,x,Object.getOwnPropertyDescriptor(S,x))})}return i}function H(i,s){if(i==null)return{};var S=N(i,s),x,T;if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(i);for(T=0;T<A.length;T++){if(x=A[T],s.indexOf(x)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(i,x))continue;S[x]=i[x]}}return S}function N(i,s){if(i==null)return{};var S={},x=Object.keys(i),T,A;for(A=0;A<x.length;A++){if(T=x[A],s.indexOf(T)>=0)continue;S[T]=i[T]}return S}function n(i,s){if(!(i instanceof s))throw new TypeError("Cannot call a class as a function")}function P(i,s){for(var S=0;S<s.length;S++){var x=s[S];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(i,x.key,x)}}function p(i,s,S){return s&&P(i.prototype,s),S&&P(i,S),i}function m(i,s){return s&&(X(s)==="object"||typeof s=="function")?s:u(i)}function d(i){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(S){return S.__proto__||Object.getPrototypeOf(S)},d(i)}function u(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function o(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),s&&h(i,s)}function h(i,s){return h=Object.setPrototypeOf||function(x,T){return x.__proto__=T,x},h(i,s)}function r(i,s,S){return s in i?Object.defineProperty(i,s,{value:S,enumerable:!0,configurable:!0,writable:!0}):i[s]=S,i}var a=function(i){o(s,i);function s(){var S,x;n(this,s);for(var T=arguments.length,A=new Array(T),w=0;w<T;w++)A[w]=arguments[w];return x=m(this,(S=d(s)).call.apply(S,[this].concat(A))),r(u(x),"onClick",function(v){var b=x.props,g=b.text,f=b.onCopy,C=b.children,E=b.options,_=Q.default.Children.only(C),U=(0,z.default)(g,E);f&&f(g,U),_&&_.props&&typeof _.props.onClick=="function"&&_.props.onClick(v)}),x}return p(s,[{key:"render",value:function(){var x=this.props,T=x.text,A=x.onCopy,w=x.options,v=x.children,b=H(x,["text","onCopy","options","children"]),g=Q.default.Children.only(v);return Q.default.cloneElement(g,I({},b,{onClick:this.onClick}))}}]),s}(Q.default.PureComponent);le.CopyToClipboard=a,r(a,"defaultProps",{onCopy:void 0,options:void 0})},rUJ1:function(Be,le){const D=/[&<>"']/,Q=/[&<>"']/g,z=/[<>"']|&(?!#?\w+;)/,M=/[<>"']|&(?!#?\w+;)/g,X={"&":"&","<":"<",">":">",'"':""","'":"'"},F=w=>X[w];function I(w,v){if(v){if(D.test(w))return w.replace(Q,F)}else if(z.test(w))return w.replace(M,F);return w}const H=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function N(w){return w.replace(H,(v,b)=>(b=b.toLowerCase(),b==="colon"?":":b.charAt(0)==="#"?b.charAt(1)==="x"?String.fromCharCode(parseInt(b.substring(2),16)):String.fromCharCode(+b.substring(1)):""))}const n=/(^|[^\[])\^/g;function P(w,v){w=w.source||w,v=v||"";const b={replace:(g,f)=>(f=f.source||f,f=f.replace(n,"$1"),w=w.replace(g,f),b),getRegex:()=>new RegExp(w,v)};return b}const p=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function d(w,v,b){if(w){let g;try{g=decodeURIComponent(N(b)).replace(p,"").toLowerCase()}catch(f){return null}if(g.indexOf("javascript:")===0||g.indexOf("vbscript:")===0||g.indexOf("data:")===0)return null}v&&!m.test(b)&&(b=a(v,b));try{b=encodeURI(b).replace(/%25/g,"%")}catch(g){return null}return b}const u={},o=/^[^:]+:\/*[^/]*$/,h=/^([^:]+:)[\s\S]*$/,r=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(w,v){u[" "+w]||(o.test(w)?u[" "+w]=w+"/":u[" "+w]=x(w,"/",!0)),w=u[" "+w];const b=w.indexOf(":")===-1;return v.substring(0,2)==="//"?b?v:w.replace(h,"$1")+v:v.charAt(0)==="/"?b?v:w.replace(r,"$1")+v:w+v}const i={exec:function(){}};function s(w){let v=1,b,g;for(;v<arguments.length;v++){b=arguments[v];for(g in b)Object.prototype.hasOwnProperty.call(b,g)&&(w[g]=b[g])}return w}function S(w,v){const b=w.replace(/\|/g,(C,E,_)=>{let U=!1,j=E;for(;--j>=0&&_[j]==="\\";)U=!U;return U?"|":" |"}),g=b.split(/ \|/);let f=0;if(g.length>v)g.splice(v);else for(;g.length<v;)g.push("");for(;f<g.length;f++)g[f]=g[f].trim().replace(/\\\|/g,"|");return g}function x(w,v,b){const g=w.length;if(g===0)return"";let f=0;for(;f<g;){const C=w.charAt(g-f-1);if(C===v&&!b)f++;else if(C!==v&&b)f++;else break}return w.substr(0,g-f)}function T(w,v){if(w.indexOf(v[1])===-1)return-1;const b=w.length;let g=0,f=0;for(;f<b;f++)if(w[f]==="\\")f++;else if(w[f]===v[0])g++;else if(w[f]===v[1]&&(g--,g<0))return f;return-1}function A(w){w&&w.sanitize&&!w.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")}Be.exports={escape:I,unescape:N,edit:P,cleanUrl:d,resolveUrl:a,noopTest:i,merge:s,splitCells:S,rtrim:x,findClosingBracket:T,checkSanitizeDeprecation:A}},rdUC:function(Be,le,D){var Q=D("MFOe"),z=Q.Global;Be.exports={name:"localStorage",read:X,write:F,each:I,remove:H,clearAll:N};function M(){return z.localStorage}function X(n){return M().getItem(n)}function F(n,P){return M().setItem(n,P)}function I(n){for(var P=M().length-1;P>=0;P--){var p=M().key(P);n(X(p),p)}}function H(n){return M().removeItem(n)}function N(){return M().clear()}},"s8/Y":function(Be,le,D){Be.exports=D.p+"static/jx.e464a4ed.svg"},"sB/4":function(Be,le,D){Be.exports=D.p+"static/b.419f1a2b.svg"},sNtx:function(Be,le,D){},sR1s:function(Be,le,D){"use strict";D.d(le,"b",function(){return X}),D.d(le,"a",function(){return F}),D.d(le,"c",function(){return I}),D.d(le,"d",function(){return H});var Q=D("U8pU"),z="RC_TABLE_KEY";function M(N){return N==null?[]:Array.isArray(N)?N:[N]}function X(N,n){if(!n&&typeof n!="number")return N;for(var P=M(n),p=N,m=0;m<P.length;m+=1){if(!p)return null;var d=P[m];p=p[d]}return p}function F(N){var n=[],P={};return N.forEach(function(p){for(var m=p||{},d=m.key,u=m.dataIndex,o=d||M(u).join("-")||z;P[o];)o="".concat(o,"_next");P[o]=!0,n.push(o)}),n}function I(){var N={};function n(d,u){u&&Object.keys(u).forEach(function(o){var h=u[o];h&&Object(Q.a)(h)==="object"?(d[o]=d[o]||{},n(d[o],h)):d[o]=h})}for(var P=arguments.length,p=new Array(P),m=0;m<P;m++)p[m]=arguments[m];return p.forEach(function(d){n(N,d)}),N}function H(N){return N!=null}},sboe:function(Be,le,D){"use strict";D.d(le,"a",function(){return M});var Q=D("q1tI"),z=D.n(Q),M=Q.createContext(null)},"t/PP":function(Be,le,D){Be.exports=D.p+"static/title.b0fa77f7.svg"},t23M:function(Be,le,D){"use strict";var Q=D("VTBJ"),z=D("1OyB"),M=D("vuIU"),X=D("Ji7U"),F=D("LK+K"),I=D("q1tI"),H=D.n(I),N=D("m+aA"),n=D("Zm9Q"),P=D("Kwbf"),p=D("c+Xe"),m=D("bdgK"),d="rc-observer-key",u=function(o){Object(X.a)(r,o);var h=Object(F.a)(r);function r(){var a;return Object(z.a)(this,r),a=h.apply(this,arguments),a.resizeObserver=null,a.childNode=null,a.currentElement=null,a.state={width:0,height:0,offsetHeight:0,offsetWidth:0},a.onResize=function(i){var s=a.props.onResize,S=i[0].target,x=S.getBoundingClientRect(),T=x.width,A=x.height,w=S.offsetWidth,v=S.offsetHeight,b=Math.floor(T),g=Math.floor(A);if(a.state.width!==b||a.state.height!==g||a.state.offsetWidth!==w||a.state.offsetHeight!==v){var f={width:b,height:g,offsetWidth:w,offsetHeight:v};a.setState(f),s&&Promise.resolve().then(function(){s(Object(Q.a)(Object(Q.a)({},f),{},{offsetWidth:w,offsetHeight:v}))})}},a.setChildNode=function(i){a.childNode=i},a}return Object(M.a)(r,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var i=this.props.disabled;if(i){this.destroyObserver();return}var s=Object(N.a)(this.childNode||this),S=s!==this.currentElement;S&&(this.destroyObserver(),this.currentElement=s),!this.resizeObserver&&s&&(this.resizeObserver=new m.default(this.onResize),this.resizeObserver.observe(s))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var i=this.props.children,s=Object(n.a)(i);if(s.length>1)Object(P.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(s.length===0)return Object(P.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var S=s[0];if(I.isValidElement(S)&&Object(p.c)(S)){var x=S.ref;s[0]=I.cloneElement(S,{ref:Object(p.a)(x,this.setChildNode)})}return s.length===1?s[0]:s.map(function(T,A){return!I.isValidElement(T)||"key"in T&&T.key!==null?T:I.cloneElement(T,{key:"".concat(d,"-").concat(A)})})}}]),r}(I.Component);u.displayName="ResizeObserver",le.a=u},t9D7:function(Be,le,D){"use strict";D.d(le,"b",function(){return H}),D.d(le,"g",function(){return n}),D.d(le,"d",function(){return P}),D.d(le,"e",function(){return p}),D.d(le,"a",function(){return m}),D.d(le,"f",function(){return o}),D.d(le,"c",function(){return h});var Q=D("Vhoy"),z=D("MI8n"),M=D("pmY6"),X=D("Cg/j"),F=D("ic2d"),I=D("nEHx");const H=Object(X.c)("themeService");var N;(function(r){function a(i){return i&&typeof i=="object"&&typeof i.id=="string"}r.isThemeColor=a})(N||(N={}));function n(r){return{id:r}}var P;(function(r){function a(A){return A&&typeof A=="object"&&typeof A.id=="string"&&(typeof A.color=="undefined"||N.isThemeColor(A.color))}r.isThemeIcon=a;const i=new RegExp(`^\\$\\((${Q.a.iconNameExpression}(?:${Q.a.iconModifierExpression})?)\\)$`);function s(A){const w=i.exec(A);if(!w)return;let[,v]=w;return{id:v}}r.fromString=s;function S(A,w){let v=A.id;const b=v.lastIndexOf("~");return b!==-1&&(v=v.substring(0,b)),w&&(v=`${v}~${w}`),{id:v}}r.modify=S;function x(A,w){var v,b;return A.id===w.id&&((v=A.color)===null||v===void 0?void 0:v.id)===((b=w.color)===null||b===void 0?void 0:b.id)}r.isEqual=x;function T(A,w){return{id:A.id,color:w?n(w):void 0}}r.asThemeIcon=T,r.asClassNameArray=Q.a.asClassNameArray,r.asClassName=Q.a.asClassName,r.asCSSSelector=Q.a.asCSSSelector})(P||(P={}));function p(r){switch(r){case I.a.DARK:return"vs-dark";case I.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const m={ThemingContribution:"base.contributions.theming"};class d{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new z.b}onColorThemeChange(r){return this.themingParticipants.push(r),this.onThemingParticipantAddedEmitter.fire(r),Object(M.i)(()=>{const a=this.themingParticipants.indexOf(r);this.themingParticipants.splice(a,1)})}getThemingParticipants(){return this.themingParticipants}}let u=new d;F.a.add(m.ThemingContribution,u);function o(r){return u.onColorThemeChange(r)}class h extends M.a{constructor(r){super();this.themeService=r,this.theme=r.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(a=>this.onThemeChange(a)))}onThemeChange(r){this.theme=r,this.updateStyles()}updateStyles(){}}},twBr:function(Be,le,D){Be.exports=D.p+"static/s.b06c61c8.svg"},uMZB:function(Be,le,D){Be.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(Be,le,D){Be.exports=Q;function Q(){return D("gaXo"),{}}},ulZh:function(Be,le,D){typeof window!="undefined"&&function(z,M){Be.exports=M()}(this,function(){return function(Q){var z={};function M(X){if(z[X])return z[X].exports;var F=z[X]={i:X,l:!1,exports:{}};return Q[X].call(F.exports,F,F.exports,M),F.l=!0,F.exports}return M.m=Q,M.c=z,M.d=function(X,F,I){M.o(X,F)||Object.defineProperty(X,F,{enumerable:!0,get:I})},M.r=function(X){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(X,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(X,"__esModule",{value:!0})},M.t=function(X,F){if(F&1&&(X=M(X)),F&8)return X;if(F&4&&typeof X=="object"&&X&&X.__esModule)return X;var I=Object.create(null);if(M.r(I),Object.defineProperty(I,"default",{enumerable:!0,value:X}),F&2&&typeof X!="string")for(var H in X)M.d(I,H,function(N){return X[N]}.bind(null,H));return I},M.n=function(X){var F=X&&X.__esModule?function(){return X.default}:function(){return X};return M.d(F,"a",F),F},M.o=function(X,F){return Object.prototype.hasOwnProperty.call(X,F)},M.p="/dist/",M(M.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(Q,z,M){"use strict";var X=Object.prototype.hasOwnProperty,F="~";function I(){}Object.create&&(I.prototype=Object.create(null),new I().__proto__||(F=!1));function H(p,m,d){this.fn=p,this.context=m,this.once=d||!1}function N(p,m,d,u,o){if(typeof d!="function")throw new TypeError("The listener must be a function");var h=new H(d,u||p,o),r=F?F+m:m;return p._events[r]?p._events[r].fn?p._events[r]=[p._events[r],h]:p._events[r].push(h):(p._events[r]=h,p._eventsCount++),p}function n(p,m){--p._eventsCount===0?p._events=new I:delete p._events[m]}function P(){this._events=new I,this._eventsCount=0}P.prototype.eventNames=function(){var m=[],d,u;if(this._eventsCount===0)return m;for(u in d=this._events)X.call(d,u)&&m.push(F?u.slice(1):u);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(d)):m},P.prototype.listeners=function(m){var d=F?F+m:m,u=this._events[d];if(!u)return[];if(u.fn)return[u.fn];for(var o=0,h=u.length,r=new Array(h);o<h;o++)r[o]=u[o].fn;return r},P.prototype.listenerCount=function(m){var d=F?F+m:m,u=this._events[d];return u?u.fn?1:u.length:0},P.prototype.emit=function(m,d,u,o,h,r){var a=F?F+m:m;if(!this._events[a])return!1;var i=this._events[a],s=arguments.length,S,x;if(i.fn){i.once&&this.removeListener(m,i.fn,void 0,!0);switch(s){case 1:return i.fn.call(i.context),!0;case 2:return i.fn.call(i.context,d),!0;case 3:return i.fn.call(i.context,d,u),!0;case 4:return i.fn.call(i.context,d,u,o),!0;case 5:return i.fn.call(i.context,d,u,o,h),!0;case 6:return i.fn.call(i.context,d,u,o,h,r),!0}for(x=1,S=new Array(s-1);x<s;x++)S[x-1]=arguments[x];i.fn.apply(i.context,S)}else{var T=i.length,A;for(x=0;x<T;x++){i[x].once&&this.removeListener(m,i[x].fn,void 0,!0);switch(s){case 1:i[x].fn.call(i[x].context);break;case 2:i[x].fn.call(i[x].context,d);break;case 3:i[x].fn.call(i[x].context,d,u);break;case 4:i[x].fn.call(i[x].context,d,u,o);break;default:if(!S)for(A=1,S=new Array(s-1);A<s;A++)S[A-1]=arguments[A];i[x].fn.apply(i[x].context,S)}}}return!0},P.prototype.on=function(m,d,u){return N(this,m,d,u,!1)},P.prototype.once=function(m,d,u){return N(this,m,d,u,!0)},P.prototype.removeListener=function(m,d,u,o){var h=F?F+m:m;if(!this._events[h])return this;if(!d)return n(this,h),this;var r=this._events[h];if(r.fn)r.fn===d&&(!o||r.once)&&(!u||r.context===u)&&n(this,h);else{for(var a=0,i=[],s=r.length;a<s;a++)(r[a].fn!==d||o&&!r[a].once||u&&r[a].context!==u)&&i.push(r[a]);i.length?this._events[h]=i.length===1?i[0]:i:n(this,h)}return this},P.prototype.removeAllListeners=function(m){var d;return m?(d=F?F+m:m,this._events[d]&&n(this,d)):(this._events=new I,this._eventsCount=0),this},P.prototype.off=P.prototype.removeListener,P.prototype.addListener=P.prototype.on,P.prefixed=F,P.EventEmitter=P,Q.exports=P},"./node_modules/url-toolkit/src/url-toolkit.js":function(Q,z,M){(function(X){var F=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,I=/^([^\/?#]*)([^]*)$/,H=/(?:\/|^)\.(?=\/)/g,N=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,n={buildAbsoluteURL:function(P,p,m){if(m=m||{},P=P.trim(),p=p.trim(),!p){if(!m.alwaysNormalize)return P;var d=n.parseURL(P);if(!d)throw new Error("Error trying to parse base URL.");return d.path=n.normalizePath(d.path),n.buildURLFromParts(d)}var u=n.parseURL(p);if(!u)throw new Error("Error trying to parse relative URL.");if(u.scheme)return m.alwaysNormalize?(u.path=n.normalizePath(u.path),n.buildURLFromParts(u)):p;var o=n.parseURL(P);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&o.path[0]!=="/"){var h=I.exec(o.path);o.netLoc=h[1],o.path=h[2]}o.netLoc&&!o.path&&(o.path="/");var r={scheme:o.scheme,netLoc:u.netLoc,path:null,params:u.params,query:u.query,fragment:u.fragment};if(!u.netLoc&&(r.netLoc=o.netLoc,u.path[0]!=="/"))if(!u.path)r.path=o.path,u.params||(r.params=o.params,u.query||(r.query=o.query));else{var a=o.path,i=a.substring(0,a.lastIndexOf("/")+1)+u.path;r.path=n.normalizePath(i)}return r.path===null&&(r.path=m.alwaysNormalize?n.normalizePath(u.path):u.path),n.buildURLFromParts(r)},parseURL:function(P){var p=F.exec(P);return p?{scheme:p[1]||"",netLoc:p[2]||"",path:p[3]||"",params:p[4]||"",query:p[5]||"",fragment:p[6]||""}:null},normalizePath:function(P){for(P=P.split("").reverse().join("").replace(H,"");P.length!==(P=P.replace(N,"")).length;);return P.split("").reverse().join("")},buildURLFromParts:function(P){return P.scheme+P.netLoc+P.path+P.params+P.query+P.fragment}};Q.exports=n})(this)},"./node_modules/webworkify-webpack/index.js":function(Q,z,M){function X(m){var d={};function u(h){if(d[h])return d[h].exports;var r=d[h]={i:h,l:!1,exports:{}};return m[h].call(r.exports,r,r.exports,u),r.l=!0,r.exports}u.m=m,u.c=d,u.i=function(h){return h},u.d=function(h,r,a){u.o(h,r)||Object.defineProperty(h,r,{configurable:!1,enumerable:!0,get:a})},u.r=function(h){Object.defineProperty(h,"__esModule",{value:!0})},u.n=function(h){var r=h&&h.__esModule?function(){return h.default}:function(){return h};return u.d(r,"a",r),r},u.o=function(h,r){return Object.prototype.hasOwnProperty.call(h,r)},u.p="/",u.oe=function(h){throw console.error(h),h};var o=u(u.s=ENTRY_MODULE);return o.default||o}var F="[\\.|\\-|\\+|\\w|/|@]+",I="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+F+").*?\\)";function H(m){return(m+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function N(m){return!isNaN(1*m)}function n(m,d,u){var o={};o[u]=[];var h=d.toString(),r=h.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!r)return o;for(var a=r[1],i=new RegExp("(\\\\n|\\W)"+H(a)+I,"g"),s;s=i.exec(h);){if(s[3]==="dll-reference")continue;o[u].push(s[3])}for(i=new RegExp("\\("+H(a)+'\\("(dll-reference\\s('+F+'))"\\)\\)'+I,"g");s=i.exec(h);)m[s[2]]||(o[u].push(s[1]),m[s[2]]=M(s[1]).m),o[s[2]]=o[s[2]]||[],o[s[2]].push(s[4]);for(var S=Object.keys(o),x=0;x<S.length;x++)for(var T=0;T<o[S[x]].length;T++)N(o[S[x]][T])&&(o[S[x]][T]=1*o[S[x]][T]);return o}function P(m){var d=Object.keys(m);return d.reduce(function(u,o){return u||m[o].length>0},!1)}function p(m,d){for(var u={main:[d]},o={main:[]},h={main:{}};P(u);)for(var r=Object.keys(u),a=0;a<r.length;a++){var i=r[a],s=u[i],S=s.pop();if(h[i]=h[i]||{},h[i][S]||!m[i][S])continue;h[i][S]=!0,o[i]=o[i]||[],o[i].push(S);for(var x=n(m,m[i][S],i),T=Object.keys(x),A=0;A<T.length;A++)u[T[A]]=u[T[A]]||[],u[T[A]]=u[T[A]].concat(x[T[A]])}return o}Q.exports=function(m,d){d=d||{};var u={main:M.m},o=d.all?{main:Object.keys(u.main)}:p(u,m),h="";Object.keys(o).filter(function(S){return S!=="main"}).forEach(function(S){for(var x=0;o[S][x];)x++;o[S].push(x),u[S][x]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",h=h+"var "+S+" = ("+X.toString().replace("ENTRY_MODULE",JSON.stringify(x))+")({"+o[S].map(function(T){return""+JSON.stringify(T)+": "+u[S][T].toString()}).join(",")+`});
|
|
`}),h=h+"new (("+X.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+o.main.map(function(S){return""+JSON.stringify(S)+": "+u.main[S].toString()}).join(",")+"}))(self);";var r=new window.Blob([h],{type:"text/javascript"});if(d.bare)return r;var a=window.URL||window.webkitURL||window.mozURL||window.msURL,i=a.createObjectURL(r),s=new window.Worker(i);return s.objectURL=i,s}},"./src/config.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"hlsDefaultConfig",function(){return A}),M.d(z,"mergeConfig",function(){return v}),M.d(z,"enableStreamingMode",function(){return b});var X=M("./src/controller/abr-controller.ts"),F=M("./src/controller/audio-stream-controller.ts"),I=M("./src/controller/audio-track-controller.ts"),H=M("./src/controller/subtitle-stream-controller.ts"),N=M("./src/controller/subtitle-track-controller.ts"),n=M("./src/controller/buffer-controller.ts"),P=M("./src/controller/timeline-controller.ts"),p=M("./src/controller/cap-level-controller.ts"),m=M("./src/controller/fps-controller.ts"),d=M("./src/controller/eme-controller.ts"),u=M("./src/controller/cmcd-controller.ts"),o=M("./src/utils/xhr-loader.ts"),h=M("./src/utils/fetch-loader.ts"),r=M("./src/utils/cues.ts"),a=M("./src/utils/mediakeys-helper.ts"),i=M("./src/utils/logger.ts");function s(){return s=Object.assign||function(g){for(var f=1;f<arguments.length;f++){var C=arguments[f];for(var E in C)Object.prototype.hasOwnProperty.call(C,E)&&(g[E]=C[E])}return g},s.apply(this,arguments)}function S(g,f){var C=Object.keys(g);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(g);f&&(E=E.filter(function(_){return Object.getOwnPropertyDescriptor(g,_).enumerable})),C.push.apply(C,E)}return C}function x(g){for(var f=1;f<arguments.length;f++){var C=arguments[f]!=null?arguments[f]:{};f%2?S(Object(C),!0).forEach(function(E){T(g,E,C[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(C)):S(Object(C)).forEach(function(E){Object.defineProperty(g,E,Object.getOwnPropertyDescriptor(C,E))})}return g}function T(g,f,C){return f in g?Object.defineProperty(g,f,{value:C,enumerable:!0,configurable:!0,writable:!0}):g[f]=C,g}var A=x(x({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:o.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:X.default,bufferController:n.default,capLevelController:p.default,fpsController:m.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:a.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},w()),{},{subtitleStreamController:H.SubtitleStreamController,subtitleTrackController:N.default,timelineController:P.TimelineController,audioStreamController:F.default,audioTrackController:I.default,emeController:d.default,cmcdController:u.default});function w(){return{cueHandler:r.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 v(g,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 s({},g,f)}function b(g){var f=g.loader;if(f!==h.default&&f!==o.default)i.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),g.progressive=!1;else{var C=Object(h.fetchSupported)();C&&(g.loader=h.default,g.progressive=!0,g.enableSoftwareAES=!0,i.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(Q,z,M){"use strict";M.r(z);var X=M("./src/polyfills/number.ts"),F=M("./src/utils/ewma-bandwidth-estimator.ts"),I=M("./src/events.ts"),H=M("./src/utils/buffer-helper.ts"),N=M("./src/errors.ts"),n=M("./src/types/loader.ts"),P=M("./src/utils/logger.ts");function p(u,o){for(var h=0;h<o.length;h++){var r=o[h];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(u,r.key,r)}}function m(u,o,h){return o&&p(u.prototype,o),h&&p(u,h),u}var d=function(){function u(h){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=h;var r=h.config;this.bwEstimator=new F.default(r.abrEwmaSlowVoD,r.abrEwmaFastVoD,r.abrEwmaDefaultEstimate),this.registerListeners()}var o=u.prototype;return o.registerListeners=function(){var r=this.hls;r.on(I.Events.FRAG_LOADING,this.onFragLoading,this),r.on(I.Events.FRAG_LOADED,this.onFragLoaded,this),r.on(I.Events.FRAG_BUFFERED,this.onFragBuffered,this),r.on(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),r.on(I.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var r=this.hls;r.off(I.Events.FRAG_LOADING,this.onFragLoading,this),r.off(I.Events.FRAG_LOADED,this.onFragLoaded,this),r.off(I.Events.FRAG_BUFFERED,this.onFragBuffered,this),r.off(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),r.off(I.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},o.onFragLoading=function(r,a){var i=a.frag;if(i.type===n.PlaylistLevelType.MAIN&&!this.timer){var s;this.fragCurrent=i,this.partCurrent=(s=a.part)!=null?s:null,this.timer=self.setInterval(this.onCheck,100)}},o.onLevelLoaded=function(r,a){var i=this.hls.config;a.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD)},o._abandonRulesCheck=function(){var r=this.fragCurrent,a=this.partCurrent,i=this.hls,s=i.autoLevelEnabled,S=i.config,x=i.media;if(!r||!x)return;var T=a?a.stats:r.stats,A=a?a.duration:r.duration;if(T.aborted){P.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!s||x.paused||!x.playbackRate||!x.readyState)return;var w=performance.now()-T.loading.start,v=Math.abs(x.playbackRate);if(w<=500*A/v)return;var b=i.levels,g=i.minAutoLevel,f=b[r.level],C=T.total||Math.max(T.loaded,Math.round(A*f.maxBitrate/8)),E=Math.max(1,T.bwEstimate?T.bwEstimate/8:T.loaded*1e3/w),_=(C-T.loaded)/E,U=x.currentTime,j=(H.BufferHelper.bufferInfo(x,U,S.maxBufferHole).end-U)/v;if(j>=2*A/v||_<=j)return;var L=Number.POSITIVE_INFINITY,G;for(G=r.level-1;G>g;G--){var B=b[G].maxBitrate;if(L=A*B/(8*.8*E),L<j)break}if(L>=_)return;var O=this.bwEstimator.getEstimate();P.logger.warn("Fragment "+r.sn+(a?" part "+a.index:"")+" of level "+r.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+G+`
|
|
Current BW estimate: `+(Object(X.isFiniteNumber)(O)?(O/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+_.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+L.toFixed(3)+` s
|
|
Time to underbuffer: `+j.toFixed(3)+" s"),i.nextLoadLevel=G,this.bwEstimator.sample(w,T.loaded),this.clearTimer(),r.loader&&(this.fragCurrent=this.partCurrent=null,r.loader.abort()),i.trigger(I.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:r,part:a,stats:T})},o.onFragLoaded=function(r,a){var i=a.frag,s=a.part;if(i.type===n.PlaylistLevelType.MAIN&&Object(X.isFiniteNumber)(i.sn)){var S=s?s.stats:i.stats,x=s?s.duration:i.duration;if(this.clearTimer(),this.lastLoadedFragLevel=i.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var T=this.hls.levels[i.level],A=(T.loaded?T.loaded.bytes:0)+S.loaded,w=(T.loaded?T.loaded.duration:0)+x;T.loaded={bytes:A,duration:w},T.realBitrate=Math.round(8*A/w)}if(i.bitrateTest){var v={stats:S,frag:i,part:s,id:i.type};this.onFragBuffered(I.Events.FRAG_BUFFERED,v),i.bitrateTest=!1}}},o.onFragBuffered=function(r,a){var i=a.frag,s=a.part,S=s?s.stats:i.stats;if(S.aborted)return;if(i.type!==n.PlaylistLevelType.MAIN||i.sn==="initSegment")return;var x=S.parsing.end-S.loading.start;this.bwEstimator.sample(x,S.loaded),S.bwEstimate=this.bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=x/1e3:this.bitrateTestDelay=0},o.onError=function(r,a){switch(a.details){case N.ErrorDetails.FRAG_LOAD_ERROR:case N.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},o.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},o.getNextABRAutoLevel=function(){var r=this.fragCurrent,a=this.partCurrent,i=this.hls,s=i.maxAutoLevel,S=i.config,x=i.minAutoLevel,T=i.media,A=a?a.duration:r?r.duration:0,w=T?T.currentTime:0,v=T&&T.playbackRate!==0?Math.abs(T.playbackRate):1,b=this.bwEstimator?this.bwEstimator.getEstimate():S.abrEwmaDefaultEstimate,g=(H.BufferHelper.bufferInfo(T,w,S.maxBufferHole).end-w)/v,f=this.findBestLevel(b,x,s,g,S.abrBandWidthFactor,S.abrBandWidthUpFactor);if(f>=0)return f;P.logger.trace((g?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var C=A?Math.min(A,S.maxStarvationDelay):S.maxStarvationDelay,E=S.abrBandWidthFactor,_=S.abrBandWidthUpFactor;if(!g){var U=this.bitrateTestDelay;if(U){var j=A?Math.min(A,S.maxLoadingDelay):S.maxLoadingDelay;C=j-U,P.logger.trace("bitrate test took "+Math.round(1e3*U)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*C)+" ms"),E=_=1}}return f=this.findBestLevel(b,x,s,g+C,E,_),Math.max(f,0)},o.findBestLevel=function(r,a,i,s,S,x){for(var T,A=this.fragCurrent,w=this.partCurrent,v=this.lastLoadedFragLevel,b=this.hls.levels,g=b[v],f=!!(g!=null&&(T=g.details)!==null&&T!==void 0&&T.live),C=g==null?void 0:g.codecSet,E=w?w.duration:A?A.duration:0,_=i;_>=a;_--){var U=b[_];if(!U||C&&U.codecSet!==C)continue;var j=U.details,L=(w?j==null?void 0:j.partTarget:j==null?void 0:j.averagetargetduration)||E,G=void 0;_<=v?G=S*r:G=x*r;var B=b[_].maxBitrate,O=B*L/G;if(P.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+_+"/"+Math.round(G)+"/"+B+"/"+L+"/"+s+"/"+O),G>B&&(!O||f&&!this.bitrateTestDelay||O<s))return _}return-1},m(u,[{key:"nextAutoLevel",get:function(){var r=this._nextAutoLevel,a=this.bwEstimator;if(r!==-1&&(!a||!a.canEstimate()))return r;var i=this.getNextABRAutoLevel();return r!==-1&&(i=Math.min(r,i)),i},set:function(r){this._nextAutoLevel=r}}]),u}();z.default=d},"./src/controller/audio-stream-controller.ts":function(Q,z,M){"use strict";M.r(z);var X=M("./src/polyfills/number.ts"),F=M("./src/controller/base-stream-controller.ts"),I=M("./src/events.ts"),H=M("./src/utils/buffer-helper.ts"),N=M("./src/controller/fragment-tracker.ts"),n=M("./src/types/level.ts"),P=M("./src/types/loader.ts"),p=M("./src/loader/fragment.ts"),m=M("./src/demux/chunk-cache.ts"),d=M("./src/demux/transmuxer-interface.ts"),u=M("./src/types/transmuxer.ts"),o=M("./src/controller/fragment-finders.ts"),h=M("./src/utils/discontinuities.ts"),r=M("./src/errors.ts"),a=M("./src/utils/logger.ts");function i(){return i=Object.assign||function(A){for(var w=1;w<arguments.length;w++){var v=arguments[w];for(var b in v)Object.prototype.hasOwnProperty.call(v,b)&&(A[b]=v[b])}return A},i.apply(this,arguments)}function s(A,w){A.prototype=Object.create(w.prototype),A.prototype.constructor=A,S(A,w)}function S(A,w){return S=Object.setPrototypeOf||function(b,g){return b.__proto__=g,b},S(A,w)}var x=100,T=function(A){s(w,A);function w(b,g){var f;return f=A.call(this,b,g,"[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 v=w.prototype;return v.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},v._registerListeners=function(){var g=this.hls;g.on(I.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.on(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.on(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),g.on(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.on(I.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),g.on(I.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),g.on(I.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),g.on(I.Events.ERROR,this.onError,this),g.on(I.Events.BUFFER_RESET,this.onBufferReset,this),g.on(I.Events.BUFFER_CREATED,this.onBufferCreated,this),g.on(I.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),g.on(I.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),g.on(I.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v._unregisterListeners=function(){var g=this.hls;g.off(I.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.off(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.off(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),g.off(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.off(I.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),g.off(I.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),g.off(I.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),g.off(I.Events.ERROR,this.onError,this),g.off(I.Events.BUFFER_RESET,this.onBufferReset,this),g.off(I.Events.BUFFER_CREATED,this.onBufferCreated,this),g.off(I.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),g.off(I.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),g.off(I.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v.onInitPtsFound=function(g,f){var C=f.frag,E=f.id,_=f.initPTS;if(E==="main"){var U=C.cc;this.initPTS[C.cc]=_,this.log("InitPTS for cc: "+U+" found from main: "+_),this.videoTrackCC=U,this.state===F.State.WAITING_INIT_PTS&&this.tick()}},v.startLoad=function(g){if(!this.levels){this.startPosition=g,this.state=F.State.STOPPED;return}var f=this.lastCurrentTime;this.stopLoad(),this.setInterval(x),this.fragLoadError=0,f>0&&g===-1?(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),this.state=F.State.IDLE):(this.loadedmetadata=!1,this.state=F.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=g,this.tick()},v.doTick=function(){switch(this.state){case F.State.IDLE:this.doTickIdle();break;case F.State.WAITING_TRACK:{var g,f=this.levels,C=this.trackId,E=f==null||((g=f[C])===null||g===void 0)?void 0:g.details;if(E){if(this.waitForCdnTuneIn(E))break;this.state=F.State.WAITING_INIT_PTS}break}case F.State.FRAG_LOADING_WAITING_RETRY:{var _,U=performance.now(),j=this.retryDate;(!j||U>=j||(_=this.media)!==null&&_!==void 0&&_.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=F.State.IDLE);break}case F.State.WAITING_INIT_PTS:{var L=this.waitingData;if(L){var G=L.frag,B=L.part,O=L.cache,V=L.complete;if(this.initPTS[G.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=F.State.FRAG_LOADING;var te=O.flush(),re={frag:G,part:B,payload:te,networkDetails:null};this._handleFragmentLoadProgress(re),V&&A.prototype._handleFragmentLoadComplete.call(this,re)}else if(this.videoTrackCC!==this.waitingVideoCC)a.logger.log("Waiting fragment cc ("+G.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ge=this.getLoadPosition(),Ae=H.BufferHelper.bufferInfo(this.mediaBuffer,ge,this.config.maxBufferHole),Oe=Object(o.fragmentWithinToleranceTest)(Ae.end,this.config.maxFragLookUpTolerance,G);Oe<0&&(a.logger.log("Waiting fragment cc ("+G.cc+") @ "+G.start+" cancelled because another fragment at "+Ae.end+" is needed"),this.clearWaitingFragment())}}else this.state=F.State.IDLE}}this.onTickEnd()},v.clearWaitingFragment=function(){var g=this.waitingData;g&&(this.fragmentTracker.removeFragment(g.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=F.State.IDLE)},v.onTickEnd=function(){var g=this.media;if(!g||!g.readyState)return;var f=this.mediaBuffer?this.mediaBuffer:g,C=f.buffered;!this.loadedmetadata&&C.length&&(this.loadedmetadata=!0),this.lastCurrentTime=g.currentTime},v.doTickIdle=function(){var g,f,C=this.hls,E=this.levels,_=this.media,U=this.trackId,j=C.config;if(!E||!E[U])return;if(!_&&(this.startFragRequested||!j.startFragPrefetch))return;var L=E[U],G=L.details;if(!G||G.live&&this.levelLastLoaded!==U||this.waitForCdnTuneIn(G)){this.state=F.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,p.ElementaryStreamTypes.AUDIO,P.PlaylistLevelType.AUDIO));var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,P.PlaylistLevelType.AUDIO);if(B===null)return;var O=B.len,V=this.getMaxBufferLength(),te=this.audioSwitch;if(O>=V&&!te)return;if(!te&&this._streamEnded(B,G)){C.trigger(I.Events.BUFFER_EOS,{type:"audio"}),this.state=F.State.ENDED;return}var re=G.fragments,ge=re[0].start,Ae=B.end;if(te){var Oe=this.getLoadPosition();Ae=Oe,G.PTSKnown&&Oe<ge&&((B.end>ge||B.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),_.currentTime=ge+.05))}var Ce=this.getNextFragment(Ae,G);if(!Ce){this.bufferFlushed=!0;return}((g=Ce.decryptdata)===null||g===void 0?void 0:g.keyFormat)==="identity"&&!((f=Ce.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(Ce,G):this.loadFragment(Ce,G,Ae)},v.getMaxBufferLength=function(){var g=A.prototype.getMaxBufferLength.call(this),f=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,P.PlaylistLevelType.MAIN);return f===null?g:Math.max(g,f.len)},v.onMediaDetaching=function(){this.videoBuffer=null,A.prototype.onMediaDetaching.call(this)},v.onAudioTracksUpdated=function(g,f){var C=f.audioTracks;this.resetTransmuxer(),this.levels=C.map(function(E){return new n.Level(E)})},v.onAudioTrackSwitching=function(g,f){var C=!!f.url;this.trackId=f.id;var E=this.fragCurrent;E!=null&&E.loader&&E.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),C?this.setInterval(x):this.resetTransmuxer(),C?(this.audioSwitch=!0,this.state=F.State.IDLE):this.state=F.State.STOPPED,this.tick()},v.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},v.onLevelLoaded=function(g,f){this.mainDetails=f.details},v.onAudioTrackLoaded=function(g,f){var C,E=this.levels,_=f.details,U=f.id;if(!E){this.warn("Audio tracks were reset while loading level "+U);return}this.log("Track "+U+" loaded ["+_.startSN+","+_.endSN+"],duration:"+_.totalduration);var j=E[U],L=0;if(_.live||(C=j.details)!==null&&C!==void 0&&C.live){var G=this.mainDetails;if(_.fragments[0]||(_.deltaUpdateFailed=!0),_.deltaUpdateFailed||!G)return;!j.details&&_.hasProgramDateTime&&G.hasProgramDateTime?(Object(h.alignMediaPlaylistByPDT)(_,G),L=_.fragments[0].start):L=this.alignPlaylists(_,j.details)}j.details=_,this.levelLastLoaded=U,!this.startFragRequested&&(this.mainDetails||!_.live)&&this.setStartPosition(j.details,L),this.state===F.State.WAITING_TRACK&&!this.waitForCdnTuneIn(_)&&(this.state=F.State.IDLE),this.tick()},v._handleFragmentLoadProgress=function(g){var f,C=g.frag,E=g.part,_=g.payload,U=this.config,j=this.trackId,L=this.levels;if(!L){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+C.sn+" of level "+C.level+" will not be buffered");return}var G=L[j];console.assert(G,"Audio track is defined on fragment load progress");var B=G.details;console.assert(B,"Audio track details are defined on fragment load progress");var O=U.defaultAudioCodec||G.audioCodec||"mp4a.40.2",V=this.transmuxer;V||(V=this.transmuxer=new d.default(this.hls,P.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var te=this.initPTS[C.cc],re=(f=C.initSegment)===null||f===void 0?void 0:f.data;if(te!==void 0){var ge=!1,Ae=E?E.index:-1,Oe=Ae!==-1,Ce=new u.ChunkMetadata(C.level,C.sn,C.stats.chunkCount,_.byteLength,Ae,Oe);V.push(_,re,O,"",C,E,B.totalduration,ge,Ce,te)}else{a.logger.log("Unknown video PTS for cc "+C.cc+", waiting for video PTS before demuxing audio frag "+C.sn+" of ["+B.startSN+" ,"+B.endSN+"],track "+j);var je=this.waitingData=this.waitingData||{frag:C,part:E,cache:new m.default,complete:!1},Ue=je.cache;Ue.push(new Uint8Array(_)),this.waitingVideoCC=this.videoTrackCC,this.state=F.State.WAITING_INIT_PTS}},v._handleFragmentLoadComplete=function(g){if(this.waitingData){this.waitingData.complete=!0;return}A.prototype._handleFragmentLoadComplete.call(this,g)},v.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},v.onBufferCreated=function(g,f){var C=f.tracks.audio;C&&(this.mediaBuffer=C.buffer),f.tracks.video&&(this.videoBuffer=f.tracks.video.buffer)},v.onFragBuffered=function(g,f){var C=f.frag,E=f.part;if(C.type!==P.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(C)){this.warn("Fragment "+C.sn+(E?" p: "+E.index:"")+" of level "+C.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}C.sn!=="initSegment"&&(this.fragPrevious=C,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(I.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(C,E)},v.onError=function(g,f){switch(f.details){case r.ErrorDetails.FRAG_LOAD_ERROR:case r.ErrorDetails.FRAG_LOAD_TIMEOUT:case r.ErrorDetails.KEY_LOAD_ERROR:case r.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(P.PlaylistLevelType.AUDIO,f);break;case r.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case r.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==F.State.ERROR&&this.state!==F.State.STOPPED&&(this.state=f.fatal?F.State.ERROR:F.State.IDLE,this.warn(f.details+" while loading frag, switching to "+this.state+" state"));break;case r.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="audio"&&(this.state===F.State.PARSING||this.state===F.State.PARSED)){var C=!0,E=this.getFwdBufferInfo(this.mediaBuffer,P.PlaylistLevelType.AUDIO);E&&E.len>.5&&(C=!this.reduceMaxBufferLength(E.len)),C&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,A.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},v.onBufferFlushed=function(g,f){var C=f.type;C===p.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},v._handleTransmuxComplete=function(g){var f,C="audio",E=this.hls,_=g.remuxResult,U=g.chunkMeta,j=this.getCurrentContext(U);if(!j){this.warn("The loading context changed while buffering fragment "+U.sn+" of level "+U.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(U.level);return}var L=j.frag,G=j.part,B=_.audio,O=_.text,V=_.id3,te=_.initSegment;if(this.fragContextChanged(L))return;if(this.state=F.State.PARSING,this.audioSwitch&&B&&this.completeAudioSwitch(),te!=null&&te.tracks&&(this._bufferInitSegment(te.tracks,L,U),E.trigger(I.Events.FRAG_PARSING_INIT_SEGMENT,{frag:L,id:C,tracks:te.tracks})),B){var re=B.startPTS,ge=B.endPTS,Ae=B.startDTS,Oe=B.endDTS;G&&(G.elementaryStreams[p.ElementaryStreamTypes.AUDIO]={startPTS:re,endPTS:ge,startDTS:Ae,endDTS:Oe}),L.setElementaryStreamInfo(p.ElementaryStreamTypes.AUDIO,re,ge,Ae,Oe),this.bufferFragmentData(B,L,G,U)}if(V!=null&&(f=V.samples)!==null&&f!==void 0&&f.length){var Ce=i({frag:L,id:C},V);E.trigger(I.Events.FRAG_PARSING_METADATA,Ce)}if(O){var je=i({frag:L,id:C},O);E.trigger(I.Events.FRAG_PARSING_USERDATA,je)}},v._bufferInitSegment=function(g,f,C){if(this.state!==F.State.PARSING)return;g.video&&delete g.video;var E=g.audio;if(!E)return;E.levelCodec=E.codec,E.id="audio",this.log("Init audio buffer, container:"+E.container+", codecs[parsed]=["+E.codec+"]"),this.hls.trigger(I.Events.BUFFER_CODECS,g);var _=E.initSegment;if(_!=null&&_.byteLength){var U={type:"audio",frag:f,part:null,chunkMeta:C,parent:f.type,data:_};this.hls.trigger(I.Events.BUFFER_APPENDING,U)}this.tick()},v.loadFragment=function(g,f,C){var E=this.fragmentTracker.getState(g);this.fragCurrent=g,(this.audioSwitch||E===N.FragmentState.NOT_LOADED||E===N.FragmentState.PARTIAL)&&(g.sn==="initSegment"?this._loadInitSegment(g):f.live&&!Object(X.isFiniteNumber)(this.initPTS[g.cc])?(this.log("Waiting for video PTS in continuity counter "+g.cc+" of live stream before loading audio fragment "+g.sn+" of level "+this.trackId),this.state=F.State.WAITING_INIT_PTS):(this.startFragRequested=!0,A.prototype.loadFragment.call(this,g,f,C)))},v.completeAudioSwitch=function(){var g=this.hls,f=this.media,C=this.trackId;f&&(this.log("Switching audio track : flushing all audio"),A.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,g.trigger(I.Events.AUDIO_TRACK_SWITCHED,{id:C})},w}(F.default);z.default=T},"./src/controller/audio-track-controller.ts":function(Q,z,M){"use strict";M.r(z);var X=M("./src/events.ts"),F=M("./src/errors.ts"),I=M("./src/controller/base-playlist-controller.ts"),H=M("./src/types/loader.ts");function N(d,u){for(var o=0;o<u.length;o++){var h=u[o];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(d,h.key,h)}}function n(d,u,o){return u&&N(d.prototype,u),o&&N(d,o),d}function P(d,u){d.prototype=Object.create(u.prototype),d.prototype.constructor=d,p(d,u)}function p(d,u){return p=Object.setPrototypeOf||function(h,r){return h.__proto__=r,h},p(d,u)}var m=function(d){P(u,d);function u(h){var r;return r=d.call(this,h,"[audio-track-controller]")||this,r.tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.trackName="",r.selectDefaultTrack=!0,r.registerListeners(),r}var o=u.prototype;return o.registerListeners=function(){var r=this.hls;r.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(X.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.on(X.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),r.on(X.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var r=this.hls;r.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(X.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.off(X.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),r.off(X.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,d.prototype.destroy.call(this)},o.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},o.onManifestParsed=function(r,a){this.tracks=a.audioTracks||[]},o.onAudioTrackLoaded=function(r,a){var i=a.id,s=a.details,S=this.tracksInGroup[i];if(!S){this.warn("Invalid audio track id "+i);return}var x=S.details;S.details=a.details,this.log("audioTrack "+i+" loaded ["+s.startSN+"-"+s.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,a,x))},o.onLevelLoading=function(r,a){this.switchLevel(a.level)},o.onLevelSwitching=function(r,a){this.switchLevel(a.level)},o.switchLevel=function(r){var a=this.hls.levels[r];if(!(a!=null&&a.audioGroupIds))return;var i=a.audioGroupIds[a.urlId];if(this.groupId!==i){this.groupId=i;var s=this.tracks.filter(function(x){return!i||x.groupId===i});this.selectDefaultTrack&&!s.some(function(x){return x.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=s;var S={audioTracks:s};this.log("Updating audio tracks, "+s.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(X.Events.AUDIO_TRACKS_UPDATED,S),this.selectInitialTrack()}},o.onError=function(r,a){if(d.prototype.onError.call(this,r,a),a.fatal||!a.context)return;a.context.type===H.PlaylistContextType.AUDIO_TRACK&&a.context.id===this.trackId&&a.context.groupId===this.groupId&&this.retryLoadingOrFail(a)},o.setAudioTrack=function(r){var a=this.tracksInGroup;if(r<0||r>=a.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var i=a[this.trackId];this.log("Now switching to audio-track index "+r);var s=a[r],S=s.id,x=s.groupId,T=x===void 0?"":x,A=s.name,w=s.type,v=s.url;if(this.trackId=r,this.trackName=A,this.selectDefaultTrack=!1,this.hls.trigger(X.Events.AUDIO_TRACK_SWITCHING,{id:S,groupId:T,name:A,type:w,url:v}),s.details&&!s.details.live)return;var b=this.switchParams(s.url,i==null?void 0:i.details);this.loadPlaylist(b)},o.selectInitialTrack=function(){var r=this.tracksInGroup;console.assert(r.length,"Initial audio track should be selected when tracks are known");var a=this.trackName,i=this.findTrackId(a)||this.findTrackId();i!==-1?this.setAudioTrack(i):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},o.findTrackId=function(r){for(var a=this.tracksInGroup,i=0;i<a.length;i++){var s=a[i];if((!this.selectDefaultTrack||s.default)&&(!r||r===s.name))return s.id}return-1},o.loadPlaylist=function(r){var a=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(a)){var i=a.id,s=a.groupId,S=a.url;if(r)try{S=r.addDirectives(S)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("loading audio-track playlist for id: "+i),this.clearTimer(),this.hls.trigger(X.Events.AUDIO_TRACK_LOADING,{url:S,id:i,groupId:s,deliveryDirectives:r||null})}},n(u,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(r){this.selectDefaultTrack=!1,this.setAudioTrack(r)}}]),u}(I.default);z.default=m},"./src/controller/base-playlist-controller.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"default",function(){return n});var X=M("./src/polyfills/number.ts"),F=M("./src/types/level.ts"),I=M("./src/controller/level-helper.ts"),H=M("./src/utils/logger.ts"),N=M("./src/errors.ts"),n=function(){function P(m,d){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=H.logger.log.bind(H.logger,d+":"),this.warn=H.logger.warn.bind(H.logger,d+":"),this.hls=m}var p=P.prototype;return p.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},p.onError=function(d,u){u.fatal&&u.type===N.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},p.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},p.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},p.stopLoad=function(){this.canLoad=!1,this.clearTimer()},p.switchParams=function(d,u){var o=u==null?void 0:u.renditionReports;if(o)for(var h=0;h<o.length;h++){var r=o[h],a=""+r.URI;if(a===d.substr(-a.length)){var i=parseInt(r["LAST-MSN"]),s=parseInt(r["LAST-PART"]);if(u&&this.hls.config.lowLatencyMode){var S=Math.min(u.age-u.partTarget,u.targetduration);s!==void 0&&S>u.partTarget&&(s+=1)}if(Object(X.isFiniteNumber)(i))return new F.HlsUrlParameters(i,Object(X.isFiniteNumber)(s)?s:void 0,F.HlsSkip.No)}}},p.loadPlaylist=function(d){},p.shouldLoadTrack=function(d){return this.canLoad&&d&&!!d.url&&(!d.details||d.details.live)},p.playlistLoaded=function(d,u,o){var h=this,r=u.details,a=u.stats,i=a.loading.end?Math.max(0,self.performance.now()-a.loading.end):0;if(r.advancedDateTime=Date.now()-i,r.live||o!=null&&o.live){if(r.reloaded(o),o&&this.log("live playlist "+d+" "+(r.advanced?"REFRESHED "+r.lastPartSn+"-"+r.lastPartIndex:"MISSED")),o&&r.fragments.length>0&&Object(I.mergeDetails)(o,r),!this.canLoad||!r.live)return;var s,S=void 0,x=void 0;if(r.canBlockReload&&r.endSN&&r.advanced){var T=this.hls.config.lowLatencyMode,A=r.lastPartSn,w=r.endSN,v=r.lastPartIndex,b=v!==-1,g=A===w,f=T?0:v;b?(S=g?w+1:A,x=g?f:v+1):S=w+1;var C=r.age,E=C+r.ageHeader,_=Math.min(E-r.partTarget,r.targetduration*1.5);if(_>0){if(o&&_>o.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+o.tuneInGoal+" to: "+_+" with playlist age: "+r.age),_=0;else{var U=Math.floor(_/r.targetduration);if(S+=U,x!==void 0){var j=Math.round(_%r.targetduration/r.partTarget);x+=j}this.log("CDN Tune-in age: "+r.ageHeader+"s last advanced "+C.toFixed(2)+"s goal: "+_+" skip sn "+U+" to part "+x)}r.tuneInGoal=_}if(s=this.getDeliveryDirectives(r,u.deliveryDirectives,S,x),T||!g){this.loadPlaylist(s);return}}else s=this.getDeliveryDirectives(r,u.deliveryDirectives,S,x);var L=Object(I.computeReloadInterval)(r,a);S!==void 0&&r.canBlockReload&&(L-=r.partTarget||1),this.log("reload live playlist "+d+" in "+Math.round(L)+" ms"),this.timer=self.setTimeout(function(){return h.loadPlaylist(s)},L)}else this.clearTimer()},p.getDeliveryDirectives=function(d,u,o,h){var r=Object(F.getSkipValue)(d,o);return u!=null&&u.skip&&d.deltaUpdateFailed&&(o=u.msn,h=u.part,r=F.HlsSkip.No),new F.HlsUrlParameters(o,h,r)},p.retryLoadingOrFail=function(d){var u=this,o=this.hls.config,h=this.retryCount<o.levelLoadingMaxRetry;if(h){var r;if(this.retryCount++,d.details.indexOf("LoadTimeOut")>-1&&(r=d.context)!==null&&r!==void 0&&r.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+d.details+'"'),this.loadPlaylist();else{var a=Math.min(Math.pow(2,this.retryCount)*o.levelLoadingRetryDelay,o.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return u.loadPlaylist()},a),this.warn("retry playlist loading #"+this.retryCount+" in "+a+' ms after "'+d.details+'"')}}else this.warn('cannot recover from error "'+d.details+'"'),this.clearTimer(),d.fatal=!0;return h},P}()},"./src/controller/base-stream-controller.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"State",function(){return w}),M.d(z,"default",function(){return v});var X=M("./src/polyfills/number.ts"),F=M("./src/task-loop.ts"),I=M("./src/controller/fragment-tracker.ts"),H=M("./src/utils/buffer-helper.ts"),N=M("./src/utils/logger.ts"),n=M("./src/events.ts"),P=M("./src/errors.ts"),p=M("./src/types/transmuxer.ts"),m=M("./src/utils/mp4-tools.ts"),d=M("./src/utils/discontinuities.ts"),u=M("./src/controller/fragment-finders.ts"),o=M("./src/controller/level-helper.ts"),h=M("./src/loader/fragment-loader.ts"),r=M("./src/crypt/decrypter.ts"),a=M("./src/utils/time-ranges.ts"),i=M("./src/types/loader.ts");function s(b,g){for(var f=0;f<g.length;f++){var C=g[f];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(b,C.key,C)}}function S(b,g,f){return g&&s(b.prototype,g),f&&s(b,f),b}function x(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function T(b,g){b.prototype=Object.create(g.prototype),b.prototype.constructor=b,A(b,g)}function A(b,g){return A=Object.setPrototypeOf||function(C,E){return C.__proto__=E,C},A(b,g)}var w={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"},v=function(b){T(g,b);function g(C,E,_){var U;return U=b.call(this)||this,U.hls=void 0,U.fragPrevious=null,U.fragCurrent=null,U.fragmentTracker=void 0,U.transmuxer=null,U._state=w.STOPPED,U.media=void 0,U.mediaBuffer=void 0,U.config=void 0,U.bitrateTest=!1,U.lastCurrentTime=0,U.nextLoadPosition=0,U.startPosition=0,U.loadedmetadata=!1,U.fragLoadError=0,U.retryDate=0,U.levels=null,U.fragmentLoader=void 0,U.levelLastLoaded=null,U.startFragRequested=!1,U.decrypter=void 0,U.initPTS=[],U.onvseeking=null,U.onvended=null,U.logPrefix="",U.log=void 0,U.warn=void 0,U.logPrefix=_,U.log=N.logger.log.bind(N.logger,_+":"),U.warn=N.logger.warn.bind(N.logger,_+":"),U.hls=C,U.fragmentLoader=new h.default(C.config),U.fragmentTracker=E,U.config=C.config,U.decrypter=new r.default(C,C.config),C.on(n.Events.KEY_LOADED,U.onKeyLoaded,x(U)),U}var f=g.prototype;return f.doTick=function(){this.onTickEnd()},f.onTickEnd=function(){},f.startLoad=function(E){},f.stopLoad=function(){this.fragmentLoader.abort();var E=this.fragCurrent;E&&this.fragmentTracker.removeFragment(E),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=w.STOPPED},f._streamEnded=function(E,_){var U=this.fragCurrent,j=this.fragmentTracker;if(!_.live&&U&&U.sn===_.endSN&&!E.nextStart){var L=j.getState(U);return L===I.FragmentState.PARTIAL||L===I.FragmentState.OK}return!1},f.onMediaAttached=function(E,_){var U=this.media=this.mediaBuffer=_.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),U.addEventListener("seeking",this.onvseeking),U.addEventListener("ended",this.onvended);var j=this.config;this.levels&&j.autoStartLoad&&this.state===w.STOPPED&&this.startLoad(j.startPosition)},f.onMediaDetaching=function(){var E=this.media;E!=null&&E.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),E&&(E.removeEventListener("seeking",this.onvseeking),E.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 E=this.config,_=this.fragCurrent,U=this.media,j=this.mediaBuffer,L=this.state,G=U?U.currentTime:0,B=H.BufferHelper.bufferInfo(j||U,G,E.maxBufferHole);if(this.log("media seeking to "+(Object(X.isFiniteNumber)(G)?G.toFixed(3):G)+", state: "+L),L===w.ENDED)this.resetLoadingState();else if(_&&!B.len){var O=E.maxFragLookUpTolerance,V=_.start-O,te=_.start+_.duration+O,re=G>te;(G<V||re)&&(re&&_.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),_.loader.abort()),this.resetLoadingState())}U&&(this.lastCurrentTime=G),!this.loadedmetadata&&!B.len&&(this.nextLoadPosition=this.startPosition=G),this.tickImmediate()},f.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},f.onKeyLoaded=function(E,_){if(this.state!==w.KEY_LOADING||_.frag!==this.fragCurrent||!this.levels)return;this.state=w.IDLE;var U=this.levels[_.frag.level].details;U&&this.loadFragment(_.frag,U,_.frag.start)},f.onHandlerDestroying=function(){this.stopLoad(),b.prototype.onHandlerDestroying.call(this)},f.onHandlerDestroyed=function(){this.state=w.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,b.prototype.onHandlerDestroyed.call(this)},f.loadKey=function(E,_){this.log("Loading key for "+E.sn+" of ["+_.startSN+"-"+_.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+E.level),this.state=w.KEY_LOADING,this.fragCurrent=E,this.hls.trigger(n.Events.KEY_LOADING,{frag:E})},f.loadFragment=function(E,_,U){this._loadFragForPlayback(E,_,U)},f._loadFragForPlayback=function(E,_,U){var j=this,L=function(B){if(j.fragContextChanged(E)){j.warn("Fragment "+E.sn+(B.part?" p: "+B.part.index:"")+" of level "+E.level+" was dropped during download."),j.fragmentTracker.removeFragment(E);return}E.stats.chunkCount++,j._handleFragmentLoadProgress(B)};this._doFragLoad(E,_,U,L).then(function(G){if(!G)return;j.fragLoadError=0;var B=j.state;if(j.fragContextChanged(E)){(B===w.FRAG_LOADING||B===w.BACKTRACKING||!j.fragCurrent&&B===w.PARSING)&&(j.fragmentTracker.removeFragment(E),j.state=w.IDLE);return}if("payload"in G&&(j.log("Loaded fragment "+E.sn+" of level "+E.level),j.hls.trigger(n.Events.FRAG_LOADED,G),j.state===w.BACKTRACKING)){j.fragmentTracker.backtrack(E,G),j.resetFragmentLoading(E);return}j._handleFragmentLoadComplete(G)}).catch(function(G){j.warn(G),j.resetFragmentLoading(E)})},f.flushMainBuffer=function(E,_,U){if(U===void 0&&(U=null),!(E-_))return;var j={startOffset:E,endOffset:_,type:U};this.fragLoadError=0,this.hls.trigger(n.Events.BUFFER_FLUSHING,j)},f._loadInitSegment=function(E){var _=this;this._doFragLoad(E).then(function(U){if(!U||_.fragContextChanged(E)||!_.levels)throw new Error("init load aborted");return U}).then(function(U){var j=_.hls,L=U.payload,G=E.decryptdata;if(L&&L.byteLength>0&&G&&G.key&&G.iv&&G.method==="AES-128"){var B=self.performance.now();return _.decrypter.webCryptoDecrypt(new Uint8Array(L),G.key.buffer,G.iv.buffer).then(function(O){var V=self.performance.now();return j.trigger(n.Events.FRAG_DECRYPTED,{frag:E,payload:O,stats:{tstart:B,tdecrypt:V}}),U.payload=O,U})}return U}).then(function(U){var j=_.fragCurrent,L=_.hls,G=_.levels;if(!G)throw new Error("init load aborted, missing levels");var B=G[E.level].details;console.assert(B,"Level details are defined when init segment is loaded");var O=E.stats;_.state=w.IDLE,_.fragLoadError=0,E.data=new Uint8Array(U.payload),O.parsing.start=O.buffering.start=self.performance.now(),O.parsing.end=O.buffering.end=self.performance.now(),U.frag===j&&L.trigger(n.Events.FRAG_BUFFERED,{stats:O,frag:j,part:null,id:E.type}),_.tick()}).catch(function(U){_.warn(U),_.resetFragmentLoading(E)})},f.fragContextChanged=function(E){var _=this.fragCurrent;return!E||!_||E.level!==_.level||E.sn!==_.sn||E.urlId!==_.urlId},f.fragBufferedComplete=function(E,_){var U=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+E.type+" sn: "+E.sn+(_?" part: "+_.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+E.level+" "+a.default.toString(H.BufferHelper.getBuffered(U))),this.state=w.IDLE,this.tick()},f._handleFragmentLoadComplete=function(E){var _=this.transmuxer;if(!_)return;var U=E.frag,j=E.part,L=E.partsLoaded,G=!L||L.length===0||L.some(function(O){return!O}),B=new p.ChunkMetadata(U.level,U.sn,U.stats.chunkCount+1,0,j?j.index:-1,!G);_.flush(B)},f._handleFragmentLoadProgress=function(E){},f._doFragLoad=function(E,_,U,j){var L=this;if(U===void 0&&(U=null),!this.levels)throw new Error("frag load aborted, missing levels");if(U=Math.max(E.start,U||0),this.config.lowLatencyMode&&_){var G=_.partList;if(G&&j){U>E.end&&_.fragmentHint&&(E=_.fragmentHint);var B=this.getNextPart(G,E,U);if(B>-1){var O=G[B];return this.log("Loading part sn: "+E.sn+" p: "+O.index+" cc: "+E.cc+" of playlist ["+_.startSN+"-"+_.endSN+"] parts [0-"+B+"-"+(G.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(U.toFixed(3))),this.nextLoadPosition=O.start+O.duration,this.state=w.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:E,part:G[B],targetBufferTime:U}),this.doFragPartsLoad(E,G,B,j).catch(function(V){return L.handleFragLoadError(V)})}else if(!E.url||this.loadedEndOfParts(G,U))return Promise.resolve(null)}}return this.log("Loading fragment "+E.sn+" cc: "+E.cc+" "+(_?"of ["+_.startSN+"-"+_.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(U.toFixed(3))),Object(X.isFiniteNumber)(E.sn)&&!this.bitrateTest&&(this.nextLoadPosition=E.start+E.duration),this.state=w.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:E,targetBufferTime:U}),this.fragmentLoader.load(E,j).catch(function(V){return L.handleFragLoadError(V)})},f.doFragPartsLoad=function(E,_,U,j){var L=this;return new Promise(function(G,B){var O=[],V=function te(re){var ge=_[re];L.fragmentLoader.loadPart(E,ge,j).then(function(Ae){O[ge.index]=Ae;var Oe=Ae.part;L.hls.trigger(n.Events.FRAG_LOADED,Ae);var Ce=_[re+1];if(Ce&&Ce.fragment===E)te(re+1);else return G({frag:E,part:Oe,partsLoaded:O})}).catch(B)};V(U)})},f.handleFragLoadError=function(E){var _=E.data;return _&&_.details===P.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(_.frag,_.part):this.hls.trigger(n.Events.ERROR,_),null},f._handleTransmuxerFlush=function(E){var _=this.getCurrentContext(E);if(!_||this.state!==w.PARSING){this.fragCurrent||(this.state=w.IDLE);return}var U=_.frag,j=_.part,L=_.level,G=self.performance.now();U.stats.parsing.end=G,j&&(j.stats.parsing.end=G),this.updateLevelTiming(U,j,L,E.partial)},f.getCurrentContext=function(E){var _=this.levels,U=E.level,j=E.sn,L=E.part;if(!_||!_[U])return this.warn("Levels object was unset while buffering fragment "+j+" of level "+U+". The current chunk will not be buffered."),null;var G=_[U],B=L>-1?Object(o.getPartWith)(G,j,L):null,O=B?B.fragment:Object(o.getFragmentWithSN)(G,j,this.fragCurrent);return O?{frag:O,part:B,level:G}:null},f.bufferFragmentData=function(E,_,U,j){if(!E||this.state!==w.PARSING)return;var L=E.data1,G=E.data2,B=L;if(L&&G&&(B=Object(m.appendUint8Array)(L,G)),!B||!B.length)return;var O={type:E.type,frag:_,part:U,chunkMeta:j,parent:_.type,data:B};this.hls.trigger(n.Events.BUFFER_APPENDING,O),E.dropped&&E.independent&&!U&&this.flushBufferGap(_)},f.flushBufferGap=function(E){var _=this.media;if(!_)return;if(!H.BufferHelper.isBuffered(_,_.currentTime)){this.flushMainBuffer(0,E.start);return}var U=_.currentTime,j=H.BufferHelper.bufferInfo(_,U,0),L=E.duration,G=Math.min(this.config.maxFragLookUpTolerance*2,L*.25),B=Math.max(Math.min(E.start-G,j.end-G),U+G);E.start-B>G&&this.flushMainBuffer(B,E.start)},f.getFwdBufferInfo=function(E,_){var U=this.config,j=this.getLoadPosition();if(!Object(X.isFiniteNumber)(j))return null;var L=H.BufferHelper.bufferInfo(E,j,U.maxBufferHole);if(L.len===0&&L.nextStart!==void 0){var G=this.fragmentTracker.getBufferedFrag(j,_);if(G&&L.nextStart<G.end)return H.BufferHelper.bufferInfo(E,j,Math.max(L.nextStart,U.maxBufferHole))}return L},f.getMaxBufferLength=function(E){var _=this.config,U;return E?U=Math.max(8*_.maxBufferSize/E,_.maxBufferLength):U=_.maxBufferLength,Math.min(U,_.maxMaxBufferLength)},f.reduceMaxBufferLength=function(E){var _=this.config,U=E||_.maxBufferLength;return _.maxMaxBufferLength>=U?(_.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+_.maxMaxBufferLength+"s"),!0):!1},f.getNextFragment=function(E,_){var U,j,L=_.fragments,G=L.length;if(!G)return null;var B=this.config,O=L[0].start,V;if(_.live){var te=B.initialLiveManifestSize;if(G<te)return this.warn("Not enough fragments to start playback (have: "+G+", need: "+te+")"),null;!_.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(V=this.getInitialLiveFragment(_,L),this.startPosition=V?this.hls.liveSyncPosition||V.start:E)}else E<=O&&(V=L[0]);if(!V){var re=B.lowLatencyMode?_.partEnd:_.fragmentEnd;V=this.getFragmentAtPosition(E,re,_)}return(U=V)!==null&&U!==void 0&&U.initSegment&&!((j=V)!==null&&j!==void 0&&j.initSegment.data)&&!this.bitrateTest&&(V=V.initSegment),V},f.getNextPart=function(E,_,U){for(var j=-1,L=!1,G=!0,B=0,O=E.length;B<O;B++){var V=E[B];if(G=G&&!V.independent,j>-1&&U<V.start)break;var te=V.loaded;!te&&(L||V.independent||G)&&V.fragment===_&&(j=B),L=te}return j},f.loadedEndOfParts=function(E,_){var U=E[E.length-1];return U&&_>U.start&&U.loaded},f.getInitialLiveFragment=function(E,_){var U=this.fragPrevious,j=null;if(U){if(E.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+U.programDateTime),j=Object(u.findFragmentByPDT)(_,U.endProgramDateTime,this.config.maxFragLookUpTolerance)),!j){var L=U.sn+1;if(L>=E.startSN&&L<=E.endSN){var G=_[L-E.startSN];U.cc===G.cc&&(j=G,this.log("Live playlist, switching playlist, load frag with next SN: "+j.sn))}j||(j=Object(u.findFragWithCC)(_,U.cc),j&&this.log("Live playlist, switching playlist, load frag with same CC: "+j.sn))}}else{var B=this.hls.liveSyncPosition;B!==null&&(j=this.getFragmentAtPosition(B,this.bitrateTest?E.fragmentEnd:E.edge,E))}return j},f.getFragmentAtPosition=function(E,_,U){var j=this.config,L=this.fragPrevious,G=U.fragments,B=U.endSN,O=U.fragmentHint,V=j.maxFragLookUpTolerance,te=!!(j.lowLatencyMode&&U.partList&&O);te&&O&&!this.bitrateTest&&(G=G.concat(O),B=O.sn);var re;if(E<_){var ge=E>_-V?0:V;re=Object(u.findFragmentByPTS)(L,G,E,ge)}else re=G[G.length-1];if(re){var Ae=re.sn-U.startSN,Oe=L&&re.level===L.level,Ce=G[Ae+1],je=this.fragmentTracker.getState(re);if(je===I.FragmentState.BACKTRACKED){re=null;for(var Ue=Ae;G[Ue]&&this.fragmentTracker.getState(G[Ue])===I.FragmentState.BACKTRACKED;)L?re=G[Ue--]:re=G[--Ue];re||(re=Ce)}else L&&re.sn===L.sn&&!te&&(Oe&&(re.sn<B&&this.fragmentTracker.getState(Ce)!==I.FragmentState.OK?(this.log("SN "+re.sn+" just loaded, load next one: "+Ce.sn),re=Ce):re=null))}return re},f.synchronizeToLiveEdge=function(E){var _=this.config,U=this.media;if(!U)return;var j=this.hls.liveSyncPosition,L=U.currentTime,G=E.fragments[0].start,B=E.edge,O=L>=G-_.maxFragLookUpTolerance&&L<=B;if(j!==null&&U.duration>j&&(L<j||!O)){var V=_.liveMaxLatencyDuration!==void 0?_.liveMaxLatencyDuration:_.liveMaxLatencyDurationCount*E.targetduration;(!O&&U.readyState<4||L<B-V)&&(this.loadedmetadata||(this.nextLoadPosition=j),U.readyState&&(this.warn("Playback: "+L.toFixed(3)+" is located too far from the end of live sliding playlist: "+B+", reset currentTime to : "+j.toFixed(3)),U.currentTime=j))}},f.alignPlaylists=function(E,_){var U=this.levels,j=this.levelLastLoaded,L=this.fragPrevious,G=j!==null?U[j]:null,B=E.fragments.length;if(!B)return this.warn("No fragments in live playlist"),0;var O=E.fragments[0].start,V=!_,te=E.alignedSliding&&Object(X.isFiniteNumber)(O);if(V||!te&&!O){Object(d.alignStream)(L,G,E);var re=E.fragments[0].start;return this.log("Live playlist sliding: "+re.toFixed(2)+" start-sn: "+(_?_.startSN:"na")+"->"+E.startSN+" prev-sn: "+(L?L.sn:"na")+" fragments: "+B),re}return O},f.waitForCdnTuneIn=function(E){var _=3;return E.live&&E.canBlockReload&&E.tuneInGoal>Math.max(E.partHoldBack,E.partTarget*_)},f.setStartPosition=function(E,_){var U=this.startPosition;if(U<_&&(U=-1),U===-1||this.lastCurrentTime===-1){var j=E.startTimeOffset;Object(X.isFiniteNumber)(j)?(U=_+j,j<0&&(U+=E.totalduration),U=Math.min(Math.max(_,U),_+E.totalduration),this.log("Start time offset "+j+" found in playlist, adjust startPosition to "+U),this.startPosition=U):E.live?U=this.hls.liveSyncPosition||_:this.startPosition=U=0,this.lastCurrentTime=U}this.nextLoadPosition=U},f.getLoadPosition=function(){var E=this.media,_=0;return this.loadedmetadata&&E?_=E.currentTime:this.nextLoadPosition&&(_=this.nextLoadPosition),_},f.handleFragLoadAborted=function(E,_){this.transmuxer&&E.sn!=="initSegment"&&E.stats.aborted&&(this.warn("Fragment "+E.sn+(_?" part"+_.index:"")+" of level "+E.level+" was aborted"),this.resetFragmentLoading(E))},f.resetFragmentLoading=function(E){(!this.fragCurrent||!this.fragContextChanged(E))&&(this.state=w.IDLE)},f.onFragmentOrKeyLoadError=function(E,_){if(_.fatal)return;var U=_.frag;if(!U||U.type!==E)return;var j=this.fragCurrent;console.assert(j&&U.sn===j.sn&&U.level===j.level&&U.urlId===j.urlId,"Frag load error must match current frag to retry");var L=this.config;if(this.fragLoadError+1<=L.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(U.level))return;var G=Math.min(Math.pow(2,this.fragLoadError)*L.fragLoadingRetryDelay,L.fragLoadingMaxRetryTimeout);this.warn("Fragment "+U.sn+" of "+E+" "+U.level+" failed to load, retrying in "+G+"ms"),this.retryDate=self.performance.now()+G,this.fragLoadError++,this.state=w.FRAG_LOADING_WAITING_RETRY}else _.levelRetry?(E===i.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=w.IDLE):(N.logger.error(_.details+" reaches max retry, redispatch as fatal ..."),_.fatal=!0,this.hls.stopLoad(),this.state=w.ERROR)},f.afterBufferFlushed=function(E,_,U){if(!E)return;var j=H.BufferHelper.getBuffered(E);this.fragmentTracker.detectEvictedFragments(_,j,U),this.state===w.ENDED&&this.resetLoadingState()},f.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=w.IDLE},f.resetLiveStartWhenNotLoaded=function(E){if(!this.loadedmetadata){this.startFragRequested=!1;var _=this.levels?this.levels[E].details:null;if(_!=null&&_.live)return this.startPosition=-1,this.setStartPosition(_,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},f.updateLevelTiming=function(E,_,U,j){var L=this,G=U.details;console.assert(!!G,"level.details must be defined");var B=Object.keys(E.elementaryStreams).reduce(function(O,V){var te=E.elementaryStreams[V];if(te){var re=te.endPTS-te.startPTS;if(re<=0)return L.warn("Could not parse fragment "+E.sn+" "+V+" duration reliably ("+re+") resetting transmuxer to fallback to playlist timing"),L.resetTransmuxer(),O||!1;var ge=j?0:Object(o.updateFragPTSDTS)(G,E,te.startPTS,te.endPTS,te.startDTS,te.endDTS);return L.hls.trigger(n.Events.LEVEL_PTS_UPDATED,{details:G,level:U,drift:ge,type:V,frag:E,start:te.startPTS,end:te.endPTS}),!0}return O},!1);B?(this.state=w.PARSED,this.hls.trigger(n.Events.FRAG_PARSED,{frag:E,part:_})):this.resetLoadingState()},f.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},S(g,[{key:"state",get:function(){return this._state},set:function(E){var _=this._state;_!==E&&(this._state=E,this.log(_+"->"+E))}}]),g}(F.default)},"./src/controller/buffer-controller.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"default",function(){return u});var X=M("./src/polyfills/number.ts"),F=M("./src/events.ts"),I=M("./src/utils/logger.ts"),H=M("./src/errors.ts"),N=M("./src/utils/buffer-helper.ts"),n=M("./src/utils/mediasource-helper.ts"),P=M("./src/loader/fragment.ts"),p=M("./src/controller/buffer-operation-queue.ts"),m=Object(n.getMediaSource)(),d=/([ha]vc.)(?:\.[^.,]+)+/,u=function(){function o(r){var a=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 i=a.hls,s=a.media,S=a.mediaSource;I.logger.log("[buffer-controller]: Media source opened"),s&&(a.updateMediaElementDuration(),i.trigger(F.Events.MEDIA_ATTACHED,{media:s})),S&&S.removeEventListener("sourceopen",a._onMediaSourceOpen),a.checkPendingTracks()},this._onMediaSourceClose=function(){I.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){I.logger.log("[buffer-controller]: Media source ended")},this.hls=r,this._initSourceBuffer(),this.registerListeners()}var h=o.prototype;return h.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},h.destroy=function(){this.unregisterListeners(),this.details=null},h.registerListeners=function(){var a=this.hls;a.on(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(F.Events.BUFFER_RESET,this.onBufferReset,this),a.on(F.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.on(F.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.on(F.Events.BUFFER_EOS,this.onBufferEos,this),a.on(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.on(F.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.on(F.Events.FRAG_PARSED,this.onFragParsed,this),a.on(F.Events.FRAG_CHANGED,this.onFragChanged,this)},h.unregisterListeners=function(){var a=this.hls;a.off(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(F.Events.BUFFER_RESET,this.onBufferReset,this),a.off(F.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.off(F.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.off(F.Events.BUFFER_EOS,this.onBufferEos,this),a.off(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.off(F.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.off(F.Events.FRAG_PARSED,this.onFragParsed,this),a.off(F.Events.FRAG_CHANGED,this.onFragChanged,this)},h._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new p.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},h.onManifestParsed=function(a,i){var s=2;(i.audio&&!i.video||!i.altAudio)&&(s=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=s,this.details=null,I.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},h.onMediaAttaching=function(a,i){var s=this.media=i.media;if(s&&m){var S=this.mediaSource=new m;S.addEventListener("sourceopen",this._onMediaSourceOpen),S.addEventListener("sourceended",this._onMediaSourceEnded),S.addEventListener("sourceclose",this._onMediaSourceClose),s.src=self.URL.createObjectURL(S),this._objectUrl=s.src}},h.onMediaDetaching=function(){var a=this.media,i=this.mediaSource,s=this._objectUrl;if(i){if(I.logger.log("[buffer-controller]: media source detaching"),i.readyState==="open")try{i.endOfStream()}catch(S){I.logger.warn("[buffer-controller]: onMediaDetaching: "+S.message+" while calling endOfStream")}this.onBufferReset(),i.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("sourceended",this._onMediaSourceEnded),i.removeEventListener("sourceclose",this._onMediaSourceClose),a&&(s&&self.URL.revokeObjectURL(s),a.src===s?(a.removeAttribute("src"),a.load()):I.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(F.Events.MEDIA_DETACHED,void 0)},h.onBufferReset=function(){var a=this;this.getSourceBufferTypes().forEach(function(i){var s=a.sourceBuffer[i];try{s&&(a.removeBufferListeners(i),a.mediaSource&&a.mediaSource.removeSourceBuffer(s),a.sourceBuffer[i]=void 0)}catch(S){I.logger.warn("[buffer-controller]: Failed to reset the "+i+" buffer",S)}}),this._initSourceBuffer()},h.onBufferCodecs=function(a,i){var s=this,S=this.getSourceBufferTypes().length;if(Object.keys(i).forEach(function(x){if(S){var T=s.tracks[x];if(T&&typeof T.buffer.changeType=="function"){var A=i[x],w=A.codec,v=A.levelCodec,b=A.container,g=(T.levelCodec||T.codec).replace(d,"$1"),f=(v||w).replace(d,"$1");if(g!==f){var C=b+";codecs="+(v||w);s.appendChangeType(x,C)}}}else s.pendingTracks[x]=i[x]}),S)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},h.appendChangeType=function(a,i){var s=this,S=this.operationQueue,x={execute:function(){var A=s.sourceBuffer[a];A&&(I.logger.log("[buffer-controller]: changing "+a+" sourceBuffer type to "+i),A.changeType(i)),S.shiftAndExecuteNext(a)},onStart:function(){},onComplete:function(){},onError:function(A){I.logger.warn("[buffer-controller]: Failed to change "+a+" SourceBuffer type",A)}};S.append(x,a)},h.onBufferAppending=function(a,i){var s=this,S=this.hls,x=this.operationQueue,T=this.tracks,A=i.data,w=i.type,v=i.frag,b=i.part,g=i.chunkMeta,f=g.buffering[w],C=self.performance.now();f.start=C;var E=v.stats.buffering,_=b?b.stats.buffering:null;E.start===0&&(E.start=C),_&&_.start===0&&(_.start=C);var U=T.audio,j=w==="audio"&&g.id===1&&(U==null?void 0:U.container)==="audio/mpeg",L={execute:function(){if(f.executeStart=self.performance.now(),j){var B=s.sourceBuffer[w];if(B){var O=v.start-B.timestampOffset;Math.abs(O)>=.1&&(I.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+v.start+" (delta: "+O+") sn: "+v.sn+")"),B.timestampOffset=v.start)}}s.appendExecutor(A,w)},onStart:function(){},onComplete:function(){var B=self.performance.now();f.executeEnd=f.end=B,E.first===0&&(E.first=B),_&&_.first===0&&(_.first=B);var O=s.sourceBuffer,V={};for(var te in O)V[te]=N.BufferHelper.getBuffered(O[te]);s.appendError=0,s.hls.trigger(F.Events.BUFFER_APPENDED,{type:w,frag:v,part:b,chunkMeta:g,parent:v.type,timeRanges:V})},onError:function(B){I.logger.error("[buffer-controller]: Error encountered while trying to append to the "+w+" SourceBuffer",B);var O={type:H.ErrorTypes.MEDIA_ERROR,parent:v.type,details:H.ErrorDetails.BUFFER_APPEND_ERROR,err:B,fatal:!1};B.code===DOMException.QUOTA_EXCEEDED_ERR?O.details=H.ErrorDetails.BUFFER_FULL_ERROR:(s.appendError++,O.details=H.ErrorDetails.BUFFER_APPEND_ERROR,s.appendError>S.config.appendErrorMaxRetry&&(I.logger.error("[buffer-controller]: Failed "+S.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),O.fatal=!0)),S.trigger(F.Events.ERROR,O)}};x.append(L,w)},h.onBufferFlushing=function(a,i){var s=this,S=this.operationQueue,x=function(A){return{execute:s.removeExecutor.bind(s,A,i.startOffset,i.endOffset),onStart:function(){},onComplete:function(){s.hls.trigger(F.Events.BUFFER_FLUSHED,{type:A})},onError:function(v){I.logger.warn("[buffer-controller]: Failed to remove from "+A+" SourceBuffer",v)}}};i.type?S.append(x(i.type),i.type):this.getSourceBufferTypes().forEach(function(T){S.append(x(T),T)})},h.onFragParsed=function(a,i){var s=this,S=i.frag,x=i.part,T=[],A=x?x.elementaryStreams:S.elementaryStreams;A[P.ElementaryStreamTypes.AUDIOVIDEO]?T.push("audiovideo"):(A[P.ElementaryStreamTypes.AUDIO]&&T.push("audio"),A[P.ElementaryStreamTypes.VIDEO]&&T.push("video"));var w=function(){var b=self.performance.now();S.stats.buffering.end=b,x&&(x.stats.buffering.end=b);var g=x?x.stats:S.stats;s.hls.trigger(F.Events.FRAG_BUFFERED,{frag:S,part:x,stats:g,id:S.type})};T.length===0&&I.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+S.type+" level: "+S.level+" sn: "+S.sn),this.blockBuffers(w,T)},h.onFragChanged=function(a,i){this.flushBackBuffer()},h.onBufferEos=function(a,i){var s=this,S=this.getSourceBufferTypes().reduce(function(x,T){var A=s.sourceBuffer[T];return(!i.type||i.type===T)&&(A&&!A.ended&&(A.ended=!0,I.logger.log("[buffer-controller]: "+T+" sourceBuffer now EOS"))),x&&!!(!A||A.ended)},!0);S&&this.blockBuffers(function(){var x=s.mediaSource;if(!x||x.readyState!=="open")return;x.endOfStream()})},h.onLevelUpdated=function(a,i){var s=i.details;if(!s.fragments.length)return;this.details=s,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},h.flushBackBuffer=function(){var a=this.hls,i=this.details,s=this.media,S=this.sourceBuffer;if(!s||i===null)return;var x=this.getSourceBufferTypes();if(!x.length)return;var T=i.live&&a.config.liveBackBufferLength!==null?a.config.liveBackBufferLength:a.config.backBufferLength;if(!Object(X.isFiniteNumber)(T)||T<0)return;var A=s.currentTime,w=i.levelTargetDuration,v=Math.max(T,w),b=Math.floor(A/w)*w-v;x.forEach(function(g){var f=S[g];if(f){var C=N.BufferHelper.getBuffered(f);C.length>0&&b>C.start(0)&&(a.trigger(F.Events.BACK_BUFFER_REACHED,{bufferEnd:b}),i.live&&a.trigger(F.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:b}),a.trigger(F.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:b,type:g}))}})},h.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var a=this.details,i=this.hls,s=this.media,S=this.mediaSource,x=a.fragments[0].start+a.totalduration,T=s.duration,A=Object(X.isFiniteNumber)(S.duration)?S.duration:0;a.live&&i.config.liveDurationInfinity?(I.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),S.duration=Infinity,this.updateSeekableRange(a)):(x>A&&x>T||!Object(X.isFiniteNumber)(T))&&(I.logger.log("[buffer-controller]: Updating Media Source duration to "+x.toFixed(3)),S.duration=x)},h.updateSeekableRange=function(a){var i=this.mediaSource,s=a.fragments,S=s.length;if(S&&a.live&&i!==null&&i!==void 0&&i.setLiveSeekableRange){var x=Math.max(0,s[0].start),T=Math.max(x,x+a.totalduration);i.setLiveSeekableRange(x,T)}},h.checkPendingTracks=function(){var a=this.bufferCodecEventsExpected,i=this.operationQueue,s=this.pendingTracks,S=Object.keys(s).length;if(S&&!a||S===2){this.createSourceBuffers(s),this.pendingTracks={};var x=this.getSourceBufferTypes();if(x.length===0){this.hls.trigger(F.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}x.forEach(function(T){i.executeNext(T)})}},h.createSourceBuffers=function(a){var i=this.sourceBuffer,s=this.mediaSource;if(!s)throw Error("createSourceBuffers called when mediaSource was null");var S=0;for(var x in a)if(!i[x]){var T=a[x];if(!T)throw Error("source buffer exists for track "+x+", however track does not");var A=T.levelCodec||T.codec,w=T.container+";codecs="+A;I.logger.log("[buffer-controller]: creating sourceBuffer("+w+")");try{var v=i[x]=s.addSourceBuffer(w),b=x;this.addBufferListener(b,"updatestart",this._onSBUpdateStart),this.addBufferListener(b,"updateend",this._onSBUpdateEnd),this.addBufferListener(b,"error",this._onSBUpdateError),this.tracks[x]={buffer:v,codec:A,container:T.container,levelCodec:T.levelCodec,id:T.id},S++}catch(g){I.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+g.message),this.hls.trigger(F.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:g,mimeType:w})}}S&&this.hls.trigger(F.Events.BUFFER_CREATED,{tracks:this.tracks})},h._onSBUpdateStart=function(a){var i=this.operationQueue,s=i.current(a);s.onStart()},h._onSBUpdateEnd=function(a){var i=this.operationQueue,s=i.current(a);s.onComplete(),i.shiftAndExecuteNext(a)},h._onSBUpdateError=function(a,i){I.logger.error("[buffer-controller]: "+a+" SourceBuffer error",i),this.hls.trigger(F.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var s=this.operationQueue.current(a);s&&s.onError(i)},h.removeExecutor=function(a,i,s){var S=this.media,x=this.mediaSource,T=this.operationQueue,A=this.sourceBuffer,w=A[a];if(!S||!x||!w){I.logger.warn("[buffer-controller]: Attempting to remove from the "+a+" SourceBuffer, but it does not exist"),T.shiftAndExecuteNext(a);return}var v=Object(X.isFiniteNumber)(S.duration)?S.duration:Infinity,b=Object(X.isFiniteNumber)(x.duration)?x.duration:Infinity,g=Math.max(0,i),f=Math.min(s,v,b);f>g?(I.logger.log("[buffer-controller]: Removing ["+g+","+f+"] from the "+a+" SourceBuffer"),console.assert(!w.updating,a+" sourceBuffer must not be updating"),w.remove(g,f)):T.shiftAndExecuteNext(a)},h.appendExecutor=function(a,i){var s=this.operationQueue,S=this.sourceBuffer,x=S[i];if(!x){I.logger.warn("[buffer-controller]: Attempting to append to the "+i+" SourceBuffer, but it does not exist"),s.shiftAndExecuteNext(i);return}x.ended=!1,console.assert(!x.updating,i+" sourceBuffer must not be updating"),x.appendBuffer(a)},h.blockBuffers=function(a,i){var s=this;if(i===void 0&&(i=this.getSourceBufferTypes()),!i.length){I.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(a);return}var S=this.operationQueue,x=i.map(function(T){return S.appendBlocker(T)});Promise.all(x).then(function(){a(),i.forEach(function(T){var A=s.sourceBuffer[T];(!A||!A.updating)&&S.shiftAndExecuteNext(T)})})},h.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},h.addBufferListener=function(a,i,s){var S=this.sourceBuffer[a];if(!S)return;var x=s.bind(this,a);this.listeners[a].push({event:i,listener:x}),S.addEventListener(i,x)},h.removeBufferListeners=function(a){var i=this.sourceBuffer[a];if(!i)return;this.listeners[a].forEach(function(s){i.removeEventListener(s.event,s.listener)})},o}()},"./src/controller/buffer-operation-queue.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"default",function(){return F});var X=M("./src/utils/logger.ts"),F=function(){function I(N){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=N}var H=I.prototype;return H.append=function(n,P){var p=this.queues[P];p.push(n),p.length===1&&this.buffers[P]&&this.executeNext(P)},H.insertAbort=function(n,P){var p=this.queues[P];p.unshift(n),this.executeNext(P)},H.appendBlocker=function(n){var P,p=new Promise(function(d){P=d}),m={execute:P,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(m,n),p},H.executeNext=function(n){var P=this.buffers,p=this.queues,m=P[n],d=p[n];if(d.length){var u=d[0];try{u.execute()}catch(o){X.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),u.onError(o),(!m||!m.updating)&&(d.shift(),this.executeNext(n))}}},H.shiftAndExecuteNext=function(n){this.queues[n].shift(),this.executeNext(n)},H.current=function(n){return this.queues[n][0]},I}()},"./src/controller/cap-level-controller.ts":function(Q,z,M){"use strict";M.r(z);var X=M("./src/events.ts");function F(N,n){for(var P=0;P<n.length;P++){var p=n[P];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(N,p.key,p)}}function I(N,n,P){return n&&F(N.prototype,n),P&&F(N,P),N}var H=function(){function N(P){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=P,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var n=N.prototype;return n.setStreamController=function(p){this.streamController=p},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 p=this.hls;p.on(X.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),p.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),p.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),p.on(X.Events.BUFFER_CODECS,this.onBufferCodecs,this),p.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.unregisterListener=function(){var p=this.hls;p.off(X.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),p.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),p.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),p.off(X.Events.BUFFER_CODECS,this.onBufferCodecs,this),p.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.onFpsDropLevelCapping=function(p,m){N.isLevelAllowed(m.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(m.droppedLevel)},n.onMediaAttaching=function(p,m){this.media=m.media instanceof HTMLVideoElement?m.media:null},n.onManifestParsed=function(p,m){var d=this.hls;this.restrictedLevels=[],this.firstLevel=m.firstLevel,d.config.capLevelToPlayerSize&&m.video&&this.startCapping()},n.onBufferCodecs=function(p,m){var d=this.hls;d.config.capLevelToPlayerSize&&m.video&&this.startCapping()},n.onMediaDetaching=function(){this.stopCapping()},n.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var p=this.hls.levels;if(p.length){var m=this.hls;m.autoLevelCapping=this.getMaxLevel(p.length-1),m.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=m.autoLevelCapping}}},n.getMaxLevel=function(p){var m=this,d=this.hls.levels;if(!d.length)return-1;var u=d.filter(function(o,h){return N.isLevelAllowed(h,m.restrictedLevels)&&h<=p});return this.clientRect=null,N.getMaxLevelByMediaSize(u,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 p=this.media,m={width:0,height:0};if(p){var d=p.getBoundingClientRect();m.width=d.width,m.height=d.height,!m.width&&!m.height&&(m.width=d.right-d.left||p.width||0,m.height=d.bottom-d.top||p.height||0)}return this.clientRect=m,m},N.isLevelAllowed=function(p,m){return m===void 0&&(m=[]),m.indexOf(p)===-1},N.getMaxLevelByMediaSize=function(p,m,d){if(!p||!p.length)return-1;for(var u=function(i,s){return s?i.width!==s.width||i.height!==s.height:!0},o=p.length-1,h=0;h<p.length;h+=1){var r=p[h];if((r.width>=m||r.height>=d)&&u(r,p[h+1])){o=h;break}}return o},I(N,[{key:"mediaWidth",get:function(){return this.getDimensions().width*N.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*N.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var p=1;try{p=self.devicePixelRatio}catch(m){}return p}}]),N}();z.default=H},"./src/controller/cmcd-controller.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"default",function(){return u});var X=M("./src/events.ts"),F=M("./src/types/cmcd.ts"),I=M("./src/utils/buffer-helper.ts"),H=M("./src/utils/logger.ts");function N(o,h){for(var r=0;r<h.length;r++){var a=h[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(o,a.key,a)}}function n(o,h,r){return h&&N(o.prototype,h),r&&N(o,r),o}function P(o,h){var r=typeof Symbol!="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(r)return(r=r.call(o)).next.bind(r);if(Array.isArray(o)||(r=p(o))||h&&o&&typeof o.length=="number"){r&&(o=r);var a=0;return function(){return a>=o.length?{done:!0}:{done:!1,value:o[a++]}}}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 p(o,h){if(!o)return;if(typeof o=="string")return m(o,h);var r=Object.prototype.toString.call(o).slice(8,-1);if(r==="Object"&&o.constructor&&(r=o.constructor.name),r==="Map"||r==="Set")return Array.from(o);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(o,h)}function m(o,h){(h==null||h>o.length)&&(h=o.length);for(var r=0,a=new Array(h);r<h;r++)a[r]=o[r];return a}function d(){return d=Object.assign||function(o){for(var h=1;h<arguments.length;h++){var r=arguments[h];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(o[a]=r[a])}return o},d.apply(this,arguments)}var u=function(){function o(r){var a=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(){a.initialized&&(a.starved=!0),a.buffering=!0},this.onPlaying=function(){a.initialized||(a.initialized=!0),a.buffering=!1},this.applyPlaylistData=function(S){try{a.apply(S,{ot:F.CMCDObjectType.MANIFEST,su:!a.initialized})}catch(x){H.logger.warn("Could not generate manifest CMCD data.",x)}},this.applyFragmentData=function(S){try{var x=S.frag,T=a.hls.levels[x.level],A=a.getObjectType(x),w={d:x.duration*1e3,ot:A};(A===F.CMCDObjectType.VIDEO||A===F.CMCDObjectType.AUDIO||A==F.CMCDObjectType.MUXED)&&(w.br=T.bitrate/1e3,w.tb=a.getTopBandwidth(A),w.bl=a.getBufferLength(A)),a.apply(S,w)}catch(v){H.logger.warn("Could not generate segment CMCD data.",v)}},this.hls=r;var i=this.config=r.config,s=i.cmcd;s!=null&&(i.pLoader=this.createPlaylistLoader(),i.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||o.uuid(),this.cid=s.contentId,this.useHeaders=s.useHeaders===!0,this.registerListeners())}var h=o.prototype;return h.registerListeners=function(){var a=this.hls;a.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),a.on(X.Events.BUFFER_CREATED,this.onBufferCreated,this)},h.unregisterListeners=function(){var a=this.hls;a.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),a.off(X.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},h.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},h.onMediaAttached=function(a,i){this.media=i.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},h.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},h.onBufferCreated=function(a,i){var s,S;this.audioBuffer=(s=i.tracks.audio)===null||s===void 0?void 0:s.buffer,this.videoBuffer=(S=i.tracks.video)===null||S===void 0?void 0:S.buffer},h.createData=function(){var a;return{v:F.CMCDVersion,sf:F.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(a=this.media)===null||a===void 0?void 0:a.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},h.apply=function(a,i){i===void 0&&(i={}),d(i,this.createData());var s=i.ot===F.CMCDObjectType.INIT||i.ot===F.CMCDObjectType.VIDEO||i.ot===F.CMCDObjectType.MUXED;if(this.starved&&s&&(i.bs=!0,i.su=!0,this.starved=!1),i.su==null&&(i.su=this.buffering),this.useHeaders){var S=o.toHeaders(i);if(!Object.keys(S).length)return;a.headers||(a.headers={}),d(a.headers,S)}else{var x=o.toQuery(i);if(!x)return;a.url=o.appendQueryToUri(a.url,x)}},h.getObjectType=function(a){var i=a.type;return i==="subtitle"?F.CMCDObjectType.TIMED_TEXT:a.sn==="initSegment"?F.CMCDObjectType.INIT:i==="audio"?F.CMCDObjectType.AUDIO:i==="main"?this.hls.audioTracks.length?F.CMCDObjectType.VIDEO:F.CMCDObjectType.MUXED:void 0},h.getTopBandwidth=function(a){for(var i=0,s=a===F.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,S=P(s),x;!(x=S()).done;){var T=x.value;T.bitrate>i&&(i=T.bitrate)}return i>0?i:NaN},h.getBufferLength=function(a){var i=this.hls.media,s=a===F.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!s||!i)return NaN;var S=I.BufferHelper.bufferInfo(s,i.currentTime,this.config.maxBufferHole);return S.len*1e3},h.createPlaylistLoader=function(){var a=this.config.pLoader,i=this.applyPlaylistData,s=a||this.config.loader;return function(){function S(T){this.loader=void 0,this.loader=new s(T)}var x=S.prototype;return x.destroy=function(){this.loader.destroy()},x.abort=function(){this.loader.abort()},x.load=function(A,w,v){i(A),this.loader.load(A,w,v)},n(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},h.createFragmentLoader=function(){var a=this.config.fLoader,i=this.applyFragmentData,s=a||this.config.loader;return function(){function S(T){this.loader=void 0,this.loader=new s(T)}var x=S.prototype;return x.destroy=function(){this.loader.destroy()},x.abort=function(){this.loader.abort()},x.load=function(A,w,v){i(A),this.loader.load(A,w,v)},n(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},o.uuid=function(){var a=URL.createObjectURL(new Blob),i=a.toString();return URL.revokeObjectURL(a),i.substr(i.lastIndexOf("/")+1)},o.serialize=function(a){for(var i=[],s=function(j){return!Number.isNaN(j)&&j!=null&&j!==""&&j!==!1},S=function(j){return Math.round(j)},x=function(j){return S(j/100)*100},T=function(j){return encodeURIComponent(j)},A={br:S,d:S,bl:x,dl:x,mtp:x,nor:T,rtp:x,tb:S},w=Object.keys(a||{}).sort(),v=P(w),b;!(b=v()).done;){var g=b.value,f=a[g];if(!s(f))continue;if(g==="v"&&f===1)continue;if(g=="pr"&&f===1)continue;var C=A[g];C&&(f=C(f));var E=typeof f,_=void 0;g==="ot"||g==="sf"||g==="st"?_=g+"="+f:E==="boolean"?_=g:E==="number"?_=g+"="+f:_=g+"="+JSON.stringify(f),i.push(_)}return i.join(",")},o.toHeaders=function(a){for(var i=Object.keys(a),s={},S=["Object","Request","Session","Status"],x=[{},{},{},{}],T={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},A=0,w=i;A<w.length;A++){var v=w[A],b=T[v]!=null?T[v]:1;x[b][v]=a[v]}for(var g=0;g<x.length;g++){var f=o.serialize(x[g]);f&&(s["CMCD-"+S[g]]=f)}return s},o.toQuery=function(a){return"CMCD="+encodeURIComponent(o.serialize(a))},o.appendQueryToUri=function(a,i){if(!i)return a;var s=a.includes("?")?"&":"?";return""+a+s+i},o}()},"./src/controller/eme-controller.ts":function(Q,z,M){"use strict";M.r(z);var X=M("./src/events.ts"),F=M("./src/errors.ts"),I=M("./src/utils/logger.ts"),H=M("./src/utils/mediakeys-helper.ts");function N(u,o){for(var h=0;h<o.length;h++){var r=o[h];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(u,r.key,r)}}function n(u,o,h){return o&&N(u.prototype,o),h&&N(u,h),u}var P=3,p=function(o,h,r){var a={audioCapabilities:[],videoCapabilities:[]};return o.forEach(function(i){a.audioCapabilities.push({contentType:'audio/mp4; codecs="'+i+'"',robustness:r.audioRobustness||""})}),h.forEach(function(i){a.videoCapabilities.push({contentType:'video/mp4; codecs="'+i+'"',robustness:r.videoRobustness||""})}),[a]},m=function(o,h,r,a){switch(o){case H.KeySystems.WIDEVINE:return p(h,r,a);default:throw new Error("Unknown key-system: "+o)}},d=function(){function u(h){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=h,this._config=h.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 o=u.prototype;return o.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},o._registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this)},o._unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this)},o.getLicenseServerUrl=function(r){switch(r){case H.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+r+'"')},o._attemptKeySystemAccess=function(r,a,i){var s=this,S=m(r,a,i,this._drmSystemOptions);I.logger.log("Requesting encrypted media key-system access");var x=this.requestMediaKeySystemAccess(r,S);this.mediaKeysPromise=x.then(function(T){return s._onMediaKeySystemAccessObtained(r,T)}),x.catch(function(T){I.logger.error('Failed to obtain key-system "'+r+'" access:',T)})},o._onMediaKeySystemAccessObtained=function(r,a){var i=this;I.logger.log('Access for key-system "'+r+'" obtained');var s={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:a,mediaKeySystemDomain:r};this._mediaKeysList.push(s);var S=Promise.resolve().then(function(){return a.createMediaKeys()}).then(function(x){return s.mediaKeys=x,I.logger.log('Media-keys created for key-system "'+r+'"'),i._onMediaKeysCreated(),x});return S.catch(function(x){I.logger.error("Failed to create media-keys:",x)}),S},o._onMediaKeysCreated=function(){var r=this;this._mediaKeysList.forEach(function(a){a.mediaKeysSession||(a.mediaKeysSession=a.mediaKeys.createSession(),r._onNewMediaKeySession(a.mediaKeysSession))})},o._onNewMediaKeySession=function(r){var a=this;I.logger.log("New key-system session "+r.sessionId),r.addEventListener("message",function(i){a._onKeySessionMessage(r,i.message)},!1)},o._onKeySessionMessage=function(r,a){I.logger.log("Got EME message event, creating license request"),this._requestLicense(a,function(i){I.logger.log("Received license data (length: "+(i&&i.byteLength)+"), updating key-session"),r.update(i)})},o.onMediaEncrypted=function(r){var a=this;if(I.logger.log('Media is encrypted using "'+r.initDataType+'" init data type'),!this.mediaKeysPromise){I.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var i=function(S){if(!a._media)return;a._attemptSetMediaKeys(S),a._generateRequestWithPreferredKeySession(r.initDataType,r.initData)};this.mediaKeysPromise.then(i).catch(i)},o._attemptSetMediaKeys=function(r){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var a=this._mediaKeysList[0];if(!a||!a.mediaKeys){I.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}I.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(a.mediaKeys),this._hasSetMediaKeys=!0}},o._generateRequestWithPreferredKeySession=function(r,a){var i=this,s=this._mediaKeysList[0];if(!s){I.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(s.mediaKeysSessionInitialized){I.logger.warn("Key-Session already initialized but requested again");return}var S=s.mediaKeysSession;if(!S){I.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!a){I.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}I.logger.log('Generating key-session request for "'+r+'" init data type'),s.mediaKeysSessionInitialized=!0,S.generateRequest(r,a).then(function(){I.logger.debug("Key-session generation succeeded")}).catch(function(x){I.logger.error("Error generating key-session request:",x),i.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},o._createLicenseXhr=function(r,a,i){var s=new XMLHttpRequest;s.responseType="arraybuffer",s.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,s,r,a,i);var S=this._licenseXhrSetup;if(S)try{S.call(this.hls,s,r),S=void 0}catch(x){I.logger.error(x)}try{s.readyState||s.open("POST",r,!0),S&&S.call(this.hls,s,r)}catch(x){throw new Error("issue setting up KeySystem license XHR "+x)}return s},o._onLicenseRequestReadyStageChange=function(r,a,i,s){switch(r.readyState){case 4:if(r.status===200){this._requestLicenseFailureCount=0,I.logger.log("License request succeeded");var S=r.response,x=this._licenseResponseCallback;if(x)try{S=x.call(this.hls,r,a)}catch(A){I.logger.error(A)}s(S)}else{if(I.logger.error("License Request XHR failed ("+a+"). Status: "+r.status+" ("+r.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>P){this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var T=P-this._requestLicenseFailureCount+1;I.logger.warn("Retrying license request, "+T+" attempts left"),this._requestLicense(i,s)}break}},o._generateLicenseRequestChallenge=function(r,a){switch(r.mediaKeySystemDomain){case H.KeySystems.WIDEVINE:return a}throw new Error("unsupported key-system: "+r.mediaKeySystemDomain)},o._requestLicense=function(r,a){I.logger.log("Requesting content license for key-system");var i=this._mediaKeysList[0];if(!i){I.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var s=this.getLicenseServerUrl(i.mediaKeySystemDomain),S=this._createLicenseXhr(s,r,a);I.logger.log("Sending license request to URL: "+s);var x=this._generateLicenseRequestChallenge(i,r);S.send(x)}catch(T){I.logger.error("Failure requesting DRM license: "+T),this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},o.onMediaAttached=function(r,a){if(!this._emeEnabled)return;var i=a.media;this._media=i,i.addEventListener("encrypted",this._onMediaEncrypted)},o.onMediaDetached=function(){var r=this._media,a=this._mediaKeysList;if(!r)return;r.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(a.map(function(i){if(i.mediaKeysSession)return i.mediaKeysSession.close().catch(function(){})})).then(function(){return r.setMediaKeys(null)}).catch(function(){})},o.onManifestParsed=function(r,a){if(!this._emeEnabled)return;var i=a.levels.map(function(S){return S.audioCodec}).filter(function(S){return!!S}),s=a.levels.map(function(S){return S.videoCodec}).filter(function(S){return!!S});this._attemptKeySystemAccess(H.KeySystems.WIDEVINE,i,s)},n(u,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),u}();z.default=d},"./src/controller/fps-controller.ts":function(Q,z,M){"use strict";M.r(z);var X=M("./src/events.ts"),F=M("./src/utils/logger.ts"),I=function(){function H(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 N=H.prototype;return N.setStreamController=function(P){this.streamController=P},N.registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},N.unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching)},N.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},N.onMediaAttaching=function(P,p){var m=this.hls.config;if(m.capLevelOnFPSDrop){var d=p.media instanceof self.HTMLVideoElement?p.media:null;this.media=d,d&&typeof d.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),m.fpsDroppedMonitoringPeriod)}},N.checkFPS=function(P,p,m){var d=performance.now();if(p){if(this.lastTime){var u=d-this.lastTime,o=m-this.lastDroppedFrames,h=p-this.lastDecodedFrames,r=1e3*o/u,a=this.hls;if(a.trigger(X.Events.FPS_DROP,{currentDropped:o,currentDecoded:h,totalDroppedFrames:m}),r>0&&o>a.config.fpsDroppedMonitoringThreshold*h){var i=a.currentLevel;F.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+i),i>0&&(a.autoLevelCapping===-1||a.autoLevelCapping>=i)&&(i=i-1,a.trigger(X.Events.FPS_DROP_LEVEL_CAPPING,{level:i,droppedLevel:a.currentLevel}),a.autoLevelCapping=i,this.streamController.nextLevelSwitch())}}this.lastTime=d,this.lastDroppedFrames=m,this.lastDecodedFrames=p}},N.checkFPSInterval=function(){var P=this.media;if(P)if(this.isVideoPlaybackQualityAvailable){var p=P.getVideoPlaybackQuality();this.checkFPS(P,p.totalVideoFrames,p.droppedVideoFrames)}else this.checkFPS(P,P.webkitDecodedFrameCount,P.webkitDroppedFrameCount)},H}();z.default=I},"./src/controller/fragment-finders.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"findFragmentByPDT",function(){return I}),M.d(z,"findFragmentByPTS",function(){return H}),M.d(z,"fragmentWithinToleranceTest",function(){return N}),M.d(z,"pdtWithinToleranceTest",function(){return n}),M.d(z,"findFragWithCC",function(){return P});var X=M("./src/polyfills/number.ts"),F=M("./src/utils/binary-search.ts");function I(p,m,d){if(m===null||!Array.isArray(p)||!p.length||!Object(X.isFiniteNumber)(m))return null;var u=p[0].programDateTime;if(m<(u||0))return null;var o=p[p.length-1].endProgramDateTime;if(m>=(o||0))return null;d=d||0;for(var h=0;h<p.length;++h){var r=p[h];if(n(m,d,r))return r}return null}function H(p,m,d,u){d===void 0&&(d=0),u===void 0&&(u=0);var o=null;if(p?o=m[p.sn-m[0].sn+1]||null:d===0&&m[0].start===0&&(o=m[0]),o&&N(d,u,o)===0)return o;var h=F.default.search(m,N.bind(null,d,u));return h||o}function N(p,m,d){p===void 0&&(p=0),m===void 0&&(m=0);var u=Math.min(m,d.duration+(d.deltaPTS?d.deltaPTS:0));return d.start+d.duration-u<=p?1:d.start-u>p&&d.start?-1:0}function n(p,m,d){var u=Math.min(m,d.duration+(d.deltaPTS?d.deltaPTS:0))*1e3,o=d.endProgramDateTime||0;return o-u>p}function P(p,m){return F.default.search(p,function(d){return d.cc<m?1:d.cc>m?-1:0})}},"./src/controller/fragment-tracker.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"FragmentState",function(){return I}),M.d(z,"FragmentTracker",function(){return H});var X=M("./src/events.ts"),F=M("./src/types/loader.ts"),I;(function(P){P.NOT_LOADED="NOT_LOADED",P.BACKTRACKED="BACKTRACKED",P.APPENDING="APPENDING",P.PARTIAL="PARTIAL",P.OK="OK"})(I||(I={}));var H=function(){function P(m){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=m,this._registerListeners()}var p=P.prototype;return p._registerListeners=function(){var d=this.hls;d.on(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),d.on(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),d.on(X.Events.FRAG_LOADED,this.onFragLoaded,this)},p._unregisterListeners=function(){var d=this.hls;d.off(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),d.off(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),d.off(X.Events.FRAG_LOADED,this.onFragLoaded,this)},p.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},p.getAppendedFrag=function(d,u){if(u===F.PlaylistLevelType.MAIN){var o=this.activeFragment,h=this.activeParts;if(!o)return null;if(h)for(var r=h.length;r--;){var a=h[r],i=a?a.end:o.appendedPTS;if(a.start<=d&&i!==void 0&&d<=i)return r>9&&(this.activeParts=h.slice(r-9)),a}else if(o.start<=d&&o.appendedPTS!==void 0&&d<=o.appendedPTS)return o}return this.getBufferedFrag(d,u)},p.getBufferedFrag=function(d,u){for(var o=this.fragments,h=Object.keys(o),r=h.length;r--;){var a=o[h[r]];if((a==null?void 0:a.body.type)===u&&a.buffered){var i=a.body;if(i.start<=d&&d<=i.end)return i}}return null},p.detectEvictedFragments=function(d,u,o){var h=this;Object.keys(this.fragments).forEach(function(r){var a=h.fragments[r];if(!a)return;if(!a.buffered){a.body.type===o&&h.removeFragment(a.body);return}var i=a.range[d];if(!i)return;i.time.some(function(s){var S=!h.isTimeBuffered(s.startPTS,s.endPTS,u);return S&&h.removeFragment(a.body),S})})},p.detectPartialFragments=function(d){var u=this,o=this.timeRanges,h=d.frag,r=d.part;if(!o||h.sn==="initSegment")return;var a=n(h),i=this.fragments[a];if(!i)return;Object.keys(o).forEach(function(s){var S=h.elementaryStreams[s];if(!S)return;var x=o[s],T=r!==null||S.partial===!0;i.range[s]=u.getBufferedTimes(h,r,T,x)}),i.backtrack=i.loaded=null,Object.keys(i.range).length?i.buffered=!0:this.removeFragment(i.body)},p.fragBuffered=function(d){var u=n(d),o=this.fragments[u];o&&(o.backtrack=o.loaded=null,o.buffered=!0)},p.getBufferedTimes=function(d,u,o,h){for(var r={time:[],partial:o},a=u?u.start:d.start,i=u?u.end:d.end,s=d.minEndPTS||i,S=d.maxStartPTS||a,x=0;x<h.length;x++){var T=h.start(x)-this.bufferPadding,A=h.end(x)+this.bufferPadding;if(S>=T&&s<=A){r.time.push({startPTS:Math.max(a,h.start(x)),endPTS:Math.min(i,h.end(x))});break}else if(a<A&&i>T)r.partial=!0,r.time.push({startPTS:Math.max(a,h.start(x)),endPTS:Math.min(i,h.end(x))});else if(i<=T)break}return r},p.getPartialFragment=function(d){var u=null,o,h,r,a=0,i=this.bufferPadding,s=this.fragments;return Object.keys(s).forEach(function(S){var x=s[S];if(!x)return;N(x)&&(h=x.body.start-i,r=x.body.end+i,d>=h&&d<=r&&(o=Math.min(d-h,r-d),a<=o&&(u=x.body,a=o)))}),u},p.getState=function(d){var u=n(d),o=this.fragments[u];return o?o.buffered?N(o)?I.PARTIAL:I.OK:o.backtrack?I.BACKTRACKED:I.APPENDING:I.NOT_LOADED},p.backtrack=function(d,u){var o=n(d),h=this.fragments[o];if(!h||h.backtrack)return null;var r=h.backtrack=u||h.loaded;return h.loaded=null,r},p.getBacktrackData=function(d){var u=n(d),o=this.fragments[u];if(o){var h,r=o.backtrack;if(r!=null&&(h=r.payload)!==null&&h!==void 0&&h.byteLength)return r;this.removeFragment(d)}return null},p.isTimeBuffered=function(d,u,o){for(var h,r,a=0;a<o.length;a++){if(h=o.start(a)-this.bufferPadding,r=o.end(a)+this.bufferPadding,d>=h&&u<=r)return!0;if(u<=h)return!1}return!1},p.onFragLoaded=function(d,u){var o=u.frag,h=u.part;if(o.sn==="initSegment"||o.bitrateTest||h)return;var r=n(o);this.fragments[r]={body:o,loaded:u,backtrack:null,buffered:!1,range:Object.create(null)}},p.onBufferAppended=function(d,u){var o=this,h=u.frag,r=u.part,a=u.timeRanges;if(h.type===F.PlaylistLevelType.MAIN)if(this.activeFragment=h,r){var i=this.activeParts;i||(this.activeParts=i=[]),i.push(r)}else this.activeParts=null;this.timeRanges=a,Object.keys(a).forEach(function(s){var S=a[s];if(o.detectEvictedFragments(s,S),!r)for(var x=0;x<S.length;x++)h.appendedPTS=Math.max(S.end(x),h.appendedPTS||0)})},p.onFragBuffered=function(d,u){this.detectPartialFragments(u)},p.hasFragment=function(d){var u=n(d);return!!this.fragments[u]},p.removeFragmentsInRange=function(d,u,o){var h=this;Object.keys(this.fragments).forEach(function(r){var a=h.fragments[r];if(!a)return;if(a.buffered){var i=a.body;i.type===o&&i.start<u&&i.end>d&&h.removeFragment(i)}})},p.removeFragment=function(d){var u=n(d);d.stats.loaded=0,d.clearElementaryStreamInfo(),delete this.fragments[u]},p.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},P}();function N(P){var p,m;return P.buffered&&(((p=P.range.video)===null||p===void 0?void 0:p.partial)||((m=P.range.audio)===null||m===void 0?void 0:m.partial))}function n(P){return P.type+"_"+P.level+"_"+P.urlId+"_"+P.sn}},"./src/controller/gap-controller.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"STALL_MINIMUM_DURATION_MS",function(){return N}),M.d(z,"MAX_START_GAP_JUMP",function(){return n}),M.d(z,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return P}),M.d(z,"SKIP_BUFFER_RANGE_START",function(){return p}),M.d(z,"default",function(){return m});var X=M("./src/utils/buffer-helper.ts"),F=M("./src/errors.ts"),I=M("./src/events.ts"),H=M("./src/utils/logger.ts"),N=250,n=2,P=.1,p=.05,m=function(){function d(o,h,r,a){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=o,this.media=h,this.fragmentTracker=r,this.hls=a}var u=d.prototype;return u.destroy=function(){this.hls=this.fragmentTracker=this.media=null},u.poll=function(h){var r=this.config,a=this.media,i=this.stalled,s=a.currentTime,S=a.seeking,x=this.seeking&&!S,T=!this.seeking&&S;if(this.seeking=S,s!==h){if(this.moved=!0,i!==null){if(this.stallReported){var A=self.performance.now()-i;H.logger.warn("playback not stuck anymore @"+s+", after "+Math.round(A)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((T||x)&&(this.stalled=null),a.paused||a.ended||a.playbackRate===0||!X.BufferHelper.getBuffered(a).length)return;var w=X.BufferHelper.bufferInfo(a,s,0),v=w.len>0,b=w.nextStart||0;if(!v&&!b)return;if(S){var g=w.len>n,f=!b||b-s>n&&!this.fragmentTracker.getPartialFragment(s);if(g||f)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var C,E=Math.max(b,w.start||0)-s,_=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,U=_==null||((C=_.details)===null||C===void 0)?void 0:C.live,j=U?_.details.targetduration*2:n;if(E>0&&E<=j){this._trySkipBufferHole(null);return}}var L=self.performance.now();if(i===null){this.stalled=L;return}var G=L-i;!S&&G>=N&&this._reportStall(w.len);var B=X.BufferHelper.bufferInfo(a,s,r.maxBufferHole);this._tryFixBufferStall(B,G)},u._tryFixBufferStall=function(h,r){var a=this.config,i=this.fragmentTracker,s=this.media,S=s.currentTime,x=i.getPartialFragment(S);if(x){var T=this._trySkipBufferHole(x);if(T)return}h.len>a.maxBufferHole&&r>a.highBufferWatchdogPeriod*1e3&&(H.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},u._reportStall=function(h){var r=this.hls,a=this.media,i=this.stallReported;i||(this.stallReported=!0,H.logger.warn("Playback stalling at @"+a.currentTime+" due to low buffer (buffer="+h+")"),r.trigger(I.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:h}))},u._trySkipBufferHole=function(h){for(var r=this.config,a=this.hls,i=this.media,s=i.currentTime,S=0,x=X.BufferHelper.getBuffered(i),T=0;T<x.length;T++){var A=x.start(T);if(s+r.maxBufferHole>=S&&s<A){var w=Math.max(A+p,i.currentTime+P);return H.logger.warn("skipping hole, adjusting currentTime from "+s+" to "+w),this.moved=!0,this.stalled=null,i.currentTime=w,h&&a.trigger(I.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+s+" to "+w,frag:h}),w}S=x.end(T)}return 0},u._tryNudgeBuffer=function(){var h=this.config,r=this.hls,a=this.media,i=a.currentTime,s=(this.nudgeRetry||0)+1;if(this.nudgeRetry=s,s<h.nudgeMaxRetry){var S=i+s*h.nudgeOffset;H.logger.warn("Nudging 'currentTime' from "+i+" to "+S),a.currentTime=S,r.trigger(I.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else H.logger.error("Playhead still not moving while enough data buffered @"+i+" after "+h.nudgeMaxRetry+" nudges"),r.trigger(I.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},d}()},"./src/controller/id3-track-controller.ts":function(Q,z,M){"use strict";M.r(z);var X=M("./src/events.ts"),F=M("./src/utils/texttrack-utils.ts"),I=M("./src/demux/id3.ts"),H=.25,N=function(){function n(p){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=p,this._registerListeners()}var P=n.prototype;return P.destroy=function(){this._unregisterListeners()},P._registerListeners=function(){var m=this.hls;m.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(X.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.on(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},P._unregisterListeners=function(){var m=this.hls;m.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(X.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.off(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},P.onMediaAttached=function(m,d){this.media=d.media},P.onMediaDetaching=function(){if(!this.id3Track)return;Object(F.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},P.getID3Track=function(m){if(!this.media)return;for(var d=0;d<m.length;d++){var u=m[d];if(u.kind==="metadata"&&u.label==="id3")return Object(F.sendAddTrackEvent)(u,this.media),u}return this.media.addTextTrack("metadata","id3")},P.onFragParsingMetadata=function(m,d){if(!this.media)return;var u=d.frag,o=d.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var h=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,r=0;r<o.length;r++){var a=I.getID3Frames(o[r].data);if(a){var i=o[r].pts,s=r<o.length-1?o[r+1].pts:u.end,S=s-i;S<=0&&(s=i+H);for(var x=0;x<a.length;x++){var T=a[x];if(!I.isTimeStampFrame(T)){var A=new h(i,s,"");A.value=T,this.id3Track.addCue(A)}}}}},P.onBufferFlushing=function(m,d){var u=d.startOffset,o=d.endOffset,h=d.type;if(!h||h==="audio"){var r=this.id3Track;r&&Object(F.removeCuesInRange)(r,u,o)}},n}();z.default=N},"./src/controller/latency-controller.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"default",function(){return n});var X=M("./src/errors.ts"),F=M("./src/events.ts"),I=M("./src/utils/logger.ts");function H(P,p){for(var m=0;m<p.length;m++){var d=p[m];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(P,d.key,d)}}function N(P,p,m){return p&&H(P.prototype,p),m&&H(P,m),P}var n=function(){function P(m){var d=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 d.timeupdate()},this.hls=m,this.config=m.config,this.registerListeners()}var p=P.prototype;return p.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},p.registerListeners=function(){this.hls.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(F.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(F.Events.ERROR,this.onError,this)},p.unregisterListeners=function(){this.hls.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(F.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(F.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(F.Events.ERROR,this.onError)},p.onMediaAttached=function(d,u){this.media=u.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},p.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},p.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},p.onLevelUpdated=function(d,u){var o=u.details;this.levelDetails=o,o.advanced&&this.timeupdate(),!o.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},p.onError=function(d,u){if(u.details!==X.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,I.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},p.timeupdate=function(){var d=this.media,u=this.levelDetails;if(!d||!u)return;this.currentTime=d.currentTime;var o=this.computeLatency();if(o===null)return;this._latency=o;var h=this.config,r=h.lowLatencyMode,a=h.maxLiveSyncPlaybackRate;if(!r||a===1)return;var i=this.targetLatency;if(i===null)return;var s=o-i,S=Math.min(this.maxLatency,i+u.targetduration),x=s<S;if(u.live&&x&&s>.05&&this.forwardBufferLength>1){var T=Math.min(2,Math.max(1,a)),A=Math.round(2/(1+Math.exp(-.75*s-this.edgeStalled))*20)/20;d.playbackRate=Math.min(T,Math.max(1,A))}else d.playbackRate!==1&&d.playbackRate!==0&&(d.playbackRate=1)},p.estimateLiveEdge=function(){var d=this.levelDetails;return d===null?null:d.edge+d.age},p.computeLatency=function(){var d=this.estimateLiveEdge();return d===null?null:d-this.currentTime},N(P,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var d=this.config,u=this.levelDetails;return d.liveMaxLatencyDuration!==void 0?d.liveMaxLatencyDuration:u?d.liveMaxLatencyDurationCount*u.targetduration:0}},{key:"targetLatency",get:function(){var d=this.levelDetails;if(d===null)return null;var u=d.holdBack,o=d.partHoldBack,h=d.targetduration,r=this.config,a=r.liveSyncDuration,i=r.liveSyncDurationCount,s=r.lowLatencyMode,S=this.hls.userConfig,x=s&&o||u;(S.liveSyncDuration||S.liveSyncDurationCount||x===0)&&(x=a!==void 0?a:i*h);var T=h,A=1;return x+Math.min(this.stallCount*A,T)}},{key:"liveSyncPosition",get:function(){var d=this.estimateLiveEdge(),u=this.targetLatency,o=this.levelDetails;if(d===null||u===null||o===null)return null;var h=o.edge,r=d-u-this.edgeStalled,a=h-o.totalduration,i=h-(this.config.lowLatencyMode&&o.partTarget||o.targetduration);return Math.min(Math.max(a,r),i)}},{key:"drift",get:function(){var d=this.levelDetails;return d===null?1:d.drift}},{key:"edgeStalled",get:function(){var d=this.levelDetails;if(d===null)return 0;var u=(this.config.lowLatencyMode&&d.partTarget||d.targetduration)*3;return Math.max(d.age-u,0)}},{key:"forwardBufferLength",get:function(){var d=this.media,u=this.levelDetails;if(!d||!u)return 0;var o=d.buffered.length;return o?d.buffered.end(o-1):u.edge-this.currentTime}}]),P}()},"./src/controller/level-controller.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"default",function(){return r});var X=M("./src/types/level.ts"),F=M("./src/events.ts"),I=M("./src/errors.ts"),H=M("./src/utils/codecs.ts"),N=M("./src/controller/level-helper.ts"),n=M("./src/controller/base-playlist-controller.ts"),P=M("./src/types/loader.ts");function p(){return p=Object.assign||function(a){for(var i=1;i<arguments.length;i++){var s=arguments[i];for(var S in s)Object.prototype.hasOwnProperty.call(s,S)&&(a[S]=s[S])}return a},p.apply(this,arguments)}function m(a,i){for(var s=0;s<i.length;s++){var S=i[s];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(a,S.key,S)}}function d(a,i,s){return i&&m(a.prototype,i),s&&m(a,s),a}function u(a,i){a.prototype=Object.create(i.prototype),a.prototype.constructor=a,o(a,i)}function o(a,i){return o=Object.setPrototypeOf||function(S,x){return S.__proto__=x,S},o(a,i)}var h=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),r=function(a){u(i,a);function i(S){var x;return x=a.call(this,S,"[level-controller]")||this,x._levels=[],x._firstLevel=-1,x._startLevel=void 0,x.currentLevelIndex=-1,x.manualLevelIndex=-1,x.onParsedComplete=void 0,x._registerListeners(),x}var s=i.prototype;return s._registerListeners=function(){var x=this.hls;x.on(F.Events.MANIFEST_LOADED,this.onManifestLoaded,this),x.on(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.on(F.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),x.on(F.Events.FRAG_LOADED,this.onFragLoaded,this),x.on(F.Events.ERROR,this.onError,this)},s._unregisterListeners=function(){var x=this.hls;x.off(F.Events.MANIFEST_LOADED,this.onManifestLoaded,this),x.off(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.off(F.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),x.off(F.Events.FRAG_LOADED,this.onFragLoaded,this),x.off(F.Events.ERROR,this.onError,this)},s.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,a.prototype.destroy.call(this)},s.startLoad=function(){var x=this._levels;x.forEach(function(T){T.loadError=0}),a.prototype.startLoad.call(this)},s.onManifestLoaded=function(x,T){var A=[],w=[],v=[],b,g={},f,C=!1,E=!1,_=!1;if(T.levels.forEach(function(G){var B=G.attrs;C=C||!!(G.width&&G.height),E=E||!!G.videoCodec,_=_||!!G.audioCodec,h&&G.audioCodec&&G.audioCodec.indexOf("mp4a.40.34")!==-1&&(G.audioCodec=void 0);var O=G.bitrate+"-"+G.attrs.RESOLUTION+"-"+G.attrs.CODECS;f=g[O],f?f.url.push(G.url):(f=new X.Level(G),g[O]=f,A.push(f)),B&&(B.AUDIO&&Object(N.addGroupId)(f,"audio",B.AUDIO),B.SUBTITLES&&Object(N.addGroupId)(f,"text",B.SUBTITLES))}),(C||E)&&_&&(A=A.filter(function(G){var B=G.videoCodec,O=G.width,V=G.height;return!!B||!!(O&&V)})),A=A.filter(function(G){var B=G.audioCodec,O=G.videoCodec;return(!B||Object(H.isCodecSupportedInMp4)(B,"audio"))&&(!O||Object(H.isCodecSupportedInMp4)(O,"video"))}),T.audioTracks&&(w=T.audioTracks.filter(function(G){return!G.audioCodec||Object(H.isCodecSupportedInMp4)(G.audioCodec,"audio")}),Object(N.assignTrackIdsByGroup)(w)),T.subtitles&&(v=T.subtitles,Object(N.assignTrackIdsByGroup)(v)),A.length>0){b=A[0].bitrate,A.sort(function(G,B){return G.bitrate-B.bitrate}),this._levels=A;for(var U=0;U<A.length;U++)if(A[U].bitrate===b){this._firstLevel=U,this.log("manifest loaded, "+A.length+" level(s) found, first bitrate: "+b);break}var j=_&&!E,L={levels:A,audioTracks:w,subtitleTracks:v,firstLevel:this._firstLevel,stats:T.stats,audio:_,video:E,altAudio:!j&&w.some(function(G){return!!G.url})};this.hls.trigger(F.Events.MANIFEST_PARSED,L),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(F.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:T.url,reason:"no level with compatible codecs found in manifest"})},s.onError=function(x,T){if(a.prototype.onError.call(this,x,T),T.fatal)return;var A=T.context,w=this._levels[this.currentLevelIndex];if(A&&(A.type===P.PlaylistContextType.AUDIO_TRACK&&w.audioGroupIds&&A.groupId===w.audioGroupIds[w.urlId]||A.type===P.PlaylistContextType.SUBTITLE_TRACK&&w.textGroupIds&&A.groupId===w.textGroupIds[w.urlId])){this.redundantFailover(this.currentLevelIndex);return}var v=!1,b=!0,g;switch(T.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:if(T.frag){var f=this._levels[T.frag.level];f?(f.fragmentError++,f.fragmentError>this.hls.config.fragLoadingMaxRetry&&(g=T.frag.level)):g=T.frag.level}break;case I.ErrorDetails.LEVEL_LOAD_ERROR:case I.ErrorDetails.LEVEL_LOAD_TIMEOUT:A&&(A.deliveryDirectives&&(b=!1),g=A.level),v=!0;break;case I.ErrorDetails.REMUX_ALLOC_ERROR:g=T.level,v=!0;break}g!==void 0&&this.recoverLevel(T,g,v,b)},s.recoverLevel=function(x,T,A,w){var v=x.details,b=this._levels[T];if(b.loadError++,A){var g=this.retryLoadingOrFail(x);if(g)x.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(w){var f=b.url.length;if(f>1&&b.loadError<f)x.levelRetry=!0,this.redundantFailover(T);else if(this.manualLevelIndex===-1){var C=T===0?this._levels.length-1:T-1;this.currentLevelIndex!==C&&this._levels[C].loadError===0&&(this.warn(v+": switch to "+C),x.levelRetry=!0,this.hls.nextAutoLevel=C)}}},s.redundantFailover=function(x){var T=this._levels[x],A=T.url.length;if(A>1){var w=(T.urlId+1)%A;this.warn("Switching to redundant URL-id "+w),this._levels.forEach(function(v){v.urlId=w}),this.level=x}},s.onFragLoaded=function(x,T){var A=T.frag;if(A!==void 0&&A.type===P.PlaylistLevelType.MAIN){var w=this._levels[A.level];w!==void 0&&(w.fragmentError=0,w.loadError=0)}},s.onLevelLoaded=function(x,T){var A,w=T.level,v=T.details,b=this._levels[w];if(!b){var g;this.warn("Invalid level index "+w),(g=T.deliveryDirectives)!==null&&g!==void 0&&g.skip&&(v.deltaUpdateFailed=!0);return}w===this.currentLevelIndex?(b.fragmentError===0&&(b.loadError=0,this.retryCount=0),this.playlistLoaded(w,T,b.details)):(A=T.deliveryDirectives)!==null&&A!==void 0&&A.skip&&(v.deltaUpdateFailed=!0)},s.onAudioTrackSwitched=function(x,T){var A=this.hls.levels[this.currentLevelIndex];if(!A)return;if(A.audioGroupIds){for(var w=-1,v=this.hls.audioTracks[T.id].groupId,b=0;b<A.audioGroupIds.length;b++)if(A.audioGroupIds[b]===v){w=b;break}w!==A.urlId&&(A.urlId=w,this.startLoad())}},s.loadPlaylist=function(x){var T=this.currentLevelIndex,A=this._levels[T];if(this.canLoad&&A&&A.url.length>0){var w=A.urlId,v=A.url[w];if(x)try{v=x.addDirectives(v)}catch(b){this.warn("Could not construct new URL with HLS Delivery Directives: "+b)}this.log("Attempt loading level index "+T+(x?" at sn "+x.msn+" part "+x.part:"")+" with URL-id "+w+" "+v),this.clearTimer(),this.hls.trigger(F.Events.LEVEL_LOADING,{url:v,level:T,id:w,deliveryDirectives:x||null})}},s.removeLevel=function(x,T){var A=function(b,g){return g!==T},w=this._levels.filter(function(v,b){return b!==x?!0:v.url.length>1&&T!==void 0?(v.url=v.url.filter(A),v.audioGroupIds&&(v.audioGroupIds=v.audioGroupIds.filter(A)),v.textGroupIds&&(v.textGroupIds=v.textGroupIds.filter(A)),v.urlId=0,!0):!1}).map(function(v,b){var g=v.details;return g!=null&&g.fragments&&g.fragments.forEach(function(f){f.level=b}),v});this._levels=w,this.hls.trigger(F.Events.LEVELS_UPDATED,{levels:w})},d(i,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(x){var T,A=this._levels;if(A.length===0)return;if(this.currentLevelIndex===x&&(T=A[x])!==null&&T!==void 0&&T.details)return;if(x<0||x>=A.length){var w=x<0;if(this.hls.trigger(F.Events.ERROR,{type:I.ErrorTypes.OTHER_ERROR,details:I.ErrorDetails.LEVEL_SWITCH_ERROR,level:x,fatal:w,reason:"invalid level idx"}),w)return;x=Math.min(x,A.length-1)}this.clearTimer();var v=this.currentLevelIndex,b=A[v],g=A[x];this.log("switching to level "+x+" from "+v),this.currentLevelIndex=x;var f=p({},g,{level:x,maxBitrate:g.maxBitrate,uri:g.uri,urlId:g.urlId});delete f._urlId,this.hls.trigger(F.Events.LEVEL_SWITCHING,f);var C=g.details;if(!C||C.live){var E=this.switchParams(g.uri,b==null?void 0:b.details);this.loadPlaylist(E)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(x){this.manualLevelIndex=x,this._startLevel===void 0&&(this._startLevel=x),x!==-1&&(this.level=x)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(x){this._firstLevel=x}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var x=this.hls.config.startLevel;return x!==void 0?x:this._firstLevel}else return this._startLevel},set:function(x){this._startLevel=x}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(x){this.level=x,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=x)}}]),i}(n.default)},"./src/controller/level-helper.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"addGroupId",function(){return I}),M.d(z,"assignTrackIdsByGroup",function(){return H}),M.d(z,"updatePTS",function(){return N}),M.d(z,"updateFragPTSDTS",function(){return P}),M.d(z,"mergeDetails",function(){return p}),M.d(z,"mapPartIntersection",function(){return m}),M.d(z,"mapFragmentIntersection",function(){return d}),M.d(z,"adjustSliding",function(){return u}),M.d(z,"addSliding",function(){return o}),M.d(z,"computeReloadInterval",function(){return h}),M.d(z,"getFragmentWithSN",function(){return r}),M.d(z,"getPartWith",function(){return a});var X=M("./src/polyfills/number.ts"),F=M("./src/utils/logger.ts");function I(i,s,S){switch(s){case"audio":i.audioGroupIds||(i.audioGroupIds=[]),i.audioGroupIds.push(S);break;case"text":i.textGroupIds||(i.textGroupIds=[]),i.textGroupIds.push(S);break}}function H(i){var s={};i.forEach(function(S){var x=S.groupId||"";S.id=s[x]=s[x]||0,s[x]++})}function N(i,s,S){var x=i[s],T=i[S];n(x,T)}function n(i,s){var S=s.startPTS;if(Object(X.isFiniteNumber)(S)){var x=0,T;s.sn>i.sn?(x=S-i.start,T=i):(x=i.start-S,T=s),T.duration!==x&&(T.duration=x)}else if(s.sn>i.sn){var A=i.cc===s.cc;A&&i.minEndPTS?s.start=i.start+(i.minEndPTS-i.start):s.start=i.start+i.duration}else s.start=Math.max(i.start-s.duration,0)}function P(i,s,S,x,T,A){var w=x-S;w<=0&&(F.logger.warn("Fragment should have a positive duration",s),x=S+s.duration,A=T+s.duration);var v=S,b=x,g=s.startPTS,f=s.endPTS;if(Object(X.isFiniteNumber)(g)){var C=Math.abs(g-S);Object(X.isFiniteNumber)(s.deltaPTS)?s.deltaPTS=Math.max(C,s.deltaPTS):s.deltaPTS=C,v=Math.max(S,g),S=Math.min(S,g),T=Math.min(T,s.startDTS),b=Math.min(x,f),x=Math.max(x,f),A=Math.max(A,s.endDTS)}s.duration=x-S;var E=S-s.start;s.appendedPTS=x,s.start=s.startPTS=S,s.maxStartPTS=v,s.startDTS=T,s.endPTS=x,s.minEndPTS=b,s.endDTS=A;var _=s.sn;if(!i||_<i.startSN||_>i.endSN)return 0;var U,j=_-i.startSN,L=i.fragments;for(L[j]=s,U=j;U>0;U--)n(L[U],L[U-1]);for(U=j;U<L.length-1;U++)n(L[U],L[U+1]);return i.fragmentHint&&n(L[L.length-1],i.fragmentHint),i.PTSKnown=i.alignedSliding=!0,E}function p(i,s){for(var S=null,x=i.fragments,T=x.length-1;T>=0;T--){var A=x[T].initSegment;if(A){S=A;break}}i.fragmentHint&&delete i.fragmentHint.endPTS;var w=0,v;if(d(i,s,function(U,j){U.relurl&&(w=U.cc-j.cc),Object(X.isFiniteNumber)(U.startPTS)&&Object(X.isFiniteNumber)(U.endPTS)&&(j.start=j.startPTS=U.startPTS,j.startDTS=U.startDTS,j.appendedPTS=U.appendedPTS,j.maxStartPTS=U.maxStartPTS,j.endPTS=U.endPTS,j.endDTS=U.endDTS,j.minEndPTS=U.minEndPTS,j.duration=U.endPTS-U.startPTS,j.duration&&(v=j),s.PTSKnown=s.alignedSliding=!0),j.elementaryStreams=U.elementaryStreams,j.loader=U.loader,j.stats=U.stats,j.urlId=U.urlId,U.initSegment&&(j.initSegment=U.initSegment,S=U.initSegment)}),S){var b=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments;b.forEach(function(U){var j;(!U.initSegment||U.initSegment.relurl===((j=S)===null||j===void 0?void 0:j.relurl))&&(U.initSegment=S)})}if(s.skippedSegments&&(s.deltaUpdateFailed=s.fragments.some(function(U){return!U}),s.deltaUpdateFailed)){F.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var g=s.skippedSegments;g--;)s.fragments.shift();s.startSN=s.fragments[0].sn,s.startCC=s.fragments[0].cc}var f=s.fragments;if(w){F.logger.warn("discontinuity sliding from playlist, take drift into account");for(var C=0;C<f.length;C++)f[C].cc+=w}s.skippedSegments&&(s.startCC=s.fragments[0].cc),m(i.partList,s.partList,function(U,j){j.elementaryStreams=U.elementaryStreams,j.stats=U.stats}),v?P(s,v,v.startPTS,v.endPTS,v.startDTS,v.endDTS):u(i,s),f.length&&(s.totalduration=s.edge-f[0].start),s.driftStartTime=i.driftStartTime,s.driftStart=i.driftStart;var E=s.advancedDateTime;if(s.advanced&&E){var _=s.edge;s.driftStart||(s.driftStartTime=E,s.driftStart=_),s.driftEndTime=E,s.driftEnd=_}else s.driftEndTime=i.driftEndTime,s.driftEnd=i.driftEnd,s.advancedDateTime=i.advancedDateTime}function m(i,s,S){if(i&&s)for(var x=0,T=0,A=i.length;T<=A;T++){var w=i[T],v=s[T+x];w&&v&&w.index===v.index&&w.fragment.sn===v.fragment.sn?S(w,v):x--}}function d(i,s,S){for(var x=s.skippedSegments,T=Math.max(i.startSN,s.startSN)-s.startSN,A=(i.fragmentHint?1:0)+(x?s.endSN:Math.min(i.endSN,s.endSN))-s.startSN,w=s.startSN-i.startSN,v=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,b=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments,g=T;g<=A;g++){var f=b[w+g],C=v[g];x&&!C&&g<x&&(C=s.fragments[g]=f),f&&C&&S(f,C)}}function u(i,s){var S=s.startSN+s.skippedSegments-i.startSN,x=i.fragments;if(S<0||S>=x.length)return;o(s,x[S].start)}function o(i,s){if(s){for(var S=i.fragments,x=i.skippedSegments;x<S.length;x++)S[x].start+=s;i.fragmentHint&&(i.fragmentHint.start+=s)}}function h(i,s){var S=1e3*i.levelTargetDuration,x=S/2,T=i.age,A=T>0&&T<S*3,w=s.loading.end-s.loading.start,v,b=i.availabilityDelay;if(i.updated===!1)if(A){var g=333*i.misses;v=Math.max(Math.min(x,w*2),g),i.availabilityDelay=(i.availabilityDelay||0)+v}else v=x;else A?(b=Math.min(b||S/2,T),i.availabilityDelay=b,v=b+S-T):v=S-w;return Math.round(v)}function r(i,s,S){if(!i||!i.details)return null;var x=i.details,T=x.fragments[s-x.startSN];return T||(T=x.fragmentHint,T&&T.sn===s?T:s<x.startSN&&S&&S.sn===s?S:null)}function a(i,s,S){if(!i||!i.details)return null;var x=i.details.partList;if(x)for(var T=x.length;T--;){var A=x[T];if(A.index===S&&A.fragment.sn===s)return A}return null}},"./src/controller/stream-controller.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"default",function(){return x});var X=M("./src/polyfills/number.ts"),F=M("./src/controller/base-stream-controller.ts"),I=M("./src/is-supported.ts"),H=M("./src/events.ts"),N=M("./src/utils/buffer-helper.ts"),n=M("./src/controller/fragment-tracker.ts"),P=M("./src/types/loader.ts"),p=M("./src/loader/fragment.ts"),m=M("./src/demux/transmuxer-interface.ts"),d=M("./src/types/transmuxer.ts"),u=M("./src/controller/gap-controller.ts"),o=M("./src/errors.ts"),h=M("./src/utils/logger.ts");function r(T,A){for(var w=0;w<A.length;w++){var v=A[w];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(T,v.key,v)}}function a(T,A,w){return A&&r(T.prototype,A),w&&r(T,w),T}function i(T,A){T.prototype=Object.create(A.prototype),T.prototype.constructor=T,s(T,A)}function s(T,A){return s=Object.setPrototypeOf||function(v,b){return v.__proto__=b,v},s(T,A)}var S=100,x=function(T){i(A,T);function A(v,b){var g;return g=T.call(this,v,b,"[stream-controller]")||this,g.audioCodecSwap=!1,g.gapController=null,g.level=-1,g._forceStartLoad=!1,g.altAudio=!1,g.audioOnly=!1,g.fragPlaying=null,g.onvplaying=null,g.onvseeked=null,g.fragLastKbps=0,g.stalled=!1,g.couldBacktrack=!1,g.audioCodecSwitch=!1,g.videoBuffer=null,g._registerListeners(),g}var w=A.prototype;return w._registerListeners=function(){var b=this.hls;b.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.on(H.Events.LEVEL_LOADING,this.onLevelLoading,this),b.on(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.on(H.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.on(H.Events.ERROR,this.onError,this),b.on(H.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.on(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.on(H.Events.BUFFER_CREATED,this.onBufferCreated,this),b.on(H.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.on(H.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.on(H.Events.FRAG_BUFFERED,this.onFragBuffered,this)},w._unregisterListeners=function(){var b=this.hls;b.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.off(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.off(H.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.off(H.Events.ERROR,this.onError,this),b.off(H.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.off(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.off(H.Events.BUFFER_CREATED,this.onBufferCreated,this),b.off(H.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.off(H.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.off(H.Events.FRAG_BUFFERED,this.onFragBuffered,this)},w.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},w.startLoad=function(b){if(this.levels){var g=this.lastCurrentTime,f=this.hls;if(this.stopLoad(),this.setInterval(S),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var C=f.startLevel;C===-1&&(f.config.testBandwidth?(C=0,this.bitrateTest=!0):C=f.nextAutoLevel),this.level=f.nextLoadLevel=C,this.loadedmetadata=!1}g>0&&b===-1&&(this.log("Override startPosition with lastCurrentTime @"+g.toFixed(3)),b=g),this.state=F.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=b,this.tick()}else this._forceStartLoad=!0,this.state=F.State.STOPPED},w.stopLoad=function(){this._forceStartLoad=!1,T.prototype.stopLoad.call(this)},w.doTick=function(){switch(this.state){case F.State.IDLE:this.doTickIdle();break;case F.State.WAITING_LEVEL:{var b,g=this.levels,f=this.level,C=g==null||((b=g[f])===null||b===void 0)?void 0:b.details;if(C&&(!C.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(C))break;this.state=F.State.IDLE;break}break}case F.State.FRAG_LOADING_WAITING_RETRY:{var E,_=self.performance.now(),U=this.retryDate;(!U||_>=U||(E=this.media)!==null&&E!==void 0&&E.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=F.State.IDLE)}break;default:break}this.onTickEnd()},w.onTickEnd=function(){T.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},w.doTickIdle=function(){var b,g,f=this.hls,C=this.levelLastLoaded,E=this.levels,_=this.media,U=f.config,j=f.nextLoadLevel;if(C===null||!_&&(this.startFragRequested||!U.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!E||!E[j])return;var L=E[j];this.level=f.nextLoadLevel=j;var G=L.details;if(!G||this.state===F.State.WAITING_LEVEL||G.live&&this.levelLastLoaded!==j){this.state=F.State.WAITING_LEVEL;return}var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:_,P.PlaylistLevelType.MAIN);if(B===null)return;var O=B.len,V=this.getMaxBufferLength(L.maxBitrate);if(O>=V)return;if(this._streamEnded(B,G)){var te={};this.altAudio&&(te.type="video"),this.hls.trigger(H.Events.BUFFER_EOS,te),this.state=F.State.ENDED;return}var re=B.end,ge=this.getNextFragment(re,G);if(this.couldBacktrack&&!this.fragPrevious&&ge&&ge.sn!=="initSegment"){var Ae=ge.sn-G.startSN;Ae>1&&(ge=G.fragments[Ae-1],this.fragmentTracker.removeFragment(ge))}if(ge&&this.fragmentTracker.getState(ge)===n.FragmentState.OK&&this.nextLoadPosition>re){var Oe=this.audioOnly&&!this.altAudio?p.ElementaryStreamTypes.AUDIO:p.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(_,Oe,P.PlaylistLevelType.MAIN),ge=this.getNextFragment(this.nextLoadPosition,G)}if(!ge)return;ge.initSegment&&!ge.initSegment.data&&!this.bitrateTest&&(ge=ge.initSegment),((b=ge.decryptdata)===null||b===void 0?void 0:b.keyFormat)==="identity"&&!((g=ge.decryptdata)!==null&&g!==void 0&&g.key)?this.loadKey(ge,G):this.loadFragment(ge,G,re)},w.loadFragment=function(b,g,f){var C,E=this.fragmentTracker.getState(b);if(this.fragCurrent=b,E===n.FragmentState.BACKTRACKED){var _=this.fragmentTracker.getBacktrackData(b);if(_){this._handleFragmentLoadProgress(_),this._handleFragmentLoadComplete(_);return}else E=n.FragmentState.NOT_LOADED}E===n.FragmentState.NOT_LOADED||E===n.FragmentState.PARTIAL?b.sn==="initSegment"?this._loadInitSegment(b):this.bitrateTest?(b.bitrateTest=!0,this.log("Fragment "+b.sn+" of level "+b.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(b)):(this.startFragRequested=!0,T.prototype.loadFragment.call(this,b,g,f)):E===n.FragmentState.APPENDING?this.reduceMaxBufferLength(b.duration)&&this.fragmentTracker.removeFragment(b):((C=this.media)===null||C===void 0?void 0:C.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},w.getAppendedFrag=function(b){var g=this.fragmentTracker.getAppendedFrag(b,P.PlaylistLevelType.MAIN);return g&&"fragment"in g?g.fragment:g},w.getBufferedFrag=function(b){return this.fragmentTracker.getBufferedFrag(b,P.PlaylistLevelType.MAIN)},w.followingBufferedFrag=function(b){return b?this.getBufferedFrag(b.end+.5):null},w.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},w.nextLevelSwitch=function(){var b=this.levels,g=this.media;if(g!=null&&g.readyState){var f,C=this.getAppendedFrag(g.currentTime);if(C&&C.start>1&&this.flushMainBuffer(0,C.start-1),!g.paused&&b){var E=this.hls.nextLoadLevel,_=b[E],U=this.fragLastKbps;U&&this.fragCurrent?f=this.fragCurrent.duration*_.maxBitrate/(1e3*U)+1:f=0}else f=0;var j=this.getBufferedFrag(g.currentTime+f);if(j){var L=this.followingBufferedFrag(j);if(L){this.abortCurrentFrag();var G=L.maxStartPTS?L.maxStartPTS:L.start,B=L.duration,O=Math.max(j.end,G+Math.min(Math.max(B-this.config.maxFragLookUpTolerance,B*.5),B*.75));this.flushMainBuffer(O,Number.POSITIVE_INFINITY)}}}},w.abortCurrentFrag=function(){var b=this.fragCurrent;this.fragCurrent=null,b!=null&&b.loader&&b.loader.abort(),this.state===F.State.KEY_LOADING&&(this.state=F.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},w.flushMainBuffer=function(b,g){T.prototype.flushMainBuffer.call(this,b,g,this.altAudio?"video":null)},w.onMediaAttached=function(b,g){T.prototype.onMediaAttached.call(this,b,g);var f=g.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 u.default(this.config,f,this.fragmentTracker,this.hls)},w.onMediaDetaching=function(){var b=this.media;b&&(b.removeEventListener("playing",this.onvplaying),b.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),T.prototype.onMediaDetaching.call(this)},w.onMediaPlaying=function(){this.tick()},w.onMediaSeeked=function(){var b=this.media,g=b?b.currentTime:null;Object(X.isFiniteNumber)(g)&&this.log("Media seeked to "+g.toFixed(3)),this.tick()},w.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(H.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},w.onManifestParsed=function(b,g){var f=!1,C=!1,E;g.levels.forEach(function(_){E=_.audioCodec,E&&(E.indexOf("mp4a.40.2")!==-1&&(f=!0),E.indexOf("mp4a.40.5")!==-1&&(C=!0))}),this.audioCodecSwitch=f&&C&&!Object(I.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=g.levels,this.startFragRequested=!1},w.onLevelLoading=function(b,g){var f=this.levels;if(!f||this.state!==F.State.IDLE)return;var C=f[g.level];(!C.details||C.details.live&&this.levelLastLoaded!==g.level||this.waitForCdnTuneIn(C.details))&&(this.state=F.State.WAITING_LEVEL)},w.onLevelLoaded=function(b,g){var f,C=this.levels,E=g.level,_=g.details,U=_.totalduration;if(!C){this.warn("Levels were reset while loading level "+E);return}this.log("Level "+E+" loaded ["+_.startSN+","+_.endSN+"], cc ["+_.startCC+", "+_.endCC+"] duration:"+U);var j=this.fragCurrent;j&&(this.state===F.State.FRAG_LOADING||this.state===F.State.FRAG_LOADING_WAITING_RETRY)&&(j.level!==g.level&&j.loader&&(this.state=F.State.IDLE,j.loader.abort()));var L=C[E],G=0;if(_.live||(f=L.details)!==null&&f!==void 0&&f.live){if(_.fragments[0]||(_.deltaUpdateFailed=!0),_.deltaUpdateFailed)return;G=this.alignPlaylists(_,L.details)}if(L.details=_,this.levelLastLoaded=E,this.hls.trigger(H.Events.LEVEL_UPDATED,{details:_,level:E}),this.state===F.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(_))return;this.state=F.State.IDLE}this.startFragRequested?_.live&&this.synchronizeToLiveEdge(_):this.setStartPosition(_,G),this.tick()},w._handleFragmentLoadProgress=function(b){var g,f=b.frag,C=b.part,E=b.payload,_=this.levels;if(!_){this.warn("Levels were reset while fragment load was in progress. Fragment "+f.sn+" of level "+f.level+" will not be buffered");return}var U=_[f.level],j=U.details;if(!j){this.warn("Dropping fragment "+f.sn+" of level "+f.level+" after level details were reset");return}var L=U.videoCodec,G=j.PTSKnown||!j.live,B=(g=f.initSegment)===null||g===void 0?void 0:g.data,O=this._getAudioCodec(U),V=this.transmuxer=this.transmuxer||new m.default(this.hls,P.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),te=C?C.index:-1,re=te!==-1,ge=new d.ChunkMetadata(f.level,f.sn,f.stats.chunkCount,E.byteLength,te,re),Ae=this.initPTS[f.cc];V.push(E,B,O,L,f,C,j.totalduration,G,ge,Ae)},w.onAudioTrackSwitching=function(b,g){var f=this.altAudio,C=!!g.url,E=g.id;if(!C){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var _=this.fragCurrent;_!=null&&_.loader&&(this.log("Switching to main audio track, cancel main fragment load"),_.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var U=this.hls;f&&U.trigger(H.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),U.trigger(H.Events.AUDIO_TRACK_SWITCHED,{id:E})}},w.onAudioTrackSwitched=function(b,g){var f=g.id,C=!!this.hls.audioTracks[f].url;if(C){var E=this.videoBuffer;E&&this.mediaBuffer!==E&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=E)}this.altAudio=C,this.tick()},w.onBufferCreated=function(b,g){var f=g.tracks,C,E,_=!1;for(var U in f){var j=f[U];if(j.id==="main"){if(E=U,C=j,U==="video"){var L=f[U];L&&(this.videoBuffer=L.buffer)}}else _=!0}_&&C?(this.log("Alternate track found, use "+E+".buffered to schedule main fragment loading"),this.mediaBuffer=C.buffer):this.mediaBuffer=this.media},w.onFragBuffered=function(b,g){var f=g.frag,C=g.part;if(f&&f.type!==P.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(f)){this.warn("Fragment "+f.sn+(C?" p: "+C.index:"")+" of level "+f.level+" finished buffering, but was aborted. state: "+this.state),this.state===F.State.PARSED&&(this.state=F.State.IDLE);return}var E=C?C.stats:f.stats;this.fragLastKbps=Math.round(8*E.total/(E.buffering.end-E.loading.first)),f.sn!=="initSegment"&&(this.fragPrevious=f),this.fragBufferedComplete(f,C)},w.onError=function(b,g){switch(g.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(P.PlaylistLevelType.MAIN,g);break;case o.ErrorDetails.LEVEL_LOAD_ERROR:case o.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==F.State.ERROR&&(g.fatal?(this.warn(""+g.details),this.state=F.State.ERROR):!g.levelRetry&&this.state===F.State.WAITING_LEVEL&&(this.state=F.State.IDLE));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(g.parent==="main"&&(this.state===F.State.PARSING||this.state===F.State.PARSED)){var f=!0,C=this.getFwdBufferInfo(this.media,P.PlaylistLevelType.MAIN);C&&C.len>.5&&(f=!this.reduceMaxBufferLength(C.len)),f&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},w.checkBuffer=function(){var b=this.media,g=this.gapController;if(!b||!g||!b.readyState)return;var f=N.BufferHelper.getBuffered(b);!this.loadedmetadata&&f.length?(this.loadedmetadata=!0,this.seekToStartPos()):g.poll(this.lastCurrentTime),this.lastCurrentTime=b.currentTime},w.onFragLoadEmergencyAborted=function(){this.state=F.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},w.onBufferFlushed=function(b,g){var f=g.type;if(f!==p.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var C=(f===p.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(C,f,P.PlaylistLevelType.MAIN)}},w.onLevelsUpdated=function(b,g){this.levels=g.levels},w.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},w.seekToStartPos=function(){var b=this.media,g=b.currentTime,f=this.startPosition;if(f>=0&&g<f){if(b.seeking){h.logger.log("could not seek to "+f+", already seeking at "+g);return}var C=N.BufferHelper.getBuffered(b),E=C.length?C.start(0):0,_=E-f;_>0&&(_<this.config.maxBufferHole||_<this.config.maxFragLookUpTolerance)&&(h.logger.log("adjusting start position by "+_+" to match buffer start"),f+=_,this.startPosition=f),this.log("seek to target start position "+f+" from current time "+g),b.currentTime=f}},w._getAudioCodec=function(b){var g=this.config.defaultAudioCodec||b.audioCodec;return this.audioCodecSwap&&g&&(this.log("Swapping audio codec"),g.indexOf("mp4a.40.5")!==-1?g="mp4a.40.2":g="mp4a.40.5"),g},w._loadBitrateTestFrag=function(b){var g=this;this._doFragLoad(b).then(function(f){var C=g.hls;if(!f||C.nextLoadLevel||g.fragContextChanged(b))return;g.fragLoadError=0,g.state=F.State.IDLE,g.startFragRequested=!1,g.bitrateTest=!1;var E=b.stats;E.parsing.start=E.parsing.end=E.buffering.start=E.buffering.end=self.performance.now(),C.trigger(H.Events.FRAG_LOADED,f)})},w._handleTransmuxComplete=function(b){var g,f="main",C=this.hls,E=b.remuxResult,_=b.chunkMeta,U=this.getCurrentContext(_);if(!U){this.warn("The loading context changed while buffering fragment "+_.sn+" of level "+_.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(_.level);return}var j=U.frag,L=U.part,G=U.level,B=E.video,O=E.text,V=E.id3,te=E.initSegment,re=this.altAudio?void 0:E.audio;if(this.fragContextChanged(j))return;if(this.state=F.State.PARSING,te){te.tracks&&(this._bufferInitSegment(G,te.tracks,j,_),C.trigger(H.Events.FRAG_PARSING_INIT_SEGMENT,{frag:j,id:f,tracks:te.tracks}));var ge=te.initPTS,Ae=te.timescale;Object(X.isFiniteNumber)(ge)&&(this.initPTS[j.cc]=ge,C.trigger(H.Events.INIT_PTS_FOUND,{frag:j,id:f,initPTS:ge,timescale:Ae}))}if(B&&E.independent!==!1){if(G.details){var Oe=B.startPTS,Ce=B.endPTS,je=B.startDTS,Ue=B.endDTS;if(L)L.elementaryStreams[B.type]={startPTS:Oe,endPTS:Ce,startDTS:je,endDTS:Ue};else if(B.firstKeyFrame&&B.independent&&(this.couldBacktrack=!0),B.dropped&&B.independent){var xe=this.getLoadPosition()+this.config.maxBufferHole;if(xe<Oe){this.backtrack(j);return}j.setElementaryStreamInfo(B.type,j.start,Ce,j.start,Ue,!0)}j.setElementaryStreamInfo(B.type,Oe,Ce,je,Ue),this.bufferFragmentData(B,j,L,_)}}else if(E.independent===!1){this.backtrack(j);return}if(re){var be=re.startPTS,Ve=re.endPTS,mt=re.startDTS,yt=re.endDTS;L&&(L.elementaryStreams[p.ElementaryStreamTypes.AUDIO]={startPTS:be,endPTS:Ve,startDTS:mt,endDTS:yt}),j.setElementaryStreamInfo(p.ElementaryStreamTypes.AUDIO,be,Ve,mt,yt),this.bufferFragmentData(re,j,L,_)}if(V!=null&&(g=V.samples)!==null&&g!==void 0&&g.length){var _t={frag:j,id:f,samples:V.samples};C.trigger(H.Events.FRAG_PARSING_METADATA,_t)}if(O){var xt={frag:j,id:f,samples:O.samples};C.trigger(H.Events.FRAG_PARSING_USERDATA,xt)}},w._bufferInitSegment=function(b,g,f,C){var E=this;if(this.state!==F.State.PARSING)return;this.audioOnly=!!g.audio&&!g.video,this.altAudio&&!this.audioOnly&&delete g.audio;var _=g.audio,U=g.video,j=g.audiovideo;if(_){var L=b.audioCodec,G=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(L&&(L.indexOf("mp4a.40.5")!==-1?L="mp4a.40.2":L="mp4a.40.5"),_.metadata.channelCount!==1&&G.indexOf("firefox")===-1&&(L="mp4a.40.5")),G.indexOf("android")!==-1&&_.container!=="audio/mpeg"&&(L="mp4a.40.2",this.log("Android: force audio codec to "+L)),b.audioCodec&&b.audioCodec!==L&&this.log('Swapping manifest audio codec "'+b.audioCodec+'" for "'+L+'"'),_.levelCodec=L,_.id="main",this.log("Init audio buffer, container:"+_.container+", codecs[selected/level/parsed]=["+(L||"")+"/"+(b.audioCodec||"")+"/"+_.codec+"]")}U&&(U.levelCodec=b.videoCodec,U.id="main",this.log("Init video buffer, container:"+U.container+", codecs[level/parsed]=["+(b.videoCodec||"")+"/"+U.codec+"]")),j&&this.log("Init audiovideo buffer, container:"+j.container+", codecs[level/parsed]=["+(b.attrs.CODECS||"")+"/"+j.codec+"]"),this.hls.trigger(H.Events.BUFFER_CODECS,g),Object.keys(g).forEach(function(B){var O=g[B],V=O.initSegment;V!=null&&V.byteLength&&E.hls.trigger(H.Events.BUFFER_APPENDING,{type:B,data:V,frag:f,part:null,chunkMeta:C,parent:f.type})}),this.tick()},w.backtrack=function(b){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(b);var g=this.fragmentTracker.backtrack(b);this.fragPrevious=null,this.nextLoadPosition=b.start,g?this.resetFragmentLoading(b):this.state=F.State.BACKTRACKING},w.checkFragmentChanged=function(){var b=this.media,g=null;if(b&&b.readyState>1&&b.seeking===!1){var f=b.currentTime;if(N.BufferHelper.isBuffered(b,f)?g=this.getAppendedFrag(f):N.BufferHelper.isBuffered(b,f+.1)&&(g=this.getAppendedFrag(f+.1)),g){var C=this.fragPlaying,E=g.level;(!C||g.sn!==C.sn||C.level!==E||g.urlId!==C.urlId)&&(this.hls.trigger(H.Events.FRAG_CHANGED,{frag:g}),(!C||C.level!==E)&&this.hls.trigger(H.Events.LEVEL_SWITCHED,{level:E}),this.fragPlaying=g)}}},a(A,[{key:"nextLevel",get:function(){var b=this.nextBufferedFrag;return b?b.level:-1}},{key:"currentLevel",get:function(){var b=this.media;if(b){var g=this.getAppendedFrag(b.currentTime);if(g)return g.level}return-1}},{key:"nextBufferedFrag",get:function(){var b=this.media;if(b){var g=this.getAppendedFrag(b.currentTime);return this.followingBufferedFrag(g)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),A}(F.default)},"./src/controller/subtitle-stream-controller.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"SubtitleStreamController",function(){return i});var X=M("./src/events.ts"),F=M("./src/utils/logger.ts"),I=M("./src/utils/buffer-helper.ts"),H=M("./src/controller/fragment-finders.ts"),N=M("./src/utils/discontinuities.ts"),n=M("./src/controller/level-helper.ts"),P=M("./src/controller/fragment-tracker.ts"),p=M("./src/controller/base-stream-controller.ts"),m=M("./src/types/loader.ts"),d=M("./src/types/level.ts");function u(s,S){for(var x=0;x<S.length;x++){var T=S[x];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(s,T.key,T)}}function o(s,S,x){return S&&u(s.prototype,S),x&&u(s,x),s}function h(s,S){s.prototype=Object.create(S.prototype),s.prototype.constructor=s,r(s,S)}function r(s,S){return r=Object.setPrototypeOf||function(T,A){return T.__proto__=A,T},r(s,S)}var a=500,i=function(s){h(S,s);function S(T,A){var w;return w=s.call(this,T,A,"[subtitle-stream-controller]")||this,w.levels=[],w.currentTrackId=-1,w.tracksBuffered=[],w.mainDetails=null,w._registerListeners(),w}var x=S.prototype;return x.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},x._registerListeners=function(){var A=this.hls;A.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),A.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),A.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),A.on(X.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.on(X.Events.ERROR,this.onError,this),A.on(X.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),A.on(X.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),A.on(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),A.on(X.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),A.on(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},x._unregisterListeners=function(){var A=this.hls;A.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),A.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),A.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),A.off(X.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.off(X.Events.ERROR,this.onError,this),A.off(X.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),A.off(X.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),A.off(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),A.off(X.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),A.off(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},x.startLoad=function(){this.stopLoad(),this.state=p.State.IDLE,this.setInterval(a),this.tick()},x.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},x.onLevelLoaded=function(A,w){this.mainDetails=w.details},x.onSubtitleFragProcessed=function(A,w){var v=w.frag,b=w.success;if(this.fragPrevious=v,this.state=p.State.IDLE,!b)return;var g=this.tracksBuffered[this.currentTrackId];if(!g)return;for(var f,C=v.start,E=0;E<g.length;E++)if(C>=g[E].start&&C<=g[E].end){f=g[E];break}var _=v.start+v.duration;f?f.end=_:(f={start:C,end:_},g.push(f)),this.fragmentTracker.fragBuffered(v)},x.onBufferFlushing=function(A,w){var v=w.startOffset,b=w.endOffset;if(v===0&&b!==Number.POSITIVE_INFINITY){var g=this.currentTrackId,f=this.levels;if(!f.length||!f[g]||!f[g].details)return;var C=f[g].details,E=C.targetduration,_=b-E;if(_<=0)return;w.endOffsetSubtitles=Math.max(0,_),this.tracksBuffered.forEach(function(U){for(var j=0;j<U.length;){if(U[j].end<=_){U.shift();continue}else if(U[j].start<_)U[j].start=_;else break;j++}}),this.fragmentTracker.removeFragmentsInRange(v,_,m.PlaylistLevelType.SUBTITLE)}},x.onError=function(A,w){var v,b=w.frag;if(!b||b.type!==m.PlaylistLevelType.SUBTITLE)return;(v=this.fragCurrent)!==null&&v!==void 0&&v.loader&&this.fragCurrent.loader.abort(),this.state=p.State.IDLE},x.onSubtitleTracksUpdated=function(A,w){var v=this,b=w.subtitleTracks;this.tracksBuffered=[],this.levels=b.map(function(g){return new d.Level(g)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(g){v.tracksBuffered[g.id]=[]}),this.mediaBuffer=null},x.onSubtitleTrackSwitch=function(A,w){if(this.currentTrackId=w.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var v=this.levels[this.currentTrackId];v!=null&&v.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,v&&this.setInterval(a)},x.onSubtitleTrackLoaded=function(A,w){var v,b=w.details,g=w.id,f=this.currentTrackId,C=this.levels;if(!C.length)return;var E=C[f];if(g>=C.length||g!==f||!E)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,b.live||(v=E.details)!==null&&v!==void 0&&v.live){var _=this.mainDetails;if(b.deltaUpdateFailed||!_)return;var U=_.fragments[0];if(!E.details)b.hasProgramDateTime&&_.hasProgramDateTime?Object(N.alignMediaPlaylistByPDT)(b,_):U&&Object(n.addSliding)(b,U.start);else{var j=this.alignPlaylists(b,E.details);j===0&&U&&Object(n.addSliding)(b,U.start)}}if(E.details=b,this.levelLastLoaded=g,this.tick(),b.live&&!this.fragCurrent&&this.media&&this.state===p.State.IDLE){var L=Object(H.findFragmentByPTS)(null,b.fragments,this.media.currentTime,0);L||(this.warn("Subtitle playlist not aligned with playback"),E.details=void 0)}},x._handleFragmentLoadComplete=function(A){var w=A.frag,v=A.payload,b=w.decryptdata,g=this.hls;if(this.fragContextChanged(w))return;if(v&&v.byteLength>0&&b&&b.key&&b.iv&&b.method==="AES-128"){var f=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(v),b.key.buffer,b.iv.buffer).then(function(C){var E=performance.now();g.trigger(X.Events.FRAG_DECRYPTED,{frag:w,payload:C,stats:{tstart:f,tdecrypt:E}})})}},x.doTick=function(){if(!this.media){this.state=p.State.IDLE;return}if(this.state===p.State.IDLE){var A,w=this.currentTrackId,v=this.levels;if(!v.length||!v[w]||!v[w].details)return;var b=v[w].details,g=b.targetduration,f=this.config,C=this.media,E=I.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,C.currentTime-g,f.maxBufferHole),_=E.end,U=E.len,j=this.getMaxBufferLength()+g;if(U>j)return;console.assert(b,"Subtitle track details are defined on idle subtitle stream controller tick");var L=b.fragments,G=L.length,B=b.edge,O,V=this.fragPrevious;if(_<B){var te=f.maxFragLookUpTolerance;V&&b.hasProgramDateTime&&(O=Object(H.findFragmentByPDT)(L,V.endProgramDateTime,te)),O||(O=Object(H.findFragmentByPTS)(V,L,_,te),!O&&V&&V.start<L[0].start&&(O=L[0]))}else O=L[G-1];(A=O)!==null&&A!==void 0&&A.encrypted?(F.logger.log("Loading key for "+O.sn),this.state=p.State.KEY_LOADING,this.hls.trigger(X.Events.KEY_LOADING,{frag:O})):O&&this.fragmentTracker.getState(O)===P.FragmentState.NOT_LOADED&&this.loadFragment(O,b,_)}},x.loadFragment=function(A,w,v){this.fragCurrent=A,s.prototype.loadFragment.call(this,A,w,v)},o(S,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),S}(p.default)},"./src/controller/subtitle-track-controller.ts":function(Q,z,M){"use strict";M.r(z);var X=M("./src/events.ts"),F=M("./src/utils/texttrack-utils.ts"),I=M("./src/controller/base-playlist-controller.ts"),H=M("./src/types/loader.ts");function N(u,o){for(var h=0;h<o.length;h++){var r=o[h];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(u,r.key,r)}}function n(u,o,h){return o&&N(u.prototype,o),h&&N(u,h),u}function P(u,o){u.prototype=Object.create(o.prototype),u.prototype.constructor=u,p(u,o)}function p(u,o){return p=Object.setPrototypeOf||function(r,a){return r.__proto__=a,r},p(u,o)}var m=function(u){P(o,u);function o(r){var a;return a=u.call(this,r,"[subtitle-track-controller]")||this,a.media=null,a.tracks=[],a.groupId=null,a.tracksInGroup=[],a.trackId=-1,a.selectDefaultTrack=!0,a.queuedDefaultTrack=-1,a.trackChangeListener=function(){return a.onTextTracksChanged()},a.asyncPollTrackChange=function(){return a.pollTrackChange(0)},a.useTextTrackPolling=!1,a.subtitlePollingInterval=-1,a.subtitleDisplay=!0,a.registerListeners(),a}var h=o.prototype;return h.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,u.prototype.destroy.call(this)},h.registerListeners=function(){var a=this.hls;a.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(X.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.on(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),a.on(X.Events.ERROR,this.onError,this)},h.unregisterListeners=function(){var a=this.hls;a.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(X.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.off(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),a.off(X.Events.ERROR,this.onError,this)},h.onMediaAttached=function(a,i){if(this.media=i.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)},h.pollTrackChange=function(a){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,a)},h.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 a=d(this.media.textTracks);a.forEach(function(i){Object(F.clearCurrentCues)(i)}),this.subtitleTrack=-1,this.media=null},h.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},h.onManifestParsed=function(a,i){this.tracks=i.subtitleTracks},h.onSubtitleTrackLoaded=function(a,i){var s=i.id,S=i.details,x=this.trackId,T=this.tracksInGroup[x];if(!T){this.warn("Invalid subtitle track id "+s);return}var A=T.details;T.details=i.details,this.log("subtitle track "+s+" loaded ["+S.startSN+"-"+S.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,i,A))},h.onLevelLoading=function(a,i){this.switchLevel(i.level)},h.onLevelSwitching=function(a,i){this.switchLevel(i.level)},h.switchLevel=function(a){var i=this.hls.levels[a];if(!(i!=null&&i.textGroupIds))return;var s=i.textGroupIds[i.urlId];if(this.groupId!==s){var S=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,x=this.tracks.filter(function(w){return!s||w.groupId===s});this.tracksInGroup=x;var T=this.findTrackId(S==null?void 0:S.name)||this.findTrackId();this.groupId=s;var A={subtitleTracks:x};this.log("Updating subtitle tracks, "+x.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(X.Events.SUBTITLE_TRACKS_UPDATED,A),T!==-1&&this.setSubtitleTrack(T,S)}},h.findTrackId=function(a){for(var i=this.tracksInGroup,s=0;s<i.length;s++){var S=i[s];if((!this.selectDefaultTrack||S.default)&&(!a||a===S.name))return S.id}return-1},h.onError=function(a,i){if(u.prototype.onError.call(this,a,i),i.fatal||!i.context)return;i.context.type===H.PlaylistContextType.SUBTITLE_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},h.loadPlaylist=function(a){var i=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(i)){var s=i.id,S=i.groupId,x=i.url;if(a)try{x=a.addDirectives(x)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("Loading subtitle playlist for id "+s),this.hls.trigger(X.Events.SUBTITLE_TRACK_LOADING,{url:x,id:s,groupId:S,deliveryDirectives:a||null})}},h.toggleTrackModes=function(a){var i=this,s=this.media,S=this.subtitleDisplay,x=this.trackId;if(!s)return;var T=d(s.textTracks),A=T.filter(function(b){return b.groupId===i.groupId});if(a===-1)[].slice.call(T).forEach(function(b){b.mode="disabled"});else{var w=A[x];w&&(w.mode="disabled")}var v=A[a];v&&(v.mode=S?"showing":"hidden")},h.setSubtitleTrack=function(a,i){var s,S=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=a;return}if(this.trackId!==a&&this.toggleTrackModes(a),this.trackId===a&&(a===-1||(s=S[a])!==null&&s!==void 0&&s.details)||a<-1||a>=S.length)return;this.clearTimer();var x=S[a];if(this.log("Switching to subtitle track "+a),this.trackId=a,x){var T=x.id,A=x.groupId,w=A===void 0?"":A,v=x.name,b=x.type,g=x.url;this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:T,groupId:w,name:v,type:b,url:g});var f=this.switchParams(x.url,i==null?void 0:i.details);this.loadPlaylist(f)}else this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:a})},h.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var a=-1,i=d(this.media.textTracks),s=0;s<i.length;s++)if(i[s].mode==="hidden")a=s;else if(i[s].mode==="showing"){a=s;break}this.subtitleTrack!==a&&(this.subtitleTrack=a)},n(o,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(a){this.selectDefaultTrack=!1;var i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(a,i)}}]),o}(I.default);function d(u){for(var o=[],h=0;h<u.length;h++){var r=u[h];r.kind==="subtitles"&&r.label&&o.push(u[h])}return o}z.default=m},"./src/controller/timeline-controller.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"TimelineController",function(){return d});var X=M("./src/polyfills/number.ts"),F=M("./src/events.ts"),I=M("./src/utils/cea-608-parser.ts"),H=M("./src/utils/output-filter.ts"),N=M("./src/utils/webvtt-parser.ts"),n=M("./src/utils/texttrack-utils.ts"),P=M("./src/utils/imsc1-ttml-parser.ts"),p=M("./src/types/loader.ts"),m=M("./src/utils/logger.ts"),d=function(){function r(i){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=h(),this.captionsProperties=void 0,this.hls=i,this.config=i.config,this.Cues=i.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 s=new H.default(this,"textTrack1"),S=new H.default(this,"textTrack2"),x=new H.default(this,"textTrack3"),T=new H.default(this,"textTrack4");this.cea608Parser1=new I.default(1,s,S),this.cea608Parser2=new I.default(3,x,T)}i.on(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(F.Events.MANIFEST_LOADED,this.onManifestLoaded,this),i.on(F.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),i.on(F.Events.FRAG_LOADING,this.onFragLoading,this),i.on(F.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(F.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),i.on(F.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),i.on(F.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.on(F.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),i.on(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var a=r.prototype;return a.destroy=function(){var s=this.hls;s.off(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(F.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.off(F.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.off(F.Events.FRAG_LOADING,this.onFragLoading,this),s.off(F.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(F.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.off(F.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.off(F.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.off(F.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.off(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},a.addCues=function(s,S,x,T,A){for(var w=!1,v=A.length;v--;){var b=A[v],g=o(b[0],b[1],S,x);if(g>=0&&(b[0]=Math.min(b[0],S),b[1]=Math.max(b[1],x),w=!0,g/(x-S)>.5))return}if(w||A.push([S,x]),this.config.renderTextTracksNatively){var f=this.captionsTracks[s];this.Cues.newCue(f,S,x,T)}else{var C=this.Cues.newCue(null,S,x,T);this.hls.trigger(F.Events.CUES_PARSED,{type:"captions",cues:C,track:s})}},a.onInitPtsFound=function(s,S){var x=this,T=S.frag,A=S.id,w=S.initPTS,v=S.timescale,b=this.unparsedVttFrags;A==="main"&&(this.initPTS[T.cc]=w,this.timescale[T.cc]=v),b.length&&(this.unparsedVttFrags=[],b.forEach(function(g){x.onFragLoaded(F.Events.FRAG_LOADED,g)}))},a.getExistingTrack=function(s){var S=this.media;if(S)for(var x=0;x<S.textTracks.length;x++){var T=S.textTracks[x];if(T[s])return T}return null},a.createCaptionsTrack=function(s){this.config.renderTextTracksNatively?this.createNativeTrack(s):this.createNonNativeTrack(s)},a.createNativeTrack=function(s){if(this.captionsTracks[s])return;var S=this.captionsProperties,x=this.captionsTracks,T=this.media,A=S[s],w=A.label,v=A.languageCode,b=this.getExistingTrack(s);if(b)x[s]=b,Object(n.clearCurrentCues)(x[s]),Object(n.sendAddTrackEvent)(x[s],T);else{var g=this.createTextTrack("captions",w,v);g&&(g[s]=!0,x[s]=g)}},a.createNonNativeTrack=function(s){if(this.nonNativeCaptionsTracks[s])return;var S=this.captionsProperties[s];if(!S)return;var x=S.label,T={_id:s,label:x,kind:"captions",default:S.media?!!S.media.default:!1,closedCaptions:S.media};this.nonNativeCaptionsTracks[s]=T,this.hls.trigger(F.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[T]})},a.createTextTrack=function(s,S,x){var T=this.media;return T?T.addTextTrack(s,S,x):void 0},a.onMediaAttaching=function(s,S){this.media=S.media,this._cleanTracks()},a.onMediaDetaching=function(){var s=this.captionsTracks;Object.keys(s).forEach(function(S){Object(n.clearCurrentCues)(s[S]),delete s[S]}),this.nonNativeCaptionsTracks={}},a.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=h(),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())},a._cleanTracks=function(){var s=this.media;if(!s)return;var S=s.textTracks;if(S)for(var x=0;x<S.length;x++)Object(n.clearCurrentCues)(S[x])},a.onSubtitleTracksUpdated=function(s,S){var x=this;this.textTracks=[];var T=S.subtitleTracks||[],A=T.some(function(g){return g.textCodec===P.IMSC1_CODEC});if(this.config.enableWebVTT||A&&this.config.enableIMSC1){var w=this.tracks&&T&&this.tracks.length===T.length;if(this.tracks=T||[],this.config.renderTextTracksNatively){var v=this.media?this.media.textTracks:[];this.tracks.forEach(function(g,f){var C;if(f<v.length){for(var E=null,_=0;_<v.length;_++)if(u(v[_],g)){E=v[_];break}E&&(C=E)}C?Object(n.clearCurrentCues)(C):(C=x.createTextTrack("subtitles",g.name,g.lang),C&&(C.mode="disabled")),C&&(C.groupId=g.groupId,x.textTracks.push(C))})}else if(!w&&this.tracks&&this.tracks.length){var b=this.tracks.map(function(g){return{label:g.name,kind:g.type.toLowerCase(),default:g.default,subtitleTrack:g}});this.hls.trigger(F.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:b})}}},a.onManifestLoaded=function(s,S){var x=this;this.config.enableCEA708Captions&&S.captions&&S.captions.forEach(function(T){var A=/(?:CC|SERVICE)([1-4])/.exec(T.instreamId);if(!A)return;var w="textTrack"+A[1],v=x.captionsProperties[w];if(!v)return;v.label=T.name,T.lang&&(v.languageCode=T.lang),v.media=T})},a.onFragLoading=function(s,S){var x=this.cea608Parser1,T=this.cea608Parser2,A=this.lastSn,w=this.lastPartIndex;if(!this.enabled||!(x&&T))return;if(S.frag.type===p.PlaylistLevelType.MAIN){var v,b,g=S.frag.sn,f=(v=S==null||((b=S.part)===null||b===void 0)?void 0:b.index)!=null?v:-1;g===A+1||g===A&&f===w+1||(x.reset(),T.reset()),this.lastSn=g,this.lastPartIndex=f}},a.onFragLoaded=function(s,S){var x=S.frag,T=S.payload,A=this.initPTS,w=this.unparsedVttFrags;if(x.type===p.PlaylistLevelType.SUBTITLE)if(T.byteLength){if(!Object(X.isFiniteNumber)(A[x.cc])){w.push(S),A.length&&this.hls.trigger(F.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:x,error:new Error("Missing initial subtitle PTS")});return}var v=x.decryptdata;if(v==null||v.key==null||v.method!=="AES-128"){var b=this.tracks[x.level],g=this.vttCCs;g[x.cc]||(g[x.cc]={start:x.start,prevCC:this.prevCC,new:!0},this.prevCC=x.cc),b&&b.textCodec===P.IMSC1_CODEC?this._parseIMSC1(x,T):this._parseVTTs(x,T,g)}}else this.hls.trigger(F.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:x,error:new Error("Empty subtitle payload")})},a._parseIMSC1=function(s,S){var x=this,T=this.hls;Object(P.parseIMSC1)(S,this.initPTS[s.cc],this.timescale[s.cc],function(A){x._appendCues(A,s.level),T.trigger(F.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},function(A){m.logger.log("Failed to parse IMSC1: "+A),T.trigger(F.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:A})})},a._parseVTTs=function(s,S,x){var T=this,A=this.hls;Object(N.parseWebVTT)(S,this.initPTS[s.cc],this.timescale[s.cc],x,s.cc,s.start,function(w){T._appendCues(w,s.level),A.trigger(F.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},function(w){T._fallbackToIMSC1(s,S),m.logger.log("Failed to parse VTT cue: "+w),A.trigger(F.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:w})})},a._fallbackToIMSC1=function(s,S){var x=this,T=this.tracks[s.level];T.textCodec||Object(P.parseIMSC1)(S,this.initPTS[s.cc],this.timescale[s.cc],function(){T.textCodec=P.IMSC1_CODEC,x._parseIMSC1(s,S)},function(){T.textCodec="wvtt"})},a._appendCues=function(s,S){var x=this.hls;if(this.config.renderTextTracksNatively){var T=this.textTracks[S];if(T.mode==="disabled")return;s.forEach(function(v){return Object(n.addCueToTrack)(T,v)})}else{var A=this.tracks[S],w=A.default?"default":"subtitles"+S;x.trigger(F.Events.CUES_PARSED,{type:"subtitles",cues:s,track:w})}},a.onFragDecrypted=function(s,S){var x=S.frag;if(x.type===p.PlaylistLevelType.SUBTITLE){if(!Object(X.isFiniteNumber)(this.initPTS[x.cc])){this.unparsedVttFrags.push(S);return}this.onFragLoaded(F.Events.FRAG_LOADED,S)}},a.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},a.onFragParsingUserdata=function(s,S){var x=this.cea608Parser1,T=this.cea608Parser2;if(!this.enabled||!(x&&T))return;for(var A=0;A<S.samples.length;A++){var w=S.samples[A].bytes;if(w){var v=this.extractCea608Data(w);x.addData(S.samples[A].pts,v[0]),T.addData(S.samples[A].pts,v[1])}}},a.onBufferFlushing=function(s,S){var x=S.startOffset,T=S.endOffset,A=S.endOffsetSubtitles,w=S.type,v=this.media;if(!v||v.currentTime<T)return;if(!w||w==="video"){var b=this.captionsTracks;Object.keys(b).forEach(function(f){return Object(n.removeCuesInRange)(b[f],x,T)})}if(this.config.renderTextTracksNatively&&(x===0&&A!==void 0)){var g=this.textTracks;Object.keys(g).forEach(function(f){return Object(n.removeCuesInRange)(g[f],x,A)})}},a.extractCea608Data=function(s){for(var S=s[0]&31,x=2,T=[[],[]],A=0;A<S;A++){var w=s[x++],v=127&s[x++],b=127&s[x++],g=(4&w)!==0,f=3&w;if(v===0&&b===0)continue;g&&((f===0||f===1)&&(T[f].push(v),T[f].push(b)))}return T},r}();function u(r,a){return r&&r.label===a.name&&!(r.textTrack1||r.textTrack2)}function o(r,a,i,s){return Math.min(a,s)-Math.max(r,i)}function h(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"default",function(){return X});var X=function(){function F(H,N){this.subtle=void 0,this.aesIV=void 0,this.subtle=H,this.aesIV=N}var I=F.prototype;return I.decrypt=function(N,n){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},n,N)},F}()},"./src/crypt/aes-decryptor.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"removePadding",function(){return F}),M.d(z,"default",function(){return I});var X=M("./src/utils/typed-array.ts");function F(H){var N=H.byteLength,n=N&&new DataView(H.buffer).getUint8(N-1);return n?Object(X.sliceUint8)(H,0,N-n):H}var I=function(){function H(){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 N=H.prototype;return N.uint8ArrayToUint32Array_=function(P){for(var p=new DataView(P),m=new Uint32Array(4),d=0;d<4;d++)m[d]=p.getUint32(d*4);return m},N.initTable=function(){var P=this.sBox,p=this.invSBox,m=this.subMix,d=m[0],u=m[1],o=m[2],h=m[3],r=this.invSubMix,a=r[0],i=r[1],s=r[2],S=r[3],x=new Uint32Array(256),T=0,A=0,w=0;for(w=0;w<256;w++)w<128?x[w]=w<<1:x[w]=w<<1^283;for(w=0;w<256;w++){var v=A^A<<1^A<<2^A<<3^A<<4;v=v>>>8^v&255^99,P[T]=v,p[v]=T;var b=x[T],g=x[b],f=x[g],C=x[v]*257^v*16843008;d[T]=C<<24|C>>>8,u[T]=C<<16|C>>>16,o[T]=C<<8|C>>>24,h[T]=C,C=f*16843009^g*65537^b*257^T*16843008,a[v]=C<<24|C>>>8,i[v]=C<<16|C>>>16,s[v]=C<<8|C>>>24,S[v]=C,T?(T=b^x[x[x[f^b]]],A^=x[x[A]]):T=A=1}},N.expandKey=function(P){for(var p=this.uint8ArrayToUint32Array_(P),m=!0,d=0;d<p.length&&m;)m=p[d]===this.key[d],d++;if(m)return;this.key=p;var u=this.keySize=p.length;if(u!==4&&u!==6&&u!==8)throw new Error("Invalid aes key size="+u);var o=this.ksRows=(u+6+1)*4,h,r,a=this.keySchedule=new Uint32Array(o),i=this.invKeySchedule=new Uint32Array(o),s=this.sBox,S=this.rcon,x=this.invSubMix,T=x[0],A=x[1],w=x[2],v=x[3],b,g;for(h=0;h<o;h++){if(h<u){b=a[h]=p[h];continue}g=b,h%u===0?(g=g<<8|g>>>24,g=s[g>>>24]<<24|s[g>>>16&255]<<16|s[g>>>8&255]<<8|s[g&255],g^=S[h/u|0]<<24):u>6&&h%u===4&&(g=s[g>>>24]<<24|s[g>>>16&255]<<16|s[g>>>8&255]<<8|s[g&255]),a[h]=b=(a[h-u]^g)>>>0}for(r=0;r<o;r++)h=o-r,r&3?g=a[h]:g=a[h-4],r<4||h<=4?i[r]=g:i[r]=T[s[g>>>24]]^A[s[g>>>16&255]]^w[s[g>>>8&255]]^v[s[g&255]],i[r]=i[r]>>>0},N.networkToHostOrderSwap=function(P){return P<<24|(P&65280)<<8|(P&16711680)>>8|P>>>24},N.decrypt=function(P,p,m){for(var d=this.keySize+6,u=this.invKeySchedule,o=this.invSBox,h=this.invSubMix,r=h[0],a=h[1],i=h[2],s=h[3],S=this.uint8ArrayToUint32Array_(m),x=S[0],T=S[1],A=S[2],w=S[3],v=new Int32Array(P),b=new Int32Array(v.length),g,f,C,E,_,U,j,L,G,B,O,V,te,re,ge=this.networkToHostOrderSwap;p<v.length;){for(G=ge(v[p]),B=ge(v[p+1]),O=ge(v[p+2]),V=ge(v[p+3]),_=G^u[0],U=V^u[1],j=O^u[2],L=B^u[3],te=4,re=1;re<d;re++)g=r[_>>>24]^a[U>>16&255]^i[j>>8&255]^s[L&255]^u[te],f=r[U>>>24]^a[j>>16&255]^i[L>>8&255]^s[_&255]^u[te+1],C=r[j>>>24]^a[L>>16&255]^i[_>>8&255]^s[U&255]^u[te+2],E=r[L>>>24]^a[_>>16&255]^i[U>>8&255]^s[j&255]^u[te+3],_=g,U=f,j=C,L=E,te=te+4;g=o[_>>>24]<<24^o[U>>16&255]<<16^o[j>>8&255]<<8^o[L&255]^u[te],f=o[U>>>24]<<24^o[j>>16&255]<<16^o[L>>8&255]<<8^o[_&255]^u[te+1],C=o[j>>>24]<<24^o[L>>16&255]<<16^o[_>>8&255]<<8^o[U&255]^u[te+2],E=o[L>>>24]<<24^o[_>>16&255]<<16^o[U>>8&255]<<8^o[j&255]^u[te+3],b[p]=ge(g^x),b[p+1]=ge(E^T),b[p+2]=ge(C^A),b[p+3]=ge(f^w),x=G,T=B,A=O,w=V,p=p+4}return b.buffer},H}()},"./src/crypt/decrypter.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"default",function(){return p});var X=M("./src/crypt/aes-crypto.ts"),F=M("./src/crypt/fast-aes-key.ts"),I=M("./src/crypt/aes-decryptor.ts"),H=M("./src/utils/logger.ts"),N=M("./src/utils/mp4-tools.ts"),n=M("./src/utils/typed-array.ts"),P=16,p=function(){function m(u,o,h){var r=h===void 0?{}:h,a=r.removePKCS7Padding,i=a===void 0?!0:a;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=u,this.config=o,this.removePKCS7Padding=i,i)try{var s=self.crypto;s&&(this.subtle=s.subtle||s.webkitSubtle)}catch(S){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var d=m.prototype;return d.destroy=function(){this.observer=null},d.isSync=function(){return this.config.enableSoftwareAES},d.flush=function(){var o=this.currentResult;if(!o){this.reset();return}var h=new Uint8Array(o);return this.reset(),this.removePKCS7Padding?Object(I.removePadding)(h):h},d.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},d.decrypt=function(o,h,r,a){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(o),h,r);var i=this.flush();i&&a(i.buffer)}else this.webCryptoDecrypt(new Uint8Array(o),h,r).then(a)},d.softwareDecrypt=function(o,h,r){var a=this.currentIV,i=this.currentResult,s=this.remainderData;this.logOnce("JS AES decrypt"),s&&(o=Object(N.appendUint8Array)(s,o),this.remainderData=null);var S=this.getValidChunk(o);if(!S.length)return null;a&&(r=a);var x=this.softwareDecrypter;x||(x=this.softwareDecrypter=new I.default),x.expandKey(h);var T=i;return this.currentResult=x.decrypt(S.buffer,0,r),this.currentIV=Object(n.sliceUint8)(S,-16).buffer,T||null},d.webCryptoDecrypt=function(o,h,r){var a=this,i=this.subtle;return(this.key!==h||!this.fastAesKey)&&(this.key=h,this.fastAesKey=new F.default(i,h)),this.fastAesKey.expandKey().then(function(s){if(!i)return Promise.reject(new Error("web crypto not initialized"));var S=new X.default(i,r);return S.decrypt(o.buffer,s)}).catch(function(s){return a.onWebCryptoError(s,o,h,r)})},d.onWebCryptoError=function(o,h,r,a){return H.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",o),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(h,r,a)},d.getValidChunk=function(o){var h=o,r=o.length-o.length%P;return r!==o.length&&(h=Object(n.sliceUint8)(o,0,r),this.remainderData=Object(n.sliceUint8)(o,r)),h},d.logOnce=function(o){if(!this.logEnabled)return;H.logger.log("[decrypter.ts]: "+o),this.logEnabled=!1},m}()},"./src/crypt/fast-aes-key.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"default",function(){return X});var X=function(){function F(H,N){this.subtle=void 0,this.key=void 0,this.subtle=H,this.key=N}var I=F.prototype;return I.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},F}()},"./src/demux/aacdemuxer.ts":function(Q,z,M){"use strict";M.r(z);var X=M("./src/demux/base-audio-demuxer.ts"),F=M("./src/demux/adts.ts"),I=M("./src/utils/logger.ts"),H=M("./src/demux/id3.ts");function N(p,m){p.prototype=Object.create(m.prototype),p.prototype.constructor=p,n(p,m)}function n(p,m){return n=Object.setPrototypeOf||function(u,o){return u.__proto__=o,u},n(p,m)}var P=function(p){N(m,p);function m(u,o){var h;return h=p.call(this)||this,h.observer=void 0,h.config=void 0,h.observer=u,h.config=o,h}var d=m.prototype;return d.resetInitSegment=function(o,h,r){p.prototype.resetInitSegment.call(this,o,h,r),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:o,duration:r,inputTimeScale:9e4,dropped:0}},m.probe=function(o){if(!o)return!1;for(var h=H.getID3Data(o,0)||[],r=h.length,a=o.length;r<a;r++)if(F.probe(o,r))return I.logger.log("ADTS sync word found !"),!0;return!1},d.canParse=function(o,h){return F.canParse(o,h)},d.appendFrame=function(o,h,r){F.initTrackConfig(o,this.observer,h,r,o.manifestCodec);var a=F.appendFrame(o,h,r,this.initPTS,this.frameIndex);if(a&&a.missing===0)return a},m}(X.default);P.minProbeByteLength=9,z.default=P},"./src/demux/adts.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"getAudioConfig",function(){return H}),M.d(z,"isHeaderPattern",function(){return N}),M.d(z,"getHeaderLength",function(){return n}),M.d(z,"getFullFrameLength",function(){return P}),M.d(z,"canGetFrameLength",function(){return p}),M.d(z,"isHeader",function(){return m}),M.d(z,"canParse",function(){return d}),M.d(z,"probe",function(){return u}),M.d(z,"initTrackConfig",function(){return o}),M.d(z,"getFrameDuration",function(){return h}),M.d(z,"parseFrameHeader",function(){return r}),M.d(z,"appendFrame",function(){return a});var X=M("./src/utils/logger.ts"),F=M("./src/errors.ts"),I=M("./src/events.ts");function H(i,s,S,x){var T,A,w,v,b=navigator.userAgent.toLowerCase(),g=x,f=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];T=((s[S+2]&192)>>>6)+1;var C=(s[S+2]&60)>>>2;if(C>f.length-1){i.trigger(I.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+C});return}return w=(s[S+2]&1)<<2,w|=(s[S+3]&192)>>>6,X.logger.log("manifest codec:"+x+", ADTS type:"+T+", samplingIndex:"+C),/firefox/i.test(b)?C>=6?(T=5,v=new Array(4),A=C-3):(T=2,v=new Array(2),A=C):b.indexOf("android")!==-1?(T=2,v=new Array(2),A=C):(T=5,v=new Array(4),x&&(x.indexOf("mp4a.40.29")!==-1||x.indexOf("mp4a.40.5")!==-1)||!x&&C>=6?A=C-3:((x&&x.indexOf("mp4a.40.2")!==-1&&(C>=6&&w===1||/vivaldi/i.test(b))||!x&&w===1)&&(T=2,v=new Array(2)),A=C)),v[0]=T<<3,v[0]|=(C&14)>>1,v[1]|=(C&1)<<7,v[1]|=w<<3,T===5&&(v[1]|=(A&14)>>1,v[2]=(A&1)<<7,v[2]|=2<<2,v[3]=0),{config:v,samplerate:f[C],channelCount:w,codec:"mp4a.40."+T,manifestCodec:g}}function N(i,s){return i[s]===255&&(i[s+1]&246)===240}function n(i,s){return i[s+1]&1?7:9}function P(i,s){return(i[s+3]&3)<<11|i[s+4]<<3|(i[s+5]&224)>>>5}function p(i,s){return s+5<i.length}function m(i,s){return s+1<i.length&&N(i,s)}function d(i,s){return p(i,s)&&N(i,s)&&P(i,s)<=i.length-s}function u(i,s){if(m(i,s)){var S=n(i,s);if(s+S>=i.length)return!1;var x=P(i,s);if(x<=S)return!1;var T=s+x;return T===i.length||m(i,T)}return!1}function o(i,s,S,x,T){if(!i.samplerate){var A=H(s,S,x,T);if(!A)return;i.config=A.config,i.samplerate=A.samplerate,i.channelCount=A.channelCount,i.codec=A.codec,i.manifestCodec=A.manifestCodec,X.logger.log("parsed codec:"+i.codec+", rate:"+A.samplerate+", channels:"+A.channelCount)}}function h(i){return 1024*9e4/i}function r(i,s,S,x,T){var A=n(i,s),w=P(i,s);if(w-=A,w>0){var v=S+x*T;return{headerLength:A,frameLength:w,stamp:v}}}function a(i,s,S,x,T){var A=h(i.samplerate),w=r(s,S,x,T,A);if(w){var v=w.frameLength,b=w.headerLength,g=w.stamp,f=b+v,C=Math.max(0,S+f-s.length),E;C?(E=new Uint8Array(f-b),E.set(s.subarray(S+b,s.length),0)):E=s.subarray(S+b,S+f);var _={unit:E,pts:g};return C||i.samples.push(_),{sample:_,length:f,missing:C}}}},"./src/demux/base-audio-demuxer.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"initPTSFn",function(){return P});var X=M("./src/polyfills/number.ts"),F=M("./src/demux/id3.ts"),I=M("./src/demux/dummy-demuxed-track.ts"),H=M("./src/utils/mp4-tools.ts"),N=M("./src/utils/typed-array.ts"),n=function(){function p(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var m=p.prototype;return m.resetInitSegment=function(u,o,h){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},m.resetTimeStamp=function(){},m.resetContiguity=function(){},m.canParse=function(u,o){return!1},m.appendFrame=function(u,o,h){},m.demux=function(u,o){this.cachedData&&(u=Object(H.appendUint8Array)(this.cachedData,u),this.cachedData=null);var h=F.getID3Data(u,0),r=h?h.length:0,a,i,s=this._audioTrack,S=this._id3Track,x=h?F.getTimeStamp(h):void 0,T=u.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=P(x,o)),h&&h.length>0&&S.samples.push({pts:this.initPTS,dts:this.initPTS,data:h}),i=this.initPTS;r<T;){if(this.canParse(u,r)){var A=this.appendFrame(s,u,r);A?(this.frameIndex++,i=A.sample.pts,r+=A.length,a=r):r=T}else F.canParse(u,r)?(h=F.getID3Data(u,r),S.samples.push({pts:i,dts:i,data:h}),r+=h.length,a=r):r++;if(r===T&&a!==T){var w=Object(N.sliceUint8)(u,a);this.cachedData?this.cachedData=Object(H.appendUint8Array)(this.cachedData,w):this.cachedData=w}}return{audioTrack:s,avcTrack:Object(I.dummyTrack)(),id3Track:S,textTrack:Object(I.dummyTrack)()}},m.demuxSampleAes=function(u,o,h){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},m.flush=function(u){var o=this.cachedData;return o&&(this.cachedData=null,this.demux(o,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(I.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(I.dummyTrack)()}},m.destroy=function(){},p}(),P=function(m,d){return Object(X.isFiniteNumber)(m)?m*90:d*9e4};z.default=n},"./src/demux/chunk-cache.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"default",function(){return X});var X=function(){function I(){this.chunks=[],this.dataLength=0}var H=I.prototype;return H.push=function(n){this.chunks.push(n),this.dataLength+=n.length},H.flush=function(){var n=this.chunks,P=this.dataLength,p;if(n.length)n.length===1?p=n[0]:p=F(n,P);else return new Uint8Array(0);return this.reset(),p},H.reset=function(){this.chunks.length=0,this.dataLength=0},I}();function F(I,H){for(var N=new Uint8Array(H),n=0,P=0;P<I.length;P++){var p=I[P];N.set(p,n),n+=p.length}return N}},"./src/demux/dummy-demuxed-track.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"dummyTrack",function(){return X});function X(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(Q,z,M){"use strict";M.r(z);var X=M("./src/utils/logger.ts"),F=function(){function I(N){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=N,this.bytesAvailable=N.byteLength,this.word=0,this.bitsAvailable=0}var H=I.prototype;return H.loadWord=function(){var n=this.data,P=this.bytesAvailable,p=n.byteLength-P,m=new Uint8Array(4),d=Math.min(4,P);if(d===0)throw new Error("no bytes available");m.set(n.subarray(p,p+d)),this.word=new DataView(m.buffer).getUint32(0),this.bitsAvailable=d*8,this.bytesAvailable-=d},H.skipBits=function(n){var P;this.bitsAvailable>n?(this.word<<=n,this.bitsAvailable-=n):(n-=this.bitsAvailable,P=n>>3,n-=P>>3,this.bytesAvailable-=P,this.loadWord(),this.word<<=n,this.bitsAvailable-=n)},H.readBits=function(n){var P=Math.min(this.bitsAvailable,n),p=this.word>>>32-P;return n>32&&X.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=P,this.bitsAvailable>0?this.word<<=P:this.bytesAvailable>0&&this.loadWord(),P=n-P,P>0&&this.bitsAvailable?p<<P|this.readBits(P):p},H.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()},H.skipUEG=function(){this.skipBits(1+this.skipLZ())},H.skipEG=function(){this.skipBits(1+this.skipLZ())},H.readUEG=function(){var n=this.skipLZ();return this.readBits(n+1)-1},H.readEG=function(){var n=this.readUEG();return 1&n?1+n>>>1:-1*(n>>>1)},H.readBoolean=function(){return this.readBits(1)===1},H.readUByte=function(){return this.readBits(8)},H.readUShort=function(){return this.readBits(16)},H.readUInt=function(){return this.readBits(32)},H.skipScalingList=function(n){for(var P=8,p=8,m,d=0;d<n;d++)p!==0&&(m=this.readEG(),p=(P+m+256)%256),P=p===0?P:p},H.readSPS=function(){var n=0,P=0,p=0,m=0,d,u,o,h=this.readUByte.bind(this),r=this.readBits.bind(this),a=this.readUEG.bind(this),i=this.readBoolean.bind(this),s=this.skipBits.bind(this),S=this.skipEG.bind(this),x=this.skipUEG.bind(this),T=this.skipScalingList.bind(this);h();var A=h();if(r(5),s(3),h(),x(),A===100||A===110||A===122||A===244||A===44||A===83||A===86||A===118||A===128){var w=a();if(w===3&&s(1),x(),x(),s(1),i())for(u=w!==3?8:12,o=0;o<u;o++)i()&&(o<6?T(16):T(64))}x();var v=a();if(v===0)a();else if(v===1)for(s(1),S(),S(),d=a(),o=0;o<d;o++)S();x(),s(1);var b=a(),g=a(),f=r(1);f===0&&s(1),s(1),i()&&(n=a(),P=a(),p=a(),m=a());var C=[1,1];if(i()&&i()){var E=h();switch(E){case 1:C=[1,1];break;case 2:C=[12,11];break;case 3:C=[10,11];break;case 4:C=[16,11];break;case 5:C=[40,33];break;case 6:C=[24,11];break;case 7:C=[20,11];break;case 8:C=[32,11];break;case 9:C=[80,33];break;case 10:C=[18,11];break;case 11:C=[15,11];break;case 12:C=[64,33];break;case 13:C=[160,99];break;case 14:C=[4,3];break;case 15:C=[3,2];break;case 16:C=[2,1];break;case 255:{C=[h()<<8|h(),h()<<8|h()];break}}}return{width:Math.ceil((b+1)*16-n*2-P*2),height:(2-f)*(g+1)*16-(f?2:4)*(p+m),pixelRatio:C}},H.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},I}();z.default=F},"./src/demux/id3.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"isHeader",function(){return X}),M.d(z,"isFooter",function(){return F}),M.d(z,"getID3Data",function(){return I}),M.d(z,"canParse",function(){return N}),M.d(z,"getTimeStamp",function(){return n}),M.d(z,"isTimeStampFrame",function(){return P}),M.d(z,"getID3Frames",function(){return m}),M.d(z,"decodeFrame",function(){return d}),M.d(z,"utf8ArrayToStr",function(){return a}),M.d(z,"testables",function(){return i});var X=function(T,A){return A+10<=T.length&&(T[A]===73&&T[A+1]===68&&T[A+2]===51&&(T[A+3]<255&&T[A+4]<255&&(T[A+6]<128&&T[A+7]<128&&T[A+8]<128&&T[A+9]<128)))},F=function(T,A){return A+10<=T.length&&(T[A]===51&&T[A+1]===68&&T[A+2]===73&&(T[A+3]<255&&T[A+4]<255&&(T[A+6]<128&&T[A+7]<128&&T[A+8]<128&&T[A+9]<128)))},I=function(T,A){for(var w=A,v=0;X(T,A);){v+=10;var b=H(T,A+6);v+=b,F(T,A+10)&&(v+=10),A+=v}return v>0?T.subarray(w,w+v):void 0},H=function(T,A){var w=0;return w=(T[A]&127)<<21,w|=(T[A+1]&127)<<14,w|=(T[A+2]&127)<<7,w|=T[A+3]&127,w},N=function(T,A){return X(T,A)&&H(T,A+6)+10<=T.length-A},n=function(T){for(var A=m(T),w=0;w<A.length;w++){var v=A[w];if(P(v))return r(v)}return},P=function(T){return T&&T.key==="PRIV"&&T.info==="com.apple.streaming.transportStreamTimestamp"},p=function(T){var A=String.fromCharCode(T[0],T[1],T[2],T[3]),w=H(T,4),v=10;return{type:A,size:w,data:T.subarray(v,v+w)}},m=function(T){for(var A=0,w=[];X(T,A);){var v=H(T,A+6);A+=10;for(var b=A+v;A+8<b;){var g=p(T.subarray(A)),f=d(g);f&&w.push(f),A+=g.size+10}F(T,A)&&(A+=10)}return w},d=function(T){return T.type==="PRIV"?u(T):T.type[0]==="W"?h(T):o(T)},u=function(T){if(T.size<2)return;var A=a(T.data,!0),w=new Uint8Array(T.data.subarray(A.length+1));return{key:T.type,info:A,data:w.buffer}},o=function(T){if(T.size<2)return;if(T.type==="TXXX"){var A=1,w=a(T.data.subarray(A),!0);A+=w.length+1;var v=a(T.data.subarray(A));return{key:T.type,info:w,data:v}}var b=a(T.data.subarray(1));return{key:T.type,data:b}},h=function(T){if(T.type==="WXXX"){if(T.size<2)return;var A=1,w=a(T.data.subarray(A),!0);A+=w.length+1;var v=a(T.data.subarray(A));return{key:T.type,info:w,data:v}}var b=a(T.data);return{key:T.type,data:b}},r=function(T){if(T.data.byteLength===8){var A=new Uint8Array(T.data),w=A[3]&1,v=(A[4]<<23)+(A[5]<<15)+(A[6]<<7)+A[7];return v/=45,w&&(v+=4772185884e-2),Math.round(v)}return},a=function(T,A){A===void 0&&(A=!1);var w=S();if(w){var v=w.decode(T);if(A){var b=v.indexOf("\0");return b!==-1?v.substring(0,b):v}return v.replace(/\0/g,"")}for(var g=T.length,f,C,E,_="",U=0;U<g;){if(f=T[U++],f===0&&A)return _;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:_+=String.fromCharCode(f);break;case 12:case 13:C=T[U++],_+=String.fromCharCode((f&31)<<6|C&63);break;case 14:C=T[U++],E=T[U++],_+=String.fromCharCode((f&15)<<12|(C&63)<<6|(E&63)<<0);break;default:}}return _},i={decodeTextFrame:o},s;function S(){return!s&&typeof self.TextDecoder!="undefined"&&(s=new self.TextDecoder("utf-8")),s}},"./src/demux/mp3demuxer.ts":function(Q,z,M){"use strict";M.r(z);var X=M("./src/demux/base-audio-demuxer.ts"),F=M("./src/demux/id3.ts"),I=M("./src/utils/logger.ts"),H=M("./src/demux/mpegaudio.ts");function N(p,m){p.prototype=Object.create(m.prototype),p.prototype.constructor=p,n(p,m)}function n(p,m){return n=Object.setPrototypeOf||function(u,o){return u.__proto__=o,u},n(p,m)}var P=function(p){N(m,p);function m(){return p.apply(this,arguments)||this}var d=m.prototype;return d.resetInitSegment=function(o,h,r){p.prototype.resetInitSegment.call(this,o,h,r),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:o,duration:r,inputTimeScale:9e4,dropped:0}},m.probe=function(o){if(!o)return!1;for(var h=F.getID3Data(o,0)||[],r=h.length,a=o.length;r<a;r++)if(H.probe(o,r))return I.logger.log("MPEG Audio sync word found !"),!0;return!1},d.canParse=function(o,h){return H.canParse(o,h)},d.appendFrame=function(o,h,r){return this.initPTS===null?void 0:H.appendFrame(o,h,r,this.initPTS,this.frameIndex)},m}(X.default);P.minProbeByteLength=4,z.default=P},"./src/demux/mp4demuxer.ts":function(Q,z,M){"use strict";M.r(z);var X=M("./src/utils/mp4-tools.ts"),F=M("./src/demux/dummy-demuxed-track.ts"),I=function(){function H(n,P){this.remainderData=null,this.config=void 0,this.config=P}var N=H.prototype;return N.resetTimeStamp=function(){},N.resetInitSegment=function(){},N.resetContiguity=function(){},H.probe=function(P){return Object(X.findBox)({data:P,start:0,end:Math.min(P.length,16384)},["moof"]).length>0},N.demux=function(P){var p=P,m=Object(F.dummyTrack)();if(this.config.progressive){this.remainderData&&(p=Object(X.appendUint8Array)(this.remainderData,P));var d=Object(X.segmentValidRange)(p);this.remainderData=d.remainder,m.samples=d.valid||new Uint8Array}else m.samples=p;return{audioTrack:Object(F.dummyTrack)(),avcTrack:m,id3Track:Object(F.dummyTrack)(),textTrack:Object(F.dummyTrack)()}},N.flush=function(){var P=Object(F.dummyTrack)();return P.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(F.dummyTrack)(),avcTrack:P,id3Track:Object(F.dummyTrack)(),textTrack:Object(F.dummyTrack)()}},N.demuxSampleAes=function(P,p,m){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},N.destroy=function(){},H}();I.minProbeByteLength=1024,z.default=I},"./src/demux/mpegaudio.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"appendFrame",function(){return n}),M.d(z,"parseHeader",function(){return P}),M.d(z,"isHeaderPattern",function(){return p}),M.d(z,"isHeader",function(){return m}),M.d(z,"canParse",function(){return d}),M.d(z,"probe",function(){return u});var X=null,F=[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],I=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],H=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],N=[0,1,1,4];function n(o,h,r,a,i){if(r+24>h.length)return;var s=P(h,r);if(s&&r+s.frameLength<=h.length){var S=s.samplesPerFrame*9e4/s.sampleRate,x=a+i*S,T={unit:h.subarray(r,r+s.frameLength),pts:x,dts:x};return o.config=[],o.channelCount=s.channelCount,o.samplerate=s.sampleRate,o.samples.push(T),{sample:T,length:s.frameLength,missing:0}}}function P(o,h){var r=o[h+1]>>3&3,a=o[h+1]>>1&3,i=o[h+2]>>4&15,s=o[h+2]>>2&3;if(r!==1&&i!==0&&i!==15&&s!==3){var S=o[h+2]>>1&1,x=o[h+3]>>6,T=r===3?3-a:a===3?3:4,A=F[T*14+i-1]*1e3,w=r===3?0:r===2?1:2,v=I[w*3+s],b=x===3?1:2,g=H[r][a],f=N[a],C=g*8*f,E=Math.floor(g*A/v+S)*f;if(X===null){var _=navigator.userAgent||"",U=_.match(/Chrome\/(\d+)/i);X=U?parseInt(U[1]):0}var j=!!X&&X<=87;return j&&a===2&&A>=224e3&&x===0&&(o[h+3]=o[h+3]|128),{sampleRate:v,channelCount:b,frameLength:E,samplesPerFrame:C}}}function p(o,h){return o[h]===255&&(o[h+1]&224)===224&&(o[h+1]&6)!==0}function m(o,h){return h+1<o.length&&p(o,h)}function d(o,h){var r=4;return p(o,h)&&r<=o.length-h}function u(o,h){if(h+1<o.length&&p(o,h)){var r=4,a=P(o,h),i=r;a!=null&&a.frameLength&&(i=a.frameLength);var s=h+i;return s===o.length||m(o,s)}return!1}},"./src/demux/sample-aes.ts":function(Q,z,M){"use strict";M.r(z);var X=M("./src/crypt/decrypter.ts"),F=M("./src/demux/tsdemuxer.ts"),I=function(){function H(n,P,p){this.keyData=void 0,this.decrypter=void 0,this.keyData=p,this.decrypter=new X.default(n,P,{removePKCS7Padding:!1})}var N=H.prototype;return N.decryptBuffer=function(P,p){this.decrypter.decrypt(P,this.keyData.key.buffer,this.keyData.iv.buffer,p)},N.decryptAacSample=function(P,p,m,d){var u=P[p].unit,o=u.subarray(16,u.length-u.length%16),h=o.buffer.slice(o.byteOffset,o.byteOffset+o.length),r=this;this.decryptBuffer(h,function(a){var i=new Uint8Array(a);u.set(i,16),d||r.decryptAacSamples(P,p+1,m)})},N.decryptAacSamples=function(P,p,m){for(;;p++){if(p>=P.length){m();return}if(P[p].unit.length<32)continue;var d=this.decrypter.isSync();if(this.decryptAacSample(P,p,m,d),!d)return}},N.getAvcEncryptedData=function(P){for(var p=Math.floor((P.length-48)/160)*16+16,m=new Int8Array(p),d=0,u=32;u<=P.length-16;u+=160,d+=16)m.set(P.subarray(u,u+16),d);return m},N.getAvcDecryptedUnit=function(P,p){for(var m=new Uint8Array(p),d=0,u=32;u<=P.length-16;u+=160,d+=16)P.set(m.subarray(d,d+16),u);return P},N.decryptAvcSample=function(P,p,m,d,u,o){var h=Object(F.discardEPB)(u.data),r=this.getAvcEncryptedData(h),a=this;this.decryptBuffer(r.buffer,function(i){u.data=a.getAvcDecryptedUnit(h,i),o||a.decryptAvcSamples(P,p,m+1,d)})},N.decryptAvcSamples=function(P,p,m,d){if(P instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;p++,m=0){if(p>=P.length){d();return}for(var u=P[p].units;!(m>=u.length);m++){var o=u[m];if(o.data.length<=48||o.type!==1&&o.type!==5)continue;var h=this.decrypter.isSync();if(this.decryptAvcSample(P,p,m,d,o,h),!h)return}}},H}();z.default=I},"./src/demux/transmuxer-interface.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"default",function(){return u});var X=M("./node_modules/webworkify-webpack/index.js"),F=M.n(X),I=M("./src/events.ts"),H=M("./src/demux/transmuxer.ts"),N=M("./src/utils/logger.ts"),n=M("./src/errors.ts"),P=M("./src/utils/mediasource-helper.ts"),p=M("./node_modules/eventemitter3/index.js"),m=M.n(p),d=Object(P.getMediaSource)()||{isTypeSupported:function(){return!1}},u=function(){function o(r,a,i,s){var S=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=r,this.id=a,this.onTransmuxComplete=i,this.onFlush=s;var x=r.config,T=function(g,f){f=f||{},f.frag=S.frag,f.id=S.id,r.trigger(g,f)};this.observer=new p.EventEmitter,this.observer.on(I.Events.FRAG_DECRYPTED,T),this.observer.on(I.Events.ERROR,T);var A={mp4:d.isTypeSupported("video/mp4"),mpeg:d.isTypeSupported("audio/mpeg"),mp3:d.isTypeSupported('audio/mp4; codecs="mp3"')},w=navigator.vendor;if(x.enableWorker&&typeof Worker!="undefined"){N.logger.log("demuxing in webworker");var v;try{v=this.worker=X("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),v.addEventListener("message",this.onwmsg),v.onerror=function(b){r.trigger(I.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(b.message+" ("+b.filename+":"+b.lineno+")")})},v.postMessage({cmd:"init",typeSupported:A,vendor:w,id:a,config:JSON.stringify(x)})}catch(b){N.logger.warn("Error in worker:",b),N.logger.error("Error while initializing DemuxerWorker, fallback to inline"),v&&self.URL.revokeObjectURL(v.objectURL),this.transmuxer=new H.default(this.observer,A,x,w,a),this.worker=null}}else this.transmuxer=new H.default(this.observer,A,x,w,a)}var h=o.prototype;return h.destroy=function(){var a=this.worker;if(a)a.removeEventListener("message",this.onwmsg),a.terminate(),this.worker=null;else{var i=this.transmuxer;i&&(i.destroy(),this.transmuxer=null)}var s=this.observer;s&&s.removeAllListeners(),this.observer=null},h.push=function(a,i,s,S,x,T,A,w,v,b){var g=this;v.transmuxing.start=self.performance.now();var f=this.transmuxer,C=this.worker,E=T?T.start:x.start,_=x.decryptdata,U=this.frag,j=!(U&&x.cc===U.cc),L=!(U&&v.level===U.level),G=U?v.sn-U.sn:-1,B=this.part?v.part-this.part.index:1,O=!L&&(G===1||G===0&&B===1),V=self.performance.now();(L||G||x.stats.parsing.start===0)&&(x.stats.parsing.start=V),T&&(B||!O)&&(T.stats.parsing.start=V);var te=new H.TransmuxState(j,O,w,L,E);if(!O||j){N.logger.log("[transmuxer-interface, "+x.type+"]: Starting new transmux session for sn: "+v.sn+" p: "+v.part+" level: "+v.level+" id: "+v.id+`
|
|
discontinuity: `+j+`
|
|
trackSwitch: `+L+`
|
|
contiguous: `+O+`
|
|
accurateTimeOffset: `+w+`
|
|
timeOffset: `+E);var re=new H.TransmuxConfig(s,S,i,A,b);this.configureTransmuxer(re)}if(this.frag=x,this.part=T,C)C.postMessage({cmd:"demux",data:a,decryptdata:_,chunkMeta:v,state:te},a instanceof ArrayBuffer?[a]:[]);else if(f){var ge=f.push(a,_,v,te);Object(H.isPromise)(ge)?ge.then(function(Ae){g.handleTransmuxComplete(Ae)}):this.handleTransmuxComplete(ge)}},h.flush=function(a){var i=this;a.transmuxing.start=self.performance.now();var s=this.transmuxer,S=this.worker;if(S)S.postMessage({cmd:"flush",chunkMeta:a});else if(s){var x=s.flush(a);Object(H.isPromise)(x)?x.then(function(T){i.handleFlushResult(T,a)}):this.handleFlushResult(x,a)}},h.handleFlushResult=function(a,i){var s=this;a.forEach(function(S){s.handleTransmuxComplete(S)}),this.onFlush(i)},h.onWorkerMessage=function(a){var i=a.data,s=this.hls;switch(i.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(i.data);break}case"flush":{this.onFlush(i.data);break}default:{i.data=i.data||{},i.data.frag=this.frag,i.data.id=this.id,s.trigger(i.event,i.data);break}}},h.configureTransmuxer=function(a){var i=this.worker,s=this.transmuxer;i?i.postMessage({cmd:"configure",config:a}):s&&s.configure(a)},h.handleTransmuxComplete=function(a){a.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(a)},o}()},"./src/demux/transmuxer-worker.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"default",function(){return n});var X=M("./src/demux/transmuxer.ts"),F=M("./src/events.ts"),I=M("./src/utils/logger.ts"),H=M("./node_modules/eventemitter3/index.js"),N=M.n(H);function n(u){var o=new H.EventEmitter,h=function(a,i){u.postMessage({event:a,data:i})};o.on(F.Events.FRAG_DECRYPTED,h),o.on(F.Events.ERROR,h),u.addEventListener("message",function(r){var a=r.data;switch(a.cmd){case"init":{var i=JSON.parse(a.config);u.transmuxer=new X.default(o,a.typeSupported,i,a.vendor,a.id),Object(I.enableLogs)(i.debug),h("init",null);break}case"configure":{u.transmuxer.configure(a.config);break}case"demux":{var s=u.transmuxer.push(a.data,a.decryptdata,a.chunkMeta,a.state);Object(X.isPromise)(s)?s.then(function(T){P(u,T)}):P(u,s);break}case"flush":{var S=a.chunkMeta,x=u.transmuxer.flush(S);Object(X.isPromise)(x)?x.then(function(T){m(u,T,S)}):m(u,x,S);break}default:break}})}function P(u,o){if(d(o.remuxResult))return;var h=[],r=o.remuxResult,a=r.audio,i=r.video;a&&p(h,a),i&&p(h,i),u.postMessage({event:"transmuxComplete",data:o},h)}function p(u,o){o.data1&&u.push(o.data1.buffer),o.data2&&u.push(o.data2.buffer)}function m(u,o,h){o.forEach(function(r){P(u,r)}),u.postMessage({event:"flush",data:h})}function d(u){return!u.audio&&!u.video&&!u.text&&!u.id3&&!u.initSegment}},"./src/demux/transmuxer.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"default",function(){return i}),M.d(z,"isPromise",function(){return x}),M.d(z,"TransmuxConfig",function(){return T}),M.d(z,"TransmuxState",function(){return A});var X=M("./src/events.ts"),F=M("./src/errors.ts"),I=M("./src/crypt/decrypter.ts"),H=M("./src/demux/aacdemuxer.ts"),N=M("./src/demux/mp4demuxer.ts"),n=M("./src/demux/tsdemuxer.ts"),P=M("./src/demux/mp3demuxer.ts"),p=M("./src/remux/mp4-remuxer.ts"),m=M("./src/remux/passthrough-remuxer.ts"),d=M("./src/demux/chunk-cache.ts"),u=M("./src/utils/mp4-tools.ts"),o=M("./src/utils/logger.ts"),h;try{h=self.performance.now.bind(self.performance)}catch(w){o.logger.debug("Unable to use Performance API on this environment"),h=self.Date.now}var r=[{demux:n.default,remux:p.default},{demux:N.default,remux:m.default},{demux:H.default,remux:p.default},{demux:P.default,remux:p.default}],a=1024;r.forEach(function(w){var v=w.demux;a=Math.max(a,v.minProbeByteLength)});var i=function(){function w(b,g,f,C,E){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 d.default,this.observer=b,this.typeSupported=g,this.config=f,this.vendor=C,this.id=E}var v=w.prototype;return v.configure=function(g){this.transmuxConfig=g,this.decrypter&&this.decrypter.reset()},v.push=function(g,f,C,E){var _=this,U=C.transmuxing;U.executeStart=h();var j=new Uint8Array(g),L=this.cache,G=this.config,B=this.currentTransmuxState,O=this.transmuxConfig;E&&(this.currentTransmuxState=E);var V=s(j,f);if(V&&V.method==="AES-128"){var te=this.getDecrypter();if(G.enableSoftwareAES){var re=te.softwareDecrypt(j,V.key.buffer,V.iv.buffer);if(!re)return U.executeEnd=h(),S(C);j=new Uint8Array(re)}else return this.decryptionPromise=te.webCryptoDecrypt(j,V.key.buffer,V.iv.buffer).then(function(ct){var wt=_.push(ct,null,C);return _.decryptionPromise=null,wt}),this.decryptionPromise}var ge=E||B,Ae=ge.contiguous,Oe=ge.discontinuity,Ce=ge.trackSwitch,je=ge.accurateTimeOffset,Ue=ge.timeOffset,xe=O.audioCodec,be=O.videoCodec,Ve=O.defaultInitPts,mt=O.duration,yt=O.initSegmentData;if((Oe||Ce)&&this.resetInitSegment(yt,xe,be,mt),Oe&&this.resetInitialTimestamp(Ve),Ae||this.resetContiguity(),this.needsProbing(j,Oe,Ce)){if(L.dataLength){var _t=L.flush();j=Object(u.appendUint8Array)(_t,j)}this.configureTransmuxer(j,O)}var xt=this.transmux(j,V,Ue,je,C),nt=this.currentTransmuxState;return nt.contiguous=!0,nt.discontinuity=!1,nt.trackSwitch=!1,U.executeEnd=h(),xt},v.flush=function(g){var f=this,C=g.transmuxing;C.executeStart=h();var E=this.decrypter,_=this.cache,U=this.currentTransmuxState,j=this.decryptionPromise;if(j)return j.then(function(){return f.flush(g)});var L=[],G=U.timeOffset;if(E){var B=E.flush();B&&L.push(this.push(B,null,g))}var O=_.dataLength;_.reset();var V=this.demuxer,te=this.remuxer;if(!V||!te)return O>=a&&this.observer.emit(X.Events.ERROR,X.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),C.executeEnd=h(),[S(g)];var re=V.flush(G);return x(re)?re.then(function(ge){return f.flushRemux(L,ge,g),L}):(this.flushRemux(L,re,g),L)},v.flushRemux=function(g,f,C){var E=f.audioTrack,_=f.avcTrack,U=f.id3Track,j=f.textTrack,L=this.currentTransmuxState,G=L.accurateTimeOffset,B=L.timeOffset;o.logger.log("[transmuxer.ts]: Flushed fragment "+C.sn+(C.part>-1?" p: "+C.part:"")+" of level "+C.level);var O=this.remuxer.remux(E,_,U,j,B,G,!0,this.id);g.push({remuxResult:O,chunkMeta:C}),C.transmuxing.executeEnd=h()},v.resetInitialTimestamp=function(g){var f=this.demuxer,C=this.remuxer;if(!f||!C)return;f.resetTimeStamp(g),C.resetTimeStamp(g)},v.resetContiguity=function(){var g=this.demuxer,f=this.remuxer;if(!g||!f)return;g.resetContiguity(),f.resetNextTimestamp()},v.resetInitSegment=function(g,f,C,E){var _=this.demuxer,U=this.remuxer;if(!_||!U)return;_.resetInitSegment(f,C,E),U.resetInitSegment(g,f,C)},v.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},v.transmux=function(g,f,C,E,_){var U;return f&&f.method==="SAMPLE-AES"?U=this.transmuxSampleAes(g,f,C,E,_):U=this.transmuxUnencrypted(g,C,E,_),U},v.transmuxUnencrypted=function(g,f,C,E){var _=this.demuxer.demux(g,f,!1,!this.config.progressive),U=_.audioTrack,j=_.avcTrack,L=_.id3Track,G=_.textTrack,B=this.remuxer.remux(U,j,L,G,f,C,!1,this.id);return{remuxResult:B,chunkMeta:E}},v.transmuxSampleAes=function(g,f,C,E,_){var U=this;return this.demuxer.demuxSampleAes(g,f,C).then(function(j){var L=U.remuxer.remux(j.audioTrack,j.avcTrack,j.id3Track,j.textTrack,C,E,!1,U.id);return{remuxResult:L,chunkMeta:_}})},v.configureTransmuxer=function(g,f){for(var C=this.config,E=this.observer,_=this.typeSupported,U=this.vendor,j=f.audioCodec,L=f.defaultInitPts,G=f.duration,B=f.initSegmentData,O=f.videoCodec,V,te=0,re=r.length;te<re;te++)if(r[te].demux.probe(g)){V=r[te];break}V||(o.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),V={demux:N.default,remux:m.default});var ge=this.demuxer,Ae=this.remuxer,Oe=V.remux,Ce=V.demux;(!Ae||!(Ae instanceof Oe))&&(this.remuxer=new Oe(E,C,_,U)),(!ge||!(ge instanceof Ce))&&(this.demuxer=new Ce(E,C,_),this.probe=Ce.probe),this.resetInitSegment(B,j,O,G),this.resetInitialTimestamp(L)},v.needsProbing=function(g,f,C){return!this.demuxer||!this.remuxer||f||C},v.getDecrypter=function(){var g=this.decrypter;return g||(g=this.decrypter=new I.default(this.observer,this.config)),g},w}();function s(w,v){var b=null;return w.byteLength>0&&v!=null&&v.key!=null&&v.iv!==null&&v.method!=null&&(b=v),b}var S=function(v){return{remuxResult:{},chunkMeta:v}};function x(w){return"then"in w&&w.then instanceof Function}var T=function(v,b,g,f,C){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=v,this.videoCodec=b,this.initSegmentData=g,this.duration=f,this.defaultInitPts=C},A=function(v,b,g,f,C){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=v,this.contiguous=b,this.accurateTimeOffset=g,this.trackSwitch=f,this.timeOffset=C}},"./src/demux/tsdemuxer.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"discardEPB",function(){return S});var X=M("./src/demux/adts.ts"),F=M("./src/demux/mpegaudio.ts"),I=M("./src/demux/exp-golomb.ts"),H=M("./src/demux/id3.ts"),N=M("./src/demux/sample-aes.ts"),n=M("./src/events.ts"),P=M("./src/utils/mp4-tools.ts"),p=M("./src/utils/logger.ts"),m=M("./src/errors.ts"),d={video:1,audio:2,id3:3,text:4},u=function(){function x(A,w,v){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=A,this.config=w,this.typeSupported=v}x.probe=function(w){var v=x.syncOffset(w);return v<0?!1:(v&&p.logger.warn("MPEG2-TS detected but first sync word found @ offset "+v+", junk ahead ?"),!0)},x.syncOffset=function(w){for(var v=Math.min(1e3,w.length-3*188),b=0;b<v;){if(w[b]===71&&w[b+188]===71&&w[b+2*188]===71)return b;b++}return-1},x.createTrack=function(w,v){return{container:w==="video"||w==="audio"?"video/mp2t":void 0,type:w,id:d[w],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:w==="audio"?v:void 0}};var T=x.prototype;return T.resetInitSegment=function(w,v,b){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=x.createTrack("video",b),this._audioTrack=x.createTrack("audio",b),this._id3Track=x.createTrack("id3",b),this._txtTrack=x.createTrack("text",b),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=w,this.videoCodec=v,this._duration=b},T.resetTimeStamp=function(){},T.resetContiguity=function(){var w=this._audioTrack,v=this._avcTrack,b=this._id3Track;w&&(w.pesData=null),v&&(v.pesData=null),b&&(b.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},T.demux=function(w,v,b,g){b===void 0&&(b=!1),g===void 0&&(g=!1),b||(this.sampleAes=null);var f,C=this._avcTrack,E=this._audioTrack,_=this._id3Track,U=C.pid,j=C.pesData,L=E.pid,G=_.pid,B=E.pesData,O=_.pesData,V=!1,te=this.pmtParsed,re=this._pmtId,ge=w.length;if(this.remainderData&&(w=Object(P.appendUint8Array)(this.remainderData,w),ge=w.length,this.remainderData=null),ge<188&&!g)return this.remainderData=w,{audioTrack:E,avcTrack:C,id3Track:_,textTrack:this._txtTrack};var Ae=Math.max(0,x.syncOffset(w));ge-=(ge+Ae)%188,ge<w.byteLength&&!g&&(this.remainderData=new Uint8Array(w.buffer,ge,w.buffer.byteLength-ge));for(var Oe=Ae;Oe<ge;Oe+=188)if(w[Oe]===71){var Ce=!!(w[Oe+1]&64),je=((w[Oe+1]&31)<<8)+w[Oe+2],Ue=(w[Oe+3]&48)>>4,xe=void 0;if(Ue>1){if(xe=Oe+5+w[Oe+4],xe===Oe+188)continue}else xe=Oe+4;switch(je){case U:Ce&&(j&&(f=a(j))&&this.parseAVCPES(f,!1),j={data:[],size:0}),j&&(j.data.push(w.subarray(xe,Oe+188)),j.size+=Oe+188-xe);break;case L:Ce&&(B&&(f=a(B))&&(E.isAAC?this.parseAACPES(f):this.parseMPEGPES(f)),B={data:[],size:0}),B&&(B.data.push(w.subarray(xe,Oe+188)),B.size+=Oe+188-xe);break;case G:Ce&&(O&&(f=a(O))&&this.parseID3PES(f),O={data:[],size:0}),O&&(O.data.push(w.subarray(xe,Oe+188)),O.size+=Oe+188-xe);break;case 0:Ce&&(xe+=w[xe]+1),re=this._pmtId=h(w,xe);break;case re:{Ce&&(xe+=w[xe]+1);var be=r(w,xe,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,b);U=be.avc,U>0&&(C.pid=U),L=be.audio,L>0&&(E.pid=L,E.isAAC=be.isAAC),G=be.id3,G>0&&(_.pid=G),V&&!te&&(p.logger.log("reparse from beginning"),V=!1,Oe=Ae-188),te=this.pmtParsed=!0;break}case 17:case 8191:break;default:V=!0;break}}else this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});C.pesData=j,E.pesData=B,_.pesData=O;var Ve={audioTrack:E,avcTrack:C,id3Track:_,textTrack:this._txtTrack};return g&&this.extractRemainingSamples(Ve),Ve},T.flush=function(){var w=this.remainderData;this.remainderData=null;var v;return w?v=this.demux(w,-1,!1,!0):v={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(v),this.sampleAes?this.decrypt(v,this.sampleAes):v},T.extractRemainingSamples=function(w){var v=w.audioTrack,b=w.avcTrack,g=w.id3Track,f=b.pesData,C=v.pesData,E=g.pesData,_;f&&(_=a(f))?(this.parseAVCPES(_,!0),b.pesData=null):b.pesData=f,C&&(_=a(C))?(v.isAAC?this.parseAACPES(_):this.parseMPEGPES(_),v.pesData=null):(C!=null&&C.size&&p.logger.log("last AAC PES packet truncated,might overlap between fragments"),v.pesData=C),E&&(_=a(E))?(this.parseID3PES(_),g.pesData=null):g.pesData=E},T.demuxSampleAes=function(w,v,b){var g=this.demux(w,b,!0,!this.config.progressive),f=this.sampleAes=new N.default(this.observer,this.config,v);return this.decrypt(g,f)},T.decrypt=function(w,v){return new Promise(function(b){var g=w.audioTrack,f=w.avcTrack;g.samples&&g.isAAC?v.decryptAacSamples(g.samples,0,function(){f.samples?v.decryptAvcSamples(f.samples,0,0,function(){b(w)}):b(w)}):f.samples&&v.decryptAvcSamples(f.samples,0,0,function(){b(w)})})},T.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},T.parseAVCPES=function(w,v){var b=this,g=this._avcTrack,f=this.parseAVCNALu(w.data),C=!1,E=this.avcSample,_,U=!1;w.data=null,E&&f.length&&!g.audFound&&(i(E,g),E=this.avcSample=o(!1,w.pts,w.dts,"")),f.forEach(function(j){switch(j.type){case 1:{_=!0,E||(E=b.avcSample=o(!0,w.pts,w.dts,"")),C&&(E.debug+="NDR "),E.frame=!0;var L=j.data;if(U&&L.length>4){var G=new I.default(L).readSliceType();(G===2||G===4||G===7||G===9)&&(E.key=!0)}break}case 5:_=!0,E||(E=b.avcSample=o(!0,w.pts,w.dts,"")),C&&(E.debug+="IDR "),E.key=!0,E.frame=!0;break;case 6:{_=!0,C&&E&&(E.debug+="SEI ");var B=new I.default(S(j.data));B.readUByte();for(var O=0,V=0,te=!1,re=0;!te&&B.bytesAvailable>1;){O=0;do re=B.readUByte(),O+=re;while(re===255);V=0;do re=B.readUByte(),V+=re;while(re===255);if(O===4&&B.bytesAvailable!==0){te=!0;var ge=B.readUByte();if(ge===181){var Ae=B.readUShort();if(Ae===49){var Oe=B.readUInt();if(Oe===1195456820){var Ce=B.readUByte();if(Ce===3){for(var je=B.readUByte(),Ue=B.readUByte(),xe=31&je,be=[je,Ue],Ve=0;Ve<xe;Ve++)be.push(B.readUByte()),be.push(B.readUByte()),be.push(B.readUByte());s(b._txtTrack.samples,{type:3,pts:w.pts,bytes:be})}}}}}else if(O===5&&B.bytesAvailable!==0){if(te=!0,V>16){for(var mt=[],yt=0;yt<16;yt++)mt.push(B.readUByte().toString(16)),(yt===3||yt===5||yt===7||yt===9)&&mt.push("-");for(var _t=V-16,xt=new Uint8Array(_t),nt=0;nt<_t;nt++)xt[nt]=B.readUByte();s(b._txtTrack.samples,{pts:w.pts,payloadType:O,uuid:mt.join(""),userData:Object(H.utf8ArrayToStr)(xt),userDataBytes:xt})}}else if(V<B.bytesAvailable)for(var ct=0;ct<V;ct++)B.readUByte()}break}case 7:if(_=!0,U=!0,C&&E&&(E.debug+="SPS "),!g.sps){var wt=new I.default(j.data),_e=wt.readSPS();g.width=_e.width,g.height=_e.height,g.pixelRatio=_e.pixelRatio,g.sps=[j.data],g.duration=b._duration;for(var Me=j.data.subarray(1,4),ve="avc1.",Te=0;Te<3;Te++){var We=Me[Te].toString(16);We.length<2&&(We="0"+We),ve+=We}g.codec=ve}break;case 8:_=!0,C&&E&&(E.debug+="PPS "),g.pps||(g.pps=[j.data]);break;case 9:_=!1,g.audFound=!0,E&&i(E,g),E=b.avcSample=o(!1,w.pts,w.dts,C?"AUD ":"");break;case 12:_=!1;break;default:_=!1,E&&(E.debug+="unknown NAL "+j.type+" ");break}if(E&&_){var Je=E.units;Je.push(j)}}),v&&E&&(i(E,g),this.avcSample=null)},T.getLastNalUnit=function(){var w,v=this.avcSample,b;if(!v||v.units.length===0){var g=this._avcTrack.samples;v=g[g.length-1]}if((w=v)!==null&&w!==void 0&&w.units){var f=v.units;b=f[f.length-1]}return b},T.parseAVCNALu=function(w){var v=w.byteLength,b=this._avcTrack,g=b.naluState||0,f=g,C=[],E=0,_,U,j,L=-1,G=0;for(g===-1&&(L=0,G=w[0]&31,g=0,E=1);E<v;){if(_=w[E++],!g){g=_?0:1;continue}if(g===1){g=_?0:2;continue}if(!_)g=3;else if(_===1){if(L>=0){var B={data:w.subarray(L,E-g-1),type:G};C.push(B)}else{var O=this.getLastNalUnit();if(O&&(f&&E<=4-f&&(O.state&&(O.data=O.data.subarray(0,O.data.byteLength-f))),U=E-g-1,U>0)){var V=new Uint8Array(O.data.byteLength+U);V.set(O.data,0),V.set(w.subarray(0,U),O.data.byteLength),O.data=V,O.state=0}}E<v?(j=w[E]&31,L=E,G=j,g=0):g=-1}else g=0}if(L>=0&&g>=0){var te={data:w.subarray(L,v),type:G,state:g};C.push(te)}if(C.length===0){var re=this.getLastNalUnit();if(re){var ge=new Uint8Array(re.data.byteLength+w.byteLength);ge.set(re.data,0),ge.set(w,re.data.byteLength),re.data=ge}}return b.naluState=g,C},T.parseAACPES=function(w){var v=0,b=this._audioTrack,g=this.aacOverFlow,f=w.data;if(g){this.aacOverFlow=null;var C=g.sample.unit.byteLength,E=Math.min(g.missing,C),_=C-E;g.sample.unit.set(f.subarray(0,E),_),b.samples.push(g.sample),v=g.missing}var U,j;for(U=v,j=f.length;U<j-1&&!X.isHeader(f,U);U++);if(U!==v){var L,G;if(U<j-1?(L="AAC PES did not start with ADTS header,offset:"+U,G=!1):(L="no ADTS header found in AAC PES",G=!0),p.logger.warn("parsing error:"+L),this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:G,reason:L}),G)return}X.initTrackConfig(b,this.observer,f,U,this.audioCodec);var B;if(w.pts!==void 0)B=w.pts;else if(g){var O=X.getFrameDuration(b.samplerate);B=g.sample.pts+O}else{p.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var V=0;U<j;)if(X.isHeader(f,U)){if(U+5<j){var te=X.appendFrame(b,f,U,B,V);if(te)if(te.missing)this.aacOverFlow=te;else{U+=te.length,V++;continue}}break}else U++},T.parseMPEGPES=function(w){var v=w.data,b=v.length,g=0,f=0,C=w.pts;if(C===void 0){p.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;f<b;)if(F.isHeader(v,f)){var E=F.appendFrame(this._audioTrack,v,f,C,g);if(E)f+=E.length,g++;else break}else f++},T.parseID3PES=function(w){if(w.pts===void 0){p.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(w)},x}();u.minProbeByteLength=188;function o(x,T,A,w){return{key:x,frame:!1,pts:T,dts:A,units:[],debug:w,length:0}}function h(x,T){return(x[T+10]&31)<<8|x[T+11]}function r(x,T,A,w){var v={audio:-1,avc:-1,id3:-1,isAAC:!0},b=(x[T+1]&15)<<8|x[T+2],g=T+3+b-4,f=(x[T+10]&15)<<8|x[T+11];for(T+=12+f;T<g;){var C=(x[T+1]&31)<<8|x[T+2];switch(x[T]){case 207:if(!w){p.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:v.audio===-1&&(v.audio=C);break;case 21:v.id3===-1&&(v.id3=C);break;case 219:if(!w){p.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:v.avc===-1&&(v.avc=C);break;case 3:case 4:A?v.audio===-1&&(v.audio=C,v.isAAC=!1):p.logger.log("MPEG audio found, not supported in this browser");break;case 36:p.logger.warn("Unsupported HEVC stream type found");break;default:break}T+=((x[T+3]&15)<<8|x[T+4])+5}return v}function a(x){var T=0,A,w,v,b,g,f=x.data;if(!x||x.size===0)return null;for(;f[0].length<19&&f.length>1;){var C=new Uint8Array(f[0].length+f[1].length);C.set(f[0]),C.set(f[1],f[0].length),f[0]=C,f.splice(1,1)}A=f[0];var E=(A[0]<<16)+(A[1]<<8)+A[2];if(E===1){if(w=(A[4]<<8)+A[5],w&&w>x.size-6)return null;var _=A[7];_&192&&(b=(A[9]&14)*536870912+(A[10]&255)*4194304+(A[11]&254)*16384+(A[12]&255)*128+(A[13]&254)/2,_&64?(g=(A[14]&14)*536870912+(A[15]&255)*4194304+(A[16]&254)*16384+(A[17]&255)*128+(A[18]&254)/2,b-g>60*9e4&&(p.logger.warn(Math.round((b-g)/9e4)+"s delta between PTS and DTS, align them"),b=g)):g=b),v=A[8];var U=v+9;if(x.size<=U)return null;x.size-=U;for(var j=new Uint8Array(x.size),L=0,G=f.length;L<G;L++){A=f[L];var B=A.byteLength;if(U)if(U>B){U-=B;continue}else A=A.subarray(U),B-=U,U=0;j.set(A,T),T+=B}return w&&(w-=v+3),{data:j,pts:b,dts:g,len:w}}return null}function i(x,T){if(x.units.length&&x.frame){if(x.pts===void 0){var A=T.samples,w=A.length;if(w){var v=A[w-1];x.pts=v.pts,x.dts=v.dts}else{T.dropped++;return}}T.samples.push(x)}x.debug.length&&p.logger.log(x.pts+"/"+x.dts+":"+x.debug)}function s(x,T){var A=x.length;if(A>0){if(T.pts>=x[A-1].pts)x.push(T);else for(var w=A-1;w>=0;w--)if(T.pts<x[w].pts){x.splice(w,0,T);break}}else x.push(T)}function S(x){for(var T=x.byteLength,A=[],w=1;w<T-2;)x[w]===0&&x[w+1]===0&&x[w+2]===3?(A.push(w+2),w+=2):w++;if(A.length===0)return x;var v=T-A.length,b=new Uint8Array(v),g=0;for(w=0;w<v;g++,w++)g===A[0]&&(g++,A.shift()),b[w]=x[g];return b}z.default=u},"./src/errors.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"ErrorTypes",function(){return X}),M.d(z,"ErrorDetails",function(){return F});var X;(function(I){I.NETWORK_ERROR="networkError",I.MEDIA_ERROR="mediaError",I.KEY_SYSTEM_ERROR="keySystemError",I.MUX_ERROR="muxError",I.OTHER_ERROR="otherError"})(X||(X={}));var F;(function(I){I.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",I.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",I.KEY_SYSTEM_NO_SESSION="keySystemNoSession",I.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",I.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",I.MANIFEST_LOAD_ERROR="manifestLoadError",I.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",I.MANIFEST_PARSING_ERROR="manifestParsingError",I.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",I.LEVEL_EMPTY_ERROR="levelEmptyError",I.LEVEL_LOAD_ERROR="levelLoadError",I.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",I.LEVEL_SWITCH_ERROR="levelSwitchError",I.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",I.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",I.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",I.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",I.FRAG_LOAD_ERROR="fragLoadError",I.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",I.FRAG_DECRYPT_ERROR="fragDecryptError",I.FRAG_PARSING_ERROR="fragParsingError",I.REMUX_ALLOC_ERROR="remuxAllocError",I.KEY_LOAD_ERROR="keyLoadError",I.KEY_LOAD_TIMEOUT="keyLoadTimeOut",I.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",I.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",I.BUFFER_APPEND_ERROR="bufferAppendError",I.BUFFER_APPENDING_ERROR="bufferAppendingError",I.BUFFER_STALLED_ERROR="bufferStalledError",I.BUFFER_FULL_ERROR="bufferFullError",I.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",I.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",I.INTERNAL_EXCEPTION="internalException",I.INTERNAL_ABORTED="aborted",I.UNKNOWN="unknown"})(F||(F={}))},"./src/events.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"Events",function(){return X});var X;(function(F){F.MEDIA_ATTACHING="hlsMediaAttaching",F.MEDIA_ATTACHED="hlsMediaAttached",F.MEDIA_DETACHING="hlsMediaDetaching",F.MEDIA_DETACHED="hlsMediaDetached",F.BUFFER_RESET="hlsBufferReset",F.BUFFER_CODECS="hlsBufferCodecs",F.BUFFER_CREATED="hlsBufferCreated",F.BUFFER_APPENDING="hlsBufferAppending",F.BUFFER_APPENDED="hlsBufferAppended",F.BUFFER_EOS="hlsBufferEos",F.BUFFER_FLUSHING="hlsBufferFlushing",F.BUFFER_FLUSHED="hlsBufferFlushed",F.MANIFEST_LOADING="hlsManifestLoading",F.MANIFEST_LOADED="hlsManifestLoaded",F.MANIFEST_PARSED="hlsManifestParsed",F.LEVEL_SWITCHING="hlsLevelSwitching",F.LEVEL_SWITCHED="hlsLevelSwitched",F.LEVEL_LOADING="hlsLevelLoading",F.LEVEL_LOADED="hlsLevelLoaded",F.LEVEL_UPDATED="hlsLevelUpdated",F.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",F.LEVELS_UPDATED="hlsLevelsUpdated",F.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",F.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",F.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",F.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",F.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",F.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",F.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",F.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",F.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",F.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",F.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",F.CUES_PARSED="hlsCuesParsed",F.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",F.INIT_PTS_FOUND="hlsInitPtsFound",F.FRAG_LOADING="hlsFragLoading",F.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",F.FRAG_LOADED="hlsFragLoaded",F.FRAG_DECRYPTED="hlsFragDecrypted",F.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",F.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",F.FRAG_PARSING_METADATA="hlsFragParsingMetadata",F.FRAG_PARSED="hlsFragParsed",F.FRAG_BUFFERED="hlsFragBuffered",F.FRAG_CHANGED="hlsFragChanged",F.FPS_DROP="hlsFpsDrop",F.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",F.ERROR="hlsError",F.DESTROYING="hlsDestroying",F.KEY_LOADING="hlsKeyLoading",F.KEY_LOADED="hlsKeyLoaded",F.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",F.BACK_BUFFER_REACHED="hlsBackBufferReached"})(X||(X={}))},"./src/hls.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"default",function(){return x});var X=M("./node_modules/url-toolkit/src/url-toolkit.js"),F=M.n(X),I=M("./src/loader/playlist-loader.ts"),H=M("./src/loader/key-loader.ts"),N=M("./src/controller/id3-track-controller.ts"),n=M("./src/controller/latency-controller.ts"),P=M("./src/controller/level-controller.ts"),p=M("./src/controller/fragment-tracker.ts"),m=M("./src/controller/stream-controller.ts"),d=M("./src/is-supported.ts"),u=M("./src/utils/logger.ts"),o=M("./src/config.ts"),h=M("./node_modules/eventemitter3/index.js"),r=M.n(h),a=M("./src/events.ts"),i=M("./src/errors.ts");function s(T,A){for(var w=0;w<A.length;w++){var v=A[w];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(T,v.key,v)}}function S(T,A,w){return A&&s(T.prototype,A),w&&s(T,w),T}var x=function(){T.isSupported=function(){return Object(d.isSupported)()};function T(w){w===void 0&&(w={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new h.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 v=this.config=Object(o.mergeConfig)(T.DefaultConfig,w);this.userConfig=w,Object(u.enableLogs)(v.debug),this._autoLevelCapping=-1,v.progressive&&Object(o.enableStreamingMode)(v);var b=v.abrController,g=v.bufferController,f=v.capLevelController,C=v.fpsController,E=this.abrController=new b(this),_=this.bufferController=new g(this),U=this.capLevelController=new f(this),j=new C(this),L=new I.default(this),G=new H.default(this),B=new N.default(this),O=this.levelController=new P.default(this),V=new p.FragmentTracker(this),te=this.streamController=new m.default(this,V);U.setStreamController(te),j.setStreamController(te);var re=[O,te];this.networkControllers=re;var ge=[L,G,E,_,U,j,B,V];this.audioTrackController=this.createController(v.audioTrackController,null,re),this.createController(v.audioStreamController,V,re),this.subtitleTrackController=this.createController(v.subtitleTrackController,null,re),this.createController(v.subtitleStreamController,V,re),this.createController(v.timelineController,null,ge),this.emeController=this.createController(v.emeController,null,ge),this.cmcdController=this.createController(v.cmcdController,null,ge),this.latencyController=this.createController(n.default,null,ge),this.coreComponents=ge}var A=T.prototype;return A.createController=function(v,b,g){if(v){var f=b?new v(this,b):new v(this);return g&&g.push(f),f}return null},A.on=function(v,b,g){g===void 0&&(g=this),this._emitter.on(v,b,g)},A.once=function(v,b,g){g===void 0&&(g=this),this._emitter.once(v,b,g)},A.removeAllListeners=function(v){this._emitter.removeAllListeners(v)},A.off=function(v,b,g,f){g===void 0&&(g=this),this._emitter.off(v,b,g,f)},A.listeners=function(v){return this._emitter.listeners(v)},A.emit=function(v,b,g){return this._emitter.emit(v,b,g)},A.trigger=function(v,b){if(this.config.debug)return this.emit(v,v,b);try{return this.emit(v,v,b)}catch(g){u.logger.error("An internal error happened while handling event "+v+'. Error message: "'+g.message+'". Here is a stacktrace:',g),this.trigger(a.Events.ERROR,{type:i.ErrorTypes.OTHER_ERROR,details:i.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:v,error:g})}return!1},A.listenerCount=function(v){return this._emitter.listenerCount(v)},A.destroy=function(){u.logger.log("destroy"),this.trigger(a.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(v){return v.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(v){return v.destroy()}),this.coreComponents.length=0},A.attachMedia=function(v){u.logger.log("attachMedia"),this._media=v,this.trigger(a.Events.MEDIA_ATTACHING,{media:v})},A.detachMedia=function(){u.logger.log("detachMedia"),this.trigger(a.Events.MEDIA_DETACHING,void 0),this._media=null},A.loadSource=function(v){this.stopLoad();var b=this.media,g=this.url,f=this.url=X.buildAbsoluteURL(self.location.href,v,{alwaysNormalize:!0});u.logger.log("loadSource:"+f),b&&g&&g!==f&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(b)),this.trigger(a.Events.MANIFEST_LOADING,{url:v})},A.startLoad=function(v){v===void 0&&(v=-1),u.logger.log("startLoad("+v+")"),this.networkControllers.forEach(function(b){b.startLoad(v)})},A.stopLoad=function(){u.logger.log("stopLoad"),this.networkControllers.forEach(function(v){v.stopLoad()})},A.swapAudioCodec=function(){u.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},A.recoverMediaError=function(){u.logger.log("recoverMediaError");var v=this._media;this.detachMedia(),v&&this.attachMedia(v)},A.removeLevel=function(v,b){b===void 0&&(b=0),this.levelController.removeLevel(v,b)},S(T,[{key:"levels",get:function(){var v=this.levelController.levels;return v||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(v){u.logger.log("set currentLevel:"+v),this.loadLevel=v,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(v){u.logger.log("set nextLevel:"+v),this.levelController.manualLevel=v,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(v){u.logger.log("set loadLevel:"+v),this.levelController.manualLevel=v}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(v){this.levelController.nextLoadLevel=v}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(v){u.logger.log("set firstLevel:"+v),this.levelController.firstLevel=v}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(v){u.logger.log("set startLevel:"+v),v!==-1&&(v=Math.max(v,this.minAutoLevel)),this.levelController.startLevel=v}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(v){var b=!!v;b!==this.config.capLevelToPlayerSize&&(b?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=b)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(v){this._autoLevelCapping!==v&&(u.logger.log("set autoLevelCapping:"+v),this._autoLevelCapping=v)}},{key:"bandwidthEstimate",get:function(){var v=this.abrController.bwEstimator;return v?v.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var v=this.levels,b=this.config.minAutoBitrate;if(!v)return 0;for(var g=v.length,f=0;f<g;f++)if(v[f].maxBitrate>b)return f;return 0}},{key:"maxAutoLevel",get:function(){var v=this.levels,b=this.autoLevelCapping,g;return b===-1&&v&&v.length?g=v.length-1:g=b,g}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(v){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,v)}},{key:"audioTracks",get:function(){var v=this.audioTrackController;return v?v.audioTracks:[]}},{key:"audioTrack",get:function(){var v=this.audioTrackController;return v?v.audioTrack:-1},set:function(v){var b=this.audioTrackController;b&&(b.audioTrack=v)}},{key:"subtitleTracks",get:function(){var v=this.subtitleTrackController;return v?v.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var v=this.subtitleTrackController;return v?v.subtitleTrack:-1},set:function(v){var b=this.subtitleTrackController;b&&(b.subtitleTrack=v)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var v=this.subtitleTrackController;return v?v.subtitleDisplay:!1},set:function(v){var b=this.subtitleTrackController;b&&(b.subtitleDisplay=v)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(v){this.config.lowLatencyMode=v}},{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 a.Events}},{key:"ErrorTypes",get:function(){return i.ErrorTypes}},{key:"ErrorDetails",get:function(){return i.ErrorDetails}},{key:"DefaultConfig",get:function(){return T.defaultConfig?T.defaultConfig:o.hlsDefaultConfig},set:function(v){T.defaultConfig=v}}]),T}();x.defaultConfig=void 0},"./src/is-supported.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"isSupported",function(){return I}),M.d(z,"changeTypeSupported",function(){return H});var X=M("./src/utils/mediasource-helper.ts");function F(){return self.SourceBuffer||self.WebKitSourceBuffer}function I(){var N=Object(X.getMediaSource)();if(!N)return!1;var n=F(),P=N&&typeof N.isTypeSupported=="function"&&N.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),p=!n||n.prototype&&typeof n.prototype.appendBuffer=="function"&&typeof n.prototype.remove=="function";return!!P&&!!p}function H(){var N,n=F();return typeof(n==null||((N=n.prototype)===null||N===void 0)?void 0:N.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"default",function(){return u}),M.d(z,"LoadError",function(){return h});var X=M("./src/polyfills/number.ts"),F=M("./src/errors.ts");function I(r,a){r.prototype=Object.create(a.prototype),r.prototype.constructor=r,p(r,a)}function H(r){var a=typeof Map=="function"?new Map:void 0;return H=function(s){if(s===null||!P(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof a!="undefined"){if(a.has(s))return a.get(s);a.set(s,S)}function S(){return N(s,arguments,m(this).constructor)}return S.prototype=Object.create(s.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),p(S,s)},H(r)}function N(r,a,i){return n()?N=Reflect.construct:N=function(S,x,T){var A=[null];A.push.apply(A,x);var w=Function.bind.apply(S,A),v=new w;return T&&p(v,T.prototype),v},N.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(r){return!1}}function P(r){return Function.toString.call(r).indexOf("[native code]")!==-1}function p(r,a){return p=Object.setPrototypeOf||function(s,S){return s.__proto__=S,s},p(r,a)}function m(r){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},m(r)}var d=Math.pow(2,17),u=function(){function r(i){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=i}var a=r.prototype;return a.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},a.abort=function(){this.loader&&this.loader.abort()},a.load=function(s,S){var x=this,T=s.url;if(!T)return Promise.reject(new h({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,networkDetails:null},"Fragment does not have a "+(T?"part list":"url")));this.abort();var A=this.config,w=A.fLoader,v=A.loader;return new Promise(function(b,g){x.loader&&x.loader.destroy();var f=x.loader=s.loader=w?new w(A):new v(A),C=o(s),E={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:d};s.stats=f.stats,f.load(C,E,{onSuccess:function(U,j,L,G){x.resetLoader(s,f),b({frag:s,part:null,payload:U.data,networkDetails:G})},onError:function(U,j,L){x.resetLoader(s,f),g(new h({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,response:U,networkDetails:L}))},onAbort:function(U,j,L){x.resetLoader(s,f),g(new h({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,networkDetails:L}))},onTimeout:function(U,j,L){x.resetLoader(s,f),g(new h({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,networkDetails:L}))},onProgress:function(U,j,L,G){S&&S({frag:s,part:null,payload:L,networkDetails:G})}})})},a.loadPart=function(s,S,x){var T=this;this.abort();var A=this.config,w=A.fLoader,v=A.loader;return new Promise(function(b,g){T.loader&&T.loader.destroy();var f=T.loader=s.loader=w?new w(A):new v(A),C=o(s,S),E={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:d};S.stats=f.stats,f.load(C,E,{onSuccess:function(U,j,L,G){T.resetLoader(s,f),T.updateStatsFromPart(s,S);var B={frag:s,part:S,payload:U.data,networkDetails:G};x(B),b(B)},onError:function(U,j,L){T.resetLoader(s,f),g(new h({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,part:S,response:U,networkDetails:L}))},onAbort:function(U,j,L){s.stats.aborted=S.stats.aborted,T.resetLoader(s,f),g(new h({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,part:S,networkDetails:L}))},onTimeout:function(U,j,L){T.resetLoader(s,f),g(new h({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,part:S,networkDetails:L}))}})})},a.updateStatsFromPart=function(s,S){var x=s.stats,T=S.stats,A=T.total;if(x.loaded+=T.loaded,A){var w=Math.round(s.duration/S.duration),v=Math.min(Math.round(x.loaded/A),w),b=w-v,g=b*Math.round(x.loaded/v);x.total=x.loaded+g}else x.total=Math.max(x.loaded,x.total);var f=x.loading,C=T.loading;f.start?f.first+=C.first-C.start:(f.start=C.start,f.first=C.first),f.end=C.end},a.resetLoader=function(s,S){s.loader=null,this.loader===S&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),S.destroy()},r}();function o(r,a){a===void 0&&(a=null);var i=a||r,s={frag:r,part:a,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},S=i.byteRangeStartOffset,x=i.byteRangeEndOffset;return Object(X.isFiniteNumber)(S)&&Object(X.isFiniteNumber)(x)&&(s.rangeStart=S,s.rangeEnd=x),s}var h=function(r){I(a,r);function a(i){for(var s,S=arguments.length,x=new Array(S>1?S-1:0),T=1;T<S;T++)x[T-1]=arguments[T];return s=r.call.apply(r,[this].concat(x))||this,s.data=void 0,s.data=i,s}return a}(H(Error))},"./src/loader/fragment.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"ElementaryStreamTypes",function(){return u}),M.d(z,"BaseSegment",function(){return o}),M.d(z,"Fragment",function(){return h}),M.d(z,"Part",function(){return r});var X=M("./src/polyfills/number.ts"),F=M("./node_modules/url-toolkit/src/url-toolkit.js"),I=M.n(F),H=M("./src/utils/logger.ts"),N=M("./src/loader/level-key.ts"),n=M("./src/loader/load-stats.ts");function P(a,i){a.prototype=Object.create(i.prototype),a.prototype.constructor=a,p(a,i)}function p(a,i){return p=Object.setPrototypeOf||function(S,x){return S.__proto__=x,S},p(a,i)}function m(a,i){for(var s=0;s<i.length;s++){var S=i[s];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(a,S.key,S)}}function d(a,i,s){return i&&m(a.prototype,i),s&&m(a,s),a}var u;(function(a){a.AUDIO="audio",a.VIDEO="video",a.AUDIOVIDEO="audiovideo"})(u||(u={}));var o=function(){function a(s){var S;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(S={},S[u.AUDIO]=null,S[u.VIDEO]=null,S[u.AUDIOVIDEO]=null,S),this.baseurl=s}var i=a.prototype;return i.setByteRange=function(S,x){var T=S.split("@",2),A=[];T.length===1?A[0]=x?x.byteRangeEndOffset:0:A[0]=parseInt(T[1]),A[1]=parseInt(T[0])+A[0],this._byteRange=A},d(a,[{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(F.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(S){this._url=S}}]),a}(),h=function(a){P(i,a);function i(S,x){var T;return T=a.call(this,x)||this,T._decryptdata=null,T.rawProgramDateTime=null,T.programDateTime=null,T.tagList=[],T.duration=0,T.sn=0,T.levelkey=void 0,T.type=void 0,T.loader=null,T.level=-1,T.cc=0,T.startPTS=void 0,T.endPTS=void 0,T.appendedPTS=void 0,T.startDTS=void 0,T.endDTS=void 0,T.start=0,T.deltaPTS=void 0,T.maxStartPTS=void 0,T.minEndPTS=void 0,T.stats=new n.LoadStats,T.urlId=0,T.data=void 0,T.bitrateTest=!1,T.title=null,T.initSegment=null,T.type=S,T}var s=i.prototype;return s.createInitializationVector=function(x){for(var T=new Uint8Array(16),A=12;A<16;A++)T[A]=x>>8*(15-A)&255;return T},s.setDecryptDataFromLevelKey=function(x,T){var A=x;return(x==null?void 0:x.method)==="AES-128"&&x.uri&&!x.iv&&(A=N.LevelKey.fromURI(x.uri),A.method=x.method,A.iv=this.createInitializationVector(T),A.keyFormat="identity"),A},s.setElementaryStreamInfo=function(x,T,A,w,v,b){b===void 0&&(b=!1);var g=this.elementaryStreams,f=g[x];if(!f){g[x]={startPTS:T,endPTS:A,startDTS:w,endDTS:v,partial:b};return}f.startPTS=Math.min(f.startPTS,T),f.endPTS=Math.max(f.endPTS,A),f.startDTS=Math.min(f.startDTS,w),f.endDTS=Math.max(f.endDTS,v)},s.clearElementaryStreamInfo=function(){var x=this.elementaryStreams;x[u.AUDIO]=null,x[u.VIDEO]=null,x[u.AUDIOVIDEO]=null},d(i,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var x=this.sn;typeof x!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&H.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),x=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,x)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(X.isFiniteNumber)(this.programDateTime))return null;var x=Object(X.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+x*1e3}},{key:"encrypted",get:function(){var x;return!!((x=this.decryptdata)!==null&&x!==void 0&&x.keyFormat&&this.decryptdata.uri)}}]),i}(o),r=function(a){P(i,a);function i(s,S,x,T,A){var w;w=a.call(this,x)||this,w.fragOffset=0,w.duration=0,w.gap=!1,w.independent=!1,w.relurl=void 0,w.fragment=void 0,w.index=void 0,w.stats=new n.LoadStats,w.duration=s.decimalFloatingPoint("DURATION"),w.gap=s.bool("GAP"),w.independent=s.bool("INDEPENDENT"),w.relurl=s.enumeratedString("URI"),w.fragment=S,w.index=T;var v=s.enumeratedString("BYTERANGE");return v&&w.setByteRange(v,A),A&&(w.fragOffset=A.fragOffset+A.duration),w}return d(i,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var S=this.elementaryStreams;return!!(S.audio||S.video||S.audiovideo)}}]),i}(o)},"./src/loader/key-loader.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"default",function(){return H});var X=M("./src/events.ts"),F=M("./src/errors.ts"),I=M("./src/utils/logger.ts"),H=function(){function N(P){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=P,this._registerListeners()}var n=N.prototype;return n._registerListeners=function(){this.hls.on(X.Events.KEY_LOADING,this.onKeyLoading,this)},n._unregisterListeners=function(){this.hls.off(X.Events.KEY_LOADING,this.onKeyLoading)},n.destroy=function(){this._unregisterListeners();for(var p in this.loaders){var m=this.loaders[p];m&&m.destroy()}this.loaders={}},n.onKeyLoading=function(p,m){var d=m.frag,u=d.type,o=this.loaders[u];if(!d.decryptdata){I.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var h=d.decryptdata.uri;if(h!==this.decrypturl||this.decryptkey===null){var r=this.hls.config;if(o&&(I.logger.warn("abort previous key loader for type:"+u),o.abort()),!h){I.logger.warn("key uri is falsy");return}var a=r.loader,i=d.loader=this.loaders[u]=new a(r);this.decrypturl=h,this.decryptkey=null;var s={url:h,frag:d,responseType:"arraybuffer"},S={timeout:r.fragLoadingTimeOut,maxRetry:0,retryDelay:r.fragLoadingRetryDelay,maxRetryDelay:r.fragLoadingMaxRetryTimeout,highWaterMark:0},x={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};i.load(s,S,x)}else this.decryptkey&&(d.decryptdata.key=this.decryptkey,this.hls.trigger(X.Events.KEY_LOADED,{frag:d}))},n.loadsuccess=function(p,m,d){var u=d.frag;if(!u.decryptdata){I.logger.error("after key load, decryptdata unset");return}this.decryptkey=u.decryptdata.key=new Uint8Array(p.data),u.loader=null,delete this.loaders[u.type],this.hls.trigger(X.Events.KEY_LOADED,{frag:u})},n.loaderror=function(p,m){var d=m.frag,u=d.loader;u&&u.abort(),delete this.loaders[d.type],this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:d,response:p})},n.loadtimeout=function(p,m){var d=m.frag,u=d.loader;u&&u.abort(),delete this.loaders[d.type],this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:d})},N}()},"./src/loader/level-details.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"LevelDetails",function(){return N});var X=M("./src/polyfills/number.ts");function F(n,P){for(var p=0;p<P.length;p++){var m=P[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(n,m.key,m)}}function I(n,P,p){return P&&F(n.prototype,P),p&&F(n,p),n}var H=10,N=function(){function n(p){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=p}var P=n.prototype;return P.reloaded=function(m){if(!m){this.advanced=!0,this.updated=!0;return}var d=this.lastPartSn-m.lastPartSn,u=this.lastPartIndex-m.lastPartIndex;this.updated=this.endSN!==m.endSN||!!u||!!d,this.advanced=this.endSN>m.endSN||d>0||d===0&&u>0,this.updated||this.advanced?this.misses=Math.floor(m.misses*.6):this.misses=m.misses+1,this.availabilityDelay=m.availabilityDelay},I(n,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(X.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||H}},{key:"drift",get:function(){var m=this.driftEndTime-this.driftStartTime;if(m>0){var d=this.driftEnd-this.driftStart;return d*1e3/m}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var m;return(m=this.fragments)!==null&&m!==void 0&&m.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),n}()},"./src/loader/level-key.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"LevelKey",function(){return N});var X=M("./node_modules/url-toolkit/src/url-toolkit.js"),F=M.n(X);function I(n,P){for(var p=0;p<P.length;p++){var m=P[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(n,m.key,m)}}function H(n,P,p){return P&&I(n.prototype,P),p&&I(n,p),n}var N=function(){n.fromURL=function(p,m){return new n(p,m)},n.fromURI=function(p){return new n(p)};function n(P,p){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,p?this._uri=Object(X.buildAbsoluteURL)(P,p,{alwaysNormalize:!0}):this._uri=P}return H(n,[{key:"uri",get:function(){return this._uri}}]),n}()},"./src/loader/load-stats.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"LoadStats",function(){return X});var X=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"default",function(){return i});var X=M("./src/polyfills/number.ts"),F=M("./node_modules/url-toolkit/src/url-toolkit.js"),I=M.n(F),H=M("./src/loader/fragment.ts"),N=M("./src/loader/level-details.ts"),n=M("./src/loader/level-key.ts"),P=M("./src/utils/attr-list.ts"),p=M("./src/utils/logger.ts"),m=M("./src/utils/codecs.ts"),d=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,u=/#EXT-X-MEDIA:(.*)/g,o=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),h=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("|")),r=/\.(mp4|m4s|m4v|m4a)$/i;function a(A){var w,v;return r.test((w=(v=F.parseURL(A))===null||v===void 0?void 0:v.path)!=null?w:"")}var i=function(){function A(){}return A.findGroup=function(v,b){for(var g=0;g<v.length;g++){var f=v[g];if(f.id===b)return f}},A.convertAVC1ToAVCOTI=function(v){var b=v.split(".");if(b.length>2){var g=b.shift()+".";return g+=parseInt(b.shift()).toString(16),g+=("000"+parseInt(b.shift()).toString(16)).substr(-4),g}return v},A.resolve=function(v,b){return F.buildAbsoluteURL(b,v,{alwaysNormalize:!0})},A.parseMasterPlaylist=function(v,b){var g=[],f={},C=!1;d.lastIndex=0;for(var E;(E=d.exec(v))!=null;)if(E[1]){var _=new P.AttrList(E[1]),U={attrs:_,bitrate:_.decimalInteger("AVERAGE-BANDWIDTH")||_.decimalInteger("BANDWIDTH"),name:_.NAME,url:A.resolve(E[2],b)},j=_.decimalResolution("RESOLUTION");j&&(U.width=j.width,U.height=j.height),s((_.CODECS||"").split(/[ ,]+/).filter(function(G){return G}),U),U.videoCodec&&U.videoCodec.indexOf("avc1")!==-1&&(U.videoCodec=A.convertAVC1ToAVCOTI(U.videoCodec)),g.push(U)}else if(E[3]){var L=new P.AttrList(E[3]);L["DATA-ID"]&&(C=!0,f[L["DATA-ID"]]=L)}return{levels:g,sessionData:C?f:null}},A.parseMasterPlaylistMedia=function(v,b,g,f){f===void 0&&(f=[]);var C,E=[],_=0;for(u.lastIndex=0;(C=u.exec(v))!==null;){var U=new P.AttrList(C[1]);if(U.TYPE===g){var j={attrs:U,bitrate:0,id:_++,groupId:U["GROUP-ID"],instreamId:U["INSTREAM-ID"],name:U.NAME||U.LANGUAGE||"",type:g,default:U.bool("DEFAULT"),autoselect:U.bool("AUTOSELECT"),forced:U.bool("FORCED"),lang:U.LANGUAGE,url:U.URI?A.resolve(U.URI,b):""};if(f.length){var L=A.findGroup(f,j.groupId)||f[0];S(j,L,"audioCodec"),S(j,L,"textCodec")}E.push(j)}}return E},A.parseLevelPlaylist=function(v,b,g,f,C){var E=new N.LevelDetails(b),_=E.fragments,U=null,j=0,L=0,G=0,B=0,O=null,V=new H.Fragment(f,b),te,re,ge,Ae=-1,Oe=!1;for(o.lastIndex=0,E.m3u8=v;(te=o.exec(v))!==null;){Oe&&(Oe=!1,V=new H.Fragment(f,b),V.start=G,V.sn=j,V.cc=B,V.level=g,U&&(V.initSegment=U,V.rawProgramDateTime=U.rawProgramDateTime));var Ce=te[1];if(Ce){V.duration=parseFloat(Ce);var je=(" "+te[2]).slice(1);V.title=je||null,V.tagList.push(je?["INF",Ce,je]:["INF",Ce])}else if(te[3])Object(X.isFiniteNumber)(V.duration)&&(V.start=G,ge&&(V.levelkey=ge),V.sn=j,V.level=g,V.cc=B,V.urlId=C,_.push(V),V.relurl=(" "+te[3]).slice(1),T(V,O),O=V,G+=V.duration,j++,L=0,Oe=!0);else if(te[4]){var Ue=(" "+te[4]).slice(1);O?V.setByteRange(Ue,O):V.setByteRange(Ue)}else if(te[5])V.rawProgramDateTime=(" "+te[5]).slice(1),V.tagList.push(["PROGRAM-DATE-TIME",V.rawProgramDateTime]),Ae===-1&&(Ae=_.length);else{if(te=te[0].match(h),!te){p.logger.warn("No matches on slow regex match for level playlist!");continue}for(re=1;re<te.length&&!(typeof te[re]!="undefined");re++);var xe=(" "+te[re]).slice(1),be=(" "+te[re+1]).slice(1),Ve=te[re+2]?(" "+te[re+2]).slice(1):"";switch(xe){case"PLAYLIST-TYPE":E.type=be.toUpperCase();break;case"MEDIA-SEQUENCE":j=E.startSN=parseInt(be);break;case"SKIP":{var mt=new P.AttrList(be),yt=mt.decimalInteger("SKIPPED-SEGMENTS");if(Object(X.isFiniteNumber)(yt)){E.skippedSegments=yt;for(var _t=yt;_t--;)_.unshift(null);j+=yt}var xt=mt.enumeratedString("RECENTLY-REMOVED-DATERANGES");xt&&(E.recentlyRemovedDateranges=xt.split(" "));break}case"TARGETDURATION":E.targetduration=parseFloat(be);break;case"VERSION":E.version=parseInt(be);break;case"EXTM3U":break;case"ENDLIST":E.live=!1;break;case"#":(be||Ve)&&V.tagList.push(Ve?[be,Ve]:[be]);break;case"DIS":B++;case"GAP":V.tagList.push([xe]);break;case"BITRATE":V.tagList.push([xe,be]);break;case"DISCONTINUITY-SEQ":B=parseInt(be);break;case"KEY":{var nt,ct=new P.AttrList(be),wt=ct.enumeratedString("METHOD"),_e=ct.URI,Me=ct.hexadecimalInteger("IV"),ve=ct.enumeratedString("KEYFORMATVERSIONS"),Te=ct.enumeratedString("KEYID"),We=(nt=ct.enumeratedString("KEYFORMAT"))!=null?nt:"identity",Je=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Je.indexOf(We)>-1){p.logger.warn("Keyformat "+We+" is not supported from the manifest");continue}else if(We!=="identity")continue;wt&&(ge=n.LevelKey.fromURL(b,_e),_e&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(wt)>=0&&(ge.method=wt,ge.keyFormat=We,Te&&(ge.keyID=Te),ve&&(ge.keyFormatVersions=ve),ge.iv=Me));break}case"START":{var at=new P.AttrList(be),dt=at.decimalFloatingPoint("TIME-OFFSET");Object(X.isFiniteNumber)(dt)&&(E.startTimeOffset=dt);break}case"MAP":{var Lt=new P.AttrList(be);V.relurl=Lt.URI,Lt.BYTERANGE&&V.setByteRange(Lt.BYTERANGE),V.level=g,V.sn="initSegment",ge&&(V.levelkey=ge),V.initSegment=null,U=V,Oe=!0;break}case"SERVER-CONTROL":{var It=new P.AttrList(be);E.canBlockReload=It.bool("CAN-BLOCK-RELOAD"),E.canSkipUntil=It.optionalFloat("CAN-SKIP-UNTIL",0),E.canSkipDateRanges=E.canSkipUntil>0&&It.bool("CAN-SKIP-DATERANGES"),E.partHoldBack=It.optionalFloat("PART-HOLD-BACK",0),E.holdBack=It.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ne=new P.AttrList(be);E.partTarget=Ne.decimalFloatingPoint("PART-TARGET");break}case"PART":{var ke=E.partList;ke||(ke=E.partList=[]);var it=L>0?ke[ke.length-1]:void 0,ot=L++,Ge=new H.Part(new P.AttrList(be),V,b,ot,it);ke.push(Ge),V.duration+=Ge.duration;break}case"PRELOAD-HINT":{var $e=new P.AttrList(be);E.preloadHint=$e;break}case"RENDITION-REPORT":{var we=new P.AttrList(be);E.renditionReports=E.renditionReports||[],E.renditionReports.push(we);break}default:p.logger.warn("line parsed but not handled: "+te);break}}}O&&!O.relurl?(_.pop(),G-=O.duration,E.partList&&(E.fragmentHint=O)):E.partList&&(T(V,O),V.cc=B,E.fragmentHint=V);var Se=_.length,Ee=_[0],ue=_[Se-1];if(G+=E.skippedSegments*E.targetduration,G>0&&Se&&ue){E.averagetargetduration=G/Se;var de=ue.sn;E.endSN=de!=="initSegment"?de:0,Ee&&(E.startCC=Ee.cc,Ee.initSegment||E.fragments.every(function(ye){return ye.relurl&&a(ye.relurl)})&&(p.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),V=new H.Fragment(f,b),V.relurl=ue.relurl,V.level=g,V.sn="initSegment",Ee.initSegment=V,E.needSidxRanges=!0))}else E.endSN=0,E.startCC=0;return E.fragmentHint&&(G+=E.fragmentHint.duration),E.totalduration=G,E.endCC=B,Ae>0&&x(_,Ae),E},A}();function s(A,w){["video","audio","text"].forEach(function(v){var b=A.filter(function(f){return Object(m.isCodecType)(f,v)});if(b.length){var g=b.filter(function(f){return f.lastIndexOf("avc1",0)===0||f.lastIndexOf("mp4a",0)===0});w[v+"Codec"]=g.length>0?g[0]:b[0],A=A.filter(function(f){return b.indexOf(f)===-1})}}),w.unknownCodecs=A}function S(A,w,v){var b=w[v];b&&(A[v]=b)}function x(A,w){for(var v=A[w],b=w;b--;){var g=A[b];if(!g)return;g.programDateTime=v.programDateTime-g.duration*1e3,v=g}}function T(A,w){A.rawProgramDateTime?A.programDateTime=Date.parse(A.rawProgramDateTime):w!=null&&w.programDateTime&&(A.programDateTime=w.endProgramDateTime),Object(X.isFiniteNumber)(A.programDateTime)||(A.programDateTime=null,A.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(Q,z,M){"use strict";M.r(z);var X=M("./src/polyfills/number.ts"),F=M("./src/events.ts"),I=M("./src/errors.ts"),H=M("./src/utils/logger.ts"),N=M("./src/utils/mp4-tools.ts"),n=M("./src/loader/m3u8-parser.ts"),P=M("./src/types/loader.ts"),p=M("./src/utils/attr-list.ts");function m(o){var h=o.type;switch(h){case P.PlaylistContextType.AUDIO_TRACK:return P.PlaylistLevelType.AUDIO;case P.PlaylistContextType.SUBTITLE_TRACK:return P.PlaylistLevelType.SUBTITLE;default:return P.PlaylistLevelType.MAIN}}function d(o,h){var r=o.url;return(r===void 0||r.indexOf("data:")===0)&&(r=h.url),r}var u=function(){function o(r){this.hls=void 0,this.loaders=Object.create(null),this.hls=r,this.registerListeners()}var h=o.prototype;return h.registerListeners=function(){var a=this.hls;a.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(F.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(F.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.on(F.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},h.unregisterListeners=function(){var a=this.hls;a.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(F.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(F.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.off(F.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},h.createInternalLoader=function(a){var i=this.hls.config,s=i.pLoader,S=i.loader,x=s||S,T=new x(i);return a.loader=T,this.loaders[a.type]=T,T},h.getInternalLoader=function(a){return this.loaders[a.type]},h.resetInternalLoader=function(a){this.loaders[a]&&delete this.loaders[a]},h.destroyInternalLoaders=function(){for(var a in this.loaders){var i=this.loaders[a];i&&i.destroy(),this.resetInternalLoader(a)}},h.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},h.onManifestLoading=function(a,i){var s=i.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:P.PlaylistContextType.MANIFEST,url:s,deliveryDirectives:null})},h.onLevelLoading=function(a,i){var s=i.id,S=i.level,x=i.url,T=i.deliveryDirectives;this.load({id:s,groupId:null,level:S,responseType:"text",type:P.PlaylistContextType.LEVEL,url:x,deliveryDirectives:T})},h.onAudioTrackLoading=function(a,i){var s=i.id,S=i.groupId,x=i.url,T=i.deliveryDirectives;this.load({id:s,groupId:S,level:null,responseType:"text",type:P.PlaylistContextType.AUDIO_TRACK,url:x,deliveryDirectives:T})},h.onSubtitleTrackLoading=function(a,i){var s=i.id,S=i.groupId,x=i.url,T=i.deliveryDirectives;this.load({id:s,groupId:S,level:null,responseType:"text",type:P.PlaylistContextType.SUBTITLE_TRACK,url:x,deliveryDirectives:T})},h.load=function(a){var i,s=this.hls.config,S=this.getInternalLoader(a);if(S){var x=S.context;if(x&&x.url===a.url){H.logger.trace("[playlist-loader]: playlist request ongoing");return}H.logger.log("[playlist-loader]: aborting previous loader for type: "+a.type),S.abort()}var T,A,w,v;switch(a.type){case P.PlaylistContextType.MANIFEST:T=s.manifestLoadingMaxRetry,A=s.manifestLoadingTimeOut,w=s.manifestLoadingRetryDelay,v=s.manifestLoadingMaxRetryTimeout;break;case P.PlaylistContextType.LEVEL:case P.PlaylistContextType.AUDIO_TRACK:case P.PlaylistContextType.SUBTITLE_TRACK:T=0,A=s.levelLoadingTimeOut;break;default:T=s.levelLoadingMaxRetry,A=s.levelLoadingTimeOut,w=s.levelLoadingRetryDelay,v=s.levelLoadingMaxRetryTimeout;break}if(S=this.createInternalLoader(a),(i=a.deliveryDirectives)!==null&&i!==void 0&&i.part){var b;if(a.type===P.PlaylistContextType.LEVEL&&a.level!==null?b=this.hls.levels[a.level].details:a.type===P.PlaylistContextType.AUDIO_TRACK&&a.id!==null?b=this.hls.audioTracks[a.id].details:a.type===P.PlaylistContextType.SUBTITLE_TRACK&&a.id!==null&&(b=this.hls.subtitleTracks[a.id].details),b){var g=b.partTarget,f=b.targetduration;g&&f&&(A=Math.min(Math.max(g*3,f*.8)*1e3,A))}}var C={timeout:A,maxRetry:T,retryDelay:w,maxRetryDelay:v,highWaterMark:0},E={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};S.load(a,C,E)},h.loadsuccess=function(a,i,s,S){if(S===void 0&&(S=null),s.isSidxRequest){this.handleSidxRequest(a,s),this.handlePlaylistLoaded(a,i,s,S);return}this.resetInternalLoader(s.type);var x=a.data;if(x.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(a,s,"no EXTM3U delimiter",S);return}i.parsing.start=performance.now(),x.indexOf("#EXTINF:")>0||x.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(a,i,s,S):this.handleMasterPlaylist(a,i,s,S)},h.loaderror=function(a,i,s){s===void 0&&(s=null),this.handleNetworkError(i,s,!1,a)},h.loadtimeout=function(a,i,s){s===void 0&&(s=null),this.handleNetworkError(i,s,!0)},h.handleMasterPlaylist=function(a,i,s,S){var x=this.hls,T=a.data,A=d(a,s),w=n.default.parseMasterPlaylist(T,A),v=w.levels,b=w.sessionData;if(!v.length){this.handleManifestParsingError(a,s,"no level found in manifest",S);return}var g=v.map(function(j){return{id:j.attrs.AUDIO,audioCodec:j.audioCodec}}),f=v.map(function(j){return{id:j.attrs.SUBTITLES,textCodec:j.textCodec}}),C=n.default.parseMasterPlaylistMedia(T,A,"AUDIO",g),E=n.default.parseMasterPlaylistMedia(T,A,"SUBTITLES",f),_=n.default.parseMasterPlaylistMedia(T,A,"CLOSED-CAPTIONS");if(C.length){var U=C.some(function(j){return!j.url});!U&&v[0].audioCodec&&!v[0].attrs.AUDIO&&(H.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),C.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new p.AttrList({}),bitrate:0,url:""}))}x.trigger(F.Events.MANIFEST_LOADED,{levels:v,audioTracks:C,subtitles:E,captions:_,url:A,stats:i,networkDetails:S,sessionData:b})},h.handleTrackOrLevelPlaylist=function(a,i,s,S){var x=this.hls,T=s.id,A=s.level,w=s.type,v=d(a,s),b=Object(X.isFiniteNumber)(T)?T:0,g=Object(X.isFiniteNumber)(A)?A:b,f=m(s),C=n.default.parseLevelPlaylist(a.data,v,g,f,b);if(!C.fragments.length){x.trigger(F.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:v,reason:"no fragments found in level",level:typeof s.level=="number"?s.level:void 0});return}if(w===P.PlaylistContextType.MANIFEST){var E={attrs:new p.AttrList({}),bitrate:0,details:C,name:"",url:v};x.trigger(F.Events.MANIFEST_LOADED,{levels:[E],audioTracks:[],url:v,stats:i,networkDetails:S,sessionData:null})}if(i.parsing.end=performance.now(),C.needSidxRanges){var _,U=(_=C.fragments[0].initSegment)===null||_===void 0?void 0:_.url;this.load({url:U,isSidxRequest:!0,type:w,level:A,levelDetails:C,id:T,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}s.levelDetails=C,this.handlePlaylistLoaded(a,i,s,S)},h.handleSidxRequest=function(a,i){var s=Object(N.parseSegmentIndex)(new Uint8Array(a.data));if(!s)return;var S=s.references,x=i.levelDetails;S.forEach(function(T,A){var w=T.info,v=x.fragments[A];v.byteRange.length===0&&v.setByteRange(String(1+w.end-w.start)+"@"+String(w.start)),v.initSegment&&v.initSegment.setByteRange(String(s.moovEndOffset)+"@0")})},h.handleManifestParsingError=function(a,i,s,S){this.hls.trigger(F.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:i.type===P.PlaylistContextType.MANIFEST,url:a.url,reason:s,response:a,context:i,networkDetails:S})},h.handleNetworkError=function(a,i,s,S){s===void 0&&(s=!1),H.logger.warn("[playlist-loader]: A network "+(s?"timeout":"error")+" occurred while loading "+a.type+" level: "+a.level+" id: "+a.id+' group-id: "'+a.groupId+'"');var x=I.ErrorDetails.UNKNOWN,T=!1,A=this.getInternalLoader(a);switch(a.type){case P.PlaylistContextType.MANIFEST:x=s?I.ErrorDetails.MANIFEST_LOAD_TIMEOUT:I.ErrorDetails.MANIFEST_LOAD_ERROR,T=!0;break;case P.PlaylistContextType.LEVEL:x=s?I.ErrorDetails.LEVEL_LOAD_TIMEOUT:I.ErrorDetails.LEVEL_LOAD_ERROR,T=!1;break;case P.PlaylistContextType.AUDIO_TRACK:x=s?I.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:I.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,T=!1;break;case P.PlaylistContextType.SUBTITLE_TRACK:x=s?I.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:I.ErrorDetails.SUBTITLE_LOAD_ERROR,T=!1;break}A&&this.resetInternalLoader(a.type);var w={type:I.ErrorTypes.NETWORK_ERROR,details:x,fatal:T,url:a.url,loader:A,context:a,networkDetails:i};S&&(w.response=S),this.hls.trigger(F.Events.ERROR,w)},h.handlePlaylistLoaded=function(a,i,s,S){var x=s.type,T=s.level,A=s.id,w=s.groupId,v=s.loader,b=s.levelDetails,g=s.deliveryDirectives;if(!(b!=null&&b.targetduration)){this.handleManifestParsingError(a,s,"invalid target duration",S);return}if(!v)return;b.live&&(v.getCacheAge&&(b.ageHeader=v.getCacheAge()||0),(!v.getCacheAge||isNaN(b.ageHeader))&&(b.ageHeader=0));switch(x){case P.PlaylistContextType.MANIFEST:case P.PlaylistContextType.LEVEL:this.hls.trigger(F.Events.LEVEL_LOADED,{details:b,level:T||0,id:A||0,stats:i,networkDetails:S,deliveryDirectives:g});break;case P.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(F.Events.AUDIO_TRACK_LOADED,{details:b,id:A||0,groupId:w||"",stats:i,networkDetails:S,deliveryDirectives:g});break;case P.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(F.Events.SUBTITLE_TRACK_LOADED,{details:b,id:A||0,groupId:w||"",stats:i,networkDetails:S,deliveryDirectives:g});break}},o}();z.default=u},"./src/polyfills/number.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"isFiniteNumber",function(){return X}),M.d(z,"MAX_SAFE_INTEGER",function(){return F});var X=Number.isFinite||function(I){return typeof I=="number"&&isFinite(I)},F=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(Q,z,M){"use strict";M.r(z);var X=function(){function F(){}return F.getSilentFrame=function(H,N){switch(H){case"mp4a.40.2":if(N===1)return new Uint8Array([0,200,0,128,35,128]);if(N===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(N===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(N===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(N===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(N===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(N===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(N===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(N===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},F}();z.default=X},"./src/remux/mp4-generator.ts":function(Q,z,M){"use strict";M.r(z);var X=Math.pow(2,32)-1,F=function(){function I(){}return I.init=function(){I.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 N;for(N in I.types)I.types.hasOwnProperty(N)&&(I.types[N]=[N.charCodeAt(0),N.charCodeAt(1),N.charCodeAt(2),N.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]),P=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]);I.HDLR_TYPES={video:n,audio:P};var p=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),m=new Uint8Array([0,0,0,0,0,0,0,0]);I.STTS=I.STSC=I.STCO=m,I.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),I.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),I.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),I.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var d=new Uint8Array([105,115,111,109]),u=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);I.FTYP=I.box(I.types.ftyp,d,o,d,u),I.DINF=I.box(I.types.dinf,I.box(I.types.dref,p))},I.box=function(N){for(var n=8,P=arguments.length,p=new Array(P>1?P-1:0),m=1;m<P;m++)p[m-1]=arguments[m];for(var d=p.length,u=d;d--;)n+=p[d].byteLength;var o=new Uint8Array(n);for(o[0]=n>>24&255,o[1]=n>>16&255,o[2]=n>>8&255,o[3]=n&255,o.set(N,4),d=0,n=8;d<u;d++)o.set(p[d],n),n+=p[d].byteLength;return o},I.hdlr=function(N){return I.box(I.types.hdlr,I.HDLR_TYPES[N])},I.mdat=function(N){return I.box(I.types.mdat,N)},I.mdhd=function(N,n){n*=N;var P=Math.floor(n/(X+1)),p=Math.floor(n%(X+1));return I.box(I.types.mdhd,new Uint8Array([1,0,0,0,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,P>>24,P>>16&255,P>>8&255,P&255,p>>24,p>>16&255,p>>8&255,p&255,85,196,0,0]))},I.mdia=function(N){return I.box(I.types.mdia,I.mdhd(N.timescale,N.duration),I.hdlr(N.type),I.minf(N))},I.mfhd=function(N){return I.box(I.types.mfhd,new Uint8Array([0,0,0,0,N>>24,N>>16&255,N>>8&255,N&255]))},I.minf=function(N){return N.type==="audio"?I.box(I.types.minf,I.box(I.types.smhd,I.SMHD),I.DINF,I.stbl(N)):I.box(I.types.minf,I.box(I.types.vmhd,I.VMHD),I.DINF,I.stbl(N))},I.moof=function(N,n,P){return I.box(I.types.moof,I.mfhd(N),I.traf(P,n))},I.moov=function(N){for(var n=N.length,P=[];n--;)P[n]=I.trak(N[n]);return I.box.apply(null,[I.types.moov,I.mvhd(N[0].timescale,N[0].duration)].concat(P).concat(I.mvex(N)))},I.mvex=function(N){for(var n=N.length,P=[];n--;)P[n]=I.trex(N[n]);return I.box.apply(null,[I.types.mvex].concat(P))},I.mvhd=function(N,n){n*=N;var P=Math.floor(n/(X+1)),p=Math.floor(n%(X+1)),m=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,N>>24&255,N>>16&255,N>>8&255,N&255,P>>24,P>>16&255,P>>8&255,P&255,p>>24,p>>16&255,p>>8&255,p&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 I.box(I.types.mvhd,m)},I.sdtp=function(N){var n=N.samples||[],P=new Uint8Array(4+n.length),p,m;for(p=0;p<n.length;p++)m=n[p].flags,P[p+4]=m.dependsOn<<4|m.isDependedOn<<2|m.hasRedundancy;return I.box(I.types.sdtp,P)},I.stbl=function(N){return I.box(I.types.stbl,I.stsd(N),I.box(I.types.stts,I.STTS),I.box(I.types.stsc,I.STSC),I.box(I.types.stsz,I.STSZ),I.box(I.types.stco,I.STCO))},I.avc1=function(N){var n=[],P=[],p,m,d;for(p=0;p<N.sps.length;p++)m=N.sps[p],d=m.byteLength,n.push(d>>>8&255),n.push(d&255),n=n.concat(Array.prototype.slice.call(m));for(p=0;p<N.pps.length;p++)m=N.pps[p],d=m.byteLength,P.push(d>>>8&255),P.push(d&255),P=P.concat(Array.prototype.slice.call(m));var u=I.box(I.types.avcC,new Uint8Array([1,n[3],n[4],n[5],252|3,224|N.sps.length].concat(n).concat([N.pps.length]).concat(P))),o=N.width,h=N.height,r=N.pixelRatio[0],a=N.pixelRatio[1];return I.box(I.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,o>>8&255,o&255,h>>8&255,h&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]),u,I.box(I.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),I.box(I.types.pasp,new Uint8Array([r>>24,r>>16&255,r>>8&255,r&255,a>>24,a>>16&255,a>>8&255,a&255])))},I.esds=function(N){var n=N.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(N.config).concat([6,1,2]))},I.mp4a=function(N){var n=N.samplerate;return I.box(I.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,N.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]),I.box(I.types.esds,I.esds(N)))},I.mp3=function(N){var n=N.samplerate;return I.box(I.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,N.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]))},I.stsd=function(N){return N.type==="audio"?!N.isAAC&&N.codec==="mp3"?I.box(I.types.stsd,I.STSD,I.mp3(N)):I.box(I.types.stsd,I.STSD,I.mp4a(N)):I.box(I.types.stsd,I.STSD,I.avc1(N))},I.tkhd=function(N){var n=N.id,P=N.duration*N.timescale,p=N.width,m=N.height,d=Math.floor(P/(X+1)),u=Math.floor(P%(X+1));return I.box(I.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,d>>24,d>>16&255,d>>8&255,d&255,u>>24,u>>16&255,u>>8&255,u&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,p>>8&255,p&255,0,0,m>>8&255,m&255,0,0]))},I.traf=function(N,n){var P=I.sdtp(N),p=N.id,m=Math.floor(n/(X+1)),d=Math.floor(n%(X+1));return I.box(I.types.traf,I.box(I.types.tfhd,new Uint8Array([0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255])),I.box(I.types.tfdt,new Uint8Array([1,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,d>>24,d>>16&255,d>>8&255,d&255])),I.trun(N,P.length+16+20+8+16+8+8),P)},I.trak=function(N){return N.duration=N.duration||4294967295,I.box(I.types.trak,I.tkhd(N),I.mdia(N))},I.trex=function(N){var n=N.id;return I.box(I.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]))},I.trun=function(N,n){var P=N.samples||[],p=P.length,m=12+16*p,d=new Uint8Array(m),u,o,h,r,a,i;for(n+=8+m,d.set([0,0,15,1,p>>>24&255,p>>>16&255,p>>>8&255,p&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255],0),u=0;u<p;u++)o=P[u],h=o.duration,r=o.size,a=o.flags,i=o.cts,d.set([h>>>24&255,h>>>16&255,h>>>8&255,h&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255,a.isLeading<<2|a.dependsOn,a.isDependedOn<<6|a.hasRedundancy<<4|a.paddingValue<<1|a.isNonSync,a.degradPrio&240<<8,a.degradPrio&15,i>>>24&255,i>>>16&255,i>>>8&255,i&255],12+16*u);return I.box(I.types.trun,d)},I.initSegment=function(N){I.types||I.init();var n=I.moov(N),P=new Uint8Array(I.FTYP.byteLength+n.byteLength);return P.set(I.FTYP),P.set(n,I.FTYP.byteLength),P},I}();F.types=void 0,F.HDLR_TYPES=void 0,F.STTS=void 0,F.STSC=void 0,F.STCO=void 0,F.STSZ=void 0,F.VMHD=void 0,F.SMHD=void 0,F.STSD=void 0,F.FTYP=void 0,F.DINF=void 0,z.default=F},"./src/remux/mp4-remuxer.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"default",function(){return i}),M.d(z,"normalizePts",function(){return s});var X=M("./src/polyfills/number.ts"),F=M("./src/remux/aac-helper.ts"),I=M("./src/remux/mp4-generator.ts"),H=M("./src/events.ts"),N=M("./src/errors.ts"),n=M("./src/utils/logger.ts"),P=M("./src/types/loader.ts"),p=M("./src/utils/timescale-conversion.ts");function m(){return m=Object.assign||function(A){for(var w=1;w<arguments.length;w++){var v=arguments[w];for(var b in v)Object.prototype.hasOwnProperty.call(v,b)&&(A[b]=v[b])}return A},m.apply(this,arguments)}var d=10*1e3,u=1024,o=1152,h=null,r=null,a=!1,i=function(){function A(v,b,g,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=v,this.config=b,this.typeSupported=g,this.ISGenerated=!1,h===null){var C=navigator.userAgent||"",E=C.match(/Chrome\/(\d+)/i);h=E?parseInt(E[1]):0}if(r===null){var _=navigator.userAgent.match(/Safari\/(\d+)/i);r=_?parseInt(_[1]):0}a=!!h&&h<75||!!r&&r<600}var w=A.prototype;return w.destroy=function(){},w.resetTimeStamp=function(b){n.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=b},w.resetNextTimestamp=function(){n.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},w.resetInitSegment=function(){n.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},w.getVideoStartPts=function(b){var g=!1,f=b.reduce(function(C,E){var _=E.pts-C;return _<-4294967296?(g=!0,s(C,E.pts)):_>0?C:E.pts},b[0].pts);return g&&n.logger.debug("PTS rollover detected"),f},w.remux=function(b,g,f,C,E,_,U,j){var L,G,B,O,V,te,re=E,ge=E,Ae=b.pid>-1,Oe=g.pid>-1,Ce=g.samples.length,je=b.samples.length>0,Ue=Ce>1,xe=(!Ae||je)&&(!Oe||Ue)||this.ISGenerated||U;if(xe){this.ISGenerated||(B=this.generateIS(b,g,E));var be=this.isVideoContiguous,Ve=-1;if(Ue&&(Ve=S(g.samples),!be&&this.config.forceKeyFrameOnDiscontinuity))if(te=!0,Ve>0){n.logger.warn("[mp4-remuxer]: Dropped "+Ve+" out of "+Ce+" video samples due to a missing keyframe");var mt=this.getVideoStartPts(g.samples);g.samples=g.samples.slice(Ve),g.dropped+=Ve,ge+=(g.samples[0].pts-mt)/(g.timescale||9e4)}else Ve===-1&&(n.logger.warn("[mp4-remuxer]: No keyframe found out of "+Ce+" video samples"),te=!1);if(this.ISGenerated){if(je&&Ue){var yt=this.getVideoStartPts(g.samples),_t=s(b.samples[0].pts,yt)-yt,xt=_t/g.inputTimeScale;re+=Math.max(0,xt),ge+=Math.max(0,-xt)}if(je){if(b.samplerate||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),B=this.generateIS(b,g,E)),G=this.remuxAudio(b,re,this.isAudioContiguous,_,Oe||Ue||j===P.PlaylistLevelType.AUDIO?ge:void 0),Ue){var nt=G?G.endPTS-G.startPTS:0;g.inputTimeScale||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),B=this.generateIS(b,g,E)),L=this.remuxVideo(g,ge,be,nt)}}else Ue&&(L=this.remuxVideo(g,ge,be,0));L&&(L.firstKeyFrame=Ve,L.independent=Ve!==-1)}}return this.ISGenerated&&(f.samples.length&&(V=this.remuxID3(f,E)),C.samples.length&&(O=this.remuxText(C,E))),{audio:G,video:L,initSegment:B,independent:te,text:O,id3:V}},w.generateIS=function(b,g,f){var C=b.samples,E=g.samples,_=this.typeSupported,U={},j=!Object(X.isFiniteNumber)(this._initPTS),L="audio/mp4",G,B,O;if(j&&(G=B=Infinity),b.config&&C.length&&(b.timescale=b.samplerate,b.isAAC||(_.mpeg?(L="audio/mpeg",b.codec=""):_.mp3&&(b.codec="mp3")),U.audio={id:"audio",container:L,codec:b.codec,initSegment:!b.isAAC&&_.mpeg?new Uint8Array(0):I.default.initSegment([b]),metadata:{channelCount:b.channelCount}},j&&(O=b.inputTimeScale,G=B=C[0].pts-Math.round(O*f))),g.sps&&g.pps&&E.length&&(g.timescale=g.inputTimeScale,U.video={id:"main",container:"video/mp4",codec:g.codec,initSegment:I.default.initSegment([g]),metadata:{width:g.width,height:g.height}},j)){O=g.inputTimeScale;var V=this.getVideoStartPts(E),te=Math.round(O*f);B=Math.min(B,s(E[0].dts,V)-te),G=Math.min(G,V-te)}if(Object.keys(U).length)return this.ISGenerated=!0,j&&(this._initPTS=G,this._initDTS=B),{tracks:U,initPTS:G,timescale:O}},w.remuxVideo=function(b,g,f,C){var E=b.inputTimeScale,_=b.samples,U=[],j=_.length,L=this._initPTS,G=this.nextAvcDts,B=8,O,V,te,re=Number.POSITIVE_INFINITY,ge=Number.NEGATIVE_INFINITY,Ae=0,Oe=!1;if(!f||G===null){var Ce=g*E,je=_[0].pts-s(_[0].dts,_[0].pts);G=Ce-je}for(var Ue=0;Ue<j;Ue++){var xe=_[Ue];if(xe.pts=s(xe.pts-L,G),xe.dts=s(xe.dts-L,G),xe.dts>xe.pts){var be=9e4*.2;Ae=Math.max(Math.min(Ae,xe.pts-xe.dts),-1*be)}xe.dts<_[Ue>0?Ue-1:Ue].dts&&(Oe=!0)}Oe&&_.sort(function(Ct,et){var st=Ct.dts-et.dts,He=Ct.pts-et.pts;return st||He}),V=_[0].dts,te=_[_.length-1].dts;var Ve=Math.round((te-V)/(j-1));if(Ae<0){if(Ae<Ve*-2){n.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(p.toMsFromMpegTsClock)(-Ve,!0)+" ms");for(var mt=Ae,yt=0;yt<j;yt++)_[yt].dts=mt=Math.max(mt,_[yt].pts-Ve),_[yt].pts=Math.max(mt,_[yt].pts)}else{n.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(p.toMsFromMpegTsClock)(Ae,!0)+" ms to overcome this issue");for(var _t=0;_t<j;_t++)_[_t].dts=_[_t].dts+Ae}V=_[0].dts}if(f){var xt=V-G,nt=xt>Ve,ct=xt<-1;if(nt||ct){nt?n.logger.warn("AVC: "+Object(p.toMsFromMpegTsClock)(xt,!0)+" ms ("+xt+"dts) hole between fragments detected, filling it"):n.logger.warn("AVC: "+Object(p.toMsFromMpegTsClock)(-xt,!0)+" ms ("+xt+"dts) overlapping between fragments detected"),V=G;var wt=_[0].pts-xt;_[0].dts=V,_[0].pts=wt,n.logger.log("Video: First PTS/DTS adjusted: "+Object(p.toMsFromMpegTsClock)(wt,!0)+"/"+Object(p.toMsFromMpegTsClock)(V,!0)+", delta: "+Object(p.toMsFromMpegTsClock)(xt,!0)+" ms")}}a&&(V=Math.max(0,V));for(var _e=0,Me=0,ve=0;ve<j;ve++){for(var Te=_[ve],We=Te.units,Je=We.length,at=0,dt=0;dt<Je;dt++)at+=We[dt].data.length;Me+=at,_e+=Je,Te.length=at,Te.dts=Math.max(Te.dts,V),Te.pts=Math.max(Te.pts,Te.dts,0),re=Math.min(Te.pts,re),ge=Math.max(Te.pts,ge)}te=_[j-1].dts;var Lt=Me+4*_e+8,It;try{It=new Uint8Array(Lt)}catch(Ct){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:N.ErrorTypes.MUX_ERROR,details:N.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Lt,reason:"fail allocating video mdat "+Lt});return}var Ne=new DataView(It.buffer);Ne.setUint32(0,Lt),It.set(I.default.types.mdat,4);for(var ke=0;ke<j;ke++){for(var it=_[ke],ot=it.units,Ge=0,$e=0,we=ot.length;$e<we;$e++){var Se=ot[$e],Ee=Se.data,ue=Se.data.byteLength;Ne.setUint32(B,ue),B+=4,It.set(Ee,B),B+=ue,Ge+=4+ue}if(ke<j-1)O=_[ke+1].dts-it.dts;else{var de=this.config,ye=it.dts-_[ke>0?ke-1:ke].dts;if(de.stretchShortVideoTrack&&this.nextAudioPts!==null){var me=Math.floor(de.maxBufferHole*E),Le=(C?re+C*E:this.nextAudioPts)-it.pts;Le>me?(O=Le-ye,O<0&&(O=ye),n.logger.log("[mp4-remuxer]: It is approximately "+Le/90+" ms to the next segment; using duration "+O/90+" ms for the last video frame.")):O=ye}else O=ye}var Xe=Math.round(it.pts-it.dts);U.push(new x(it.key,O,Ge,Xe))}if(U.length&&h&&h<70){var ut=U[0].flags;ut.dependsOn=2,ut.isNonSync=0}console.assert(O!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=G=te+O,this.isVideoContiguous=!0;var Dt=I.default.moof(b.sequenceNumber++,V,m({},b,{samples:U})),jt="video",Ut={data1:Dt,data2:It,startPTS:re/E,endPTS:(ge+O)/E,startDTS:V/E,endDTS:G/E,type:jt,hasAudio:!1,hasVideo:!0,nb:U.length,dropped:b.dropped};return b.samples=[],b.dropped=0,console.assert(It.length,"MDAT length must not be zero"),Ut},w.remuxAudio=function(b,g,f,C,E){var _=b.inputTimeScale,U=b.samplerate?b.samplerate:_,j=_/U,L=b.isAAC?u:o,G=L*j,B=this._initPTS,O=!b.isAAC&&this.typeSupported.mpeg,V=[],te=b.samples,re=O?0:8,ge=this.nextAudioPts||-1,Ae=g*_;if(this.isAudioContiguous=f=f||te.length&&ge>0&&(C&&Math.abs(Ae-ge)<9e3||Math.abs(s(te[0].pts-B,Ae)-ge)<20*G),te.forEach(function(Ee){Ee.pts=s(Ee.pts-B,Ae)}),!f||ge<0){if(te=te.filter(function(Ee){return Ee.pts>=0}),!te.length)return;E===0?ge=0:C?ge=Math.max(0,Ae):ge=te[0].pts}if(b.isAAC)for(var Oe=E!==void 0,Ce=this.config.maxAudioFramesDrift,je=0,Ue=ge;je<te.length;je++){var xe=te[je],be=xe.pts,Ve=be-Ue,mt=Math.abs(1e3*Ve/_);if(Ve<=-Ce*G&&Oe)je===0&&(n.logger.warn("Audio frame @ "+(be/_).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Ve/_)+" ms."),this.nextAudioPts=ge=Ue=be);else if(Ve>=Ce*G&&mt<d&&Oe){var yt=Math.round(Ve/G);Ue=be-yt*G,Ue<0&&(yt--,Ue+=G),je===0&&(this.nextAudioPts=ge=Ue),n.logger.warn("[mp4-remuxer]: Injecting "+yt+" audio frame @ "+(Ue/_).toFixed(3)+"s due to "+Math.round(1e3*Ve/_)+" ms gap.");for(var _t=0;_t<yt;_t++){var xt=Math.max(Ue,0),nt=F.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);nt||(n.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),nt=xe.unit.subarray()),te.splice(je,0,{unit:nt,pts:xt}),Ue+=G,je++}}xe.pts=Ue,Ue+=G}for(var ct=null,wt=null,_e,Me=0,ve=te.length;ve--;)Me+=te[ve].unit.byteLength;for(var Te=0,We=te.length;Te<We;Te++){var Je=te[Te],at=Je.unit,dt=Je.pts;if(wt!==null){var Lt=V[Te-1];Lt.duration=Math.round((dt-wt)/j)}else if(f&&b.isAAC&&(dt=ge),ct=dt,Me>0){Me+=re;try{_e=new Uint8Array(Me)}catch(Ee){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:N.ErrorTypes.MUX_ERROR,details:N.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Me,reason:"fail allocating audio mdat "+Me});return}if(!O){var It=new DataView(_e.buffer);It.setUint32(0,Me),_e.set(I.default.types.mdat,4)}}else return;_e.set(at,re);var Ne=at.byteLength;re+=Ne,V.push(new x(!0,L,Ne,0)),wt=dt}var ke=V.length;if(!ke)return;var it=V[V.length-1];this.nextAudioPts=ge=wt+j*it.duration;var ot=O?new Uint8Array(0):I.default.moof(b.sequenceNumber++,ct/j,m({},b,{samples:V}));b.samples=[];var Ge=ct/_,$e=ge/_,we="audio",Se={data1:ot,data2:_e,startPTS:Ge,endPTS:$e,startDTS:Ge,endDTS:$e,type:we,hasAudio:!0,hasVideo:!1,nb:ke};return this.isAudioContiguous=!0,console.assert(_e.length,"MDAT length must not be zero"),Se},w.remuxEmptyAudio=function(b,g,f,C){var E=b.inputTimeScale,_=b.samplerate?b.samplerate:E,U=E/_,j=this.nextAudioPts,L=(j!==null?j:C.startDTS*E)+this._initDTS,G=C.endDTS*E+this._initDTS,B=U*u,O=Math.ceil((G-L)/B),V=F.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);if(n.logger.warn("[mp4-remuxer]: remux empty Audio"),!V){n.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var te=[],re=0;re<O;re++){var ge=L+re*B;te.push({unit:V,pts:ge,dts:ge})}return b.samples=te,this.remuxAudio(b,g,f,!1)},w.remuxID3=function(b,g){var f=b.samples.length;if(!f)return;for(var C=b.inputTimeScale,E=this._initPTS,_=this._initDTS,U=0;U<f;U++){var j=b.samples[U];j.pts=s(j.pts-E,g*C)/C,j.dts=s(j.dts-_,g*C)/C}var L=b.samples;return b.samples=[],{samples:L}},w.remuxText=function(b,g){var f=b.samples.length;if(!f)return;for(var C=b.inputTimeScale,E=this._initPTS,_=0;_<f;_++){var U=b.samples[_];U.pts=s(U.pts-E,g*C)/C}b.samples.sort(function(L,G){return L.pts-G.pts});var j=b.samples;return b.samples=[],{samples:j}},A}();function s(A,w){var v;if(w===null)return A;for(w<A?v=-8589934592:v=8589934592;Math.abs(A-w)>4294967296;)A+=v;return A}function S(A){for(var w=0;w<A.length;w++)if(A[w].key)return w;return-1}var x=function(w,v,b,g){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=v,this.size=b,this.cts=g,this.flags=new T(w)},T=function(w){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=w?2:1,this.isNonSync=w?0:1}},"./src/remux/passthrough-remuxer.ts":function(Q,z,M){"use strict";M.r(z);var X=M("./src/polyfills/number.ts"),F=M("./src/utils/mp4-tools.ts"),I=M("./src/loader/fragment.ts"),H=M("./src/utils/logger.ts"),N=function(){function p(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var m=p.prototype;return m.destroy=function(){},m.resetTimeStamp=function(u){this.initPTS=u,this.lastEndDTS=null},m.resetNextTimestamp=function(){this.lastEndDTS=null},m.resetInitSegment=function(u,o,h){this.audioCodec=o,this.videoCodec=h,this.generateInitSegment(u),this.emitInitSegment=!0},m.generateInitSegment=function(u){var o=this.audioCodec,h=this.videoCodec;if(!u||!u.byteLength){this.initTracks=void 0,this.initData=void 0;return}var r=this.initData=Object(F.parseInitSegment)(u);o||(o=P(r.audio,I.ElementaryStreamTypes.AUDIO)),h||(h=P(r.video,I.ElementaryStreamTypes.VIDEO));var a={};r.audio&&r.video?a.audiovideo={container:"video/mp4",codec:o+","+h,initSegment:u,id:"main"}:r.audio?a.audio={container:"audio/mp4",codec:o,initSegment:u,id:"audio"}:r.video?a.video={container:"video/mp4",codec:h,initSegment:u,id:"main"}:H.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=a},m.remux=function(u,o,h,r,a){var i=this.initPTS,s=this.lastEndDTS,S={audio:void 0,video:void 0,text:r,id3:h,initSegment:void 0};Object(X.isFiniteNumber)(s)||(s=this.lastEndDTS=a||0);var x=o.samples;if(!x||!x.length)return S;var T={initPTS:void 0,timescale:1},A=this.initData;if((!A||!A.length)&&(this.generateInitSegment(x),A=this.initData),!A||!A.length)return H.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),S;this.emitInitSegment&&(T.tracks=this.initTracks,this.emitInitSegment=!1),Object(X.isFiniteNumber)(i)||(this.initPTS=T.initPTS=i=n(A,x,s));var w=Object(F.getDuration)(x,A),v=s,b=w+v;Object(F.offsetStartDTS)(A,x,i),w>0?this.lastEndDTS=b:(H.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var g=!!A.audio,f=!!A.video,C="";g&&(C+="audio"),f&&(C+="video");var E={data1:x,startPTS:v,startDTS:v,endPTS:b,endDTS:b,type:C,hasAudio:g,hasVideo:f,nb:1,dropped:0};return S.audio=E.type==="audio"?E:void 0,S.video=E.type!=="audio"?E:void 0,S.text=r,S.id3=h,S.initSegment=T,S},p}(),n=function(m,d,u){return Object(F.getStartDTS)(m,d)-u};function P(p,m){var d=p==null?void 0:p.codec;return d&&d.length>4?d:d==="hvc1"?"hvc1.1.c.L120.90":d==="av01"?"av01.0.04M.08":d==="avc1"||m===I.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}z.default=N},"./src/task-loop.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"default",function(){return X});var X=function(){function F(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var I=F.prototype;return I.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},I.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},I.onHandlerDestroyed=function(){},I.hasInterval=function(){return!!this._tickInterval},I.hasNextTick=function(){return!!this._tickTimer},I.setInterval=function(N){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,N),!0)},I.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},I.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},I.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},I.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},I.doTick=function(){},F}()},"./src/types/cmcd.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"CMCDVersion",function(){return X}),M.d(z,"CMCDObjectType",function(){return F}),M.d(z,"CMCDStreamingFormat",function(){return I}),M.d(z,"CMCDStreamType",function(){return H});var X=1,F;(function(N){N.MANIFEST="m",N.AUDIO="a",N.VIDEO="v",N.MUXED="av",N.INIT="i",N.CAPTION="c",N.TIMED_TEXT="tt",N.KEY="k",N.OTHER="o"})(F||(F={}));var I;(function(N){N.DASH="d",N.HLS="h",N.SMOOTH="s",N.OTHER="o"})(I||(I={}));var H;(function(N){N.VOD="v",N.LIVE="l"})(H||(H={}))},"./src/types/level.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"HlsSkip",function(){return I}),M.d(z,"getSkipValue",function(){return H}),M.d(z,"HlsUrlParameters",function(){return N}),M.d(z,"Level",function(){return n});function X(P,p){for(var m=0;m<p.length;m++){var d=p[m];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(P,d.key,d)}}function F(P,p,m){return p&&X(P.prototype,p),m&&X(P,m),P}var I;(function(P){P.No="",P.Yes="YES",P.v2="v2"})(I||(I={}));function H(P,p){var m=P.canSkipUntil,d=P.canSkipDateRanges,u=P.endSN,o=p!==void 0?p-u:0;return m&&o<m?d?I.v2:I.Yes:I.No}var N=function(){function P(m,d,u){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=m,this.part=d,this.skip=u}var p=P.prototype;return p.addDirectives=function(d){var u=new self.URL(d);return this.msn!==void 0&&u.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&u.searchParams.set("_HLS_part",this.part.toString()),this.skip&&u.searchParams.set("_HLS_skip",this.skip),u.toString()},P}(),n=function(){function P(p){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=[p.url],this.attrs=p.attrs,this.bitrate=p.bitrate,p.details&&(this.details=p.details),this.id=p.id||0,this.name=p.name,this.width=p.width||0,this.height=p.height||0,this.audioCodec=p.audioCodec,this.videoCodec=p.videoCodec,this.unknownCodecs=p.unknownCodecs,this.codecSet=[p.videoCodec,p.audioCodec].filter(function(m){return m}).join(",").replace(/\.[^.,]+/g,"")}return F(P,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(m){var d=m%this.url.length;this._urlId!==d&&(this.details=void 0,this._urlId=d)}}]),P}()},"./src/types/loader.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"PlaylistContextType",function(){return X}),M.d(z,"PlaylistLevelType",function(){return F});var X;(function(I){I.MANIFEST="manifest",I.LEVEL="level",I.AUDIO_TRACK="audioTrack",I.SUBTITLE_TRACK="subtitleTrack"})(X||(X={}));var F;(function(I){I.MAIN="main",I.AUDIO="audio",I.SUBTITLE="subtitle"})(F||(F={}))},"./src/types/transmuxer.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"ChunkMetadata",function(){return X});var X=function(H,N,n,P,p,m){P===void 0&&(P=0),p===void 0&&(p=-1),m===void 0&&(m=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=F(),this.buffering={audio:F(),video:F(),audiovideo:F()},this.level=H,this.sn=N,this.id=n,this.size=P,this.part=p,this.partial=m};function F(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"AttrList",function(){return I});var X=/^(\d+)x(\d+)$/,F=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,I=function(){function H(n){typeof n=="string"&&(n=H.parseAttrList(n));for(var P in n)n.hasOwnProperty(P)&&(this[P]=n[P])}var N=H.prototype;return N.decimalInteger=function(P){var p=parseInt(this[P],10);return p>Number.MAX_SAFE_INTEGER?Infinity:p},N.hexadecimalInteger=function(P){if(this[P]){var p=(this[P]||"0x").slice(2);p=(p.length&1?"0":"")+p;for(var m=new Uint8Array(p.length/2),d=0;d<p.length/2;d++)m[d]=parseInt(p.slice(d*2,d*2+2),16);return m}else return null},N.hexadecimalIntegerAsNumber=function(P){var p=parseInt(this[P],16);return p>Number.MAX_SAFE_INTEGER?Infinity:p},N.decimalFloatingPoint=function(P){return parseFloat(this[P])},N.optionalFloat=function(P,p){var m=this[P];return m?parseFloat(m):p},N.enumeratedString=function(P){return this[P]},N.bool=function(P){return this[P]==="YES"},N.decimalResolution=function(P){var p=X.exec(this[P]);return p===null?void 0:{width:parseInt(p[1],10),height:parseInt(p[2],10)}},H.parseAttrList=function(P){var p,m={},d='"';for(F.lastIndex=0;(p=F.exec(P))!==null;){var u=p[2];u.indexOf(d)===0&&u.lastIndexOf(d)===u.length-1&&(u=u.slice(1,-1)),m[p[1]]=u}return m},H}()},"./src/utils/binary-search.ts":function(Q,z,M){"use strict";M.r(z);var X={search:function(I,H){for(var N=0,n=I.length-1,P=null,p=null;N<=n;){P=(N+n)/2|0,p=I[P];var m=H(p);if(m>0)N=P+1;else if(m<0)n=P-1;else return p}return null}};z.default=X},"./src/utils/buffer-helper.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"BufferHelper",function(){return I});var X=M("./src/utils/logger.ts"),F={length:0,start:function(){return 0},end:function(){return 0}},I=function(){function H(){}return H.isBuffered=function(n,P){try{if(n){for(var p=H.getBuffered(n),m=0;m<p.length;m++)if(P>=p.start(m)&&P<=p.end(m))return!0}}catch(d){}return!1},H.bufferInfo=function(n,P,p){try{if(n){var m=H.getBuffered(n),d=[],u;for(u=0;u<m.length;u++)d.push({start:m.start(u),end:m.end(u)});return this.bufferedInfo(d,P,p)}}catch(o){}return{len:0,start:P,end:P,nextStart:void 0}},H.bufferedInfo=function(n,P,p){P=Math.max(0,P),n.sort(function(T,A){var w=T.start-A.start;return w||A.end-T.end});var m=[];if(p)for(var d=0;d<n.length;d++){var u=m.length;if(u){var o=m[u-1].end;n[d].start-o<p?n[d].end>o&&(m[u-1].end=n[d].end):m.push(n[d])}else m.push(n[d])}else m=n;for(var h=0,r,a=P,i=P,s=0;s<m.length;s++){var S=m[s].start,x=m[s].end;if(P+p>=S&&P<x)a=S,i=x,h=i-P;else if(P+p<S){r=S;break}}return{len:h,start:a||0,end:i||0,nextStart:r}},H.getBuffered=function(n){try{return n.buffered}catch(P){return X.logger.log("failed to get media.buffered",P),F}},H}()},"./src/utils/cea-608-parser.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"Row",function(){return i}),M.d(z,"CaptionScreen",function(){return s});var X=M("./src/utils/logger.ts"),F={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},I=function(b){var g=b;return F.hasOwnProperty(b)&&(g=F[b]),String.fromCharCode(g)},H=15,N=100,n={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},P={17:2,18:4,21:6,22:8,23:10,19:13,20:15},p={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},m={25:2,26:4,29:6,30:8,31:10,27:13,28:15},d=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],u;(function(v){v[v.ERROR=0]="ERROR",v[v.TEXT=1]="TEXT",v[v.WARNING=2]="WARNING",v[v.INFO=2]="INFO",v[v.DEBUG=3]="DEBUG",v[v.DATA=3]="DATA"})(u||(u={}));var o=function(){function v(){this.time=null,this.verboseLevel=u.ERROR}var b=v.prototype;return b.log=function(f,C){this.verboseLevel>=f&&X.logger.log(this.time+" ["+f+"] "+C)},v}(),h=function(b){for(var g=[],f=0;f<b.length;f++)g.push(b[f].toString(16));return g},r=function(){function v(g,f,C,E,_){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=g||"white",this.underline=f||!1,this.italics=C||!1,this.background=E||"black",this.flash=_||!1}var b=v.prototype;return b.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},b.setStyles=function(f){for(var C=["foreground","underline","italics","background","flash"],E=0;E<C.length;E++){var _=C[E];f.hasOwnProperty(_)&&(this[_]=f[_])}},b.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},b.equals=function(f){return this.foreground===f.foreground&&this.underline===f.underline&&this.italics===f.italics&&this.background===f.background&&this.flash===f.flash},b.copy=function(f){this.foreground=f.foreground,this.underline=f.underline,this.italics=f.italics,this.background=f.background,this.flash=f.flash},b.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},v}(),a=function(){function v(g,f,C,E,_,U){this.uchar=void 0,this.penState=void 0,this.uchar=g||" ",this.penState=new r(f,C,E,_,U)}var b=v.prototype;return b.reset=function(){this.uchar=" ",this.penState.reset()},b.setChar=function(f,C){this.uchar=f,this.penState.copy(C)},b.setPenState=function(f){this.penState.copy(f)},b.equals=function(f){return this.uchar===f.uchar&&this.penState.equals(f.penState)},b.copy=function(f){this.uchar=f.uchar,this.penState.copy(f.penState)},b.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},v}(),i=function(){function v(g){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<N;f++)this.chars.push(new a);this.logger=g,this.pos=0,this.currPenState=new r}var b=v.prototype;return b.equals=function(f){for(var C=!0,E=0;E<N;E++)if(!this.chars[E].equals(f.chars[E])){C=!1;break}return C},b.copy=function(f){for(var C=0;C<N;C++)this.chars[C].copy(f.chars[C])},b.isEmpty=function(){for(var f=!0,C=0;C<N;C++)if(!this.chars[C].isEmpty()){f=!1;break}return f},b.setCursor=function(f){this.pos!==f&&(this.pos=f),this.pos<0?(this.logger.log(u.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>N&&(this.logger.log(u.DEBUG,"Too large cursor position "+this.pos),this.pos=N)},b.moveCursor=function(f){var C=this.pos+f;if(f>1)for(var E=this.pos+1;E<C+1;E++)this.chars[E].setPenState(this.currPenState);this.setCursor(C)},b.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},b.insertChar=function(f){f>=144&&this.backSpace();var C=I(f);if(this.pos>=N){this.logger.log(u.ERROR,"Cannot insert "+f.toString(16)+" ("+C+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(C,this.currPenState),this.moveCursor(1)},b.clearFromPos=function(f){var C;for(C=f;C<N;C++)this.chars[C].reset()},b.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},b.clearToEndOfRow=function(){this.clearFromPos(this.pos)},b.getTextString=function(){for(var f=[],C=!0,E=0;E<N;E++){var _=this.chars[E].uchar;_!==" "&&(C=!1),f.push(_)}return C?"":f.join("")},b.setPenStyles=function(f){this.currPenState.setStyles(f);var C=this.chars[this.pos];C.setPenState(this.currPenState)},v}(),s=function(){function v(g){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<H;f++)this.rows.push(new i(g));this.logger=g,this.currRow=H-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var b=v.prototype;return b.reset=function(){for(var f=0;f<H;f++)this.rows[f].clear();this.currRow=H-1},b.equals=function(f){for(var C=!0,E=0;E<H;E++)if(!this.rows[E].equals(f.rows[E])){C=!1;break}return C},b.copy=function(f){for(var C=0;C<H;C++)this.rows[C].copy(f.rows[C])},b.isEmpty=function(){for(var f=!0,C=0;C<H;C++)if(!this.rows[C].isEmpty()){f=!1;break}return f},b.backSpace=function(){var f=this.rows[this.currRow];f.backSpace()},b.clearToEndOfRow=function(){var f=this.rows[this.currRow];f.clearToEndOfRow()},b.insertChar=function(f){var C=this.rows[this.currRow];C.insertChar(f)},b.setPen=function(f){var C=this.rows[this.currRow];C.setPenStyles(f)},b.moveCursor=function(f){var C=this.rows[this.currRow];C.moveCursor(f)},b.setCursor=function(f){this.logger.log(u.INFO,"setCursor: "+f);var C=this.rows[this.currRow];C.setCursor(f)},b.setPAC=function(f){this.logger.log(u.INFO,"pacData = "+JSON.stringify(f));var C=f.row-1;if(this.nrRollUpRows&&C<this.nrRollUpRows-1&&(C=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==C){for(var E=0;E<H;E++)this.rows[E].clear();var _=this.currRow+1-this.nrRollUpRows,U=this.lastOutputScreen;if(U){var j=U.rows[_].cueStartTime,L=this.logger.time;if(j&&L!==null&&j<L)for(var G=0;G<this.nrRollUpRows;G++)this.rows[C-this.nrRollUpRows+G+1].copy(U.rows[_+G])}}this.currRow=C;var B=this.rows[this.currRow];if(f.indent!==null){var O=f.indent,V=Math.max(O-1,0);B.setCursor(f.indent),f.color=B.chars[V].penState.foreground}var te={foreground:f.color,underline:f.underline,italics:f.italics,background:"black",flash:!1};this.setPen(te)},b.setBkgData=function(f){this.logger.log(u.INFO,"bkgData = "+JSON.stringify(f)),this.backSpace(),this.setPen(f),this.insertChar(32)},b.setRollUpRows=function(f){this.nrRollUpRows=f},b.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(u.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(u.TEXT,this.getDisplayText());var f=this.currRow+1-this.nrRollUpRows,C=this.rows.splice(f,1)[0];C.clear(),this.rows.splice(this.currRow,0,C),this.logger.log(u.INFO,"Rolling up")},b.getDisplayText=function(f){f=f||!1;for(var C=[],E="",_=-1,U=0;U<H;U++){var j=this.rows[U].getTextString();j&&(_=U+1,f?C.push("Row "+_+": '"+j+"'"):C.push(j.trim()))}return C.length>0&&(f?E="["+C.join(" | ")+"]":E=C.join(`
|
|
`)),E},b.getTextAndFormat=function(){return this.rows},v}(),S=function(){function v(g,f,C){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=g,this.outputFilter=f,this.mode=null,this.verbose=0,this.displayedMemory=new s(C),this.nonDisplayedMemory=new s(C),this.lastOutputScreen=new s(C),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=C}var b=v.prototype;return b.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},b.getHandler=function(){return this.outputFilter},b.setHandler=function(f){this.outputFilter=f},b.setPAC=function(f){this.writeScreen.setPAC(f)},b.setBkgData=function(f){this.writeScreen.setBkgData(f)},b.setMode=function(f){if(f===this.mode)return;this.mode=f,this.logger.log(u.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},b.insertChars=function(f){for(var C=0;C<f.length;C++)this.writeScreen.insertChar(f[C]);var E=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(u.INFO,E+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(u.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},b.ccRCL=function(){this.logger.log(u.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},b.ccBS=function(){if(this.logger.log(u.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},b.ccAOF=function(){},b.ccAON=function(){},b.ccDER=function(){this.logger.log(u.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},b.ccRU=function(f){this.logger.log(u.INFO,"RU("+f+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(f)},b.ccFON=function(){this.logger.log(u.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},b.ccRDC=function(){this.logger.log(u.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},b.ccTR=function(){this.logger.log(u.INFO,"TR"),this.setMode("MODE_TEXT")},b.ccRTD=function(){this.logger.log(u.INFO,"RTD"),this.setMode("MODE_TEXT")},b.ccEDM=function(){this.logger.log(u.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},b.ccCR=function(){this.logger.log(u.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},b.ccENM=function(){this.logger.log(u.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},b.ccEOC=function(){if(this.logger.log(u.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(u.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},b.ccTO=function(f){this.logger.log(u.INFO,"TO("+f+") - Tab Offset"),this.writeScreen.moveCursor(f)},b.ccMIDROW=function(f){var C={flash:!1};if(C.underline=f%2===1,C.italics=f>=46,C.italics)C.foreground="white";else{var E=Math.floor(f/2)-16,_=["white","green","blue","cyan","red","yellow","magenta"];C.foreground=_[E]}this.logger.log(u.INFO,"MIDROW: "+JSON.stringify(C)),this.writeScreen.setPen(C)},b.outputDataUpdate=function(f){f===void 0&&(f=!1);var C=this.logger.time;if(C===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=C:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,C,this.lastOutputScreen),f&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:C),this.lastOutputScreen.copy(this.displayedMemory))},b.cueSplitAtTime=function(f){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,f,this.displayedMemory),this.cueStartTime=f))},v}(),x=function(){function v(g,f,C){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var E=new o;this.channels=[null,new S(g,f,E),new S(g+1,C,E)],this.cmdHistory=w(),this.logger=E}var b=v.prototype;return b.getHandler=function(f){return this.channels[f].getHandler()},b.setHandler=function(f,C){this.channels[f].setHandler(C)},b.addData=function(f,C){var E,_,U,j=!1;this.logger.time=f;for(var L=0;L<C.length;L+=2){if(_=C[L]&127,U=C[L+1]&127,_===0&&U===0)continue;if(this.logger.log(u.DATA,"["+h([C[L],C[L+1]])+"] -> ("+h([_,U])+")"),E=this.parseCmd(_,U),E||(E=this.parseMidrow(_,U)),E||(E=this.parsePAC(_,U)),E||(E=this.parseBackgroundAttributes(_,U)),!E&&(j=this.parseChars(_,U),j)){var G=this.currentChannel;if(G&&G>0){var B=this.channels[G];B.insertChars(j)}else this.logger.log(u.WARNING,"No channel found yet. TEXT-MODE?")}!E&&!j&&this.logger.log(u.WARNING,"Couldn't parse cleaned data "+h([_,U])+" orig: "+h([C[L],C[L+1]]))}},b.parseCmd=function(f,C){var E=this.cmdHistory,_=(f===20||f===28||f===21||f===29)&&C>=32&&C<=47,U=(f===23||f===31)&&C>=33&&C<=35;if(!(_||U))return!1;if(A(f,C,E))return T(null,null,E),this.logger.log(u.DEBUG,"Repeated command ("+h([f,C])+") is dropped"),!0;var j=f===20||f===21||f===23?1:2,L=this.channels[j];return f===20||f===21||f===28||f===29?C===32?L.ccRCL():C===33?L.ccBS():C===34?L.ccAOF():C===35?L.ccAON():C===36?L.ccDER():C===37?L.ccRU(2):C===38?L.ccRU(3):C===39?L.ccRU(4):C===40?L.ccFON():C===41?L.ccRDC():C===42?L.ccTR():C===43?L.ccRTD():C===44?L.ccEDM():C===45?L.ccCR():C===46?L.ccENM():C===47&&L.ccEOC():L.ccTO(C-32),T(f,C,E),this.currentChannel=j,!0},b.parseMidrow=function(f,C){var E=0;if((f===17||f===25)&&C>=32&&C<=47){if(f===17?E=1:E=2,E!==this.currentChannel)return this.logger.log(u.ERROR,"Mismatch channel in midrow parsing"),!1;var _=this.channels[E];return _?(_.ccMIDROW(C),this.logger.log(u.DEBUG,"MIDROW ("+h([f,C])+")"),!0):!1}return!1},b.parsePAC=function(f,C){var E,_=this.cmdHistory,U=(f>=17&&f<=23||f>=25&&f<=31)&&C>=64&&C<=127,j=(f===16||f===24)&&C>=64&&C<=95;if(!(U||j))return!1;if(A(f,C,_))return T(null,null,_),!0;var L=f<=23?1:2;C>=64&&C<=95?E=L===1?n[f]:p[f]:E=L===1?P[f]:m[f];var G=this.channels[L];return G?(G.setPAC(this.interpretPAC(E,C)),T(f,C,_),this.currentChannel=L,!0):!1},b.interpretPAC=function(f,C){var E,_={color:null,italics:!1,indent:null,underline:!1,row:f};return C>95?E=C-96:E=C-64,_.underline=(E&1)===1,E<=13?_.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(E/2)]:E<=15?(_.italics=!0,_.color="white"):_.indent=Math.floor((E-16)/2)*4,_},b.parseChars=function(f,C){var E,_=null,U=null;if(f>=25?(E=2,U=f-8):(E=1,U=f),U>=17&&U<=19){var j;U===17?j=C+80:U===18?j=C+112:j=C+144,this.logger.log(u.INFO,"Special char '"+I(j)+"' in channel "+E),_=[j]}else f>=32&&f<=127&&(_=C===0?[f]:[f,C]);if(_){var L=h(_);this.logger.log(u.DEBUG,"Char codes = "+L.join(",")),T(f,C,this.cmdHistory)}return _},b.parseBackgroundAttributes=function(f,C){var E=(f===16||f===24)&&C>=32&&C<=47,_=(f===23||f===31)&&C>=45&&C<=47;if(!(E||_))return!1;var U,j={};f===16||f===24?(U=Math.floor((C-32)/2),j.background=d[U],C%2===1&&(j.background=j.background+"_semi")):C===45?j.background="transparent":(j.foreground="black",C===47&&(j.underline=!0));var L=f<=23?1:2,G=this.channels[L];return G.setBkgData(j),T(f,C,this.cmdHistory),!0},b.reset=function(){for(var f=0;f<Object.keys(this.channels).length;f++){var C=this.channels[f];C&&C.reset()}this.cmdHistory=w()},b.cueSplitAtTime=function(f){for(var C=0;C<this.channels.length;C++){var E=this.channels[C];E&&E.cueSplitAtTime(f)}},v}();function T(v,b,g){g.a=v,g.b=b}function A(v,b,g){return g.a===v&&g.b===b}function w(){return{a:null,b:null}}z.default=x},"./src/utils/codecs.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"isCodecType",function(){return F}),M.d(z,"isCodecSupportedInMp4",function(){return I});var X={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function F(H,N){var n=X[N];return!!n&&n[H.slice(0,4)]===!0}function I(H,N){return MediaSource.isTypeSupported((N||"video")+'/mp4;codecs="'+H+'"')}},"./src/utils/cues.ts":function(Q,z,M){"use strict";M.r(z);var X=M("./src/utils/vttparser.ts"),F=M("./src/utils/webvtt-parser.ts"),I=M("./src/utils/texttrack-utils.ts"),H=/\s/,N={newCue:function(P,p,m,d){for(var u=[],o,h,r,a,i,s=self.VTTCue||self.TextTrackCue,S=0;S<d.rows.length;S++)if(o=d.rows[S],r=!0,a=0,i="",!o.isEmpty()){for(var x=0;x<o.chars.length;x++)H.test(o.chars[x].uchar)&&r?a++:(i+=o.chars[x].uchar,r=!1);o.cueStartTime=p,p===m&&(m+=1e-4),a>=16?a--:a++;var T=Object(X.fixLineBreaks)(i.trim()),A=Object(F.generateCueId)(p,m,T);(!P||!P.cues||!P.cues.getCueById(A))&&(h=new s(p,m,T),h.id=A,h.line=S+1,h.align="left",h.position=10+Math.min(80,Math.floor(a*8/32)*10),u.push(h))}return P&&u.length&&(u.sort(function(w,v){return w.line==="auto"||v.line==="auto"?0:w.line>8&&v.line>8?v.line-w.line:w.line-v.line}),u.forEach(function(w){return Object(I.addCueToTrack)(P,w)})),u}};z.default=N},"./src/utils/discontinuities.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"findFirstFragWithCC",function(){return H}),M.d(z,"shouldAlignOnDiscontinuities",function(){return N}),M.d(z,"findDiscontinuousReferenceFrag",function(){return n}),M.d(z,"adjustSlidingStart",function(){return p}),M.d(z,"alignStream",function(){return m}),M.d(z,"alignPDT",function(){return u}),M.d(z,"alignFragmentByPDTDelta",function(){return o}),M.d(z,"alignMediaPlaylistByPDT",function(){return h});var X=M("./src/polyfills/number.ts"),F=M("./src/utils/logger.ts"),I=M("./src/controller/level-helper.ts");function H(r,a){for(var i=null,s=0,S=r.length;s<S;s++){var x=r[s];if(x&&x.cc===a){i=x;break}}return i}function N(r,a,i){return!!(a.details&&(i.endCC>i.startCC||r&&r.cc<i.startCC))}function n(r,a){var i=r.fragments,s=a.fragments;if(!s.length||!i.length){F.logger.log("No fragments to align");return}var S=H(i,s[0].cc);if(!S||S&&!S.startPTS){F.logger.log("No frag in previous level to align on");return}return S}function P(r,a){if(r){var i=r.start+a;r.start=r.startPTS=i,r.endPTS=i+r.duration}}function p(r,a){for(var i=a.fragments,s=0,S=i.length;s<S;s++)P(i[s],r);a.fragmentHint&&P(a.fragmentHint,r),a.alignedSliding=!0}function m(r,a,i){if(!a)return;d(r,i,a),!i.alignedSliding&&a.details&&u(i,a.details),!i.alignedSliding&&a.details&&!i.skippedSegments&&Object(I.adjustSliding)(a.details,i)}function d(r,a,i){if(N(r,i,a)){var s=n(i.details,a);s&&Object(X.isFiniteNumber)(s.start)&&(F.logger.log("Adjusting PTS using last level due to CC increase within current level "+a.url),p(s.start,a))}}function u(r,a){if(!a.fragments.length||!r.hasProgramDateTime||!a.hasProgramDateTime)return;var i=a.fragments[0].programDateTime,s=r.fragments[0].programDateTime,S=(s-i)/1e3+a.fragments[0].start;S&&Object(X.isFiniteNumber)(S)&&(F.logger.log("Adjusting PTS using programDateTime delta "+(s-i)+"ms, sliding:"+S.toFixed(3)+" "+r.url+" "),p(S,r))}function o(r,a){var i=r.programDateTime;if(!i)return;var s=(i-a)/1e3;r.start=r.startPTS=s,r.endPTS=s+r.duration}function h(r,a){if(!a.fragments.length||!r.hasProgramDateTime||!a.hasProgramDateTime)return;var i=a.fragments[0].programDateTime,s=a.fragments[0].start,S=i-s*1e3;r.fragments.forEach(function(x){o(x,S)}),r.fragmentHint&&o(r.fragmentHint,S),r.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(Q,z,M){"use strict";M.r(z);var X=M("./src/utils/ewma.ts"),F=function(){function I(N,n,P){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=P,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new X.default(N),this.fast_=new X.default(n)}var H=I.prototype;return H.update=function(n,P){var p=this.slow_,m=this.fast_;this.slow_.halfLife!==n&&(this.slow_=new X.default(n,p.getEstimate(),p.getTotalWeight())),this.fast_.halfLife!==P&&(this.fast_=new X.default(P,m.getEstimate(),m.getTotalWeight()))},H.sample=function(n,P){n=Math.max(n,this.minDelayMs_);var p=8*P,m=n/1e3,d=p/m;this.fast_.sample(m,d),this.slow_.sample(m,d)},H.canEstimate=function(){var n=this.fast_;return n&&n.getTotalWeight()>=this.minWeight_},H.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},H.destroy=function(){},I}();z.default=F},"./src/utils/ewma.ts":function(Q,z,M){"use strict";M.r(z);var X=function(){function F(H,N,n){N===void 0&&(N=0),n===void 0&&(n=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=H,this.alpha_=H?Math.exp(Math.log(.5)/H):0,this.estimate_=N,this.totalWeight_=n}var I=F.prototype;return I.sample=function(N,n){var P=Math.pow(this.alpha_,N);this.estimate_=n*(1-P)+P*this.estimate_,this.totalWeight_+=N},I.getTotalWeight=function(){return this.totalWeight_},I.getEstimate=function(){if(this.alpha_){var N=1-Math.pow(this.alpha_,this.totalWeight_);if(N)return this.estimate_/N}return this.estimate_},F}();z.default=X},"./src/utils/fetch-loader.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"fetchSupported",function(){return o});var X=M("./src/polyfills/number.ts"),F=M("./src/loader/load-stats.ts"),I=M("./src/demux/chunk-cache.ts");function H(s,S){s.prototype=Object.create(S.prototype),s.prototype.constructor=s,m(s,S)}function N(s){var S=typeof Map=="function"?new Map:void 0;return N=function(T){if(T===null||!p(T))return T;if(typeof T!="function")throw new TypeError("Super expression must either be null or a function");if(typeof S!="undefined"){if(S.has(T))return S.get(T);S.set(T,A)}function A(){return n(T,arguments,d(this).constructor)}return A.prototype=Object.create(T.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),m(A,T)},N(s)}function n(s,S,x){return P()?n=Reflect.construct:n=function(A,w,v){var b=[null];b.push.apply(b,w);var g=Function.bind.apply(A,b),f=new g;return v&&m(f,v.prototype),f},n.apply(null,arguments)}function P(){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(s){return!1}}function p(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function m(s,S){return m=Object.setPrototypeOf||function(T,A){return T.__proto__=A,T},m(s,S)}function d(s){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(x){return x.__proto__||Object.getPrototypeOf(x)},d(s)}function u(){return u=Object.assign||function(s){for(var S=1;S<arguments.length;S++){var x=arguments[S];for(var T in x)Object.prototype.hasOwnProperty.call(x,T)&&(s[T]=x[T])}return s},u.apply(this,arguments)}function o(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(s){}return!1}var h=function(){function s(x){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=x.fetchSetup||a,this.controller=new self.AbortController,this.stats=new F.LoadStats}var S=s.prototype;return S.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},S.abortInternal=function(){var T=this.response;(!T||!T.ok)&&(this.stats.aborted=!0,this.controller.abort())},S.abort=function(){var T;this.abortInternal(),(T=this.callbacks)!==null&&T!==void 0&&T.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},S.load=function(T,A,w){var v=this,b=this.stats;if(b.loading.start)throw new Error("Loader can only be used once.");b.loading.start=self.performance.now();var g=r(T,this.controller.signal),f=w.onProgress,C=T.responseType==="arraybuffer",E=C?"byteLength":"length";this.context=T,this.config=A,this.callbacks=w,this.request=this.fetchSetup(T,g),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){v.abortInternal(),w.onTimeout(b,T,v.response)},A.timeout),self.fetch(this.request).then(function(_){if(v.response=v.loader=_,!_.ok){var U=_.status,j=_.statusText;throw new i(j||"fetch, bad network response",U,_)}return b.loading.first=Math.max(self.performance.now(),b.loading.start),b.total=parseInt(_.headers.get("Content-Length")||"0"),f&&Object(X.isFiniteNumber)(A.highWaterMark)?v.loadProgressively(_,b,T,A.highWaterMark,f):C?_.arrayBuffer():_.text()}).then(function(_){var U=v.response;self.clearTimeout(v.requestTimeout),b.loading.end=Math.max(self.performance.now(),b.loading.first),b.loaded=b.total=_[E];var j={url:U.url,data:_};f&&!Object(X.isFiniteNumber)(A.highWaterMark)&&f(b,T,_,U),w.onSuccess(j,b,T,U)}).catch(function(_){if(self.clearTimeout(v.requestTimeout),b.aborted)return;var U=_.code||0;w.onError({code:U,text:_.message},T,_.details)})},S.getCacheAge=function(){var T=null;if(this.response){var A=this.response.headers.get("age");T=A?parseFloat(A):null}return T},S.loadProgressively=function(T,A,w,v,b){v===void 0&&(v=0);var g=new I.default,f=T.body.getReader(),C=function E(){return f.read().then(function(_){if(_.done)return g.dataLength&&b(A,w,g.flush(),T),Promise.resolve(new ArrayBuffer(0));var U=_.value,j=U.length;return A.loaded+=j,j<v||g.dataLength?(g.push(U),g.dataLength>=v&&b(A,w,g.flush(),T)):b(A,w,U,T),E()}).catch(function(){return Promise.reject()})};return C()},s}();function r(s,S){var x={method:"GET",mode:"cors",credentials:"same-origin",signal:S,headers:new self.Headers(u({},s.headers))};return s.rangeEnd&&x.headers.set("Range","bytes="+s.rangeStart+"-"+String(s.rangeEnd-1)),x}function a(s,S){return new self.Request(s.url,S)}var i=function(s){H(S,s);function S(x,T,A){var w;return w=s.call(this,x)||this,w.code=void 0,w.details=void 0,w.code=T,w.details=A,w}return S}(N(Error));z.default=h},"./src/utils/imsc1-ttml-parser.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"IMSC1_CODEC",function(){return p}),M.d(z,"parseIMSC1",function(){return o});var X=M("./src/utils/mp4-tools.ts"),F=M("./src/utils/vttparser.ts"),I=M("./src/utils/vttcue.ts"),H=M("./src/demux/id3.ts"),N=M("./src/utils/timescale-conversion.ts"),n=M("./src/utils/webvtt-parser.ts");function P(){return P=Object.assign||function(v){for(var b=1;b<arguments.length;b++){var g=arguments[b];for(var f in g)Object.prototype.hasOwnProperty.call(g,f)&&(v[f]=g[f])}return v},P.apply(this,arguments)}var p="stpp.ttml.im1t",m=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,d=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,u={left:"start",center:"center",right:"end",start:"start",end:"end"};function o(v,b,g,f,C){var E=Object(X.findBox)(new Uint8Array(v),["mdat"]);if(E.length===0){C(new Error("Could not parse IMSC1 mdat"));return}var _=E[0],U=Object(H.utf8ArrayToStr)(new Uint8Array(v,_.start,_.end-_.start)),j=Object(N.toTimescaleFromScale)(b,1,g);try{f(h(U,j))}catch(L){C(L)}}function h(v,b){var g=new DOMParser,f=g.parseFromString(v,"text/xml"),C=f.getElementsByTagName("tt")[0];if(!C)throw new Error("Invalid ttml");var E={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},_=Object.keys(E).reduce(function(B,O){return B[O]=C.getAttribute("ttp:"+O)||E[O],B},{}),U=C.getAttribute("xml:space")!=="preserve",j=a(r(C,"styling","style")),L=a(r(C,"layout","region")),G=r(C,"body","[begin]");return[].map.call(G,function(B){var O=i(B,U);if(!O||!B.hasAttribute("begin"))return null;var V=T(B.getAttribute("begin"),_),te=T(B.getAttribute("dur"),_),re=T(B.getAttribute("end"),_);if(V===null)throw x(B);if(re===null){if(te===null)throw x(B);re=V+te}var ge=new I.default(V-b,re-b,O);ge.id=Object(n.generateCueId)(ge.startTime,ge.endTime,ge.text);var Ae=L[B.getAttribute("region")],Oe=j[B.getAttribute("style")];ge.position=10,ge.size=80;var Ce=s(Ae,Oe),je=Ce.textAlign;if(je){var Ue=u[je];Ue&&(ge.lineAlign=Ue),ge.align=je}return P(ge,Ce),ge}).filter(function(B){return B!==null})}function r(v,b,g){var f=v.getElementsByTagName(b)[0];return f?[].slice.call(f.querySelectorAll(g)):[]}function a(v){return v.reduce(function(b,g){var f=g.getAttribute("xml:id");return f&&(b[f]=g),b},{})}function i(v,b){return[].slice.call(v.childNodes).reduce(function(g,f,C){var E;return f.nodeName==="br"&&C?g+`
|
|
`:(E=f.childNodes)!==null&&E!==void 0&&E.length?i(f,b):b?g+f.textContent.trim().replace(/\s+/g," "):g+f.textContent},"")}function s(v,b){var g="http://www.w3.org/ns/ttml#styling",f=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return f.reduce(function(C,E){var _=S(b,g,E)||S(v,g,E);return _&&(C[E]=_),C},{})}function S(v,b,g){return v.hasAttributeNS(b,g)?v.getAttributeNS(b,g):null}function x(v){return new Error("Could not parse ttml timestamp "+v)}function T(v,b){if(!v)return null;var g=Object(F.parseTimeStamp)(v);return g===null&&(m.test(v)?g=A(v,b):d.test(v)&&(g=w(v,b))),g}function A(v,b){var g=m.exec(v),f=(g[4]|0)+(g[5]|0)/b.subFrameRate;return(g[1]|0)*3600+(g[2]|0)*60+(g[3]|0)+f/b.frameRate}function w(v,b){var g=d.exec(v),f=Number(g[1]),C=g[2];switch(C){case"h":return f*3600;case"m":return f*60;case"ms":return f*1e3;case"f":return f/b.frameRate;case"t":return f/b.tickRate}return f}},"./src/utils/logger.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"enableLogs",function(){return n}),M.d(z,"logger",function(){return P});var X=function(){},F={trace:X,debug:X,log:X,warn:X,info:X,error:X},I=F;function H(p){var m=self.console[p];return m?m.bind(self.console,"["+p+"] >"):X}function N(p){for(var m=arguments.length,d=new Array(m>1?m-1:0),u=1;u<m;u++)d[u-1]=arguments[u];d.forEach(function(o){I[o]=p[o]?p[o].bind(p):H(o)})}function n(p){if(self.console&&p===!0||typeof p=="object"){N(p,"debug","log","info","warn","error");try{I.log()}catch(m){I=F}}else I=F}var P=I},"./src/utils/mediakeys-helper.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"KeySystems",function(){return X}),M.d(z,"requestMediaKeySystemAccess",function(){return F});var X;(function(I){I.WIDEVINE="com.widevine.alpha",I.PLAYREADY="com.microsoft.playready"})(X||(X={}));var F=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,M){"use strict";M.r(z),M.d(z,"getMediaSource",function(){return X});function X(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"bin2str",function(){return N}),M.d(z,"readUint16",function(){return n}),M.d(z,"readUint32",function(){return P}),M.d(z,"writeUint32",function(){return p}),M.d(z,"findBox",function(){return m}),M.d(z,"parseSegmentIndex",function(){return d}),M.d(z,"parseInitSegment",function(){return u}),M.d(z,"getStartDTS",function(){return o}),M.d(z,"getDuration",function(){return h}),M.d(z,"computeRawDurationFromSamples",function(){return r}),M.d(z,"offsetStartDTS",function(){return a}),M.d(z,"segmentValidRange",function(){return i}),M.d(z,"appendUint8Array",function(){return s});var X=M("./src/utils/typed-array.ts"),F=M("./src/loader/fragment.ts"),I=Math.pow(2,32)-1,H=[].push;function N(S){return String.fromCharCode.apply(null,S)}function n(S,x){"data"in S&&(x+=S.start,S=S.data);var T=S[x]<<8|S[x+1];return T<0?65536+T:T}function P(S,x){"data"in S&&(x+=S.start,S=S.data);var T=S[x]<<24|S[x+1]<<16|S[x+2]<<8|S[x+3];return T<0?4294967296+T:T}function p(S,x,T){"data"in S&&(x+=S.start,S=S.data),S[x]=T>>24,S[x+1]=T>>16&255,S[x+2]=T>>8&255,S[x+3]=T&255}function m(S,x){var T=[];if(!x.length)return T;var A,w,v;"data"in S?(A=S.data,w=S.start,v=S.end):(A=S,w=0,v=A.byteLength);for(var b=w;b<v;){var g=P(A,b),f=N(A.subarray(b+4,b+8)),C=g>1?b+g:v;if(f===x[0])if(x.length===1)T.push({data:A,start:b+8,end:C});else{var E=m({data:A,start:b+8,end:C},x.slice(1));E.length&&H.apply(T,E)}b=C}return T}function d(S){var x=m(S,["moov"]),T=x[0],A=T?T.end:null,w=m(S,["sidx"]);if(!w||!w[0])return null;var v=[],b=w[0],g=b.data[0],f=g===0?8:16,C=P(b,f);f+=4;var E=0,_=0;g===0?f+=8:f+=16,f+=2;var U=b.end+_,j=n(b,f);f+=2;for(var L=0;L<j;L++){var G=f,B=P(b,G);G+=4;var O=B&2147483647,V=(B&2147483648)>>>31;if(V===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var te=P(b,G);G+=4,v.push({referenceSize:O,subsegmentDuration:te,info:{duration:te/C,start:U,end:U+O-1}}),U+=O,G+=4,f=G}return{earliestPresentationTime:E,timescale:C,version:g,referencesCount:j,references:v,moovEndOffset:A}}function u(S){for(var x=[],T=m(S,["moov","trak"]),A=0;A<T.length;A++){var w=T[A],v=m(w,["tkhd"])[0];if(v){var b=v.data[v.start],g=b===0?12:20,f=P(v,g),C=m(w,["mdia","mdhd"])[0];if(C){b=C.data[C.start],g=b===0?12:20;var E=P(C,g),_=m(w,["mdia","hdlr"])[0];if(_){var U=N(_.data.subarray(_.start+8,_.start+12)),j={soun:F.ElementaryStreamTypes.AUDIO,vide:F.ElementaryStreamTypes.VIDEO}[U];if(j){var L=m(w,["mdia","minf","stbl","stsd"])[0],G=void 0;L&&(G=N(L.data.subarray(L.start+12,L.start+16))),x[f]={timescale:E,type:j},x[j]={timescale:E,id:f,codec:G}}}}}}var B=m(S,["moov","mvex","trex"]);return B.forEach(function(O){var V=P(O,4),te=x[V];te&&(te.default={duration:P(O,12),flags:P(O,20)})}),x}function o(S,x){return m(x,["moof","traf"]).reduce(function(T,A){var w=m(A,["tfdt"])[0],v=w.data[w.start],b=m(A,["tfhd"]).reduce(function(g,f){var C=P(f,4),E=S[C];if(E){var _=P(w,4);v===1&&(_*=Math.pow(2,32),_+=P(w,8));var U=E.timescale||9e4,j=_/U;if(isFinite(j)&&(g===null||j<g))return j}return g},null);return b!==null&&isFinite(b)&&(T===null||b<T)?b:T},null)||0}function h(S,x){for(var T=0,A=0,w=0,v=m(S,["moof","traf"]),b=0;b<v.length;b++){var g=v[b],f=m(g,["tfhd"])[0],C=P(f,4),E=x[C];if(!E)continue;var _=E.default,U=P(f,0)|(_==null?void 0:_.flags),j=_==null?void 0:_.duration;U&8&&(U&2?j=P(f,12):j=P(f,8));for(var L=E.timescale||9e4,G=m(g,["trun"]),B=0;B<G.length;B++){if(j){var O=P(G[B],4);T=j*O}else T=r(G[B]);E.type===F.ElementaryStreamTypes.VIDEO?A+=T/L:E.type===F.ElementaryStreamTypes.AUDIO&&(w+=T/L)}}if(A===0&&w===0){var V=d(S);if(V!=null&&V.references)return V.references.reduce(function(te,re){return te+re.info.duration||0},0)}return A||w}function r(S){var x=P(S,0),T=8;x&1&&(T+=4),x&4&&(T+=4);for(var A=0,w=P(S,4),v=0;v<w;v++){if(x&256){var b=P(S,T);A+=b,T+=4}x&512&&(T+=4),x&1024&&(T+=4),x&2048&&(T+=4)}return A}function a(S,x,T){m(x,["moof","traf"]).forEach(function(A){m(A,["tfhd"]).forEach(function(w){var v=P(w,4),b=S[v];if(!b)return;var g=b.timescale||9e4;m(A,["tfdt"]).forEach(function(f){var C=f.data[f.start],E=P(f,4);if(C===0)p(f,4,E-T*g);else{E*=Math.pow(2,32),E+=P(f,8),E-=T*g,E=Math.max(E,0);var _=Math.floor(E/(I+1)),U=Math.floor(E%(I+1));p(f,4,_),p(f,8,U)}})})})}function i(S){var x={valid:null,remainder:null},T=m(S,["moof"]);if(T){if(T.length<2)return x.remainder=S,x}else return x;var A=T[T.length-1];return x.valid=Object(X.sliceUint8)(S,0,A.start-8),x.remainder=Object(X.sliceUint8)(S,A.start-8),x}function s(S,x){var T=new Uint8Array(S.length+x.length);return T.set(S),T.set(x,S.length),T}},"./src/utils/output-filter.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"default",function(){return X});var X=function(){function F(H,N){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=H,this.trackName=N}var I=F.prototype;return I.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},I.newCue=function(N,n,P){(this.startTime===null||this.startTime>N)&&(this.startTime=N),this.endTime=n,this.screen=P,this.timelineController.createCaptionsTrack(this.trackName)},I.reset=function(){this.cueRanges=[]},F}()},"./src/utils/texttrack-utils.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"sendAddTrackEvent",function(){return F}),M.d(z,"addCueToTrack",function(){return I}),M.d(z,"clearCurrentCues",function(){return H}),M.d(z,"removeCuesInRange",function(){return N}),M.d(z,"getCuesInRange",function(){return P});var X=M("./src/utils/logger.ts");function F(p,m){var d;try{d=new Event("addtrack")}catch(u){d=document.createEvent("Event"),d.initEvent("addtrack",!1,!1)}d.track=p,m.dispatchEvent(d)}function I(p,m){var d=p.mode;if(d==="disabled"&&(p.mode="hidden"),p.cues&&!p.cues.getCueById(m.id))try{if(p.addCue(m),!p.cues.getCueById(m.id))throw new Error("addCue is failed for: "+m)}catch(o){X.logger.debug("[texttrack-utils]: "+o);var u=new self.TextTrackCue(m.startTime,m.endTime,m.text);u.id=m.id,p.addCue(u)}d==="disabled"&&(p.mode=d)}function H(p){var m=p.mode;if(m==="disabled"&&(p.mode="hidden"),p.cues)for(var d=p.cues.length;d--;)p.removeCue(p.cues[d]);m==="disabled"&&(p.mode=m)}function N(p,m,d){var u=p.mode;if(u==="disabled"&&(p.mode="hidden"),p.cues&&p.cues.length>0)for(var o=P(p.cues,m,d),h=0;h<o.length;h++)p.removeCue(o[h]);u==="disabled"&&(p.mode=u)}function n(p,m){if(m<p[0].startTime)return 0;var d=p.length-1;if(m>p[d].endTime)return-1;for(var u=0,o=d;u<=o;){var h=Math.floor((o+u)/2);if(m<p[h].startTime)o=h-1;else if(m>p[h].startTime&&u<d)u=h+1;else return h}return p[u].startTime-m<m-p[o].startTime?u:o}function P(p,m,d){var u=[],o=n(p,m);if(o>-1)for(var h=o,r=p.length;h<r;h++){var a=p[h];if(a.startTime>=m&&a.endTime<=d)u.push(a);else if(a.startTime>d)return u}return u}},"./src/utils/time-ranges.ts":function(Q,z,M){"use strict";M.r(z);var X={toString:function(I){for(var H="",N=I.length,n=0;n<N;n++)H+="["+I.start(n).toFixed(3)+","+I.end(n).toFixed(3)+"]";return H}};z.default=X},"./src/utils/timescale-conversion.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"toTimescaleFromBase",function(){return F}),M.d(z,"toTimescaleFromScale",function(){return I}),M.d(z,"toMsFromMpegTsClock",function(){return H}),M.d(z,"toMpegTsClockFromTimescale",function(){return N});var X=9e4;function F(n,P,p,m){p===void 0&&(p=1),m===void 0&&(m=!1);var d=n*P*p;return m?Math.round(d):d}function I(n,P,p,m){return p===void 0&&(p=1),m===void 0&&(m=!1),F(n,P,1/p,m)}function H(n,P){return P===void 0&&(P=!1),F(n,1e3,1/X,P)}function N(n,P){return P===void 0&&(P=1),F(n,X,1/P)}},"./src/utils/typed-array.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"sliceUint8",function(){return X});function X(F,I,H){return Uint8Array.prototype.slice?F.slice(I,H):new Uint8Array(Array.prototype.slice.call(F,I,H))}},"./src/utils/vttcue.ts":function(Q,z,M){"use strict";M.r(z),z.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var X=["","lr","rl"],F=["start","middle","end","left","right"];function I(p,m){if(typeof m!="string")return!1;if(!Array.isArray(p))return!1;var d=m.toLowerCase();return~p.indexOf(d)?d:!1}function H(p){return I(X,p)}function N(p){return I(F,p)}function n(p){for(var m=arguments.length,d=new Array(m>1?m-1:0),u=1;u<m;u++)d[u-1]=arguments[u];for(var o=1;o<arguments.length;o++){var h=arguments[o];for(var r in h)p[r]=h[r]}return p}function P(p,m,d){var u=this,o={enumerable:!0};u.hasBeenReset=!1;var h="",r=!1,a=p,i=m,s=d,S=null,x="",T=!0,A="auto",w="start",v=50,b="middle",g=50,f="middle";Object.defineProperty(u,"id",n({},o,{get:function(){return h},set:function(E){h=""+E}})),Object.defineProperty(u,"pauseOnExit",n({},o,{get:function(){return r},set:function(E){r=!!E}})),Object.defineProperty(u,"startTime",n({},o,{get:function(){return a},set:function(E){if(typeof E!="number")throw new TypeError("Start time must be set to a number.");a=E,this.hasBeenReset=!0}})),Object.defineProperty(u,"endTime",n({},o,{get:function(){return i},set:function(E){if(typeof E!="number")throw new TypeError("End time must be set to a number.");i=E,this.hasBeenReset=!0}})),Object.defineProperty(u,"text",n({},o,{get:function(){return s},set:function(E){s=""+E,this.hasBeenReset=!0}})),Object.defineProperty(u,"region",n({},o,{get:function(){return S},set:function(E){S=E,this.hasBeenReset=!0}})),Object.defineProperty(u,"vertical",n({},o,{get:function(){return x},set:function(E){var _=H(E);if(_===!1)throw new SyntaxError("An invalid or illegal string was specified.");x=_,this.hasBeenReset=!0}})),Object.defineProperty(u,"snapToLines",n({},o,{get:function(){return T},set:function(E){T=!!E,this.hasBeenReset=!0}})),Object.defineProperty(u,"line",n({},o,{get:function(){return A},set:function(E){if(typeof E!="number"&&E!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");A=E,this.hasBeenReset=!0}})),Object.defineProperty(u,"lineAlign",n({},o,{get:function(){return w},set:function(E){var _=N(E);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");w=_,this.hasBeenReset=!0}})),Object.defineProperty(u,"position",n({},o,{get:function(){return v},set:function(E){if(E<0||E>100)throw new Error("Position must be between 0 and 100.");v=E,this.hasBeenReset=!0}})),Object.defineProperty(u,"positionAlign",n({},o,{get:function(){return b},set:function(E){var _=N(E);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");b=_,this.hasBeenReset=!0}})),Object.defineProperty(u,"size",n({},o,{get:function(){return g},set:function(E){if(E<0||E>100)throw new Error("Size must be between 0 and 100.");g=E,this.hasBeenReset=!0}})),Object.defineProperty(u,"align",n({},o,{get:function(){return f},set:function(E){var _=N(E);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");f=_,this.hasBeenReset=!0}})),u.displayState=void 0}return P.prototype.getCueAsHTML=function(){var p=self.WebVTT;return p.convertCueToDOMTree(self,this.text)},P}()},"./src/utils/vttparser.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"parseTimeStamp",function(){return I}),M.d(z,"fixLineBreaks",function(){return m}),M.d(z,"VTTParser",function(){return d});var X=M("./src/utils/vttcue.ts"),F=function(){function u(){}var o=u.prototype;return o.decode=function(r,a){if(!r)return"";if(typeof r!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(r))},u}();function I(u){function o(r,a,i,s){return(r|0)*3600+(a|0)*60+(i|0)+parseFloat(s||0)}var h=u.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return h?parseFloat(h[2])>59?o(h[2],h[3],0,h[4]):o(h[1],h[2],h[3],h[4]):null}var H=function(){function u(){this.values=Object.create(null)}var o=u.prototype;return o.set=function(r,a){!this.get(r)&&a!==""&&(this.values[r]=a)},o.get=function(r,a,i){return i?this.has(r)?this.values[r]:a[i]:this.has(r)?this.values[r]:a},o.has=function(r){return r in this.values},o.alt=function(r,a,i){for(var s=0;s<i.length;++s)if(a===i[s]){this.set(r,a);break}},o.integer=function(r,a){/^-?\d+$/.test(a)&&this.set(r,parseInt(a,10))},o.percent=function(r,a){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(a)){var i=parseFloat(a);if(i>=0&&i<=100)return this.set(r,i),!0}return!1},u}();function N(u,o,h,r){var a=r?u.split(r):[u];for(var i in a){if(typeof a[i]!="string")continue;var s=a[i].split(h);if(s.length!==2)continue;var S=s[0],x=s[1];o(S,x)}}var n=new X.default(0,0,""),P=n.align==="middle"?"middle":"center";function p(u,o,h){var r=u;function a(){var S=I(u);if(S===null)throw new Error("Malformed timestamp: "+r);return u=u.replace(/^[^\sa-zA-Z-]+/,""),S}function i(S,x){var T=new H;N(S,function(v,b){var g;switch(v){case"region":for(var f=h.length-1;f>=0;f--)if(h[f].id===b){T.set(v,h[f].region);break}break;case"vertical":T.alt(v,b,["rl","lr"]);break;case"line":g=b.split(","),T.integer(v,g[0]),T.percent(v,g[0])&&T.set("snapToLines",!1),T.alt(v,g[0],["auto"]),g.length===2&&T.alt("lineAlign",g[1],["start",P,"end"]);break;case"position":g=b.split(","),T.percent(v,g[0]),g.length===2&&T.alt("positionAlign",g[1],["start",P,"end","line-left","line-right","auto"]);break;case"size":T.percent(v,b);break;case"align":T.alt(v,b,["start",P,"end","left","right"]);break}},/:/,/\s/),x.region=T.get("region",null),x.vertical=T.get("vertical","");var A=T.get("line","auto");A==="auto"&&n.line===-1&&(A=-1),x.line=A,x.lineAlign=T.get("lineAlign","start"),x.snapToLines=T.get("snapToLines",!0),x.size=T.get("size",100),x.align=T.get("align",P);var w=T.get("position","auto");w==="auto"&&n.position===50&&(w=x.align==="start"||x.align==="left"?0:x.align==="end"||x.align==="right"?100:50),x.position=w}function s(){u=u.replace(/^\s+/,"")}if(s(),o.startTime=a(),s(),u.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+r);u=u.substr(3),s(),o.endTime=a(),s(),i(u,o)}function m(u){return u.replace(/<br(?: \/)?>/gi,`
|
|
`)}var d=function(){function u(){this.state="INITIAL",this.buffer="",this.decoder=new F,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var o=u.prototype;return o.parse=function(r){var a=this;r&&(a.buffer+=a.decoder.decode(r,{stream:!0}));function i(){var w=a.buffer,v=0;for(w=m(w);v<w.length&&w[v]!=="\r"&&w[v]!==`
|
|
`;)++v;var b=w.substr(0,v);return w[v]==="\r"&&++v,w[v]===`
|
|
`&&++v,a.buffer=w.substr(v),b}function s(w){N(w,function(v,b){},/:/)}try{var S="";if(a.state==="INITIAL"){if(!/\r\n|\n/.test(a.buffer))return this;S=i();var x=S.match(/^()?WEBVTT([ \t].*)?$/);if(!x||!x[0])throw new Error("Malformed WebVTT signature.");a.state="HEADER"}for(var T=!1;a.buffer;){if(!/\r\n|\n/.test(a.buffer))return this;T?T=!1:S=i();switch(a.state){case"HEADER":/:/.test(S)?s(S):S||(a.state="ID");continue;case"NOTE":S||(a.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(S)){a.state="NOTE";break}if(!S)continue;if(a.cue=new X.default(0,0,""),a.state="CUE",S.indexOf("-->")===-1){a.cue.id=S;continue}case"CUE":if(!a.cue){a.state="BADCUE";continue}try{p(S,a.cue,a.regionList)}catch(w){a.cue=null,a.state="BADCUE";continue}a.state="CUETEXT";continue;case"CUETEXT":{var A=S.indexOf("-->")!==-1;if(!S||A&&(T=!0)){a.oncue&&a.cue&&a.oncue(a.cue),a.cue=null,a.state="ID";continue}if(a.cue===null)continue;a.cue.text&&(a.cue.text+=`
|
|
`),a.cue.text+=S}continue;case"BADCUE":S||(a.state="ID")}}}catch(w){a.state==="CUETEXT"&&a.cue&&a.oncue&&a.oncue(a.cue),a.cue=null,a.state=a.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},o.flush=function(){var r=this;try{if((r.cue||r.state==="HEADER")&&(r.buffer+=`
|
|
|
|
`,r.parse()),r.state==="INITIAL"||r.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(a){r.onparsingerror&&r.onparsingerror(a)}return r.onflush&&r.onflush(),this},u}()},"./src/utils/webvtt-parser.ts":function(Q,z,M){"use strict";M.r(z),M.d(z,"generateCueId",function(){return d}),M.d(z,"parseWebVTT",function(){return o});var X=M("./src/polyfills/number.ts"),F=M("./src/utils/vttparser.ts"),I=M("./src/demux/id3.ts"),H=M("./src/utils/timescale-conversion.ts"),N=M("./src/remux/mp4-remuxer.ts"),n=/\r\n|\n\r|\n|\r/g,P=function(r,a,i){return i===void 0&&(i=0),r.substr(i,a.length)===a},p=function(r){var a=parseInt(r.substr(-3)),i=parseInt(r.substr(-6,2)),s=parseInt(r.substr(-9,2)),S=r.length>9?parseInt(r.substr(0,r.indexOf(":"))):0;if(!Object(X.isFiniteNumber)(a)||!Object(X.isFiniteNumber)(i)||!Object(X.isFiniteNumber)(s)||!Object(X.isFiniteNumber)(S))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+r);return a+=1e3*i,a+=60*1e3*s,a+=60*60*1e3*S,a},m=function(r){for(var a=5381,i=r.length;i;)a=a*33^r.charCodeAt(--i);return(a>>>0).toString()};function d(h,r,a){return m(h.toString())+m(r.toString())+m(a)}var u=function(r,a,i){var s=r[a],S=r[s.prevCC];if(!S||!S.new&&s.new){r.ccOffset=r.presentationOffset=s.start,s.new=!1;return}for(;(x=S)!==null&&x!==void 0&&x.new;){var x;r.ccOffset+=s.start-S.start,s.new=!1,s=S,S=r[s.prevCC]}r.presentationOffset=i};function o(h,r,a,i,s,S,x,T){var A=new F.VTTParser,w=Object(I.utf8ArrayToStr)(new Uint8Array(h)).trim().replace(n,`
|
|
`).split(`
|
|
`),v=[],b=Object(H.toMpegTsClockFromTimescale)(r,a),g="00:00.000",f=0,C=0,E,_=!0,U=!1;A.oncue=function(j){var L=i[s],G=i.ccOffset,B=(f-b)/9e4;if(L!=null&&L.new&&(C!==void 0?G=i.ccOffset=L.start:u(i,s,B)),B&&(G=B-i.presentationOffset),U){var O=j.endTime-j.startTime,V=Object(N.normalizePts)((j.startTime+G-C)*9e4,S*9e4)/9e4;j.startTime=V,j.endTime=V+O}var te=j.text.trim();j.text=decodeURIComponent(encodeURIComponent(te)),j.id||(j.id=d(j.startTime,j.endTime,te)),j.endTime>0&&v.push(j)},A.onparsingerror=function(j){E=j},A.onflush=function(){if(E){T(E);return}x(v)},w.forEach(function(j){if(_)if(P(j,"X-TIMESTAMP-MAP=")){_=!1,U=!0,j.substr(16).split(",").forEach(function(L){P(L,"LOCAL:")?g=L.substr(6):P(L,"MPEGTS:")&&(f=parseInt(L.substr(7)))});try{C=p(g)/1e3}catch(L){U=!1,E=L}return}else j===""&&(_=!1);A.parse(j+`
|
|
`)}),A.flush()}},"./src/utils/xhr-loader.ts":function(Q,z,M){"use strict";M.r(z);var X=M("./src/utils/logger.ts"),F=M("./src/loader/load-stats.ts"),I=/^age:\s*[\d.]+\s*$/m,H=function(){function N(P){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=P?P.xhrSetup:null,this.stats=new F.LoadStats,this.retryDelay=0}var n=N.prototype;return n.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},n.abortInternal=function(){var p=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),p&&(p.onreadystatechange=null,p.onprogress=null,p.readyState!==4&&(this.stats.aborted=!0,p.abort()))},n.abort=function(){var p;this.abortInternal(),(p=this.callbacks)!==null&&p!==void 0&&p.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},n.load=function(p,m,d){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=p,this.config=m,this.callbacks=d,this.retryDelay=m.retryDelay,this.loadInternal()},n.loadInternal=function(){var p=this.config,m=this.context;if(!p)return;var d=this.loader=new self.XMLHttpRequest,u=this.stats;u.loading.first=0,u.loaded=0;var o=this.xhrSetup;try{if(o)try{o(d,m.url)}catch(a){d.open("GET",m.url,!0),o(d,m.url)}d.readyState||d.open("GET",m.url,!0);var h=this.context.headers;if(h)for(var r in h)d.setRequestHeader(r,h[r])}catch(a){this.callbacks.onError({code:d.status,text:a.message},m,d);return}m.rangeEnd&&d.setRequestHeader("Range","bytes="+m.rangeStart+"-"+(m.rangeEnd-1)),d.onreadystatechange=this.readystatechange.bind(this),d.onprogress=this.loadprogress.bind(this),d.responseType=m.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),p.timeout),d.send()},n.readystatechange=function(){var p=this.context,m=this.loader,d=this.stats;if(!p||!m)return;var u=m.readyState,o=this.config;if(d.aborted)return;if(u>=2)if(self.clearTimeout(this.requestTimeout),d.loading.first===0&&(d.loading.first=Math.max(self.performance.now(),d.loading.start)),u===4){m.onreadystatechange=null,m.onprogress=null;var h=m.status;if(h>=200&&h<300){d.loading.end=Math.max(self.performance.now(),d.loading.first);var r,a;if(p.responseType==="arraybuffer"?(r=m.response,a=r.byteLength):(r=m.responseText,a=r.length),d.loaded=d.total=a,!this.callbacks)return;var i=this.callbacks.onProgress;if(i&&i(d,p,r,m),!this.callbacks)return;var s={url:m.responseURL,data:r};this.callbacks.onSuccess(s,d,p,m)}else d.retry>=o.maxRetry||h>=400&&h<499?(X.logger.error(h+" while loading "+p.url),this.callbacks.onError({code:h,text:m.statusText},p,m)):(X.logger.warn(h+" while loading "+p.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,o.maxRetryDelay),d.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout)},n.loadtimeout=function(){X.logger.warn("timeout while loading "+this.context.url);var p=this.callbacks;p&&(this.abortInternal(),p.onTimeout(this.stats,this.context,this.loader))},n.loadprogress=function(p){var m=this.stats;m.loaded=p.loaded,p.lengthComputable&&(m.total=p.total)},n.getCacheAge=function(){var p=null;if(this.loader&&I.test(this.loader.getAllResponseHeaders())){var m=this.loader.getResponseHeader("age");p=m?parseFloat(m):null}return p},N}();z.default=H}}).default})},vHTk:function(Be,le,D){Be.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vef1:function(Be,le,D){Be.exports={upload:"upload___3GNI5"}},wCXF:function(Be,le,D){"use strict";D.d(le,"a",function(){return at});var Q=D("rePB"),z=D("VTBJ"),M=D("KQm4"),X=D("U8pU"),F=D("ODXe"),I=D("q1tI"),H=D("TSYQ"),N=D.n(H),n=D("Gytx"),P=D.n(n),p=D("Kwbf"),m=D("t23M"),d=D("qx4F"),u=D("6eGT"),o=D("IBYe"),h=D("Ff2n"),r=D("c+Xe"),a=D("fyJ8"),i=D("biw7");function s(Ne,ke,it,ot,Ge){var $e=it[Ne]||{},we=it[ke]||{},Se,Ee;$e.fixed==="left"?Se=ot.left[Ne]:we.fixed==="right"&&(Ee=ot.right[ke]);var ue=!1,de=!1,ye=!1,me=!1,Le=it[ke+1],Xe=it[Ne-1];if(Ge==="rtl"){if(Se!==void 0){var ut=Xe&&Xe.fixed==="left";me=!ut}else if(Ee!==void 0){var Dt=Le&&Le.fixed==="right";ye=!Dt}}else if(Se!==void 0){var jt=Le&&Le.fixed==="left";ue=!jt}else if(Ee!==void 0){var Ut=Xe&&Xe.fixed==="right";de=!Ut}return{fixLeft:Se,fixRight:Ee,lastFixLeft:ue,firstFixRight:de,lastFixRight:ye,firstFixLeft:me,isSticky:ot.isSticky}}var S=D("sR1s");function x(Ne){var ke=Ne.cells,it=Ne.stickyOffsets,ot=Ne.flattenColumns,Ge=Ne.rowComponent,$e=Ne.cellComponent,we=Ne.onHeaderRow,Se=Ne.index,Ee=I.useContext(i.a),ue=Ee.prefixCls,de=Ee.direction,ye;we&&(ye=we(ke.map(function(Le){return Le.column}),Se));var me=Object(S.a)(ke.map(function(Le){return Le.column}));return I.createElement(Ge,Object.assign({},ye),ke.map(function(Le,Xe){var ut=Le.column,Dt=s(Le.colStart,Le.colEnd,ot,it,de),jt;return ut&&ut.onHeaderCell&&(jt=Le.column.onHeaderCell(ut)),I.createElement(a.a,Object.assign({},Le,{ellipsis:ut.ellipsis,align:ut.align,component:$e,prefixCls:ue,key:me[Xe]},Dt,{additionalProps:jt,rowType:"header"}))}))}x.displayName="HeaderRow";var T=x;function A(Ne){var ke=[];function it(we,Se){var Ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;ke[Ee]=ke[Ee]||[];var ue=Se,de=we.filter(Boolean).map(function(ye){var me={key:ye.key,className:ye.className||"",children:ye.title,column:ye,colStart:ue},Le=1,Xe=ye.children;return Xe&&Xe.length>0&&(Le=it(Xe,ue,Ee+1).reduce(function(ut,Dt){return ut+Dt},0),me.hasSubColumns=!0),"colSpan"in ye&&(Le=ye.colSpan),"rowSpan"in ye&&(me.rowSpan=ye.rowSpan),me.colSpan=Le,me.colEnd=me.colStart+Le-1,ke[Ee].push(me),ue+=Le,Le});return de}it(Ne,0);for(var ot=ke.length,Ge=function(Se){ke[Se].forEach(function(Ee){!("rowSpan"in Ee)&&!Ee.hasSubColumns&&(Ee.rowSpan=ot-Se)})},$e=0;$e<ot;$e+=1)Ge($e);return ke}function w(Ne){var ke=Ne.stickyOffsets,it=Ne.columns,ot=Ne.flattenColumns,Ge=Ne.onHeaderRow,$e=I.useContext(i.a),we=$e.prefixCls,Se=$e.getComponent,Ee=I.useMemo(function(){return A(it)},[it]),ue=Se(["header","wrapper"],"thead"),de=Se(["header","row"],"tr"),ye=Se(["header","cell"],"th");return I.createElement(ue,{className:"".concat(we,"-thead")},Ee.map(function(me,Le){var Xe=I.createElement(T,{key:Le,flattenColumns:ot,cells:me,stickyOffsets:ke,rowComponent:de,cellComponent:ye,onHeaderRow:Ge,index:Le});return Xe}))}var v=w,b=D("hW8S");function g(Ne){for(var ke=Ne.colWidths,it=Ne.columns,ot=Ne.columCount,Ge=[],$e=ot||it.length,we=!1,Se=$e-1;Se>=0;Se-=1){var Ee=ke[Se],ue=it&&it[Se],de=ue&&ue[b.a];(Ee||de||we)&&(Ge.unshift(I.createElement("col",Object.assign({key:Se,style:{width:Ee,minWidth:Ee}},de))),we=!0)}return I.createElement("colgroup",null,Ge)}var f=g;function C(Ne,ke){return Object(I.useMemo)(function(){for(var it=[],ot=0;ot<ke;ot+=1){var Ge=Ne[ot];if(Ge!==void 0)it[ot]=Ge;else return null}return it},[Ne.join("_"),ke])}var E=I.forwardRef(function(Ne,ke){var it=Ne.noData,ot=Ne.columns,Ge=Ne.flattenColumns,$e=Ne.colWidths,we=Ne.columCount,Se=Ne.stickyOffsets,Ee=Ne.direction,ue=Ne.fixHeader,de=Ne.offsetHeader,ye=Ne.stickyClassName,me=Ne.onScroll,Le=Object(h.a)(Ne,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),Xe=I.useContext(i.a),ut=Xe.prefixCls,Dt=Xe.scrollbarSize,jt=Xe.isSticky,Ut=jt&&!ue?0:Dt,Ct=I.useRef(null),et=I.useCallback(function(Pt){Object(r.b)(ke,Pt),Object(r.b)(Ct,Pt)},[]);I.useEffect(function(){var Pt;function Nt(Ke){var gt=Ke.currentTarget,bt=Ke.deltaX;bt&&(me({currentTarget:gt,scrollLeft:gt.scrollLeft+bt}),Ke.preventDefault())}return(Pt=Ct.current)===null||Pt===void 0||Pt.addEventListener("wheel",Nt),function(){var Ke;(Ke=Ct.current)===null||Ke===void 0||Ke.removeEventListener("wheel",Nt)}},[]);var st=Ge[Ge.length-1],He={fixed:st?st.fixed:null,onHeaderCell:function(){return{className:"".concat(ut,"-cell-scrollbar")}}},pe=Object(I.useMemo)(function(){return Ut?[].concat(Object(M.a)(ot),[He]):ot},[Ut,ot]),Re=Object(I.useMemo)(function(){return Ut?[].concat(Object(M.a)(Ge),[He]):Ge},[Ut,Ge]),lt=Object(I.useMemo)(function(){var Pt=Se.right,Nt=Se.left;return Object(z.a)(Object(z.a)({},Se),{},{left:Ee==="rtl"?[].concat(Object(M.a)(Nt.map(function(Ke){return Ke+Ut})),[0]):Nt,right:Ee==="rtl"?Pt:[].concat(Object(M.a)(Pt.map(function(Ke){return Ke+Ut})),[0]),isSticky:jt})},[Ut,Se,jt]),Ye=C($e,we);return I.createElement("div",{style:Object(z.a)({overflow:"hidden"},jt?{top:de}:{}),ref:et,className:N()("".concat(ut,"-header"),Object(Q.a)({},ye,!!ye))},I.createElement("table",{style:{tableLayout:"fixed",visibility:it||Ye?null:"hidden"}},I.createElement(f,{colWidths:Ye?[].concat(Object(M.a)(Ye),[Ut]):[],columCount:we+1,columns:Re}),I.createElement(v,Object.assign({},Le,{stickyOffsets:lt,columns:pe,flattenColumns:Re}))))});E.displayName="FixedHeader";var _=E,U=I.createContext(null),j=U;function L(Ne){var ke=Ne.prefixCls,it=Ne.children,ot=Ne.component,Ge=Ne.cellComponent,$e=Ne.fixHeader,we=Ne.fixColumn,Se=Ne.horizonScroll,Ee=Ne.className,ue=Ne.expanded,de=Ne.componentWidth,ye=Ne.colSpan,me=I.useContext(i.a),Le=me.scrollbarSize;return I.useMemo(function(){var Xe=it;return we&&(Xe=I.createElement("div",{style:{width:de-($e?Le:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(ke,"-expanded-row-fixed")},Xe)),I.createElement(ot,{className:Ee,style:{display:ue?null:"none"}},I.createElement(a.a,{component:Ge,prefixCls:ke,colSpan:ye},Xe))},[it,ot,$e,Se,Ee,ue,de,ye,Le])}var G=L;function B(Ne){var ke=Ne.className,it=Ne.style,ot=Ne.record,Ge=Ne.index,$e=Ne.rowKey,we=Ne.getRowKey,Se=Ne.rowExpandable,Ee=Ne.expandedKeys,ue=Ne.onRow,de=Ne.indent,ye=de===void 0?0:de,me=Ne.rowComponent,Le=Ne.cellComponent,Xe=Ne.childrenColumnName,ut=I.useContext(i.a),Dt=ut.prefixCls,jt=ut.fixedInfoList,Ut=I.useContext(j),Ct=Ut.fixHeader,et=Ut.fixColumn,st=Ut.horizonScroll,He=Ut.componentWidth,pe=Ut.flattenColumns,Re=Ut.expandableType,lt=Ut.expandRowByClick,Ye=Ut.onTriggerExpand,Pt=Ut.rowClassName,Nt=Ut.expandedRowClassName,Ke=Ut.indentSize,gt=Ut.expandIcon,bt=Ut.expandedRowRender,Tt=Ut.expandIconColumnIndex,Wt=I.useState(!1),fe=Object(F.a)(Wt,2),se=fe[0],W=fe[1],$=Ee&&Ee.has(Ne.recordKey);I.useEffect(function(){$&&W(!0)},[$]);var Z=Re==="row"&&(!Se||Se(ot)),ne=Re==="nest",he=Xe&&ot&&ot[Xe],Pe=Z||ne,ze;ue&&(ze=ue(ot,Ge));var Rt=function(R){if(lt&&Pe&&Ye(ot,R),ze&&ze.onClick){for(var k,Y=arguments.length,ae=new Array(Y>1?Y-1:0),q=1;q<Y;q++)ae[q-1]=arguments[q];(k=ze).onClick.apply(k,[R].concat(ae))}},Mt;typeof Pt=="string"?Mt=Pt:typeof Pt=="function"&&(Mt=Pt(ot,Ge,ye));var Ze=Object(S.a)(pe),kt=I.createElement(me,Object.assign({},ze,{"data-row-key":$e,className:N()(ke,"".concat(Dt,"-row"),"".concat(Dt,"-row-level-").concat(ye),Mt,ze&&ze.className),style:Object(z.a)(Object(z.a)({},it),ze?ze.style:null),onClick:Rt}),pe.map(function(J,R){var k=J.render,Y=J.dataIndex,ae=J.className,q=Ze[R],Ie=jt[R],ht;R===(Tt||0)&&ne&&(ht=I.createElement(I.Fragment,null,I.createElement("span",{style:{paddingLeft:"".concat(Ke*ye,"px")},className:"".concat(Dt,"-row-indent indent-level-").concat(ye)}),gt({prefixCls:Dt,expanded:$,expandable:he,record:ot,onExpand:Ye})));var Ot;return J.onCell&&(Ot=J.onCell(ot,Ge)),I.createElement(a.a,Object.assign({className:ae,ellipsis:J.ellipsis,align:J.align,component:Le,prefixCls:Dt,key:q,record:ot,index:Ge,dataIndex:Y,render:k,shouldCellUpdate:J.shouldCellUpdate},Ie,{appendNode:ht,additionalProps:Ot}))})),an;if(Z&&(se||$)){var At=bt(ot,Ge,ye+1,$),pn=Nt&&Nt(ot,Ge,ye);an=I.createElement(G,{expanded:$,className:N()("".concat(Dt,"-expanded-row"),"".concat(Dt,"-expanded-row-level-").concat(ye+1),pn),prefixCls:Dt,fixHeader:Ct,fixColumn:et,horizonScroll:st,component:me,componentWidth:He,cellComponent:Le,colSpan:pe.length},At)}var nn;return he&&$&&(nn=(ot[Xe]||[]).map(function(J,R){var k=we(J,R);return I.createElement(B,Object.assign({},Ne,{key:k,rowKey:k,record:J,recordKey:k,index:R,indent:ye+1}))})),I.createElement(I.Fragment,null,kt,an,nn)}B.displayName="BodyRow";var O=B,V=I.createContext(null),te=V;function re(Ne){var ke=Ne.columnKey,it=Ne.onColumnResize,ot=I.useRef();return I.useEffect(function(){ot.current&&it(ke,ot.current.offsetWidth)},[]),I.createElement(m.a,{onResize:function($e){var we=$e.offsetWidth;it(ke,we)}},I.createElement("td",{ref:ot,style:{padding:0,border:0,height:0}},I.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function ge(Ne){var ke=Ne.data,it=Ne.getRowKey,ot=Ne.measureColumnWidth,Ge=Ne.expandedKeys,$e=Ne.onRow,we=Ne.rowExpandable,Se=Ne.emptyNode,Ee=Ne.childrenColumnName,ue=I.useContext(te),de=ue.onColumnResize,ye=I.useContext(i.a),me=ye.prefixCls,Le=ye.getComponent,Xe=I.useContext(j),ut=Xe.fixHeader,Dt=Xe.horizonScroll,jt=Xe.flattenColumns,Ut=Xe.componentWidth;return I.useMemo(function(){var Ct=Le(["body","wrapper"],"tbody"),et=Le(["body","row"],"tr"),st=Le(["body","cell"],"td"),He;ke.length?He=ke.map(function(Re,lt){var Ye=it(Re,lt);return I.createElement(O,{key:Ye,rowKey:Ye,record:Re,recordKey:Ye,index:lt,rowComponent:et,cellComponent:st,expandedKeys:Ge,onRow:$e,getRowKey:it,rowExpandable:we,childrenColumnName:Ee})}):He=I.createElement(G,{expanded:!0,className:"".concat(me,"-placeholder"),prefixCls:me,fixHeader:ut,fixColumn:Dt,horizonScroll:Dt,component:et,componentWidth:Ut,cellComponent:st,colSpan:jt.length},Se);var pe=Object(S.a)(jt);return I.createElement(Ct,{className:"".concat(me,"-tbody")},ot&&I.createElement("tr",{"aria-hidden":"true",className:"".concat(me,"-measure-row"),style:{height:0}},pe.map(function(Re){return I.createElement(re,{key:Re,columnKey:Re,onColumnResize:de})})),He)},[ke,me,$e,ot,Ge,it,Le,Ut,Se,jt])}var Ae=I.memo(ge);Ae.displayName="Body";var Oe=Ae,Ce=D("wRmb"),je=D("xEkU"),Ue=D.n(je);function xe(Ne){var ke=Object(I.useRef)(Ne),it=Object(I.useState)({}),ot=Object(F.a)(it,2),Ge=ot[1],$e=Object(I.useRef)(null),we=Object(I.useRef)([]);function Se(Ee){$e.current===null&&(we.current=[],$e.current=Ue()(function(){we.current.forEach(function(ue){ke.current=ue(ke.current)}),$e.current=null,Ge({})})),we.current.push(Ee)}return Object(I.useEffect)(function(){return function(){Ue.a.cancel($e.current)}},[]),[ke.current,Se]}function be(Ne){var ke=Object(I.useRef)(Ne),it=Object(I.useRef)(null);function ot(){window.clearTimeout(it.current)}function Ge(we){ke.current=we,ot(),it.current=window.setTimeout(function(){ke.current=null,it.current=null},100)}function $e(){return ke.current}return Object(I.useEffect)(function(){return ot},[]),[Ge,$e]}function Ve(Ne,ke,it){var ot=Object(I.useMemo)(function(){for(var Ge=[],$e=[],we=0,Se=0,Ee=0;Ee<ke;Ee+=1)if(it==="rtl"){$e[Ee]=Se,Se+=Ne[Ee]||0;var ue=ke-Ee-1;Ge[ue]=we,we+=Ne[ue]||0}else{Ge[Ee]=we,we+=Ne[Ee]||0;var de=ke-Ee-1;$e[de]=Se,Se+=Ne[de]||0}return{left:Ge,right:$e}},[Ne,ke,it]);return ot}var mt=Ve;function yt(Ne){var ke=Ne.className,it=Ne.children;return I.createElement("div",{className:ke},it)}var _t=yt,xt=D("n6Qo");function nt(Ne){var ke,it=Ne.prefixCls,ot=Ne.record,Ge=Ne.onExpand,$e=Ne.expanded,we=Ne.expandable,Se="".concat(it,"-row-expand-icon");if(!we)return I.createElement("span",{className:N()(Se,"".concat(it,"-row-spaced"))});var Ee=function(de){Ge(ot,de),de.stopPropagation()};return I.createElement("span",{className:N()(Se,(ke={},Object(Q.a)(ke,"".concat(it,"-row-expanded"),$e),Object(Q.a)(ke,"".concat(it,"-row-collapsed"),!$e),ke)),onClick:Ee})}function ct(Ne,ke,it){var ot=[];function Ge($e){($e||[]).forEach(function(we,Se){ot.push(ke(we,Se)),Ge(we[it])})}return Ge(Ne),ot}var wt=D("zT1h"),_e=D("y0+3"),Me=function(ke,it){var ot,Ge,$e=ke.scrollBodyRef,we=ke.onScroll,Se=ke.offsetScroll,Ee=I.useContext(i.a),ue=Ee.prefixCls,de=((ot=$e.current)===null||ot===void 0?void 0:ot.scrollWidth)||0,ye=((Ge=$e.current)===null||Ge===void 0?void 0:Ge.clientWidth)||0,me=de&&ye*(ye/de),Le=I.useRef(),Xe=xe({scrollLeft:0,isHiddenScrollBar:!1}),ut=Object(F.a)(Xe,2),Dt=ut[0],jt=ut[1],Ut=I.useRef({delta:0,x:0}),Ct=I.useState(!1),et=Object(F.a)(Ct,2),st=et[0],He=et[1],pe=function(){He(!1)},Re=function(Ke){Ke.persist(),Ut.current.delta=Ke.pageX-Dt.scrollLeft,Ut.current.x=0,He(!0),Ke.preventDefault()},lt=function(Ke){var gt,bt=Ke||((gt=window)===null||gt===void 0?void 0:gt.event),Tt=bt.buttons;if(!st||Tt===0){st&&He(!1);return}var Wt=Ut.current.x+Ke.pageX-Ut.current.x-Ut.current.delta;Wt<=0&&(Wt=0),Wt+me>=ye&&(Wt=ye-me),we({scrollLeft:Wt/ye*(de+2)}),Ut.current.x=Ke.pageX},Ye=function(){var Ke=Object(_e.b)($e.current).top,gt=Ke+$e.current.offsetHeight,bt=document.documentElement.scrollTop+window.innerHeight;gt-Object(d.a)()<=bt||Ke>=bt-Se?jt(function(Tt){return Object(z.a)(Object(z.a)({},Tt),{},{isHiddenScrollBar:!0})}):jt(function(Tt){return Object(z.a)(Object(z.a)({},Tt),{},{isHiddenScrollBar:!1})})},Pt=function(Ke){jt(function(gt){return Object(z.a)(Object(z.a)({},gt),{},{scrollLeft:Ke/de*ye||0})})};return I.useImperativeHandle(it,function(){return{setScrollLeft:Pt}}),I.useEffect(function(){var Nt=Object(wt.a)(document.body,"mouseup",pe,!1),Ke=Object(wt.a)(document.body,"mousemove",lt,!1);return Ye(),function(){Nt.remove(),Ke.remove()}},[me,st]),I.useEffect(function(){var Nt=Object(wt.a)(window,"scroll",Ye,!1),Ke=Object(wt.a)(window,"resize",Ye,!1);return function(){Nt.remove(),Ke.remove()}},[]),I.useEffect(function(){Dt.isHiddenScrollBar||jt(function(Nt){var Ke,gt;return Object(z.a)(Object(z.a)({},Nt),{},{scrollLeft:$e.current.scrollLeft/((Ke=$e.current)===null||Ke===void 0?void 0:Ke.scrollWidth)*((gt=$e.current)===null||gt===void 0?void 0:gt.clientWidth)})})},[Dt.isHiddenScrollBar]),de<=ye||!me||Dt.isHiddenScrollBar?null:I.createElement("div",{style:{height:Object(d.a)(),width:ye,bottom:Se},className:"".concat(ue,"-sticky-scroll")},I.createElement("div",{onMouseDown:Re,ref:Le,className:N()("".concat(ue,"-sticky-scroll-bar"),Object(Q.a)({},"".concat(ue,"-sticky-scroll-bar-active"),st)),style:{width:"".concat(me,"px"),transform:"translate3d(".concat(Dt.scrollLeft,"px, 0, 0)")}}))},ve=I.forwardRef(Me);function Te(Ne,ke){return I.useMemo(function(){var it=!!Ne;return{isSticky:it,stickyClassName:it?"".concat(ke,"-sticky-header"):"",offsetHeader:Object(X.a)(Ne)==="object"&&Ne.offsetHeader||0,offsetScroll:Object(X.a)(Ne)==="object"&&Ne.offsetScroll||0}},[Ne,ke])}var We=[],Je={},at="rc-table-internal-hook",dt=I.memo(function(Ne){var ke=Ne.children;return ke},function(Ne,ke){return P()(Ne.props,ke.props)?Ne.pingLeft!==ke.pingLeft||Ne.pingRight!==ke.pingRight:!1});function Lt(Ne){var ke,it=Ne.prefixCls,ot=Ne.className,Ge=Ne.rowClassName,$e=Ne.style,we=Ne.data,Se=Ne.rowKey,Ee=Ne.scroll,ue=Ne.tableLayout,de=Ne.direction,ye=Ne.title,me=Ne.footer,Le=Ne.summary,Xe=Ne.id,ut=Ne.showHeader,Dt=Ne.components,jt=Ne.emptyText,Ut=Ne.onRow,Ct=Ne.onHeaderRow,et=Ne.internalHooks,st=Ne.transformColumns,He=Ne.internalRefs,pe=Ne.sticky,Re=we||We,lt=!!Re.length,Ye=I.useState(0),Pt=Object(F.a)(Ye,2),Nt=Pt[0],Ke=Pt[1];I.useEffect(function(){Ke(Object(d.a)())});var gt=I.useMemo(function(){return Object(S.c)(Dt,{})},[Dt]),bt=I.useCallback(function(tn,Yt){return Object(S.b)(gt,tn)||Yt},[gt]),Tt=I.useMemo(function(){return typeof Se=="function"?Se:function(tn){var Yt=tn&&tn[Se];return Yt}},[Se]),Wt=Object(b.c)(Ne),fe=Wt.expandIcon,se=Wt.expandedRowKeys,W=Wt.defaultExpandedRowKeys,$=Wt.defaultExpandAllRows,Z=Wt.expandedRowRender,ne=Wt.onExpand,he=Wt.onExpandedRowsChange,Pe=Wt.expandRowByClick,ze=Wt.rowExpandable,Rt=Wt.expandIconColumnIndex,Mt=Wt.expandedRowClassName,Ze=Wt.childrenColumnName,kt=Wt.indentSize,an=fe||nt,At=Ze||"children",pn=I.useMemo(function(){return Z?"row":Ne.expandable&&et===at&&Ne.expandable.__PARENT_RENDER_ICON__||Re.some(function(tn){return tn&&Object(X.a)(tn)==="object"&&tn[At]})?"nest":!1},[!!Z,Re]),nn=I.useState(function(){return W||($?ct(Re,Tt,At):[])}),J=Object(F.a)(nn,2),R=J[0],k=J[1],Y=I.useMemo(function(){return new Set(se||R||[])},[se,R]),ae=I.useCallback(function(tn){var Yt=Tt(tn,Re.indexOf(tn)),rt,Et=Y.has(Yt);Et?(Y.delete(Yt),rt=Object(M.a)(Y)):rt=[].concat(Object(M.a)(Y),[Yt]),k(rt),ne&&ne(!Et,tn),he&&he(rt)},[Tt,Y,Re,ne,he]),q=I.useState(0),Ie=Object(F.a)(q,2),ht=Ie[0],Ot=Ie[1],$t=Object(Ce.b)(Object(z.a)(Object(z.a)(Object(z.a)({},Ne),Wt),{},{expandable:!!Z,expandedKeys:Y,getRowKey:Tt,onTriggerExpand:ae,expandIcon:an,expandIconColumnIndex:Rt,direction:de}),et===at?st:null),ft=Object(F.a)($t,2),zt=ft[0],on=ft[1],Wn=I.useMemo(function(){return{columns:zt,flattenColumns:on}},[zt,on]),Si=I.useRef(),hi=I.useRef(),Fn=I.useRef(),ci=I.useState(!1),Zi=Object(F.a)(ci,2),yi=Zi[0],ri=Zi[1],Ci=I.useState(!1),Di=Object(F.a)(Ci,2),Oi=Di[0],Ri=Di[1],Vi=xe(new Map),dr=Object(F.a)(Vi,2),rr=dr[0],ji=dr[1],Wi=Object(S.a)(on),hr=Wi.map(function(tn){return rr.get(tn)}),Tr=I.useMemo(function(){return hr},[hr.join("_")]),ar=mt(Tr,on.length,de),Hn=Ee&&Object(S.d)(Ee.y),wn=Ee&&Object(S.d)(Ee.x),_i=wn&&on.some(function(tn){var Yt=tn.fixed;return Yt}),Nn=I.useRef(),Ti=Te(pe,it),ii=Ti.isSticky,wr=Ti.offsetHeader,Ni=Ti.offsetScroll,Xi=Ti.stickyClassName,lr,gr,Hr;Hn&&(gr={overflowY:"scroll",maxHeight:Ee.y}),wn&&(lr={overflowX:"auto"},Hn||(gr={overflowY:"hidden"}),Hr={width:Ee.x===!0?"auto":Ee.x,minWidth:"100%"});var kr=I.useCallback(function(tn,Yt){ji(function(rt){var Et=new Map(rt);return Et.set(tn,Yt),Et})},[]),Cr=be(null),Xr=Object(F.a)(Cr,2),vr=Xr[0],Yr=Xr[1];function $r(tn,Yt){if(!Yt)return;typeof Yt=="function"?Yt(tn):Yt.scrollLeft!==tn&&(Yt.scrollLeft=tn)}var fr=function(Yt){var rt=Yt.currentTarget,Et=Yt.scrollLeft,dn=typeof Et=="number"?Et:rt.scrollLeft,pt=rt||Je;if(!Yr()||Yr()===pt){var hn;vr(pt),$r(dn,hi.current),$r(dn,Fn.current),$r(dn,(hn=Nn.current)===null||hn===void 0?void 0:hn.setScrollLeft)}if(rt){var Bt=rt.scrollWidth,vn=rt.clientWidth;ri(dn>0),Ri(dn<Bt-vn)}},Qr=function(){Fn.current&&fr({currentTarget:Fn.current})},mn=function(Yt){var rt=Yt.width;Qr(),Ot(Si.current?Si.current.offsetWidth:rt)};I.useEffect(function(){return Qr},[]),I.useEffect(function(){wn&&Qr()},[wn]),I.useEffect(function(){et===at&&He&&(He.body.current=Fn.current)});var On=bt(["table"],"table"),yn=I.useMemo(function(){return ue||(_i?Ee.x==="max-content"?"auto":"fixed":Hn||on.some(function(tn){var Yt=tn.ellipsis;return Yt})?"fixed":"auto")},[Hn,_i,on,ue]),jn,Qn={colWidths:Tr,columCount:on.length,stickyOffsets:ar,onHeaderRow:Ct,fixHeader:Hn},un=I.useMemo(function(){return lt?null:typeof jt=="function"?jt():jt},[lt,jt]),Bn=I.createElement(Oe,{data:Re,measureColumnWidth:Hn||wn||ii,expandedKeys:Y,rowExpandable:ze,getRowKey:Tt,onRow:Ut,emptyNode:un,childrenColumnName:At}),Ai=I.createElement(f,{colWidths:on.map(function(tn){var Yt=tn.width;return Yt}),columns:on}),Yi=Le&&I.createElement(xt.b,null,Le(Re)),Xn=bt(["body"]);if(Hn||ii){var yr;typeof Xn=="function"?(yr=Xn(Re,{scrollbarSize:Nt,ref:Fn,onScroll:fr}),Qn.colWidths=on.map(function(tn,Yt){var rt=tn.width,Et=Yt===zt.length-1?rt-Nt:rt;return typeof Et=="number"&&!Number.isNaN(Et)?Et:(Object(p.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):yr=I.createElement("div",{style:Object(z.a)(Object(z.a)({},lr),gr),onScroll:fr,ref:Fn,className:N()("".concat(it,"-body"))},I.createElement(On,{style:Object(z.a)(Object(z.a)({},Hr),{},{tableLayout:yn})},Ai,Bn,Yi),ii&&I.createElement(ve,{ref:Nn,offsetScroll:Ni,scrollBodyRef:Fn,onScroll:fr})),jn=I.createElement(I.Fragment,null,ut!==!1&&I.createElement(_,Object.assign({noData:!Re.length},Qn,Wn,{direction:de,offsetHeader:wr,stickyClassName:Xi,ref:hi,onScroll:fr})),yr)}else jn=I.createElement("div",{style:Object(z.a)(Object(z.a)({},lr),gr),className:N()("".concat(it,"-content")),onScroll:fr,ref:Fn},I.createElement(On,{style:Object(z.a)(Object(z.a)({},Hr),{},{tableLayout:yn})},Ai,ut!==!1&&I.createElement(v,Object.assign({},Qn,Wn)),Bn,Yi));var si=Object(b.b)(Ne),qe=I.createElement("div",Object.assign({className:N()(it,ot,(ke={},Object(Q.a)(ke,"".concat(it,"-rtl"),de==="rtl"),Object(Q.a)(ke,"".concat(it,"-ping-left"),yi),Object(Q.a)(ke,"".concat(it,"-ping-right"),Oi),Object(Q.a)(ke,"".concat(it,"-layout-fixed"),ue==="fixed"),Object(Q.a)(ke,"".concat(it,"-fixed-header"),Hn),Object(Q.a)(ke,"".concat(it,"-fixed-column"),_i),Object(Q.a)(ke,"".concat(it,"-scroll-horizontal"),wn),Object(Q.a)(ke,"".concat(it,"-has-fix-left"),on[0]&&on[0].fixed),Object(Q.a)(ke,"".concat(it,"-has-fix-right"),on[on.length-1]&&on[on.length-1].fixed==="right"),ke)),style:$e,id:Xe,ref:Si},si),I.createElement(dt,{pingLeft:yi,pingRight:Oi,props:Object(z.a)(Object(z.a)({},Ne),{},{stickyOffsets:ar,mergedExpandedKeys:Y})},ye&&I.createElement(_t,{className:"".concat(it,"-title")},ye(Re)),I.createElement("div",{className:"".concat(it,"-container")},jn),me&&I.createElement(_t,{className:"".concat(it,"-footer")},me(Re))));wn&&(qe=I.createElement(m.a,{onResize:mn},qe));var vt=I.useMemo(function(){return{prefixCls:it,getComponent:bt,scrollbarSize:Nt,direction:de,fixedInfoList:on.map(function(tn,Yt){return s(Yt,Yt,on,ar,de)}),isSticky:ii}},[it,bt,Nt,de,on,ar,de,ii]),Gt=I.useMemo(function(){return Object(z.a)(Object(z.a)({},Wn),{},{tableLayout:yn,rowClassName:Ge,expandedRowClassName:Mt,componentWidth:ht,fixHeader:Hn,fixColumn:_i,horizonScroll:wn,expandIcon:an,expandableType:pn,expandRowByClick:Pe,expandedRowRender:Z,onTriggerExpand:ae,expandIconColumnIndex:Rt,indentSize:kt})},[Wn,yn,Ge,Mt,ht,Hn,_i,wn,an,pn,Pe,Z,ae,Rt,kt]),fn=I.useMemo(function(){return{onColumnResize:kr}},[kr]);return I.createElement(i.a.Provider,{value:vt},I.createElement(j.Provider,{value:Gt},I.createElement(te.Provider,{value:fn},qe)))}Lt.Column=o.a,Lt.ColumnGroup=u.a,Lt.Summary=xt.a,Lt.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var It=le.b=Lt},wRmb:function(Be,le,D){"use strict";D.d(le,"a",function(){return P});var Q=D("rePB"),z=D("KQm4"),M=D("VTBJ"),X=D("Ff2n"),F=D("q1tI"),I=D.n(F),H=D("Kwbf"),N=D("Zm9Q"),n=D("hW8S");function P(o){return Object(N.a)(o).filter(function(h){return F.isValidElement(h)}).map(function(h){var r=h.key,a=h.props,i=a.children,s=Object(X.a)(a,["children"]),S=Object(M.a)({key:r},s);return i&&(S.children=P(i)),S})}function p(o){return o.reduce(function(h,r){var a=r.fixed,i=a===!0?"left":a,s=r.children;return s&&s.length>0?[].concat(Object(z.a)(h),Object(z.a)(p(s).map(function(S){return Object(M.a)({fixed:i},S)}))):[].concat(Object(z.a)(h),[Object(M.a)(Object(M.a)({},r),{},{fixed:i})])},[])}function m(o){for(var h=!0,r=0;r<o.length;r+=1){var a=o[r];if(h&&a.fixed!=="left")h=!1;else if(!h&&a.fixed==="left"){Object(H.a)(!1,"Index ".concat(r-1," of `columns` missing `fixed='left'` prop."));break}}for(var i=!0,s=o.length-1;s>=0;s-=1){var S=o[s];if(i&&S.fixed!=="right")i=!1;else if(!i&&S.fixed==="right"){Object(H.a)(!1,"Index ".concat(s+1," of `columns` missing `fixed='right'` prop."));break}}}function d(o){return o.map(function(h){var r=h.fixed,a=Object(X.a)(h,["fixed"]),i=r;return r==="left"?i="right":r==="right"&&(i="left"),Object(M.a)({fixed:i},a)})}function u(o,h){var r=o.prefixCls,a=o.columns,i=o.children,s=o.expandable,S=o.expandedKeys,x=o.getRowKey,T=o.onTriggerExpand,A=o.expandIcon,w=o.rowExpandable,v=o.expandIconColumnIndex,b=o.direction,g=o.expandRowByClick,f=F.useMemo(function(){return a||P(i)},[a,i]),C=F.useMemo(function(){if(s){var U,j=v||0,L=f[j],G=(U={},Object(Q.a)(U,n.a,{className:"".concat(r,"-expand-icon-col")}),Object(Q.a)(U,"title",""),Object(Q.a)(U,"fixed",L?L.fixed:null),Object(Q.a)(U,"className","".concat(r,"-row-expand-icon-cell")),Object(Q.a)(U,"render",function(V,te,re){var ge=x(te,re),Ae=S.has(ge),Oe=w?w(te):!0,Ce=A({prefixCls:r,expanded:Ae,expandable:Oe,record:te,onExpand:T});return g?F.createElement("span",{onClick:function(Ue){return Ue.stopPropagation()}},Ce):Ce}),U),B=f.slice();return j>=0&&B.splice(j,0,G),B}return f},[s,f,x,S,A,b]),E=F.useMemo(function(){var U=C;return h&&(U=h(U)),U.length||(U=[{render:function(){return null}}]),U},[h,C,b]),_=F.useMemo(function(){return b==="rtl"?d(p(E)):p(E)},[E,b]);return[E,_]}le.b=u},wW8i:function(Be,le,D){Be.exports={flex_box_center:"flex_box_center___3xqQI",flex_space_between:"flex_space_between___1fvHN",flex_box_vertical_center:"flex_box_vertical_center___1Gb4J",flex_box_center_end:"flex_box_center_end___8RbQi",flex_box_column:"flex_box_column___3xL78",discuss:"discuss___ybobd",reply:"reply___3EgHc",pagination:"pagination___2EiMG"}},"y0+3":function(Be,le,D){"use strict";D.d(le,"a",function(){return p}),D.d(le,"b",function(){return d});var Q=/margin|padding|width|height|max|min|offset/,z={left:!0,top:!0},M={cssFloat:1,styleFloat:1,float:1};function X(u){return u.nodeType===1?u.ownerDocument.defaultView.getComputedStyle(u,null):{}}function F(u,o,h){if(o=o.toLowerCase(),h==="auto"){if(o==="height")return u.offsetHeight;if(o==="width")return u.offsetWidth}return o in z||(z[o]=Q.test(o)),z[o]?parseFloat(h)||0:h}function I(u,o){var h=arguments.length,r=X(u);return o=M[o]?"cssFloat"in u.style?"cssFloat":"styleFloat":o,h===1?r:F(u,o,r[o]||u.style[o])}function H(u,o,h){var r=arguments.length;if(o=M[o]?"cssFloat"in u.style?"cssFloat":"styleFloat":o,r===3)return typeof h=="number"&&Q.test(o)&&(h="".concat(h,"px")),u.style[o]=h,h;for(var a in o)o.hasOwnProperty(a)&&H(u,a,o[a]);return X(u)}function N(u){return u===document.body?document.documentElement.clientWidth:u.offsetWidth}function n(u){return u===document.body?window.innerHeight||document.documentElement.clientHeight:u.offsetHeight}function P(){var u=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),o=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:u,height:o}}function p(){var u=document.documentElement.clientWidth,o=window.innerHeight||document.documentElement.clientHeight;return{width:u,height:o}}function m(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function d(u){var o=u.getBoundingClientRect(),h=document.documentElement;return{left:o.left+(window.pageXOffset||h.scrollLeft)-(h.clientLeft||document.body.clientLeft||0),top:o.top+(window.pageYOffset||h.scrollTop)-(h.clientTop||document.body.clientTop||0)}}},ynwM:function(Be,le,D){var Q=D("MFOe"),z=Q.Global;Be.exports={name:"oldFF-globalStorage",read:X,write:F,each:I,remove:H,clearAll:N};var M=z.globalStorage;function X(n){return M[n]}function F(n,P){M[n]=P}function I(n){for(var P=M.length-1;P>=0;P--){var p=M.key(P);n(M[p],p)}}function H(n){return M.removeItem(n)}function N(){I(function(n,P){delete M[n]})}}}]);
|