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

491 lines
1.6 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[213,4,5,6,7,8],{"++UQ":function(We,ce,M){},"+E2i":function(We,ce,M){"use strict";M.d(ce,"a",function(){return ae}),M.d(ce,"b",function(){return z});var q=M("6ASS"),ue=M("fNpE"),re=M("B/uU"),fe=["expandable"],ae="RC_TABLE_INTERNAL_COL_DEFINE";function z(R){var B=R.expandable,n=Object(ue.a)(R,fe),W;return"expandable"in R?W=Object(q.a)(Object(q.a)({},n),B):W=n,W.showExpandColumn===!1&&(W.expandIconColumnIndex=-1),W}},"+NIl":function(We,ce,M){(function(q){q(M("VrN/"))})(function(q){"use strict";q.defineMode("stex",function(ue,re){"use strict";function fe(m,s){m.cmdState.push(s)}function ae(m){return m.cmdState.length>0?m.cmdState[m.cmdState.length-1]:null}function z(m){var s=m.cmdState.pop();s&&s.closeBracket()}function R(m){for(var s=m.cmdState,g=s.length-1;g>=0;g--){var h=s[g];if(h.name=="DEFAULT")continue;return h}return{styleIdentifier:function(){return null}}}function B(m,s,g){return function(){this.name=m,this.bracketNo=0,this.style=s,this.styles=g,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=B("importmodule","tag",["string","builtin"]),n.documentclass=B("documentclass","tag",["","atom"]),n.usepackage=B("usepackage","tag",["atom"]),n.begin=B("begin","tag",["atom"]),n.end=B("end","tag",["atom"]),n.label=B("label","tag",["atom"]),n.ref=B("ref","tag",["atom"]),n.eqref=B("eqref","tag",["atom"]),n.cite=B("cite","tag",["atom"]),n.bibitem=B("bibitem","tag",["atom"]),n.Bibitem=B("Bibitem","tag",["atom"]),n.RBibitem=B("RBibitem","tag",["atom"]),n.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function W(m,s){m.f=s}function D(m,s){var g;if(m.match(/^\\[a-zA-Z@]+/)){var h=m.current().slice(1);return g=n.hasOwnProperty(h)?n[h]:n.DEFAULT,g=new g,fe(s,g),W(s,d),g.style}if(m.match(/^\\[$&%#{}_]/))return"tag";if(m.match(/^\\[,;!\/\\]/))return"tag";if(m.match("\\["))return W(s,function(r,v){return N(r,v,"\\]")}),"keyword";if(m.match("\\("))return W(s,function(r,v){return N(r,v,"\\)")}),"keyword";if(m.match("$$"))return W(s,function(r,v){return N(r,v,"$$")}),"keyword";if(m.match("$"))return W(s,function(r,v){return N(r,v,"$")}),"keyword";var _=m.next();if(_=="%")return m.skipToEnd(),"comment";if(_=="}"||_=="]"){if(g=ae(s),g)g.closeBracket(_),W(s,d);else return"error";return"bracket"}else return _=="{"||_=="["?(g=n.DEFAULT,g=new g,fe(s,g),"bracket"):/\d/.test(_)?(m.eatWhile(/[\w.%]/),"atom"):(m.eatWhile(/[\w\-_]/),g=R(s),g.name=="begin"&&(g.argument=m.current()),g.styleIdentifier())}function N(m,s,g){if(m.eatSpace())return null;if(g&&m.match(g))return W(s,D),"keyword";if(m.match(/^\\[a-zA-Z@]+/))return"tag";if(m.match(/^[a-zA-Z]+/))return"variable-2";if(m.match(/^\\[$&%#{}_]/))return"tag";if(m.match(/^\\[,;!\/]/))return"tag";if(m.match(/^[\^_&]/))return"tag";if(m.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(m.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var h=m.next();return h=="{"||h=="}"||h=="["||h=="]"||h=="("||h==")"?"bracket":h=="%"?(m.skipToEnd(),"comment"):"error"}function d(m,s){var g=m.peek(),h;return g=="{"||g=="["?(h=ae(s),h.openBracket(g),m.eat(g),W(s,D),"bracket"):/[ \t\r]/.test(g)?(m.eat(g),null):(W(s,D),z(s),D(m,s))}return{startState:function(){var m=re.inMathMode?function(s,g){return N(s,g)}:D;return{cmdState:[],f:m}},copyState:function(m){return{cmdState:m.cmdState.slice(),f:m.f}},token:function(m,s){return s.f(m,s)},blankLine:function(m){m.f=D,m.cmdState.length=0},lineComment:"%"}}),q.defineMIME("text/x-stex","stex"),q.defineMIME("text/x-latex","stex")})},"+QRC":function(We,ce,M){"use strict";var q=M("E9nw"),ue={"text/plain":"Text","text/html":"Url",default:"Text"},re="Copy to clipboard: #{key}, Enter";function fe(z){var R=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return z.replace(/#{\s*key\s*}/g,R)}function ae(z,R){var B,n,W,D,N,d,m=!1;R||(R={}),B=R.debug||!1;try{W=q(),D=document.createRange(),N=document.getSelection(),d=document.createElement("span"),d.textContent=z,d.ariaHidden="true",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(g){if(g.stopPropagation(),R.format)if(g.preventDefault(),typeof g.clipboardData=="undefined"){B&&console.warn("unable to use e.clipboardData"),B&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var h=ue[R.format]||ue.default;window.clipboardData.setData(h,z)}else g.clipboardData.clearData(),g.clipboardData.setData(R.format,z);R.onCopy&&(g.preventDefault(),R.onCopy(g.clipboardData))}),document.body.appendChild(d),D.selectNodeContents(d),N.addRange(D);var s=document.execCommand("copy");if(!s)throw new Error("copy command was unsuccessful");m=!0}catch(g){B&&console.error("unable to copy using execCommand: ",g),B&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(R.format||"text",z),R.onCopy&&R.onCopy(window.clipboardData),m=!0}catch(h){B&&console.error("unable to copy using clipboardData: ",h),B&&console.error("falling back to prompt"),n=fe("message"in R?R.message:re),window.prompt(n,z)}}finally{N&&(typeof N.removeRange=="function"?N.removeRange(D):N.removeAllRanges()),d&&document.body.removeChild(d),W()}return m}We.exports=ae},"+aKw":function(We,ce,M){"use strict";var q=M("Hqw+"),ue=M("T/Jt"),re=M.n(ue),fe=function(R){return String(R).length===1?"0".concat(R):R},ae=function(R){var B=R.className,n=B===void 0?"":B,W=R.onChange,D=R.defaultValue,N=D===void 0?0:D,d=Object(ue.useState)(N),m=Object(q.a)(d,2),s=m[0],g=m[1];Object(ue.useEffect)(function(){var v=setTimeout(function(){g(s+1e3)},1e3);return W(s+1e3),function(){clearInterval(v)}},[s]);var h=parseInt(s/(60*6e4))||"00",_=parseInt(s%(60*6e4)/6e4)||"00",r=parseInt(s%6e4/1e3)||"00";return re.a.createElement("div",{className:n},fe(h),":",fe(_),":",fe(r))};ce.a=ae},"+ua5":function(We,ce,M){},"/cxE":function(We,ce,M){"use strict";M.d(ce,"f",function(){return re}),M.d(ce,"g",function(){return fe}),M.d(ce,"h",function(){return ae}),M.d(ce,"e",function(){return R}),M.d(ce,"b",function(){return B}),M.d(ce,"c",function(){return n}),M.d(ce,"d",function(){return W}),M.d(ce,"a",function(){return D});class q{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(N){setTimeout(()=>{throw N.stack?new Error(N.message+`
`+N.stack):N},0)}}emit(N){this.listeners.forEach(d=>{d(N)})}onUnexpectedError(N){this.unexpectedErrorHandler(N),this.emit(N)}onUnexpectedExternalError(N){this.unexpectedErrorHandler(N)}}const ue=new q;function re(N){R(N)||ue.onUnexpectedError(N);return}function fe(N){R(N)||ue.onUnexpectedExternalError(N);return}function ae(N){if(N instanceof Error){let{name:d,message:m}=N;const s=N.stacktrace||N.stack;return{$isError:!0,name:d,message:m,stack:s}}return N}const z="Canceled";function R(N){return N instanceof Error&&N.name===z&&N.message===z}function B(){const N=new Error(z);return N.name=N.message,N}function n(N){return N?new Error(`Illegal argument: ${N}`):new Error("Illegal argument")}function W(N){return N?new Error(`Illegal state: ${N}`):new Error("Illegal state")}class D extends Error{constructor(N){super("NotSupported");N&&(this.message=N)}}},"07cG":function(We,ce,M){We.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"0lMV":function(We,ce,M){"use strict";var q=M("T/Jt"),ue=M.n(q),re=q.createContext({});ce.a=re},"0pdE":function(We,ce,M){"use strict";var q=M("yuO0"),ue=M("XjgL"),re=M("fNpE"),fe=M("6ASS"),ae=M("eA01"),z=M("fXDJ"),R=M("fhFH"),B=M("BPTR"),n=M("udol"),W=M("27eb"),D=M.n(W),N=M("E0BR"),d=M("T/Jt"),m=M("c27x"),s=function(T){for(var A=T.prefixCls,b=T.level,C=T.isStart,p=T.isEnd,i="".concat(A,"-indent-unit"),f=[],o=0;o<b;o+=1){var a;f.push(d.createElement("span",{key:o,className:D()(i,(a={},Object(ue.a)(a,"".concat(i,"-start"),C[o]),Object(ue.a)(a,"".concat(i,"-end"),p[o]),a))}))}return d.createElement("span",{"aria-hidden":"true",className:"".concat(A,"-indent")},f)},g=d.memo(s),h=M("El5i"),_=M("rgEC"),r=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],v="open",S="close",w="---",I=function(P){Object(B.a)(A,P);var T=Object(n.a)(A);function A(){var b;Object(ae.a)(this,A);for(var C=arguments.length,p=new Array(C),i=0;i<C;i++)p[i]=arguments[i];return b=T.call.apply(T,[this].concat(p)),b.state={dragNodeHighlight:!1},b.selectHandle=void 0,b.cacheIndent=void 0,b.onSelectorClick=function(f){var o=b.props.context.onNodeClick;o(f,Object(_.b)(b.props)),b.isSelectable()?b.onSelect(f):b.onCheck(f)},b.onSelectorDoubleClick=function(f){var o=b.props.context.onNodeDoubleClick;o(f,Object(_.b)(b.props))},b.onSelect=function(f){if(b.isDisabled())return;var o=b.props.context.onNodeSelect;o(f,Object(_.b)(b.props))},b.onCheck=function(f){if(b.isDisabled())return;var o=b.props,a=o.disableCheckbox,L=o.checked,y=b.props.context.onNodeCheck;if(!b.isCheckable()||a)return;var l=!L;y(f,Object(_.b)(b.props),l)},b.onMouseEnter=function(f){var o=b.props.context.onNodeMouseEnter;o(f,Object(_.b)(b.props))},b.onMouseLeave=function(f){var o=b.props.context.onNodeMouseLeave;o(f,Object(_.b)(b.props))},b.onContextMenu=function(f){var o=b.props.context.onNodeContextMenu;o(f,Object(_.b)(b.props))},b.onDragStart=function(f){var o=b.props.context.onNodeDragStart;f.stopPropagation(),b.setState({dragNodeHighlight:!0}),o(f,Object(R.a)(b));try{f.dataTransfer.setData("text/plain","")}catch(a){}},b.onDragEnter=function(f){var o=b.props.context.onNodeDragEnter;f.preventDefault(),f.stopPropagation(),o(f,Object(R.a)(b))},b.onDragOver=function(f){var o=b.props.context.onNodeDragOver;f.preventDefault(),f.stopPropagation(),o(f,Object(R.a)(b))},b.onDragLeave=function(f){var o=b.props.context.onNodeDragLeave;f.stopPropagation(),o(f,Object(R.a)(b))},b.onDragEnd=function(f){var o=b.props.context.onNodeDragEnd;f.stopPropagation(),b.setState({dragNodeHighlight:!1}),o(f,Object(R.a)(b))},b.onDrop=function(f){var o=b.props.context.onNodeDrop;f.preventDefault(),f.stopPropagation(),b.setState({dragNodeHighlight:!1}),o(f,Object(R.a)(b))},b.onExpand=function(f){var o=b.props,a=o.loading,L=o.context.onNodeExpand;if(a)return;L(f,Object(_.b)(b.props))},b.setSelectHandle=function(f){b.selectHandle=f},b.getNodeState=function(){var f=b.props.expanded;return b.isLeaf()?null:f?v:S},b.hasChildren=function(){var f=b.props.eventKey,o=b.props.context.keyEntities,a=Object(h.a)(o,f)||{},L=a.children;return!!(L||[]).length},b.isLeaf=function(){var f=b.props,o=f.isLeaf,a=f.loaded,L=b.props.context.loadData,y=b.hasChildren();return o===!1?!1:o||!L&&!y||L&&a&&!y},b.isDisabled=function(){var f=b.props.disabled,o=b.props.context.disabled;return!!(o||f)},b.isCheckable=function(){var f=b.props.checkable,o=b.props.context.checkable;return!o||f===!1?!1:o},b.syncLoadData=function(f){var o=f.expanded,a=f.loading,L=f.loaded,y=b.props.context,l=y.loadData,F=y.onNodeLoad;if(a)return;l&&o&&!b.isLeaf()&&(!b.hasChildren()&&!L&&F(Object(_.b)(b.props)))},b.isDraggable=function(){var f=b.props,o=f.data,a=f.context.draggable;return!!(a&&(!a.nodeDraggable||a.nodeDraggable(o)))},b.renderDragHandler=function(){var f=b.props.context,o=f.draggable,a=f.prefixCls;return(o==null?void 0:o.icon)?d.createElement("span",{className:"".concat(a,"-draggable-icon")},o.icon):null},b.renderSwitcherIconDom=function(f){var o=b.props.switcherIcon,a=b.props.context.switcherIcon,L=o||a;return typeof L=="function"?L(Object(fe.a)(Object(fe.a)({},b.props),{},{isLeaf:f})):L},b.renderSwitcher=function(){var f=b.props.expanded,o=b.props.context.prefixCls;if(b.isLeaf()){var a=b.renderSwitcherIconDom(!0);return a!==!1?d.createElement("span",{className:D()("".concat(o,"-switcher"),"".concat(o,"-switcher-noop"))},a):null}var L=D()("".concat(o,"-switcher"),"".concat(o,"-switcher_").concat(f?v:S)),y=b.renderSwitcherIconDom(!1);return y!==!1?d.createElement("span",{onClick:b.onExpand,className:L},y):null},b.renderCheckbox=function(){var f=b.props,o=f.checked,a=f.halfChecked,L=f.disableCheckbox,y=b.props.context.prefixCls,l=b.isDisabled(),F=b.isCheckable();if(!F)return null;var j=typeof F!="boolean"?F:null;return d.createElement("span",{className:D()("".concat(y,"-checkbox"),o&&"".concat(y,"-checkbox-checked"),!o&&a&&"".concat(y,"-checkbox-indeterminate"),(l||L)&&"".concat(y,"-checkbox-disabled")),onClick:b.onCheck},j)},b.renderIcon=function(){var f=b.props.loading,o=b.props.context.prefixCls;return d.createElement("span",{className:D()("".concat(o,"-iconEle"),"".concat(o,"-icon__").concat(b.getNodeState()||"docu"),f&&"".concat(o,"-icon_loading"))})},b.renderSelector=function(){var f=b.state.dragNodeHighlight,o=b.props,a=o.title,L=a===void 0?w:a,y=o.selected,l=o.icon,F=o.loading,j=o.data,G=b.props.context,Y=G.prefixCls,te=G.showIcon,de=G.icon,ve=G.loadData,he=G.titleRender,Re=b.isDisabled(),we="".concat(Y,"-node-content-wrapper"),ge;if(te){var Ne=l||de;ge=Ne?d.createElement("span",{className:D()("".concat(Y,"-iconEle"),"".concat(Y,"-icon__customize"))},typeof Ne=="function"?Ne(b.props):Ne):b.renderIcon()}else ve&&F&&(ge=b.renderIcon());var ze;typeof L=="function"?ze=L(j):he?ze=he(j):ze=L;var nt=d.createElement("span",{className:"".concat(Y,"-title")},ze);return d.createElement("span",{ref:b.setSelectHandle,title:typeof L=="string"?L:"",className:D()("".concat(we),"".concat(we,"-").concat(b.getNodeState()||"normal"),!Re&&(y||f)&&"".concat(Y,"-node-selected")),onMouseEnter:b.onMouseEnter,onMouseLeave:b.onMouseLeave,onContextMenu:b.onContextMenu,onClick:b.onSelectorClick,onDoubleClick:b.onSelectorDoubleClick},ge,nt,b.renderDropIndicator())},b.renderDropIndicator=function(){var f=b.props,o=f.disabled,a=f.eventKey,L=b.props.context,y=L.draggable,l=L.dropLevelOffset,F=L.dropPosition,j=L.prefixCls,G=L.indent,Y=L.dropIndicatorRender,te=L.dragOverNodeKey,de=L.direction,ve=!!y,he=!o&&ve&&te===a,Re=G!=null?G:b.cacheIndent;return b.cacheIndent=G,he?Y({dropPosition:F,dropLevelOffset:l,indent:Re,prefixCls:j,direction:de}):null},b}return Object(z.a)(A,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var C=this.props.selectable,p=this.props.context.selectable;return typeof C=="boolean"?C:p}},{key:"render",value:function(){var C,p=this.props,i=p.eventKey,f=p.className,o=p.style,a=p.dragOver,L=p.dragOverGapTop,y=p.dragOverGapBottom,l=p.isLeaf,F=p.isStart,j=p.isEnd,G=p.expanded,Y=p.selected,te=p.checked,de=p.halfChecked,ve=p.loading,he=p.domRef,Re=p.active,we=p.data,ge=p.onMouseMove,Ne=p.selectable,ze=Object(re.a)(p,r),nt=this.props.context,Ge=nt.prefixCls,Xe=nt.filterTreeNode,Be=nt.keyEntities,_e=nt.dropContainerKey,Ze=nt.dropTargetKey,be=nt.draggingNodeKey,Le=this.isDisabled(),le=Object(N.a)(ze,{aria:!0,data:!0}),ye=Object(h.a)(Be,i)||{},Te=ye.level,Pe=j[j.length-1],He=this.isDraggable(),Ye=!Le&&He,ct=be===i,st=Ne!==void 0?{"aria-selected":!!Ne}:void 0;return d.createElement("div",Object(q.a)({ref:he,className:D()(f,"".concat(Ge,"-treenode"),(C={},Object(ue.a)(C,"".concat(Ge,"-treenode-disabled"),Le),Object(ue.a)(C,"".concat(Ge,"-treenode-switcher-").concat(G?"open":"close"),!l),Object(ue.a)(C,"".concat(Ge,"-treenode-checkbox-checked"),te),Object(ue.a)(C,"".concat(Ge,"-treenode-checkbox-indeterminate"),de),Object(ue.a)(C,"".concat(Ge,"-treenode-selected"),Y),Object(ue.a)(C,"".concat(Ge,"-treenode-loading"),ve),Object(ue.a)(C,"".concat(Ge,"-treenode-active"),Re),Object(ue.a)(C,"".concat(Ge,"-treenode-leaf-last"),Pe),Object(ue.a)(C,"".concat(Ge,"-treenode-draggable"),He),Object(ue.a)(C,"dragging",ct),Object(ue.a)(C,"drop-target",Ze===i),Object(ue.a)(C,"drop-container",_e===i),Object(ue.a)(C,"drag-over",!Le&&a),Object(ue.a)(C,"drag-over-gap-top",!Le&&L),Object(ue.a)(C,"drag-over-gap-bottom",!Le&&y),Object(ue.a)(C,"filter-node",Xe&&Xe(Object(_.b)(this.props))),C)),style:o,draggable:Ye,"aria-grabbed":ct,onDragStart:Ye?this.onDragStart:void 0,onDragEnter:He?this.onDragEnter:void 0,onDragOver:He?this.onDragOver:void 0,onDragLeave:He?this.onDragLeave:void 0,onDrop:He?this.onDrop:void 0,onDragEnd:He?this.onDragEnd:void 0,onMouseMove:ge},st,le),d.createElement(g,{prefixCls:Ge,level:Te,isStart:F,isEnd:j}),this.renderDragHandler(),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),A}(d.Component),E=function(T){return d.createElement(m.a.Consumer,null,function(A){return d.createElement(I,Object(q.a)({},T,{context:A}))})};E.displayName="TreeNode",E.isTreeNode=1;var x=ce.a=E},"0r65":function(We,ce){var M=arguments[3],q=arguments[4],ue=arguments[5],re=JSON.stringify;We.exports=function(fe,ae){for(var z,R=Object.keys(ue),B=0,n=R.length;B<n;B++){var W=R[B],D=ue[W].exports;if(D===fe||D&&D.default===fe){z=W;break}}if(!z){z=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var N={},B=0,n=R.length;B<n;B++){var W=R[B];N[W]=W}q[z]=["function(require,module,exports){"+fe+"(self); }",N]}var d=Math.floor(Math.pow(16,8)*Math.random()).toString(16),m={};m[z]=z,q[d]=["function(require,module,exports){var f = require("+re(z)+");(f.default ? f.default : f)(self);}",m];var s={};g(d);function g(w){s[w]=!0;for(var I in q[w][1]){var E=q[w][1][I];s[E]||g(E)}}var h="("+M+")({"+Object.keys(s).map(function(w){return re(w)+":["+q[w][0]+","+re(q[w][1])+"]"}).join(",")+"},{},["+re(d)+"])",_=window.URL||window.webkitURL||window.mozURL||window.msURL,r=new Blob([h],{type:"text/javascript"});if(ae&&ae.bare)return r;var v=_.createObjectURL(r),S=new Worker(v);return S.objectURL=v,S}},"19Vz":function(We,ce,M){(function(q){q(M("VrN/"))})(function(q){q.defineOption("placeholder","",function(B,n,W){var D=W&&W!=q.Init;if(n&&!D)B.on("blur",ae),B.on("change",z),B.on("swapDoc",z),q.on(B.getInputField(),"compositionupdate",B.state.placeholderCompose=function(){fe(B)}),z(B);else if(!n&&D){B.off("blur",ae),B.off("change",z),B.off("swapDoc",z),q.off(B.getInputField(),"compositionupdate",B.state.placeholderCompose),ue(B);var N=B.getWrapperElement();N.className=N.className.replace(" CodeMirror-empty","")}n&&!B.hasFocus()&&ae(B)});function ue(B){B.state.placeholder&&(B.state.placeholder.parentNode.removeChild(B.state.placeholder),B.state.placeholder=null)}function re(B){ue(B);var n=B.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=B.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var W=B.getOption("placeholder");typeof W=="string"&&(W=document.createTextNode(W)),n.appendChild(W),B.display.lineSpace.insertBefore(n,B.display.lineSpace.firstChild)}function fe(B){setTimeout(function(){var n=!1,W=B.getInputField();W.nodeName=="TEXTAREA"?n=!W.value:B.lineCount()==1&&(n=!/[^\u200b]/.test(W.querySelector(".CodeMirror-line").textContent)),n?re(B):ue(B)},20)}function ae(B){R(B)&&re(B)}function z(B){var n=B.getWrapperElement(),W=R(B);n.className=n.className.replace(" CodeMirror-empty","")+(W?" CodeMirror-empty":""),W?re(B):ue(B)}function R(B){return B.lineCount()===1&&B.getLine(0)===""}})},"1FX+":function(We,ce,M){We.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"}},"1HCi":function(We,ce){We.exports=function(q,ue,re,fe){var ae=re?re.call(fe,q,ue):void 0;if(ae!==void 0)return!!ae;if(q===ue)return!0;if(typeof q!="object"||!q||typeof ue!="object"||!ue)return!1;var z=Object.keys(q),R=Object.keys(ue);if(z.length!==R.length)return!1;for(var B=Object.prototype.hasOwnProperty.bind(ue),n=0;n<z.length;n++){var W=z[n];if(!B(W))return!1;var D=q[W],N=ue[W];if(ae=re?re.call(fe,D,N,W):void 0,ae===!1||ae===void 0&&D!==N)return!1}return!0}},"1eCo":function(We,ce,M){(function(q){q(M("VrN/"))})(function(q){"use strict";var ue={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},re={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};q.defineMode("xml",function(fe,ae){var z=fe.indentUnit,R={},B=ae.htmlMode?ue:re;for(var n in B)R[n]=B[n];for(var n in ae)R[n]=ae[n];var W,D;function N(b,C){function p(o){return C.tokenize=o,o(b,C)}var i=b.next();if(i=="<")return b.eat("!")?b.eat("[")?b.match("CDATA[")?p(s("atom","]]>")):null:b.match("--")?p(s("comment","-->")):b.match("DOCTYPE",!0,!0)?(b.eatWhile(/[\w\._\-]/),p(g(1))):null:b.eat("?")?(b.eatWhile(/[\w\._\-]/),C.tokenize=s("meta","?>"),"meta"):(W=b.eat("/")?"closeTag":"openTag",C.tokenize=d,"tag bracket");if(i=="&"){var f;return b.eat("#")?b.eat("x")?f=b.eatWhile(/[a-fA-F\d]/)&&b.eat(";"):f=b.eatWhile(/[\d]/)&&b.eat(";"):f=b.eatWhile(/[\w\.\-:]/)&&b.eat(";"),f?"atom":"error"}else return b.eatWhile(/[^&<]/),null}N.isInText=!0;function d(b,C){var p=b.next();if(p==">"||p=="/"&&b.eat(">"))return C.tokenize=N,W=p==">"?"endTag":"selfcloseTag","tag bracket";if(p=="=")return W="equals",null;if(p=="<"){C.tokenize=N,C.state=v,C.tagName=C.tagStart=null;var i=C.tokenize(b,C);return i?i+" tag error":"tag error"}else return/[\'\"]/.test(p)?(C.tokenize=m(p),C.stringStartCol=b.column(),C.tokenize(b,C)):(b.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function m(b){var C=function(p,i){for(;!p.eol();)if(p.next()==b){i.tokenize=d;break}return"string"};return C.isInAttribute=!0,C}function s(b,C){return function(p,i){for(;!p.eol();){if(p.match(C)){i.tokenize=N;break}p.next()}return b}}function g(b){return function(C,p){for(var i;(i=C.next())!=null;){if(i=="<")return p.tokenize=g(b+1),p.tokenize(C,p);if(i==">")if(b==1){p.tokenize=N;break}else return p.tokenize=g(b-1),p.tokenize(C,p)}return"meta"}}function h(b,C,p){this.prev=b.context,this.tagName=C,this.indent=b.indented,this.startOfLine=p,(R.doNotIndent.hasOwnProperty(C)||b.context&&b.context.noIndent)&&(this.noIndent=!0)}function _(b){b.context&&(b.context=b.context.prev)}function r(b,C){for(var p;;){if(!b.context)return;if(p=b.context.tagName,!R.contextGrabbers.hasOwnProperty(p)||!R.contextGrabbers[p].hasOwnProperty(C))return;_(b)}}function v(b,C,p){return b=="openTag"?(p.tagStart=C.column(),S):b=="closeTag"?w:v}function S(b,C,p){return b=="word"?(p.tagName=C.current(),D="tag",x):R.allowMissingTagName&&b=="endTag"?(D="tag bracket",x(b,C,p)):(D="error",S)}function w(b,C,p){if(b=="word"){var i=C.current();return p.context&&p.context.tagName!=i&&R.implicitlyClosed.hasOwnProperty(p.context.tagName)&&_(p),p.context&&p.context.tagName==i||R.matchClosing===!1?(D="tag",I):(D="tag error",E)}else return R.allowMissingTagName&&b=="endTag"?(D="tag bracket",I(b,C,p)):(D="error",E)}function I(b,C,p){return b!="endTag"?(D="error",I):(_(p),v)}function E(b,C,p){return D="error",I(b,C,p)}function x(b,C,p){if(b=="word")return D="attribute",P;if(b=="endTag"||b=="selfcloseTag"){var i=p.tagName,f=p.tagStart;return p.tagName=p.tagStart=null,b=="selfcloseTag"||R.autoSelfClosers.hasOwnProperty(i)?r(p,i):(r(p,i),p.context=new h(p,i,f==p.indented)),v}return D="error",x}function P(b,C,p){return b=="equals"?T:(R.allowMissing||(D="error"),x(b,C,p))}function T(b,C,p){return b=="string"?A:b=="word"&&R.allowUnquoted?(D="string",x):(D="error",x(b,C,p))}function A(b,C,p){return b=="string"?A:x(b,C,p)}return{startState:function(b){var C={tokenize:N,state:v,indented:b||0,tagName:null,tagStart:null,context:null};return b!=null&&(C.baseIndent=b),C},token:function(b,C){if(!C.tagName&&b.sol()&&(C.indented=b.indentation()),b.eatSpace())return null;W=null;var p=C.tokenize(b,C);return(p||W)&&p!="comment"&&(D=null,C.state=C.state(W||p,b,C),D&&(p=D=="error"?p+" error":D)),p},indent:function(b,C,p){var i=b.context;if(b.tokenize.isInAttribute)return b.tagStart==b.indented?b.stringStartCol+1:b.indented+z;if(i&&i.noIndent)return q.Pass;if(b.tokenize!=d&&b.tokenize!=N)return p?p.match(/^(\s*)/)[0].length:0;if(b.tagName)return R.multilineTagIndentPastTag!==!1?b.tagStart+b.tagName.length+2:b.tagStart+z*(R.multilineTagIndentFactor||1);if(R.alignCDATA&&/<!\[CDATA\[/.test(C))return 0;var f=C&&/^<(\/)?([\w_:\.-]*)/.exec(C);if(f&&f[1])for(;i;)if(i.tagName==f[2]){i=i.prev;break}else if(R.implicitlyClosed.hasOwnProperty(i.tagName))i=i.prev;else break;else if(f)for(;i;){var o=R.contextGrabbers[i.tagName];if(o&&o.hasOwnProperty(f[2]))i=i.prev;else break}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+z:b.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:R.htmlMode?"html":"xml",helperType:R.htmlMode?"html":"xml",skipAttribute:function(b){b.state==T&&(b.state=x)},xmlCurrentTag:function(b){return b.tagName?{name:b.tagName,close:b.type=="closeTag"}:null},xmlCurrentContext:function(b){for(var C=[],p=b.context;p;p=p.prev)p.tagName&&C.push(p.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})})},"24hK":function(We,ce,M){"use strict";M.d(ce,"a",function(){return ue});class q{constructor(re){this.element=re,this.next=q.Undefined,this.prev=q.Undefined}}q.Undefined=new q(void 0);class ue{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 re=this._first;for(;re!==q.Undefined;){const fe=re.next;re.prev=q.Undefined,re.next=q.Undefined,re=fe}this._first=q.Undefined,this._last=q.Undefined,this._size=0}unshift(re){return this._insert(re,!1)}push(re){return this._insert(re,!0)}_insert(re,fe){const ae=new q(re);if(this._first===q.Undefined)this._first=ae,this._last=ae;else if(fe){const R=this._last;this._last=ae,ae.prev=R,R.next=ae}else{const R=this._first;this._first=ae,ae.next=R,R.prev=ae}this._size+=1;let z=!1;return()=>{z||(z=!0,this._remove(ae))}}shift(){if(this._first===q.Undefined)return;{const re=this._first.element;return this._remove(this._first),re}}pop(){if(this._last===q.Undefined)return;{const re=this._last.element;return this._remove(this._last),re}}_remove(re){if(re.prev!==q.Undefined&&re.next!==q.Undefined){const fe=re.prev;fe.next=re.next,re.next.prev=fe}else re.prev===q.Undefined&&re.next===q.Undefined?(this._first=q.Undefined,this._last=q.Undefined):re.next===q.Undefined?(this._last=this._last.prev,this._last.next=q.Undefined):re.prev===q.Undefined&&(this._first=this._first.next,this._first.prev=q.Undefined);this._size-=1}*[Symbol.iterator](){let re=this._first;for(;re!==q.Undefined;)yield re.element,re=re.next}}},"3/fG":function(We,ce,M){"use strict";M.d(ce,"a",function(){return ue});function q(re,fe){let ae;return fe.length===0?ae=re:ae=re.replace(/\{(\d+)\}/g,function(z,R){const B=R[0];return typeof fe[B]!="undefined"?fe[B]:z}),ae}function ue(re,fe,...ae){return q(fe,ae)}},"3GYr":function(We,ce,M){"use strict";var q=M("yuO0"),ue=M("T/Jt"),re=M("0lMV"),fe=M("x/L2"),ae=M("Dpym"),z=M("TqI3");function R(d){var m=d.className,s=d.index,g=d.children,h=d.colSpan,_=h===void 0?1:h,r=d.rowSpan,v=d.align,S=ue.useContext(ae.a),w=S.prefixCls,I=S.direction,E=ue.useContext(re.a),x=E.scrollColumnIndex,P=E.stickyOffsets,T=E.flattenColumns,A=s+_-1,b=A+1===x?_+1:_,C=Object(z.a)(s,s+b-1,T,P,I);return ue.createElement(fe.a,Object(q.a)({className:m,index:s,component:"td",prefixCls:w,record:null,dataIndex:null,align:v,colSpan:b,rowSpan:r,render:function(){return g}},C))}var B=M("fNpE"),n=["children"];function W(d){var m=d.children,s=Object(B.a)(d,n);return ue.createElement("tr",s,m)}function D(d){var m=d.children;return m}D.Row=W,D.Cell=R;var N=ce.a=D},"3tLw":function(We,ce,M){We.exports=M.p+"static/a.5b9b2825.svg"},"4xil":function(We,ce,M){We.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"}},"5Und":function(We,ce,M){"use strict";M.d(ce,"b",function(){return re}),M.d(ce,"a",function(){return fe}),M.d(ce,"c",function(){return ae});var q="RC_TABLE_KEY";function ue(z){return z==null?[]:Array.isArray(z)?z:[z]}function re(z,R){if(!R&&typeof R!="number")return z;for(var B=ue(R),n=z,W=0;W<B.length;W+=1){if(!n)return null;var D=B[W];n=n[D]}return n}function fe(z){var R=[],B={};return z.forEach(function(n){for(var W=n||{},D=W.key,N=W.dataIndex,d=D||ue(N).join("-")||q;B[d];)d="".concat(d,"_next");B[d]=!0,R.push(d)}),R}function ae(z){return z!=null}},"5VLF":function(We,ce,M){"use strict";var q,ue;function re(fe,ae,z){var R=function(B,n){return fe.js_beautify(B,n)};return R.js=fe.js_beautify,R.css=ae.css_beautify,R.html=z.html_beautify,R.js_beautify=fe.js_beautify,R.css_beautify=ae.css_beautify,R.html_beautify=z.html_beautify,R}!(q=[M("6UM0"),M("TXwP"),M("psGv")],ue=function(fe,ae,z){return re(fe,ae,z)}.apply(ce,q),ue!==void 0&&(We.exports=ue))},"5Y4S":function(We,ce,M){"use strict";M.d(ce,"a",function(){return re});var q=M("MNsG");const ue=q.b.performance&&typeof q.b.performance.now=="function";class re{constructor(fe){this._highResolution=ue&&fe,this._startTime=this._now(),this._stopTime=-1}static create(fe=!0){return new re(fe)}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(We,ce,M){var q=M("MFOe"),ue=q.slice,re=q.pluck,fe=q.each,ae=q.bind,z=q.create,R=q.isList,B=q.isFunction,n=q.isObject;We.exports={createStore:N};var W={version:"2.0.12",enabled:!1,get:function(d,m){var s=this.storage.read(this._namespacePrefix+d);return this._deserialize(s,m)},set:function(d,m){return m===void 0?this.remove(d):(this.storage.write(this._namespacePrefix+d,this._serialize(m)),m)},remove:function(d){this.storage.remove(this._namespacePrefix+d)},each:function(d){var m=this;this.storage.each(function(s,g){d.call(m,m._deserialize(s),(g||"").replace(m._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(d){return this._namespacePrefix=="__storejs_"+d+"_"},createStore:function(){return N.apply(this,arguments)},addPlugin:function(d){this._addPlugin(d)},namespace:function(d){return N(this.storage,this.plugins,d)}};function D(){var d=typeof console=="undefined"?null:console;if(!d)return;var m=d.warn?d.warn:d.log;m.apply(d,arguments)}function N(d,m,s){s||(s=""),d&&!R(d)&&(d=[d]),m&&!R(m)&&(m=[m]);var g=s?"__storejs_"+s+"_":"",h=s?new RegExp("^"+g):null,_=/^[a-zA-Z0-9_\-]*$/;if(!_.test(s))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var r={_namespacePrefix:g,_namespaceRegexp:h,_testStorage:function(S){try{var w="__storejs__test__";S.write(w,w);var I=S.read(w)===w;return S.remove(w),I}catch(E){return!1}},_assignPluginFnProp:function(S,w){var I=this[w];this[w]=function(){var x=ue(arguments,0),P=this;function T(){return I?(fe(arguments,function(b,C){x[C]=b}),I.apply(P,x)):void 0}var A=[T].concat(x);return S.apply(P,A)}},_serialize:function(S){return JSON.stringify(S)},_deserialize:function(S,w){if(!S)return w;var I="";try{I=JSON.parse(S)}catch(E){I=S}return I!==void 0?I:w},_addStorage:function(S){if(this.enabled)return;this._testStorage(S)&&(this.storage=S,this.enabled=!0)},_addPlugin:function(S){var w=this;if(R(S)){fe(S,function(x){w._addPlugin(x)});return}var I=re(this.plugins,function(x){return S===x});if(I)return;if(this.plugins.push(S),!B(S))throw new Error("Plugins must be function values that return objects");var E=S.call(this);if(!n(E))throw new Error("Plugins must return an object of function properties");fe(E,function(x,P){if(!B(x))throw new Error("Bad plugin property: "+P+" from plugin "+S.name+". Plugins should only return functions.");w._assignPluginFnProp(x,P)})},addStorage:function(S){D("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(S)}},v=z(r,W,{plugins:[]});return v.raw={},fe(v,function(S,w){B(S)&&(v.raw[w]=ae(v,S))}),fe(d,function(S){v._addStorage(S)}),fe(m,function(S){v._addPlugin(S)}),v}},"6UM0":function(We,ce,M){var q,ue;(function(){var re;(function(){"use strict";var ae=[function(n,W,D){var N=D(1).Beautifier,d=D(5).Options;function m(s,g){var h=new N(s,g);return h.beautify()}n.exports=m,n.exports.defaultOptions=function(){return new d}},function(n,W,D){var N=D(2).Output,d=D(3).Token,m=D(4),s=D(5).Options,g=D(7).Tokenizer,h=D(7).line_starters,_=D(7).positionable_operators,r=D(7).TOKEN;function v(l,F){return F.indexOf(l)!==-1}function S(l){return l.replace(/^\s+/g,"")}function w(l){for(var F={},j=0;j<l.length;j++)F[l[j].replace(/-/g,"_")]=l[j];return F}function I(l,F){return l&&l.type===r.RESERVED&&l.text===F}function E(l,F){return l&&l.type===r.RESERVED&&v(l.text,F)}var x=["case","return","do","if","throw","else","await","break","continue","async"],P=["before-newline","after-newline","preserve-newline"],T=w(P),A=[T.before_newline,T.preserve_newline],b={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function C(l,F){if(F.multiline_frame||F.mode===b.ForInitializer||F.mode===b.Conditional)return;l.remove_indent(F.start_line_index)}function p(l){l=l.replace(m.allLineBreaks,`
`);for(var F=[],j=l.indexOf(`
`);j!==-1;)F.push(l.substring(0,j)),l=l.substring(j+1),j=l.indexOf(`
`);return l.length&&F.push(l),F}function i(l){return l===b.ArrayLiteral}function f(l){return v(l,[b.Expression,b.ForInitializer,b.Conditional])}function o(l,F){for(var j=0;j<l.length;j++){var G=l[j].trim();if(G.charAt(0)!==F)return!1}return!0}function a(l,F){for(var j=0,G=l.length,Y;j<G;j++)if(Y=l[j],Y&&Y.indexOf(F)!==0)return!1;return!0}function L(l,F){F=F||{},this._source_text=l||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new s(F)}L.prototype.create_flags=function(l,F){var j=0;l&&(j=l.indentation_level,!this._output.just_added_newline()&&l.line_indent_level>j&&(j=l.line_indent_level));var G={mode:F,parent:l,last_token:l?l.last_token:new d(r.START_BLOCK,""),last_word:l?l.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:j,alignment:0,line_indent_level:l?l.line_indent_level:j,start_line_index:this._output.get_line_number(),ternary_depth:0};return G},L.prototype._reset=function(l){var F=l.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new N(this._options,F),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(b.BlockStatement);var j=new g(l,this._options);return this._tokens=j.tokenize(),l},L.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var l,F=this._reset(this._source_text),j=this._options.eol;this._options.eol==="auto"&&(j=`
`,F&&m.lineBreak.test(F||"")&&(j=F.match(m.lineBreak)[0]));for(var G=this._tokens.next();G;)this.handle_token(G),this._last_last_text=this._flags.last_token.text,this._flags.last_token=G,G=this._tokens.next();return l=this._output.get_code(j),l},L.prototype.handle_token=function(l,F){l.type===r.START_EXPR?this.handle_start_expr(l):l.type===r.END_EXPR?this.handle_end_expr(l):l.type===r.START_BLOCK?this.handle_start_block(l):l.type===r.END_BLOCK?this.handle_end_block(l):l.type===r.WORD?this.handle_word(l):l.type===r.RESERVED?this.handle_word(l):l.type===r.SEMICOLON?this.handle_semicolon(l):l.type===r.STRING?this.handle_string(l):l.type===r.EQUALS?this.handle_equals(l):l.type===r.OPERATOR?this.handle_operator(l):l.type===r.COMMA?this.handle_comma(l):l.type===r.BLOCK_COMMENT?this.handle_block_comment(l,F):l.type===r.COMMENT?this.handle_comment(l,F):l.type===r.DOT?this.handle_dot(l):l.type===r.EOF?this.handle_eof(l):l.type===r.UNKNOWN?this.handle_unknown(l,F):this.handle_unknown(l,F)},L.prototype.handle_whitespace_and_comments=function(l,F){var j=l.newlines,G=this._options.keep_array_indentation&&i(this._flags.mode);if(l.comments_before)for(var Y=l.comments_before.next();Y;)this.handle_whitespace_and_comments(Y,F),this.handle_token(Y,F),Y=l.comments_before.next();if(G)for(var te=0;te<j;te+=1)this.print_newline(te>0,F);else if(this._options.max_preserve_newlines&&j>this._options.max_preserve_newlines&&(j=this._options.max_preserve_newlines),this._options.preserve_newlines&&j>1){this.print_newline(!1,F);for(var de=1;de<j;de+=1)this.print_newline(!0,F)}};var y=["async","break","continue","return","throw","yield"];L.prototype.allow_wrap_or_preserved_newline=function(l,F){if(F=F===void 0?!1:F,this._output.just_added_newline())return;var j=this._options.preserve_newlines&&l.newlines||F,G=v(this._flags.last_token.text,_)||v(l.text,_);if(G){var Y=v(this._flags.last_token.text,_)&&v(this._options.operator_position,A)||v(l.text,_);j=j&&Y}if(j)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(E(this._flags.last_token,y))return;this._output.set_wrap_point()}},L.prototype.print_newline=function(l,F){if(!F&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==r.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var j=this._tokens.peek();this._flags.mode===b.Statement&&!(this._flags.if_block&&I(j,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(l)&&(this._flags.multiline_frame=!0)},L.prototype.print_token_line_indentation=function(l){this._output.just_added_newline()&&(this._options.keep_array_indentation&&l.newlines&&(l.text==="["||i(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(l.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))},L.prototype.print_token=function(l){if(this._output.raw){this._output.add_raw_token(l);return}if(this._options.comma_first&&l.previous&&l.previous.type===r.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var F=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(F),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(l),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(l),this._output.non_breaking_space=!0,this._output.add_token(l.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},L.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},L.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))},L.prototype.set_mode=function(l){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,l),this._flags=this.create_flags(this._previous_flags,l),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},L.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===b.Statement&&C(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},L.prototype.start_of_object_property=function(){return this._flags.parent.mode===b.ObjectLiteral&&this._flags.mode===b.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||E(this._flags.last_token,["get","set"]))},L.prototype.start_of_statement=function(l){var F=!1;return F=F||E(this._flags.last_token,["var","let","const"])&&l.type===r.WORD,F=F||I(this._flags.last_token,"do"),F=F||!(this._flags.parent.mode===b.ObjectLiteral&&this._flags.mode===b.Statement)&&E(this._flags.last_token,y)&&!l.newlines,F=F||I(this._flags.last_token,"else")&&!(I(l,"if")&&!l.comments_before),F=F||this._flags.last_token.type===r.END_EXPR&&(this._previous_flags.mode===b.ForInitializer||this._previous_flags.mode===b.Conditional),F=F||this._flags.last_token.type===r.WORD&&this._flags.mode===b.BlockStatement&&!this._flags.in_case&&!(l.text==="--"||l.text==="++")&&this._last_last_text!=="function"&&l.type!==r.WORD&&l.type!==r.RESERVED,F=F||this._flags.mode===b.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||E(this._flags.last_token,["get","set"])),F?(this.set_mode(b.Statement),this.indent(),this.handle_whitespace_and_comments(l,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(l,E(l,["do","for","if","while"])),!0):!1},L.prototype.handle_start_expr=function(l){this.start_of_statement(l)||this.handle_whitespace_and_comments(l);var F=b.Expression;if(l.text==="["){if(this._flags.last_token.type===r.WORD||this._flags.last_token.text===")"){E(this._flags.last_token,h)&&(this._output.space_before_token=!0),this.print_token(l),this.set_mode(F),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}F=b.ArrayLiteral,i(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())),v(this._flags.last_token.type,[r.START_EXPR,r.END_EXPR,r.WORD,r.OPERATOR,r.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===r.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,F=b.ForInitializer):v(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,F=b.Conditional):v(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&l.whitespace_before===""?this._output.space_before_token=!1:(v(this._flags.last_token.text,h)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===r.EQUALS||this._flags.last_token.type===r.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(l);else if(this._flags.last_token.type===r.WORD){this._output.space_before_token=!1;var j=this._tokens.peek(-3);if(this._options.space_after_named_function&&j){var G=this._tokens.peek(-4);E(j,["async","function"])||j.text==="*"&&E(G,["async","function"])?this._output.space_before_token=!0:this._flags.mode===b.ObjectLiteral?(j.text==="{"||j.text===","||j.text==="*"&&(G.text==="{"||G.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(l);(this._flags.last_token.type===r.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(v(this._last_last_text,["function","yield"])||this._flags.mode===b.ObjectLiteral&&v(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===r.START_BLOCK?this.print_newline():(this._flags.last_token.type===r.END_EXPR||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===r.COMMA)&&this.allow_wrap_or_preserved_newline(l,l.newlines),this.print_token(l),this.set_mode(F),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},L.prototype.handle_end_expr=function(l){for(;this._flags.mode===b.Statement;)this.restore_mode();this.handle_whitespace_and_comments(l),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(l,l.text==="]"&&i(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===r.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(l),this.restore_mode(),C(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===b.Conditional&&(this._previous_flags.mode=b.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},L.prototype.handle_start_block=function(l){this.handle_whitespace_and_comments(l);var F=this._tokens.peek(),j=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===r.END_EXPR?(this.set_mode(b.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(b.BlockStatement):j&&(v(j.text,[":",","])&&v(F.type,[r.STRING,r.WORD,r.RESERVED])||v(F.text,["get","set","..."])&&v(j.type,[r.WORD,r.RESERVED]))?v(this._last_last_text,["class","interface"])&&!v(j.text,[":",","])?this.set_mode(b.BlockStatement):this.set_mode(b.ObjectLiteral):this._flags.last_token.type===r.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(b.BlockStatement):v(this._flags.last_token.type,[r.EQUALS,r.START_EXPR,r.COMMA,r.OPERATOR])||E(this._flags.last_token,["return","throw","import","default"])?this.set_mode(b.ObjectLiteral):this.set_mode(b.BlockStatement),this._flags.last_token&&(E(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var G=!F.comments_before&&F.text==="}",Y=G&&this._flags.last_word==="function"&&this._flags.last_token.type===r.END_EXPR;if(this._options.brace_preserve_inline){var te=0,de=null;this._flags.inline_frame=!0;do if(te+=1,de=this._tokens.peek(te-1),de.newlines){this._flags.inline_frame=!1;break}while(de.type!==r.EOF&&!(de.type===r.END_BLOCK&&de.opened===l))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&l.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==r.OPERATOR&&(Y||this._flags.last_token.type===r.EQUALS||E(this._flags.last_token,x)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(i(this._previous_flags.mode)&&(this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.COMMA)&&((this._flags.last_token.type===r.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(l),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==r.OPERATOR&&this._flags.last_token.type!==r.START_EXPR&&(this._flags.last_token.type===r.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(l),this.indent(),!G&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},L.prototype.handle_end_block=function(l){for(this.handle_whitespace_and_comments(l);this._flags.mode===b.Statement;)this.restore_mode();var F=this._flags.last_token.type===r.START_BLOCK;this._flags.inline_frame&&!F?this._output.space_before_token=!0:this._options.brace_style==="expand"?F||this.print_newline():F||(i(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(l)},L.prototype.handle_word=function(l){if(l.type===r.RESERVED){if(v(l.text,["set","get"])&&this._flags.mode!==b.ObjectLiteral)l.type=r.WORD;else if(l.text==="import"&&v(this._tokens.peek().text,["(","."]))l.type=r.WORD;else if(v(l.text,["as","from"])&&!this._flags.import_block)l.type=r.WORD;else if(this._flags.mode===b.ObjectLiteral){var F=this._tokens.peek();F.text===":"&&(l.type=r.WORD)}}if(this.start_of_statement(l)?E(this._flags.last_token,["var","let","const"])&&l.type===r.WORD&&(this._flags.declaration_statement=!0):l.newlines&&!f(this._flags.mode)&&(this._flags.last_token.type!==r.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==r.EQUALS&&(this._options.preserve_newlines||!E(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(l),this.print_newline()):this.handle_whitespace_and_comments(l),this._flags.do_block&&!this._flags.do_while)if(I(l,"while")){this._output.space_before_token=!0,this.print_token(l),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&&I(l,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===b.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&E(l,["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(l),this._flags.in_case=!0;return}if((this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.EQUALS||this._flags.last_token.type===r.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(l)),I(l,"function")){(v(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(v(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===r.OPERATOR))&&(!this._output.just_added_blankline()&&!l.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===r.RESERVED||this._flags.last_token.type===r.WORD?E(this._flags.last_token,["get","set","new","export"])||E(this._flags.last_token,y)?this._output.space_before_token=!0:I(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===r.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(f(this._flags.mode)||i(this._flags.mode))||this.print_newline(),this.print_token(l),this._flags.last_word=l.text;return}var j="NONE";if(this._flags.last_token.type===r.END_BLOCK?this._previous_flags.inline_frame?j="SPACE":E(l,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&l.newlines?j="NEWLINE":(j="SPACE",this._output.space_before_token=!0):j="NEWLINE":this._flags.last_token.type===r.SEMICOLON&&this._flags.mode===b.BlockStatement?j="NEWLINE":this._flags.last_token.type===r.SEMICOLON&&f(this._flags.mode)?j="SPACE":this._flags.last_token.type===r.STRING?j="NEWLINE":this._flags.last_token.type===r.RESERVED||this._flags.last_token.type===r.WORD||this._flags.last_token.text==="*"&&(v(this._last_last_text,["function","yield"])||this._flags.mode===b.ObjectLiteral&&v(this._last_last_text,["{",","]))?j="SPACE":this._flags.last_token.type===r.START_BLOCK?this._flags.inline_frame?j="SPACE":j="NEWLINE":this._flags.last_token.type===r.END_EXPR&&(this._output.space_before_token=!0,j="NEWLINE"),E(l,h)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?j="SPACE":j="NEWLINE"),E(l,["else","catch","finally"]))if((!(this._flags.last_token.type===r.END_BLOCK&&this._previous_flags.mode===b.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&l.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var G=this._output.current_line;G.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else j==="NEWLINE"?E(this._flags.last_token,x)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&E(l,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==r.END_EXPR?(this._flags.last_token.type!==r.START_EXPR||!E(l,["var","let","const"]))&&this._flags.last_token.text!==":"&&(I(l,"if")&&I(l.previous,"else")?this._output.space_before_token=!0:this.print_newline()):E(l,h)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&i(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():j==="SPACE"&&(this._output.space_before_token=!0);l.previous&&(l.previous.type===r.WORD||l.previous.type===r.RESERVED)&&(this._output.space_before_token=!0),this.print_token(l),this._flags.last_word=l.text,l.type===r.RESERVED&&(l.text==="do"?this._flags.do_block=!0:l.text==="if"?this._flags.if_block=!0:l.text==="import"?this._flags.import_block=!0:this._flags.import_block&&I(l,"from")&&(this._flags.import_block=!1))},L.prototype.handle_semicolon=function(l){this.start_of_statement(l)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(l);for(var F=this._tokens.peek();this._flags.mode===b.Statement&&!(this._flags.if_block&&I(F,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(l)},L.prototype.handle_string=function(l){l.text.startsWith("`")&&l.newlines===0&&l.whitespace_before===""&&(l.previous.text===")"||this._flags.last_token.type===r.WORD)||(this.start_of_statement(l)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(l),this._flags.last_token.type===r.RESERVED||this._flags.last_token.type===r.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.EQUALS||this._flags.last_token.type===r.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(l):l.text.startsWith("`")&&this._flags.last_token.type===r.END_EXPR&&(l.previous.text==="]"||l.previous.text===")")&&l.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(l)},L.prototype.handle_equals=function(l){this.start_of_statement(l)||this.handle_whitespace_and_comments(l),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(l),this._output.space_before_token=!0},L.prototype.handle_comma=function(l){this.handle_whitespace_and_comments(l,!0),this.print_token(l),this._output.space_before_token=!0,this._flags.declaration_statement?(f(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(l)):this._flags.mode===b.ObjectLiteral||this._flags.mode===b.Statement&&this._flags.parent.mode===b.ObjectLiteral?(this._flags.mode===b.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(l)},L.prototype.handle_operator=function(l){var F=l.text==="*"&&(E(this._flags.last_token,["function","yield"])||v(this._flags.last_token.type,[r.START_BLOCK,r.COMMA,r.END_BLOCK,r.SEMICOLON])),j=v(l.text,["-","+"])&&(v(this._flags.last_token.type,[r.START_BLOCK,r.START_EXPR,r.EQUALS,r.OPERATOR])||v(this._flags.last_token.text,h)||this._flags.last_token.text===",");if(!this.start_of_statement(l)){var G=!F;this.handle_whitespace_and_comments(l,G)}if(l.text==="*"&&this._flags.last_token.type===r.DOT){this.print_token(l);return}if(l.text==="::"){this.print_token(l);return}if(this._flags.last_token.type===r.OPERATOR&&v(this._options.operator_position,A)&&this.allow_wrap_or_preserved_newline(l),l.text===":"&&this._flags.in_case){this.print_token(l),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==r.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var Y=!0,te=!0,de=!1;if(l.text===":"?this._flags.ternary_depth===0?Y=!1:(this._flags.ternary_depth-=1,de=!0):l.text==="?"&&(this._flags.ternary_depth+=1),!j&&!F&&this._options.preserve_newlines&&v(l.text,_)){var ve=l.text===":",he=ve&&de,Re=ve&&!de;switch(this._options.operator_position){case T.before_newline:this._output.space_before_token=!Re,this.print_token(l),(!ve||he)&&this.allow_wrap_or_preserved_newline(l),this._output.space_before_token=!0;return;case T.after_newline:this._output.space_before_token=!0,!ve||he?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(l):this._output.space_before_token=!1,this.print_token(l),this._output.space_before_token=!0;return;case T.preserve_newline:Re||this.allow_wrap_or_preserved_newline(l),Y=!(this._output.just_added_newline()||Re),this._output.space_before_token=Y,this.print_token(l),this._output.space_before_token=!0;return}}if(F){this.allow_wrap_or_preserved_newline(l),Y=!1;var we=this._tokens.peek();te=we&&v(we.type,[r.WORD,r.RESERVED])}else if(l.text==="...")this.allow_wrap_or_preserved_newline(l),Y=this._flags.last_token.type===r.START_BLOCK,te=!1;else if(v(l.text,["--","++","!","~"])||j){if((this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR)&&this.allow_wrap_or_preserved_newline(l),Y=!1,te=!1,l.newlines&&(l.text==="--"||l.text==="++"||l.text==="~")){var ge=E(this._flags.last_token,x)&&l.newlines;ge&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ge,!0)}this._flags.last_token.text===";"&&f(this._flags.mode)&&(Y=!0),this._flags.last_token.type===r.RESERVED?Y=!0:this._flags.last_token.type===r.END_EXPR?Y=!(this._flags.last_token.text==="]"&&(l.text==="--"||l.text==="++")):this._flags.last_token.type===r.OPERATOR&&(Y=v(l.text,["--","-","++","+"])&&v(this._flags.last_token.text,["--","-","++","+"]),v(l.text,["+","-"])&&v(this._flags.last_token.text,["--","++"])&&(te=!0)),(this._flags.mode===b.BlockStatement&&!this._flags.inline_frame||this._flags.mode===b.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||Y,this.print_token(l),this._output.space_before_token=te},L.prototype.handle_block_comment=function(l,F){if(this._output.raw){this._output.add_raw_token(l),l.directives&&l.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(l.directives){this.print_newline(!1,F),this.print_token(l),l.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!m.newline.test(l.text)&&!l.newlines){this._output.space_before_token=!0,this.print_token(l),this._output.space_before_token=!0;return}else this.print_block_commment(l,F)},L.prototype.print_block_commment=function(l,F){var j=p(l.text),G,Y=!1,te=!1,de=l.whitespace_before,ve=de.length;if(this.print_newline(!1,F),this.print_token_line_indentation(l),this._output.add_token(j[0]),this.print_newline(!1,F),j.length>1){for(j=j.slice(1),Y=o(j,"*"),te=a(j,de),Y&&(this._flags.alignment=1),G=0;G<j.length;G++)Y?(this.print_token_line_indentation(l),this._output.add_token(S(j[G]))):te&&j[G]?(this.print_token_line_indentation(l),this._output.add_token(j[G].substring(ve))):(this._output.current_line.set_indent(-1),this._output.add_token(j[G])),this.print_newline(!1,F);this._flags.alignment=0}},L.prototype.handle_comment=function(l,F){l.newlines?this.print_newline(!1,F):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(l),this.print_newline(!1,F)},L.prototype.handle_dot=function(l){this.start_of_statement(l)||this.handle_whitespace_and_comments(l,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),E(this._flags.last_token,x)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(l,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(l)},L.prototype.handle_unknown=function(l,F){this.print_token(l),l.text[l.text.length-1]===`
`&&this.print_newline(!1,F)},L.prototype.handle_eof=function(l){for(;this._flags.mode===b.Statement;)this.restore_mode();this.handle_whitespace_and_comments(l)},n.exports.Beautifier=L},function(n){function W(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=[]}W.prototype.clone_empty=function(){var d=new W(this.__parent);return d.set_indent(this.__indent_count,this.__alignment_count),d},W.prototype.item=function(d){return d<0?this.__items[this.__items.length+d]:this.__items[d]},W.prototype.has_match=function(d){for(var m=this.__items.length-1;m>=0;m--)if(this.__items[m].match(d))return!0;return!1},W.prototype.set_indent=function(d,m){this.is_empty()&&(this.__indent_count=d||0,this.__alignment_count=m||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},W.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)},W.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},W.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},W.prototype.is_empty=function(){return this.__items.length===0},W.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},W.prototype.push=function(d){this.__items.push(d);var m=d.lastIndexOf(`
`);m!==-1?this.__character_count=d.length-m:this.__character_count+=d.length},W.prototype.pop=function(){var d=null;return this.is_empty()||(d=this.__items.pop(),this.__character_count-=d.length),d},W.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},W.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},W.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},W.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 D(d,m){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)),m=m||"",d.indent_level>0&&(m=new Array(d.indent_level+1).join(this.__indent_string)),this.__base_string=m,this.__base_string_length=m.length}D.prototype.get_indent_size=function(d,m){var s=this.__base_string_length;return m=m||0,d<0&&(s=0),s+=d*this.__indent_size,s+=m,s},D.prototype.get_indent_string=function(d,m){var s=this.__base_string;return m=m||0,d<0&&(d=0,s=""),m+=d*this.__indent_size,this.__ensure_cache(m),s+=this.__cache[m],s},D.prototype.__ensure_cache=function(d){for(;d>=this.__cache.length;)this.__add_column()},D.prototype.__add_column=function(){var d=this.__cache.length,m=0,s="";this.__indent_size&&d>=this.__indent_size&&(m=Math.floor(d/this.__indent_size),d-=m*this.__indent_size,s=new Array(m+1).join(this.__indent_string)),d&&(s+=new Array(d+1).join(" ")),this.__cache.push(s)};function N(d,m){this.__indent_cache=new D(d,m),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 W(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}N.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},N.prototype.get_line_number=function(){return this.__lines.length},N.prototype.get_indent_string=function(d,m){return this.__indent_cache.get_indent_string(d,m)},N.prototype.get_indent_size=function(d,m){return this.__indent_cache.get_indent_size(d,m)},N.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},N.prototype.add_new_line=function(d){return this.is_empty()||!d&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},N.prototype.get_code=function(d){this.trim(!0);var m=this.current_line.pop();m&&(m[m.length-1]===`
`&&(m=m.replace(/\n+$/g,"")),this.current_line.push(m)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
`);return d!==`
`&&(s=s.replace(/[\n]/g,d)),s},N.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},N.prototype.set_indent=function(d,m){return d=d||0,m=m||0,this.next_line.set_indent(d,m),this.__lines.length>1?(this.current_line.set_indent(d,m),!0):(this.current_line.set_indent(),!1)},N.prototype.add_raw_token=function(d){for(var m=0;m<d.newlines;m++)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},N.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()},N.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(" "))},N.prototype.remove_indent=function(d){for(var m=this.__lines.length;d<m;)this.__lines[d]._remove_indent(),d++;this.current_line._remove_wrap_indent()},N.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},N.prototype.just_added_newline=function(){return this.current_line.is_empty()},N.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},N.prototype.ensure_empty_line_above=function(d,m){for(var s=this.__lines.length-2;s>=0;){var g=this.__lines[s];if(g.is_empty())break;if(g.item(0).indexOf(d)!==0&&g.item(-1)!==m){this.__lines.splice(s+1,0,new W(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},n.exports.Output=N},function(n){function W(D,N,d,m){this.type=D,this.text=N,this.comments_before=null,this.newlines=d||0,this.whitespace_before=m||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}n.exports.Token=W},function(n,W){var D="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",N="\\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",m="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",s="(?:\\\\u[0-9a-fA-F]{4}|["+D+d+"])",g="(?:\\\\u[0-9a-fA-F]{4}|["+N+d+m+"])*";W.identifier=new RegExp(s+g,"g"),W.identifierStart=new RegExp(s),W.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+N+d+m+"])+");var h=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;W.newline=/[\n\r\u2028\u2029]/,W.lineBreak=new RegExp(`\r
|`+W.newline.source),W.allLineBreaks=new RegExp(W.lineBreak.source,"g")},function(n,W,D){var N=D(6).Options,d=["before-newline","after-newline","preserve-newline"];function m(s){N.call(this,s,"js");var g=this.raw_options.brace_style||null;g==="expand-strict"?this.raw_options.brace_style="expand":g==="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 h=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var _=0;_<h.length;_++)h[_]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=h[_];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)}m.prototype=new N,n.exports.Options=m},function(n){function W(d,m){this.raw_options=D(d,m),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"])}W.prototype._get_array=function(d,m){var s=this.raw_options[d],g=m||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(g=s.concat()):typeof s=="string"&&(g=s.split(/[^a-zA-Z0-9_\/\-]+/)),g},W.prototype._get_boolean=function(d,m){var s=this.raw_options[d],g=s===void 0?!!m:!!s;return g},W.prototype._get_characters=function(d,m){var s=this.raw_options[d],g=m||"";return typeof s=="string"&&(g=s.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),g},W.prototype._get_number=function(d,m){var s=this.raw_options[d];m=parseInt(m,10),isNaN(m)&&(m=0);var g=parseInt(s,10);return isNaN(g)&&(g=m),g},W.prototype._get_selection=function(d,m,s){var g=this._get_selection_list(d,m,s);if(g.length!==1)throw new Error("Invalid Option Value: The option '"+d+`' can only be one of the following values:
`+m+`
You passed in: '`+this.raw_options[d]+"'");return g[0]},W.prototype._get_selection_list=function(d,m,s){if(!m||m.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[m[0]],!this._is_valid_selection(s,m))throw new Error("Invalid Default Value!");var g=this._get_array(d,s);if(!this._is_valid_selection(g,m))throw new Error("Invalid Option Value: The option '"+d+`' can contain only the following values:
`+m+`
You passed in: '`+this.raw_options[d]+"'");return g},W.prototype._is_valid_selection=function(d,m){return d.length&&m.length&&!d.some(function(s){return m.indexOf(s)===-1})};function D(d,m){var s={};d=N(d);var g;for(g in d)g!==m&&(s[g]=d[g]);if(m&&d[m])for(g in d[m])s[g]=d[m][g];return s}function N(d){var m={},s;for(s in d){var g=s.replace(/-/g,"_");m[g]=d[s]}return m}n.exports.Options=W,n.exports.normalizeOpts=N,n.exports.mergeOpts=D},function(n,W,D){var N=D(8).InputScanner,d=D(9).Tokenizer,m=D(9).TOKEN,s=D(13).Directives,g=D(4),h=D(12).Pattern,_=D(14).TemplatablePattern;function r(o,a){return a.indexOf(o)!==-1}var v={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:m.START,RAW:m.RAW,EOF:m.EOF},S=new s(/\/\*/,/\*\//),w=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,I=/[0-9]/,E=/[^\d\.]/,x=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),P=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";P=P.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),P="\\?\\.(?!\\d) "+P,P=P.replace(/ /g,"|");var T=new RegExp(P),A="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),b=A.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),C=new RegExp("^(?:"+b.join("|")+")$"),p,i=function(o,a){d.call(this,o,a),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var L=new h(this._input),y=new _(this._input).read_options(this._options);this.__patterns={template:y,identifier:y.starting_with(g.identifier).matching(g.identifierMatch),number:L.matching(w),punct:L.matching(T),comment:L.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:L.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:L.matching(/<!--/),html_comment_end:L.matching(/-->/),include:L.starting_with(/#include/).until_after(g.lineBreak),shebang:L.starting_with(/#!/).until_after(g.lineBreak),xml:L.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:y.until(/['\\\n\r\u2028\u2029]/),double_quote:y.until(/["\\\n\r\u2028\u2029]/),template_text:y.until(/[`\\$]/),template_expression:y.until(/[`}\\]/)}};i.prototype=new d,i.prototype._is_comment=function(o){return o.type===v.COMMENT||o.type===v.BLOCK_COMMENT||o.type===v.UNKNOWN},i.prototype._is_opening=function(o){return o.type===v.START_BLOCK||o.type===v.START_EXPR},i.prototype._is_closing=function(o,a){return(o.type===v.END_BLOCK||o.type===v.END_EXPR)&&a&&(o.text==="]"&&a.text==="["||o.text===")"&&a.text==="("||o.text==="}"&&a.text==="{")},i.prototype._reset=function(){p=!1},i.prototype._get_next_token=function(o,a){var L=null;this._readWhitespace();var y=this._input.peek();return y===null?this._create_token(v.EOF,""):(L=L||this._read_non_javascript(y),L=L||this._read_string(y),L=L||this._read_word(o),L=L||this._read_singles(y),L=L||this._read_comment(y),L=L||this._read_regexp(y,o),L=L||this._read_xml(y,o),L=L||this._read_punctuation(),L=L||this._create_token(v.UNKNOWN,this._input.next()),L)},i.prototype._read_word=function(o){var a;if(a=this.__patterns.identifier.read(),a!=="")return a=a.replace(g.allLineBreaks,`
`),!(o.type===v.DOT||o.type===v.RESERVED&&(o.text==="set"||o.text==="get"))&&C.test(a)?(a==="in"||a==="of")&&(o.type===v.WORD||o.type===v.STRING)?this._create_token(v.OPERATOR,a):this._create_token(v.RESERVED,a):this._create_token(v.WORD,a);if(a=this.__patterns.number.read(),a!=="")return this._create_token(v.WORD,a)},i.prototype._read_singles=function(o){var a=null;return o==="("||o==="["?a=this._create_token(v.START_EXPR,o):o===")"||o==="]"?a=this._create_token(v.END_EXPR,o):o==="{"?a=this._create_token(v.START_BLOCK,o):o==="}"?a=this._create_token(v.END_BLOCK,o):o===";"?a=this._create_token(v.SEMICOLON,o):o==="."&&E.test(this._input.peek(1))?a=this._create_token(v.DOT,o):o===","&&(a=this._create_token(v.COMMA,o)),a&&this._input.next(),a},i.prototype._read_punctuation=function(){var o=this.__patterns.punct.read();if(o!=="")return o==="="?this._create_token(v.EQUALS,o):o==="?."?this._create_token(v.DOT,o):this._create_token(v.OPERATOR,o)},i.prototype._read_non_javascript=function(o){var a="";if(o==="#"){if(this._is_first_token()&&(a=this.__patterns.shebang.read(),a))return this._create_token(v.UNKNOWN,a.trim()+`
`);if(a=this.__patterns.include.read(),a)return this._create_token(v.UNKNOWN,a.trim()+`
`);o=this._input.next();var L="#";if(this._input.hasNext()&&this._input.testChar(I)){do o=this._input.next(),L+=o;while(this._input.hasNext()&&o!=="#"&&o!=="=");return o==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(L+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(L+="{}",this._input.next(),this._input.next())),this._create_token(v.WORD,L)}this._input.back()}else if(o==="<"&&this._is_first_token()){if(a=this.__patterns.html_comment_start.read(),a){for(;this._input.hasNext()&&!this._input.testChar(g.newline);)a+=this._input.next();return p=!0,this._create_token(v.COMMENT,a)}}else if(p&&o==="-"&&(a=this.__patterns.html_comment_end.read(),a))return p=!1,this._create_token(v.COMMENT,a);return null},i.prototype._read_comment=function(o){var a=null;if(o==="/"){var L="";if(this._input.peek(1)==="*"){L=this.__patterns.block_comment.read();var y=S.get_directives(L);y&&y.ignore==="start"&&(L+=S.readIgnored(this._input)),L=L.replace(g.allLineBreaks,`
`),a=this._create_token(v.BLOCK_COMMENT,L),a.directives=y}else this._input.peek(1)==="/"&&(L=this.__patterns.comment.read(),a=this._create_token(v.COMMENT,L))}return a},i.prototype._read_string=function(o){if(o==="`"||o==="'"||o==='"'){var a=this._input.next();return this.has_char_escapes=!1,o==="`"?a+=this._read_string_recursive("`",!0,"${"):a+=this._read_string_recursive(o),this.has_char_escapes&&this._options.unescape_strings&&(a=f(a)),this._input.peek()===o&&(a+=this._input.next()),a=a.replace(g.allLineBreaks,`
`),this._create_token(v.STRING,a)}return null},i.prototype._allow_regexp_or_xml=function(o){return o.type===v.RESERVED&&r(o.text,["return","case","throw","else","do","typeof","yield"])||o.type===v.END_EXPR&&o.text===")"&&o.opened.previous.type===v.RESERVED&&r(o.opened.previous.text,["if","while","for"])||r(o.type,[v.COMMENT,v.START_EXPR,v.START_BLOCK,v.START,v.END_BLOCK,v.OPERATOR,v.EQUALS,v.EOF,v.SEMICOLON,v.COMMA])},i.prototype._read_regexp=function(o,a){if(o==="/"&&this._allow_regexp_or_xml(a)){for(var L=this._input.next(),y=!1,l=!1;this._input.hasNext()&&(y||l||this._input.peek()!==o)&&!this._input.testChar(g.newline);)L+=this._input.peek(),y?y=!1:(y=this._input.peek()==="\\",this._input.peek()==="["?l=!0:this._input.peek()==="]"&&(l=!1)),this._input.next();return this._input.peek()===o&&(L+=this._input.next(),L+=this._input.read(g.identifier)),this._create_token(v.STRING,L)}return null},i.prototype._read_xml=function(o,a){if(this._options.e4x&&o==="<"&&this._allow_regexp_or_xml(a)){var L="",y=this.__patterns.xml.read_match();if(y){for(var l=y[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),F=l.indexOf("{")===0,j=0;y;){var G=!!y[1],Y=y[2],te=!!y[y.length-1]||Y.slice(0,8)==="![CDATA[";if(!te&&(Y===l||F&&Y.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(G?--j:++j),L+=y[0],j<=0)break;y=this.__patterns.xml.read_match()}return y||(L+=this._input.match(/[\s\S]*/g)[0]),L=L.replace(g.allLineBreaks,`
`),this._create_token(v.STRING,L)}}return null};function f(o){for(var a="",L=0,y=new N(o),l=null;y.hasNext();)if(l=y.match(/([\s]|[^\\]|\\\\)+/g),l&&(a+=l[0]),y.peek()==="\\"){if(y.next(),y.peek()==="x")l=y.match(/x([0-9A-Fa-f]{2})/g);else if(y.peek()==="u")l=y.match(/u([0-9A-Fa-f]{4})/g);else{a+="\\",y.hasNext()&&(a+=y.next());continue}if(!l)return o;if(L=parseInt(l[1],16),L>126&&L<=255&&l[0].indexOf("x")===0)return o;if(L>=0&&L<32){a+="\\"+l[0];continue}else L===34||L===39||L===92?a+="\\"+String.fromCharCode(L):a+=String.fromCharCode(L)}return a}i.prototype._read_string_recursive=function(o,a,L){var y,l;o==="'"?l=this.__patterns.single_quote:o==='"'?l=this.__patterns.double_quote:o==="`"?l=this.__patterns.template_text:o==="}"&&(l=this.__patterns.template_expression);for(var F=l.read(),j="";this._input.hasNext();){if(j=this._input.next(),j===o||!a&&g.newline.test(j)){this._input.back();break}else j==="\\"&&this._input.hasNext()?(y=this._input.peek(),y==="x"||y==="u"?this.has_char_escapes=!0:y==="\r"&&this._input.peek(1)===`
`&&this._input.next(),j+=this._input.next()):L&&(L==="${"&&j==="$"&&this._input.peek()==="{"&&(j+=this._input.next()),L===j&&(o==="`"?j+=this._read_string_recursive("}",a,"`"):j+=this._read_string_recursive("`",a,"${"),this._input.hasNext()&&(j+=this._input.next())));j+=l.read(),F+=j}return F},n.exports.Tokenizer=i,n.exports.TOKEN=v,n.exports.positionable_operators=x.slice(),n.exports.line_starters=A.slice()},function(n){var W=RegExp.prototype.hasOwnProperty("sticky");function D(N){this.__input=N||"",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 N=null;return this.hasNext()&&(N=this.__input.charAt(this.__position),this.__position+=1),N},D.prototype.peek=function(N){var d=null;return N=N||0,N+=this.__position,N>=0&&N<this.__input_length&&(d=this.__input.charAt(N)),d},D.prototype.__match=function(N,d){N.lastIndex=d;var m=N.exec(this.__input);return m&&!(W&&N.sticky)&&(m.index!==d&&(m=null)),m},D.prototype.test=function(N,d){return d=d||0,d+=this.__position,d>=0&&d<this.__input_length?!!this.__match(N,d):!1},D.prototype.testChar=function(N,d){var m=this.peek(d);return N.lastIndex=0,m!==null&&N.test(m)},D.prototype.match=function(N){var d=this.__match(N,this.__position);return d?this.__position+=d[0].length:d=null,d},D.prototype.read=function(N,d,m){var s="",g;return N&&(g=this.match(N),g&&(s+=g[0])),d&&(g||!N)&&(s+=this.readUntil(d,m)),s},D.prototype.readUntil=function(N,d){var m="",s=this.__position;N.lastIndex=this.__position;var g=N.exec(this.__input);return g?(s=g.index,d&&(s+=g[0].length)):s=this.__input_length,m=this.__input.substring(this.__position,s),this.__position=s,m},D.prototype.readUntilAfter=function(N){return this.readUntil(N,!0)},D.prototype.get_regexp=function(N,d){var m=null,s="g";return d&&W&&(s="y"),typeof N=="string"&&N!==""?m=new RegExp(N,s):N&&(m=new RegExp(N.source,s)),m},D.prototype.get_literal_regexp=function(N){return RegExp(N.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},D.prototype.peekUntilAfter=function(N){var d=this.__position,m=this.readUntilAfter(N);return this.__position=d,m},D.prototype.lookBack=function(N){var d=this.__position-1;return d>=N.length&&this.__input.substring(d-N.length,d).toLowerCase()===N},n.exports.InputScanner=D},function(n,W,D){var N=D(8).InputScanner,d=D(3).Token,m=D(10).TokenStream,s=D(11).WhitespacePattern,g={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},h=function(_,r){this._input=new N(_),this._options=r||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};h.prototype.tokenize=function(){this._input.restart(),this.__tokens=new m,this._reset();for(var _,r=new d(g.START,""),v=null,S=[],w=new m;r.type!==g.EOF;){for(_=this._get_next_token(r,v);this._is_comment(_);)w.add(_),_=this._get_next_token(r,v);w.isEmpty()||(_.comments_before=w,w=new m),_.parent=v,this._is_opening(_)?(S.push(v),v=_):v&&this._is_closing(_,v)&&(_.opened=v,v.closed=_,v=S.pop(),_.parent=v),_.previous=r,r.next=_,this.__tokens.add(_),r=_}return this.__tokens},h.prototype._is_first_token=function(){return this.__tokens.isEmpty()},h.prototype._reset=function(){},h.prototype._get_next_token=function(_,r){this._readWhitespace();var v=this._input.read(/.+/g);return v?this._create_token(g.RAW,v):this._create_token(g.EOF,"")},h.prototype._is_comment=function(_){return!1},h.prototype._is_opening=function(_){return!1},h.prototype._is_closing=function(_,r){return!1},h.prototype._create_token=function(_,r){var v=new d(_,r,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return v},h.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},n.exports.Tokenizer=h,n.exports.TOKEN=g},function(n){function W(D){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=D}W.prototype.restart=function(){this.__position=0},W.prototype.isEmpty=function(){return this.__tokens_length===0},W.prototype.hasNext=function(){return this.__position<this.__tokens_length},W.prototype.next=function(){var D=null;return this.hasNext()&&(D=this.__tokens[this.__position],this.__position+=1),D},W.prototype.peek=function(D){var N=null;return D=D||0,D+=this.__position,D>=0&&D<this.__tokens_length&&(N=this.__tokens[D]),N},W.prototype.add=function(D){this.__parent_token&&(D.parent=this.__parent_token),this.__tokens.push(D),this.__tokens_length+=1},n.exports.TokenStream=W},function(n,W,D){var N=D(12).Pattern;function d(m,s){N.call(this,m,s),s?this._line_regexp=this._input.get_regexp(s._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}d.prototype=new N,d.prototype.__set_whitespace_patterns=function(m,s){m+="\\t ",s+="\\n\\r",this._match_pattern=this._input.get_regexp("["+m+s+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+s+"]")},d.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var m=this._input.read(this._match_pattern);if(m===" ")this.whitespace_before_token=" ";else if(m){var s=this.__split(this._newline_regexp,m);this.newline_count=s.length-1,this.whitespace_before_token=s[this.newline_count]}return m},d.prototype.matching=function(m,s){var g=this._create();return g.__set_whitespace_patterns(m,s),g._update(),g},d.prototype._create=function(){return new d(this._input,this)},d.prototype.__split=function(m,s){m.lastIndex=0;for(var g=0,h=[],_=m.exec(s);_;)h.push(s.substring(g,_.index)),g=_.index+_[0].length,_=m.exec(s);return g<s.length?h.push(s.substring(g,s.length)):h.push(""),h},n.exports.WhitespacePattern=d},function(n){function W(D,N){this._input=D,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,N&&(this._starting_pattern=this._input.get_regexp(N._starting_pattern,!0),this._match_pattern=this._input.get_regexp(N._match_pattern,!0),this._until_pattern=this._input.get_regexp(N._until_pattern),this._until_after=N._until_after)}W.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},W.prototype.read_match=function(){return this._input.match(this._match_pattern)},W.prototype.until_after=function(D){var N=this._create();return N._until_after=!0,N._until_pattern=this._input.get_regexp(D),N._update(),N},W.prototype.until=function(D){var N=this._create();return N._until_after=!1,N._until_pattern=this._input.get_regexp(D),N._update(),N},W.prototype.starting_with=function(D){var N=this._create();return N._starting_pattern=this._input.get_regexp(D,!0),N._update(),N},W.prototype.matching=function(D){var N=this._create();return N._match_pattern=this._input.get_regexp(D,!0),N._update(),N},W.prototype._create=function(){return new W(this._input,this)},W.prototype._update=function(){},n.exports.Pattern=W},function(n){function W(D,N){D=typeof D=="string"?D:D.source,N=typeof N=="string"?N:N.source,this.__directives_block_pattern=new RegExp(D+/ beautify( \w+[:]\w+)+ /.source+N,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(D+/\sbeautify\signore:end\s/.source+N,"g")}W.prototype.get_directives=function(D){if(!D.match(this.__directives_block_pattern))return null;var N={};this.__directive_pattern.lastIndex=0;for(var d=this.__directive_pattern.exec(D);d;)N[d[1]]=d[2],d=this.__directive_pattern.exec(D);return N},W.prototype.readIgnored=function(D){return D.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=W},function(n,W,D){var N=D(12).Pattern,d={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function m(s,g){N.call(this,s,g),this.__template_pattern=null,this._disabled=Object.assign({},d),this._excluded=Object.assign({},d),g&&(this.__template_pattern=this._input.get_regexp(g.__template_pattern),this._excluded=Object.assign(this._excluded,g._excluded),this._disabled=Object.assign(this._disabled,g._disabled));var h=new N(s);this.__patterns={handlebars_comment:h.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:h.starting_with(/{{{/).until_after(/}}}/),handlebars:h.starting_with(/{{/).until_after(/}}/),php:h.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:h.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:h.starting_with(/{%/).until_after(/%}/),django_value:h.starting_with(/{{/).until_after(/}}/),django_comment:h.starting_with(/{#/).until_after(/#}/),smarty:h.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:h.starting_with(/{\*/).until_after(/\*}/),smarty_literal:h.starting_with(/{literal}/).until_after(/{\/literal}/)}}m.prototype=new N,m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){this.__set_templated_pattern()},m.prototype.disable=function(s){var g=this._create();return g._disabled[s]=!0,g._update(),g},m.prototype.read_options=function(s){var g=this._create();for(var h in d)g._disabled[h]=s.templating.indexOf(h)===-1;return g._update(),g},m.prototype.exclude=function(s){var g=this._create();return g._excluded[s]=!0,g._update(),g},m.prototype.read=function(){var s="";this._match_pattern?s=this._input.read(this._starting_pattern):s=this._input.read(this._starting_pattern,this.__template_pattern);for(var g=this._read_template();g;)this._match_pattern?g+=this._input.read(this._match_pattern):g+=this._input.readUntil(this.__template_pattern),s+=g,g=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},m.prototype.__set_templated_pattern=function(){var s=[];this._disabled.php||s.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||s.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||s.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(s.push(this.__patterns.django._starting_pattern.source),s.push(this.__patterns.django_value._starting_pattern.source),s.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||s.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&s.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+s.join("|")+")")},m.prototype._read_template=function(){var s="",g=this._input.peek();if(g==="<"){var h=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&h==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&h==="%"&&(s=s||this.__patterns.erb.read())}else g==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(s=s||this.__patterns.handlebars_comment.read(),s=s||this.__patterns.handlebars_unescaped.read(),s=s||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(s=s||this.__patterns.django_value.read()),this._excluded.django||(s=s||this.__patterns.django_comment.read(),s=s||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(s=s||this.__patterns.smarty_comment.read(),s=s||this.__patterns.smarty_literal.read(),s=s||this.__patterns.smarty.read()));return s},n.exports.TemplatablePattern=m}],z={};function R(n){var W=z[n];if(W!==void 0)return W.exports;var D=z[n]={exports:{}};return ae[n](D,D.exports,R),D.exports}var B=R(0);re=B})();var fe=re;!(q=[],ue=function(){return{js_beautify:fe}}.apply(ce,q),ue!==void 0&&(We.exports=ue))})()},"7+5b":function(We,ce,M){We.exports=M.p+"static/v.54a31e96.svg"},"746U":function(We,ce,M){"use strict";M.d(ce,"f",function(){return q}),M.d(ce,"l",function(){return ue}),M.d(ce,"k",function(){return re}),M.d(ce,"j",function(){return fe}),M.d(ce,"g",function(){return ae}),M.d(ce,"m",function(){return z}),M.d(ce,"h",function(){return R}),M.d(ce,"n",function(){return B}),M.d(ce,"c",function(){return n}),M.d(ce,"a",function(){return W}),M.d(ce,"i",function(){return D}),M.d(ce,"o",function(){return N}),M.d(ce,"e",function(){return s}),M.d(ce,"d",function(){return g}),M.d(ce,"p",function(){return h}),M.d(ce,"b",function(){return _});function q(r){return Array.isArray(r)}function ue(r){return typeof r=="string"}function re(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)&&!(r instanceof RegExp)&&!(r instanceof Date)}function fe(r){return typeof r=="number"&&!isNaN(r)}function ae(r){return r===!0||r===!1}function z(r){return typeof r=="undefined"}function R(r){return!B(r)}function B(r){return z(r)||r===null}function n(r,v){if(!r)throw new Error(v?`Unexpected type, expected '${v}'`:"Unexpected type")}function W(r){if(B(r))throw new Error("Assertion Failed: argument is undefined or null");return r}function D(r){return typeof r=="function"}function N(r,v){const S=Math.min(r.length,v.length);for(let w=0;w<S;w++)d(r[w],v[w])}function d(r,v){if(ue(v)){if(typeof r!==v)throw new Error(`argument does not match constraint: typeof ${v}`)}else if(D(v)){try{if(r instanceof v)return}catch(S){}if(!B(r)&&r.constructor===v)return;if(v.length===1&&v.call(void 0,r)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function m(r){let v=[],S=Object.getPrototypeOf(r);for(;Object.prototype!==S;)v=v.concat(Object.getOwnPropertyNames(S)),S=Object.getPrototypeOf(S);return v}function s(r){const v=[];for(const S of m(r))typeof r[S]=="function"&&v.push(S);return v}function g(r,v){const S=I=>function(){const E=Array.prototype.slice.call(arguments,0);return v(I,E)};let w={};for(const I of r)w[I]=S(I);return w}function h(r){return r===null?void 0:r}function _(r,v="Unreachable"){throw new Error(v)}},"7Cbv":function(We,ce,M){"use strict";var q=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),ue=new Uint8Array(16);function re(){if(!q)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return q(ue)}var fe=/^(?:[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 ae(d){return typeof d=="string"&&fe.test(d)}for(var z=ae,R=[],B=0;B<256;++B)R.push((B+256).toString(16).substr(1));function n(d){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=(R[d[m+0]]+R[d[m+1]]+R[d[m+2]]+R[d[m+3]]+"-"+R[d[m+4]]+R[d[m+5]]+"-"+R[d[m+6]]+R[d[m+7]]+"-"+R[d[m+8]]+R[d[m+9]]+"-"+R[d[m+10]]+R[d[m+11]]+R[d[m+12]]+R[d[m+13]]+R[d[m+14]]+R[d[m+15]]).toLowerCase();if(!z(s))throw TypeError("Stringified UUID is invalid");return s}var W=n;function D(d,m,s){d=d||{};var g=d.random||(d.rng||re)();if(g[6]=g[6]&15|64,g[8]=g[8]&63|128,m){s=s||0;for(var h=0;h<16;++h)m[s+h]=g[h];return m}return W(g)}var N=ce.a=D},"7J2G":function(We,ce,M){"use strict";M.d(ce,"a",function(){return I});var q=M("yuO0"),ue=M("XjgL"),re=M("6ASS"),fe=M("eA01"),ae=M("fXDJ"),z=M("BPTR"),R=M("udol"),B=M("T/Jt"),n=M.n(B),W=M("27eb"),D=M.n(W),N=function(x){var P,T="".concat(x.rootPrefixCls,"-item"),A=D()(T,"".concat(T,"-").concat(x.page),(P={},Object(ue.a)(P,"".concat(T,"-active"),x.active),Object(ue.a)(P,"".concat(T,"-disabled"),!x.page),Object(ue.a)(P,x.className,!!x.className),P)),b=function(){x.onClick(x.page)},C=function(i){x.onKeyPress(i,x.onClick,x.page)};return n.a.createElement("li",{title:x.showTitle?x.page:null,className:A,onClick:b,onKeyPress:C,tabIndex:"0"},x.itemRender(x.page,"page",n.a.createElement("a",{rel:"nofollow"},x.page)))},d=N,m={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},s=function(E){Object(z.a)(P,E);var x=Object(R.a)(P);function P(){var T;Object(fe.a)(this,P);for(var A=arguments.length,b=new Array(A),C=0;C<A;C++)b[C]=arguments[C];return T=x.call.apply(x,[this].concat(b)),T.state={goInputText:""},T.buildOptionText=function(p){return"".concat(p," ").concat(T.props.locale.items_per_page)},T.changeSize=function(p){T.props.changeSize(Number(p))},T.handleChange=function(p){T.setState({goInputText:p.target.value})},T.handleBlur=function(p){var i=T.props,f=i.goButton,o=i.quickGo,a=i.rootPrefixCls,L=T.state.goInputText;if(f||L==="")return;if(T.setState({goInputText:""}),p.relatedTarget&&(p.relatedTarget.className.indexOf("".concat(a,"-item-link"))>=0||p.relatedTarget.className.indexOf("".concat(a,"-item"))>=0))return;o(T.getValidValue())},T.go=function(p){var i=T.state.goInputText;if(i==="")return;(p.keyCode===m.ENTER||p.type==="click")&&(T.setState({goInputText:""}),T.props.quickGo(T.getValidValue()))},T}return Object(ae.a)(P,[{key:"getValidValue",value:function(){var A=this.state.goInputText;return!A||isNaN(A)?void 0:Number(A)}},{key:"getPageSizeOptions",value:function(){var A=this.props,b=A.pageSize,C=A.pageSizeOptions;return C.some(function(p){return p.toString()===b.toString()})?C:C.concat([b.toString()]).sort(function(p,i){var f=isNaN(Number(p))?0:Number(p),o=isNaN(Number(i))?0:Number(i);return f-o})}},{key:"render",value:function(){var A=this,b=this.props,C=b.pageSize,p=b.locale,i=b.rootPrefixCls,f=b.changeSize,o=b.quickGo,a=b.goButton,L=b.selectComponentClass,y=b.buildOptionText,l=b.selectPrefixCls,F=b.disabled,j=this.state.goInputText,G="".concat(i,"-options"),Y=L,te=null,de=null,ve=null;if(!f&&!o)return null;var he=this.getPageSizeOptions();if(f&&Y){var Re=he.map(function(we,ge){return n.a.createElement(Y.Option,{key:ge,value:we.toString()},(y||A.buildOptionText)(we))});te=n.a.createElement(Y,{disabled:F,prefixCls:l,showSearch:!1,className:"".concat(G,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(C||he[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ge){return ge.parentNode},"aria-label":p.page_size,defaultOpen:!1},Re)}return o&&(a&&(ve=typeof a=="boolean"?n.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:F,className:"".concat(G,"-quick-jumper-button")},p.jump_to_confirm):n.a.createElement("span",{onClick:this.go,onKeyUp:this.go},a)),de=n.a.createElement("div",{className:"".concat(G,"-quick-jumper")},p.jump_to,n.a.createElement("input",{disabled:F,type:"text",value:j,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur,"aria-label":p.page}),p.page,ve)),n.a.createElement("li",{className:"".concat(G)},te,de)}}]),P}(n.a.Component);s.defaultProps={pageSizeOptions:["10","20","50","100"]};var g=s,h=M("MbTZ");function _(){}function r(E){var x=Number(E);return typeof x=="number"&&!isNaN(x)&&isFinite(x)&&Math.floor(x)===x}function v(E,x,P){return P}function S(E,x,P){var T=typeof E=="undefined"?x.pageSize:E;return Math.floor((P.total-1)/T)+1}var w=function(E){Object(z.a)(P,E);var x=Object(R.a)(P);function P(T){var A;Object(fe.a)(this,P),A=x.call(this,T),A.getJumpPrevPage=function(){return Math.max(1,A.state.current-(A.props.showLessItems?3:5))},A.getJumpNextPage=function(){return Math.min(S(void 0,A.state,A.props),A.state.current+(A.props.showLessItems?3:5))},A.getItemIcon=function(f,o){var a=A.props.prefixCls,L=f||n.a.createElement("button",{type:"button","aria-label":o,className:"".concat(a,"-item-link")});return typeof f=="function"&&(L=n.a.createElement(f,Object(re.a)({},A.props))),L},A.savePaginationNode=function(f){A.paginationNode=f},A.isValid=function(f){var o=A.props.total;return r(f)&&f!==A.state.current&&r(o)&&o>0},A.shouldDisplayQuickJumper=function(){var f=A.props,o=f.showQuickJumper,a=f.total,L=A.state.pageSize;return a<=L?!1:o},A.handleKeyDown=function(f){(f.keyCode===m.ARROW_UP||f.keyCode===m.ARROW_DOWN)&&f.preventDefault()},A.handleKeyUp=function(f){var o=A.getValidValue(f),a=A.state.currentInputValue;o!==a&&A.setState({currentInputValue:o}),f.keyCode===m.ENTER?A.handleChange(o):f.keyCode===m.ARROW_UP?A.handleChange(o-1):f.keyCode===m.ARROW_DOWN&&A.handleChange(o+1)},A.handleBlur=function(f){var o=A.getValidValue(f);A.handleChange(o)},A.changePageSize=function(f){var o=A.state.current,a=S(f,A.state,A.props);o=o>a?a:o,a===0&&(o=A.state.current),typeof f=="number"&&("pageSize"in A.props||A.setState({pageSize:f}),"current"in A.props||A.setState({current:o,currentInputValue:o})),A.props.onShowSizeChange(o,f),"onChange"in A.props&&A.props.onChange&&A.props.onChange(o,f)},A.handleChange=function(f){var o=A.props,a=o.disabled,L=o.onChange,y=A.state,l=y.pageSize,F=y.current,j=y.currentInputValue;if(A.isValid(f)&&!a){var G=S(void 0,A.state,A.props),Y=f;return f>G?Y=G:f<1&&(Y=1),"current"in A.props||A.setState({current:Y}),Y!==j&&A.setState({currentInputValue:Y}),L(Y,l),Y}return F},A.prev=function(){A.hasPrev()&&A.handleChange(A.state.current-1)},A.next=function(){A.hasNext()&&A.handleChange(A.state.current+1)},A.jumpPrev=function(){A.handleChange(A.getJumpPrevPage())},A.jumpNext=function(){A.handleChange(A.getJumpNextPage())},A.hasPrev=function(){return A.state.current>1},A.hasNext=function(){return A.state.current<S(void 0,A.state,A.props)},A.runIfEnter=function(f,o){if(f.key==="Enter"||f.charCode===13){for(var a=arguments.length,L=new Array(a>2?a-2:0),y=2;y<a;y++)L[y-2]=arguments[y];o.apply(void 0,L)}},A.runIfEnterPrev=function(f){A.runIfEnter(f,A.prev)},A.runIfEnterNext=function(f){A.runIfEnter(f,A.next)},A.runIfEnterJumpPrev=function(f){A.runIfEnter(f,A.jumpPrev)},A.runIfEnterJumpNext=function(f){A.runIfEnter(f,A.jumpNext)},A.handleGoTO=function(f){(f.keyCode===m.ENTER||f.type==="click")&&A.handleChange(A.state.currentInputValue)};var b=T.onChange!==_,C="current"in T;C&&!b&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var p=T.defaultCurrent;"current"in T&&(p=T.current);var i=T.defaultPageSize;return"pageSize"in T&&(i=T.pageSize),p=Math.min(p,S(i,void 0,T)),A.state={current:p,currentInputValue:p,pageSize:i},A}return Object(ae.a)(P,[{key:"componentDidUpdate",value:function(A,b){var C=this.props.prefixCls;if(b.current!==this.state.current&&this.paginationNode){var p=this.paginationNode.querySelector(".".concat(C,"-item-").concat(b.current));p&&document.activeElement===p&&p.blur()}}},{key:"getValidValue",value:function(A){var b=A.target.value,C=S(void 0,this.state,this.props),p=this.state.currentInputValue,i;return b===""?i=b:isNaN(Number(b))?i=p:b>=C?i=C:i=Number(b),i}},{key:"getShowSizeChanger",value:function(){var A=this.props,b=A.showSizeChanger,C=A.total,p=A.totalBoundaryShowSizeChanger;return typeof b!="undefined"?b:C>p}},{key:"renderPrev",value:function(A){var b=this.props,C=b.prevIcon,p=b.itemRender,i=p(A,"prev",this.getItemIcon(C,"prev page")),f=!this.hasPrev();return Object(B.isValidElement)(i)?Object(B.cloneElement)(i,{disabled:f}):i}},{key:"renderNext",value:function(A){var b=this.props,C=b.nextIcon,p=b.itemRender,i=p(A,"next",this.getItemIcon(C,"next page")),f=!this.hasNext();return Object(B.isValidElement)(i)?Object(B.cloneElement)(i,{disabled:f}):i}},{key:"render",value:function(){var A=this,b=this.props,C=b.prefixCls,p=b.className,i=b.style,f=b.disabled,o=b.hideOnSinglePage,a=b.total,L=b.locale,y=b.showQuickJumper,l=b.showLessItems,F=b.showTitle,j=b.showTotal,G=b.simple,Y=b.itemRender,te=b.showPrevNextJumpers,de=b.jumpPrevIcon,ve=b.jumpNextIcon,he=b.selectComponentClass,Re=b.selectPrefixCls,we=b.pageSizeOptions,ge=this.state,Ne=ge.current,ze=ge.pageSize,nt=ge.currentInputValue;if(o===!0&&a<=ze)return null;var Ge=S(void 0,this.state,this.props),Xe=[],Be=null,_e=null,Ze=null,be=null,Le=null,le=y&&y.goButton,ye=l?1:2,Te=Ne-1>0?Ne-1:0,Pe=Ne+1<Ge?Ne+1:Ge,He=Object.keys(this.props).reduce(function(me,Ce){return(Ce.substr(0,5)==="data-"||Ce.substr(0,5)==="aria-"||Ce==="role")&&(me[Ce]=A.props[Ce]),me},{}),Ye=j&&n.a.createElement("li",{className:"".concat(C,"-total-text")},j(a,[a===0?0:(Ne-1)*ze+1,Ne*ze>a?a:Ne*ze]));if(G)return le&&(typeof le=="boolean"?Le=n.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},L.jump_to_confirm):Le=n.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},le),Le=n.a.createElement("li",{title:F?"".concat(L.jump_to).concat(Ne,"/").concat(Ge):null,className:"".concat(C,"-simple-pager")},Le)),n.a.createElement("ul",Object(q.a)({className:D()(C,"".concat(C,"-simple"),Object(ue.a)({},"".concat(C,"-disabled"),f),p),style:i,ref:this.savePaginationNode},He),Ye,n.a.createElement("li",{title:F?L.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:D()("".concat(C,"-prev"),Object(ue.a)({},"".concat(C,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Te)),n.a.createElement("li",{title:F?"".concat(Ne,"/").concat(Ge):null,className:"".concat(C,"-simple-pager")},n.a.createElement("input",{type:"text",value:nt,disabled:f,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,onBlur:this.handleBlur,size:"3"}),n.a.createElement("span",{className:"".concat(C,"-slash")},"/"),Ge),n.a.createElement("li",{title:F?L.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:D()("".concat(C,"-next"),Object(ue.a)({},"".concat(C,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Pe)),Le);if(Ge<=3+ye*2){var ct={locale:L,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:F,itemRender:Y};Ge||Xe.push(n.a.createElement(d,Object(q.a)({},ct,{key:"noPager",page:1,className:"".concat(C,"-item-disabled")})));for(var st=1;st<=Ge;st+=1){var vt=Ne===st;Xe.push(n.a.createElement(d,Object(q.a)({},ct,{key:st,page:st,active:vt})))}}else{var qe=l?L.prev_3:L.prev_5,mt=l?L.next_3:L.next_5;te&&(Be=n.a.createElement("li",{title:F?qe:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:D()("".concat(C,"-jump-prev"),Object(ue.a)({},"".concat(C,"-jump-prev-custom-icon"),!!de))},Y(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(de,"prev page"))),_e=n.a.createElement("li",{title:F?mt:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:D()("".concat(C,"-jump-next"),Object(ue.a)({},"".concat(C,"-jump-next-custom-icon"),!!ve))},Y(this.getJumpNextPage(),"jump-next",this.getItemIcon(ve,"next page")))),be=n.a.createElement(d,{locale:L,last:!0,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ge,page:Ge,active:!1,showTitle:F,itemRender:Y}),Ze=n.a.createElement(d,{locale:L,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:F,itemRender:Y});var yt=Math.max(1,Ne-ye),Je=Math.min(Ne+ye,Ge);Ne-1<=ye&&(Je=1+ye*2),Ge-Ne<=ye&&(yt=Ge-ye*2);for(var et=yt;et<=Je;et+=1){var De=Ne===et;Xe.push(n.a.createElement(d,{locale:L,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:et,page:et,active:De,showTitle:F,itemRender:Y}))}Ne-1>=ye*2&&Ne!==1+2&&(Xe[0]=Object(B.cloneElement)(Xe[0],{className:"".concat(C,"-item-after-jump-prev")}),Xe.unshift(Be)),Ge-Ne>=ye*2&&Ne!==Ge-2&&(Xe[Xe.length-1]=Object(B.cloneElement)(Xe[Xe.length-1],{className:"".concat(C,"-item-before-jump-next")}),Xe.push(_e)),yt!==1&&Xe.unshift(Ze),Je!==Ge&&Xe.push(be)}var ke=!this.hasPrev()||!Ge,Me=!this.hasNext()||!Ge;return n.a.createElement("ul",Object(q.a)({className:D()(C,p,Object(ue.a)({},"".concat(C,"-disabled"),f)),style:i,ref:this.savePaginationNode},He),Ye,n.a.createElement("li",{title:F?L.prev_page:null,onClick:this.prev,tabIndex:ke?null:0,onKeyPress:this.runIfEnterPrev,className:D()("".concat(C,"-prev"),Object(ue.a)({},"".concat(C,"-disabled"),ke)),"aria-disabled":ke},this.renderPrev(Te)),Xe,n.a.createElement("li",{title:F?L.next_page:null,onClick:this.next,tabIndex:Me?null:0,onKeyPress:this.runIfEnterNext,className:D()("".concat(C,"-next"),Object(ue.a)({},"".concat(C,"-disabled"),Me)),"aria-disabled":Me},this.renderNext(Pe)),n.a.createElement(g,{disabled:f,locale:L,rootPrefixCls:C,selectComponentClass:he,selectPrefixCls:Re,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Ne,pageSize:ze,pageSizeOptions:we,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:le}))}}],[{key:"getDerivedStateFromProps",value:function(A,b){var C={};if("current"in A&&(C.current=A.current,A.current!==b.current&&(C.currentInputValue=C.current)),"pageSize"in A&&A.pageSize!==b.pageSize){var p=b.current,i=S(A.pageSize,b,A);p=p>i?i:p,"current"in A||(C.current=p,C.currentInputValue=p),C.pageSize=A.pageSize}return C}}]),P}(n.a.Component);w.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:_,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:_,locale:h.a,style:{},itemRender:v,totalBoundaryShowSizeChanger:50};var I=w},"7O0G":function(We,ce,M){(function(q,ue){We.exports=ue()})(this,function(){"use strict";function q(De,ke){for(var Me=0;Me<ke.length;Me++){var me=ke[Me];me.enumerable=me.enumerable||!1,me.configurable=!0,"value"in me&&(me.writable=!0),Object.defineProperty(De,me.key,me)}}function ue(De,ke,Me){return ke&&q(De.prototype,ke),Me&&q(De,Me),De}function re(De,ke){if(!De)return;if(typeof De=="string")return fe(De,ke);var Me=Object.prototype.toString.call(De).slice(8,-1);if(Me==="Object"&&De.constructor&&(Me=De.constructor.name),Me==="Map"||Me==="Set")return Array.from(De);if(Me==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Me))return fe(De,ke)}function fe(De,ke){(ke==null||ke>De.length)&&(ke=De.length);for(var Me=0,me=new Array(ke);Me<ke;Me++)me[Me]=De[Me];return me}function ae(De,ke){var Me;if(typeof Symbol=="undefined"||De[Symbol.iterator]==null){if(Array.isArray(De)||(Me=re(De))||ke&&De&&typeof De.length=="number"){Me&&(De=Me);var me=0;return function(){return me>=De.length?{done:!0}:{done:!1,value:De[me++]}}}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 Me=De[Symbol.iterator](),Me.next.bind(Me)}function z(De,ke){return ke={exports:{}},De(ke,ke.exports),ke.exports}var R=z(function(De){function ke(){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 Me(me){De.exports.defaults=me}De.exports={defaults:ke(),getDefaults:ke,changeDefaults:Me}}),B=R.defaults,n=R.getDefaults,W=R.changeDefaults,D=/[&<>"']/,N=/[&<>"']/g,d=/[<>"']|&(?!#?\w+;)/,m=/[<>"']|&(?!#?\w+;)/g,s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},g=function(ke){return s[ke]};function h(De,ke){if(ke){if(D.test(De))return De.replace(N,g)}else if(d.test(De))return De.replace(m,g);return De}var _=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function r(De){return De.replace(_,function(ke,Me){return Me=Me.toLowerCase(),Me==="colon"?":":Me.charAt(0)==="#"?Me.charAt(1)==="x"?String.fromCharCode(parseInt(Me.substring(2),16)):String.fromCharCode(+Me.substring(1)):""})}var v=/(^|[^\[])\^/g;function S(De,ke){De=De.source||De,ke=ke||"";var Me={replace:function(Ce,Oe){return Oe=Oe.source||Oe,Oe=Oe.replace(v,"$1"),De=De.replace(Ce,Oe),Me},getRegex:function(){return new RegExp(De,ke)}};return Me}var w=/[^\w:]/g,I=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function E(De,ke,Me){if(De){var me;try{me=decodeURIComponent(r(Me)).replace(w,"").toLowerCase()}catch(Ce){return null}if(me.indexOf("javascript:")===0||me.indexOf("vbscript:")===0||me.indexOf("data:")===0)return null}ke&&!I.test(Me)&&(Me=b(ke,Me));try{Me=encodeURI(Me).replace(/%25/g,"%")}catch(Ce){return null}return Me}var x={},P=/^[^:]+:\/*[^/]*$/,T=/^([^:]+:)[\s\S]*$/,A=/^([^:]+:\/*[^/]*)[\s\S]*$/;function b(De,ke){x[" "+De]||(P.test(De)?x[" "+De]=De+"/":x[" "+De]=f(De,"/",!0)),De=x[" "+De];var Me=De.indexOf(":")===-1;return ke.substring(0,2)==="//"?Me?ke:De.replace(T,"$1")+ke:ke.charAt(0)==="/"?Me?ke:De.replace(A,"$1")+ke:De+ke}var C={exec:function(){}};function p(De){for(var ke=1,Me,me;ke<arguments.length;ke++){Me=arguments[ke];for(me in Me)Object.prototype.hasOwnProperty.call(Me,me)&&(De[me]=Me[me])}return De}function i(De,ke){var Me=De.replace(/\|/g,function(Oe,Se,Fe){for(var it=!1,Ie=Se;--Ie>=0&&Fe[Ie]==="\\";)it=!it;return it?"|":" |"}),me=Me.split(/ \|/),Ce=0;if(me.length>ke)me.splice(ke);else for(;me.length<ke;)me.push("");for(;Ce<me.length;Ce++)me[Ce]=me[Ce].trim().replace(/\\\|/g,"|");return me}function f(De,ke,Me){var me=De.length;if(me===0)return"";for(var Ce=0;Ce<me;){var Oe=De.charAt(me-Ce-1);if(Oe===ke&&!Me)Ce++;else if(Oe!==ke&&Me)Ce++;else break}return De.substr(0,me-Ce)}function o(De,ke){if(De.indexOf(ke[1])===-1)return-1;for(var Me=De.length,me=0,Ce=0;Ce<Me;Ce++)if(De[Ce]==="\\")Ce++;else if(De[Ce]===ke[0])me++;else if(De[Ce]===ke[1]&&(me--,me<0))return Ce;return-1}function a(De){De&&De.sanitize&&!De.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 L={escape:h,unescape:r,edit:S,cleanUrl:E,resolveUrl:b,noopTest:C,merge:p,splitCells:i,rtrim:f,findClosingBracket:o,checkSanitizeDeprecation:a},y=R.defaults,l=L.rtrim,F=L.splitCells,j=L.escape,G=L.findClosingBracket;function Y(De,ke,Me){var me=ke.href,Ce=ke.title?j(ke.title):null,Oe=De[1].replace(/\\([\[\]])/g,"$1");return De[0].charAt(0)!=="!"?{type:"link",raw:Me,href:me,title:Ce,text:Oe}:{type:"image",raw:Me,href:me,title:Ce,text:j(Oe)}}function te(De,ke){var Me=De.match(/^(\s+)(?:```)/);if(Me===null)return ke;var me=Me[1];return ke.split(`
`).map(function(Ce){var Oe=Ce.match(/^\s+/);if(Oe===null)return Ce;var Se=Oe[0];return Se.length>=me.length?Ce.slice(me.length):Ce}).join(`
`)}var de=function(){function De(Me){this.options=Me||y}var ke=De.prototype;return ke.space=function(me){var Ce=this.rules.block.newline.exec(me);if(Ce)return Ce[0].length>1?{type:"space",raw:Ce[0]}:{raw:`
`}},ke.code=function(me,Ce){var Oe=this.rules.block.code.exec(me);if(Oe){var Se=Ce[Ce.length-1];if(Se&&Se.type==="paragraph")return{raw:Oe[0],text:Oe[0].trimRight()};var Fe=Oe[0].replace(/^ {4}/gm,"");return{type:"code",raw:Oe[0],codeBlockStyle:"indented",text:this.options.pedantic?Fe:l(Fe,`
`)}}},ke.fences=function(me){var Ce=this.rules.block.fences.exec(me);if(Ce){var Oe=Ce[0],Se=te(Oe,Ce[3]||"");return{type:"code",raw:Oe,lang:Ce[2]?Ce[2].trim():Ce[2],text:Se}}},ke.heading=function(me){var Ce=this.rules.block.heading.exec(me);if(Ce)return{type:"heading",raw:Ce[0],depth:Ce[1].length,text:Ce[2]}},ke.nptable=function(me){var Ce=this.rules.block.nptable.exec(me);if(Ce){var Oe={type:"table",header:F(Ce[1].replace(/^ *| *\| *$/g,"")),align:Ce[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ce[3]?Ce[3].replace(/\n$/,"").split(`
`):[],raw:Ce[0]};if(Oe.header.length===Oe.align.length){var Se=Oe.align.length,Fe;for(Fe=0;Fe<Se;Fe++)/^ *-+: *$/.test(Oe.align[Fe])?Oe.align[Fe]="right":/^ *:-+: *$/.test(Oe.align[Fe])?Oe.align[Fe]="center":/^ *:-+ *$/.test(Oe.align[Fe])?Oe.align[Fe]="left":Oe.align[Fe]=null;for(Se=Oe.cells.length,Fe=0;Fe<Se;Fe++)Oe.cells[Fe]=F(Oe.cells[Fe],Oe.header.length);return Oe}}},ke.hr=function(me){var Ce=this.rules.block.hr.exec(me);if(Ce)return{type:"hr",raw:Ce[0]}},ke.blockquote=function(me){var Ce=this.rules.block.blockquote.exec(me);if(Ce){var Oe=Ce[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Ce[0],text:Oe}}},ke.list=function(me){var Ce=this.rules.block.list.exec(me);if(Ce){for(var Oe=Ce[0],Se=Ce[2],Fe=Se.length>1,it=Se[Se.length-1]===")",Ie={type:"list",raw:Oe,ordered:Fe,start:Fe?+Se.slice(0,-1):"",loose:!1,items:[]},Qe=Ce[0].match(this.rules.block.item),rt=!1,ft,It,Tt,Et,Ct,dt,Nt,Xt=Qe.length,Dt=0;Dt<Xt;Dt++)ft=Qe[Dt],Oe=ft,It=ft.length,ft=ft.replace(/^ *([*+-]|\d+[.)]) */,""),~ft.indexOf(`
`)&&(It-=ft.length,ft=this.options.pedantic?ft.replace(/^ {1,4}/gm,""):ft.replace(new RegExp("^ {1,"+It+"}","gm"),"")),Dt!==Xt-1&&(Tt=this.rules.block.bullet.exec(Qe[Dt+1])[0],(Fe?Tt.length===1||!it&&Tt[Tt.length-1]===")":Tt.length>1||this.options.smartLists&&Tt!==Se)&&(Et=Qe.slice(Dt+1).join(`
`),Ie.raw=Ie.raw.substring(0,Ie.raw.length-Et.length),Dt=Xt-1)),Ct=rt||/\n\n(?!\s*$)/.test(ft),Dt!==Xt-1&&(rt=ft.charAt(ft.length-1)===`
`,Ct||(Ct=rt)),Ct&&(Ie.loose=!0),dt=/^\[[ xX]\] /.test(ft),Nt=void 0,dt&&(Nt=ft[1]!==" ",ft=ft.replace(/^\[[ xX]\] +/,"")),Ie.items.push({type:"list_item",raw:Oe,task:dt,checked:Nt,loose:Ct,text:ft});return Ie}},ke.html=function(me){var Ce=this.rules.block.html.exec(me);if(Ce)return{type:this.options.sanitize?"paragraph":"html",raw:Ce[0],pre:!this.options.sanitizer&&(Ce[1]==="pre"||Ce[1]==="script"||Ce[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ce[0]):j(Ce[0]):Ce[0]}},ke.def=function(me){var Ce=this.rules.block.def.exec(me);if(Ce){Ce[3]&&(Ce[3]=Ce[3].substring(1,Ce[3].length-1));var Oe=Ce[1].toLowerCase().replace(/\s+/g," ");return{tag:Oe,raw:Ce[0],href:Ce[2],title:Ce[3]}}},ke.table=function(me){var Ce=this.rules.block.table.exec(me);if(Ce){var Oe={type:"table",header:F(Ce[1].replace(/^ *| *\| *$/g,"")),align:Ce[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ce[3]?Ce[3].replace(/\n$/,"").split(`
`):[]};if(Oe.header.length===Oe.align.length){Oe.raw=Ce[0];var Se=Oe.align.length,Fe;for(Fe=0;Fe<Se;Fe++)/^ *-+: *$/.test(Oe.align[Fe])?Oe.align[Fe]="right":/^ *:-+: *$/.test(Oe.align[Fe])?Oe.align[Fe]="center":/^ *:-+ *$/.test(Oe.align[Fe])?Oe.align[Fe]="left":Oe.align[Fe]=null;for(Se=Oe.cells.length,Fe=0;Fe<Se;Fe++)Oe.cells[Fe]=F(Oe.cells[Fe].replace(/^ *\| *| *\| *$/g,""),Oe.header.length);return Oe}}},ke.lheading=function(me){var Ce=this.rules.block.lheading.exec(me);if(Ce)return{type:"heading",raw:Ce[0],depth:Ce[2].charAt(0)==="="?1:2,text:Ce[1]}},ke.paragraph=function(me){var Ce=this.rules.block.paragraph.exec(me);if(Ce)return{type:"paragraph",raw:Ce[0],text:Ce[1].charAt(Ce[1].length-1)===`
`?Ce[1].slice(0,-1):Ce[1]}},ke.text=function(me,Ce){var Oe=this.rules.block.text.exec(me);if(Oe){var Se=Ce[Ce.length-1];return Se&&Se.type==="text"?{raw:Oe[0],text:Oe[0]}:{type:"text",raw:Oe[0],text:Oe[0]}}},ke.escape=function(me){var Ce=this.rules.inline.escape.exec(me);if(Ce)return{type:"escape",raw:Ce[0],text:j(Ce[1])}},ke.tag=function(me,Ce,Oe){var Se=this.rules.inline.tag.exec(me);if(Se)return!Ce&&/^<a /i.test(Se[0])?Ce=!0:Ce&&/^<\/a>/i.test(Se[0])&&(Ce=!1),!Oe&&/^<(pre|code|kbd|script)(\s|>)/i.test(Se[0])?Oe=!0:Oe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Se[0])&&(Oe=!1),{type:this.options.sanitize?"text":"html",raw:Se[0],inLink:Ce,inRawBlock:Oe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Se[0]):j(Se[0]):Se[0]}},ke.link=function(me){var Ce=this.rules.inline.link.exec(me);if(Ce){var Oe=G(Ce[2],"()");if(Oe>-1){var Se=Ce[0].indexOf("!")===0?5:4,Fe=Se+Ce[1].length+Oe;Ce[2]=Ce[2].substring(0,Oe),Ce[0]=Ce[0].substring(0,Fe).trim(),Ce[3]=""}var it=Ce[2],Ie="";if(this.options.pedantic){var Qe=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(it);Qe?(it=Qe[1],Ie=Qe[3]):Ie=""}else Ie=Ce[3]?Ce[3].slice(1,-1):"";it=it.trim().replace(/^<([\s\S]*)>$/,"$1");var rt=Y(Ce,{href:it&&it.replace(this.rules.inline._escapes,"$1"),title:Ie&&Ie.replace(this.rules.inline._escapes,"$1")},Ce[0]);return rt}},ke.reflink=function(me,Ce){var Oe;if((Oe=this.rules.inline.reflink.exec(me))||(Oe=this.rules.inline.nolink.exec(me))){var Se=(Oe[2]||Oe[1]).replace(/\s+/g," ");if(Se=Ce[Se.toLowerCase()],!Se||!Se.href){var Fe=Oe[0].charAt(0);return{type:"text",raw:Fe,text:Fe}}var it=Y(Oe,Se,Oe[0]);return it}},ke.strong=function(me,Ce,Oe){Oe===void 0&&(Oe="");var Se=this.rules.inline.strong.start.exec(me);if(Se&&(!Se[1]||Se[1]&&(Oe===""||this.rules.inline.punctuation.exec(Oe)))){Ce=Ce.slice(-1*me.length);var Fe=Se[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Fe.lastIndex=0;for(var it;(Se=Fe.exec(Ce))!=null;)if(it=this.rules.inline.strong.middle.exec(Ce.slice(0,Se.index+3)),it)return{type:"strong",raw:me.slice(0,it[0].length),text:me.slice(2,it[0].length-2)}}},ke.em=function(me,Ce,Oe){Oe===void 0&&(Oe="");var Se=this.rules.inline.em.start.exec(me);if(Se&&(!Se[1]||Se[1]&&(Oe===""||this.rules.inline.punctuation.exec(Oe)))){Ce=Ce.slice(-1*me.length);var Fe=Se[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Fe.lastIndex=0;for(var it;(Se=Fe.exec(Ce))!=null;)if(it=this.rules.inline.em.middle.exec(Ce.slice(0,Se.index+2)),it)return{type:"em",raw:me.slice(0,it[0].length),text:me.slice(1,it[0].length-1)}}},ke.codespan=function(me){var Ce=this.rules.inline.code.exec(me);if(Ce){var Oe=Ce[2].replace(/\n/g," "),Se=/[^ ]/.test(Oe),Fe=Oe.startsWith(" ")&&Oe.endsWith(" ");return Se&&Fe&&(Oe=Oe.substring(1,Oe.length-1)),Oe=j(Oe,!0),{type:"codespan",raw:Ce[0],text:Oe}}},ke.br=function(me){var Ce=this.rules.inline.br.exec(me);if(Ce)return{type:"br",raw:Ce[0]}},ke.del=function(me){var Ce=this.rules.inline.del.exec(me);if(Ce)return{type:"del",raw:Ce[0],text:Ce[1]}},ke.autolink=function(me,Ce){var Oe=this.rules.inline.autolink.exec(me);if(Oe){var Se,Fe;return Oe[2]==="@"?(Se=j(this.options.mangle?Ce(Oe[1]):Oe[1]),Fe="mailto:"+Se):(Se=j(Oe[1]),Fe=Se),{type:"link",raw:Oe[0],text:Se,href:Fe,tokens:[{type:"text",raw:Se,text:Se}]}}},ke.url=function(me,Ce){var Oe;if(Oe=this.rules.inline.url.exec(me)){var Se,Fe;if(Oe[2]==="@")Se=j(this.options.mangle?Ce(Oe[0]):Oe[0]),Fe="mailto:"+Se;else{var it;do it=Oe[0],Oe[0]=this.rules.inline._backpedal.exec(Oe[0])[0];while(it!==Oe[0]);Se=j(Oe[0]),Oe[1]==="www."?Fe="http://"+Se:Fe=Se}return{type:"link",raw:Oe[0],text:Se,href:Fe,tokens:[{type:"text",raw:Se,text:Se}]}}},ke.inlineText=function(me,Ce,Oe){var Se=this.rules.inline.text.exec(me);if(Se){var Fe;return Ce?Fe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Se[0]):j(Se[0]):Se[0]:Fe=j(this.options.smartypants?Oe(Se[0]):Se[0]),{type:"text",raw:Se[0],text:Fe}}},De}(),ve=L.noopTest,he=L.edit,Re=L.merge,we={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:ve,table:ve,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};we._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,we._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,we.def=he(we.def).replace("label",we._label).replace("title",we._title).getRegex(),we.bullet=/(?:[*+-]|\d{1,9}[.)])/,we.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,we.item=he(we.item,"gm").replace(/bull/g,we.bullet).getRegex(),we.list=he(we.list).replace(/bull/g,we.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+we.def.source+")").getRegex(),we._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",we._comment=/<!--(?!-?>)[\s\S]*?-->/,we.html=he(we.html,"i").replace("comment",we._comment).replace("tag",we._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),we.paragraph=he(we._paragraph).replace("hr",we.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",we._tag).getRegex(),we.blockquote=he(we.blockquote).replace("paragraph",we.paragraph).getRegex(),we.normal=Re({},we),we.gfm=Re({},we.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*|$)"}),we.gfm.nptable=he(we.gfm.nptable).replace("hr",we.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",we._tag).getRegex(),we.gfm.table=he(we.gfm.table).replace("hr",we.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",we._tag).getRegex(),we.pedantic=Re({},we.normal,{html:he(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",we._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:ve,paragraph:he(we.normal._paragraph).replace("hr",we.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",we.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ge={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ve,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:ve,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ge._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ge.punctuation=he(ge.punctuation).replace(/punctuation/g,ge._punctuation).getRegex(),ge._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ge._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ge.em.start=he(ge.em.start).replace(/punctuation/g,ge._punctuation).getRegex(),ge.em.middle=he(ge.em.middle).replace(/punctuation/g,ge._punctuation).replace(/overlapSkip/g,ge._overlapSkip).getRegex(),ge.em.endAst=he(ge.em.endAst,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.em.endUnd=he(ge.em.endUnd,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.strong.start=he(ge.strong.start).replace(/punctuation/g,ge._punctuation).getRegex(),ge.strong.middle=he(ge.strong.middle).replace(/punctuation/g,ge._punctuation).replace(/blockSkip/g,ge._blockSkip).getRegex(),ge.strong.endAst=he(ge.strong.endAst,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.strong.endUnd=he(ge.strong.endUnd,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.blockSkip=he(ge._blockSkip,"g").getRegex(),ge.overlapSkip=he(ge._overlapSkip,"g").getRegex(),ge._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ge._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ge._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])?)+(?![-_])/,ge.autolink=he(ge.autolink).replace("scheme",ge._scheme).replace("email",ge._email).getRegex(),ge._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ge.tag=he(ge.tag).replace("comment",we._comment).replace("attribute",ge._attribute).getRegex(),ge._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ge._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ge._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ge.link=he(ge.link).replace("label",ge._label).replace("href",ge._href).replace("title",ge._title).getRegex(),ge.reflink=he(ge.reflink).replace("label",ge._label).getRegex(),ge.reflinkSearch=he(ge.reflinkSearch,"g").replace("reflink",ge.reflink).replace("nolink",ge.nolink).getRegex(),ge.normal=Re({},ge),ge.pedantic=Re({},ge.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:he(/^!?\[(label)\]\((.*?)\)/).replace("label",ge._label).getRegex(),reflink:he(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ge._label).getRegex()}),ge.gfm=Re({},ge.normal,{escape:he(ge.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),ge.gfm.url=he(ge.gfm.url,"i").replace("email",ge.gfm._extended_email).getRegex(),ge.breaks=Re({},ge.gfm,{br:he(ge.br).replace("{2,}","*").getRegex(),text:he(ge.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Ne={block:we,inline:ge},ze=R.defaults,nt=Ne.block,Ge=Ne.inline;function Xe(De){return De.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 Be(De){var ke="",Me,me,Ce=De.length;for(Me=0;Me<Ce;Me++)me=De.charCodeAt(Me),Math.random()>.5&&(me="x"+me.toString(16)),ke+="&#"+me+";";return ke}var _e=function(){function De(Me){this.tokens=[],this.tokens.links=Object.create(null),this.options=Me||ze,this.options.tokenizer=this.options.tokenizer||new de,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var me={block:nt.normal,inline:Ge.normal};this.options.pedantic?(me.block=nt.pedantic,me.inline=Ge.pedantic):this.options.gfm&&(me.block=nt.gfm,this.options.breaks?me.inline=Ge.breaks:me.inline=Ge.gfm),this.tokenizer.rules=me}De.lex=function(me,Ce){var Oe=new De(Ce);return Oe.lex(me)};var ke=De.prototype;return ke.lex=function(me){return me=me.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(me,this.tokens,!0),this.inline(this.tokens),this.tokens},ke.blockTokens=function(me,Ce,Oe){Ce===void 0&&(Ce=[]),Oe===void 0&&(Oe=!0),me=me.replace(/^ +$/gm,"");for(var Se,Fe,it,Ie;me;){if(Se=this.tokenizer.space(me)){me=me.substring(Se.raw.length),Se.type&&Ce.push(Se);continue}if(Se=this.tokenizer.code(me,Ce)){me=me.substring(Se.raw.length),Se.type?Ce.push(Se):(Ie=Ce[Ce.length-1],Ie.raw+=`
`+Se.raw,Ie.text+=`
`+Se.text);continue}if(Se=this.tokenizer.fences(me)){me=me.substring(Se.raw.length),Ce.push(Se);continue}if(Se=this.tokenizer.heading(me)){me=me.substring(Se.raw.length),Ce.push(Se);continue}if(Se=this.tokenizer.nptable(me)){me=me.substring(Se.raw.length),Ce.push(Se);continue}if(Se=this.tokenizer.hr(me)){me=me.substring(Se.raw.length),Ce.push(Se);continue}if(Se=this.tokenizer.blockquote(me)){me=me.substring(Se.raw.length),Se.tokens=this.blockTokens(Se.text,[],Oe),Ce.push(Se);continue}if(Se=this.tokenizer.list(me)){for(me=me.substring(Se.raw.length),it=Se.items.length,Fe=0;Fe<it;Fe++)Se.items[Fe].tokens=this.blockTokens(Se.items[Fe].text,[],!1);Ce.push(Se);continue}if(Se=this.tokenizer.html(me)){me=me.substring(Se.raw.length),Ce.push(Se);continue}if(Oe&&(Se=this.tokenizer.def(me))){me=me.substring(Se.raw.length),this.tokens.links[Se.tag]||(this.tokens.links[Se.tag]={href:Se.href,title:Se.title});continue}if(Se=this.tokenizer.table(me)){me=me.substring(Se.raw.length),Ce.push(Se);continue}if(Se=this.tokenizer.lheading(me)){me=me.substring(Se.raw.length),Ce.push(Se);continue}if(Oe&&(Se=this.tokenizer.paragraph(me))){me=me.substring(Se.raw.length),Ce.push(Se);continue}if(Se=this.tokenizer.text(me,Ce)){me=me.substring(Se.raw.length),Se.type?Ce.push(Se):(Ie=Ce[Ce.length-1],Ie.raw+=`
`+Se.raw,Ie.text+=`
`+Se.text);continue}if(me){var Qe="Infinite loop on byte: "+me.charCodeAt(0);if(this.options.silent){console.error(Qe);break}else throw new Error(Qe)}}return Ce},ke.inline=function(me){var Ce,Oe,Se,Fe,it,Ie,Qe=me.length;for(Ce=0;Ce<Qe;Ce++){Ie=me[Ce];switch(Ie.type){case"paragraph":case"text":case"heading":{Ie.tokens=[],this.inlineTokens(Ie.text,Ie.tokens);break}case"table":{for(Ie.tokens={header:[],cells:[]},Fe=Ie.header.length,Oe=0;Oe<Fe;Oe++)Ie.tokens.header[Oe]=[],this.inlineTokens(Ie.header[Oe],Ie.tokens.header[Oe]);for(Fe=Ie.cells.length,Oe=0;Oe<Fe;Oe++)for(it=Ie.cells[Oe],Ie.tokens.cells[Oe]=[],Se=0;Se<it.length;Se++)Ie.tokens.cells[Oe][Se]=[],this.inlineTokens(it[Se],Ie.tokens.cells[Oe][Se]);break}case"blockquote":{this.inline(Ie.tokens);break}case"list":{for(Fe=Ie.items.length,Oe=0;Oe<Fe;Oe++)this.inline(Ie.items[Oe].tokens);break}}}return me},ke.inlineTokens=function(me,Ce,Oe,Se,Fe){Ce===void 0&&(Ce=[]),Oe===void 0&&(Oe=!1),Se===void 0&&(Se=!1),Fe===void 0&&(Fe="");var it,Ie=me,Qe;if(this.tokens.links){var rt=Object.keys(this.tokens.links);if(rt.length>0)for(;(Qe=this.tokenizer.rules.inline.reflinkSearch.exec(Ie))!=null;)rt.includes(Qe[0].slice(Qe[0].lastIndexOf("[")+1,-1))&&(Ie=Ie.slice(0,Qe.index)+"["+"a".repeat(Qe[0].length-2)+"]"+Ie.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Qe=this.tokenizer.rules.inline.blockSkip.exec(Ie))!=null;)Ie=Ie.slice(0,Qe.index)+"["+"a".repeat(Qe[0].length-2)+"]"+Ie.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;me;){if(it=this.tokenizer.escape(me)){me=me.substring(it.raw.length),Ce.push(it);continue}if(it=this.tokenizer.tag(me,Oe,Se)){me=me.substring(it.raw.length),Oe=it.inLink,Se=it.inRawBlock,Ce.push(it);continue}if(it=this.tokenizer.link(me)){me=me.substring(it.raw.length),it.type==="link"&&(it.tokens=this.inlineTokens(it.text,[],!0,Se)),Ce.push(it);continue}if(it=this.tokenizer.reflink(me,this.tokens.links)){me=me.substring(it.raw.length),it.type==="link"&&(it.tokens=this.inlineTokens(it.text,[],!0,Se)),Ce.push(it);continue}if(it=this.tokenizer.strong(me,Ie,Fe)){me=me.substring(it.raw.length),it.tokens=this.inlineTokens(it.text,[],Oe,Se),Ce.push(it);continue}if(it=this.tokenizer.em(me,Ie,Fe)){me=me.substring(it.raw.length),it.tokens=this.inlineTokens(it.text,[],Oe,Se),Ce.push(it);continue}if(it=this.tokenizer.codespan(me)){me=me.substring(it.raw.length),Ce.push(it);continue}if(it=this.tokenizer.br(me)){me=me.substring(it.raw.length),Ce.push(it);continue}if(it=this.tokenizer.del(me)){me=me.substring(it.raw.length),it.tokens=this.inlineTokens(it.text,[],Oe,Se),Ce.push(it);continue}if(it=this.tokenizer.autolink(me,Be)){me=me.substring(it.raw.length),Ce.push(it);continue}if(!Oe&&(it=this.tokenizer.url(me,Be))){me=me.substring(it.raw.length),Ce.push(it);continue}if(it=this.tokenizer.inlineText(me,Se,Xe)){me=me.substring(it.raw.length),Fe=it.raw.slice(-1),Ce.push(it);continue}if(me){var ft="Infinite loop on byte: "+me.charCodeAt(0);if(this.options.silent){console.error(ft);break}else throw new Error(ft)}}return Ce},ue(De,null,[{key:"rules",get:function(){return{block:nt,inline:Ge}}}]),De}(),Ze=R.defaults,be=L.cleanUrl,Le=L.escape,le=function(){function De(Me){this.options=Me||Ze}var ke=De.prototype;return ke.code=function(me,Ce,Oe){var Se=(Ce||"").match(/\S*/)[0];if(this.options.highlight){var Fe=this.options.highlight(me,Se);Fe!=null&&Fe!==me&&(Oe=!0,me=Fe)}return Se?'<pre><code class="'+this.options.langPrefix+Le(Se,!0)+'">'+(Oe?me:Le(me,!0))+`</code></pre>
`:"<pre><code>"+(Oe?me:Le(me,!0))+`</code></pre>
`},ke.blockquote=function(me){return`<blockquote>
`+me+`</blockquote>
`},ke.html=function(me){return me},ke.heading=function(me,Ce,Oe,Se){return this.options.headerIds?"<h"+Ce+' id="'+this.options.headerPrefix+Se.slug(Oe)+'">'+me+"</h"+Ce+`>
`:"<h"+Ce+">"+me+"</h"+Ce+`>
`},ke.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},ke.list=function(me,Ce,Oe){var Se=Ce?"ol":"ul",Fe=Ce&&Oe!==1?' start="'+Oe+'"':"";return"<"+Se+Fe+`>
`+me+"</"+Se+`>
`},ke.listitem=function(me){return"<li>"+me+`</li>
`},ke.checkbox=function(me){return"<input "+(me?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ke.paragraph=function(me){return"<p>"+me+`</p>
`},ke.table=function(me,Ce){return Ce&&(Ce="<tbody>"+Ce+"</tbody>"),`<table>
<thead>
`+me+`</thead>
`+Ce+`</table>
`},ke.tablerow=function(me){return`<tr>
`+me+`</tr>
`},ke.tablecell=function(me,Ce){var Oe=Ce.header?"th":"td",Se=Ce.align?"<"+Oe+' align="'+Ce.align+'">':"<"+Oe+">";return Se+me+"</"+Oe+`>
`},ke.strong=function(me){return"<strong>"+me+"</strong>"},ke.em=function(me){return"<em>"+me+"</em>"},ke.codespan=function(me){return"<code>"+me+"</code>"},ke.br=function(){return this.options.xhtml?"<br/>":"<br>"},ke.del=function(me){return"<del>"+me+"</del>"},ke.link=function(me,Ce,Oe){if(me=be(this.options.sanitize,this.options.baseUrl,me),me===null)return Oe;var Se='<a href="'+Le(me)+'"';return Ce&&(Se+=' title="'+Ce+'"'),Se+=">"+Oe+"</a>",Se},ke.image=function(me,Ce,Oe){if(me=be(this.options.sanitize,this.options.baseUrl,me),me===null)return Oe;var Se='<img src="'+me+'" alt="'+Oe+'"';return Ce&&(Se+=' title="'+Ce+'"'),Se+=this.options.xhtml?"/>":">",Se},ke.text=function(me){return me},De}(),ye=function(){function De(){}var ke=De.prototype;return ke.strong=function(me){return me},ke.em=function(me){return me},ke.codespan=function(me){return me},ke.del=function(me){return me},ke.html=function(me){return me},ke.text=function(me){return me},ke.link=function(me,Ce,Oe){return""+Oe},ke.image=function(me,Ce,Oe){return""+Oe},ke.br=function(){return""},De}(),Te=function(){function De(){this.seen={}}var ke=De.prototype;return ke.slug=function(me){var Ce=me.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Ce)){var Oe=Ce;do this.seen[Oe]++,Ce=Oe+"-"+this.seen[Oe];while(this.seen.hasOwnProperty(Ce))}return this.seen[Ce]=0,Ce},De}(),Pe=R.defaults,He=L.unescape,Ye=function(){function De(Me){this.options=Me||Pe,this.options.renderer=this.options.renderer||new le,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ye,this.slugger=new Te}De.parse=function(me,Ce){var Oe=new De(Ce);return Oe.parse(me)};var ke=De.prototype;return ke.parse=function(me,Ce){Ce===void 0&&(Ce=!0);var Oe="",Se,Fe,it,Ie,Qe,rt,ft,It,Tt,Et,Ct,dt,Nt,Xt,Dt,an,nn,An,_n=me.length;for(Se=0;Se<_n;Se++){Et=me[Se];switch(Et.type){case"space":continue;case"hr":{Oe+=this.renderer.hr();continue}case"heading":{Oe+=this.renderer.heading(this.parseInline(Et.tokens),Et.depth,He(this.parseInline(Et.tokens,this.textRenderer)),this.slugger);continue}case"code":{Oe+=this.renderer.code(Et.text,Et.lang,Et.escaped);continue}case"table":{for(It="",ft="",Ie=Et.header.length,Fe=0;Fe<Ie;Fe++)ft+=this.renderer.tablecell(this.parseInline(Et.tokens.header[Fe]),{header:!0,align:Et.align[Fe]});for(It+=this.renderer.tablerow(ft),Tt="",Ie=Et.cells.length,Fe=0;Fe<Ie;Fe++){for(rt=Et.tokens.cells[Fe],ft="",Qe=rt.length,it=0;it<Qe;it++)ft+=this.renderer.tablecell(this.parseInline(rt[it]),{header:!1,align:Et.align[it]});Tt+=this.renderer.tablerow(ft)}Oe+=this.renderer.table(It,Tt);continue}case"blockquote":{Tt=this.parse(Et.tokens),Oe+=this.renderer.blockquote(Tt);continue}case"list":{for(Ct=Et.ordered,dt=Et.start,Nt=Et.loose,Ie=Et.items.length,Tt="",Fe=0;Fe<Ie;Fe++)Dt=Et.items[Fe],an=Dt.checked,nn=Dt.task,Xt="",Dt.task&&(An=this.renderer.checkbox(an),Nt?Dt.tokens.length>0&&Dt.tokens[0].type==="text"?(Dt.tokens[0].text=An+" "+Dt.tokens[0].text,Dt.tokens[0].tokens&&Dt.tokens[0].tokens.length>0&&Dt.tokens[0].tokens[0].type==="text"&&(Dt.tokens[0].tokens[0].text=An+" "+Dt.tokens[0].tokens[0].text)):Dt.tokens.unshift({type:"text",text:An}):Xt+=An),Xt+=this.parse(Dt.tokens,Nt),Tt+=this.renderer.listitem(Xt,nn,an);Oe+=this.renderer.list(Tt,Ct,dt);continue}case"html":{Oe+=this.renderer.html(Et.text);continue}case"paragraph":{Oe+=this.renderer.paragraph(this.parseInline(Et.tokens));continue}case"text":{for(Tt=Et.tokens?this.parseInline(Et.tokens):Et.text;Se+1<_n&&me[Se+1].type==="text";)Et=me[++Se],Tt+=`
`+(Et.tokens?this.parseInline(Et.tokens):Et.text);Oe+=Ce?this.renderer.paragraph(Tt):Tt;continue}default:{var At='Token with "'+Et.type+'" type was not found.';if(this.options.silent){console.error(At);return}else throw new Error(At)}}}return Oe},ke.parseInline=function(me,Ce){Ce=Ce||this.renderer;var Oe="",Se,Fe,it=me.length;for(Se=0;Se<it;Se++){Fe=me[Se];switch(Fe.type){case"escape":{Oe+=Ce.text(Fe.text);break}case"html":{Oe+=Ce.html(Fe.text);break}case"link":{Oe+=Ce.link(Fe.href,Fe.title,this.parseInline(Fe.tokens,Ce));break}case"image":{Oe+=Ce.image(Fe.href,Fe.title,Fe.text);break}case"strong":{Oe+=Ce.strong(this.parseInline(Fe.tokens,Ce));break}case"em":{Oe+=Ce.em(this.parseInline(Fe.tokens,Ce));break}case"codespan":{Oe+=Ce.codespan(Fe.text);break}case"br":{Oe+=Ce.br();break}case"del":{Oe+=Ce.del(this.parseInline(Fe.tokens,Ce));break}case"text":{Oe+=Ce.text(Fe.text);break}default:{var Ie='Token with "'+Fe.type+'" type was not found.';if(this.options.silent){console.error(Ie);return}else throw new Error(Ie)}}}return Oe},De}(),ct=L.merge,st=L.checkSanitizeDeprecation,vt=L.escape,qe=R.getDefaults,mt=R.changeDefaults,yt=R.defaults;function Je(De,ke,Me){if(typeof De=="undefined"||De===null)throw new Error("marked(): input parameter is undefined or null");if(typeof De!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(De)+", string expected");if(typeof ke=="function"&&(Me=ke,ke=null),ke=ct({},Je.defaults,ke||{}),st(ke),Me){var me=ke.highlight,Ce;try{Ce=_e.lex(De,ke)}catch(it){return Me(it)}var Oe=function(Ie){var Qe;if(!Ie)try{Qe=Ye.parse(Ce,ke)}catch(rt){Ie=rt}return ke.highlight=me,Ie?Me(Ie):Me(null,Qe)};if(!me||me.length<3)return Oe();if(delete ke.highlight,!Ce.length)return Oe();var Se=0;Je.walkTokens(Ce,function(it){it.type==="code"&&(Se++,setTimeout(function(){me(it.text,it.lang,function(Ie,Qe){if(Ie)return Oe(Ie);Qe!=null&&Qe!==it.text&&(it.text=Qe,it.escaped=!0),Se--,Se===0&&Oe()})},0))}),Se===0&&Oe();return}try{var Fe=_e.lex(De,ke);return ke.walkTokens&&Je.walkTokens(Fe,ke.walkTokens),Ye.parse(Fe,ke)}catch(it){if(it.message+=`
Please report this to https://github.com/markedjs/marked.`,ke.silent)return"<p>An error occurred:</p><pre>"+vt(it.message+"",!0)+"</pre>";throw it}}Je.options=Je.setOptions=function(De){return ct(Je.defaults,De),mt(Je.defaults),Je},Je.getDefaults=qe,Je.defaults=yt,Je.use=function(De){var ke=ct({},De);if(De.renderer&&function(){var me=Je.defaults.renderer||new le,Ce=function(Fe){var it=me[Fe];me[Fe]=function(){for(var Ie=arguments.length,Qe=new Array(Ie),rt=0;rt<Ie;rt++)Qe[rt]=arguments[rt];var ft=De.renderer[Fe].apply(me,Qe);return ft===!1&&(ft=it.apply(me,Qe)),ft}};for(var Oe in De.renderer)Ce(Oe);ke.renderer=me}(),De.tokenizer&&function(){var me=Je.defaults.tokenizer||new de,Ce=function(Fe){var it=me[Fe];me[Fe]=function(){for(var Ie=arguments.length,Qe=new Array(Ie),rt=0;rt<Ie;rt++)Qe[rt]=arguments[rt];var ft=De.tokenizer[Fe].apply(me,Qe);return ft===!1&&(ft=it.apply(me,Qe)),ft}};for(var Oe in De.tokenizer)Ce(Oe);ke.tokenizer=me}(),De.walkTokens){var Me=Je.defaults.walkTokens;ke.walkTokens=function(me){De.walkTokens(me),Me&&Me(me)}}Je.setOptions(ke)},Je.walkTokens=function(De,ke){for(var Me=ae(De),me;!(me=Me()).done;){var Ce=me.value;ke(Ce);switch(Ce.type){case"table":{for(var Oe=ae(Ce.tokens.header),Se;!(Se=Oe()).done;){var Fe=Se.value;Je.walkTokens(Fe,ke)}for(var it=ae(Ce.tokens.cells),Ie;!(Ie=it()).done;)for(var Qe=Ie.value,rt=ae(Qe),ft;!(ft=rt()).done;){var It=ft.value;Je.walkTokens(It,ke)}break}case"list":{Je.walkTokens(Ce.items,ke);break}default:Ce.tokens&&Je.walkTokens(Ce.tokens,ke)}}},Je.Parser=Ye,Je.parser=Ye.parse,Je.Renderer=le,Je.TextRenderer=ye,Je.Lexer=_e,Je.lexer=_e.lex,Je.Tokenizer=de,Je.Slugger=Te,Je.parse=Je;var et=Je;return et})},"7ahc":function(We,ce,M){"use strict";M.d(ce,"a",function(){return S});var q=M("YaWb"),ue=M("HPgX"),re=M("dLI4"),fe=M("4d5L"),ae=M("y6Ii"),z=M("Wuip"),R=M("Hqw+"),B=M("FrBR"),n=M("SCzF"),W=M("T/Jt"),D=M.n(W),N=M("VrN/"),d=M.n(N),m=M("p77/"),s=M.n(m),g=M("c5Ni"),h=M.n(g),_=n.a.Option,r={labelCol:{span:4},wrapperCol:{span:20}},v={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"]};ce.b=function(w){var I=w.callback,E=w.onCancel,x=Object(W.useState)("python"),P=Object(R.a)(x,2),T=P[0],A=P[1];function b(p){A(v[p][1])}function C(p){I(p)}return D.a.createElement(z.a,Object(ue.a)({},r,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:C}),D.a.createElement(z.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},D.a.createElement(n.a,{onChange:b},Object.keys(v).map(function(p){return D.a.createElement(_,{key:p,value:p},v[p][0])}))),D.a.createElement(z.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},D.a.createElement(S,{mode:T})),D.a.createElement("div",{className:"flex-container flex-end"},D.a.createElement(fe.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),D.a.createElement(fe.a,{type:"ghost",onClick:E},"\u53D6\u6D88")))};function S(w){var I=w.value,E=w.onChange,x=w.mode,P=w.options,T=P===void 0?{}:P,A=Object(W.useRef)(),b=Object(W.useState)(),C=Object(R.a)(b,2),p=C[0],i=C[1];return Object(W.useEffect)(function(){if(p){function f(o){var a=o.getValue();E&&E(a)}return p.on("change",f),function(){p.off("change",f)}}},[p,E]),Object(W.useEffect)(function(){p&&p.setOption("mode",x)},[p,x]),Object(W.useEffect)(function(){p&&((I!==p.getValue()||I==="")&&setTimeout(function(){p.setValue(I||" ")},300))},[p,I]),Object(W.useEffect)(function(){if(A.current&&!p){var f=d.a.fromTextArea(A.current,Object(q.a)({mode:x,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},T));i(f)}},[A.current,p]),D.a.createElement("div",{className:"my-codemirror-container"},D.a.createElement("textarea",{ref:A}))}},"7qur":function(We,ce,M){"use strict";M.d(ce,"m",function(){return ue}),M.d(ce,"s",function(){return re}),M.d(ce,"h",function(){return fe}),M.d(ce,"o",function(){return ae}),M.d(ce,"n",function(){return z}),M.d(ce,"l",function(){return R}),M.d(ce,"b",function(){return B}),M.d(ce,"q",function(){return n}),M.d(ce,"t",function(){return W}),M.d(ce,"v",function(){return D}),M.d(ce,"w",function(){return N}),M.d(ce,"u",function(){return d}),M.d(ce,"p",function(){return m}),M.d(ce,"f",function(){return s}),M.d(ce,"a",function(){return g}),M.d(ce,"j",function(){return h}),M.d(ce,"k",function(){return _}),M.d(ce,"d",function(){return r}),M.d(ce,"g",function(){return v}),M.d(ce,"c",function(){return S}),M.d(ce,"e",function(){return w}),M.d(ce,"i",function(){return I}),M.d(ce,"r",function(){return E});var q=M("ErOA");function ue(x){return Object(q.c)("mypractices/".concat(x,".json"),{hidePopLogin:!0})}function re(x,P){return Object(q.f)("mypractices/".concat(x,"/code_submit.json"),P)}function fe(x,P){return Object(q.c)("mypractices/".concat(x,"/code_debug.json"),P)}function ae(x,P){return Object(q.c)("mypractices/".concat(x,"/submit_records.json"),P)}function z(x){return Object(q.c)("mypractices/record_detail.json",{id:x})}function R(x,P){return Object(q.c)("mypractices/".concat(x,"/result.json"),{mode:P})}function B(x,P){return Object(q.f)("mypractices/".concat(x,"/add_notes.json"),P)}function n(x,P){return Object(q.f)("mypractices/".concat(x,"/restore_initial_code.json"),P)}function W(x,P){return Object(q.f)("mypractices/".concat(x,"/sync_code.json"),P)}function D(x,P){return Object(q.f)("mypractices/".concat(x,"/update_code.json"),P)}function N(x){return Object(q.f)("mypractices/".concat(x,"/initial_codes.json"))}function d(x,P){return Object(q.f)("discusses/".concat(x,"/plus.json"),P)}function m(x){return Object(q.c)("practices/practices_list.json",x)}function s(x,P){return Object(q.c)("practices/".concat(x,"/question_solution_articles"),P)}function g(x,P){return Object(q.f)("practices/".concat(x,"/question_solution_articles"),P)}function h(x,P){return Object(q.g)("practices/".concat(x,"/question_solution_articles/").concat(P==null?void 0:P.active),P)}function _(x,P){return Object(q.c)("practices/".concat(x,"/question_solution_articles/").concat(P==null?void 0:P.active,"/edit"),P)}function r(x,P){return Object(q.c)("practices/".concat(x,"/question_solution_articles/").concat(P==null?void 0:P.active),P)}function v(x,P){return Object(q.f)("practices/".concat(x,"/question_solution_articles/").concat(P==null?void 0:P.active,"/set_authority_or_excellent"),P)}function S(x,P){return Object(q.f)("practices/".concat(x,"/question_solution_articles/").concat(P==null?void 0:P.active,"/praise_or_treads"),P)}function w(x,P){return Object(q.f)("practices/".concat(x,"/question_solution_articles/").concat(P==null?void 0:P.active,"/hide"))}function I(x,P){return Object(q.b)("practices/".concat(x,"/question_solution_articles/").concat(P==null?void 0:P.active),P)}function E(x,P){return Object(q.f)("mypractices/".concat(x,"/update_practice_time_sum"),P)}},"8EBN":function(We,ce,M){(function(q){q(M("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 ue=0;ue<q.modeInfo.length;ue++){var re=q.modeInfo[ue];re.mimes&&(re.mime=re.mimes[0])}q.findModeByMIME=function(fe){fe=fe.toLowerCase();for(var ae=0;ae<q.modeInfo.length;ae++){var z=q.modeInfo[ae];if(z.mime==fe)return z;if(z.mimes){for(var R=0;R<z.mimes.length;R++)if(z.mimes[R]==fe)return z}}if(/\+xml$/.test(fe))return q.findModeByMIME("application/xml");if(/\+json$/.test(fe))return q.findModeByMIME("application/json")},q.findModeByExtension=function(fe){fe=fe.toLowerCase();for(var ae=0;ae<q.modeInfo.length;ae++){var z=q.modeInfo[ae];if(z.ext){for(var R=0;R<z.ext.length;R++)if(z.ext[R]==fe)return z}}},q.findModeByFileName=function(fe){for(var ae=0;ae<q.modeInfo.length;ae++){var z=q.modeInfo[ae];if(z.file&&z.file.test(fe))return z}var R=fe.lastIndexOf("."),B=R>-1&&fe.substring(R+1,fe.length);if(B)return q.findModeByExtension(B)},q.findModeByName=function(fe){fe=fe.toLowerCase();for(var ae=0;ae<q.modeInfo.length;ae++){var z=q.modeInfo[ae];if(z.name.toLowerCase()==fe)return z;if(z.alias){for(var R=0;R<z.alias.length;R++)if(z.alias[R].toLowerCase()==fe)return z}}}})},"8HAY":function(We,ce,M){"use strict";M.d(ce,"a",function(){return ae}),M.d(ce,"b",function(){return z}),M.d(ce,"d",function(){return R}),M.d(ce,"e",function(){return B}),M.d(ce,"c",function(){return n});var q=M("MI8n"),ue=M("pmY6"),re=M("3/fG"),fe=function(W,D,N,d){function m(s){return s instanceof N?s:new N(function(g){g(s)})}return new(N||(N=Promise))(function(s,g){function h(v){try{r(d.next(v))}catch(S){g(S)}}function _(v){try{r(d.throw(v))}catch(S){g(S)}}function r(v){v.done?s(v.value):m(v.value).then(h,_)}r((d=d.apply(W,D||[])).next())})};class ae extends ue.a{constructor(W,D="",N="",d=!0,m){super();this._onDidChange=this._register(new q.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=W,this._label=D,this._cssClass=N,this._enabled=d,this._actionCallback=m}get id(){return this._id}get label(){return this._label}set label(W){this._setLabel(W)}_setLabel(W){this._label!==W&&(this._label=W,this._onDidChange.fire({label:W}))}get tooltip(){return this._tooltip||""}set tooltip(W){this._setTooltip(W)}_setTooltip(W){this._tooltip!==W&&(this._tooltip=W,this._onDidChange.fire({tooltip:W}))}get class(){return this._cssClass}set class(W){this._setClass(W)}_setClass(W){this._cssClass!==W&&(this._cssClass=W,this._onDidChange.fire({class:W}))}get enabled(){return this._enabled}set enabled(W){this._setEnabled(W)}_setEnabled(W){this._enabled!==W&&(this._enabled=W,this._onDidChange.fire({enabled:W}))}get checked(){return this._checked}set checked(W){this._setChecked(W)}_setChecked(W){this._checked!==W&&(this._checked=W,this._onDidChange.fire({checked:W}))}run(W,D){return fe(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(W))})}}class z extends ue.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(W,D){return fe(this,void 0,void 0,function*(){if(!W.enabled)return;this._onBeforeRun.fire({action:W});let N;try{yield this.runAction(W,D)}catch(d){N=d}this._onDidRun.fire({action:W,error:N})})}runAction(W,D){return fe(this,void 0,void 0,function*(){yield W.run(D)})}}class R extends ae{constructor(W){super(R.ID,W,W?"separator text":"separator");this.checked=!1,this.enabled=!1}}R.ID="vs.actions.separator";class B{constructor(W,D,N,d){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=W,this.label=D,this.class=d,this._actions=N}get actions(){return this._actions}dispose(){}run(){return fe(this,void 0,void 0,function*(){})}}class n extends ae{constructor(){super(n.ID,re.a("submenu.empty","(empty)"),void 0,!1)}}n.ID="vs.actions.empty"},"8hTe":function(We,ce,M){We.exports={button:"button___1wy9m"}},"9+Du":function(We,ce,M){"use strict";var q=M("YaWb"),ue=M("IYef"),re=M("Hqw+"),fe=M("XXmO"),ae=M.n(fe),z=M("T/Jt"),R=M.n(z),B=M("ErOA"),n=M("7Cbv"),W=M("TSYQ"),D=M.n(W),N=M("vef1"),d=M.n(N),m=function(g,h){var _=g.chunkSize,r=_===void 0?1024*1024*2:_,v=g.options,S=v===void 0?{}:v,w=g.onCancel,I=g.onComplete,E=g.onError,x=g.onProgress,P=g.onBefore,T=g.onBeginInitFile,A=g.children,b=g.accept,C=g.className,p=g.style,i=p===void 0?{}:p,f=g.concurrency,o=f===void 0?4:f,a=Object(z.useState)("ready"),L=Object(re.a)(a,2),y=L[0],l=L[1],F=Object(z.useState)(0),j=Object(re.a)(F,2),G=j[0],Y=j[1],te=Object(z.useState)(""),de=Object(re.a)(te,2),ve=de[0],he=de[1],Re=Object(z.useState)(null),we=Object(re.a)(Re,2),ge=we[0],Ne=we[1],ze=Object(z.useRef)(null),nt=Object(z.useRef)(Object(n.a)()),Ge=Object(z.useRef)(!1);Object(z.useImperativeHandle)(h,function(){return{cancel:_e,file:ge,uploadStatus:y}});var Xe=function(){var Le=document.getElementById(nt.current);Le&&(Le.value="")},Be=function(){var be=Object(ue.a)(ae.a.mark(function Le(le){var ye,Te;return ae.a.wrap(function(He){for(;;)switch(He.prev=He.next){case 0:if(!(y==="uploading")){He.next=2;break}return He.abrupt("return");case 2:return T&&T(le),ye=le.size,Te=Math.ceil(ye/r),Ge.current=!1,l("uploading"),Y(0),he(""),He.prev=9,He.delegateYield(ae.a.mark(function Ye(){var ct,st,vt,qe,mt,yt,Je,et,De,ke,Me,me;return ae.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:return Oe.next=2,Object(B.a)("/api/attachments/multipart_upload_start",{method:"POST",body:Object(q.a)({fileName:le.name,chunkCount:Te},S)});case 2:if(ct=Oe.sent,!(Ge.current||(ct==null?void 0:ct.status)!==0)){Oe.next=5;break}throw new Error;case 5:for(st=ct.upload_id,ze.current=new AbortController,vt=[],qe=0,mt=function(Fe){var it=Fe*r,Ie=Math.min(it+r,ye),Qe=le.slice(it,Ie),rt=new FormData;rt.append("chunk",Qe),rt.append("fileName",le.name),rt.append("chunkIndex",(Fe+1).toString()),rt.append("uploadId",st);for(var ft in S)Object.prototype.hasOwnProperty.call(S,ft)&&rt.append(ft,S[ft]);vt.push(function(){return Object(B.a)("/api/attachments/multipart_upload",{method:"POST",body:rt,signal:ze.current.signal},!0).then(function(It){qe++;var Tt=Math.round(qe/Te*100);Y(Tt),x&&x(Object(q.a)(Object(q.a)({},It),{},{file:le,percent:Tt}))})})},yt=0;yt<Te;yt++)mt(yt);Je=0,et=o;case 13:if(!(Je<vt.length)){Oe.next=22;break}if(ke=(De=vt.slice(Je,Je+et))===null||De===void 0?void 0:De.map(function(Se){return Se()}),!(ke.length>0)){Oe.next=20;break}return Oe.next=18,Promise.all(ke);case 18:Me=Oe.sent,Je+=et;case 20:Oe.next=13;break;case 22:return Oe.next=24,Object(B.a)("/api/attachments/multipart_upload_end",{method:"POST",body:Object(q.a)({fileName:le.name,chunkCount:Te,uploadId:st},S)});case 24:me=Oe.sent,me.object?(l("success"),Xe(),I&&I(Object(q.a)(Object(q.a)({},me),{},{file:le,percent:100}))):(l("error"),he("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"),Xe(),E&&E(le.name));case 26:case"end":return Oe.stop()}},Ye)})(),"t0",11);case 11:He.next=19;break;case 13:He.prev=13,He.t1=He.catch(9),l("error"),he("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"),Xe(),E&&E(le.name);case 19:case"end":return He.stop()}},Le,null,[[9,13]])}));return function(le){return be.apply(this,arguments)}}(),_e=Object(z.useCallback)(function(){Ge.current=!0,ze.current&&(ze.current.abort(),w&&w())},[w]),Ze=function(Le){var le,ye,Te=Le==null||((le=Le.target)===null||le===void 0||((ye=le.files)===null||ye===void 0))?void 0:ye[0];if(Ne(Te),y="ready",!Te)return;if(P){var Pe=P(Te);Pe||Be(Te),Xe();return}Be(Te)};return R.a.createElement(z.Fragment,null,R.a.createElement("input",{type:"file",id:nt.current,style:{display:"none"},onChange:Ze,accept:b}),R.a.createElement("label",{className:D()(d.a.upload,C),htmlFor:nt.current,style:i},A))};ce.a=Object(z.forwardRef)(m)},"9Bee":function(We,ce,M){"use strict";var q=M("CDKA"),ue=M("d7ih"),re=M("dLI4"),fe=M("4d5L"),ae=M("YaWb"),z=M("IYef"),R=M("Hqw+"),B=M("XXmO"),n=M.n(B),W=M("T/Jt"),D=M.n(W),N=M("vg9a"),d=M("7O0G"),m=M.n(d),s=M("GcTH");function g(Q,k){var U=Q.match(/^(\s+)(?:```)/);if(U===null)return k;var X=U[1];return k.split(`
`).map(function(ie){var J=ie.match(/^\s+/);if(J===null)return ie;var Ae=Object(R.a)(J,1),tt=Ae[0];return tt.length>=X.length?ie.slice(X.length):ie}).join(`
`)}var h=[],_=["<ul>"],r=new m.a.Renderer,v=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function S(){h.length=0,_=["<ul>"]}var w={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function I(Q,k,U,X){if(k>=Q.length||Q[k].level<=U)return k;var ie=Q[k];X.push("<li><a href='#"+ie.anchor+"'>"+ie.text+"</a>"),k++;var J=[];return k=I(Q,k,ie.level,J),J.length>0&&(X.push("<ul>"),J.forEach(function(Ae){X.push(Ae)}),X.push("</ul>")),X.push("</li>"),k=I(Q,k,U,X),k}function E(){return I(h,0,0,_),_.push("</ul>"),_.join("")}var x={heading:function(k){var U=v.exec(k);if(U)return{type:"heading",raw:U[0],depth:U[1].length,text:U[2]}},fences:function(k){var U=this.rules.block.fences.exec(k);if(U){var X=U[0],ie=g(X,U[3]||""),J=U[2]?U[2].trim():U[2];if(["latex","katex","math"].indexOf(J)>=0){var Ae=A(),tt=ie;ie=Ae,b[Ae]={type:"block",expression:tt}}return{type:"code",raw:X,lang:J,text:ie}}}},P=/(?:\${2})([^\n`]+?)(?:\${2})/gi,T=0,A=function(){return"__special_katext_id_".concat(T++,"__")},b={};function C(){return b}function p(){T=0,b={}}function i(Q){return Q=Q.replace(P,function(k,U){var X=A();return b[X]={type:"inline",expression:U},X}),Q}var f=r.listitem;r.listitem=function(Q){return f(i(Q))};var o=r.paragraph;r.paragraph=function(Q){return o(i(Q))};var a=r.tablecell;r.tablecell=function(Q,k){return a(i(Q),k)},r.code=function(Q,k,U){var X=(k||"").match(/\S*/)[0];return X?["latex","katex","math"].indexOf(X)>=0?"<p class='editormd-tex'>".concat(Q,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(k,'">').concat(U?Q:Object(s.escape)(Q,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(U?Q:Object(s.escape)(Q,!0))+"</code></pre>"},r.heading=function(Q,k,U){var X=this.options.headerPrefix+U.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return h.push({anchor:X,level:k,text:Q}),"<h"+k+' id="'+X+'">'+Q+"</h"+k+">"},m.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),m.a.use({tokenizer:x,renderer:r});var L=m.a,y=M("SJMd"),l=M("ulZh"),F=M.n(l),j=M("m3rI"),G=M("Oy/b"),Y=M("p5ED"),te=M("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 de=function(Q,k){return(de=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(U,X){U.__proto__=X}||function(U,X){for(var ie in X)Object.prototype.hasOwnProperty.call(X,ie)&&(U[ie]=X[ie])})(Q,k)};function ve(Q,k){function U(){this.constructor=Q}de(Q,k),Q.prototype=k===null?Object.create(k):(U.prototype=k.prototype,new U)}function he(Q,k,U,X){return new(U||(U=Promise))(function(ie,J){function Ae(Mt){try{kt(X.next(Mt))}catch(gt){J(gt)}}function tt(Mt){try{kt(X.throw(Mt))}catch(gt){J(gt)}}function kt(Mt){var gt;Mt.done?ie(Mt.value):(gt=Mt.value,gt instanceof U?gt:new U(function($t){$t(gt)})).then(Ae,tt)}kt((X=X.apply(Q,k||[])).next())})}function Re(Q,k){var U,X,ie,J,Ae={label:0,sent:function(){if(1&ie[0])throw ie[1];return ie[1]},trys:[],ops:[]};return J={next:tt(0),throw:tt(1),return:tt(2)},typeof Symbol=="function"&&(J[Symbol.iterator]=function(){return this}),J;function tt(kt){return function(Mt){return function(gt){if(U)throw new TypeError("Generator is already executing.");for(;Ae;)try{if(U=1,X&&(ie=2&gt[0]?X.return:gt[0]?X.throw||((ie=X.return)&&ie.call(X),0):X.next)&&!(ie=ie.call(X,gt[1])).done)return ie;switch(X=0,ie&&(gt=[2&gt[0],ie.value]),gt[0]){case 0:case 1:ie=gt;break;case 4:return Ae.label++,{value:gt[1],done:!1};case 5:Ae.label++,X=gt[1],gt=[0];continue;case 7:gt=Ae.ops.pop(),Ae.trys.pop();continue;default:if(!(ie=Ae.trys,(ie=ie.length>0&&ie[ie.length-1])||gt[0]!==6&&gt[0]!==2)){Ae=0;continue}if(gt[0]===3&&(!ie||gt[1]>ie[0]&&gt[1]<ie[3])){Ae.label=gt[1];break}if(gt[0]===6&&Ae.label<ie[1]){Ae.label=ie[1],ie=gt;break}if(ie&&Ae.label<ie[2]){Ae.label=ie[2],Ae.ops.push(gt);break}ie[2]&&Ae.ops.pop(),Ae.trys.pop();continue}gt=k.call(Q,Ae)}catch($t){gt=[6,$t],X=0}finally{U=ie=0}if(5&gt[0])throw gt[1];return{value:gt[0]?gt[1]:void 0,done:!0}}([kt,Mt])}}}function we(){for(var Q=0,k=0,U=arguments.length;k<U;k++)Q+=arguments[k].length;var X=Array(Q),ie=0;for(k=0;k<U;k++)for(var J=arguments[k],Ae=0,tt=J.length;Ae<tt;Ae++,ie++)X[ie]=J[Ae];return X}var ge=function(){function Q(){}return Q.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Q.setAttributes=function(k,U){for(var X=0,ie=U;X<ie.length;X++){var J=ie[X],Ae=J[0],tt=J[1];k.setAttribute(Ae,tt)}},Q.createRect=function(k,U,X){var ie=document.createElementNS("http://www.w3.org/2000/svg","rect");return ie.setAttribute("width",k.toString()),ie.setAttribute("height",U.toString()),X&&Q.setAttributes(ie,X),ie},Q.createLine=function(k,U,X,ie,J){var Ae=document.createElementNS("http://www.w3.org/2000/svg","line");return Ae.setAttribute("x1",k.toString()),Ae.setAttribute("y1",U.toString()),Ae.setAttribute("x2",X.toString()),Ae.setAttribute("y2",ie.toString()),J&&Q.setAttributes(Ae,J),Ae},Q.createPolygon=function(k,U){var X=document.createElementNS("http://www.w3.org/2000/svg","polygon");return X.setAttribute("points",k),U&&Q.setAttributes(X,U),X},Q.createCircle=function(k,U){var X=document.createElementNS("http://www.w3.org/2000/svg","circle");return X.setAttribute("cx",(k/2).toString()),X.setAttribute("cy",(k/2).toString()),X.setAttribute("r",k.toString()),U&&Q.setAttributes(X,U),X},Q.createEllipse=function(k,U,X){var ie=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ie.setAttribute("cx",(k/2).toString()),ie.setAttribute("cy",(U/2).toString()),ie.setAttribute("rx",(k/2).toString()),ie.setAttribute("ry",(U/2).toString()),X&&Q.setAttributes(ie,X),ie},Q.createGroup=function(k){var U=document.createElementNS("http://www.w3.org/2000/svg","g");return k&&Q.setAttributes(U,k),U},Q.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Q.createMarker=function(k,U,X,ie,J,Ae,tt){var kt=document.createElementNS("http://www.w3.org/2000/svg","marker");return Q.setAttributes(kt,[["id",k],["orient",U],["markerWidth",X.toString()],["markerHeight",ie.toString()],["refX",J.toString()],["refY",Ae.toString()]]),kt.appendChild(tt),kt},Q.createText=function(k){var U=document.createElementNS("http://www.w3.org/2000/svg","text");return U.setAttribute("x","0"),U.setAttribute("y","0"),k&&Q.setAttributes(U,k),U},Q.createTSpan=function(k,U){var X=document.createElementNS("http://www.w3.org/2000/svg","tspan");return X.textContent=k,U&&Q.setAttributes(X,U),X},Q.createImage=function(k){var U=document.createElementNS("http://www.w3.org/2000/svg","image");return k&&Q.setAttributes(U,k),U},Q.createPoint=function(k,U){var X=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return X.x=k,X.y=U,X},Q.createPath=function(k,U){var X=document.createElementNS("http://www.w3.org/2000/svg","path");return X.setAttribute("d",k),U&&Q.setAttributes(X,U),X},Q}(),Ne=function(){function Q(){}return Q.addKey=function(k){Q.key=k},Object.defineProperty(Q,"isLicensed",{get:function(){return!!Q.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Q.key)},enumerable:!1,configurable:!0}),Q}(),ze=function(){function Q(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Q.prototype.rasterize=function(k,U,X){var ie=this;return new Promise(function(J){var Ae=X!==void 0?X:document.createElement("canvas");k===null&&(ie.markersOnly=!0,ie.naturalSize=!1);var tt=document.createElementNS("http://www.w3.org/2000/svg","svg");tt.setAttribute("xmlns","http://www.w3.org/2000/svg"),tt.setAttribute("width",U.width.baseVal.valueAsString),tt.setAttribute("height",U.height.baseVal.valueAsString),tt.setAttribute("viewBox","0 0 "+U.viewBox.baseVal.width.toString()+" "+U.viewBox.baseVal.height.toString()),tt.innerHTML=U.innerHTML,ie.naturalSize===!0?(tt.width.baseVal.value=k.naturalWidth,tt.height.baseVal.value=k.naturalHeight):ie.width!==void 0&&ie.height!==void 0&&(tt.width.baseVal.value=ie.width,tt.height.baseVal.value=ie.height),Ae.width=tt.width.baseVal.value,Ae.height=tt.height.baseVal.value;var kt=tt.outerHTML,Mt=Ae.getContext("2d");ie.markersOnly!==!0&&Mt.drawImage(k,0,0,Ae.width,Ae.height);var gt=window.URL,$t=new Image(Ae.width,Ae.height);$t.setAttribute("crossOrigin","anonymous");var mn=new Blob([kt],{type:"image/svg+xml"}),Mn=gt.createObjectURL(mn);$t.onload=function(){Mt.drawImage($t,0,0),gt.revokeObjectURL(Mn);var lr=Ae.toDataURL(ie.imageType,ie.imageQuality);J(lr)},$t.src=Mn})},Q}(),nt=function(){},Ge=function(){function Q(k){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+k+"_"}return Object.defineProperty(Q.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Q.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(Q.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),Q.prototype.addClass=function(k){return this.styleSheet===void 0&&this.addStyleSheet(),k.name=""+this.classNamePrefix+k.localName,this.classes.push(k),this.styleSheet.sheet.insertRule("."+k.name+" {"+k.style+"}",this.styleSheet.sheet.cssRules.length),k},Q.prototype.addRule=function(k){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(k),this.styleSheet.sheet.insertRule(k.selector+" {"+k.style+"}",this.styleSheet.sheet.cssRules.length)},Q.prototype.addStyleSheet=function(){var k;this.styleSheet=document.createElement("style"),((k=this.styleSheetRoot)!==null&&k!==void 0?k:document.head).appendChild(this.styleSheet),this.addRule(new Xe("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Xe("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Xe("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Be("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Be("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},Q.prototype.removeStyleSheet=function(){var k;this.styleSheet&&(((k=this.styleSheetRoot)!==null&&k!==void 0?k:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Q}(),Xe=function(Q,k){this.selector=Q,this.style=k},Be=function(Q,k){this.localName=Q,this.style=k},_e=function(){function Q(k,U,X,ie,J){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=k,this.displayMode=U,this.markerItems=X,this.uiStyleSettings=ie,this.styles=J,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return Q.prototype.show=function(k){var U=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=k,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var X=document.createElement("div");X.className=this.toolbarBlockStyleClass.name,X.style.whiteSpace="nowrap",this.uiContainer.appendChild(X),this.addActionButton(X,'<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","Select mode"),this.addActionButton(X,'<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","Delete marker"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(X,'<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","Delete all markers"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(X,'<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","Undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(X,'<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","Redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(X,'<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","Zoom in"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(X,'<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","Zoom out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(X,'<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","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(J){var Ae=document.createElement("div");Ae.className=""+U.toolbarButtonStyleClass.name,Ae.setAttribute("data-type-name",J.typeName),Ae.setAttribute("aria-label",J.title),Ae.setAttribute("title",J.title),Ae.innerHTML=J.icon,Ae.addEventListener("click",function(){U.markerToolbarButtonClicked(Ae,J)}),U.buttons.push(Ae),U.markerButtons.push(Ae)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var ie=document.createElement("div");ie.className=this.toolbarBlockStyleClass.name,ie.style.whiteSpace="nowrap",ie.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ie),this.addActionButton(ie,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render","Save and close"),this.addActionButton(ie,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close","Close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},Q.prototype.addButtonClickListener=function(k){this.buttonClickListeners.push(k)},Q.prototype.removeButtonClickListener=function(k){this.buttonClickListeners.indexOf(k)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(k),1)},Q.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Q.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var k=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var U=0;U<this.markerButtons.length;U++)U<k||U===k&&this.markerButtons.length-1===k?this.markerButtonBlock.appendChild(this.markerButtons[U]):(U===k&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[U]))}},Q.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")},Q.prototype.resetButtonStyles=function(){var k=this;this.buttons.forEach(function(U){U.className=U.className.replace(k.uiStyleSettings.toolbarButtonStyleColorsClassName?k.uiStyleSettings.toolbarButtonStyleColorsClassName:k.toolbarButtonStyleColorsClass.name,"").trim(),U.className=U.className.replace(k.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?k.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:k.toolbarActiveButtonStyleColorsClass.name,"").trim(),U.className+=" "+(k.uiStyleSettings.toolbarButtonStyleColorsClassName?k.uiStyleSettings.toolbarButtonStyleColorsClassName:k.toolbarButtonStyleColorsClass.name)})},Q.prototype.addActionButton=function(k,U,X,ie){var J=this,Ae=document.createElement("div");switch(Ae.className=""+this.toolbarButtonStyleClass.name,Ae.innerHTML=U,Ae.setAttribute("role","button"),Ae.setAttribute("data-action",X),Ae.title=ie,Ae.setAttribute("aria-label",ie),Ae.addEventListener("click",function(){J.actionToolbarButtonClicked(Ae,X)}),X){case"select":Ae.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Ae.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Ae.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Ae.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Ae.style.fill=this.uiStyleSettings.closeButtonColor}k.appendChild(Ae),this.buttons.push(Ae)},Q.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Be("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 Be("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Be("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Be("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 Be("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var k=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Be("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
padding: `+k+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Be("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Be("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Xe("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Xe("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},Q.prototype.markerToolbarButtonClicked=function(k,U){this.setActiveButton(k),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(X){return X("marker",U)}),this.markerButtonOverflowBlock.style.display="none"},Q.prototype.actionToolbarButtonClicked=function(k,U){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(X){return X("action",U)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Q.prototype.setActiveButton=function(k){this.resetButtonStyles(),k.className=k.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),k.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Q.prototype.setActiveMarkerButton=function(k){var U=this.markerButtons.find(function(X){return X.getAttribute("data-type-name")===k});U&&this.setActiveButton(U)},Q.prototype.setCurrentMarker=function(k){var U=this;this.currentMarker=k,this.buttons.filter(function(X){return/delete|notes/.test(X.getAttribute("data-action"))}).forEach(function(X){U.currentMarker===void 0?(X.style.fillOpacity="0.4",X.style.pointerEvents="none"):(X.style.fillOpacity="1",X.style.pointerEvents="all")})},Q}(),Ze=function(){function Q(k,U,X,ie){this.panels=[],this.panelButtons=[],this.markerjsContainer=k,this.displayMode=U,this.uiStyleSettings=X,this.styles=ie,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Q.prototype.addStyles=function(){var k;this.toolboxStyleClass=this.styles.addClass(new Be("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 Be("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var U=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Be("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Be("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Be("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 Be("toolbox-panel-row_colors",`
background-color: `+((k=this.uiStyleSettings.toolboxBackgroundColor)!==null&&k!==void 0?k:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Be("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*U)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*U)+`px;
padding: `+U+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Be("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Be("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Xe("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Xe("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Xe("."+this.toolboxPanelRowStyleClass.name+" > div",`
scrollbar-width: thin;
`)),this.styles.addRule(new Xe("."+this.toolboxPanelRowStyleClass.name+" > div::-webkit-scrollbar",`
height: 10px;
width: 10px;
`)),this.styles.addRule(new Xe("."+this.toolboxPanelRowStyleClass.name+" > div::-webkit-scrollbar-track",`
background-color: transparent;
`)),this.styles.addRule(new Xe("."+this.toolboxPanelRowStyleClass.name+" > div::-webkit-scrollbar-thumb",`
background-color: #444;
border-radius: 20px;
border: 2px solid #aaa;
`))},Q.prototype.show=function(k){var U;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=k,this.uiContainer.className=this.toolboxStyleClass.name+" "+((U=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&U!==void 0?U:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Q.prototype.setPanelButtons=function(k){var U,X,ie=this;this.panels=k,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((U=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&U!==void 0?U:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((X=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&X!==void 0?X:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(J){var Ae;J.uiStyleSettings=ie.uiStyleSettings;var tt=document.createElement("div");tt.className=ie.toolboxButtonStyleClass.name+" "+((Ae=ie.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ae!==void 0?Ae:ie.toolboxButtonStyleColorsClass.name),tt.innerHTML=J.icon,tt.title=J.title,tt.setAttribute("role","button"),tt.setAttribute("aria-label",J.title),J.id&&tt.setAttribute("data-action",J.id),tt.addEventListener("click",function(){ie.panelButtonClick(J)}),ie.panelButtons.push(tt),ie.buttonRow.appendChild(tt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Q.prototype.panelButtonClick=function(k){var U=this,X=-1;if(k!==this.activePanel){X=this.panels.indexOf(k),this.panelRow.innerHTML="";var ie=k.getUi();ie.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ie),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=k}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){U.displayMode==="inline"?U.panelRow.style.display="none":U.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(J,Ae){var tt,kt;J.className=U.toolboxButtonStyleClass.name+" "+(Ae===X?""+((tt=U.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&tt!==void 0?tt:U.toolboxActiveButtonStyleColorsClass.name):""+((kt=U.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&kt!==void 0?kt:U.toolboxButtonStyleColorsClass.name))})},Q}(),be=function(){function Q(k,U,X){this.title=k,this.icon=U,this._id=X}return Object.defineProperty(Q.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Q}(),Le=function(Q){function k(U,X,ie,J,Ae){var tt=Q.call(this,U,J||'<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>',Ae||"color-picker-panel")||this;return tt.colors=[],tt.addTransparent=!1,tt.colorBoxes=[],tt.colors=X,tt.currentColor=ie,tt.setCurrentColor=tt.setCurrentColor.bind(tt),tt.getColorBox=tt.getColorBox.bind(tt),tt}return ve(k,Q),k.prototype.getUi=function(){var U=this,X=document.createElement("div");return X.style.overflow="hidden",X.style.overflowX="auto",X.style.whiteSpace="nowrap",this.colors.forEach(function(ie){var J=U.getColorBox(ie);X.appendChild(J),U.colorBoxes.push(J)}),X},k.prototype.getColorBox=function(U){var X=this,ie=this.uiStyleSettings.toolbarHeight/4,J=this.uiStyleSettings.toolbarHeight-ie,Ae=document.createElement("div");Ae.style.display="inline-block",Ae.style.boxSizing="content-box",Ae.style.width=J-2+"px",Ae.style.height=J-2+"px",Ae.style.padding="1px",Ae.style.marginRight="2px",Ae.style.marginBottom="2px",Ae.style.borderWidth="2px",Ae.style.borderStyle="solid",Ae.style.borderRadius=(J+2)/2+"px",Ae.style.borderColor=U===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ae.addEventListener("click",function(){X.setCurrentColor(U,Ae)});var tt=document.createElement("div");return tt.style.display="inline-block",tt.style.width=J-2+"px",tt.style.height=J-2+"px",tt.style.backgroundColor=U,tt.style.borderRadius=J/2+"px",U==="transparent"&&(tt.style.fill=this.uiStyleSettings.toolboxAccentColor,tt.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>`),Ae.appendChild(tt),Ae},k.prototype.setCurrentColor=function(U,X){var ie=this;this.currentColor=U,this.colorBoxes.forEach(function(J){J.style.borderColor=J===X?ie.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(U)},k}(be),le=function(){function Q(k,U,X){this._state="new",this._isSelected=!1,this._container=k,this._overlayContainer=U,this.globalSettings=X,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Q.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Q.prototype.ownsTarget=function(k){return!1},Object.defineProperty(Q.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Q.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Q.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Q.prototype.pointerDown=function(k,U){},Q.prototype.dblClick=function(k,U){},Q.prototype.manipulate=function(k){},Q.prototype.pointerUp=function(k){this.stateChanged()},Q.prototype.dispose=function(){},Q.prototype.addMarkerVisualToContainer=function(k){this.container.childNodes.length>0?this.container.insertBefore(k,this.container.childNodes[0]):this.container.appendChild(k)},Q.prototype.getState=function(){return{typeName:Q.typeName,state:this.state,notes:this.notes}},Q.prototype.restoreState=function(k){this._state=k.state,this.notes=k.notes},Q.prototype.scale=function(k,U){},Q.prototype.colorChanged=function(k){this.onColorChanged&&this.onColorChanged(k),this.stateChanged()},Q.prototype.fillColorChanged=function(k){this.onFillColorChanged&&this.onFillColorChanged(k),this.stateChanged()},Q.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var k=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),k.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(k)&&this.onStateChanged(this)}},Q.typeName="MarkerBase",Q}(),ye=function(){function Q(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Q.prototype.findGripByVisual=function(k){return this.topLeft.ownsTarget(k)?this.topLeft:this.topCenter.ownsTarget(k)?this.topCenter:this.topRight.ownsTarget(k)?this.topRight:this.centerLeft.ownsTarget(k)?this.centerLeft:this.centerRight.ownsTarget(k)?this.centerRight:this.bottomLeft.ownsTarget(k)?this.bottomLeft:this.bottomCenter.ownsTarget(k)?this.bottomCenter:this.bottomRight.ownsTarget(k)?this.bottomRight:void 0},Q}(),Te=function(){function Q(){this.GRIP_SIZE=10,this.visual=ge.createGroup(),this.visual.appendChild(ge.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ge.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Q.prototype.ownsTarget=function(k){return k===this.visual||k===this.visual.childNodes[0]||k===this.visual.childNodes[1]},Q}(),Pe=function(){function Q(){}return Q.toITransformMatrix=function(k){return{a:k.a,b:k.b,c:k.c,d:k.d,e:k.e,f:k.f}},Q.toSVGMatrix=function(k,U){return k.a=U.a,k.b=U.b,k.c=U.c,k.d=U.d,k.e=U.e,k.f=U.f,k},Q}(),He=function(Q){function k(U,X,ie){var J=Q.call(this,U,X,ie)||this;return J.left=0,J.top=0,J.width=0,J.height=0,J.defaultSize={x:50,y:20},J.offsetX=0,J.offsetY=0,J.rotationAngle=0,J.CB_DISTANCE=10,J._suppressMarkerCreateEvent=!1,J.container.transform.baseVal.appendItem(ge.createTransform()),J.setupControlBox(),J}return ve(k,Q),Object.defineProperty(k.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"visual",{get:function(){return this._visual},set:function(U){this._visual=U;var X=ge.createTransform();this._visual.transform.baseVal.appendItem(X)},enumerable:!1,configurable:!0}),k.prototype.ownsTarget=function(U){return!!Q.prototype.ownsTarget.call(this,U)||!!(this.controlGrips.findGripByVisual(U)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(U))},k.prototype.pointerDown=function(U,X){Q.prototype.pointerDown.call(this,U,X),this.state==="new"&&(this.left=U.x,this.top=U.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ie=this.unrotatePoint(U);if(this.manipulationStartX=ie.x,this.manipulationStartY=ie.y,this.offsetX=ie.x-this.left,this.offsetY=ie.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(X),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(X)){this.activeGrip=this.rotatorGrip;var J=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=J.x-this.width/2,this.top=J.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Ae=this.container.transform.baseVal.getItem(0);Ae.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ae,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},k.prototype.pointerUp=function(U){var X=this.state;Q.prototype.pointerUp.call(this,U),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(U),this._state="select",X==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},k.prototype.moveVisual=function(U){this.visual.style.transform="translate("+U.x+"px, "+U.y+"px)"},k.prototype.manipulate=function(U){var X=this.unrotatePoint(U);this.state==="creating"?this.resize(U):this.state==="move"?(this.left=this.manipulationStartLeft+(X.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(X.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(X):this.state==="rotate"&&this.rotate(U)},k.prototype.resize=function(U){var X=this.manipulationStartLeft,ie=this.manipulationStartWidth,J=this.manipulationStartTop,Ae=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:X=this.manipulationStartLeft+U.x-this.manipulationStartX,ie=this.manipulationStartWidth+this.manipulationStartLeft-X;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ie=this.manipulationStartWidth+U.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:J=this.manipulationStartTop+U.y-this.manipulationStartY,Ae=this.manipulationStartHeight+this.manipulationStartTop-J;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ae=this.manipulationStartHeight+U.y-this.manipulationStartY}ie>=0?(this.left=X,this.width=ie):(this.left=X+ie,this.width=-ie),Ae>=0?(this.top=J,this.height=Ae):(this.top=J+Ae,this.height=-Ae),this.setSize()},k.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},k.prototype.rotate=function(U){if(Math.abs(U.x-this.centerX)>.1){var X=Math.sign(U.x-this.centerX);this.rotationAngle=180*Math.atan((U.y-this.centerY)/(U.x-this.centerX))/Math.PI+90*X,this.applyRotation()}},k.prototype.applyRotation=function(){var U=this.container.transform.baseVal.getItem(0);U.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(U,0)},k.prototype.rotatePoint=function(U){if(this.rotationAngle===0)return U;var X=this.container.getCTM(),ie=ge.createPoint(U.x,U.y);return{x:(ie=ie.matrixTransform(X)).x,y:ie.y}},k.prototype.unrotatePoint=function(U){if(this.rotationAngle===0)return U;var X=this.container.getCTM();X=X.inverse();var ie=ge.createPoint(U.x,U.y);return{x:(ie=ie.matrixTransform(X)).x,y:ie.y}},k.prototype.select=function(){Q.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},k.prototype.deselect=function(){Q.prototype.deselect.call(this),this.controlBox.style.display="none"},k.prototype.setupControlBox=function(){this.controlBox=ge.createGroup();var U=ge.createTransform();U.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(U),this.container.appendChild(this.controlBox),this.controlRect=ge.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=ge.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 ye,this.addControlGrips(),this.controlBox.style.display="none"},k.prototype.adjustControlBox=function(){var U=this.controlBox.transform.baseVal.getItem(0);U.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(U,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},k.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},k.prototype.createGrip=function(){var U=new Te;return U.visual.transform.baseVal.appendItem(ge.createTransform()),this.controlBox.appendChild(U.visual),U},k.prototype.positionGrips=function(){var U=this.controlGrips.topLeft.GRIP_SIZE,X=-U/2,ie=X,J=(this.width+this.CB_DISTANCE)/2-U/2,Ae=(this.height+this.CB_DISTANCE)/2-U/2,tt=this.height+this.CB_DISTANCE-U/2,kt=this.width+this.CB_DISTANCE-U/2;this.positionGrip(this.controlGrips.topLeft.visual,X,ie),this.positionGrip(this.controlGrips.topCenter.visual,J,ie),this.positionGrip(this.controlGrips.topRight.visual,kt,ie),this.positionGrip(this.controlGrips.centerLeft.visual,X,Ae),this.positionGrip(this.controlGrips.centerRight.visual,kt,Ae),this.positionGrip(this.controlGrips.bottomLeft.visual,X,tt),this.positionGrip(this.controlGrips.bottomCenter.visual,J,tt),this.positionGrip(this.controlGrips.bottomRight.visual,kt,tt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,J,ie-3*this.CB_DISTANCE)},k.prototype.positionGrip=function(U,X,ie){var J=U.transform.baseVal.getItem(0);J.setTranslate(X,ie),U.transform.baseVal.replaceItem(J,0)},k.prototype.hideControlBox=function(){this.controlBox.style.display="none"},k.prototype.showControlBox=function(){this.controlBox.style.display=""},k.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Pe.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Pe.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Q.prototype.getState.call(this))},k.prototype.restoreState=function(U){Q.prototype.restoreState.call(this,U);var X=U;this.left=X.left,this.top=X.top,this.width=X.width,this.height=X.height,this.rotationAngle=X.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Pe.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,X.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Pe.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,X.containerTransformMatrix))},k.prototype.scale=function(U,X){Q.prototype.scale.call(this,U,X);var ie=this.rotatePoint({x:this.left,y:this.top}),J=this.unrotatePoint({x:ie.x*U,y:ie.y*X});this.left=J.x,this.top=J.y,this.width=this.width*U,this.height=this.height*X,this.adjustControlBox()},k}(le),Ye=function(Q){function k(U,X,ie){var J=Q.call(this,U,X,ie)||this;return J.fillColor="transparent",J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.opacity=1,J.setStrokeColor=J.setStrokeColor.bind(J),J.setFillColor=J.setFillColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.createVisual=J.createVisual.bind(J),J}return ve(k,Q),k.prototype.ownsTarget=function(U){return!(!Q.prototype.ownsTarget.call(this,U)&&U!==this.visual)},k.prototype.createVisual=function(){this.visual=ge.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},k.prototype.pointerDown=function(U,X){Q.prototype.pointerDown.call(this,U,X),this.state==="new"&&(this.createVisual(),this.moveVisual(U),this._state="creating")},k.prototype.manipulate=function(U){Q.prototype.manipulate.call(this,U)},k.prototype.resize=function(U){Q.prototype.resize.call(this,U),this.setSize()},k.prototype.setSize=function(){Q.prototype.setSize.call(this),ge.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},k.prototype.pointerUp=function(U){Q.prototype.pointerUp.call(this,U),this.setSize()},k.prototype.setStrokeColor=function(U){this.strokeColor=U,this.visual&&ge.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(U),this.stateChanged()},k.prototype.setFillColor=function(U){this.fillColor=U,this.visual&&ge.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},k.prototype.setStrokeWidth=function(U){this.strokeWidth=U,this.visual&&ge.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},k.prototype.setStrokeDasharray=function(U){this.strokeDasharray=U,this.visual&&ge.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},k.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Q.prototype.getState.call(this))},k.prototype.restoreState=function(U){var X=U;this.fillColor=X.fillColor,this.strokeColor=X.strokeColor,this.strokeWidth=X.strokeWidth,this.strokeDasharray=X.strokeDasharray,this.opacity=X.opacity,this.createVisual(),Q.prototype.restoreState.call(this,U),this.setSize()},k.prototype.scale=function(U,X){Q.prototype.scale.call(this,U,X),this.setSize()},k.title="Rectangle marker",k}(He),ct=function(Q){function k(U,X,ie,J,Ae){var tt=Q.call(this,U,J||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>',Ae||"line-width-panel")||this;return tt.widths=[],tt.widthBoxes=[],tt.widths=X,tt.currentWidth=ie,tt.setCurrentWidth=tt.setCurrentWidth.bind(tt),tt}return ve(k,Q),k.prototype.getUi=function(){var U=this,X=document.createElement("div");return X.style.display="flex",X.style.overflow="hidden",X.style.flexGrow="2",this.widths.forEach(function(ie){var J=document.createElement("div");J.style.display="flex",J.style.flexGrow="2",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.borderColor=ie===U.currentWidth?U.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){U.setCurrentWidth(ie,J)}),X.appendChild(J);var Ae=document.createElement("div");Ae.innerText=ie.toString(),Ae.style.marginRight="5px",J.appendChild(Ae);var tt=document.createElement("div");tt.style.minHeight="20px",tt.style.flexGrow="2",tt.style.display="flex",tt.style.alignItems="center";var kt=document.createElement("hr");kt.style.minWidth="20px",kt.style.border="0px",kt.style.borderTop=ie+"px solid "+U.uiStyleSettings.toolboxColor,kt.style.flexGrow="2",tt.appendChild(kt),J.appendChild(tt),U.widthBoxes.push(J)}),X},k.prototype.setCurrentWidth=function(U,X){var ie=this;this.currentWidth=U,this.widthBoxes.forEach(function(J){J.style.borderColor=J===X?ie.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},k}(be),st=function(Q){function k(U,X,ie,J,Ae){var tt=Q.call(this,U,J||'<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>',Ae||"line-style-panel")||this;return tt.styles=[],tt.styleBoxes=[],tt.styles=X,tt.currentStyle=ie,tt.setCurrentStyle=tt.setCurrentStyle.bind(tt),tt}return ve(k,Q),k.prototype.getUi=function(){var U=this,X=document.createElement("div");return X.style.display="flex",X.style.overflow="hidden",X.style.flexGrow="2",this.styles.forEach(function(ie){var J=document.createElement("div");J.style.display="flex",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.overflow="hidden",J.style.maxWidth=100/U.styles.length-5+"%",J.style.borderColor=ie===U.currentStyle?U.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){U.setCurrentStyle(ie,J)}),X.appendChild(J);var Ae=document.createElement("div");Ae.style.minHeight="20px",Ae.style.flexGrow="2",Ae.style.overflow="hidden";var tt=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+U.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ie!==""?'stroke-dasharray="'+ie+'"':"")+` />
</svg>`;Ae.innerHTML=tt,J.appendChild(Ae),U.styleBoxes.push(J)}),X},k.prototype.setCurrentStyle=function(U,X){var ie=this;this.currentStyle=U,this.styleBoxes.forEach(function(J){J.style.borderColor=J===X?ie.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},k}(be),vt=function(Q){function k(U,X,ie){var J=Q.call(this,U,X,ie)||this;return J.strokeColor=ie.defaultColor,J.strokeWidth=ie.defaultStrokeWidth,J.strokeDasharray=ie.defaultStrokeDasharray,J.strokePanel=new Le("Line color",ie.defaultColorSet,ie.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new ct("Line width",ie.defaultStrokeWidths,ie.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new st("Line style",ie.defaultStrokeDasharrays,ie.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return ve(k,Q),Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var U=Q.prototype.getState.call(this);return U.typeName=k.typeName,U},k.typeName="FrameMarker",k.title="Frame marker",k.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',k}(Ye),qe=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,this.defaultCaptionFontSize="1rem",this.defaultCaptionText="Text",this.wrapText=!1,this.defaultText="Your text here"},mt=function(Q){function k(U,X,ie){var J=Q.call(this,U,X,ie)||this;return J.x1=0,J.y1=0,J.x2=0,J.y2=0,J.defaultLength=50,J.manipulationStartX=0,J.manipulationStartY=0,J.manipulationStartX1=0,J.manipulationStartY1=0,J.manipulationStartX2=0,J.manipulationStartY2=0,J.setupControlBox(),J}return ve(k,Q),k.prototype.ownsTarget=function(U){return!!Q.prototype.ownsTarget.call(this,U)||!(!this.grip1.ownsTarget(U)&&!this.grip2.ownsTarget(U))},k.prototype.pointerDown=function(U,X){Q.prototype.pointerDown.call(this,U,X),this.manipulationStartX=U.x,this.manipulationStartY=U.y,this.state==="new"&&(this.x1=U.x,this.y1=U.y,this.x2=U.x,this.y2=U.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(X)?this.activeGrip=this.grip1:this.grip2.ownsTarget(X)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},k.prototype.pointerUp=function(U){var X=this.state;Q.prototype.pointerUp.call(this,U),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(U),this._state="select",X==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},k.prototype.adjustVisual=function(){},k.prototype.manipulate=function(U){this.state==="creating"?this.resize(U):this.state==="move"?(this.x1=this.manipulationStartX1+U.x-this.manipulationStartX,this.y1=this.manipulationStartY1+U.y-this.manipulationStartY,this.x2=this.manipulationStartX2+U.x-this.manipulationStartX,this.y2=this.manipulationStartY2+U.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(U)},k.prototype.resize=function(U){switch(this.activeGrip){case this.grip1:this.x1=U.x,this.y1=U.y;break;case this.grip2:case void 0:this.x2=U.x,this.y2=U.y}this.adjustVisual(),this.adjustControlBox()},k.prototype.select=function(){Q.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},k.prototype.deselect=function(){Q.prototype.deselect.call(this),this.controlBox.style.display="none"},k.prototype.setupControlBox=function(){this.controlBox=ge.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},k.prototype.adjustControlBox=function(){this.positionGrips()},k.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},k.prototype.createGrip=function(){var U=new Te;return U.visual.transform.baseVal.appendItem(ge.createTransform()),this.controlBox.appendChild(U.visual),U},k.prototype.positionGrips=function(){var U=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-U/2,this.y1-U/2),this.positionGrip(this.grip2.visual,this.x2-U/2,this.y2-U/2)},k.prototype.positionGrip=function(U,X,ie){var J=U.transform.baseVal.getItem(0);J.setTranslate(X,ie),U.transform.baseVal.replaceItem(J,0)},k.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Q.prototype.getState.call(this))},k.prototype.restoreState=function(U){Q.prototype.restoreState.call(this,U);var X=U;this.x1=X.x1,this.y1=X.y1,this.x2=X.x2,this.y2=X.y2},k.prototype.scale=function(U,X){Q.prototype.scale.call(this,U,X),this.x1=this.x1*U,this.y1=this.y1*X,this.x2=this.x2*U,this.y2=this.y2*X,this.adjustVisual(),this.adjustControlBox()},k}(le),yt=function(Q){function k(U,X,ie){var J=Q.call(this,U,X,ie)||this;return J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.setStrokeColor=J.setStrokeColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.strokeColor=ie.defaultColor,J.strokeWidth=ie.defaultStrokeWidth,J.strokeDasharray=ie.defaultStrokeDasharray,J.strokePanel=new Le("Line color",ie.defaultColorSet,ie.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new ct("Line width",ie.defaultStrokeWidths,ie.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new st("Line style",ie.defaultStrokeDasharrays,ie.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return ve(k,Q),k.prototype.ownsTarget=function(U){return!(!Q.prototype.ownsTarget.call(this,U)&&U!==this.visual&&U!==this.selectorLine&&U!==this.visibleLine)},k.prototype.createVisual=function(){this.visual=ge.createGroup(),this.selectorLine=ge.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ge.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},k.prototype.pointerDown=function(U,X){Q.prototype.pointerDown.call(this,U,X),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},k.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),ge.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ge.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ge.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},k.prototype.setStrokeColor=function(U){this.strokeColor=U,this.adjustVisual(),this.colorChanged(U)},k.prototype.setStrokeWidth=function(U){this.strokeWidth=U,this.adjustVisual()},k.prototype.setStrokeDasharray=function(U){this.strokeDasharray=U,this.adjustVisual(),this.stateChanged()},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var U=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Q.prototype.getState.call(this));return U.typeName=k.typeName,U},k.prototype.restoreState=function(U){Q.prototype.restoreState.call(this,U);var X=U;this.strokeColor=X.strokeColor,this.strokeWidth=X.strokeWidth,this.strokeDasharray=X.strokeDasharray,this.createVisual(),this.adjustVisual()},k.typeName="LineMarker",k.title="Line marker",k.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',k}(mt),Je=function(Q){function k(U,X,ie,J,Ae){var tt=Q.call(this,U,J||'<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>',Ae||"font-family-panel")||this;return tt.fonts=[],tt.fontBoxes=[],tt.fonts=X,tt.currentFont=ie,tt.setCurrentFont=tt.setCurrentFont.bind(tt),tt}return ve(k,Q),k.prototype.getUi=function(){var U=this,X=document.createElement("div");return X.style.overflow="hidden",X.style.flexGrow="2",this.fonts.forEach(function(ie){var J=document.createElement("div");J.style.display="inline-block",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.overflow="hidden",J.style.maxWidth=100/U.fonts.length-5+"%",J.style.borderColor=ie===U.currentFont?U.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){U.setCurrentFont(ie,J)}),X.appendChild(J);var Ae=document.createElement("div");Ae.style.display="flex",Ae.style.minHeight="20px",Ae.style.flexGrow="2",Ae.style.fontFamily=ie,Ae.style.overflow="hidden";var tt=document.createElement("div");tt.style.whiteSpace="nowrap",tt.style.overflow="hidden",tt.style.textOverflow="ellipsis",tt.innerHTML="The quick brown fox jumps over the lazy dog",Ae.appendChild(tt),J.appendChild(Ae),U.fontBoxes.push(J)}),X},k.prototype.setCurrentFont=function(U,X){var ie=this;this.currentFont=U,this.fontBoxes.forEach(function(J){J.style.borderColor=J===X?ie.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},k}(be),et=function(Q){function k(U,X,ie){var J,Ae=Q.call(this,U,X,ie)||this;return Ae.color="transparent",Ae.padding=5,Ae.DEFAULT_TEXT="your text here",Ae.isMoved=!1,Ae.color=ie.defaultColor,Ae.fontFamily=ie.defaultFontFamily,Ae.text=(J=ie.defaultText)!==null&&J!==void 0?J:Ae.DEFAULT_TEXT,Ae.defaultSize={x:100,y:30},Ae.setColor=Ae.setColor.bind(Ae),Ae.setFont=Ae.setFont.bind(Ae),Ae.renderText=Ae.renderText.bind(Ae),Ae.sizeText=Ae.sizeText.bind(Ae),Ae.textEditDivClicked=Ae.textEditDivClicked.bind(Ae),Ae.showTextEditor=Ae.showTextEditor.bind(Ae),Ae.setSize=Ae.setSize.bind(Ae),Ae.positionTextEditor=Ae.positionTextEditor.bind(Ae),Ae.wrapText=Ae.wrapText.bind(Ae),Ae.colorPanel=new Le("Color",ie.defaultColorSet,ie.defaultColor),Ae.colorPanel.onColorChanged=Ae.setColor,Ae.fontFamilyPanel=new Je("Font",ie.defaultFontFamilies,ie.defaultFontFamily),Ae.fontFamilyPanel.onFontChanged=Ae.setFont,Ae}return ve(k,Q),k.prototype.ownsTarget=function(U){if(Q.prototype.ownsTarget.call(this,U)||U===this.visual||U===this.textElement||U===this.bgRectangle)return!0;var X=!1;return this.textElement.childNodes.forEach(function(ie){ie===U&&(X=!0)}),X},k.prototype.createVisual=function(){this.visual=ge.createGroup(),this.bgRectangle=ge.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ge.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ge.createTransform()),this.textElement.transform.baseVal.appendItem(ge.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},k.prototype.pointerDown=function(U,X){Q.prototype.pointerDown.call(this,U,X),this.isMoved=!1,this.pointerDownPoint=U,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(U),this._state="creating")},k.prototype.wrapText=function(){function U(Mt){var gt=Mt[0].length;return Mt.forEach(function($t){$t.length>gt&&(gt=$t.length)}),.35*gt/Mt.length}if(this.text!==""){for(var X=this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/),ie=1*this.width/this.height,J=new(Array.bind.apply(Array,we([void 0],X))),Ae=U(J),tt=Number.MAX_VALUE,kt=function(){var Mt=J[0];J.forEach(function(gt){gt.length>Mt.length&&(Mt=gt)}),(tt=Mt.lastIndexOf(" ",tt-1))>0?(J=[],X.forEach(function(gt){for(var $t=gt;$t.length>tt;){var mn=$t.lastIndexOf(" ",tt);mn<0&&(mn=$t.indexOf(" ")),mn>0?(J.push($t.substring(0,mn)),$t=$t.substring(mn).trim()):(J.push($t),$t="")}J.push($t)}),Ae=U(J)):Ae=-1};Ae>ie;)kt();return J.join(`\r
`)}return this.text},k.prototype.renderText=function(){var U=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);(this.globalSettings.wrapText?this.wrapText():this.text).split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(X){U.textElement.appendChild(ge.createTSpan(X.trim()===""?" ":X.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},k.prototype.getTextScale=function(){var U=this.textElement.getBBox(),X=1;if(U.width>0&&U.height>0){var ie=(1*this.width-this.width*this.padding*2/100)/U.width,J=(1*this.height-this.height*this.padding*2/100)/U.height;X=Math.min(ie,J)}return X},k.prototype.getTextPosition=function(U){var X=window.getComputedStyle(this.textElement).direction==="rtl"?1:-1,ie=this.textElement.getBBox(),J=0,Ae=0;return ie.width>0&&ie.height>0&&(J=(this.width+X*ie.width*U)/2,Ae=this.height/2-ie.height*U/2),{x:J,y:Ae}},k.prototype.sizeText=function(){var U=this.textElement.getBBox(),X=this.getTextScale(),ie=this.getTextPosition(X);ie.y-=U.y*X,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ie.x+"px, "+ie.y+"px) scale("+X+", "+X+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ie.x,ie.y),this.textElement.transform.baseVal.getItem(1).setScale(X,X))},k.prototype.manipulate=function(U){Q.prototype.manipulate.call(this,U),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(U.x-this.pointerDownPoint.x)>5||Math.abs(U.y-this.pointerDownPoint.y)>5)},k.prototype.resize=function(U){Q.prototype.resize.call(this,U),this.isMoved=!0,this.setSize(),this.globalSettings.wrapText?this.renderText():this.sizeText()},k.prototype.setSize=function(){Q.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ge.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ge.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},k.prototype.pointerUp=function(U){var X=this.state;X==="creating"&&(this._suppressMarkerCreateEvent=!0),Q.prototype.pointerUp.call(this,U),this.setSize(),(X==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},k.prototype.showTextEditor=function(){var U=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(X){X.stopPropagation()}),this.globalSettings.wrapText||this.textEditor.addEventListener("input",function(){for(var X=Number.parseFloat(U.textEditor.style.fontSize);U.textEditor.clientWidth>=Number.parseInt(U.textEditor.style.maxWidth)&&X>.9;)X-=.1,U.textEditor.style.fontSize=Math.max(X,.9)+"em"}),this.textEditor.addEventListener("keyup",function(X){X.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(X){if(X.clipboardData){var ie=X.clipboardData.getData("text"),J=window.getSelection();if(!J.rangeCount)return!1;J.deleteFromDocument(),J.getRangeAt(0).insertNode(document.createTextNode(ie)),X.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){U.textEditDivClicked(U.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},k.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else if(this.globalSettings.wrapText)this.textEditor.style.left=this.left+this.padding+"px",this.textEditor.style.top=this.top+this.padding+"px",this.textEditor.style.width=this.width-2*this.padding+"px",this.textEditor.style.height=this.height-2*this.padding+"px",this.textEditor.style.maxHeight=this.textEditor.style.height,this.textEditor.style.whiteSpace="wrap";else{this.textElement.style.display="";var U=this.getTextScale(),X=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ie=this.textElement.getBBox(),J={x:ie.width*U,y:ie.height*U};X.x-=J.x/2,X.y-=J.y/2,this.textEditor.style.top=X.y+"px",this.textEditor.style.left=X.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-X.x+"px",this.textEditor.style.fontSize=Math.max(16*U,12)+"px",this.textElement.style.display="none"}},k.prototype.textEditDivClicked=function(U){this.text=U.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},k.prototype.select=function(){Q.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},k.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Q.prototype.deselect.call(this)},k.prototype.dblClick=function(U,X){Q.prototype.dblClick.call(this,U,X),this.showTextEditor()},k.prototype.setColor=function(U){this.textElement&&ge.setAttributes(this.textElement,[["fill",U]]),this.color=U,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(U)},k.prototype.setFont=function(U){this.textElement&&ge.setAttributes(this.textElement,[["font-family",U]]),this.fontFamily=U,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},k.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},k.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var U=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text,wrapText:this.globalSettings.wrapText},Q.prototype.getState.call(this));return U.typeName=k.typeName,U},k.prototype.restoreState=function(U){var X=U;this.color=X.color,this.fontFamily=X.fontFamily,this.padding=X.padding,this.text=X.text,this.createVisual(),Q.prototype.restoreState.call(this,U),this.setSize(),this.globalSettings.wrapText&&this.renderText()},k.prototype.scale=function(U,X){Q.prototype.scale.call(this,U,X),this.setSize(),this.sizeText(),this.positionTextEditor()},k.typeName="TextMarker",k.title="Text marker",k.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',k}(He),De=function(Q){function k(U,X,ie){var J=Q.call(this,U,X,ie)||this;return J.color="transparent",J.lineWidth=3,J.drawing=!1,J.pixelRatio=1,J.color=ie.defaultColor,J.lineWidth=ie.defaultStrokeWidth,J.pixelRatio=ie.freehandPixelRatio,J.setColor=J.setColor.bind(J),J.addCanvas=J.addCanvas.bind(J),J.finishCreation=J.finishCreation.bind(J),J.setLineWidth=J.setLineWidth.bind(J),J.colorPanel=new Le("Color",ie.defaultColorSet,ie.defaultColor),J.colorPanel.onColorChanged=J.setColor,J.lineWidthPanel=new ct("Line width",ie.defaultStrokeWidths,ie.defaultStrokeWidth),J.lineWidthPanel.onWidthChanged=J.setLineWidth,J}return ve(k,Q),k.prototype.ownsTarget=function(U){return!(!Q.prototype.ownsTarget.call(this,U)&&U!==this.visual&&U!==this.drawingImage)},k.prototype.createVisual=function(){this.visual=ge.createGroup(),this.drawingImage=ge.createImage(),this.visual.appendChild(this.drawingImage);var U=ge.createTransform();this.visual.transform.baseVal.appendItem(U),this.addMarkerVisualToContainer(this.visual)},k.prototype.pointerDown=function(U,X){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(U.x,U.y),this.drawing=!0):Q.prototype.pointerDown.call(this,U,X)},k.prototype.manipulate=function(U){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(U.x,U.y),this.canvasContext.stroke()):Q.prototype.manipulate.call(this,U)},k.prototype.resize=function(U){Q.prototype.resize.call(this,U),ge.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ge.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},k.prototype.pointerUp=function(U){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Q.prototype.pointerUp.call(this,U)},k.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},k.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Q.prototype.select.call(this)},k.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Q.prototype.deselect.call(this)},k.prototype.finishCreation=function(){for(var U=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),X=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ie=X[0],J=X[1],Ae=X[2],tt=X[3],kt=!1,Mt=0;Mt<this.canvasElement.height;Mt++)for(var gt=0;gt<this.canvasElement.width;gt++)U.data[Mt*this.canvasElement.width*4+4*gt+3]>0&&(kt=!0,Mt<J&&(J=Mt),gt<ie&&(ie=gt),Mt>tt&&(tt=Mt),gt>Ae&&(Ae=gt));if(kt){this.left=ie/this.pixelRatio,this.top=J/this.pixelRatio,this.width=(Ae-ie)/this.pixelRatio,this.height=(tt-J)/this.pixelRatio;var $t=document.createElement("canvas");$t.width=Ae-ie,$t.height=tt-J,$t.getContext("2d").putImageData(this.canvasContext.getImageData(ie,J,Ae-ie,tt-J),0,0),this.drawingImgUrl=$t.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},k.prototype.setDrawingImage=function(){ge.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ge.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},k.prototype.setColor=function(U){this.color=U,this.colorChanged(U)},k.prototype.setLineWidth=function(U){this.lineWidth=U},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var U=Object.assign({drawingImgUrl:this.drawingImgUrl},Q.prototype.getState.call(this));return U.typeName=k.typeName,U},k.prototype.restoreState=function(U){this.createVisual(),Q.prototype.restoreState.call(this,U),this.drawingImgUrl=U.drawingImgUrl,this.setDrawingImage()},k.prototype.scale=function(U,X){Q.prototype.scale.call(this,U,X),this.setDrawingImage()},k.typeName="FreehandMarker",k.title="Freehand marker",k.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',k}(He),ke=function(Q){function k(U,X,ie,J){var Ae=Q.call(this,U,ie||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>',J||"arrow-type-panel")||this;return Ae.typeBoxes=[],Ae.currentType=X,Ae.setCurrentType=Ae.setCurrentType.bind(Ae),Ae}return ve(k,Q),k.prototype.getUi=function(){var U=this,X=document.createElement("div");X.style.display="flex",X.style.overflow="hidden",X.style.flexGrow="2";for(var ie=function(tt){var kt="both";switch(tt){case 0:kt="both";break;case 1:kt="start";break;case 2:kt="end";break;case 3:kt="none"}var Mt=document.createElement("div");if(Mt.style.display="flex",Mt.style.flexGrow="2",Mt.style.alignItems="center",Mt.style.justifyContent="space-between",Mt.style.padding="5px",Mt.style.borderWidth="2px",Mt.style.borderStyle="solid",Mt.style.borderColor=kt===J.currentType?J.uiStyleSettings.toolboxAccentColor:"transparent",Mt.addEventListener("click",function(){U.setCurrentType(kt,Mt)}),X.appendChild(Mt),kt==="both"||kt==="start"){var gt=document.createElement("div");gt.style.display="flex",gt.style.alignItems="center",gt.style.minHeight="20px",gt.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="`+(J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,gt.style.marginLeft="5px",Mt.appendChild(gt)}var $t=document.createElement("div");$t.style.display="flex",$t.style.alignItems="center",$t.style.minHeight="20px",$t.style.flexGrow="2";var mn=document.createElement("hr");if(mn.style.minWidth="20px",mn.style.border="0px",mn.style.borderTop="3px solid "+(J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxColor:"#eeeeee"),mn.style.flexGrow="2",$t.appendChild(mn),Mt.appendChild($t),kt==="both"||kt==="end"){var Mn=document.createElement("div");Mn.style.display="flex",Mn.style.alignItems="center",Mn.style.minHeight="20px",Mn.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="`+(J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Mn.style.marginRight="5px",Mt.appendChild(Mn)}J.typeBoxes.push(Mt)},J=this,Ae=0;Ae<4;Ae++)ie(Ae);return X},k.prototype.setCurrentType=function(U,X){var ie=this;this.currentType=U,this.typeBoxes.forEach(function(J){J.style.borderColor=J===X?ie.uiStyleSettings!==void 0?ie.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},k}(be),Me=function(Q){function k(U,X,ie){var J=Q.call(this,U,X,ie)||this;return J.arrowType="end",J.arrowBaseHeight=10,J.arrowBaseWidth=10,J.getArrowPoints=J.getArrowPoints.bind(J),J.setArrowType=J.setArrowType.bind(J),J.arrowTypePanel=new ke("Arrow type","end"),J.arrowTypePanel.onArrowTypeChanged=J.setArrowType,J}return ve(k,Q),k.prototype.ownsTarget=function(U){return!(!Q.prototype.ownsTarget.call(this,U)&&U!==this.arrow1&&U!==this.arrow2)},k.prototype.getArrowPoints=function(U,X){var ie=this.arrowBaseWidth+2*this.strokeWidth,J=this.arrowBaseHeight+2*this.strokeWidth;return U-ie/2+","+(X+J/2)+" "+U+","+(X-J/2)+" "+(U+ie/2)+","+(X+J/2)},k.prototype.createTips=function(){this.arrow1=ge.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ge.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ge.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ge.createTransform()),this.visual.appendChild(this.arrow2)},k.prototype.pointerDown=function(U,X){Q.prototype.pointerDown.call(this,U,X),this.state==="creating"&&this.createTips()},k.prototype.adjustVisual=function(){if(Q.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",ge.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ge.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]);var U=0;Math.abs(this.x1-this.x2)>.1&&(U=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2));var X=this.arrow1.transform.baseVal.getItem(0);X.setRotate(U,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(X,0);var ie=this.arrow2.transform.baseVal.getItem(0);ie.setRotate(U+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ie,0)}},k.prototype.setArrowType=function(U){this.arrowType=U,this.adjustVisual(),this.stateChanged()},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var U=Object.assign({arrowType:this.arrowType},Q.prototype.getState.call(this));return U.typeName=k.typeName,U},k.prototype.restoreState=function(U){Q.prototype.restoreState.call(this,U);var X=U;this.arrowType=X.arrowType,this.createTips(),this.adjustVisual()},k.typeName="ArrowMarker",k.title="Arrow marker",k.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',k}(yt),me=function(Q){function k(U,X,ie){var J=Q.call(this,U,X,ie)||this;return J.fillColor=ie.defaultFillColor,J.strokeWidth=0,J.fillPanel=new Le("Color",ie.defaultColorSet,ie.defaultFillColor),J.fillPanel.onColorChanged=J.setFillColor,J}return ve(k,Q),Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var U=Q.prototype.getState.call(this);return U.typeName=k.typeName,U},k.typeName="CoverMarker",k.title="Cover marker",k.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',k}(Ye),Ce=function(Q){function k(U,X,ie,J,Ae){var tt=Q.call(this,U,J||'<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>',Ae||"opacity-panel")||this;return tt.opacities=[],tt.opacityBoxes=[],tt.opacities=X,tt.currentOpacity=ie,tt.setCurrentOpacity=tt.setCurrentOpacity.bind(tt),tt}return ve(k,Q),k.prototype.getUi=function(){var U=this,X=document.createElement("div");return X.style.display="flex",X.style.overflow="hidden",X.style.flexGrow="2",X.style.justifyContent="space-between",this.opacities.forEach(function(ie){var J=document.createElement("div");J.style.display="flex",J.style.alignItems="center",J.style.justifyContent="center",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.borderColor=ie===U.currentOpacity?U.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){U.setCurrentOpacity(ie,J)}),X.appendChild(J);var Ae=document.createElement("div");Ae.innerText=100*ie+"%",J.appendChild(Ae),U.opacityBoxes.push(J)}),X},k.prototype.setCurrentOpacity=function(U,X){var ie=this;this.currentOpacity=U,this.opacityBoxes.forEach(function(J){J.style.borderColor=J===X?ie.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},k}(be),Oe=function(Q){function k(U,X,ie){var J=Q.call(this,U,X,ie)||this;return J.setOpacity=J.setOpacity.bind(J),J.fillColor=ie.defaultHighlightColor,J.strokeWidth=0,J.opacity=ie.defaultHighlightOpacity,J.fillPanel=new Le("Color",ie.defaultColorSet,J.fillColor),J.fillPanel.onColorChanged=J.setFillColor,J.opacityPanel=new Ce("Opacity",ie.defaultOpacitySteps,J.opacity),J.opacityPanel.onOpacityChanged=J.setOpacity,J}return ve(k,Q),k.prototype.setOpacity=function(U){this.opacity=U,this.visual&&ge.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var U=Q.prototype.getState.call(this);return U.typeName=k.typeName,U},k.typeName="HighlightMarker",k.title="Highlight marker",k.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',k}(me),Se='<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>',Fe='<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>',it=function(Q){function k(U,X,ie){var J=Q.call(this,U,X,ie)||this;return J.bgColor="transparent",J.tipPosition={x:0,y:0},J.tipBase1Position={x:0,y:0},J.tipBase2Position={x:0,y:0},J.tipMoving=!1,J.color=ie.defaultStrokeColor,J.bgColor=ie.defaultFillColor,J.fontFamily=ie.defaultFontFamily,J.defaultSize={x:100,y:30},J.setBgColor=J.setBgColor.bind(J),J.getTipPoints=J.getTipPoints.bind(J),J.positionTip=J.positionTip.bind(J),J.setTipPoints=J.setTipPoints.bind(J),J.colorPanel=new Le("Text color",ie.defaultColorSet,J.color,Se,"text-color-panel"),J.colorPanel.onColorChanged=J.setColor,J.bgColorPanel=new Le("Fill color",ie.defaultColorSet,J.bgColor,Fe,"fill-color-panel"),J.bgColorPanel.onColorChanged=J.setBgColor,J.fontFamilyPanel=new Je("Font",ie.defaultFontFamilies,ie.defaultFontFamily),J.fontFamilyPanel.onFontChanged=J.setFont,J.tipGrip=new Te,J.tipGrip.visual.transform.baseVal.appendItem(ge.createTransform()),J.controlBox.appendChild(J.tipGrip.visual),J}return ve(k,Q),k.prototype.ownsTarget=function(U){return Q.prototype.ownsTarget.call(this,U)||this.tipGrip.ownsTarget(U)||this.tip===U},k.prototype.createTip=function(){ge.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ge.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},k.prototype.pointerDown=function(U,X){this.state==="new"&&Q.prototype.pointerDown.call(this,U,X),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(X)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Q.prototype.pointerDown.call(this,U,X)},k.prototype.pointerUp=function(U){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Q.prototype.pointerUp.call(this,U);else{var X=this.state==="creating";Q.prototype.pointerUp.call(this,U),this.setTipPoints(X),this.positionTip()}},k.prototype.manipulate=function(U){if(this.tipMoving){var X=this.unrotatePoint(U);this.tipPosition={x:X.x-this.manipulationStartLeft,y:X.y-this.manipulationStartTop},this.positionTip()}else Q.prototype.manipulate.call(this,U)},k.prototype.setBgColor=function(U){this.bgRectangle&&this.tip&&(ge.setAttributes(this.bgRectangle,[["fill",U]]),ge.setAttributes(this.tip,[["fill",U]])),this.bgColor=U,this.fillColorChanged(U)},k.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},k.prototype.setTipPoints=function(U){U===void 0&&(U=!1);var X=Math.min(this.height/2,15),ie=this.height/5;U&&(this.tipPosition={x:X+ie/2,y:this.height+20});var J=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?J<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ie=this.width/5,X=Math.min(this.width/2,15),this.tipBase1Position={x:X,y:0},this.tipBase2Position={x:X+ie,y:0}):(this.tipBase1Position={x:0,y:X},this.tipBase2Position={x:0,y:X+ie}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?J<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ie=this.width/5,X=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-X-ie,y:0},this.tipBase2Position={x:this.width-X,y:0}):(this.tipBase1Position={x:this.width,y:X},this.tipBase2Position={x:this.width,y:X+ie}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?J<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ie=this.width/5,X=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-X-ie,y:this.height},this.tipBase2Position={x:this.width-X,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-X-ie},this.tipBase2Position={x:this.width,y:this.height-X}):J<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ie=this.width/5,X=Math.min(this.width/2,15),this.tipBase1Position={x:X,y:this.height},this.tipBase2Position={x:X+ie,y:this.height}):(this.tipBase1Position={x:0,y:this.height-X},this.tipBase2Position={x:0,y:this.height-X-ie})},k.prototype.resize=function(U){Q.prototype.resize.call(this,U),this.positionTip()},k.prototype.positionTip=function(){ge.setAttributes(this.tip,[["points",this.getTipPoints()]]);var U=this.tipGrip.visual.transform.baseVal.getItem(0);U.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(U,0)},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),k.prototype.select=function(){this.positionTip(),Q.prototype.select.call(this)},k.prototype.getState=function(){var U=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Q.prototype.getState.call(this));return U.typeName=k.typeName,U},k.prototype.restoreState=function(U){var X=U;this.bgColor=X.bgColor,this.tipPosition=X.tipPosition,Q.prototype.restoreState.call(this,U),this.createTip(),this.setTipPoints()},k.prototype.scale=function(U,X){Q.prototype.scale.call(this,U,X),this.tipPosition={x:this.tipPosition.x*U,y:this.tipPosition.y*X},this.positionTip()},k.typeName="CalloutMarker",k.title="Callout marker",k.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',k}(et),Ie=function(Q){function k(U,X,ie){var J=Q.call(this,U,X,ie)||this;return J.fillColor="transparent",J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.opacity=1,J.strokeColor=ie.defaultColor,J.strokeWidth=ie.defaultStrokeWidth,J.strokeDasharray=ie.defaultStrokeDasharray,J.fillColor=ie.defaultFillColor,J.setStrokeColor=J.setStrokeColor.bind(J),J.setFillColor=J.setFillColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.setOpacity=J.setOpacity.bind(J),J.createVisual=J.createVisual.bind(J),J.strokePanel=new Le("Line color",we(ie.defaultColorSet,["transparent"]),ie.defaultColor,void 0,"stroke-color-panel"),J.strokePanel.onColorChanged=J.setStrokeColor,J.fillPanel=new Le("Fill color",we(ie.defaultColorSet,["transparent"]),J.fillColor,Fe,"fill-color-panel"),J.fillPanel.onColorChanged=J.setFillColor,J.strokeWidthPanel=new ct("Line width",ie.defaultStrokeWidths,ie.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new st("Line style",ie.defaultStrokeDasharrays,ie.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J.opacityPanel=new Ce("Opacity",ie.defaultOpacitySteps,J.opacity),J.opacityPanel.onOpacityChanged=J.setOpacity,J}return ve(k,Q),k.prototype.ownsTarget=function(U){return!(!Q.prototype.ownsTarget.call(this,U)&&U!==this.visual)},k.prototype.createVisual=function(){this.visual=ge.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},k.prototype.pointerDown=function(U,X){Q.prototype.pointerDown.call(this,U,X),this.state==="new"&&(this.createVisual(),this.moveVisual(U),this._state="creating")},k.prototype.manipulate=function(U){Q.prototype.manipulate.call(this,U)},k.prototype.resize=function(U){Q.prototype.resize.call(this,U),this.setSize()},k.prototype.setSize=function(){Q.prototype.setSize.call(this),ge.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},k.prototype.pointerUp=function(U){Q.prototype.pointerUp.call(this,U),this.setSize()},k.prototype.setStrokeColor=function(U){this.strokeColor=U,this.visual&&ge.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(U),this.stateChanged()},k.prototype.setFillColor=function(U){this.fillColor=U,this.visual&&ge.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(U),this.stateChanged()},k.prototype.setStrokeWidth=function(U){this.strokeWidth=U,this.visual&&ge.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},k.prototype.setStrokeDasharray=function(U){this.strokeDasharray=U,this.visual&&ge.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},k.prototype.setOpacity=function(U){this.opacity=U,this.visual&&ge.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var U=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Q.prototype.getState.call(this));return U.typeName=k.typeName,U},k.prototype.restoreState=function(U){var X=U;this.fillColor=X.fillColor,this.strokeColor=X.strokeColor,this.strokeWidth=X.strokeWidth,this.strokeDasharray=X.strokeDasharray,this.opacity=X.opacity,this.createVisual(),Q.prototype.restoreState.call(this,U),this.setSize()},k.prototype.scale=function(U,X){Q.prototype.scale.call(this,U,X),this.setSize()},k.typeName="EllipseMarker",k.title="Ellipse marker",k.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',k}(He),Qe=function(Q){function k(U,X,ie){return Q.call(this,U,X,ie)||this}return ve(k,Q),Object.defineProperty(k.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),k.prototype.ownsTarget=function(U){return!(!Q.prototype.ownsTarget.call(this,U)&&U!==this.tip1&&U!==this.tip2)},k.prototype.createTips=function(){this.tip1=ge.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(ge.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ge.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(ge.createTransform()),this.visual.appendChild(this.tip2)},k.prototype.pointerDown=function(U,X){Q.prototype.pointerDown.call(this,U,X),this.state==="creating"&&this.createTips()},k.prototype.adjustVisual=function(){if(Q.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ge.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()]]),ge.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 U=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),X=this.tip1.transform.baseVal.getItem(0);X.setRotate(U,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(X,0);var ie=this.tip2.transform.baseVal.getItem(0);ie.setRotate(U+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ie,0)}},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var U=Q.prototype.getState.call(this);return U.typeName=k.typeName,U},k.prototype.restoreState=function(U){Q.prototype.restoreState.call(this,U),this.createTips(),this.adjustVisual()},k.typeName="MeasurementMarker",k.title="Measurement marker",k.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',k}(yt),rt=function(Q){function k(U,X,ie){var J=Q.call(this,U,X,ie)||this;return J.strokePanel.colors=ie.defaultColorSet,J.fillColor="transparent",J}return ve(k,Q),Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var U=Q.prototype.getState.call(this);return U.typeName=k.typeName,U},k.typeName="EllipseFrameMarker",k.title="Ellipse frame marker",k.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',k}(Ie),ft=function(){function Q(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Q.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Q.prototype.addUndoStep=function(k){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(k)||(this.undoStack.push(k),JSON.stringify(this.lastRedoStep)!==JSON.stringify(k)&&this.redoStack.splice(0,this.redoStack.length))},Q.prototype.replaceLastUndoStep=function(k){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=k)},Q.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Q.prototype.undo=function(){if(this.undoStack.length>1){var k=this.undoStack.pop();return k!==void 0&&this.redoStack.push(k),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Q.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Q}(),It=function(Q){function k(U,X,ie){var J=Q.call(this,U,X,ie)||this;return J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.curveX=0,J.curveY=0,J.manipulationStartCurveX=0,J.manipulationStartCurveY=0,J.setStrokeColor=J.setStrokeColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.positionGrips=J.positionGrips.bind(J),J.addControlGrips=J.addControlGrips.bind(J),J.adjustVisual=J.adjustVisual.bind(J),J.setupControlBox=J.setupControlBox.bind(J),J.resize=J.resize.bind(J),J.strokeColor=ie.defaultColor,J.strokeWidth=ie.defaultStrokeWidth,J.strokeDasharray=ie.defaultStrokeDasharray,J.strokePanel=new Le("Line color",ie.defaultColorSet,ie.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new ct("Line width",ie.defaultStrokeWidths,ie.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new st("Line style",ie.defaultStrokeDasharrays,ie.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return ve(k,Q),k.prototype.ownsTarget=function(U){return!(!Q.prototype.ownsTarget.call(this,U)&&U!==this.visual&&U!==this.selectorCurve&&U!==this.visibleCurve&&!this.curveGrip.ownsTarget(U))},k.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},k.prototype.createVisual=function(){this.visual=ge.createGroup(),this.selectorCurve=ge.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ge.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},k.prototype.pointerDown=function(U,X){Q.prototype.pointerDown.call(this,U,X),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=U.x,this.curveY=U.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(X)&&(this.activeGrip=this.curveGrip,this._state="resize")},k.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ge.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ge.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ge.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},k.prototype.setupControlBox=function(){Q.prototype.setupControlBox.call(this),this.curveControlLine1=ge.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ge.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},k.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Q.prototype.addControlGrips.call(this)},k.prototype.positionGrips=function(){Q.prototype.positionGrips.call(this);var U=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-U/2,this.curveY-U/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},k.prototype.manipulate=function(U){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+U.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+U.y-this.manipulationStartY),Q.prototype.manipulate.call(this,U)},k.prototype.resize=function(U){this.activeGrip===this.curveGrip&&(this.curveX=U.x,this.curveY=U.y),Q.prototype.resize.call(this,U),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},k.prototype.setStrokeColor=function(U){this.strokeColor=U,this.adjustVisual(),this.colorChanged(U)},k.prototype.setStrokeWidth=function(U){this.strokeWidth=U,this.adjustVisual()},k.prototype.setStrokeDasharray=function(U){this.strokeDasharray=U,this.adjustVisual()},k.prototype.scale=function(U,X){this.curveX=this.curveX*U,this.curveY=this.curveY*X,Q.prototype.scale.call(this,U,X)},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var U=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Q.prototype.getState.call(this));return U.typeName=k.typeName,U},k.prototype.restoreState=function(U){Q.prototype.restoreState.call(this,U);var X=U;this.strokeColor=X.strokeColor,this.strokeWidth=X.strokeWidth,this.strokeDasharray=X.strokeDasharray,this.curveX=X.curveX,this.curveY=X.curveY,this.createVisual(),this.adjustVisual()},k.typeName="CurveMarker",k.title="Curve marker",k.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',k}(mt),Tt=function(Q){function k(U,X,ie){var J=Q.call(this,U,X,ie)||this;return J.fillColor="transparent",J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.textColor="transparent",J.fontSize="1rem",J.isMoved=!1,J.captionText="Caption",J.PADDING=5,J.captionBoxWidth=0,J.captionBoxHeight=0,J.strokeColor=ie.defaultColor,J.strokeWidth=ie.defaultStrokeWidth,J.strokeDasharray=ie.defaultStrokeDasharray,J.fillColor=ie.defaultFillColor,J.textColor=ie.defaultStrokeColor,J.fontFamily=ie.defaultFontFamily,J.fontSize=ie.defaultCaptionFontSize,J.captionText=ie.defaultCaptionText,J.setStrokeColor=J.setStrokeColor.bind(J),J.setFillColor=J.setFillColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.createVisual=J.createVisual.bind(J),J.sizeCaption=J.sizeCaption.bind(J),J.setCaptionText=J.setCaptionText.bind(J),J.showTextEditor=J.showTextEditor.bind(J),J.positionTextEditor=J.positionTextEditor.bind(J),J.finishTextEditing=J.finishTextEditing.bind(J),J.setFont=J.setFont.bind(J),J.setTextColor=J.setTextColor.bind(J),J.strokePanel=new Le("Line color",we(ie.defaultColorSet,["transparent"]),J.strokeColor,void 0,"stroke-color-panel"),J.strokePanel.onColorChanged=J.setStrokeColor,J.fillPanel=new Le("Fill color",we(ie.defaultColorSet,["transparent"]),J.fillColor,Fe,"fill-color-panel"),J.fillPanel.onColorChanged=J.setFillColor,J.strokeWidthPanel=new ct("Line width",ie.defaultStrokeWidths,ie.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new st("Line style",ie.defaultStrokeDasharrays,ie.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J.fontFamilyPanel=new Je("Font",ie.defaultFontFamilies,ie.defaultFontFamily),J.fontFamilyPanel.onFontChanged=J.setFont,J.textColorPanel=new Le("Text color",ie.defaultColorSet,J.textColor,Se,"text-color-panel"),J.textColorPanel.onColorChanged=J.setTextColor,J}return ve(k,Q),k.prototype.ownsTarget=function(U){return!(!Q.prototype.ownsTarget.call(this,U)&&U!==this.visual&&U!==this.frame&&U!==this.captionBg&&U!==this.captionElement)},k.prototype.createVisual=function(){this.visual=ge.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=ge.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=ge.createText([["fill",this.textColor],["font-family",this.fontFamily]]),this.captionElement.style.fontSize=this.fontSize,this.captionElement.style.textAnchor="start",this.captionElement.style.dominantBaseline="text-before-edge",this.captionElement.textContent=this.captionText,this.visual.appendChild(this.captionElement),this.frame=ge.createRect(this.width,this.height,[["fill","transparent"],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray]]),this.visual.appendChild(this.frame),this.sizeCaption()},k.prototype.setCaptionText=function(U){this.captionText=U,this.captionElement.textContent=this.captionText,this.sizeCaption()},k.prototype.pointerDown=function(U,X){Q.prototype.pointerDown.call(this,U,X),this.isMoved=!1,this.pointerDownPoint=U,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(U),this._state="creating")},k.prototype.manipulate=function(U){Q.prototype.manipulate.call(this,U),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(U.x-this.pointerDownPoint.x)>5||Math.abs(U.y-this.pointerDownPoint.y)>5)},k.prototype.resize=function(U){Q.prototype.resize.call(this,U),this.setSize()},k.prototype.sizeCaption=function(){var U=this.captionElement.getBBox();this.captionText.trim()!==""?(this.captionBoxWidth=U.width+2*this.PADDING,this.captionBoxHeight=U.height+2*this.PADDING):(this.captionBoxWidth=0,this.captionBoxHeight=0),ge.setAttributes(this.captionBg,[["width",this.captionBoxWidth.toString()],["height",this.captionBoxHeight.toString()],["clip-path","path('M0,0 H"+this.width+" V"+this.height+" H"+-this.width+" Z')"]]),ge.setAttributes(this.captionElement,[["x",this.PADDING.toString()],["y",this.PADDING.toString()],["clip-path","path('M0,0 H"+(this.width-this.PADDING)+" V"+this.height+" H"+(-this.width-this.PADDING)+" Z')"]])},k.prototype.showTextEditor=function(){var U=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.textEditBox=document.createElement("input"),this.textEditBox.style.position="absolute",this.textEditBox.style.width=this.width+"px",this.captionBoxHeight>0&&(this.textEditBox.style.height=this.captionBoxHeight+"px"),this.textEditBox.style.fontSize=this.fontSize,this.textEditBox.style.fontFamily=this.fontFamily,this.textEditBox.style.backgroundColor=this.fillColor,this.textEditBox.style.color=this.textColor,this.textEditBox.style.borderWidth="0",this.textEditBox.setAttribute("value",this.captionText),this.textEditBox.select(),this.textEditDiv.appendChild(this.textEditBox),this.overlayContainer.appendChild(this.textEditDiv),this.textEditBox.addEventListener("pointerup",function(X){X.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(X){X.key==="Enter"&&U.finishTextEditing(U.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(X){X.cancelBubble=!0}),this.textEditBox.addEventListener("blur",function(){U.finishTextEditing(U.textEditBox.value)}),this.textEditDiv.addEventListener("pointerup",function(){U.finishTextEditing(U.textEditBox.value)}),this.positionTextEditor(),this.textEditBox.focus()},k.prototype.positionTextEditor=function(){this.state==="edit"&&(this.textEditBox===void 0?this.showTextEditor():(this.textEditBox.style.left=this.left+"px",this.textEditBox.style.top=this.top+"px",this.textEditBox.style.transform="rotate("+this.rotationAngle+"deg)",this.textEditBox.style.transformOrigin=this.width/2+"px "+this.height/2+"px"))},k.prototype.finishTextEditing=function(U){this.setCaptionText(U.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},k.prototype.setFont=function(U){this.captionElement&&ge.setAttributes(this.captionElement,[["font-family",U]]),this.fontFamily=U,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},k.prototype.setTextColor=function(U){this.captionElement&&ge.setAttributes(this.captionElement,[["fill",U]]),this.textColor=U,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},k.prototype.setSize=function(){Q.prototype.setSize.call(this),ge.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},k.prototype.pointerUp=function(U){Q.prototype.pointerUp.call(this,U),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},k.prototype.dblClick=function(U,X){Q.prototype.dblClick.call(this,U,X),this.showTextEditor()},k.prototype.setStrokeColor=function(U){this.strokeColor=U,this.frame&&ge.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(U),this.stateChanged()},k.prototype.setFillColor=function(U){this.fillColor=U,this.captionBg&&ge.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(U),this.stateChanged()},k.prototype.setStrokeWidth=function(U){this.strokeWidth=U,this.frame&&ge.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},k.prototype.setStrokeDasharray=function(U){this.strokeDasharray=U,this.frame&&ge.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var U=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:1,textColor:this.textColor,fontFamily:this.fontFamily,fontSize:this.fontSize,captionText:this.captionText},Q.prototype.getState.call(this));return U.typeName=this.typeName,U},k.prototype.restoreState=function(U){var X=U;this.fillColor=X.fillColor,this.strokeColor=X.strokeColor,this.strokeWidth=X.strokeWidth,this.strokeDasharray=X.strokeDasharray,this.textColor=X.textColor,this.fontFamily=X.fontFamily,this.captionText=X.captionText,this.fontSize=X.fontSize,this.createVisual(),Q.prototype.restoreState.call(this,U),this.setSize()},k.prototype.scale=function(U,X){Q.prototype.scale.call(this,U,X),this.setSize()},k.typeName="CaptionFrameMarker",k.title="Caption frame marker",k.icon='<svg viewBox="0 0 24 24"><path d="M5 3c-1.11 0-2 .89-2 2v14c0 1.11.89 2 2 2h14c1.11 0 2-.89 2-2V5c0-1.11-.89-2-2-2H5m0 2h14v14H5V5m2 2v2h10V7H7z"/></svg>',k}(He),Et=function(){function Q(k,U){U===void 0&&(U=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=k,this.cancelable=U}return Object.defineProperty(Q.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Q.prototype.preventDefault=function(){this._defaultPrevented=!0},Q}(),Ct=function(Q){function k(U,X,ie){var J=Q.call(this,U,!1)||this;return J.dataUrl=X,J.state=ie,J}return ve(k,Q),k}(Et),dt=function(Q){function k(U,X,ie){ie===void 0&&(ie=!1);var J=Q.call(this,U,ie)||this;return J.marker=X,J}return ve(k,Q),k}(Et),Nt=function(){function Q(){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 Q.prototype.addEventListener=function(k,U){this[k].push(U)},Q.prototype.removeEventListener=function(k,U){var X=this[k].indexOf(U);X>-1&&this[k].splice(X,1)},Q}(),Xt=function(){function Q(k){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new qe,this._isOpen=!1,this.undoRedoManager=new ft,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 Nt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Q.instanceCounter++,this.styles=new Ge(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=k,this.targetRoot=document.body,this.width=k.clientWidth,this.height=k.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this),this.addMarkerEvents=this.addMarkerEvents.bind(this)}return Object.defineProperty(Q.prototype,"ALL_MARKER_TYPES",{get:function(){return[vt,De,Me,et,rt,Ie,Oe,it,Qe,me,yt,It,Tt]},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[vt,De,Me,et,Ie,Oe,it]},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"BASIC_MARKER_TYPES",{get:function(){return[vt,De,Me,et,Oe]},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(k){var U=this;this._availableMarkerTypes.splice(0),k.forEach(function(X){if(typeof X=="string"){var ie=U.ALL_MARKER_TYPES.find(function(J){return J.typeName===X});ie!==void 0&&U._availableMarkerTypes.push(ie)}else U._availableMarkerTypes.push(X)})},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(k){this._zoomLevel=k,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Q.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Ne.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Q.prototype.show=function(){var k=this;this.styles.styleSheetRoot===void 0&&nt.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=nt.styleSheetRoot),this.markers.splice(0),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(U){return U(new Et(k))})},Q.prototype.render=function(){return he(this,void 0,void 0,function(){var k;return Re(this,function(U){switch(U.label){case 0:return this.setCurrentMarker(),(k=new ze).naturalSize=this.renderAtNaturalSize,k.imageType=this.renderImageType,k.imageQuality=this.renderImageQuality,k.markersOnly=this.renderMarkersOnly,k.width=this.renderWidth,k.height=this.renderHeight,[4,k.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return U.sent(),[4,k.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,U.sent()]}})})},Q.prototype.close=function(k){var U=this;if(k===void 0&&(k=!1),this.isOpen){var X=!1;k||this.eventListeners.beforeclose.forEach(function(ie){var J=new Et(U,!0);ie(J),J.defaultPrevented&&(X=!0)}),X||(this.coverDiv&&this.closeUI(),this.targetObserver&&(this.targetObserver.unobserve(this.target),this.targetObserver.unobserve(this.editorCanvas)),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(ie){return ie(new Et(U))}),this.detachEvents(),this._isOpen=!1)}},Q.prototype.addMarkersToToolbar=function(){for(var k,U=[],X=0;X<arguments.length;X++)U[X]=arguments[X];(k=this._availableMarkerTypes).push.apply(k,U)},Q.prototype.addRenderEventListener=function(k){this.addEventListener("render",function(U){k(U.dataUrl,U.state)})},Q.prototype.removeRenderEventListener=function(k){},Q.prototype.addCloseEventListener=function(k){this.addEventListener("close",function(){k()})},Q.prototype.removeCloseEventListener=function(k){},Q.prototype.setupResizeObserver=function(){var k=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){k.resize(k.target.clientWidth,k.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return k.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},Q.prototype.onPopupTargetResize=function(){var k=1*this.target.clientWidth/this.target.clientHeight,U=this.editorCanvas.clientWidth/k>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*k:this.editorCanvas.clientWidth,X=U<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/k;this.resize(U,X)},Q.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Q.prototype.resize=function(k,U){this._isResizing=!0;var X=k/this.imageWidth,ie=U/this.imageHeight;this.imageWidth=Math.round(k),this.imageHeight=Math.round(U),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(X,ie),this._isResizing=!1},Q.prototype.scaleMarkers=function(k,U){var X,ie=this;this._currentMarker&&this._currentMarker instanceof et?this._currentMarker.scale(k,U):(X=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(J){J!==ie._currentMarker&&J.scale(k,U)}),X!==void 0&&this.setCurrentMarker(X)},Q.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"},Q.prototype.setTopLeft=function(){var k=this.editingTarget.getBoundingClientRect(),U=this.editorCanvas.getBoundingClientRect();this.left=k.left-U.left,this.top=k.top-U.top},Q.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)},Q.prototype.addDefs=function(){for(var k,U=[],X=0;X<arguments.length;X++)U[X]=arguments[X];this.defs=ge.createDefs(),this.addDefsToImage(),(k=this.defs).append.apply(k,U)},Q.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},Q.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)},Q.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},Q.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("touchmove",function(k){return k.preventDefault()}),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},Q.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)},Q.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},Q.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)},Q.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var k=document.createElement("a");k.href="https://markerjs.com/",k.target="_blank",k.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',k.title="Powered by marker.js",k.style.display="grid",k.style.alignItems="center",k.style.justifyItems="center",k.style.padding="3px",k.style.width="20px",k.style.height="20px",this.logoUI.appendChild(k),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Q.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")},Q.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"},Q.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Q.prototype.showUI=function(){var k;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 U=this.settings.uiOffsetTop!==void 0?this.target.offsetTop+this.settings.uiOffsetTop:this.target.offsetTop>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0,X=this.target.offsetLeft+((k=this.settings.uiOffsetLeft)!==null&&k!==void 0?k:0);this.coverDiv.style.top=U+"px",this.coverDiv.style.left=X+"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="fixed",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.settings.displayMode==="popup"&&(this.uiDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px"),this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new _e(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.settings.displayMode==="inline"&&this.settings.uiOffsetTop===void 0&&this.target.offsetTop<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Ze(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},Q.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv),this.coverDiv.remove(),this.coverDiv=null},Q.prototype.removeMarker=function(k){this.markerImage.removeChild(k.container),this.markers.indexOf(k)>-1&&this.markers.splice(this.markers.indexOf(k),1),k.dispose()},Q.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())},Q.prototype.toolbarButtonClicked=function(k,U){if(k==="marker"&&U!==void 0)this.createNewMarker(U);else if(k==="action")switch(U){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()}},Q.prototype.deleteSelectedMarker=function(){var k=this;if(this._currentMarker!==void 0&&this._currentMarker.state==="select"){var U=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ie){var J=new dt(k,k._currentMarker,!0);ie(J),J.defaultPrevented&&(U=!0)}),!U){var X=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(ie){return ie(new dt(k,X))})}}},Q.prototype.clear=function(){var k=this,U=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ae){var tt=new dt(k,void 0,!0);Ae(tt),tt.defaultPrevented&&(U=!0)}),!U)){this.setCurrentMarker();for(var X=function(Ae){var tt=ie.markers[Ae];ie.setCurrentMarker(ie.markers[Ae]),ie._currentMarker.dispose(),ie.markerImage.removeChild(ie._currentMarker.container),ie.markers.splice(ie.markers.indexOf(ie._currentMarker),1),ie.eventListeners.markerdelete.forEach(function(kt){return kt(new dt(k,tt))})},ie=this,J=this.markers.length-1;J>=0;J--)X(J);this.addUndoStep()}},Object.defineProperty(Q.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Q.prototype.showNotesEditor=function(){var k;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(k=this._currentMarker.notes)!==null&&k!==void 0?k:"",this.overlayContainer.appendChild(this.notesArea))},Q.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)},Q.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Q.prototype.addUndoStep=function(){var k=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var U=this.getState(),X=this.undoRedoManager.getLastUndoStep();if(!X||X.width===U.width&&X.height===U.height){var ie=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(U),ie<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(J){return J(new Et(k))})}else this.undoRedoManager.replaceLastUndoStep(U)}},Q.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Q.prototype.undoStep=function(){var k=this,U=this.undoRedoManager.undo();U!==void 0&&(this.restoreState(U),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(X){return X(new Et(k))}))},Q.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},Q.prototype.redoStep=function(){var k=this,U=this.undoRedoManager.redo();U!==void 0&&(this.restoreState(U),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(X){return X(new Et(k))}))},Q.prototype.stepZoom=function(){var k=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=k<this.zoomSteps.length-1?this.zoomSteps[k+1]:this.zoomSteps[0]},Q.prototype.panTo=function(k){this.contentDiv.scrollBy({left:this.prevPanPoint.x-k.x,top:this.prevPanPoint.y-k.y}),this.prevPanPoint=k},Q.prototype.startRenderAndClose=function(){return he(this,void 0,void 0,function(){var k,U,X=this;return Re(this,function(ie){switch(ie.label){case 0:return[4,this.render()];case 1:return k=ie.sent(),U=this.getState(),this.eventListeners.render.forEach(function(J){return J(new Ct(X,k,U))}),this.close(!0),[2]}})})},Q.prototype.getState=function(k){k===!0&&this.setCurrentMarker();var U={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(X){return U.markers.push(X.getState())}),U},Q.prototype.restoreState=function(k){var U=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);k.markers.forEach(function(X){var ie=U._availableMarkerTypes.find(function(Ae){return Ae.typeName===X.typeName});if(ie!==void 0){var J=U.addNewMarker(ie);J.restoreState(X),U.addMarkerEvents(J),U.markers.push(J)}}),k.width&&k.height&&(k.width!==this.imageWidth||k.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/k.width,this.imageHeight/k.height),this.eventListeners.restorestate.forEach(function(X){return X(new Et(U))})},Q.prototype.addNewMarker=function(k){var U=ge.createGroup();return this.markerImage.appendChild(U),new k(U,this.overlayContainer,this.settings)},Q.prototype.createNewMarker=function(k){var U,X=this;(U=typeof k=="string"?this._availableMarkerTypes.find(function(ie){return ie.typeName===k}):k)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(U),this.addMarkerEvents(this._currentMarker),this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(U.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ie){return ie(new dt(X,X._currentMarker))}))},Q.prototype.addMarkerEvents=function(k){k.onMarkerCreated=this.markerCreated,k.onColorChanged=this.colorChanged,k.onFillColorChanged=this.fillColorChanged,k.onStateChanged=this.markerStateChanged},Q.prototype.markerCreated=function(k){var U=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(k),this.setCurrentMarker(k),k instanceof De&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(De):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(X){return X(new dt(U,k))})},Q.prototype.colorChanged=function(k){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=k,this.settings.defaultStrokeColor=k)},Q.prototype.fillColorChanged=function(k){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=k)},Q.prototype.markerStateChanged=function(k){var U=this;this.eventListeners.markerchange.forEach(function(X){return X(new dt(U,k))})},Q.prototype.setCurrentMarker=function(k){var U=this;this._currentMarker!==k&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(X){return X(new dt(U,U._currentMarker))})),this._currentMarker=k,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(X){return X(new dt(U,U._currentMarker))}))},Q.prototype.onPointerDown=function(k){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||k.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var U=this.markers.find(function(X){return X.ownsTarget(k.target)});U!==void 0?(this.setCurrentMarker(U),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(k.clientX,k.clientY),k.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:k.clientX,y:k.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(k.clientX,k.clientY))},Q.prototype.onDblClick=function(k){if(this._isFocused||this.focus(),this.mode==="select"){var U=this.markers.find(function(X){return X.ownsTarget(k.target)});U!==void 0&&U!==this._currentMarker&&this.setCurrentMarker(U),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(k.clientX,k.clientY),k.target):this.setCurrentMarker()}},Q.prototype.onPointerMove=function(k){this.touchPoints!==1&&k.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||k.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(k.clientX,k.clientY)):this.zoomLevel>1&&this.panTo({x:k.clientX,y:k.clientY}))},Q.prototype.onPointerUp=function(k){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(k.clientX,k.clientY)),this.isDragging=!1,this.addUndoStep()},Q.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Q.prototype.onKeyUp=function(k){this._currentMarker===void 0||this.notesArea!==void 0||k.key!=="Delete"&&k.key!=="Backspace"||this.deleteSelectedMarker()},Q.prototype.clientToLocalCoordinates=function(k,U){var X=this.markerImage.getBoundingClientRect(),ie=X.width/this.imageWidth/this.zoomLevel,J=X.height/this.imageHeight/this.zoomLevel;return{x:(k-X.left)/this.zoomLevel/ie,y:(U-X.top)/this.zoomLevel/J}},Q.prototype.onWindowResize=function(){this.positionUI()},Q.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var k=this.target.getClientRects(),U=k.length>0&&k.item(0)&&k.item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=U+"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()},Q.prototype.addLicenseKey=function(k){Ne.addKey(k)},Q.prototype.addEventListener=function(k,U){this.eventListeners.addEventListener(k,U)},Q.prototype.removeEventListener=function(k,U){this.eventListeners.removeEventListener(k,U)},Q.prototype.renderState=function(k){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(k),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Q.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Q.prototype.focus=function(){var k=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(U){return U(new Et(k))}))},Q.prototype.blur=function(){var k=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(U){return U(new Et(k))}))},Q.instanceCounter=0,Q}();/* **********************************
cropro version 1.6.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 Dt=function(Q,k){return(Dt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(U,X){U.__proto__=X}||function(U,X){for(var ie in X)Object.prototype.hasOwnProperty.call(X,ie)&&(U[ie]=X[ie])})(Q,k)};function an(Q,k){if(typeof k!="function"&&k!==null)throw new TypeError("Class extends value "+String(k)+" is not a constructor or null");function U(){this.constructor=Q}Dt(Q,k),Q.prototype=k===null?Object.create(k):(U.prototype=k.prototype,new U)}function nn(Q,k,U,X){return new(U||(U=Promise))(function(ie,J){function Ae(Mt){try{kt(X.next(Mt))}catch(gt){J(gt)}}function tt(Mt){try{kt(X.throw(Mt))}catch(gt){J(gt)}}function kt(Mt){var gt;Mt.done?ie(Mt.value):(gt=Mt.value,gt instanceof U?gt:new U(function($t){$t(gt)})).then(Ae,tt)}kt((X=X.apply(Q,k||[])).next())})}function An(Q,k){var U,X,ie,J,Ae={label:0,sent:function(){if(1&ie[0])throw ie[1];return ie[1]},trys:[],ops:[]};return J={next:tt(0),throw:tt(1),return:tt(2)},typeof Symbol=="function"&&(J[Symbol.iterator]=function(){return this}),J;function tt(kt){return function(Mt){return function(gt){if(U)throw new TypeError("Generator is already executing.");for(;Ae;)try{if(U=1,X&&(ie=2&gt[0]?X.return:gt[0]?X.throw||((ie=X.return)&&ie.call(X),0):X.next)&&!(ie=ie.call(X,gt[1])).done)return ie;switch(X=0,ie&&(gt=[2&gt[0],ie.value]),gt[0]){case 0:case 1:ie=gt;break;case 4:return Ae.label++,{value:gt[1],done:!1};case 5:Ae.label++,X=gt[1],gt=[0];continue;case 7:gt=Ae.ops.pop(),Ae.trys.pop();continue;default:if(!(ie=Ae.trys,(ie=ie.length>0&&ie[ie.length-1])||gt[0]!==6&&gt[0]!==2)){Ae=0;continue}if(gt[0]===3&&(!ie||gt[1]>ie[0]&&gt[1]<ie[3])){Ae.label=gt[1];break}if(gt[0]===6&&Ae.label<ie[1]){Ae.label=ie[1],ie=gt;break}if(ie&&Ae.label<ie[2]){Ae.label=ie[2],Ae.ops.push(gt);break}ie[2]&&Ae.ops.pop(),Ae.trys.pop();continue}gt=k.call(Q,Ae)}catch($t){gt=[6,$t],X=0}finally{U=ie=0}if(5&gt[0])throw gt[1];return{value:gt[0]?gt[1]:void 0,done:!0}}([kt,Mt])}}}var _n=function(){function Q(){}return Q.addKey=function(k){Q.key=k},Object.defineProperty(Q,"isLicensed",{get:function(){return!!Q.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Q.key)},enumerable:!1,configurable:!0}),Q}(),At=function(){function Q(){}return Q.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Q.setAttributes=function(k,U){for(var X=0,ie=U;X<ie.length;X++){var J=ie[X],Ae=J[0],tt=J[1];k.setAttribute(Ae,tt)}},Q.createRect=function(k,U,X){var ie=document.createElementNS("http://www.w3.org/2000/svg","rect");return ie.setAttribute("width",k.toString()),ie.setAttribute("height",U.toString()),X&&Q.setAttributes(ie,X),ie},Q.createLine=function(k,U,X,ie,J){var Ae=document.createElementNS("http://www.w3.org/2000/svg","line");return Ae.setAttribute("x1",k.toString()),Ae.setAttribute("y1",U.toString()),Ae.setAttribute("x2",X.toString()),Ae.setAttribute("y2",ie.toString()),J&&Q.setAttributes(Ae,J),Ae},Q.createPolygon=function(k,U){var X=document.createElementNS("http://www.w3.org/2000/svg","polygon");return X.setAttribute("points",k),U&&Q.setAttributes(X,U),X},Q.createCircle=function(k,U){var X=document.createElementNS("http://www.w3.org/2000/svg","circle");return X.setAttribute("cx",(k/2).toString()),X.setAttribute("cy",(k/2).toString()),X.setAttribute("r",k.toString()),U&&Q.setAttributes(X,U),X},Q.createEllipse=function(k,U,X){var ie=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ie.setAttribute("cx",(k/2).toString()),ie.setAttribute("cy",(U/2).toString()),ie.setAttribute("rx",(k/2).toString()),ie.setAttribute("ry",(U/2).toString()),X&&Q.setAttributes(ie,X),ie},Q.createGroup=function(k){var U=document.createElementNS("http://www.w3.org/2000/svg","g");return k&&Q.setAttributes(U,k),U},Q.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Q.createMarker=function(k,U,X,ie,J,Ae,tt){var kt=document.createElementNS("http://www.w3.org/2000/svg","marker");return Q.setAttributes(kt,[["id",k],["orient",U],["markerWidth",X.toString()],["markerHeight",ie.toString()],["refX",J.toString()],["refY",Ae.toString()]]),kt.appendChild(tt),kt},Q.createText=function(k){var U=document.createElementNS("http://www.w3.org/2000/svg","text");return U.setAttribute("x","0"),U.setAttribute("y","0"),k&&Q.setAttributes(U,k),U},Q.createTSpan=function(k,U){var X=document.createElementNS("http://www.w3.org/2000/svg","tspan");return X.textContent=k,U&&Q.setAttributes(X,U),X},Q.createImage=function(k){var U=document.createElementNS("http://www.w3.org/2000/svg","image");return k&&Q.setAttributes(U,k),U},Q.createPoint=function(k,U){var X=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return X.x=k,X.y=U,X},Q.createPath=function(k,U){var X=document.createElementNS("http://www.w3.org/2000/svg","path");return X.setAttribute("d",k),U&&Q.setAttributes(X,U),X},Q.createElement=function(k,U){var X=document.createElementNS("http://www.w3.org/2000/svg",k);return U&&Q.setAttributes(X,U),X},Q.getHollowRectanglePath=function(k,U,X,ie,J,Ae,tt,kt){return"M"+k+","+U+"V"+(U+ie)+"H"+(k+X)+"V"+U+"H"+J+"V"+Ae+"H"+(J+tt)+"V"+(Ae+kt)+"H"+J+"V"+U+"Z"},Q}(),jt=function(){function Q(k){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+k+"_"}return Object.defineProperty(Q.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Q.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(Q.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),Q.prototype.addClass=function(k){return this.styleSheet===void 0&&this.addStyleSheet(),k.name=""+this.classNamePrefix+k.localName,this.classes.push(k),this.styleSheet.sheet.insertRule("."+k.name+" {"+k.style+"}",this.styleSheet.sheet.cssRules.length),k},Q.prototype.addRule=function(k){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(k),this.styleSheet.sheet.insertRule(k.selector+" {"+k.style+"}",this.styleSheet.sheet.cssRules.length)},Q.prototype.addStyleSheet=function(){var k;this.styleSheet=document.createElement("style"),((k=this.styleSheetRoot)!==null&&k!==void 0?k:document.head).appendChild(this.styleSheet),this.addRule(new on("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new on("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new on("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Ee("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Ee("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},Q.prototype.removeStyleSheet=function(){var k;this.styleSheet&&(((k=this.styleSheetRoot)!==null&&k!==void 0?k:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Q}(),on=function(Q,k){this.selector=Q,this.style=k},Ee=function(Q,k){this.localName=Q,this.style=k},se=function(){function Q(){this.blocks=[],this.display=""}return Q.prototype.addButtonBlock=function(k){k.className=this.blockClassName,k.buttonClassName=this.buttonClassName,k.buttonColorsClassName=this.buttonColorsClassName,k.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(k)},Q.prototype.addElementBlock=function(k){k.className===void 0&&(k.className=this.blockClassName),this.blocks.push(k)},Q.prototype.getUI=function(){var k=document.createElement("div");return k.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,k.style.display=this.display,this.blocks.forEach(function(U){return k.appendChild(U.getUI())}),k},Q}(),H=function(){function Q(){}return Q.prototype.getUI=function(){var k=document.createElement("div");if(k.className=this.className,this.minWidth!==void 0&&(k.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":k.style.justifyContent="flex-start";break;case"center":k.style.justifyContent="center";break;case"end":k.style.justifyContent="flex-end"}return k.style.whiteSpace="nowrap",k},Q}(),V=function(Q){function k(){var U=Q!==null&&Q.apply(this,arguments)||this;return U.buttons=[],U}return an(k,Q),k.prototype.addButton=function(U){U.className=this.buttonClassName,U.colorsClassName=this.buttonColorsClassName,U.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(U)},k.prototype.getUI=function(){var U=Q.prototype.getUI.call(this);return this.buttons.forEach(function(X){return U.appendChild(X.getUI())}),U},k}(H),$=function(){function Q(k,U){this._isActive=!1,this._isHidden=!1,this._icon=k,this.title=U,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(Q.prototype,"icon",{get:function(){return this._icon},set:function(k){this._icon=k,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"isActive",{get:function(){return this._isActive},set:function(k){this._isActive=k,this.adjustClassName()},enumerable:!1,configurable:!0}),Q.prototype.getUI=function(){var k=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.setAttribute("role","button"),this.buttonContainer.setAttribute("aria-label",this.title),this.buttonContainer.setAttribute("data-action",this.title),this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return k.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},Q.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,"")))},Q.prototype.hide=function(){this._isHidden=!0},Q}(),ee=function(Q){function k(){var U=Q!==null&&Q.apply(this,arguments)||this;return U.elements=[],U}return an(k,Q),k.prototype.addElement=function(U){this.elements.push(U)},k.prototype.getUI=function(){var U=Q.prototype.getUI.call(this);return this.elements.forEach(function(X){return U.appendChild(X)}),U},k}(H),xe=function(){function Q(k,U){this.horizontal=k,this.vertical=U}return Object.defineProperty(Q.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),Q.prototype.getVerticalLength=function(k){return k/this.ratio},Q.prototype.getHorizontalLength=function(k){return k*this.ratio},Q}(),Ue=function(){function Q(){}return Q.getIcon=function(k,U){if(k>0&&U>0){var X=new xe(k,U),ie=X.ratio>=1?20:X.getHorizontalLength(20),J=X.ratio<1?20:X.getVerticalLength(20),Ae=document.createElementNS("http://www.w3.org/2000/svg","svg");Ae.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ae.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Ae);var tt=At.createDefs();Ae.appendChild(tt);var kt=At.createElement("clipPath",[["id","text-bg-clip"]]);tt.appendChild(kt);var Mt=At.createPath(At.getHollowRectanglePath((24-ie)/2,(24-J)/2,ie,J,(24-ie)/2+2,(24-J)/2+2,ie-4,J-4));Ae.appendChild(Mt);var gt=At.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);gt.appendChild(At.createTSpan(k+":"+U)),Ae.appendChild(gt);var $t=gt.getBBox();At.setAttributes(gt,[["x",((24-$t.width)/2).toString()],["y",((24-$t.height)/2-$t.y).toString()]]);var mn=At.createPath(At.getHollowRectanglePath(0,0,24,24,(24-Math.ceil($t.width))/2,(24-Math.ceil($t.height))/2,Math.ceil($t.width),Math.ceil($t.height)));return kt.appendChild(mn),At.setAttributes(Mt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Ae),Ae.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>'},Q}(),$e=function(Q){function k(U,X,ie){var J=Q.call(this,U,X)||this;return J.isDropdownOpen=!1,J.onClick=J.dropdownButtonClicked,J.dropdownButtons=ie,J}return an(k,Q),k.prototype.setupDropdown=function(){var U=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(X){X.className=U.className,X.colorsClassName=U.colorsClassName,U.dropdownBlock.appendChild(X.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},k.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},k.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},k.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},k.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},k.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},k}($),pt=function(){function Q(k,U){this.GRIP_SIZE=10,this.color=k,this.fillColor=U,this.visual=At.createGroup(),this.visual.appendChild(At.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(At.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Q.prototype.ownsTarget=function(k){return k===this.visual||k===this.visual.childNodes[0]||k===this.visual.childNodes[1]},Q.prototype.setCenter=function(k,U){this.visual.childNodes.forEach(function(X){return At.setAttributes(X,[["cx",k.toString()],["cy",U.toString()]])})},Q}(),xt=function(){function Q(k,U,X,ie){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this._zoomToCropEnabled=!1,this.cropRectChanged=!1,this.canvasWidth=k,this.canvasHeight=U,this.margin=X,this.container=ie,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(Q.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(k){this._aspectRatio=k,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(k){this._isGridVisible=k,this.gridContainer&&At.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(k){this._zoomFactor=k,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"zoomToCropEnabled",{set:function(k){this._zoomToCropEnabled=k},enumerable:!1,configurable:!0}),Q.prototype.open=function(){var k=this;this.cropShadeElement=At.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=At.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var U=0;U<this.numberOfGridLines;U++)this.horizontalGridLines.push(At.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(At.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(X){return k.gridContainer.appendChild(X)}),this.verticalGridLines.forEach(function(X){return k.gridContainer.appendChild(X)}),this.cropRectElement=At.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new pt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new pt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new pt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new pt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},Q.prototype.setCropRectangle=function(k){this.cropRect=k;var U=Object.assign({},this.cropRect);this._zoomToCropEnabled&&(U.width=this.cropRect.width*this.zoomFactor,U.height=this.cropRect.height*this.zoomFactor,U.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-U.width/2,U.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-U.height/2),At.setAttributes(this.cropRectElement,[["x",U.x.toString()],["y",U.y.toString()],["width",U.width.toString()],["height",U.height.toString()]]);var X=U.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(J,Ae){var tt=U.y+X*(Ae+1);At.setAttributes(J,[["x1",""+U.x],["y1",""+tt],["x2",""+(U.x+U.width)],["y2",""+tt]])});var ie=U.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(J,Ae){var tt=U.x+ie*(Ae+1);At.setAttributes(J,[["x1",""+tt],["y1",""+U.y],["x2",""+tt],["y2",""+(U.y+U.height)]])}),At.setAttributes(this.cropShadeElement,[["d",At.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,U.x,U.y,U.width,U.height)]]),this.topLeftGrip.setCenter(U.x,U.y),this.topRightGrip.setCenter(U.x+U.width,U.y),this.bottomLeftGrip.setCenter(U.x,U.y+U.height),this.bottomRightGrip.setCenter(U.x+U.width,U.y+U.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},Q.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)},Q.prototype.clientToLocalCoordinates=function(k,U){var X=this.container.getBoundingClientRect();return{x:k-X.left+this.margin,y:U-X.top+this.margin}},Q.prototype.onPointerDown=function(k){this.container.setPointerCapture(k.pointerId),this.previousPoint=this.clientToLocalCoordinates(k.clientX,k.clientY),this.cropRectElement===k.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(k.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(k.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(k.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(k.target)&&(this.activeGrip=this.bottomRightGrip)},Q.prototype.onPointerMove=function(k){if(this.isMoving)this.move(this.clientToLocalCoordinates(k.clientX,k.clientY));else if(this.activeGrip){var U=this.clientToLocalCoordinates(k.clientX,k.clientY);this.resize(U)}k.preventDefault()},Q.prototype.onPointerUp=function(k){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(k.pointerId)},Q.prototype.move=function(k){var U=k.x-this.previousPoint.x,X=k.y-this.previousPoint.y;this.zoomFactor!==1&&(U=-U/this.zoomFactor,X=-X/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+U),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+X),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=k},Q.prototype.resize=function(k){var U=Object.assign({},this.cropRect),X=k.x-this.previousPoint.x,ie=k.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:U.x+X<this.margin&&(X=this.margin-U.x),U.x+=X,U.width=this.cropRect.x+this.cropRect.width-U.x;break;case this.bottomRightGrip:case this.topRightGrip:U.width+X>this.canvasWidth*this.zoomFactor&&(X=this.canvasWidth*this.zoomFactor-U.width),U.width+=X}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(U.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(X),U.height=this.aspectRatio.getVerticalLength(U.width)):(U.y+=ie,U.height=this.cropRect.y+this.cropRect.height-U.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?U.height=this.aspectRatio.getVerticalLength(U.width):U.height+=ie}U.width<10&&(U.x=this.cropRect.x,U.width=10),U.height<10&&(U.y=this.cropRect.y,U.height=10),this.previousPoint=k,U.x>=this.margin&&U.y>=this.margin&&Math.floor(U.x-this.margin+U.width)<=Math.ceil(this.canvasWidth)&&Math.floor(U.y-this.margin+U.height)<=Math.ceil(this.canvasHeight)&&(this.cropRect=U,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},Q.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var k=this.cropRect.x+this.cropRect.width/2,U=this.cropRect.y+this.cropRect.height/2,X=this.aspectRatio.getHorizontalLength(this.cropRect.height),ie=this.aspectRatio.getVerticalLength(this.cropRect.width);X/this.canvasWidth<ie/this.canvasHeight?this.cropRect.width=X:this.cropRect.height=ie,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=k-this.cropRect.width/2,this.cropRect.y=U-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)}},Q.prototype.getRescaledRect=function(k,U,X,ie,J,Ae){var tt=X/k,kt=ie/U;return{x:(J.x-Ae)*tt+Ae,y:(J.y-Ae)*kt+Ae,width:J.width*tt,height:J.height*kt}},Q.prototype.scaleCanvas=function(k,U){var X=this.getRescaledRect(this.canvasWidth,this.canvasHeight,k,U,this.cropRect,this.margin);this.canvasWidth=k,this.canvasHeight=U,this.onCropChange&&this.onCropChange(X),this.setCropRectangle(X)},Q}(),Ve=function(){function Q(k){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=k,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(Q.prototype,"angle",{get:function(){return this._angle},set:function(k){this._angle=k,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),Q.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.setAttribute("role","button"),this.controlContainer.setAttribute("aria-label",this.title),this.controlContainer.setAttribute("data-action",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},Q.prototype.onPointerDown=function(k){this.controlContainer.setPointerCapture(k.pointerId),this.isDragging=!0,this.previousPoint={x:k.clientX,y:k.clientY}},Q.prototype.onPointerMove=function(k){this.isDragging&&(this.onAngleChange&&this.onAngleChange((k.clientX-this.previousPoint.x)/5),this.previousPoint.x=k.clientX)},Q.prototype.onPointerUp=function(k){this.isDragging&&this.onAngleChange&&this.onAngleChange((k.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(k.pointerId)},Q.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var k=this.angleLabelText.getBBox();At.setAttributes(this.angleLabelElement,[["x",((this.width-k.width)/2).toString()],["y",(this.height/2).toString()]])}},Q.prototype.positionScaleShape=function(){if(this.scaleShape){var k=this.scaleShape.transform.baseVal.getItem(0);k.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(k,0)}},Q.prototype.getVisual=function(){var k=document.createElementNS("http://www.w3.org/2000/svg","svg");k.setAttribute("xmlns","http://www.w3.org/2000/svg"),k.setAttribute("width",this.width+"px"),k.setAttribute("height",this.height+"px"),k.setAttribute("viewBox","0 0 "+this.width+" "+this.height),k.style.flexShrink="0",document.body.appendChild(k);for(var U="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,X=1;X<=this.width/5+10;X++){var ie=X%5==0?this.height/3:this.height/6;U+="h4v"+-ie+"h1v"+ie}U+="v1H0Z",this.scaleShape=At.createPath(U);var J=At.createTransform();this.scaleShape.transform.baseVal.appendItem(J),k.appendChild(this.scaleShape),this.angleLabelElement=At.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=At.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Ae=At.createTSpan("");return Ae.innerHTML="&deg;",this.angleLabelElement.appendChild(Ae),k.appendChild(this.angleLabelElement),document.body.removeChild(k),k},Q}(),ht=function(){function Q(){this.naturalSize=!1,this.imageType="image/png",this.rasterize=this.rasterize.bind(this)}return Q.prototype.rasterize=function(k,U,X,ie,J,Ae,tt){var kt=this;return new Promise(function(Mt){var gt=document.createElement("canvas");gt.width=k.width.baseVal.value-2*ie,gt.height=k.height.baseVal.value-2*ie;var $t=1,mn=1;if(kt.naturalSize===!0?($t=Math.abs(U.naturalWidth/(k.width.baseVal.value-2*ie)/Ae),mn=Math.abs(U.naturalHeight/(k.height.baseVal.value-2*ie)/tt),gt.width=Math.abs(U.naturalWidth/Ae),gt.height=Math.abs(U.naturalHeight/tt)):kt.width!==void 0&&kt.height!==void 0&&($t=kt.width/X.width,mn=kt.height/X.height,gt.width*=$t,gt.height*=mn),kt.maxSize!==void 0&&gt.width*gt.height>=kt.maxSize){var Mn=gt.width*gt.height,lr=Math.sqrt(kt.maxSize/Mn);$t*=lr,mn*=lr,gt.width*=lr,gt.height*=lr}var Kn=gt.getContext("2d");Kn.translate(gt.width/2,gt.height/2),Kn.rotate(J*Math.PI/180),Kn.scale(Ae,tt),Kn.translate(-gt.width/2,-gt.height/2),Kn.drawImage(U,0,0,gt.width,gt.height);var ur=document.createElement("canvas");ur.width=X.width*$t,ur.height=X.height*mn,ur.getContext("2d").putImageData(Kn.getImageData((X.x-ie)*$t,(X.y-ie)*mn,X.width*$t,X.height*mn),0,0),Mt(ur.toDataURL(kt.imageType,kt.imageQuality))})},Q}(),Rt=function(){function Q(k){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.stateChangeEventListeners=[],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.previousState="",this._instanceNo=Q.instanceCounter++,this.styles=new jt(this.instanceNo),this.target=k,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),this.renderState=this.renderState.bind(this),this.addStateChangeEventListener=this.addStateChangeEventListener.bind(this),this.removeStateChangeEventListener=this.removeStateChangeEventListener.bind(this),this.onStateChanged=this.onStateChanged.bind(this)}return Object.defineProperty(Q.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(k){this._zoomToCropEnabled=k,this.cropLayer!==void 0&&(this.cropLayer.zoomToCropEnabled=this._zoomToCropEnabled),k?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(k){this._isGridVisible=k,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"gridLines",{get:function(){return this._gridLines},set:function(k){this._gridLines=k,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(k){this._rotationAngle=k,this.straightener&&(this.straightener.angle=this._rotationAngle),this.onStateChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"aspectRatio",{get:function(){var k;return(k=this._aspectRatio)!==null&&k!==void 0?k:this.aspectRatios[0]},set:function(k){this._aspectRatio=k},enumerable:!1,configurable:!0}),Q.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},Q.prototype.show=function(){this.showUI(),this.open()},Q.prototype.close=function(k){k===void 0&&(k=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),k||this.closeEventListeners.forEach(function(U){return U()}),this._isOpen=!1)},Q.prototype.addRenderEventListener=function(k){this.renderEventListeners.push(k)},Q.prototype.removeRenderEventListener=function(k){this.renderEventListeners.indexOf(k)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(k),1)},Q.prototype.addCloseEventListener=function(k){this.closeEventListeners.push(k)},Q.prototype.removeCloseEventListener=function(k){this.closeEventListeners.indexOf(k)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(k),1)},Q.prototype.addStateChangeEventListener=function(k){this.stateChangeEventListeners.push(k)},Q.prototype.removeStateChangeEventListener=function(k){this.stateChangeEventListeners.indexOf(k)>-1&&this.stateChangeEventListeners.splice(this.stateChangeEventListeners.indexOf(k),1)},Q.prototype.setupResizeObserver=function(){var k=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){k.resize(k.target.clientWidth,k.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))},Q.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var k=1*this.target.clientWidth/this.target.clientHeight,U=this.contentDiv.clientWidth/k>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*k:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,X=U+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/k;this.resize(U,X)}},Q.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Q.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",At.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},Q.prototype.resize=function(k,U){this.imageWidth=Math.round(k),this.imageHeight=Math.round(U),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(),this.onStateChanged()},Q.prototype.setEditingTarget=function(){At.setAttributes(this.editingTarget,[["href",this.target.src]]),this.setEditingTargetSize()},Q.prototype.setTopLeft=function(){var k=this.target.getBoundingClientRect(),U=this.editorCanvas.getBoundingClientRect();this.left=k.left-U.left-this.CANVAS_MARGIN,this.top=k.top-U.top-this.CANVAS_MARGIN},Q.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=At.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=At.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=At.createGroup(),this.editingTargetRotationScaleContainer=At.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var k=At.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(k);var U=At.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(U),this.editingTargetContainer=At.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)},Q.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},Q.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=At.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new xt(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.zoomToCropEnabled=this.zoomToCropEnabled,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},Q.prototype.zoomToCrop=function(){if(this.cropRect){var k=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,U=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=k+"px "+U+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-k+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-U+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},Q.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)},Q.prototype.cropRectChanged=function(k){this.cropRect=k,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1,this.onStateChanged()},Q.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},Q.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"},Q.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Q.prototype.showUI=function(){var k,U;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 X=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,ie=this.target.offsetTop>X+this.CANVAS_MARGIN?this.target.offsetTop-(X+this.CANVAS_MARGIN):0;ie+=(k=this.uiOffsetTop)!==null&&k!==void 0?k:0;var J=this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0;J+=(U=this.uiOffsetLeft)!==null&&U!==void 0?U:0,this.coverDiv.style.top=ie+"px",this.coverDiv.style.left=J+"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.processingUi=document.createElement("div"),this.processingUi.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="margin: auto; background: none; display: block; shape-rendering: auto;" width="50px" height="50px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid">
<rect x="19" y="19" width="20" height="20" fill="#eeeeee">
<animate attributeName="fill" values="#888888;#eeeeee;#eeeeee" keyTimes="0;0.125;1" dur="1s" repeatCount="indefinite" begin="0s" calcMode="discrete"></animate>
</rect><rect x="40" y="19" width="20" height="20" fill="#eeeeee">
<animate attributeName="fill" values="#888888;#eeeeee;#eeeeee" keyTimes="0;0.125;1" dur="1s" repeatCount="indefinite" begin="0.125s" calcMode="discrete"></animate>
</rect><rect x="61" y="19" width="20" height="20" fill="#eeeeee">
<animate attributeName="fill" values="#888888;#eeeeee;#eeeeee" keyTimes="0;0.125;1" dur="1s" repeatCount="indefinite" begin="0.25s" calcMode="discrete"></animate>
</rect><rect x="19" y="40" width="20" height="20" fill="#eeeeee">
<animate attributeName="fill" values="#888888;#eeeeee;#eeeeee" keyTimes="0;0.125;1" dur="1s" repeatCount="indefinite" begin="0.875s" calcMode="discrete"></animate>
</rect><rect x="61" y="40" width="20" height="20" fill="#eeeeee">
<animate attributeName="fill" values="#888888;#eeeeee;#eeeeee" keyTimes="0;0.125;1" dur="1s" repeatCount="indefinite" begin="0.375s" calcMode="discrete"></animate>
</rect><rect x="19" y="61" width="20" height="20" fill="#eeeeee">
<animate attributeName="fill" values="#888888;#eeeeee;#eeeeee" keyTimes="0;0.125;1" dur="1s" repeatCount="indefinite" begin="0.75s" calcMode="discrete"></animate>
</rect><rect x="40" y="61" width="20" height="20" fill="#eeeeee">
<animate attributeName="fill" values="#888888;#eeeeee;#eeeeee" keyTimes="0;0.125;1" dur="1s" repeatCount="indefinite" begin="0.625s" calcMode="discrete"></animate>
</rect><rect x="61" y="61" width="20" height="20" fill="#eeeeee">
<animate attributeName="fill" values="#888888;#eeeeee;#eeeeee" keyTimes="0;0.125;1" dur="1s" repeatCount="indefinite" begin="0.5s" calcMode="discrete"></animate>
</rect>
</svg>`,this.processingUi.style.position="absolute",this.processingUi.style.width="100%",this.processingUi.style.height="100%",this.processingUi.style.backgroundColor="rgba(0,0,0,0.3)",this.processingUi.style.alignItems="center",this.processingUi.style.justifyContent="center",this.processingUi.style.display="none",this.editorCanvas.appendChild(this.processingUi),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},Q.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},Q.prototype.addTopToolbar=function(){var k=this;this.topToolbar=new se,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 U=new V;U.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(U);var X=[];this.aspectRatios.forEach(function(mn){var Mn=new $(Ue.getIcon(mn.horizontal,mn.vertical),mn.horizontal===0&&mn.vertical===0?"FREE":mn.horizontal+":"+mn.vertical);Mn.onClick=function(){return k.ratioButtonClicked(mn)},X.push(Mn)}),this.aspectRatioButton=new $e(Ue.getIcon(0,0),"Aspect ratio",X),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,U.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ie=new $('<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");ie.isActive=this.isGridVisible,ie.onClick=function(){k.isGridVisible=!k.isGridVisible,ie.isActive=k.isGridVisible},U.addButton(ie);var J=new $('<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(J.isActive=this.zoomToCropEnabled,J.onClick=function(){k.zoomToCropEnabled=!k.zoomToCropEnabled,J.isActive=k.zoomToCropEnabled},U.addButton(J),!_n.isLicensed){var Ae=new ee;this.topToolbar.addElementBlock(Ae);var tt=document.createElement("div");tt.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var kt=document.createElement("a");kt.style.color="currentColor",kt.href="https://markerjs.com/products/cropro",kt.target="_blank",kt.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>',tt.appendChild(kt),Ae.addElement(tt)}var Mt=new V;Mt.minWidth=3*this.toolbarHeight+"px",Mt.contentAlign="end",this.topToolbar.addButtonBlock(Mt);var gt=new $('<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");gt.onClick=function(){k.processingUi.style.display="flex",setTimeout(k.startRenderAndClose,100)},Mt.addButton(gt),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(gt.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var $t=new $('<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");$t.onClick=this.close,Mt.addButton($t),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&($t.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},Q.prototype.addBottomToolbar=function(){var k=this;this.bottomToolbar=new se,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 U=new V;U.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(U);var X=new $('<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");X.onClick=this.rotateLeftButtonClicked,U.addButton(X);var ie=new $('<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");ie.onClick=this.rotateRightButtonClicked,U.addButton(ie);var J=new ee;J.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(J),this.straightener=new Ve("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(Mt){k.rotateBy(Mt),k.straightener.angle=k.rotationAngle},J.addElement(this.straightener.getUI());var Ae=new V;Ae.minWidth=2*this.toolbarHeight+"px",Ae.contentAlign="end",this.bottomToolbar.addButtonBlock(Ae);var tt=new $('<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");tt.onClick=this.flipHorizontallyButtonClicked,Ae.addButton(tt);var kt=new $('<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");kt.onClick=this.flipVerticallyButtonClicked,Ae.addButton(kt)},Q.prototype.ratioButtonClicked=function(k){this.aspectRatio=k,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},Q.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Ue.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},Q.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new xe(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0,this.onStateChanged())},Q.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Q.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},Q.prototype.restoreState=function(k){if(k){var U=this.cropLayer.getRescaledRect(k.width,k.height,this.imageWidth,this.imageHeight,k.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(U),this.cropRectChanged(U),this.flippedHorizontally=k.flippedHorizontally,this.flippedVertically=k.flippedVertically,this.applyFlip(),this.rotationAngle=k.rotationAngle,this.applyRotation(),this.onStateChanged()}},Q.prototype.renderState=function(k){this.displayMode="inline",this.isOpen||this.show(),this.restoreState(k),this.startRenderAndClose()},Q.prototype.clientToLocalCoordinates=function(k,U){var X=this.cropImage.getBoundingClientRect();return{x:k-X.left,y:U-X.top}},Q.prototype.onWindowResize=function(){this.positionUI()},Q.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var k=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=k+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},Q.prototype.rotateLeftButtonClicked=function(){var k=this.rotationAngle-90;this.rotationAngle%90!=0&&(k+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(k)},Q.prototype.rotateRightButtonClicked=function(){var k=this.rotationAngle+90;this.rotationAngle%90!=0&&(k-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(k)},Q.prototype.rotateTo=function(k){k=(k=k>180?k-360:k)<=-180?k+360:k,this.rotationAngle=k,this.applyRotation()},Q.prototype.rotateBy=function(k){this.rotateTo((this.rotationAngle+k)%360)},Q.prototype.applyRotation=function(){var k=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var U=this.editingTargetRotationContainer.transform.baseVal.getItem(0);U.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(U,0);var X=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/X.width,this.imageHeight/X.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=k},Q.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},Q.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},Q.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")",this.onStateChanged()},Q.prototype.startRenderAndClose=function(){return nn(this,void 0,void 0,function(){var k,U;return An(this,function(X){switch(X.label){case 0:return[4,this.render()];case 1:return k=X.sent(),U=this.getState(),this.renderEventListeners.forEach(function(ie){return ie(k,U)}),this.close(!0),[2]}})})},Q.prototype.render=function(){return nn(this,void 0,void 0,function(){var k,U;return An(this,function(X){switch(X.label){case 0:return(k=new ht).naturalSize=this.renderAtNaturalSize,k.imageType=this.renderImageType,k.imageQuality=this.renderImageQuality,k.width=this.renderWidth,k.height=this.renderHeight,k.maxSize=this.renderMaxSize,this.unzoomFromCrop(),At.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,k.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 X.sent(),[4,k.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 U=X.sent(),this.processingUi.style.display="none",[2,U]}})})},Q.prototype.onStateChanged=function(){var k=this.getState(),U=JSON.stringify(k);this.previousState!==U&&(this.stateChangeEventListeners.forEach(function(X){return X(k)}),this.previousState=U)},Q.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ee("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 Ee("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ee("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var k=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ee("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*k)+`px;
height: `+(this.toolbarHeight-2*k)+`px;
padding: `+k+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ee("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ee("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new on("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new on("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Ee("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 Ee("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Ee("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 Ee("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*k)+`px;
padding: `+k+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Ee("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},Q.instanceCounter=0,Q}(),lt=M("8hTe"),Pt=M.n(lt),Wt=/<pre[^>]*>/g;function Bt(Q){var k=document.createElement("div");return k.innerHTML=Q,k.childNodes.length===0?"":k.childNodes[0].nodeValue}var wt=ce.a=function(Q){var k=Q.value,U=k===void 0?"":k,X=Q.edit,ie=X===void 0?!1:X,J=Q.className,Ae=Q.showTextOnly,tt=Q.showLines,kt=Q.replaces,Mt=Q.zoomImg,gt=Q.hasMask,$t=Q.style,mn=$t===void 0?{}:$t,Mn=Q.stylesPrev,lr=Mn===void 0?{}:Mn,Kn=String(U),ur=Object(W.useRef)(),dr=Object(W.useRef)(),hr=Object(W.useState)(""),Dr=Object(R.a)(hr,2),Cr=Dr[0],Wn=Dr[1],Er=Object(W.useState)("office"),zr=Object(R.a)(Er,2),vi=zr[0],xr=zr[1],Zr=function(){var Qn=new Rt(dr.current);Qn.displayMode="popup",Qn.addRenderEventListener(function(){var Or=Object(z.a)(n.a.mark(function er(Wr){var Rr;return n.a.wrap(function(Ar){for(;;)switch(Ar.prev=Ar.next){case 0:return ur.current.style.display="none",Ar.next=3,Object(te.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Wr}});case 3:Rr=Ar.sent,Rr!=null&&Rr.id&&kt(dr.current.getAttribute("src").replace(j.a.API_SERVER,""),"/api/attachments/".concat(Rr==null?void 0:Rr.id,"?type=").concat(Rr.content_type));case 5:case"end":return Ar.stop()}},er)}));return function(er){return Or.apply(this,arguments)}}()),Qn.show()},_i=function(){var Qn=new Xt(dr.current);Qn.settings.displayMode="popup",Qn.addEventListener("render",function(){var Or=Object(z.a)(n.a.mark(function er(Wr){var Rr;return n.a.wrap(function(Ar){for(;;)switch(Ar.prev=Ar.next){case 0:if(ur.current.style.display="none",!dr.current){Ar.next=6;break}return Ar.next=4,Object(te.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Wr.dataUrl}});case 4:Rr=Ar.sent,Rr!=null&&Rr.id&&kt(dr.current.getAttribute("src").replace(j.a.API_SERVER,""),"/api/attachments/".concat(Rr==null?void 0:Rr.id,"?type=").concat(Rr.content_type));case 6:case"end":return Ar.stop()}},er)}));return function(er){return Or.apply(this,arguments)}}()),Qn.show(),window.markerArea=Qn},yi=Object(W.useMemo)(function(){ur.current&&(ur.current.style.zIndex=-1);try{var Sr=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Qn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Or=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Kn=Kn.replace(Sr,"("+j.a.API_SERVER+"/api/attachments/").replace(Qn,'"'+j.a.API_SERVER+"/api/attachments/").replace(Or,'"'+j.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(Vr){}var er=L(Kn),Wr=C();if(Kn.match(/\[TOC\]/)&&(er=er.replace("<p>[TOC]</p>",E()),S()),er=er.replace(/(__special_katext_id_\d+__)/g,function(Vr,Ar){var Ri=Wr[Ar],Hi=Ri.type,ri=Ri.expression;return Object(G.renderToString)(Bt(ri)||"",{displayMode:Hi==="block",throwOnError:!1,output:"html"})}),er=er.replace(/▁/g,"\u2581\u2581\u2581"),p(),Ae){var Rr=document.createElement("div");return Rr.innerHTML=er,Rr.innerText}return setTimeout(function(){return Pr()},500),er},[Kn]),qr=Object(W.useRef)();w.WebkitLineClamp=tt,tt&&(mn=Object(ae.a)(Object(ae.a)({},mn),w));function di(Sr){var Qn=Sr.target;if(Qn.tagName.toUpperCase()==="IMG"){if(Mt){var Or=Qn.getAttribute("src");Wn(Or),xr("image")}}else if(Qn.tagName.toUpperCase()==="A"){var er=Qn.getAttribute("href");if(er.indexOf("office")>-1)Sr.preventDefault(),Wn(er),xr("office");else if(er.indexOf("application/pdf")>-1)Sr.preventDefault(),Wn(er),xr("pdf");else if(er.indexOf("text/html")>-1)Sr.preventDefault(),Wn(er),xr("html");else if(er.startsWith("#")){Sr.preventDefault();var Wr=document.getElementById(er.replace("#",""));Wr&&Wr.scrollIntoView(!0)}}}var Pr=function(){var Qn,Or=(Qn=qr.current)===null||Qn===void 0?void 0:Qn.querySelectorAll("video");Or==null||Or.forEach(function(er){if(er.oncontextmenu=function(){return!1},er.src.indexOf(".m3u8")>-1&&!er.canPlayType("application/vnd.apple.mpegurl")){if(F.a.isSupported()){var Wr=new F.a;Wr.loadSource(er.src),Wr.attachMedia(er)}}})};Object(W.useEffect)(function(){if(qr.current&&yi&&(yi.match(Wt)&&window.PR.prettyPrint()),qr.current)return qr.current.addEventListener("click",di),function(){qr.current.removeEventListener("click",di),p(),S()}},[yi,qr.current,di]);var Nr=function(Qn){if(!ie)return;Qn.target.nodeName==="IMG"?(ur.current.style.zIndex=1,ur.current.style.display="flex",ur.current.style.width=Qn.target.clientWidth+"px",ur.current.style.height=Qn.target.clientHeight+"px",ur.current.style.top=Qn.target.offsetTop+"px",ur.current.style.left=Qn.target.offsetLeft+"px",dr.current.src=Qn.target.getAttribute("src")):ur.current.style.display="none"};return D.a.createElement("div",{style:{position:"relative"}},D.a.createElement("div",{ref:qr,style:Object(ae.a)({},mn),className:"".concat(J||""," markdown-body ").concat(Pt.a.mdBody),onMouseOver:Nr,dangerouslySetInnerHTML:{__html:yi}}),D.a.createElement("div",{ref:ur,className:Pt.a.button},D.a.createElement(ue.b,null,D.a.createElement(fe.a,{onClick:function(){return Zr()}},"\u88C1\u526A"),D.a.createElement(fe.a,{onClick:function(){return _i()}},"\u7F16\u8F91"))),D.a.createElement("img",{ref:dr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),D.a.createElement(Y.a,{close:!0,data:Cr,type:Cr!=null&&Cr.length?vi:"",style:Object(ae.a)({},lr),onClose:function(){return Wn("")}}))}},"9VGf":function(We,ce,M){"use strict";M.d(ce,"a",function(){return re});var q=M("T/Jt"),ue=M.n(q);function re(fe,ae){var z=Object(q.useRef)();Object(q.useEffect)(function(){z.current=fe}),Object(q.useEffect)(function(){function R(){z.current()}if(ae!==null){var B=setInterval(R,ae);return function(){return clearInterval(B)}}},[ae])}},AMnG:function(We,ce,M){"use strict";var q=M("8OG5"),ue=M("mgsT"),re=M("Hqw+"),fe=M("T/Jt"),ae=M.n(fe),z=M("nWbc"),R=M.n(z),B=M("Ot1p");ce.a=function(n){var W=n.id,D=n.activeDiscussIndex,N=n.onReplyDiscuss,d=Object(fe.useState)(""),m=Object(re.a)(d,2),s=m[0],g=m[1];function h(r){g(r)}function _(){if(!s){ue.b.info("\u56DE\u590D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A!");return}N(W,s),g("")}return ae.a.createElement("div",{key:W,className:"discuss-item-editor",style:{display:D===W?"block":"none",width:"100%"}},ae.a.createElement(B.a,{miniToolbar:!0,startInit:D===W,defaultValue:s,id:W,noStorage:!0,watch:!1,height:155,placeholder:"\u6211\u8981\u56DE\u590D",showResizeBar:!0,onChange:h}),ae.a.createElement("a",{onClick:_,className:"btn-send"},"\u53D1\u9001"))}},Bd2K:function(We,ce,M){(function(q){q(M("VrN/"),M("osHv"))})(function(q){q.defineOption("autoCloseTags",!1,function(n,W,D){if(D!=q.Init&&D&&n.removeKeyMap("autoCloseTags"),!W)return;var N={name:"autoCloseTags"};(typeof W!="object"||W.whenClosing!==!1)&&(N["'/'"]=function(d){return z(d)}),(typeof W!="object"||W.whenOpening!==!1)&&(N["'>'"]=function(d){return fe(d)}),n.addKeyMap(N)});var ue=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],re=["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 fe(n){if(n.getOption("disableInput"))return q.Pass;for(var W=n.listSelections(),D=[],N=n.getOption("autoCloseTags"),d=0;d<W.length;d++){if(!W[d].empty())return q.Pass;var m=W[d].head,s=n.getTokenAt(m),g=q.innerMode(n.getMode(),s.state),h=g.state,_=g.mode.xmlCurrentTag&&g.mode.xmlCurrentTag(h),r=_&&_.name;if(!r)return q.Pass;var v=g.mode.configuration=="html",S=typeof N=="object"&&N.dontCloseTags||v&&ue,w=typeof N=="object"&&N.indentTags||v&&re;s.end>m.ch&&(r=r.slice(0,r.length-s.end+m.ch));var I=r.toLowerCase();if(!r||s.type=="string"&&(s.end!=m.ch||!/[\"\']/.test(s.string.charAt(s.string.length-1))||s.string.length==1)||s.type=="tag"&&_.close||s.string.indexOf("/")==m.ch-s.start-1||S&&R(S,I)>-1||B(n,g.mode.xmlCurrentContext&&g.mode.xmlCurrentContext(h)||[],r,m,!0))return q.Pass;var E=typeof N=="object"&&N.emptyTags;if(E&&R(E,r)>-1){D[d]={text:"/>",newPos:q.Pos(m.line,m.ch+2)};continue}var x=w&&R(w,I)>-1;D[d]={indent:x,text:">"+(x?`
`:"")+"</"+r+">",newPos:x?q.Pos(m.line+1,0):q.Pos(m.line,m.ch+1)}}for(var P=typeof N=="object"&&N.dontIndentOnAutoClose,d=W.length-1;d>=0;d--){var T=D[d];n.replaceRange(T.text,W[d].head,W[d].anchor,"+insert");var A=n.listSelections().slice(0);A[d]={head:T.newPos,anchor:T.newPos},n.setSelections(A),!P&&T.indent&&(n.indentLine(T.newPos.line,null,!0),n.indentLine(T.newPos.line+1,null,!0))}}function ae(n,W){for(var D=n.listSelections(),N=[],d=W?"/":"</",m=n.getOption("autoCloseTags"),s=typeof m=="object"&&m.dontIndentOnSlash,g=0;g<D.length;g++){if(!D[g].empty())return q.Pass;var h=D[g].head,_=n.getTokenAt(h),r=q.innerMode(n.getMode(),_.state),v=r.state;if(W&&(_.type=="string"||_.string.charAt(0)!="<"||_.start!=h.ch-1))return q.Pass;var S,w=r.mode.name!="xml"&&n.getMode().name=="htmlmixed";if(w&&r.mode.name=="javascript")S=d+"script";else if(w&&r.mode.name=="css")S=d+"style";else{var I=r.mode.xmlCurrentContext&&r.mode.xmlCurrentContext(v);if(!I||I.length&&B(n,I,I[I.length-1],h))return q.Pass;S=d+I[I.length-1]}n.getLine(h.line).charAt(_.end)!=">"&&(S+=">"),N[g]=S}if(n.replaceSelections(N),D=n.listSelections(),!s)for(var g=0;g<D.length;g++)(g==D.length-1||D[g].head.line<D[g+1].head.line)&&n.indentLine(D[g].head.line)}function z(n){return n.getOption("disableInput")?q.Pass:ae(n,!0)}q.commands.closeTag=function(n){return ae(n)};function R(n,W){if(n.indexOf)return n.indexOf(W);for(var D=0,N=n.length;D<N;++D)if(n[D]==W)return D;return-1}function B(n,W,D,N,d){if(!q.scanForClosingTag)return!1;var m=Math.min(n.lastLine()+1,N.line+500),s=q.scanForClosingTag(n,N,null,m);if(!s||s.tag!=D)return!1;for(var g=d?1:0,h=W.length-1;h>=0&&W[h]==D;h--)++g;N=s.to;for(var h=1;h<g;h++){var _=q.scanForClosingTag(n,N,null,m);if(!_||_.tag!=D)return!1;N=_.to}return!0}})},BdwD:function(We,ce,M){"use strict";var q=M("dLI4"),ue=M("4d5L"),re=M("HPgX"),fe=M("YaWb"),ae=M("T/Jt"),z=M.n(ae),R=M("FOrL"),B=M.n(R),n=function(D){var N=D.buttonProps,d=N===void 0?{}:N,m=D.styles,s=m===void 0?{}:m,g=D.customText,h=D.ButtonText,_=D.ButtonClick,r=D.Buttonclass,v=D.ButtonTwo;return z.a.createElement("section",{className:"tc animated fadeIn",style:Object(fe.a)(Object(fe.a)({},{color:"#999",margin:"200px auto"}),s)},z.a.createElement("img",{src:B.a}),z.a.createElement("p",{className:"mt20 font14"},g||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),h&&z.a.createElement(ue.a,Object(re.a)({className:r,onClick:_},d),h),v&&v)};ce.a=n},BjJ7:function(We,ce,M){"use strict";M.d(ce,"d",function(){return ue}),M.d(ce,"c",function(){return re}),M.d(ce,"e",function(){return fe}),M.d(ce,"b",function(){return ae}),M.d(ce,"a",function(){return R});var q=M("m3rI");function ue(B){var n=!0;if(B.length>0){for(var W=0;W<B.length;W++)if(B[W].compile_success==0||!B[W].compile_success){n=!1;break}}else n=!1;return n}function re(B){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",W=[],D=0;D<B.length;D++){var N=B[D],d=n?"".concat(n,"/").concat(N.name):"".concat(N.name);W.push({title:N.name,isLeaf:!(N.type==="tree"),key:d})}return W}function fe(B,n,W){for(var D=0;D<B.length;D++){var N=B[D];if(N.key===n){N.children=W;break}N.children&&fe(N.children,n,W)}return B}function ae(B,n,W){var D;return function(){var N=this,d=arguments,m=function(){D=null,W||B.apply(N,d)},s=W&&!D;clearTimeout(D),D=setTimeout(m,n),s&&B.apply(N,d)}}var z=!0,R=q.a.API_SERVER},BsWD:function(We,ce,M){"use strict";M.d(ce,"a",function(){return ue});var q=M("a3WO");function ue(re,fe){if(!re)return;if(typeof re=="string")return Object(q.a)(re,fe);var ae=Object.prototype.toString.call(re).slice(8,-1);if(ae==="Object"&&re.constructor&&(ae=re.constructor.name),ae==="Map"||ae==="Set")return Array.from(re);if(ae==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ae))return Object(q.a)(re,fe)}},"C+DQ":function(We,ce,M){},"C/vA":function(We,ce,M){"use strict";M.d(ce,"a",function(){return q});function q(ue){const re=this;let fe=!1,ae;return function(){return fe||(fe=!0,ae=ue.apply(re,arguments)),ae}}},CNDd:function(We,ce,M){We.exports=M.p+"static/c1.517fc2f6.svg"},CaVn:function(We,ce,M){We.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(We,ce,M){"use strict";M.d(ce,"b",function(){return q}),M.d(ce,"a",function(){return ue}),M.d(ce,"c",function(){return fe}),M.d(ce,"d",function(){return ae});var q;(function(z){z.serviceIds=new Map,z.DI_TARGET="$di$target",z.DI_DEPENDENCIES="$di$dependencies";function R(B){return B[z.DI_DEPENDENCIES]||[]}z.getServiceDependencies=R})(q||(q={}));const ue=fe("instantiationService");function re(z,R,B,n){R[q.DI_TARGET]===R?R[q.DI_DEPENDENCIES].push({id:z,index:B,optional:n}):(R[q.DI_DEPENDENCIES]=[{id:z,index:B,optional:n}],R[q.DI_TARGET]=R)}function fe(z){if(q.serviceIds.has(z))return q.serviceIds.get(z);const R=function(B,n,W){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");re(R,B,W,!1)};return R.toString=()=>z,q.serviceIds.set(z,R),R}function ae(z){return function(R,B,n){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");re(z,R,n,!0)}}},CrYA:function(We,ce,M){var q=M("MFOe"),ue=q.Global;We.exports={name:"sessionStorage",read:fe,write:ae,each:z,remove:R,clearAll:B};function re(){return ue.sessionStorage}function fe(n){return re().getItem(n)}function ae(n,W){return re().setItem(n,W)}function z(n){for(var W=re().length-1;W>=0;W--){var D=re().key(W);n(fe(D),D)}}function R(n){return re().removeItem(n)}function B(){return re().clear()}},"DlR+":function(We,ce,M){var q=M("MFOe"),ue=q.Global,re=q.trim;We.exports={name:"cookieStorage",read:ae,write:R,each:z,remove:B,clearAll:n};var fe=ue.document;function ae(D){if(!D||!W(D))return null;var N="(?:^|.*;\\s*)"+escape(D).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(fe.cookie.replace(new RegExp(N),"$1"))}function z(D){for(var N=fe.cookie.split(/; ?/g),d=N.length-1;d>=0;d--){if(!re(N[d]))continue;var m=N[d].split("="),s=unescape(m[0]),g=unescape(m[1]);D(g,s)}}function R(D,N){if(!D)return;fe.cookie=escape(D)+"="+escape(N)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function B(D){if(!D||!W(D))return;fe.cookie=escape(D)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function n(){z(function(D,N){B(N)})}function W(D){return new RegExp("(?:^|;\\s*)"+escape(D).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(fe.cookie)}},Dpym:function(We,ce,M){"use strict";var q=M("T/Jt"),ue=M.n(q),re=q.createContext(null);ce.a=re},E2g8:function(We,ce,M){(function(q,ue){/*!
* @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(re,fe){We.exports=fe()})(this,function(){"use strict";function re(le){var ye=typeof le;return le!==null&&(ye==="object"||ye==="function")}function fe(le){return typeof le=="function"}var ae=void 0;Array.isArray?ae=Array.isArray:ae=function(le){return Object.prototype.toString.call(le)==="[object Array]"};var z=ae,R=0,B=void 0,n=void 0,W=function(ye,Te){I[R]=ye,I[R+1]=Te,R+=2,R===2&&(n?n(E):P())};function D(le){n=le}function N(le){W=le}var d=typeof window!="undefined"?window:void 0,m=d||{},s=m.MutationObserver||m.WebKitMutationObserver,g=typeof self=="undefined"&&typeof q!="undefined"&&{}.toString.call(q)==="[object process]",h=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function _(){return function(){return q.nextTick(E)}}function r(){return typeof B!="undefined"?function(){B(E)}:w()}function v(){var le=0,ye=new s(E),Te=document.createTextNode("");return ye.observe(Te,{characterData:!0}),function(){Te.data=le=++le%2}}function S(){var le=new MessageChannel;return le.port1.onmessage=E,function(){return le.port2.postMessage(0)}}function w(){var le=setTimeout;return function(){return le(E,1)}}var I=new Array(1e3);function E(){for(var le=0;le<R;le+=2){var ye=I[le],Te=I[le+1];ye(Te),I[le]=void 0,I[le+1]=void 0}R=0}function x(){try{var le=Function("return this")().require("vertx");return B=le.runOnLoop||le.runOnContext,r()}catch(ye){return w()}}var P=void 0;g?P=_():s?P=v():h?P=S():d===void 0&&!0?P=x():P=w();function T(le,ye){var Te=this,Pe=new this.constructor(C);Pe[b]===void 0&&Ne(Pe);var He=Te._state;if(He){var Ye=arguments[He-1];W(function(){return he(He,Pe,Ye,Te._result)})}else de(Te,Pe,le,ye);return Pe}function A(le){var ye=this;if(le&&typeof le=="object"&&le.constructor===ye)return le;var Te=new ye(C);return j(Te,le),Te}var b=Math.random().toString(36).substring(2);function C(){}var p=void 0,i=1,f=2;function o(){return new TypeError("You cannot resolve a promise with itself")}function a(){return new TypeError("A promises callback cannot return that same promise.")}function L(le,ye,Te,Pe){try{le.call(ye,Te,Pe)}catch(He){return He}}function y(le,ye,Te){W(function(Pe){var He=!1,Ye=L(Te,ye,function(ct){if(He)return;He=!0,ye!==ct?j(Pe,ct):Y(Pe,ct)},function(ct){if(He)return;He=!0,te(Pe,ct)},"Settle: "+(Pe._label||" unknown promise"));!He&&Ye&&(He=!0,te(Pe,Ye))},le)}function l(le,ye){ye._state===i?Y(le,ye._result):ye._state===f?te(le,ye._result):de(ye,void 0,function(Te){return j(le,Te)},function(Te){return te(le,Te)})}function F(le,ye,Te){ye.constructor===le.constructor&&Te===T&&ye.constructor.resolve===A?l(le,ye):Te===void 0?Y(le,ye):fe(Te)?y(le,ye,Te):Y(le,ye)}function j(le,ye){if(le===ye)te(le,o());else if(re(ye)){var Te=void 0;try{Te=ye.then}catch(Pe){te(le,Pe);return}F(le,ye,Te)}else Y(le,ye)}function G(le){le._onerror&&le._onerror(le._result),ve(le)}function Y(le,ye){if(le._state!==p)return;le._result=ye,le._state=i,le._subscribers.length!==0&&W(ve,le)}function te(le,ye){if(le._state!==p)return;le._state=f,le._result=ye,W(G,le)}function de(le,ye,Te,Pe){var He=le._subscribers,Ye=He.length;le._onerror=null,He[Ye]=ye,He[Ye+i]=Te,He[Ye+f]=Pe,Ye===0&&le._state&&W(ve,le)}function ve(le){var ye=le._subscribers,Te=le._state;if(ye.length===0)return;for(var Pe=void 0,He=void 0,Ye=le._result,ct=0;ct<ye.length;ct+=3)Pe=ye[ct],He=ye[ct+Te],Pe?he(Te,Pe,He,Ye):He(Ye);le._subscribers.length=0}function he(le,ye,Te,Pe){var He=fe(Te),Ye=void 0,ct=void 0,st=!0;if(He){try{Ye=Te(Pe)}catch(vt){st=!1,ct=vt}if(ye===Ye){te(ye,a());return}}else Ye=Pe;ye._state!==p||(He&&st?j(ye,Ye):st===!1?te(ye,ct):le===i?Y(ye,Ye):le===f&&te(ye,Ye))}function Re(le,ye){try{ye(function(Pe){j(le,Pe)},function(Pe){te(le,Pe)})}catch(Te){te(le,Te)}}var we=0;function ge(){return we++}function Ne(le){le[b]=we++,le._state=void 0,le._result=void 0,le._subscribers=[]}function ze(){return new Error("Array Methods must be provided an Array")}var nt=function(){function le(ye,Te){this._instanceConstructor=ye,this.promise=new ye(C),this.promise[b]||Ne(this.promise),z(Te)?(this.length=Te.length,this._remaining=Te.length,this._result=new Array(this.length),this.length===0?Y(this.promise,this._result):(this.length=this.length||0,this._enumerate(Te),this._remaining===0&&Y(this.promise,this._result))):te(this.promise,ze())}return le.prototype._enumerate=function(Te){for(var Pe=0;this._state===p&&Pe<Te.length;Pe++)this._eachEntry(Te[Pe],Pe)},le.prototype._eachEntry=function(Te,Pe){var He=this._instanceConstructor,Ye=He.resolve;if(Ye===A){var ct=void 0,st=void 0,vt=!1;try{ct=Te.then}catch(mt){vt=!0,st=mt}if(ct===T&&Te._state!==p)this._settledAt(Te._state,Pe,Te._result);else if(typeof ct!="function")this._remaining--,this._result[Pe]=Te;else if(He===be){var qe=new He(C);vt?te(qe,st):F(qe,Te,ct),this._willSettleAt(qe,Pe)}else this._willSettleAt(new He(function(mt){return mt(Te)}),Pe)}else this._willSettleAt(Ye(Te),Pe)},le.prototype._settledAt=function(Te,Pe,He){var Ye=this.promise;Ye._state===p&&(this._remaining--,Te===f?te(Ye,He):this._result[Pe]=He),this._remaining===0&&Y(Ye,this._result)},le.prototype._willSettleAt=function(Te,Pe){var He=this;de(Te,void 0,function(Ye){return He._settledAt(i,Pe,Ye)},function(Ye){return He._settledAt(f,Pe,Ye)})},le}();function Ge(le){return new nt(this,le).promise}function Xe(le){var ye=this;return z(le)?new ye(function(Te,Pe){for(var He=le.length,Ye=0;Ye<He;Ye++)ye.resolve(le[Ye]).then(Te,Pe)}):new ye(function(Te,Pe){return Pe(new TypeError("You must pass an array to race."))})}function Be(le){var ye=this,Te=new ye(C);return te(Te,le),Te}function _e(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function Ze(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var be=function(){function le(ye){this[b]=ge(),this._result=this._state=void 0,this._subscribers=[],C!==ye&&(typeof ye!="function"&&_e(),this instanceof le?Re(this,ye):Ze())}return le.prototype.catch=function(Te){return this.then(null,Te)},le.prototype.finally=function(Te){var Pe=this,He=Pe.constructor;return fe(Te)?Pe.then(function(Ye){return He.resolve(Te()).then(function(){return Ye})},function(Ye){return He.resolve(Te()).then(function(){throw Ye})}):Pe.then(Te,Te)},le}();be.prototype.then=T,be.all=Ge,be.race=Xe,be.resolve=A,be.reject=Be,be._setScheduler=D,be._setAsap=N,be._asap=W;function Le(){var le=void 0;if(typeof ue!="undefined")le=ue;else if(typeof self!="undefined")le=self;else try{le=Function("return this")()}catch(Pe){throw new Error("polyfill failed because global object is unavailable in this environment")}var ye=le.Promise;if(ye){var Te=null;try{Te=Object.prototype.toString.call(ye.resolve())}catch(Pe){}if(Te==="[object Promise]"&&!ye.cast)return}le.Promise=be}return be.polyfill=Le,be.Promise=be,be})}).call(this,M("B0ME"),M("IGO8"))},E9nw:function(We,ce){We.exports=function(){var M=document.getSelection();if(!M.rangeCount)return function(){};for(var q=document.activeElement,ue=[],re=0;re<M.rangeCount;re++)ue.push(M.getRangeAt(re));switch(q.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":q.blur();break;default:q=null;break}return M.removeAllRanges(),function(){M.type==="Caret"&&M.removeAllRanges(),M.rangeCount||ue.forEach(function(fe){M.addRange(fe)}),q&&q.focus()}}},EHPI:function(We,ce,M){"use strict";var q=M("GCqv"),ue=M("VHWp"),re=M("Hqw+"),fe=M("YaWb"),ae=M("T/Jt"),z=M.n(ae),R=M("ZW9T"),B=M("ZD9Y"),n=M("M8RZ"),W=M("bCnd"),D=M("fcyK"),N=M.n(D),d={theme:Object(W.a)("cmCodeMode","vs-dark"),fontSize:Object(W.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(W.a)("cmTabToSpace",!0)},m;(function(h){h[h.set_font_size=0]="set_font_size",h[h.set_theme=1]="set_theme",h[h.on_tab_to_space=2]="on_tab_to_space",h[h.set_show_editor_setting=3]="set_show_editor_setting"})(m||(m={}));function s(h,_){switch(_.type){case m.set_show_editor_setting:return Object(fe.a)(Object(fe.a)({},h),{},{showEditorSetting:_.payload});case m.set_theme:return Object(fe.a)(Object(fe.a)({},h),{},{theme:_.payload});case m.set_font_size:return Object(fe.a)(Object(fe.a)({},h),{},{fontSize:_.payload});case m.on_tab_to_space:return Object(fe.a)(Object(fe.a)({},h),{},{tabToSpace:_.payload});default:throw new Error}}ce.a=function(h){var _=h.isLoading,r=h.value,v=h.onChange,S=h.language,w=h.ActionBarRender,I=w===void 0?function(L){return z.a.createElement(g,{onShowCodeSetting:L})}:w,E=Object(ae.useReducer)(s,d),x=Object(re.a)(E,2),P=x[0],T=x[1],A=P.theme,b=P.fontSize,C=P.showEditorSetting,p=P.tabToSpace,i={onFontSizeChange:function(y){T({type:m.set_font_size,payload:y}),Object(W.b)("cmFontSize",y)},tabToSpace:p,cmFontSize:b,className:"oj",cmCodeMode:A,onTabToSpace:function(y){T({type:m.on_tab_to_space,payload:y}),Object(W.b)("cmTabToSpace",y)},onCodeModeChange:function(y){T({type:m.set_theme,payload:y}),Object(W.b)("cmCodeMode",y)}};function f(){T({type:m.set_show_editor_setting,payload:!1})}function o(){T({type:m.set_show_editor_setting,payload:!0})}var a={value:r,language:S,onChange:v,theme:A,height:"calc(100% - 56px)",options:{fontSize:b,insertSpaces:p}};return z.a.createElement(ae.Fragment,null,z.a.createElement("div",{className:"code-panel-container"},I(o),!_&&z.a.createElement(R.b,a)),z.a.createElement(n.a,null,z.a.createElement(ue.a,{className:"oj",title:null,placement:"right",closable:!1,visible:C,onClose:f},z.a.createElement(B.a,i))))};function g(h){var _=h.onShowCodeSetting;return z.a.createElement("div",{className:"action-bar"},z.a.createElement("span",null,"\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"),z.a.createElement("a",{onClick:_},z.a.createElement("i",{className:"iconfont icon-shezhi"})))}},ELLl:function(We,ce,M){(function(q){q(M("VrN/"))})(function(q){var ue={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},re=q.Pos;q.defineOption("autoCloseBrackets",!1,function(s,g,h){h&&h!=q.Init&&(s.removeKeyMap(ae),s.state.closeBrackets=null),g&&(z(fe(g,"pairs")),s.state.closeBrackets=g,s.addKeyMap(ae))});function fe(s,g){return g=="pairs"&&typeof s=="string"?s:typeof s=="object"&&s[g]!=null?s[g]:ue[g]}var ae={Backspace:n,Enter:W};function z(s){for(var g=0;g<s.length;g++){var h=s.charAt(g),_="'"+h+"'";ae[_]||(ae[_]=R(h))}}z(ue.pairs+"`");function R(s){return function(g){return N(g,s)}}function B(s){var g=s.state.closeBrackets;if(!g||g.override)return g;var h=s.getModeAt(s.getCursor());return h.closeBrackets||g}function n(s){var g=B(s);if(!g||s.getOption("disableInput"))return q.Pass;for(var h=fe(g,"pairs"),_=s.listSelections(),r=0;r<_.length;r++){if(!_[r].empty())return q.Pass;var v=d(s,_[r].head);if(!v||h.indexOf(v)%2!=0)return q.Pass}for(var r=_.length-1;r>=0;r--){var S=_[r].head;s.replaceRange("",re(S.line,S.ch-1),re(S.line,S.ch+1),"+delete")}}function W(s){var g=B(s),h=g&&fe(g,"explode");if(!h||s.getOption("disableInput"))return q.Pass;for(var _=s.listSelections(),r=0;r<_.length;r++){if(!_[r].empty())return q.Pass;var v=d(s,_[r].head);if(!v||h.indexOf(v)%2!=0)return q.Pass}s.operation(function(){var S=s.lineSeparator()||`
`;s.replaceSelection(S+S,null),s.execCommand("goCharLeft"),_=s.listSelections();for(var w=0;w<_.length;w++){var I=_[w].head.line;s.indentLine(I,null,!0),s.indentLine(I+1,null,!0)}})}function D(s){var g=q.cmpPos(s.anchor,s.head)>0;return{anchor:new re(s.anchor.line,s.anchor.ch+(g?-1:1)),head:new re(s.head.line,s.head.ch+(g?1:-1))}}function N(s,g){var h=B(s);if(!h||s.getOption("disableInput"))return q.Pass;var _=fe(h,"pairs"),r=_.indexOf(g);if(r==-1)return q.Pass;for(var v=fe(h,"closeBefore"),S=fe(h,"triples"),w=_.charAt(r+1)==g,I=s.listSelections(),E=r%2==0,x,P=0;P<I.length;P++){var T=I[P],A=T.head,b,C=s.getRange(A,re(A.line,A.ch+1));if(E&&!T.empty())b="surround";else if((w||!E)&&C==g)w&&m(s,A)?b="both":S.indexOf(g)>=0&&s.getRange(A,re(A.line,A.ch+3))==g+g+g?b="skipThree":b="skip";else if(w&&A.ch>1&&S.indexOf(g)>=0&&s.getRange(re(A.line,A.ch-2),A)==g+g){if(A.ch>2&&/\bstring/.test(s.getTokenTypeAt(re(A.line,A.ch-2))))return q.Pass;b="addFour"}else if(w){var p=A.ch==0?" ":s.getRange(re(A.line,A.ch-1),A);if(!q.isWordChar(C)&&p!=g&&!q.isWordChar(p))b="both";else return q.Pass}else if(E&&(C.length===0||/\s/.test(C)||v.indexOf(C)>-1))b="both";else return q.Pass;if(!x)x=b;else if(x!=b)return q.Pass}var i=r%2?_.charAt(r-1):g,f=r%2?g:_.charAt(r+1);s.operation(function(){if(x=="skip")s.execCommand("goCharRight");else if(x=="skipThree")for(var o=0;o<3;o++)s.execCommand("goCharRight");else if(x=="surround"){for(var a=s.getSelections(),o=0;o<a.length;o++)a[o]=i+a[o]+f;s.replaceSelections(a,"around"),a=s.listSelections().slice();for(var o=0;o<a.length;o++)a[o]=D(a[o]);s.setSelections(a)}else x=="both"?(s.replaceSelection(i+f,null),s.triggerElectric(i+f),s.execCommand("goCharLeft")):x=="addFour"&&(s.replaceSelection(i+i+i+i,"before"),s.execCommand("goCharRight"))})}function d(s,g){var h=s.getRange(re(g.line,g.ch-1),re(g.line,g.ch+1));return h.length==2?h:null}function m(s,g){var h=s.getTokenAt(re(g.line,g.ch+1));return/\bstring/.test(h.type)&&h.start==g.ch&&(g.ch==0||!/\bstring/.test(s.getTokenTypeAt(g)))}})},El5i:function(We,ce,M){"use strict";M.d(ce,"a",function(){return q});function q(ue,re){return ue[re]}},FER5:function(We,ce,M){"use strict";M.d(ce,"g",function(){return ue}),M.d(ce,"b",function(){return ae}),M.d(ce,"f",function(){return z}),M.d(ce,"c",function(){return R}),M.d(ce,"e",function(){return B}),M.d(ce,"a",function(){return N}),M.d(ce,"d",function(){return d});var q=M("b3aT");function ue(s,g,h){return{r:Object(q.a)(s,255)*255,g:Object(q.a)(g,255)*255,b:Object(q.a)(h,255)*255}}function re(s,g,h){s=Object(q.a)(s,255),g=Object(q.a)(g,255),h=Object(q.a)(h,255);var _=Math.max(s,g,h),r=Math.min(s,g,h),v=0,S=0,w=(_+r)/2;if(_===r)S=0,v=0;else{var I=_-r;S=w>.5?I/(2-_-r):I/(_+r);switch(_){case s:v=(g-h)/I+(g<h?6:0);break;case g:v=(h-s)/I+2;break;case h:v=(s-g)/I+4;break;default:break}v/=6}return{h:v,s:S,l:w}}function fe(s,g,h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6?s+(g-s)*(6*h):h<1/2?g:h<2/3?s+(g-s)*(2/3-h)*6:s}function ae(s,g,h){var _,r,v;if(s=Object(q.a)(s,360),g=Object(q.a)(g,100),h=Object(q.a)(h,100),g===0)r=h,v=h,_=h;else{var S=h<.5?h*(1+g):h+g-h*g,w=2*h-S;_=fe(w,S,s+1/3),r=fe(w,S,s),v=fe(w,S,s-1/3)}return{r:_*255,g:r*255,b:v*255}}function z(s,g,h){s=Object(q.a)(s,255),g=Object(q.a)(g,255),h=Object(q.a)(h,255);var _=Math.max(s,g,h),r=Math.min(s,g,h),v=0,S=_,w=_-r,I=_===0?0:w/_;if(_===r)v=0;else{switch(_){case s:v=(g-h)/w+(g<h?6:0);break;case g:v=(h-s)/w+2;break;case h:v=(s-g)/w+4;break;default:break}v/=6}return{h:v,s:I,v:S}}function R(s,g,h){s=Object(q.a)(s,360)*6,g=Object(q.a)(g,100),h=Object(q.a)(h,100);var _=Math.floor(s),r=s-_,v=h*(1-g),S=h*(1-r*g),w=h*(1-(1-r)*g),I=_%6,E=[h,S,v,v,w,h][I],x=[w,h,h,S,v,v][I],P=[v,v,w,h,h,S][I];return{r:E*255,g:x*255,b:P*255}}function B(s,g,h,_){var r=[Object(q.d)(Math.round(s).toString(16)),Object(q.d)(Math.round(g).toString(16)),Object(q.d)(Math.round(h).toString(16))];return _&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function n(s,g,h,_,r){var v=[Object(q.d)(Math.round(s).toString(16)),Object(q.d)(Math.round(g).toString(16)),Object(q.d)(Math.round(h).toString(16)),Object(q.d)(D(_))];return r&&v[0].startsWith(v[0].charAt(1))&&v[1].startsWith(v[1].charAt(1))&&v[2].startsWith(v[2].charAt(1))&&v[3].startsWith(v[3].charAt(1))?v[0].charAt(0)+v[1].charAt(0)+v[2].charAt(0)+v[3].charAt(0):v.join("")}function W(s,g,h,_){var r=[Object(q.d)(D(_)),Object(q.d)(Math.round(s).toString(16)),Object(q.d)(Math.round(g).toString(16)),Object(q.d)(Math.round(h).toString(16))];return r.join("")}function D(s){return Math.round(parseFloat(s)*255).toString(16)}function N(s){return d(s)/255}function d(s){return parseInt(s,16)}function m(s){return{r:s>>16,g:(s&65280)>>8,b:s&255}}},FOrL:function(We,ce,M){We.exports=M.p+"static/nodata.a6b3f948.png"},FWmy:function(We,ce,M){"use strict";M.d(ce,"a",function(){return q});function q(ue,re){if(!ue)throw new Error(re?`Assertion failed (${re})`:"Assertion Failed")}},Ff2n:function(We,ce,M){"use strict";M.d(ce,"a",function(){return ue});var q=M("zLVn");function ue(re,fe){if(re==null)return{};var ae=Object(q.a)(re,fe),z,R;if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(re);for(R=0;R<B.length;R++){if(z=B[R],fe.indexOf(z)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(re,z))continue;ae[z]=re[z]}}return ae}},GNbK:function(We,ce,M){"use strict";M.d(ce,"a",function(){return h});var q=M("3ptp"),ue=M("M6Bk"),re=M("T/Jt"),fe=M.n(re),ae=M("AFTV"),z=M("yuO0"),R=M("ZIz+"),B=M("r0bv"),n=function(x){Object(ue.a)(P,x);function P(){for(var A,b=arguments.length,C=new Array(b),p=0;p<b;p++)C[p]=arguments[p];return A=x.call.apply(x,[this].concat(C))||this,A.history=Object(ae.a)(A.props),A}var T=P.prototype;return T.render=function(){return fe.a.createElement(q.c,{history:this.history,children:this.props.children})},P}(fe.a.Component),W=function(x){Object(ue.a)(P,x);function P(){for(var A,b=arguments.length,C=new Array(b),p=0;p<b;p++)C[p]=arguments[p];return A=x.call.apply(x,[this].concat(C))||this,A.history=Object(ae.b)(A.props),A}var T=P.prototype;return T.render=function(){return fe.a.createElement(q.c,{history:this.history,children:this.props.children})},P}(fe.a.Component),D=function(P,T){return typeof P=="function"?P(T):P},N=function(P,T){return typeof P=="string"?Object(ae.c)(P,null,null,T):P},d=function(P){return P},m=fe.a.forwardRef;typeof m=="undefined"&&(m=d);function s(x){return!!(x.metaKey||x.altKey||x.ctrlKey||x.shiftKey)}var g=m(function(x,P){var T=x.innerRef,A=x.navigate,b=x.onClick,C=Object(R.a)(x,["innerRef","navigate","onClick"]),p=C.target,i=Object(z.a)({},C,{onClick:function(o){try{b&&b(o)}catch(a){throw o.preventDefault(),a}!o.defaultPrevented&&o.button===0&&(!p||p==="_self")&&!s(o)&&(o.preventDefault(),A())}});return d!==m?i.ref=P||T:i.ref=T,fe.a.createElement("a",i)}),h=m(function(x,P){var T=x.component,A=T===void 0?g:T,b=x.replace,C=x.to,p=x.innerRef,i=Object(R.a)(x,["component","replace","to","innerRef"]);return fe.a.createElement(q.e.Consumer,null,function(f){f||Object(B.a)(!1);var o=f.history,a=N(D(C,f.location),f.location),L=a?o.createHref(a):"",y=Object(z.a)({},i,{href:L,navigate:function(){var F=D(C,f.location),j=b?o.replace:o.push;j(F)}});return d!==m?y.ref=P||p:y.innerRef=p,fe.a.createElement(A,y)})});if(!1)var _,r;var v=function(P){return P},S=fe.a.forwardRef;typeof S=="undefined"&&(S=v);function w(){for(var x=arguments.length,P=new Array(x),T=0;T<x;T++)P[T]=arguments[T];return P.filter(function(A){return A}).join(" ")}var I=S(function(x,P){var T=x["aria-current"],A=T===void 0?"page":T,b=x.activeClassName,C=b===void 0?"active":b,p=x.activeStyle,i=x.className,f=x.exact,o=x.isActive,a=x.location,L=x.sensitive,y=x.strict,l=x.style,F=x.to,j=x.innerRef,G=Object(R.a)(x,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return fe.a.createElement(q.e.Consumer,null,function(Y){Y||Object(B.a)(!1);var te=a||Y.location,de=N(D(F,te),te),ve=de.pathname,he=ve&&ve.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),Re=he?Object(q.f)(te.pathname,{path:he,exact:f,sensitive:L,strict:y}):null,we=!!(o?o(Re,te):Re),ge=we?w(i,C):i,Ne=we?Object(z.a)({},l,{},p):l,ze=Object(z.a)({"aria-current":we&&A||null,className:ge,style:Ne,to:de},G);return v!==S?ze.ref=P||j:ze.innerRef=j,fe.a.createElement(h,ze)})});if(!1)var E},GUcZ:function(We,ce,M){"use strict";var q=M("gKMJ"),ue=M("d9ep"),re=function(){function Ee(){Object(q.a)(this,Ee)}return Object(ue.a)(Ee,null,[{key:"install",value:function(){Object.setPrototypeOf=Object.setPrototypeOf||function(H,V){return H.__proto__=V,H},Object.assign=Object.assign||function(H){if(H==null)throw new TypeError("Cannot convert undefined or null to object");for(var V=Object(H),$=1;$<arguments.length;$++){var ee=arguments[$];if(ee!=null)for(var xe in ee)ee.hasOwnProperty(xe)&&(V[xe]=ee[xe])}return V},typeof self.Promise!="function"&&M("E2g8").polyfill()}}]),Ee}();re.install();var fe=re,ae=M("Dyds"),z=M.n(ae),R=function(){function Ee(){Object(q.a)(this,Ee)}return Object(ue.a)(Ee,null,[{key:"e",value:function(H,V){(!H||Ee.FORCE_GLOBAL_TAG)&&(H=Ee.GLOBAL_TAG);var $="[".concat(H,"] > ").concat(V);if(Ee.ENABLE_CALLBACK&&Ee.emitter.emit("log","error",$),!Ee.ENABLE_ERROR)return;console.error?console.error($):console.warn?console.warn($):console.log($)}},{key:"i",value:function(H,V){(!H||Ee.FORCE_GLOBAL_TAG)&&(H=Ee.GLOBAL_TAG);var $="[".concat(H,"] > ").concat(V);if(Ee.ENABLE_CALLBACK&&Ee.emitter.emit("log","info",$),!Ee.ENABLE_INFO)return;console.info?console.info($):console.log($)}},{key:"w",value:function(H,V){(!H||Ee.FORCE_GLOBAL_TAG)&&(H=Ee.GLOBAL_TAG);var $="[".concat(H,"] > ").concat(V);if(Ee.ENABLE_CALLBACK&&Ee.emitter.emit("log","warn",$),!Ee.ENABLE_WARN)return;console.warn?console.warn($):console.log($)}},{key:"d",value:function(H,V){(!H||Ee.FORCE_GLOBAL_TAG)&&(H=Ee.GLOBAL_TAG);var $="[".concat(H,"] > ").concat(V);if(Ee.ENABLE_CALLBACK&&Ee.emitter.emit("log","debug",$),!Ee.ENABLE_DEBUG)return;console.debug?console.debug($):console.log($)}},{key:"v",value:function(H,V){(!H||Ee.FORCE_GLOBAL_TAG)&&(H=Ee.GLOBAL_TAG);var $="[".concat(H,"] > ").concat(V);if(Ee.ENABLE_CALLBACK&&Ee.emitter.emit("log","verbose",$),!Ee.ENABLE_VERBOSE)return;console.log($)}}]),Ee}();R.GLOBAL_TAG="flv.js",R.FORCE_GLOBAL_TAG=!1,R.ENABLE_ERROR=!0,R.ENABLE_INFO=!0,R.ENABLE_WARN=!0,R.ENABLE_DEBUG=!0,R.ENABLE_VERBOSE=!0,R.ENABLE_CALLBACK=!1,R.emitter=new z.a;var B=R,n=function(){function Ee(){Object(q.a)(this,Ee),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(ue.a)(Ee,[{key:"reset",value:function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}},{key:"addBytes",value:function(H){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=H,this._totalBytes+=H):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=H,this._totalBytes+=H):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=H,this._totalBytes+=H,this._lastCheckpoint=this._now())}},{key:"currentKBps",get:function(){this.addBytes(0);var H=(this._now()-this._lastCheckpoint)/1e3;return H==0&&(H=1),this._intervalBytes/H/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 H=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/H/1024}}]),Ee}(),W=n,D=M("BSjk"),N=M("FA6E"),d=function(){function Ee(se){Object(q.a)(this,Ee),this._message=se}return Object(ue.a)(Ee,[{key:"name",get:function(){return"RuntimeException"}},{key:"message",get:function(){return this._message}},{key:"toString",value:function(){return this.name+": "+this.message}}]),Ee}(),m=function(Ee){Object(D.a)(H,Ee);var se=Object(N.a)(H);function H(V){return Object(q.a)(this,H),se.call(this,V)}return Object(ue.a)(H,[{key:"name",get:function(){return"IllegalStateException"}}]),H}(d),s=function(Ee){Object(D.a)(H,Ee);var se=Object(N.a)(H);function H(V){return Object(q.a)(this,H),se.call(this,V)}return Object(ue.a)(H,[{key:"name",get:function(){return"InvalidArgumentException"}}]),H}(d),g=function(Ee){Object(D.a)(H,Ee);var se=Object(N.a)(H);function H(V){return Object(q.a)(this,H),se.call(this,V)}return Object(ue.a)(H,[{key:"name",get:function(){return"NotImplementedException"}}]),H}(d),h={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},_={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},r=function(){function Ee(se){Object(q.a)(this,Ee),this._type=se||"undefined",this._status=h.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return Object(ue.a)(Ee,[{key:"destroy",value:function(){this._status=h.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}},{key:"isWorking",value:function(){return this._status===h.kConnecting||this._status===h.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(H){this._onContentLengthKnown=H}},{key:"onURLRedirect",get:function(){return this._onURLRedirect},set:function(H){this._onURLRedirect=H}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(H){this._onDataArrival=H}},{key:"onError",get:function(){return this._onError},set:function(H){this._onError=H}},{key:"onComplete",get:function(){return this._onComplete},set:function(H){this._onComplete=H}},{key:"open",value:function(H,V){throw new g("Unimplemented abstract function!")}},{key:"abort",value:function(){throw new g("Unimplemented abstract function!")}}]),Ee}(),v=M("7soC");function S(Ee,se){for(;!Object.prototype.hasOwnProperty.call(Ee,se)&&!(Ee=Object(v.a)(Ee),Ee===null););return Ee}function w(Ee,se,H){return typeof Reflect!="undefined"&&Reflect.get?w=Reflect.get:w=function($,ee,xe){var Ue=S($,ee);if(!Ue)return;var $e=Object.getOwnPropertyDescriptor(Ue,ee);return $e.get?$e.get.call(xe):$e.value},w(Ee,se,H||Ee)}var I={};function E(){var Ee=self.navigator.userAgent.toLowerCase(),se=/(edge)\/([\w.]+)/.exec(Ee)||/(opr)[\/]([\w.]+)/.exec(Ee)||/(chrome)[ \/]([\w.]+)/.exec(Ee)||/(iemobile)[\/]([\w.]+)/.exec(Ee)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(Ee)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(Ee)||/(webkit)[ \/]([\w.]+)/.exec(Ee)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(Ee)||/(msie) ([\w.]+)/.exec(Ee)||Ee.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(Ee)||Ee.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(Ee)||[],H=/(ipad)/.exec(Ee)||/(ipod)/.exec(Ee)||/(windows phone)/.exec(Ee)||/(iphone)/.exec(Ee)||/(kindle)/.exec(Ee)||/(android)/.exec(Ee)||/(windows)/.exec(Ee)||/(mac)/.exec(Ee)||/(linux)/.exec(Ee)||/(cros)/.exec(Ee)||[],V={browser:se[5]||se[3]||se[1]||"",version:se[2]||se[4]||"0",majorVersion:se[4]||se[2]||"0",platform:H[0]||""},$={};if(V.browser){$[V.browser]=!0;var ee=V.majorVersion.split(".");$.version={major:parseInt(V.majorVersion,10),string:V.version},ee.length>1&&($.version.minor=parseInt(ee[1],10)),ee.length>2&&($.version.build=parseInt(ee[2],10))}if(V.platform&&($[V.platform]=!0),($.chrome||$.opr||$.safari)&&($.webkit=!0),$.rv||$.iemobile){$.rv&&delete $.rv;var xe="msie";V.browser=xe,$[xe]=!0}if($.edge){delete $.edge;var Ue="msedge";V.browser=Ue,$[Ue]=!0}if($.opr){var $e="opera";V.browser=$e,$[$e]=!0}if($.safari&&$.android){var pt="android";V.browser=pt,$[pt]=!0}$.name=V.browser,$.platform=V.platform;for(var xt in I)I.hasOwnProperty(xt)&&delete I[xt];Object.assign(I,$)}E();var x=I,P=function(Ee){Object(D.a)(H,Ee);var se=Object(N.a)(H);function H(V,$){var ee;return Object(q.a)(this,H),ee=se.call(this,"fetch-stream-loader"),ee.TAG="FetchStreamLoader",ee._seekHandler=V,ee._config=$,ee._needStash=!0,ee._requestAbort=!1,ee._contentLength=null,ee._receivedLength=0,ee}return Object(ue.a)(H,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),w(Object(v.a)(H.prototype),"destroy",this).call(this)}},{key:"open",value:function($,ee){var xe=this;this._dataSource=$,this._range=ee;var Ue=$.url;this._config.reuseRedirectedURL&&$.redirectedURL!=null&&(Ue=$.redirectedURL);var $e=this._seekHandler.getConfig(Ue,ee),pt=new self.Headers;if(typeof $e.headers=="object"){var xt=$e.headers;for(var Ve in xt)xt.hasOwnProperty(Ve)&&pt.append(Ve,xt[Ve])}var ht={method:"GET",headers:pt,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var Rt in this._config.headers)pt.append(Rt,this._config.headers[Rt]);$.cors===!1&&(ht.mode="same-origin"),$.withCredentials&&(ht.credentials="include"),$.referrerPolicy&&(ht.referrerPolicy=$.referrerPolicy),this._status=h.kConnecting,self.fetch($e.url,ht).then(function(lt){if(xe._requestAbort){xe._requestAbort=!1,xe._status=h.kIdle;return}if(lt.ok&&lt.status>=200&&lt.status<=299){if(lt.url!==$e.url&&xe._onURLRedirect){var Pt=xe._seekHandler.removeURLParameters(lt.url);xe._onURLRedirect(Pt)}var Wt=lt.headers.get("Content-Length");return Wt!=null&&(xe._contentLength=parseInt(Wt),xe._contentLength!==0&&(xe._onContentLengthKnown&&xe._onContentLengthKnown(xe._contentLength))),xe._pump.call(xe,lt.body.getReader())}else if(xe._status=h.kError,xe._onError)xe._onError(_.HTTP_STATUS_CODE_INVALID,{code:lt.status,msg:lt.statusText});else throw new d("FetchStreamLoader: Http code invalid, "+lt.status+" "+lt.statusText)}).catch(function(lt){if(xe._status=h.kError,xe._onError)xe._onError(_.EXCEPTION,{code:-1,msg:lt.message});else throw lt})}},{key:"abort",value:function(){this._requestAbort=!0}},{key:"_pump",value:function($){var ee=this;return $.read().then(function(xe){if(xe.done)if(ee._contentLength!==null&&ee._receivedLength<ee._contentLength){ee._status=h.kError;var Ue=_.EARLY_EOF,$e={code:-1,msg:"Fetch stream meet Early-EOF"};if(ee._onError)ee._onError(Ue,$e);else throw new d($e.msg)}else ee._status=h.kComplete,ee._onComplete&&ee._onComplete(ee._range.from,ee._range.from+ee._receivedLength-1);else{if(ee._requestAbort===!0)return ee._requestAbort=!1,ee._status=h.kComplete,$.cancel();ee._status=h.kBuffering;var pt=xe.value.buffer,xt=ee._range.from+ee._receivedLength;ee._receivedLength+=pt.byteLength,ee._onDataArrival&&ee._onDataArrival(pt,xt,ee._receivedLength),ee._pump($)}}).catch(function(xe){if(xe.code===11&&x.msedge)return;ee._status=h.kError;var Ue=0,$e=null;if((xe.code===19||xe.message==="network error")&&(ee._contentLength===null||ee._contentLength!==null&&ee._receivedLength<ee._contentLength)?(Ue=_.EARLY_EOF,$e={code:xe.code,msg:"Fetch stream meet Early-EOF"}):(Ue=_.EXCEPTION,$e={code:xe.code,msg:xe.message}),ee._onError)ee._onError(Ue,$e);else throw new d($e.msg)})}}],[{key:"isSupported",value:function(){try{var $=x.msedge&&x.version.minor>=15048,ee=x.msedge?$:!0;return self.fetch&&self.ReadableStream&&ee}catch(xe){return!1}}}]),H}(r),T=P,A=function(Ee){Object(D.a)(H,Ee);var se=Object(N.a)(H);function H(V,$){var ee;return Object(q.a)(this,H),ee=se.call(this,"xhr-moz-chunked-loader"),ee.TAG="MozChunkedLoader",ee._seekHandler=V,ee._config=$,ee._needStash=!0,ee._xhr=null,ee._requestAbort=!1,ee._contentLength=null,ee._receivedLength=0,ee}return Object(ue.a)(H,[{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),w(Object(v.a)(H.prototype),"destroy",this).call(this)}},{key:"open",value:function($,ee){this._dataSource=$,this._range=ee;var xe=$.url;this._config.reuseRedirectedURL&&$.redirectedURL!=null&&(xe=$.redirectedURL);var Ue=this._seekHandler.getConfig(xe,ee);this._requestURL=Ue.url;var $e=this._xhr=new XMLHttpRequest;if($e.open("GET",Ue.url,!0),$e.responseType="moz-chunked-arraybuffer",$e.onreadystatechange=this._onReadyStateChange.bind(this),$e.onprogress=this._onProgress.bind(this),$e.onloadend=this._onLoadEnd.bind(this),$e.onerror=this._onXhrError.bind(this),$.withCredentials&&($e.withCredentials=!0),typeof Ue.headers=="object"){var pt=Ue.headers;for(var xt in pt)pt.hasOwnProperty(xt)&&$e.setRequestHeader(xt,pt[xt])}if(typeof this._config.headers=="object"){var Ve=this._config.headers;for(var ht in Ve)Ve.hasOwnProperty(ht)&&$e.setRequestHeader(ht,Ve[ht])}this._status=h.kConnecting,$e.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=h.kComplete}},{key:"_onReadyStateChange",value:function($){var ee=$.target;if(ee.readyState===2){if(ee.responseURL!=null&&ee.responseURL!==this._requestURL&&this._onURLRedirect){var xe=this._seekHandler.removeURLParameters(ee.responseURL);this._onURLRedirect(xe)}if(ee.status!==0&&(ee.status<200||ee.status>299))if(this._status=h.kError,this._onError)this._onError(_.HTTP_STATUS_CODE_INVALID,{code:ee.status,msg:ee.statusText});else throw new d("MozChunkedLoader: Http code invalid, "+ee.status+" "+ee.statusText);else this._status=h.kBuffering}}},{key:"_onProgress",value:function($){if(this._status===h.kError)return;this._contentLength===null&&($.total!==null&&$.total!==0&&(this._contentLength=$.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)));var ee=$.target.response,xe=this._range.from+this._receivedLength;this._receivedLength+=ee.byteLength,this._onDataArrival&&this._onDataArrival(ee,xe,this._receivedLength)}},{key:"_onLoadEnd",value:function($){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===h.kError)return;this._status=h.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}},{key:"_onXhrError",value:function($){this._status=h.kError;var ee=0,xe=null;if(this._contentLength&&$.loaded<this._contentLength?(ee=_.EARLY_EOF,xe={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(ee=_.EXCEPTION,xe={code:-1,msg:$.constructor.name+" "+$.type}),this._onError)this._onError(ee,xe);else throw new d(xe.msg)}}],[{key:"isSupported",value:function(){try{var $=new XMLHttpRequest;return $.open("GET","https://example.com",!0),$.responseType="moz-chunked-arraybuffer",$.responseType==="moz-chunked-arraybuffer"}catch(ee){return B.w("MozChunkedLoader",ee.message),!1}}}]),H}(r),b=A,C=function(Ee){Object(D.a)(H,Ee);var se=Object(N.a)(H);function H(V,$){var ee;return Object(q.a)(this,H),ee=se.call(this,"xhr-msstream-loader"),ee.TAG="MSStreamLoader",ee._seekHandler=V,ee._config=$,ee._needStash=!0,ee._xhr=null,ee._reader=null,ee._totalRange=null,ee._currentRange=null,ee._currentRequestURL=null,ee._currentRedirectedURL=null,ee._contentLength=null,ee._receivedLength=0,ee._bufferLimit=16*1024*1024,ee._lastTimeBufferSize=0,ee._isReconnecting=!1,ee}return Object(ue.a)(H,[{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),w(Object(v.a)(H.prototype),"destroy",this).call(this)}},{key:"open",value:function($,ee){this._internalOpen($,ee,!1)}},{key:"_internalOpen",value:function($,ee,xe){this._dataSource=$,xe?this._currentRange=ee:this._totalRange=ee;var Ue=$.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?Ue=this._currentRedirectedURL:$.redirectedURL!=null&&(Ue=$.redirectedURL));var $e=this._seekHandler.getConfig(Ue,ee);this._currentRequestURL=$e.url;var pt=this._reader=new self.MSStreamReader;pt.onprogress=this._msrOnProgress.bind(this),pt.onload=this._msrOnLoad.bind(this),pt.onerror=this._msrOnError.bind(this);var xt=this._xhr=new XMLHttpRequest;if(xt.open("GET",$e.url,!0),xt.responseType="ms-stream",xt.onreadystatechange=this._xhrOnReadyStateChange.bind(this),xt.onerror=this._xhrOnError.bind(this),$.withCredentials&&(xt.withCredentials=!0),typeof $e.headers=="object"){var Ve=$e.headers;for(var ht in Ve)Ve.hasOwnProperty(ht)&&xt.setRequestHeader(ht,Ve[ht])}if(typeof this._config.headers=="object"){var Rt=this._config.headers;for(var lt in Rt)Rt.hasOwnProperty(lt)&&xt.setRequestHeader(lt,Rt[lt])}this._isReconnecting?this._isReconnecting=!1:this._status=h.kConnecting,xt.send()}},{key:"abort",value:function(){this._internalAbort(),this._status=h.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($){var ee=$.target;if(ee.readyState===2)if(ee.status>=200&&ee.status<=299){if(this._status=h.kBuffering,ee.responseURL!=null){var xe=this._seekHandler.removeURLParameters(ee.responseURL);ee.responseURL!==this._currentRequestURL&&xe!==this._currentRedirectedURL&&(this._currentRedirectedURL=xe,this._onURLRedirect&&this._onURLRedirect(xe))}var Ue=ee.getResponseHeader("Content-Length");if(Ue!=null&&this._contentLength==null){var $e=parseInt(Ue);$e>0&&(this._contentLength=$e,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=h.kError,this._onError)this._onError(_.HTTP_STATUS_CODE_INVALID,{code:ee.status,msg:ee.statusText});else throw new d("MSStreamLoader: Http code invalid, "+ee.status+" "+ee.statusText);else if(ee.readyState===3&&(ee.status>=200&&ee.status<=299)){this._status=h.kBuffering;var pt=ee.response;this._reader.readAsArrayBuffer(pt)}}},{key:"_xhrOnError",value:function($){this._status=h.kError;var ee=_.EXCEPTION,xe={code:-1,msg:$.constructor.name+" "+$.type};if(this._onError)this._onError(ee,xe);else throw new d(xe.msg)}},{key:"_msrOnProgress",value:function($){var ee=$.target,xe=ee.result;if(xe==null){this._doReconnectIfNeeded();return}var Ue=xe.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=xe.byteLength;var $e=this._totalRange.from+this._receivedLength;this._receivedLength+=Ue.byteLength,this._onDataArrival&&this._onDataArrival(Ue,$e,this._receivedLength),xe.byteLength>=this._bufferLimit&&(B.v(this.TAG,"MSStream buffer exceeded max size near ".concat($e+Ue.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 $={from:this._totalRange.from+this._receivedLength,to:-1};this._internalOpen(this._dataSource,$,!0)}}},{key:"_msrOnLoad",value:function($){this._status=h.kComplete,this._onComplete&&this._onComplete(this._totalRange.from,this._totalRange.from+this._receivedLength-1)}},{key:"_msrOnError",value:function($){this._status=h.kError;var ee=0,xe=null;if(this._contentLength&&this._receivedLength<this._contentLength?(ee=_.EARLY_EOF,xe={code:-1,msg:"MSStream meet Early-Eof"}):(ee=_.EARLY_EOF,xe={code:-1,msg:$.constructor.name+" "+$.type}),this._onError)this._onError(ee,xe);else throw new d(xe.msg)}}],[{key:"isSupported",value:function(){try{if(typeof self.MSStream=="undefined"||typeof self.MSStreamReader=="undefined")return!1;var $=new XMLHttpRequest;return $.open("GET","https://example.com",!0),$.responseType="ms-stream",$.responseType==="ms-stream"}catch(ee){return B.w("MSStreamLoader",ee.message),!1}}}]),H}(r),p=C,i=function(Ee){Object(D.a)(H,Ee);var se=Object(N.a)(H);function H(V,$){var ee;return Object(q.a)(this,H),ee=se.call(this,"xhr-range-loader"),ee.TAG="RangeLoader",ee._seekHandler=V,ee._config=$,ee._needStash=!1,ee._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],ee._currentChunkSizeKB=384,ee._currentSpeedNormalized=0,ee._zeroSpeedChunkCount=0,ee._xhr=null,ee._speedSampler=new W,ee._requestAbort=!1,ee._waitForTotalLength=!1,ee._totalLengthReceived=!1,ee._currentRequestURL=null,ee._currentRedirectedURL=null,ee._currentRequestRange=null,ee._totalLength=null,ee._contentLength=null,ee._receivedLength=0,ee._lastTimeLoaded=0,ee}return Object(ue.a)(H,[{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),w(Object(v.a)(H.prototype),"destroy",this).call(this)}},{key:"currentSpeed",get:function(){return this._speedSampler.lastSecondKBps}},{key:"open",value:function($,ee){this._dataSource=$,this._range=ee,this._status=h.kConnecting;var xe=!1;this._dataSource.filesize!=null&&this._dataSource.filesize!==0&&(xe=!0,this._totalLength=this._dataSource.filesize),!this._totalLengthReceived&&!xe?(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1})):this._openSubRange()}},{key:"_openSubRange",value:function(){var $=this._currentChunkSizeKB*1024,ee=this._range.from+this._receivedLength,xe=ee+$;this._contentLength!=null&&(xe-this._range.from>=this._contentLength&&(xe=this._range.from+this._contentLength-1)),this._currentRequestRange={from:ee,to:xe},this._internalOpen(this._dataSource,this._currentRequestRange)}},{key:"_internalOpen",value:function($,ee){this._lastTimeLoaded=0;var xe=$.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?xe=this._currentRedirectedURL:$.redirectedURL!=null&&(xe=$.redirectedURL));var Ue=this._seekHandler.getConfig(xe,ee);this._currentRequestURL=Ue.url;var $e=this._xhr=new XMLHttpRequest;if($e.open("GET",Ue.url,!0),$e.responseType="arraybuffer",$e.onreadystatechange=this._onReadyStateChange.bind(this),$e.onprogress=this._onProgress.bind(this),$e.onload=this._onLoad.bind(this),$e.onerror=this._onXhrError.bind(this),$.withCredentials&&($e.withCredentials=!0),typeof Ue.headers=="object"){var pt=Ue.headers;for(var xt in pt)pt.hasOwnProperty(xt)&&$e.setRequestHeader(xt,pt[xt])}if(typeof this._config.headers=="object"){var Ve=this._config.headers;for(var ht in Ve)Ve.hasOwnProperty(ht)&&$e.setRequestHeader(ht,Ve[ht])}$e.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._internalAbort(),this._status=h.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($){var ee=$.target;if(ee.readyState===2){if(ee.responseURL!=null){var xe=this._seekHandler.removeURLParameters(ee.responseURL);ee.responseURL!==this._currentRequestURL&&xe!==this._currentRedirectedURL&&(this._currentRedirectedURL=xe,this._onURLRedirect&&this._onURLRedirect(xe))}if(ee.status>=200&&ee.status<=299){if(this._waitForTotalLength)return;this._status=h.kBuffering}else if(this._status=h.kError,this._onError)this._onError(_.HTTP_STATUS_CODE_INVALID,{code:ee.status,msg:ee.statusText});else throw new d("RangeLoader: Http code invalid, "+ee.status+" "+ee.statusText)}}},{key:"_onProgress",value:function($){if(this._status===h.kError)return;if(this._contentLength===null){var ee=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,ee=!0;var xe=$.total;this._internalAbort(),xe!=null&xe!==0&&(this._totalLength=xe)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,ee){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var Ue=$.loaded-this._lastTimeLoaded;this._lastTimeLoaded=$.loaded,this._speedSampler.addBytes(Ue)}},{key:"_normalizeSpeed",value:function($){var ee=this._chunkSizeKBList,xe=ee.length-1,Ue=0,$e=0,pt=xe;if($<ee[0])return ee[0];for(;$e<=pt;){if(Ue=$e+Math.floor((pt-$e)/2),Ue===xe||$>=ee[Ue]&&$<ee[Ue+1])return ee[Ue];ee[Ue]<$?$e=Ue+1:pt=Ue-1}}},{key:"_onLoad",value:function($){if(this._status===h.kError)return;if(this._waitForTotalLength){this._waitForTotalLength=!1;return}this._lastTimeLoaded=0;var ee=this._speedSampler.lastSecondKBps;if(ee===0&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(ee=this._speedSampler.currentKBps)),ee!==0){var xe=this._normalizeSpeed(ee);this._currentSpeedNormalized!==xe&&(this._currentSpeedNormalized=xe,this._currentChunkSizeKB=xe)}var Ue=$.target.response,$e=this._range.from+this._receivedLength;this._receivedLength+=Ue.byteLength;var pt=!1;this._contentLength!=null&&this._receivedLength<this._contentLength?this._openSubRange():pt=!0,this._onDataArrival&&this._onDataArrival(Ue,$e,this._receivedLength),pt&&(this._status=h.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}},{key:"_onXhrError",value:function($){this._status=h.kError;var ee=0,xe=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(ee=_.EARLY_EOF,xe={code:-1,msg:"RangeLoader meet Early-Eof"}):(ee=_.EXCEPTION,xe={code:-1,msg:$.constructor.name+" "+$.type}),this._onError)this._onError(ee,xe);else throw new d(xe.msg)}}],[{key:"isSupported",value:function(){try{var $=new XMLHttpRequest;return $.open("GET","https://example.com",!0),$.responseType="arraybuffer",$.responseType==="arraybuffer"}catch(ee){return B.w("RangeLoader",ee.message),!1}}}]),H}(r),f=i,o=function(Ee){Object(D.a)(H,Ee);var se=Object(N.a)(H);function H(){var V;return Object(q.a)(this,H),V=se.call(this,"websocket-loader"),V.TAG="WebSocketLoader",V._needStash=!0,V._ws=null,V._requestAbort=!1,V._receivedLength=0,V}return Object(ue.a)(H,[{key:"destroy",value:function(){this._ws&&this.abort(),w(Object(v.a)(H.prototype),"destroy",this).call(this)}},{key:"open",value:function($){try{var ee=this._ws=new self.WebSocket($.url);ee.binaryType="arraybuffer",ee.onopen=this._onWebSocketOpen.bind(this),ee.onclose=this._onWebSocketClose.bind(this),ee.onmessage=this._onWebSocketMessage.bind(this),ee.onerror=this._onWebSocketError.bind(this),this._status=h.kConnecting}catch(Ue){this._status=h.kError;var xe={code:Ue.code,msg:Ue.message};if(this._onError)this._onError(_.EXCEPTION,xe);else throw new d(xe.msg)}}},{key:"abort",value:function(){var $=this._ws;$&&($.readyState===0||$.readyState===1)&&(this._requestAbort=!0,$.close()),this._ws=null,this._status=h.kComplete}},{key:"_onWebSocketOpen",value:function($){this._status=h.kBuffering}},{key:"_onWebSocketClose",value:function($){if(this._requestAbort===!0){this._requestAbort=!1;return}this._status=h.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)}},{key:"_onWebSocketMessage",value:function($){var ee=this;if($.data instanceof ArrayBuffer)this._dispatchArrayBuffer($.data);else if($.data instanceof Blob){var xe=new FileReader;xe.onload=function(){ee._dispatchArrayBuffer(xe.result)},xe.readAsArrayBuffer($.data)}else{this._status=h.kError;var Ue={code:-1,msg:"Unsupported WebSocket message type: "+$.data.constructor.name};if(this._onError)this._onError(_.EXCEPTION,Ue);else throw new d(Ue.msg)}}},{key:"_dispatchArrayBuffer",value:function($){var ee=$,xe=this._receivedLength;this._receivedLength+=ee.byteLength,this._onDataArrival&&this._onDataArrival(ee,xe,this._receivedLength)}},{key:"_onWebSocketError",value:function($){this._status=h.kError;var ee={code:$.code,msg:$.message};if(this._onError)this._onError(_.EXCEPTION,ee);else throw new d(ee.msg)}}],[{key:"isSupported",value:function(){try{return typeof self.WebSocket!="undefined"}catch($){return!1}}}]),H}(r),a=o,L=function(){function Ee(se){Object(q.a)(this,Ee),this._zeroStart=se||!1}return Object(ue.a)(Ee,[{key:"getConfig",value:function(H,V){var $={};if(V.from!==0||V.to!==-1){var ee;V.to!==-1?ee="bytes=".concat(V.from.toString(),"-").concat(V.to.toString()):ee="bytes=".concat(V.from.toString(),"-"),$.Range=ee}else this._zeroStart&&($.Range="bytes=0-");return{url:H,headers:$}}},{key:"removeURLParameters",value:function(H){return H}}]),Ee}(),y=L,l=function(){function Ee(se,H){Object(q.a)(this,Ee),this._startName=se,this._endName=H}return Object(ue.a)(Ee,[{key:"getConfig",value:function(H,V){var $=H;if(V.from!==0||V.to!==-1){var ee=!0;$.indexOf("?")===-1&&($+="?",ee=!1),ee&&($+="&"),$+="".concat(this._startName,"=").concat(V.from.toString()),V.to!==-1&&($+="&".concat(this._endName,"=").concat(V.to.toString()))}return{url:$,headers:{}}}},{key:"removeURLParameters",value:function(H){var V=H.split("?")[0],$=void 0,ee=H.indexOf("?");ee!==-1&&($=H.substring(ee+1));var xe="";if($!=null&&$.length>0)for(var Ue=$.split("&"),$e=0;$e<Ue.length;$e++){var pt=Ue[$e].split("="),xt=$e>0;pt[0]!==this._startName&&pt[0]!==this._endName&&(xt&&(xe+="&"),xe+=Ue[$e])}return xe.length===0?V:V+"?"+xe}}]),Ee}(),F=l,j=function(){function Ee(se,H,V){Object(q.a)(this,Ee),this.TAG="IOController",this._config=H,this._extraData=V,this._stashInitialSize=1024*384,H.stashInitialSize!=null&&H.stashInitialSize>0&&(this._stashInitialSize=H.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,H.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 W,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(ue.a)(Ee,[{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(H){this._extraData=H}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(H){this._onDataArrival=H}},{key:"onSeeked",get:function(){return this._onSeeked},set:function(H){this._onSeeked=H}},{key:"onError",get:function(){return this._onError},set:function(H){this._onError=H}},{key:"onComplete",get:function(){return this._onComplete},set:function(H){this._onComplete=H}},{key:"onRedirect",get:function(){return this._onRedirect},set:function(H){this._onRedirect=H}},{key:"onRecoveredEarlyEof",get:function(){return this._onRecoveredEarlyEof},set:function(H){this._onRecoveredEarlyEof=H}},{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===f?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}},{key:"loaderType",get:function(){return this._loader.type}},{key:"_selectSeekHandler",value:function(){var H=this._config;if(H.seekType==="range")this._seekHandler=new y(this._config.rangeLoadZeroStart);else if(H.seekType==="param"){var V=H.seekParamStart||"bstart",$=H.seekParamEnd||"bend";this._seekHandler=new F(V,$)}else if(H.seekType==="custom"){if(typeof H.customSeekHandler!="function")throw new s("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new H.customSeekHandler}else throw new s("Invalid seekType in config: ".concat(H.seekType))}},{key:"_selectLoader",value:function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=a;else if(T.isSupported())this._loaderClass=T;else if(b.isSupported())this._loaderClass=b;else if(f.isSupported())this._loaderClass=f;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(H){this._currentRange={from:0,to:-1},H&&(this._currentRange.from=H),this._speedSampler.reset(),H||(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 H=this._resumeFrom;this._resumeFrom=0,this._internalSeek(H,!0)}}},{key:"seek",value:function(H){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(H,!0)}},{key:"_internalSeek",value:function(H,V){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(V),this._loader.destroy(),this._loader=null;var $={from:H,to:-1};this._currentRange={from:$.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,$),this._onSeeked&&this._onSeeked()}},{key:"updateUrl",value:function(H){if(!H||typeof H!="string"||H.length===0)throw new s("Url must be a non-empty string!");this._dataSource.url=H}},{key:"_expandBuffer",value:function(H){for(var V=this._stashSize;V+1024*1024*1<H;)V*=2;if(V+=1024*1024*1,V===this._bufferSize)return;var $=new ArrayBuffer(V);if(this._stashUsed>0){var ee=new Uint8Array(this._stashBuffer,0,this._stashUsed),xe=new Uint8Array($,0,V);xe.set(ee,0)}this._stashBuffer=$,this._bufferSize=V}},{key:"_normalizeSpeed",value:function(H){var V=this._speedNormalizeList,$=V.length-1,ee=0,xe=0,Ue=$;if(H<V[0])return V[0];for(;xe<=Ue;){if(ee=xe+Math.floor((Ue-xe)/2),ee===$||H>=V[ee]&&H<V[ee+1])return V[ee];V[ee]<H?xe=ee+1:Ue=ee-1}}},{key:"_adjustStashSize",value:function(H){var V=0;this._config.isLive||H<512?V=H:H>=512&&H<=1024?V=Math.floor(H*1.5):V=H*2,V>8192&&(V=8192);var $=V*1024+1024*1024*1;this._bufferSize<$&&this._expandBuffer($),this._stashSize=V*1024}},{key:"_dispatchChunks",value:function(H,V){return this._currentRange.to=V+H.byteLength-1,this._onDataArrival(H,V)}},{key:"_onURLRedirect",value:function(H){this._redirectedURL=H,this._onRedirect&&this._onRedirect(H)}},{key:"_onContentLengthKnown",value:function(H){H&&this._fullRequestFlag&&(this._totalLength=H,this._fullRequestFlag=!1)}},{key:"_onLoaderChunkArrival",value:function(H,V,$){if(!this._onDataArrival)throw new m("IOController: No existing consumer (onDataArrival) callback!");if(this._paused)return;this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(H.byteLength);var ee=this._speedSampler.lastSecondKBps;if(ee!==0){var xe=this._normalizeSpeed(ee);this._speedNormalized!==xe&&(this._speedNormalized=xe,this._adjustStashSize(xe))}if(this._enableStash)if(this._stashUsed===0&&this._stashByteStart===0&&(this._stashByteStart=V),this._stashUsed+H.byteLength<=this._stashSize){var Rt=new Uint8Array(this._stashBuffer,0,this._stashSize);Rt.set(new Uint8Array(H),this._stashUsed),this._stashUsed+=H.byteLength}else{var lt=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){var Pt=this._stashBuffer.slice(0,this._stashUsed),Wt=this._dispatchChunks(Pt,this._stashByteStart);if(Wt<Pt.byteLength){if(Wt>0){var Bt=new Uint8Array(Pt,Wt);lt.set(Bt,0),this._stashUsed=Bt.byteLength,this._stashByteStart+=Wt}}else this._stashUsed=0,this._stashByteStart+=Wt;this._stashUsed+H.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+H.byteLength),lt=new Uint8Array(this._stashBuffer,0,this._bufferSize)),lt.set(new Uint8Array(H),this._stashUsed),this._stashUsed+=H.byteLength}else{var wt=this._dispatchChunks(H,V);if(wt<H.byteLength){var Q=H.byteLength-wt;Q>this._bufferSize&&(this._expandBuffer(Q),lt=new Uint8Array(this._stashBuffer,0,this._bufferSize)),lt.set(new Uint8Array(H,wt),0),this._stashUsed+=Q,this._stashByteStart=V+wt}}}else if(this._stashUsed===0){var Ue=this._dispatchChunks(H,V);if(Ue<H.byteLength){var $e=H.byteLength-Ue;$e>this._bufferSize&&this._expandBuffer($e);var pt=new Uint8Array(this._stashBuffer,0,this._bufferSize);pt.set(new Uint8Array(H,Ue),0),this._stashUsed+=$e,this._stashByteStart=V+Ue}}else{this._stashUsed+H.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+H.byteLength);var xt=new Uint8Array(this._stashBuffer,0,this._bufferSize);xt.set(new Uint8Array(H),this._stashUsed),this._stashUsed+=H.byteLength;var Ve=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(Ve<this._stashUsed&&Ve>0){var ht=new Uint8Array(this._stashBuffer,Ve);xt.set(ht,0)}this._stashUsed-=Ve,this._stashByteStart+=Ve}}},{key:"_flushStashBuffer",value:function(H){if(this._stashUsed>0){var V=this._stashBuffer.slice(0,this._stashUsed),$=this._dispatchChunks(V,this._stashByteStart),ee=V.byteLength-$;if($<V.byteLength)if(H)B.w(this.TAG,"".concat(ee," bytes unconsumed data remain when flush buffer, dropped"));else{if($>0){var xe=new Uint8Array(this._stashBuffer,0,this._bufferSize),Ue=new Uint8Array(V,$);xe.set(Ue,0),this._stashUsed=Ue.byteLength,this._stashByteStart+=$}return 0}return this._stashUsed=0,this._stashByteStart=0,ee}return 0}},{key:"_onLoaderComplete",value:function(H,V){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}},{key:"_onLoaderError",value:function(H,V){B.e(this.TAG,"Loader error, code = ".concat(V.code,", msg = ").concat(V.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,H=_.UNRECOVERABLE_EARLY_EOF);switch(H){case _.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){var $=this._currentRange.to+1;$<this._totalLength&&(B.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek($,!1));return}H=_.UNRECOVERABLE_EARLY_EOF;break}case _.UNRECOVERABLE_EARLY_EOF:case _.CONNECTING_TIMEOUT:case _.HTTP_STATUS_CODE_INVALID:case _.EXCEPTION:break}if(this._onError)this._onError(H,V);else throw new d("IOException: "+V.msg)}}]),Ee}(),G=j,Y={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 te(){return Object.assign({},Y)}var de=function(){function Ee(){Object(q.a)(this,Ee)}return Object(ue.a)(Ee,null,[{key:"supportMSEH264Playback",value:function(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}},{key:"supportNetworkStreamIO",value:function(){var H=new G({},te()),V=H.loaderType;return H.destroy(),V=="fetch-stream-loader"||V=="xhr-moz-chunked-loader"}},{key:"getNetworkLoaderTypeName",value:function(){var H=new G({},te()),V=H.loaderType;return H.destroy(),V}},{key:"supportNativeMediaPlayback",value:function(H){Ee.videoElement==null&&(Ee.videoElement=window.document.createElement("video"));var V=Ee.videoElement.canPlayType(H);return V==="probably"||V=="maybe"}},{key:"getFeatureList",value:function(){var H={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return H.mseFlvPlayback=Ee.supportMSEH264Playback(),H.networkStreamIO=Ee.supportNetworkStreamIO(),H.networkLoaderName=Ee.getNetworkLoaderTypeName(),H.mseLiveFlvPlayback=H.mseFlvPlayback&&H.networkStreamIO,H.nativeMP4H264Playback=Ee.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),H.nativeWebmVP8Playback=Ee.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),H.nativeWebmVP9Playback=Ee.supportNativeMediaPlayback('video/webm; codecs="vp9"'),H}}]),Ee}(),ve=de,he={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"},Re=he,we=function(){function Ee(){Object(q.a)(this,Ee)}return Object(ue.a)(Ee,null,[{key:"forceGlobalTag",get:function(){return B.FORCE_GLOBAL_TAG},set:function(H){B.FORCE_GLOBAL_TAG=H,Ee._notifyChange()}},{key:"globalTag",get:function(){return B.GLOBAL_TAG},set:function(H){B.GLOBAL_TAG=H,Ee._notifyChange()}},{key:"enableAll",get:function(){return B.ENABLE_VERBOSE&&B.ENABLE_DEBUG&&B.ENABLE_INFO&&B.ENABLE_WARN&&B.ENABLE_ERROR},set:function(H){B.ENABLE_VERBOSE=H,B.ENABLE_DEBUG=H,B.ENABLE_INFO=H,B.ENABLE_WARN=H,B.ENABLE_ERROR=H,Ee._notifyChange()}},{key:"enableDebug",get:function(){return B.ENABLE_DEBUG},set:function(H){B.ENABLE_DEBUG=H,Ee._notifyChange()}},{key:"enableVerbose",get:function(){return B.ENABLE_VERBOSE},set:function(H){B.ENABLE_VERBOSE=H,Ee._notifyChange()}},{key:"enableInfo",get:function(){return B.ENABLE_INFO},set:function(H){B.ENABLE_INFO=H,Ee._notifyChange()}},{key:"enableWarn",get:function(){return B.ENABLE_WARN},set:function(H){B.ENABLE_WARN=H,Ee._notifyChange()}},{key:"enableError",get:function(){return B.ENABLE_ERROR},set:function(H){B.ENABLE_ERROR=H,Ee._notifyChange()}},{key:"getConfig",value:function(){return{globalTag:B.GLOBAL_TAG,forceGlobalTag:B.FORCE_GLOBAL_TAG,enableVerbose:B.ENABLE_VERBOSE,enableDebug:B.ENABLE_DEBUG,enableInfo:B.ENABLE_INFO,enableWarn:B.ENABLE_WARN,enableError:B.ENABLE_ERROR,enableCallback:B.ENABLE_CALLBACK}}},{key:"applyConfig",value:function(H){B.GLOBAL_TAG=H.globalTag,B.FORCE_GLOBAL_TAG=H.forceGlobalTag,B.ENABLE_VERBOSE=H.enableVerbose,B.ENABLE_DEBUG=H.enableDebug,B.ENABLE_INFO=H.enableInfo,B.ENABLE_WARN=H.enableWarn,B.ENABLE_ERROR=H.enableError,B.ENABLE_CALLBACK=H.enableCallback}},{key:"_notifyChange",value:function(){var H=Ee.emitter;if(H.listenerCount("change")>0){var V=Ee.getConfig();H.emit("change",V)}}},{key:"registerListener",value:function(H){Ee.emitter.addListener("change",H)}},{key:"removeListener",value:function(H){Ee.emitter.removeListener("change",H)}},{key:"addLogListener",value:function(H){B.emitter.addListener("log",H),B.emitter.listenerCount("log")>0&&(B.ENABLE_CALLBACK=!0,Ee._notifyChange())}},{key:"removeLogListener",value:function(H){B.emitter.removeListener("log",H),B.emitter.listenerCount("log")===0&&(B.ENABLE_CALLBACK=!1,Ee._notifyChange())}}]),Ee}();we.emitter=new z.a;var ge=we,Ne=function(){function Ee(){Object(q.a)(this,Ee),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(ue.a)(Ee,[{key:"isComplete",value:function(){var H=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,V=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&&H&&V}},{key:"isSeekable",value:function(){return this.hasKeyframesIndex===!0}},{key:"getNearestKeyframe",value:function(H){if(this.keyframesIndex==null)return null;var V=this.keyframesIndex,$=this._search(V.times,H);return{index:$,milliseconds:V.times[$],fileposition:V.filepositions[$]}}},{key:"_search",value:function(H,V){var $=0,ee=H.length-1,xe=0,Ue=0,$e=ee;for(V<H[0]&&($=0,Ue=$e+1);Ue<=$e;)if(xe=Ue+Math.floor(($e-Ue)/2),xe===ee||V>=H[xe]&&V<H[xe+1]){$=xe;break}else H[xe]<V?Ue=xe+1:$e=xe-1;return $}}]),Ee}(),ze=Ne;function nt(Ee,se,H){var V=Ee;if(se+H<V.length){for(;H--;)if((V[++se]&192)!==128)return!1;return!0}else return!1}function Ge(Ee){for(var se=[],H=Ee,V=0,$=Ee.length;V<$;){if(H[V]<128){se.push(String.fromCharCode(H[V])),++V;continue}else if(!(H[V]<192)){if(H[V]<224){if(nt(H,V,1)){var ee=(H[V]&31)<<6|H[V+1]&63;if(ee>=128){se.push(String.fromCharCode(ee&65535)),V+=2;continue}}}else if(H[V]<240){if(nt(H,V,2)){var xe=(H[V]&15)<<12|(H[V+1]&63)<<6|H[V+2]&63;if(xe>=2048&&(xe&63488)!==55296){se.push(String.fromCharCode(xe&65535)),V+=3;continue}}}else if(H[V]<248&&nt(H,V,3)){var Ue=(H[V]&7)<<18|(H[V+1]&63)<<12|(H[V+2]&63)<<6|H[V+3]&63;if(Ue>65536&&Ue<1114112){Ue-=65536,se.push(String.fromCharCode(Ue>>>10|55296)),se.push(String.fromCharCode(Ue&1023|56320)),V+=4;continue}}}se.push(String.fromCharCode(65533)),++V}return se.join("")}var Xe=Ge,Be=function(){var Ee=new ArrayBuffer(2);return new DataView(Ee).setInt16(0,256,!0),new Int16Array(Ee)[0]===256}(),_e=function(){function Ee(){Object(q.a)(this,Ee)}return Object(ue.a)(Ee,null,[{key:"parseScriptData",value:function(H,V,$){var ee={};try{var xe=Ee.parseValue(H,V,$),Ue=Ee.parseValue(H,V+xe.size,$-xe.size);ee[xe.data]=Ue.data}catch($e){B.e("AMF",$e.toString())}return ee}},{key:"parseObject",value:function(H,V,$){if($<3)throw new m("Data not enough when parse ScriptDataObject");var ee=Ee.parseString(H,V,$),xe=Ee.parseValue(H,V+ee.size,$-ee.size),Ue=xe.objectEnd;return{data:{name:ee.data,value:xe.data},size:ee.size+xe.size,objectEnd:Ue}}},{key:"parseVariable",value:function(H,V,$){return Ee.parseObject(H,V,$)}},{key:"parseString",value:function(H,V,$){if($<2)throw new m("Data not enough when parse String");var ee=new DataView(H,V,$),xe=ee.getUint16(0,!Be),Ue;return xe>0?Ue=Xe(new Uint8Array(H,V+2,xe)):Ue="",{data:Ue,size:2+xe}}},{key:"parseLongString",value:function(H,V,$){if($<4)throw new m("Data not enough when parse LongString");var ee=new DataView(H,V,$),xe=ee.getUint32(0,!Be),Ue;return xe>0?Ue=Xe(new Uint8Array(H,V+4,xe)):Ue="",{data:Ue,size:4+xe}}},{key:"parseDate",value:function(H,V,$){if($<10)throw new m("Data size invalid when parse Date");var ee=new DataView(H,V,$),xe=ee.getFloat64(0,!Be),Ue=ee.getInt16(8,!Be);return xe+=Ue*60*1e3,{data:new Date(xe),size:8+2}}},{key:"parseValue",value:function(H,V,$){if($<1)throw new m("Data not enough when parse Value");var ee=new DataView(H,V,$),xe=1,Ue=ee.getUint8(0),$e,pt=!1;try{switch(Ue){case 0:$e=ee.getFloat64(1,!Be),xe+=8;break;case 1:{var xt=ee.getUint8(1);$e=!!xt,xe+=1;break}case 2:{var Ve=Ee.parseString(H,V+1,$-1);$e=Ve.data,xe+=Ve.size;break}case 3:{$e={};var ht=0;for((ee.getUint32($-4,!Be)&16777215)===9&&(ht=3);xe<$-4;){var Rt=Ee.parseObject(H,V+xe,$-xe-ht);if(Rt.objectEnd)break;$e[Rt.data.name]=Rt.data.value,xe+=Rt.size}if(xe<=$-3){var lt=ee.getUint32(xe-1,!Be)&16777215;lt===9&&(xe+=3)}break}case 8:{$e={},xe+=4;var Pt=0;for((ee.getUint32($-4,!Be)&16777215)===9&&(Pt=3);xe<$-8;){var Wt=Ee.parseVariable(H,V+xe,$-xe-Pt);if(Wt.objectEnd)break;$e[Wt.data.name]=Wt.data.value,xe+=Wt.size}if(xe<=$-3){var Bt=ee.getUint32(xe-1,!Be)&16777215;Bt===9&&(xe+=3)}break}case 9:$e=void 0,xe=1,pt=!0;break;case 10:{$e=[];var wt=ee.getUint32(1,!Be);xe+=4;for(var Q=0;Q<wt;Q++){var k=Ee.parseValue(H,V+xe,$-xe);$e.push(k.data),xe+=k.size}break}case 11:{var U=Ee.parseDate(H,V+1,$-1);$e=U.data,xe+=U.size;break}case 12:{var X=Ee.parseString(H,V+1,$-1);$e=X.data,xe+=X.size;break}default:xe=$,B.w("AMF","Unsupported AMF value type "+Ue)}}catch(ie){B.e("AMF",ie.toString())}return{data:$e,size:xe,objectEnd:pt}}}]),Ee}(),Ze=_e,be=function(){function Ee(se){Object(q.a)(this,Ee),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(ue.a)(Ee,[{key:"destroy",value:function(){this._buffer=null}},{key:"_fillCurrentWord",value:function(){var H=this._total_bytes-this._buffer_index;if(H<=0)throw new m("ExpGolomb: _fillCurrentWord() but no bytes available");var V=Math.min(4,H),$=new Uint8Array(4);$.set(this._buffer.subarray(this._buffer_index,this._buffer_index+V)),this._current_word=new DataView($.buffer).getUint32(0,!1),this._buffer_index+=V,this._current_word_bits_left=V*8}},{key:"readBits",value:function(H){if(H>32)throw new s("ExpGolomb: readBits() bits exceeded max 32bits!");if(H<=this._current_word_bits_left){var V=this._current_word>>>32-H;return this._current_word<<=H,this._current_word_bits_left-=H,V}var $=this._current_word_bits_left?this._current_word:0;$=$>>>32-this._current_word_bits_left;var ee=H-this._current_word_bits_left;this._fillCurrentWord();var xe=Math.min(ee,this._current_word_bits_left),Ue=this._current_word>>>32-xe;return this._current_word<<=xe,this._current_word_bits_left-=xe,$=$<<xe|Ue,$}},{key:"readBool",value:function(){return this.readBits(1)===1}},{key:"readByte",value:function(){return this.readBits(8)}},{key:"_skipLeadingZero",value:function(){var H;for(H=0;H<this._current_word_bits_left;H++)if((this._current_word&2147483648>>>H)!==0)return this._current_word<<=H,this._current_word_bits_left-=H,H;return this._fillCurrentWord(),H+this._skipLeadingZero()}},{key:"readUEG",value:function(){var H=this._skipLeadingZero();return this.readBits(H+1)-1}},{key:"readSEG",value:function(){var H=this.readUEG();return H&1?H+1>>>1:-1*(H>>>1)}}]),Ee}(),Le=be,le=function(){function Ee(){Object(q.a)(this,Ee)}return Object(ue.a)(Ee,null,[{key:"_ebsp2rbsp",value:function(H){for(var V=H,$=V.byteLength,ee=new Uint8Array($),xe=0,Ue=0;Ue<$;Ue++){if(Ue>=2&&(V[Ue]===3&&V[Ue-1]===0&&V[Ue-2]===0))continue;ee[xe]=V[Ue],xe++}return new Uint8Array(ee.buffer,0,xe)}},{key:"parseSPS",value:function(H){var V=Ee._ebsp2rbsp(H),$=new Le(V);$.readByte();var ee=$.readByte();$.readByte();var xe=$.readByte();$.readUEG();var Ue=Ee.getProfileString(ee),$e=Ee.getLevelString(xe),pt=1,xt=420,Ve=[0,420,422,444],ht=8;if((ee===100||ee===110||ee===122||ee===244||ee===44||ee===83||ee===86||ee===118||ee===128||ee===138||ee===144)&&(pt=$.readUEG(),pt===3&&$.readBits(1),pt<=3&&(xt=Ve[pt]),ht=$.readUEG()+8,$.readUEG(),$.readBits(1),$.readBool()))for(var Rt=pt!==3?8:12,lt=0;lt<Rt;lt++)$.readBool()&&(lt<6?Ee._skipScalingList($,16):Ee._skipScalingList($,64));$.readUEG();var Pt=$.readUEG();if(Pt===0)$.readUEG();else if(Pt===1){$.readBits(1),$.readSEG(),$.readSEG();for(var Wt=$.readUEG(),Bt=0;Bt<Wt;Bt++)$.readSEG()}var wt=$.readUEG();$.readBits(1);var Q=$.readUEG(),k=$.readUEG(),U=$.readBits(1);U===0&&$.readBits(1),$.readBits(1);var X=0,ie=0,J=0,Ae=0,tt=$.readBool();tt&&(X=$.readUEG(),ie=$.readUEG(),J=$.readUEG(),Ae=$.readUEG());var kt=1,Mt=1,gt=0,$t=!0,mn=0,Mn=0,lr=$.readBool();if(lr){if($.readBool()){var Kn=$.readByte(),ur=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],dr=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];Kn>0&&Kn<16?(kt=ur[Kn-1],Mt=dr[Kn-1]):Kn===255&&(kt=$.readByte()<<8|$.readByte(),Mt=$.readByte()<<8|$.readByte())}if($.readBool()&&$.readBool(),$.readBool()&&($.readBits(4),$.readBool()&&$.readBits(24)),$.readBool()&&($.readUEG(),$.readUEG()),$.readBool()){var hr=$.readBits(32),Dr=$.readBits(32);$t=$.readBool(),mn=Dr,Mn=hr*2,gt=mn/Mn}}var Cr=1;(kt!==1||Mt!==1)&&(Cr=kt/Mt);var Wn=0,Er=0;if(pt===0)Wn=1,Er=2-U;else{var zr=pt===3?1:2,vi=pt===1?2:1;Wn=zr,Er=vi*(2-U)}var xr=(Q+1)*16,Zr=(2-U)*((k+1)*16);xr-=(X+ie)*Wn,Zr-=(J+Ae)*Er;var _i=Math.ceil(xr*Cr);return $.destroy(),$=null,{profile_string:Ue,level_string:$e,bit_depth:ht,ref_frames:wt,chroma_format:xt,chroma_format_string:Ee.getChromaFormatString(xt),frame_rate:{fixed:$t,fps:gt,fps_den:Mn,fps_num:mn},sar_ratio:{width:kt,height:Mt},codec_size:{width:xr,height:Zr},present_size:{width:_i,height:Zr}}}},{key:"_skipScalingList",value:function(H,V){for(var $=8,ee=8,xe=0,Ue=0;Ue<V;Ue++)ee!==0&&(xe=H.readSEG(),ee=($+xe+256)%256),$=ee===0?$:ee}},{key:"getProfileString",value:function(H){switch(H){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(H){return(H/10).toFixed(1)}},{key:"getChromaFormatString",value:function(H){switch(H){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}]),Ee}(),ye=le,Te={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"},Pe=Te;function He(Ee){return Ee>>>8&255|(Ee&255)<<8}function Ye(Ee){return(Ee&4278190080)>>>24|(Ee&16711680)>>>8|(Ee&65280)<<8|(Ee&255)<<24}function ct(Ee,se){return Ee[se]<<24|Ee[se+1]<<16|Ee[se+2]<<8|Ee[se+3]}var st=function(){function Ee(se,H){Object(q.a)(this,Ee),this.TAG="FLVDemuxer",this._config=H,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 ze,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 V=new ArrayBuffer(2);return new DataView(V).setInt16(0,256,!0),new Int16Array(V)[0]===256}()}return Object(ue.a)(Ee,[{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(H){return H.onDataArrival=this.parseChunks.bind(this),this}},{key:"onTrackMetadata",get:function(){return this._onTrackMetadata},set:function(H){this._onTrackMetadata=H}},{key:"onMediaInfo",get:function(){return this._onMediaInfo},set:function(H){this._onMediaInfo=H}},{key:"onMetaDataArrived",get:function(){return this._onMetaDataArrived},set:function(H){this._onMetaDataArrived=H}},{key:"onScriptDataArrived",get:function(){return this._onScriptDataArrived},set:function(H){this._onScriptDataArrived=H}},{key:"onError",get:function(){return this._onError},set:function(H){this._onError=H}},{key:"onDataAvailable",get:function(){return this._onDataAvailable},set:function(H){this._onDataAvailable=H}},{key:"timestampBase",get:function(){return this._timestampBase},set:function(H){this._timestampBase=H}},{key:"overridedDuration",get:function(){return this._duration},set:function(H){this._durationOverrided=!0,this._duration=H,this._mediaInfo.duration=H}},{key:"overridedHasAudio",set:function(H){this._hasAudioFlagOverrided=!0,this._hasAudio=H,this._mediaInfo.hasAudio=H}},{key:"overridedHasVideo",set:function(H){this._hasVideoFlagOverrided=!0,this._hasVideo=H,this._mediaInfo.hasVideo=H}},{key:"resetMediaInfo",value:function(){this._mediaInfo=new ze}},{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(H,V){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new m("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var $=0,ee=this._littleEndian;if(V===0)if(H.byteLength>13){var xe=Ee.probe(H);$=xe.dataOffset}else return 0;if(this._firstParse){this._firstParse=!1,V+$!==this._dataOffset&&B.w(this.TAG,"First time parsing but chunk byteStart invalid!");var Ue=new DataView(H,$),$e=Ue.getUint32(0,!ee);$e!==0&&B.w(this.TAG,"PrevTagSize0 !== 0 !!!"),$+=4}for(;$<H.byteLength;){this._dispatch=!0;var pt=new DataView(H,$);if($+11+4>H.byteLength)break;var xt=pt.getUint8(0),Ve=pt.getUint32(0,!ee)&16777215;if($+11+Ve+4>H.byteLength)break;if(xt!==8&&xt!==9&&xt!==18){B.w(this.TAG,"Unsupported tag type ".concat(xt,", skipped")),$+=11+Ve+4;continue}var ht=pt.getUint8(4),Rt=pt.getUint8(5),lt=pt.getUint8(6),Pt=pt.getUint8(7),Wt=lt|Rt<<8|ht<<16|Pt<<24,Bt=pt.getUint32(7,!ee)&16777215;Bt!==0&&B.w(this.TAG,"Meet tag which has StreamID != 0!");var wt=$+11;switch(xt){case 8:this._parseAudioData(H,wt,Ve,Wt);break;case 9:this._parseVideoData(H,wt,Ve,Wt,V+$);break;case 18:this._parseScriptData(H,wt,Ve);break}var Q=pt.getUint32(11+Ve,!ee);Q!==11+Ve&&B.w(this.TAG,"Invalid PrevTagSize ".concat(Q)),$+=11+Ve+4}return this._isInitialMetadataDispatched()&&(this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack)),$}},{key:"_parseScriptData",value:function(H,V,$){var ee=Ze.parseScriptData(H,V,$);if(ee.hasOwnProperty("onMetaData")){if(ee.onMetaData==null||typeof ee.onMetaData!="object"){B.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&B.w(this.TAG,"Found another onMetaData tag!"),this._metadata=ee;var xe=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},xe)),typeof xe.hasAudio=="boolean"&&(this._hasAudioFlagOverrided===!1&&(this._hasAudio=xe.hasAudio,this._mediaInfo.hasAudio=this._hasAudio)),typeof xe.hasVideo=="boolean"&&(this._hasVideoFlagOverrided===!1&&(this._hasVideo=xe.hasVideo,this._mediaInfo.hasVideo=this._hasVideo)),typeof xe.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=xe.audiodatarate),typeof xe.videodatarate=="number"&&(this._mediaInfo.videoDataRate=xe.videodatarate),typeof xe.width=="number"&&(this._mediaInfo.width=xe.width),typeof xe.height=="number"&&(this._mediaInfo.height=xe.height),typeof xe.duration=="number"){if(!this._durationOverrided){var Ue=Math.floor(xe.duration*this._timescale);this._duration=Ue,this._mediaInfo.duration=Ue}}else this._mediaInfo.duration=0;if(typeof xe.framerate=="number"){var $e=Math.floor(xe.framerate*1e3);if($e>0){var pt=$e/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=pt,this._referenceFrameRate.fps_num=$e,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=pt}}if(typeof xe.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var xt=xe.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(xt),xe.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=xe,B.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(ee).length>0&&(this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},ee)))}},{key:"_parseKeyframesIndex",value:function(H){for(var V=[],$=[],ee=1;ee<H.times.length;ee++){var xe=this._timestampBase+Math.floor(H.times[ee]*1e3);V.push(xe),$.push(H.filepositions[ee])}return{times:V,filepositions:$}}},{key:"_parseAudioData",value:function(H,V,$,ee){if($<=1){B.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");return}if(this._hasAudioFlagOverrided===!0&&this._hasAudio===!1)return;var xe=this._littleEndian,Ue=new DataView(H,V,$),$e=Ue.getUint8(0),pt=$e>>>4;if(pt!==2&&pt!==10){this._onError(Pe.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+pt);return}var xt=0,Ve=($e&12)>>>2;if(Ve>=0&&Ve<=4)xt=this._flvSoundRateTable[Ve];else{this._onError(Pe.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+Ve);return}var ht=($e&2)>>>1,Rt=$e&1,lt=this._audioMetadata,Pt=this._audioTrack;if(lt||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),lt=this._audioMetadata={},lt.type="audio",lt.id=Pt.id,lt.timescale=this._timescale,lt.duration=this._duration,lt.audioSampleRate=xt,lt.channelCount=Rt===0?1:2),pt===10){var Wt=this._parseAACAudioData(H,V+1,$-1);if(Wt==null)return;if(Wt.packetType===0){lt.config&&B.w(this.TAG,"Found another AudioSpecificConfig!");var Bt=Wt.data;lt.audioSampleRate=Bt.samplingRate,lt.channelCount=Bt.channelCount,lt.codec=Bt.codec,lt.originalCodec=Bt.originalCodec,lt.config=Bt.config,lt.refSampleDuration=1024/lt.audioSampleRate*lt.timescale,B.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",lt);var wt=this._mediaInfo;wt.audioCodec=lt.originalCodec,wt.audioSampleRate=lt.audioSampleRate,wt.audioChannelCount=lt.channelCount,wt.hasVideo?wt.videoCodec!=null&&(wt.mimeType='video/x-flv; codecs="'+wt.videoCodec+","+wt.audioCodec+'"'):wt.mimeType='video/x-flv; codecs="'+wt.audioCodec+'"',wt.isComplete()&&this._onMediaInfo(wt)}else if(Wt.packetType===1){var Q=this._timestampBase+ee,k={unit:Wt.data,length:Wt.data.byteLength,dts:Q,pts:Q};Pt.samples.push(k),Pt.length+=Wt.data.length}else B.e(this.TAG,"Flv: Unsupported AAC data type ".concat(Wt.packetType))}else if(pt===2){if(!lt.codec){var U=this._parseMP3AudioData(H,V+1,$-1,!0);if(U==null)return;lt.audioSampleRate=U.samplingRate,lt.channelCount=U.channelCount,lt.codec=U.codec,lt.originalCodec=U.originalCodec,lt.refSampleDuration=1152/lt.audioSampleRate*lt.timescale,B.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",lt);var X=this._mediaInfo;X.audioCodec=lt.codec,X.audioSampleRate=lt.audioSampleRate,X.audioChannelCount=lt.channelCount,X.audioDataRate=U.bitRate,X.hasVideo?X.videoCodec!=null&&(X.mimeType='video/x-flv; codecs="'+X.videoCodec+","+X.audioCodec+'"'):X.mimeType='video/x-flv; codecs="'+X.audioCodec+'"',X.isComplete()&&this._onMediaInfo(X)}var ie=this._parseMP3AudioData(H,V+1,$-1,!1);if(ie==null)return;var J=this._timestampBase+ee,Ae={unit:ie,length:ie.byteLength,dts:J,pts:J};Pt.samples.push(Ae),Pt.length+=ie.length}}},{key:"_parseAACAudioData",value:function(H,V,$){if($<=1){B.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}var ee={},xe=new Uint8Array(H,V,$);return ee.packetType=xe[0],xe[0]===0?ee.data=this._parseAACAudioSpecificConfig(H,V+1,$-1):ee.data=xe.subarray(1),ee}},{key:"_parseAACAudioSpecificConfig",value:function(H,V,$){var ee=new Uint8Array(H,V,$),xe=null,Ue=0,$e=0,pt=null,xt=0,Ve=null;if(Ue=$e=ee[0]>>>3,xt=(ee[0]&7)<<1|ee[1]>>>7,xt<0||xt>=this._mpegSamplingRates.length){this._onError(Pe.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}var ht=this._mpegSamplingRates[xt],Rt=(ee[1]&120)>>>3;if(Rt<0||Rt>=8){this._onError(Pe.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}Ue===5&&(Ve=(ee[1]&7)<<1|ee[2]>>>7,pt=(ee[2]&124)>>>2);var lt=self.navigator.userAgent.toLowerCase();return lt.indexOf("firefox")!==-1?xt>=6?(Ue=5,xe=new Array(4),Ve=xt-3):(Ue=2,xe=new Array(2),Ve=xt):lt.indexOf("android")!==-1?(Ue=2,xe=new Array(2),Ve=xt):(Ue=5,Ve=xt,xe=new Array(4),xt>=6?Ve=xt-3:Rt===1&&(Ue=2,xe=new Array(2),Ve=xt)),xe[0]=Ue<<3,xe[0]|=(xt&15)>>>1,xe[1]=(xt&15)<<7,xe[1]|=(Rt&15)<<3,Ue===5&&(xe[1]|=(Ve&15)>>>1,xe[2]=(Ve&1)<<7,xe[2]|=2<<2,xe[3]=0),{config:xe,samplingRate:ht,channelCount:Rt,codec:"mp4a.40."+Ue,originalCodec:"mp4a.40."+$e}}},{key:"_parseMP3AudioData",value:function(H,V,$,ee){if($<4){B.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}var xe=this._littleEndian,Ue=new Uint8Array(H,V,$),$e=null;if(ee){if(Ue[0]!==255)return;var pt=Ue[1]>>>3&3,xt=(Ue[1]&6)>>1,Ve=(Ue[2]&240)>>>4,ht=(Ue[2]&12)>>>2,Rt=Ue[3]>>>6&3,lt=Rt!==3?2:1,Pt=0,Wt=0,Bt=34,wt="mp3";switch(pt){case 0:Pt=this._mpegAudioV25SampleRateTable[ht];break;case 2:Pt=this._mpegAudioV20SampleRateTable[ht];break;case 3:Pt=this._mpegAudioV10SampleRateTable[ht];break}switch(xt){case 1:Bt=34,Ve<this._mpegAudioL3BitRateTable.length&&(Wt=this._mpegAudioL3BitRateTable[Ve]);break;case 2:Bt=33,Ve<this._mpegAudioL2BitRateTable.length&&(Wt=this._mpegAudioL2BitRateTable[Ve]);break;case 3:Bt=32,Ve<this._mpegAudioL1BitRateTable.length&&(Wt=this._mpegAudioL1BitRateTable[Ve]);break}$e={bitRate:Wt,samplingRate:Pt,channelCount:lt,codec:wt,originalCodec:wt}}else $e=Ue;return $e}},{key:"_parseVideoData",value:function(H,V,$,ee,xe){if($<=1){B.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");return}if(this._hasVideoFlagOverrided===!0&&this._hasVideo===!1)return;var Ue=new Uint8Array(H,V,$)[0],$e=(Ue&240)>>>4,pt=Ue&15;if(pt!==7){this._onError(Pe.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(pt));return}this._parseAVCVideoPacket(H,V+1,$-1,ee,xe,$e)}},{key:"_parseAVCVideoPacket",value:function(H,V,$,ee,xe,Ue){if($<4){B.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}var $e=this._littleEndian,pt=new DataView(H,V,$),xt=pt.getUint8(0),Ve=pt.getUint32(0,!$e)&16777215,ht=Ve<<8>>8;if(xt===0)this._parseAVCDecoderConfigurationRecord(H,V+4,$-4);else if(xt===1)this._parseAVCVideoData(H,V+4,$-4,ee,xe,Ue,ht);else if(!(xt===2)){this._onError(Pe.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(xt));return}}},{key:"_parseAVCDecoderConfigurationRecord",value:function(H,V,$){if($<7){B.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}var ee=this._videoMetadata,xe=this._videoTrack,Ue=this._littleEndian,$e=new DataView(H,V,$);ee?typeof ee.avcc!="undefined"&&B.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),ee=this._videoMetadata={},ee.type="video",ee.id=xe.id,ee.timescale=this._timescale,ee.duration=this._duration);var pt=$e.getUint8(0),xt=$e.getUint8(1),Ve=$e.getUint8(2),ht=$e.getUint8(3);if(pt!==1||xt===0){this._onError(Pe.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=($e.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(Pe.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));return}var Rt=$e.getUint8(5)&31;if(Rt===0){this._onError(Pe.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else Rt>1&&B.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(Rt));for(var lt=6,Pt=0;Pt<Rt;Pt++){var Wt=$e.getUint16(lt,!Ue);if(lt+=2,Wt===0)continue;var Bt=new Uint8Array(H,V+lt,Wt);lt+=Wt;var wt=ye.parseSPS(Bt);if(Pt!==0)continue;ee.codecWidth=wt.codec_size.width,ee.codecHeight=wt.codec_size.height,ee.presentWidth=wt.present_size.width,ee.presentHeight=wt.present_size.height,ee.profile=wt.profile_string,ee.level=wt.level_string,ee.bitDepth=wt.bit_depth,ee.chromaFormat=wt.chroma_format,ee.sarRatio=wt.sar_ratio,ee.frameRate=wt.frame_rate,(wt.frame_rate.fixed===!1||wt.frame_rate.fps_num===0||wt.frame_rate.fps_den===0)&&(ee.frameRate=this._referenceFrameRate);var Q=ee.frameRate.fps_den,k=ee.frameRate.fps_num;ee.refSampleDuration=ee.timescale*(Q/k);for(var U=Bt.subarray(1,4),X="avc1.",ie=0;ie<3;ie++){var J=U[ie].toString(16);J.length<2&&(J="0"+J),X+=J}ee.codec=X;var Ae=this._mediaInfo;Ae.width=ee.codecWidth,Ae.height=ee.codecHeight,Ae.fps=ee.frameRate.fps,Ae.profile=ee.profile,Ae.level=ee.level,Ae.refFrames=wt.ref_frames,Ae.chromaFormat=wt.chroma_format_string,Ae.sarNum=ee.sarRatio.width,Ae.sarDen=ee.sarRatio.height,Ae.videoCodec=X,Ae.hasAudio?Ae.audioCodec!=null&&(Ae.mimeType='video/x-flv; codecs="'+Ae.videoCodec+","+Ae.audioCodec+'"'):Ae.mimeType='video/x-flv; codecs="'+Ae.videoCodec+'"',Ae.isComplete()&&this._onMediaInfo(Ae)}var tt=$e.getUint8(lt);if(tt===0){this._onError(Pe.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS");return}else tt>1&&B.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(tt));lt++;for(var kt=0;kt<tt;kt++){var Mt=$e.getUint16(lt,!Ue);if(lt+=2,Mt===0)continue;lt+=Mt}ee.avcc=new Uint8Array($),ee.avcc.set(new Uint8Array(H,V,$),0),B.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",ee)}},{key:"_parseAVCVideoData",value:function(H,V,$,ee,xe,Ue,$e){for(var pt=this._littleEndian,xt=new DataView(H,V,$),Ve=[],ht=0,Rt=0,lt=this._naluLengthSize,Pt=this._timestampBase+ee,Wt=Ue===1;Rt<$;){if(Rt+4>=$){B.w(this.TAG,"Malformed Nalu near timestamp ".concat(Pt,", offset = ").concat(Rt,", dataSize = ").concat($));break}var Bt=xt.getUint32(Rt,!pt);if(lt===3&&(Bt>>>=8),Bt>$-lt){B.w(this.TAG,"Malformed Nalus near timestamp ".concat(Pt,", NaluSize > DataSize!"));return}var wt=xt.getUint8(Rt+lt)&31;wt===5&&(Wt=!0);var Q=new Uint8Array(H,V+Rt,lt+Bt),k={type:wt,data:Q};Ve.push(k),ht+=Q.byteLength,Rt+=lt+Bt}if(Ve.length){var U=this._videoTrack,X={units:Ve,length:ht,isKeyframe:Wt,dts:Pt,cts:$e,pts:Pt+$e};Wt&&(X.fileposition=xe),U.samples.push(X),U.length+=ht}}}],[{key:"probe",value:function(H){var V=new Uint8Array(H),$={match:!1};if(V[0]!==70||V[1]!==76||V[2]!==86||V[3]!==1)return $;var ee=(V[4]&4)>>>2!==0,xe=(V[4]&1)!==0,Ue=ct(V,5);return Ue<9?$:{match:!0,consumed:Ue,dataOffset:Ue,hasAudioTrack:ee,hasVideoTrack:xe}}}]),Ee}(),vt=st,qe=function(){function Ee(){Object(q.a)(this,Ee)}return Object(ue.a)(Ee,null,[{key:"init",value:function(){Ee.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 H in Ee.types)Ee.types.hasOwnProperty(H)&&(Ee.types[H]=[H.charCodeAt(0),H.charCodeAt(1),H.charCodeAt(2),H.charCodeAt(3)]);var V=Ee.constants={};V.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),V.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),V.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),V.STSC=V.STCO=V.STTS,V.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),V.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]),V.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]),V.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),V.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),V.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(H){for(var V=8,$=null,ee=Array.prototype.slice.call(arguments,1),xe=ee.length,Ue=0;Ue<xe;Ue++)V+=ee[Ue].byteLength;$=new Uint8Array(V),$[0]=V>>>24&255,$[1]=V>>>16&255,$[2]=V>>>8&255,$[3]=V&255,$.set(H,4);for(var $e=8,pt=0;pt<xe;pt++)$.set(ee[pt],$e),$e+=ee[pt].byteLength;return $}},{key:"generateInitSegment",value:function(H){var V=Ee.box(Ee.types.ftyp,Ee.constants.FTYP),$=Ee.moov(H),ee=new Uint8Array(V.byteLength+$.byteLength);return ee.set(V,0),ee.set($,V.byteLength),ee}},{key:"moov",value:function(H){var V=Ee.mvhd(H.timescale,H.duration),$=Ee.trak(H),ee=Ee.mvex(H);return Ee.box(Ee.types.moov,V,$,ee)}},{key:"mvhd",value:function(H,V){return Ee.box(Ee.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,H>>>24&255,H>>>16&255,H>>>8&255,H&255,V>>>24&255,V>>>16&255,V>>>8&255,V&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))}},{key:"trak",value:function(H){return Ee.box(Ee.types.trak,Ee.tkhd(H),Ee.mdia(H))}},{key:"tkhd",value:function(H){var V=H.id,$=H.duration,ee=H.presentWidth,xe=H.presentHeight;return Ee.box(Ee.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,V>>>24&255,V>>>16&255,V>>>8&255,V&255,0,0,0,0,$>>>24&255,$>>>16&255,$>>>8&255,$&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,ee>>>8&255,ee&255,0,0,xe>>>8&255,xe&255,0,0]))}},{key:"mdia",value:function(H){return Ee.box(Ee.types.mdia,Ee.mdhd(H),Ee.hdlr(H),Ee.minf(H))}},{key:"mdhd",value:function(H){var V=H.timescale,$=H.duration;return Ee.box(Ee.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,V>>>24&255,V>>>16&255,V>>>8&255,V&255,$>>>24&255,$>>>16&255,$>>>8&255,$&255,85,196,0,0]))}},{key:"hdlr",value:function(H){var V=null;return H.type==="audio"?V=Ee.constants.HDLR_AUDIO:V=Ee.constants.HDLR_VIDEO,Ee.box(Ee.types.hdlr,V)}},{key:"minf",value:function(H){var V=null;return H.type==="audio"?V=Ee.box(Ee.types.smhd,Ee.constants.SMHD):V=Ee.box(Ee.types.vmhd,Ee.constants.VMHD),Ee.box(Ee.types.minf,V,Ee.dinf(),Ee.stbl(H))}},{key:"dinf",value:function(){var H=Ee.box(Ee.types.dinf,Ee.box(Ee.types.dref,Ee.constants.DREF));return H}},{key:"stbl",value:function(H){var V=Ee.box(Ee.types.stbl,Ee.stsd(H),Ee.box(Ee.types.stts,Ee.constants.STTS),Ee.box(Ee.types.stsc,Ee.constants.STSC),Ee.box(Ee.types.stsz,Ee.constants.STSZ),Ee.box(Ee.types.stco,Ee.constants.STCO));return V}},{key:"stsd",value:function(H){return H.type==="audio"?H.codec==="mp3"?Ee.box(Ee.types.stsd,Ee.constants.STSD_PREFIX,Ee.mp3(H)):Ee.box(Ee.types.stsd,Ee.constants.STSD_PREFIX,Ee.mp4a(H)):Ee.box(Ee.types.stsd,Ee.constants.STSD_PREFIX,Ee.avc1(H))}},{key:"mp3",value:function(H){var V=H.channelCount,$=H.audioSampleRate,ee=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,V,0,16,0,0,0,0,$>>>8&255,$&255,0,0]);return Ee.box(Ee.types[".mp3"],ee)}},{key:"mp4a",value:function(H){var V=H.channelCount,$=H.audioSampleRate,ee=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,V,0,16,0,0,0,0,$>>>8&255,$&255,0,0]);return Ee.box(Ee.types.mp4a,ee,Ee.esds(H))}},{key:"esds",value:function(H){var V=H.config||[],$=V.length,ee=new Uint8Array([0,0,0,0,3,23+$,0,1,0,4,15+$,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([$]).concat(V).concat([6,1,2]));return Ee.box(Ee.types.esds,ee)}},{key:"avc1",value:function(H){var V=H.avcc,$=H.codecWidth,ee=H.codecHeight,xe=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,$>>>8&255,$&255,ee>>>8&255,ee&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 Ee.box(Ee.types.avc1,xe,Ee.box(Ee.types.avcC,V))}},{key:"mvex",value:function(H){return Ee.box(Ee.types.mvex,Ee.trex(H))}},{key:"trex",value:function(H){var V=H.id,$=new Uint8Array([0,0,0,0,V>>>24&255,V>>>16&255,V>>>8&255,V&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return Ee.box(Ee.types.trex,$)}},{key:"moof",value:function(H,V){return Ee.box(Ee.types.moof,Ee.mfhd(H.sequenceNumber),Ee.traf(H,V))}},{key:"mfhd",value:function(H){var V=new Uint8Array([0,0,0,0,H>>>24&255,H>>>16&255,H>>>8&255,H&255]);return Ee.box(Ee.types.mfhd,V)}},{key:"traf",value:function(H,V){var $=H.id,ee=Ee.box(Ee.types.tfhd,new Uint8Array([0,0,0,0,$>>>24&255,$>>>16&255,$>>>8&255,$&255])),xe=Ee.box(Ee.types.tfdt,new Uint8Array([0,0,0,0,V>>>24&255,V>>>16&255,V>>>8&255,V&255])),Ue=Ee.sdtp(H),$e=Ee.trun(H,Ue.byteLength+16+16+8+16+8+8);return Ee.box(Ee.types.traf,ee,xe,$e,Ue)}},{key:"sdtp",value:function(H){for(var V=H.samples||[],$=V.length,ee=new Uint8Array(4+$),xe=0;xe<$;xe++){var Ue=V[xe].flags;ee[xe+4]=Ue.isLeading<<6|Ue.dependsOn<<4|Ue.isDependedOn<<2|Ue.hasRedundancy}return Ee.box(Ee.types.sdtp,ee)}},{key:"trun",value:function(H,V){var $=H.samples||[],ee=$.length,xe=12+16*ee,Ue=new Uint8Array(xe);V+=8+xe,Ue.set([0,0,15,1,ee>>>24&255,ee>>>16&255,ee>>>8&255,ee&255,V>>>24&255,V>>>16&255,V>>>8&255,V&255],0);for(var $e=0;$e<ee;$e++){var pt=$[$e].duration,xt=$[$e].size,Ve=$[$e].flags,ht=$[$e].cts;Ue.set([pt>>>24&255,pt>>>16&255,pt>>>8&255,pt&255,xt>>>24&255,xt>>>16&255,xt>>>8&255,xt&255,Ve.isLeading<<2|Ve.dependsOn,Ve.isDependedOn<<6|Ve.hasRedundancy<<4|Ve.isNonSync,0,0,ht>>>24&255,ht>>>16&255,ht>>>8&255,ht&255],12+16*$e)}return Ee.box(Ee.types.trun,Ue)}},{key:"mdat",value:function(H){return Ee.box(Ee.types.mdat,H)}}]),Ee}();qe.init();var mt=qe,yt=function(){function Ee(){Object(q.a)(this,Ee)}return Object(ue.a)(Ee,null,[{key:"getSilentFrame",value:function(H,V){if(H==="mp4a.40.2"){if(V===1)return new Uint8Array([0,200,0,128,35,128]);if(V===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(V===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(V===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(V===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(V===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(V===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(V===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(V===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}}]),Ee}(),Je=yt,et=function Ee(se,H,V,$,ee){Object(q.a)(this,Ee),this.dts=se,this.pts=H,this.duration=V,this.originalDts=$,this.isSyncPoint=ee,this.fileposition=null},De=function(){function Ee(){Object(q.a)(this,Ee),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(ue.a)(Ee,[{key:"appendSyncPoint",value:function(H){H.isSyncPoint=!0,this.syncPoints.push(H)}}]),Ee}(),ke=function(){function Ee(){Object(q.a)(this,Ee),this._list=[]}return Object(ue.a)(Ee,[{key:"clear",value:function(){this._list=[]}},{key:"appendArray",value:function(H){var V=this._list;if(H.length===0)return;V.length>0&&H[0].originalDts<V[V.length-1].originalDts&&this.clear(),Array.prototype.push.apply(V,H)}},{key:"getLastSyncPointBeforeDts",value:function(H){if(this._list.length==0)return null;var V=this._list,$=0,ee=V.length-1,xe=0,Ue=0,$e=ee;for(H<V[0].dts&&($=0,Ue=$e+1);Ue<=$e;)if(xe=Ue+Math.floor(($e-Ue)/2),xe===ee||H>=V[xe].dts&&H<V[xe+1].dts){$=xe;break}else V[xe].dts<H?Ue=xe+1:$e=xe-1;return this._list[$]}}]),Ee}(),Me=function(){function Ee(se){Object(q.a)(this,Ee),this._type=se,this._list=[],this._lastAppendLocation=-1}return Object(ue.a)(Ee,[{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(H){var V=this._list;if(V.length===0)return-2;var $=V.length-1,ee=0,xe=0,Ue=$,$e=0;if(H<V[0].originalBeginDts)return $e=-1,$e;for(;xe<=Ue;)if(ee=xe+Math.floor((Ue-xe)/2),ee===$||H>V[ee].lastSample.originalDts&&H<V[ee+1].originalBeginDts){$e=ee;break}else V[ee].originalBeginDts<H?xe=ee+1:Ue=ee-1;return $e}},{key:"_searchNearestSegmentAfter",value:function(H){return this._searchNearestSegmentBefore(H)+1}},{key:"append",value:function(H){var V=this._list,$=H,ee=this._lastAppendLocation,xe=0;ee!==-1&&ee<V.length&&$.originalBeginDts>=V[ee].lastSample.originalDts&&(ee===V.length-1||ee<V.length-1&&$.originalBeginDts<V[ee+1].originalBeginDts)?xe=ee+1:V.length>0&&(xe=this._searchNearestSegmentBefore($.originalBeginDts)+1),this._lastAppendLocation=xe,this._list.splice(xe,0,$)}},{key:"getLastSegmentBefore",value:function(H){var V=this._searchNearestSegmentBefore(H);return V>=0?this._list[V]:null}},{key:"getLastSampleBefore",value:function(H){var V=this.getLastSegmentBefore(H);return V!=null?V.lastSample:null}},{key:"getLastSyncPointBefore",value:function(H){for(var V=this._searchNearestSegmentBefore(H),$=this._list[V].syncPoints;$.length===0&&V>0;)V--,$=this._list[V].syncPoints;return $.length>0?$[$.length-1]:null}}]),Ee}(),me=function(){function Ee(se){Object(q.a)(this,Ee),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 Me("audio"),this._videoSegmentInfoList=new Me("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(x.chrome&&(x.version.major<50||x.version.major===50&&x.version.build<2661)),this._fillSilentAfterSeek=x.msedge||x.msie,this._mp3UseMpegAudio=!x.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return Object(ue.a)(Ee,[{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(H){return H.onDataAvailable=this.remux.bind(this),H.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}},{key:"onInitSegment",get:function(){return this._onInitSegment},set:function(H){this._onInitSegment=H}},{key:"onMediaSegment",get:function(){return this._onMediaSegment},set:function(H){this._onMediaSegment=H}},{key:"insertDiscontinuity",value:function(){this._audioNextDts=this._videoNextDts=void 0}},{key:"seek",value:function(H){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}},{key:"remux",value:function(H,V){if(!this._onMediaSegment)throw new m("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(H,V),this._remuxVideo(V),this._remuxAudio(H)}},{key:"_onTrackMetadataReceived",value:function(H,V){var $=null,ee="mp4",xe=V.codec;if(H==="audio")this._audioMeta=V,V.codec==="mp3"&&this._mp3UseMpegAudio?(ee="mpeg",xe="",$=new Uint8Array):$=mt.generateInitSegment(V);else if(H==="video")this._videoMeta=V,$=mt.generateInitSegment(V);else return;if(!this._onInitSegment)throw new m("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(H,{type:H,data:$.buffer,codec:xe,container:"".concat(H,"/").concat(ee),mediaDuration:V.duration})}},{key:"_calculateDtsBase",value:function(H,V){if(this._dtsBaseInited)return;H.samples&&H.samples.length&&(this._audioDtsBase=H.samples[0].dts),V.samples&&V.samples.length&&(this._videoDtsBase=V.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0}},{key:"flushStashedSamples",value:function(){var H=this._videoStashedLastSample,V=this._audioStashedLastSample,$={type:"video",id:1,sequenceNumber:0,samples:[],length:0};H!=null&&($.samples.push(H),$.length=H.length);var ee={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};V!=null&&(ee.samples.push(V),ee.length=V.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo($,!0),this._remuxAudio(ee,!0)}},{key:"_remuxAudio",value:function(H,V){if(this._audioMeta==null)return;var $=H,ee=$.samples,xe=void 0,Ue=-1,$e=-1,pt=-1,xt=this._audioMeta.refSampleDuration,Ve=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,ht=this._dtsBaseInited&&this._audioNextDts===void 0,Rt=!1;if(!ee||ee.length===0)return;if(ee.length===1&&!V)return;var lt=0,Pt=null,Wt=0;Ve?(lt=0,Wt=$.length):(lt=8,Wt=8+$.length);var Bt=null;if(ee.length>1&&(Bt=ee.pop(),Wt-=Bt.length),this._audioStashedLastSample!=null){var wt=this._audioStashedLastSample;this._audioStashedLastSample=null,ee.unshift(wt),Wt+=wt.length}Bt!=null&&(this._audioStashedLastSample=Bt);var Q=ee[0].dts-this._dtsBase;if(this._audioNextDts)xe=Q-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())xe=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&(this._audioMeta.originalCodec!=="mp3"&&(Rt=!0));else{var k=this._audioSegmentInfoList.getLastSampleBefore(Q);if(k!=null){var U=Q-(k.originalDts+k.duration);U<=3&&(U=0);var X=k.dts+k.duration+U;xe=Q-X}else xe=0}if(Rt){var ie=Q-xe,J=this._videoSegmentInfoList.getLastSegmentBefore(Q);if(J!=null&&J.beginDts<ie){var Ae=Je.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(Ae){var tt=J.beginDts,kt=ie-J.beginDts;B.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat(tt,", duration: ").concat(kt)),ee.unshift({unit:Ae,dts:tt,pts:tt}),Wt+=Ae.byteLength}}else Rt=!1}for(var Mt=[],gt=0;gt<ee.length;gt++){var $t=ee[gt],mn=$t.unit,Mn=$t.dts-this._dtsBase,lr=Mn-xe;Ue===-1&&(Ue=lr);var Kn=0;if(gt!==ee.length-1){var ur=ee[gt+1].dts-this._dtsBase-xe;Kn=ur-lr}else if(Bt!=null){var dr=Bt.dts-this._dtsBase-xe;Kn=dr-lr}else Mt.length>=1?Kn=Mt[Mt.length-1].duration:Kn=Math.floor(xt);var hr=!1,Dr=null;if(Kn>xt*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!x.safari){hr=!0;var Cr=Math.abs(Kn-xt),Wn=Math.ceil(Cr/xt),Er=lr+xt;B.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.
`+"dts: ".concat(lr+Kn," ms, expected: ").concat(lr+Math.round(xt)," ms, ")+"delta: ".concat(Math.round(Cr)," ms, generate: ").concat(Wn," frames"));var zr=Je.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);zr==null&&(B.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),zr=mn),Dr=[];for(var vi=0;vi<Wn;vi++){var xr=Math.round(Er);if(Dr.length>0){var Zr=Dr[Dr.length-1];Zr.duration=xr-Zr.dts}var _i={dts:xr,pts:xr,cts:0,unit:zr,size:zr.byteLength,duration:0,originalDts:Mn,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};Dr.push(_i),Wt+=_i.size,Er+=xt}var yi=Dr[Dr.length-1];yi.duration=lr+Kn-yi.dts,Kn=Math.round(xt)}Mt.push({dts:lr,pts:lr,cts:0,unit:$t.unit,size:$t.unit.byteLength,duration:Kn,originalDts:Mn,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),hr&&Mt.push.apply(Mt,Dr)}Ve?Pt=new Uint8Array(Wt):(Pt=new Uint8Array(Wt),Pt[0]=Wt>>>24&255,Pt[1]=Wt>>>16&255,Pt[2]=Wt>>>8&255,Pt[3]=Wt&255,Pt.set(mt.types.mdat,4));for(var qr=0;qr<Mt.length;qr++){var di=Mt[qr].unit;Pt.set(di,lt),lt+=di.byteLength}var Pr=Mt[Mt.length-1];$e=Pr.dts+Pr.duration,this._audioNextDts=$e;var Nr=new De;Nr.beginDts=Ue,Nr.endDts=$e,Nr.beginPts=Ue,Nr.endPts=$e,Nr.originalBeginDts=Mt[0].originalDts,Nr.originalEndDts=Pr.originalDts+Pr.duration,Nr.firstSample=new et(Mt[0].dts,Mt[0].pts,Mt[0].duration,Mt[0].originalDts,!1),Nr.lastSample=new et(Pr.dts,Pr.pts,Pr.duration,Pr.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(Nr),$.samples=Mt,$.sequenceNumber++;var Sr=null;Ve?Sr=new Uint8Array:Sr=mt.moof($,Ue),$.samples=[],$.length=0;var Qn={type:"audio",data:this._mergeBoxes(Sr,Pt).buffer,sampleCount:Mt.length,info:Nr};Ve&&ht&&(Qn.timestampOffset=Ue),this._onMediaSegment("audio",Qn)}},{key:"_remuxVideo",value:function(H,V){if(this._videoMeta==null)return;var $=H,ee=$.samples,xe=void 0,Ue=-1,$e=-1,pt=-1,xt=-1;if(!ee||ee.length===0)return;if(ee.length===1&&!V)return;var Ve=8,ht=null,Rt=8+H.length,lt=null;if(ee.length>1&&(lt=ee.pop(),Rt-=lt.length),this._videoStashedLastSample!=null){var Pt=this._videoStashedLastSample;this._videoStashedLastSample=null,ee.unshift(Pt),Rt+=Pt.length}lt!=null&&(this._videoStashedLastSample=lt);var Wt=ee[0].dts-this._dtsBase;if(this._videoNextDts)xe=Wt-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())xe=0;else{var Bt=this._videoSegmentInfoList.getLastSampleBefore(Wt);if(Bt!=null){var wt=Wt-(Bt.originalDts+Bt.duration);wt<=3&&(wt=0);var Q=Bt.dts+Bt.duration+wt;xe=Wt-Q}else xe=0}for(var k=new De,U=[],X=0;X<ee.length;X++){var ie=ee[X],J=ie.dts-this._dtsBase,Ae=ie.isKeyframe,tt=J-xe,kt=ie.cts,Mt=tt+kt;Ue===-1&&(Ue=tt,pt=Mt);var gt=0;if(X!==ee.length-1){var $t=ee[X+1].dts-this._dtsBase-xe;gt=$t-tt}else if(lt!=null){var mn=lt.dts-this._dtsBase-xe;gt=mn-tt}else U.length>=1?gt=U[U.length-1].duration:gt=Math.floor(this._videoMeta.refSampleDuration);if(Ae){var Mn=new et(tt,Mt,gt,ie.dts,!0);Mn.fileposition=ie.fileposition,k.appendSyncPoint(Mn)}U.push({dts:tt,pts:Mt,cts:kt,units:ie.units,size:ie.length,isKeyframe:Ae,duration:gt,originalDts:J,flags:{isLeading:0,dependsOn:Ae?2:1,isDependedOn:Ae?1:0,hasRedundancy:0,isNonSync:Ae?0:1}})}ht=new Uint8Array(Rt),ht[0]=Rt>>>24&255,ht[1]=Rt>>>16&255,ht[2]=Rt>>>8&255,ht[3]=Rt&255,ht.set(mt.types.mdat,4);for(var lr=0;lr<U.length;lr++)for(var Kn=U[lr].units;Kn.length;){var ur=Kn.shift(),dr=ur.data;ht.set(dr,Ve),Ve+=dr.byteLength}var hr=U[U.length-1];if($e=hr.dts+hr.duration,xt=hr.pts+hr.duration,this._videoNextDts=$e,k.beginDts=Ue,k.endDts=$e,k.beginPts=pt,k.endPts=xt,k.originalBeginDts=U[0].originalDts,k.originalEndDts=hr.originalDts+hr.duration,k.firstSample=new et(U[0].dts,U[0].pts,U[0].duration,U[0].originalDts,U[0].isKeyframe),k.lastSample=new et(hr.dts,hr.pts,hr.duration,hr.originalDts,hr.isKeyframe),this._isLive||this._videoSegmentInfoList.append(k),$.samples=U,$.sequenceNumber++,this._forceFirstIDR){var Dr=U[0].flags;Dr.dependsOn=2,Dr.isNonSync=0}var Cr=mt.moof($,Ue);$.samples=[],$.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(Cr,ht).buffer,sampleCount:U.length,info:k})}},{key:"_mergeBoxes",value:function(H,V){var $=new Uint8Array(H.byteLength+V.byteLength);return $.set(H,0),$.set(V,H.byteLength),$}}]),Ee}(),Ce=me,Oe={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"},Se=Oe,Fe=function(){function Ee(se,H){Object(q.a)(this,Ee),this.TAG="TransmuxingController",this._emitter=new z.a,this._config=H,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 V=0;this._mediaDataSource.segments.forEach(function($){$.timestampBase=V,V+=$.duration,$.cors=se.cors,$.withCredentials=se.withCredentials,H.referrerPolicy&&($.referrerPolicy=H.referrerPolicy)}),!isNaN(V)&&this._mediaDataSource.duration!==V&&(this._mediaDataSource.duration=V),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return Object(ue.a)(Ee,[{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(H,V){this._emitter.addListener(H,V)}},{key:"off",value:function(H,V){this._emitter.removeListener(H,V)}},{key:"start",value:function(){this._loadSegment(0),this._enableStatisticsReporter()}},{key:"_loadSegment",value:function(H,V){this._currentSegmentIndex=H;var $=this._mediaDataSource.segments[H],ee=this._ioctl=new G($,this._config,H);ee.onError=this._onIOException.bind(this),ee.onSeeked=this._onIOSeeked.bind(this),ee.onComplete=this._onIOComplete.bind(this),ee.onRedirect=this._onIORedirect.bind(this),ee.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),V?this._demuxer.bindDataSource(this._ioctl):ee.onDataArrival=this._onInitChunkArrival.bind(this),ee.open(V)}},{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(H){if(this._mediaInfo==null||!this._mediaInfo.isSeekable())return;var V=this._searchSegmentIndexContains(H);if(V===this._currentSegmentIndex){var $=this._mediaInfo.segments[V];if($==null)this._pendingSeekTime=H;else{var ee=$.getNearestKeyframe(H);this._remuxer.seek(ee.milliseconds),this._ioctl.seek(ee.fileposition),this._pendingResolveSeekPoint=ee.milliseconds}}else{var xe=this._mediaInfo.segments[V];if(xe==null)this._pendingSeekTime=H,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(V);else{var Ue=xe.getNearestKeyframe(H);this._internalAbort(),this._remuxer.seek(H),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[V].timestampBase,this._loadSegment(V,Ue.fileposition),this._pendingResolveSeekPoint=Ue.milliseconds,this._reportSegmentMediaInfo(V)}}this._enableStatisticsReporter()}},{key:"_searchSegmentIndexContains",value:function(H){for(var V=this._mediaDataSource.segments,$=V.length-1,ee=0;ee<V.length;ee++)if(H<V[ee].timestampBase){$=ee-1;break}return $}},{key:"_onInitChunkArrival",value:function(H,V){var $=this,ee=null,xe=0;if(V>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,xe=this._demuxer.parseChunks(H,V);else if((ee=vt.probe(H)).match){this._demuxer=new vt(ee,this._config),this._remuxer||(this._remuxer=new Ce(this._config));var Ue=this._mediaDataSource;Ue.duration!=null&&!isNaN(Ue.duration)&&(this._demuxer.overridedDuration=Ue.duration),typeof Ue.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=Ue.hasAudio),typeof Ue.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=Ue.hasVideo),this._demuxer.timestampBase=Ue.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),xe=this._demuxer.parseChunks(H,V)}else ee=null,B.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(function(){$._internalAbort()}),this._emitter.emit(Se.DEMUX_ERROR,Pe.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),xe=0;return xe}},{key:"_onMediaInfo",value:function(H){var V=this;this._mediaInfo==null&&(this._mediaInfo=Object.assign({},H),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,ze.prototype));var $=Object.assign({},H);Object.setPrototypeOf($,ze.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=$,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var ee=V._pendingSeekTime;V._pendingSeekTime=null,V.seek(ee)})}},{key:"_onMetaDataArrived",value:function(H){this._emitter.emit(Se.METADATA_ARRIVED,H)}},{key:"_onScriptDataArrived",value:function(H){this._emitter.emit(Se.SCRIPTDATA_ARRIVED,H)}},{key:"_onIOSeeked",value:function(){this._remuxer.insertDiscontinuity()}},{key:"_onIOComplete",value:function(H){var V=H,$=V+1;$<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment($)):(this._remuxer.flushStashedSamples(),this._emitter.emit(Se.LOADING_COMPLETE),this._disableStatisticsReporter())}},{key:"_onIORedirect",value:function(H){var V=this._ioctl.extraData;this._mediaDataSource.segments[V].redirectedURL=H}},{key:"_onIORecoveredEarlyEof",value:function(){this._emitter.emit(Se.RECOVERED_EARLY_EOF)}},{key:"_onIOException",value:function(H,V){B.e(this.TAG,"IOException: type = ".concat(H,", code = ").concat(V.code,", msg = ").concat(V.msg)),this._emitter.emit(Se.IO_ERROR,H,V),this._disableStatisticsReporter()}},{key:"_onDemuxException",value:function(H,V){B.e(this.TAG,"DemuxException: type = ".concat(H,", info = ").concat(V)),this._emitter.emit(Se.DEMUX_ERROR,H,V)}},{key:"_onRemuxerInitSegmentArrival",value:function(H,V){this._emitter.emit(Se.INIT_SEGMENT,H,V)}},{key:"_onRemuxerMediaSegmentArrival",value:function(H,V){if(this._pendingSeekTime!=null)return;if(this._emitter.emit(Se.MEDIA_SEGMENT,H,V),this._pendingResolveSeekPoint!=null&&H==="video"){var $=V.info.syncPoints,ee=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,x.safari&&$.length>0&&$[0].originalDts===ee&&(ee=$[0].pts),this._emitter.emit(Se.RECOMMEND_SEEKPOINT,ee)}}},{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(H){var V=this._mediaInfo.segments[H],$=Object.assign({},V);$.duration=this._mediaInfo.duration,$.segmentCount=this._mediaInfo.segmentCount,delete $.segments,delete $.keyframesIndex,this._emitter.emit(Se.MEDIA_INFO,$)}},{key:"_reportStatisticsInfo",value:function(){var H={};H.url=this._ioctl.currentURL,H.hasRedirect=this._ioctl.hasRedirect,H.hasRedirect&&(H.redirectedURL=this._ioctl.currentRedirectedURL),H.speed=this._ioctl.currentSpeed,H.loaderType=this._ioctl.loaderType,H.currentSegmentIndex=this._currentSegmentIndex,H.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(Se.STATISTICS_INFO,H)}}]),Ee}(),it=Fe,Ie=function(se){var H="TransmuxingWorker",V=null,$=Wt.bind(this);fe.install(),se.addEventListener("message",function(Bt){switch(Bt.data.cmd){case"init":V=new it(Bt.data.param[0],Bt.data.param[1]),V.on(Se.IO_ERROR,Rt.bind(this)),V.on(Se.DEMUX_ERROR,lt.bind(this)),V.on(Se.INIT_SEGMENT,ee.bind(this)),V.on(Se.MEDIA_SEGMENT,xe.bind(this)),V.on(Se.LOADING_COMPLETE,Ue.bind(this)),V.on(Se.RECOVERED_EARLY_EOF,$e.bind(this)),V.on(Se.MEDIA_INFO,pt.bind(this)),V.on(Se.METADATA_ARRIVED,xt.bind(this)),V.on(Se.SCRIPTDATA_ARRIVED,Ve.bind(this)),V.on(Se.STATISTICS_INFO,ht.bind(this)),V.on(Se.RECOMMEND_SEEKPOINT,Pt.bind(this));break;case"destroy":V&&(V.destroy(),V=null),se.postMessage({msg:"destroyed"});break;case"start":V.start();break;case"stop":V.stop();break;case"seek":V.seek(Bt.data.param);break;case"pause":V.pause();break;case"resume":V.resume();break;case"logging_config":{var wt=Bt.data.param;ge.applyConfig(wt),wt.enableCallback===!0?ge.addLogListener($):ge.removeLogListener($);break}}});function ee(Bt,wt){var Q={msg:Se.INIT_SEGMENT,data:{type:Bt,data:wt}};se.postMessage(Q,[wt.data])}function xe(Bt,wt){var Q={msg:Se.MEDIA_SEGMENT,data:{type:Bt,data:wt}};se.postMessage(Q,[wt.data])}function Ue(){var Bt={msg:Se.LOADING_COMPLETE};se.postMessage(Bt)}function $e(){var Bt={msg:Se.RECOVERED_EARLY_EOF};se.postMessage(Bt)}function pt(Bt){var wt={msg:Se.MEDIA_INFO,data:Bt};se.postMessage(wt)}function xt(Bt){var wt={msg:Se.METADATA_ARRIVED,data:Bt};se.postMessage(wt)}function Ve(Bt){var wt={msg:Se.SCRIPTDATA_ARRIVED,data:Bt};se.postMessage(wt)}function ht(Bt){var wt={msg:Se.STATISTICS_INFO,data:Bt};se.postMessage(wt)}function Rt(Bt,wt){se.postMessage({msg:Se.IO_ERROR,data:{type:Bt,info:wt}})}function lt(Bt,wt){se.postMessage({msg:Se.DEMUX_ERROR,data:{type:Bt,info:wt}})}function Pt(Bt){se.postMessage({msg:Se.RECOMMEND_SEEKPOINT,data:Bt})}function Wt(Bt,wt){se.postMessage({msg:"logcat_callback",data:{type:Bt,logcat:wt}})}},Qe=Ie,rt=function(){function Ee(se,H){if(Object(q.a)(this,Ee),this.TAG="Transmuxer",this._emitter=new z.a,H.enableWorker&&typeof Worker!="undefined")try{var V=M("0r65");this._worker=V(Qe),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[se,H]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},ge.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:ge.getConfig()})}catch(ee){B.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new it(se,H)}else this._controller=new it(se,H);if(this._controller){var $=this._controller;$.on(Se.IO_ERROR,this._onIOError.bind(this)),$.on(Se.DEMUX_ERROR,this._onDemuxError.bind(this)),$.on(Se.INIT_SEGMENT,this._onInitSegment.bind(this)),$.on(Se.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),$.on(Se.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),$.on(Se.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),$.on(Se.MEDIA_INFO,this._onMediaInfo.bind(this)),$.on(Se.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),$.on(Se.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),$.on(Se.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),$.on(Se.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return Object(ue.a)(Ee,[{key:"destroy",value:function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),ge.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(H,V){this._emitter.addListener(H,V)}},{key:"off",value:function(H,V){this._emitter.removeListener(H,V)}},{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(H){this._worker?this._worker.postMessage({cmd:"seek",param:H}):this._controller.seek(H)}},{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(H,V){var $=this;Promise.resolve().then(function(){$._emitter.emit(Se.INIT_SEGMENT,H,V)})}},{key:"_onMediaSegment",value:function(H,V){var $=this;Promise.resolve().then(function(){$._emitter.emit(Se.MEDIA_SEGMENT,H,V)})}},{key:"_onLoadingComplete",value:function(){var H=this;Promise.resolve().then(function(){H._emitter.emit(Se.LOADING_COMPLETE)})}},{key:"_onRecoveredEarlyEof",value:function(){var H=this;Promise.resolve().then(function(){H._emitter.emit(Se.RECOVERED_EARLY_EOF)})}},{key:"_onMediaInfo",value:function(H){var V=this;Promise.resolve().then(function(){V._emitter.emit(Se.MEDIA_INFO,H)})}},{key:"_onMetaDataArrived",value:function(H){var V=this;Promise.resolve().then(function(){V._emitter.emit(Se.METADATA_ARRIVED,H)})}},{key:"_onScriptDataArrived",value:function(H){var V=this;Promise.resolve().then(function(){V._emitter.emit(Se.SCRIPTDATA_ARRIVED,H)})}},{key:"_onStatisticsInfo",value:function(H){var V=this;Promise.resolve().then(function(){V._emitter.emit(Se.STATISTICS_INFO,H)})}},{key:"_onIOError",value:function(H,V){var $=this;Promise.resolve().then(function(){$._emitter.emit(Se.IO_ERROR,H,V)})}},{key:"_onDemuxError",value:function(H,V){var $=this;Promise.resolve().then(function(){$._emitter.emit(Se.DEMUX_ERROR,H,V)})}},{key:"_onRecommendSeekpoint",value:function(H){var V=this;Promise.resolve().then(function(){V._emitter.emit(Se.RECOMMEND_SEEKPOINT,H)})}},{key:"_onLoggingConfigChanged",value:function(H){this._worker&&this._worker.postMessage({cmd:"logging_config",param:H})}},{key:"_onWorkerMessage",value:function(H){var V=H.data,$=V.data;if(V.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(V.msg){case Se.INIT_SEGMENT:case Se.MEDIA_SEGMENT:this._emitter.emit(V.msg,$.type,$.data);break;case Se.LOADING_COMPLETE:case Se.RECOVERED_EARLY_EOF:this._emitter.emit(V.msg);break;case Se.MEDIA_INFO:Object.setPrototypeOf($,ze.prototype),this._emitter.emit(V.msg,$);break;case Se.METADATA_ARRIVED:case Se.SCRIPTDATA_ARRIVED:case Se.STATISTICS_INFO:this._emitter.emit(V.msg,$);break;case Se.IO_ERROR:case Se.DEMUX_ERROR:this._emitter.emit(V.msg,$.type,$.info);break;case Se.RECOMMEND_SEEKPOINT:this._emitter.emit(V.msg,$);break;case"logcat_callback":B.emitter.emit("log",$.type,$.logcat);break;default:break}}}]),Ee}(),ft=rt,It={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"},Tt=It,Et=function(){function Ee(se){Object(q.a)(this,Ee),this.TAG="MSEController",this._config=se,this._emitter=new z.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 ke}return Object(ue.a)(Ee,[{key:"destroy",value:function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(H,V){this._emitter.addListener(H,V)}},{key:"off",value:function(H,V){this._emitter.removeListener(H,V)}},{key:"attachMediaElement",value:function(H){if(this._mediaSource)throw new m("MediaSource has been attached to an HTMLMediaElement!");var V=this._mediaSource=new window.MediaSource;V.addEventListener("sourceopen",this.e.onSourceOpen),V.addEventListener("sourceended",this.e.onSourceEnded),V.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=H,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),H.src=this._mediaSourceObjectURL}},{key:"detachMediaElement",value:function(){if(this._mediaSource){var H=this._mediaSource;for(var V in this._sourceBuffers){var $=this._pendingSegments[V];$.splice(0,$.length),this._pendingSegments[V]=null,this._pendingRemoveRanges[V]=null,this._lastInitSegments[V]=null;var ee=this._sourceBuffers[V];if(ee){if(H.readyState!=="closed"){try{H.removeSourceBuffer(ee)}catch(xe){B.e(this.TAG,xe.message)}ee.removeEventListener("error",this.e.onSourceBufferError),ee.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[V]=null,this._sourceBuffers[V]=null}}if(H.readyState==="open")try{H.endOfStream()}catch(xe){B.e(this.TAG,xe.message)}H.removeEventListener("sourceopen",this.e.onSourceOpen),H.removeEventListener("sourceended",this.e.onSourceEnded),H.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(H,V){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(H),this._pendingSegments[H.type].push(H);return}var $=H,ee="".concat($.container);$.codec&&$.codec.length>0&&(ee+=";codecs=".concat($.codec));var xe=!1;if(B.v(this.TAG,"Received Initialization Segment, mimeType: "+ee),this._lastInitSegments[$.type]=$,ee!==this._mimeTypes[$.type]){if(this._mimeTypes[$.type])B.v(this.TAG,"Notice: ".concat($.type," mimeType changed, origin: ").concat(this._mimeTypes[$.type],", target: ").concat(ee));else{xe=!0;try{var Ue=this._sourceBuffers[$.type]=this._mediaSource.addSourceBuffer(ee);Ue.addEventListener("error",this.e.onSourceBufferError),Ue.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch($e){B.e(this.TAG,$e.message),this._emitter.emit(Tt.ERROR,{code:$e.code,msg:$e.message});return}}this._mimeTypes[$.type]=ee}V||this._pendingSegments[$.type].push($),xe||this._sourceBuffers[$.type]&&!this._sourceBuffers[$.type].updating&&this._doAppendSegments(),x.safari&&$.container==="audio/mpeg"&&$.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=$.mediaDuration/1e3,this._updateMediaSourceDuration())}},{key:"appendMediaSegment",value:function(H){var V=H;this._pendingSegments[V.type].push(V),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var $=this._sourceBuffers[V.type];$&&!$.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}},{key:"seek",value:function(H){for(var V in this._sourceBuffers){if(!this._sourceBuffers[V])continue;var $=this._sourceBuffers[V];if(this._mediaSource.readyState==="open")try{$.abort()}catch(xt){B.e(this.TAG,xt.message)}this._idrList.clear();var ee=this._pendingSegments[V];if(ee.splice(0,ee.length),this._mediaSource.readyState==="closed")continue;for(var xe=0;xe<$.buffered.length;xe++){var Ue=$.buffered.start(xe),$e=$.buffered.end(xe);this._pendingRemoveRanges[V].push({start:Ue,end:$e})}if($.updating||this._doRemoveRanges(),x.safari){var pt=this._lastInitSegments[V];pt&&(this._pendingSegments[V].push(pt),$.updating||this._doAppendSegments())}}}},{key:"endOfStream",value:function(){var H=this._mediaSource,V=this._sourceBuffers;if(!H||H.readyState!=="open"){H&&H.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0);return}V.video&&V.video.updating||V.audio&&V.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,H.endOfStream())}},{key:"getNearestKeyframe",value:function(H){return this._idrList.getLastSyncPointBeforeDts(H)}},{key:"_needCleanupSourceBuffer",value:function(){if(!this._config.autoCleanupSourceBuffer)return!1;var H=this._mediaElement.currentTime;for(var V in this._sourceBuffers){var $=this._sourceBuffers[V];if($){var ee=$.buffered;if(ee.length>=1&&H-ee.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}},{key:"_doCleanupSourceBuffer",value:function(){var H=this._mediaElement.currentTime;for(var V in this._sourceBuffers){var $=this._sourceBuffers[V];if($){for(var ee=$.buffered,xe=!1,Ue=0;Ue<ee.length;Ue++){var $e=ee.start(Ue),pt=ee.end(Ue);if($e<=H&&H<pt+3){if(H-$e>=this._config.autoCleanupMaxBackwardDuration){xe=!0;var xt=H-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[V].push({start:$e,end:xt})}}else pt<H&&(xe=!0,this._pendingRemoveRanges[V].push({start:$e,end:pt}))}xe&&!$.updating&&this._doRemoveRanges()}}}},{key:"_updateMediaSourceDuration",value:function(){var H=this._sourceBuffers;if(this._mediaElement.readyState===0||this._mediaSource.readyState!=="open")return;if(H.video&&H.video.updating||H.audio&&H.audio.updating)return;var V=this._mediaSource.duration,$=this._pendingMediaDuration;$>0&&(isNaN(V)||$>V)&&(B.v(this.TAG,"Update MediaSource duration from ".concat(V," to ").concat($)),this._mediaSource.duration=$),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},{key:"_doRemoveRanges",value:function(){for(var H in this._pendingRemoveRanges){if(!this._sourceBuffers[H]||this._sourceBuffers[H].updating)continue;for(var V=this._sourceBuffers[H],$=this._pendingRemoveRanges[H];$.length&&!V.updating;){var ee=$.shift();V.remove(ee.start,ee.end)}}}},{key:"_doAppendSegments",value:function(){var H=this._pendingSegments;for(var V in H){if(!this._sourceBuffers[V]||this._sourceBuffers[V].updating)continue;if(H[V].length>0){var $=H[V].shift();if($.timestampOffset){var ee=this._sourceBuffers[V].timestampOffset,xe=$.timestampOffset/1e3,Ue=Math.abs(ee-xe);Ue>.1&&(B.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(ee," to ").concat(xe)),this._sourceBuffers[V].timestampOffset=xe),delete $.timestampOffset}if(!$.data||$.data.byteLength===0)continue;try{this._sourceBuffers[V].appendBuffer($.data),this._isBufferFull=!1,V==="video"&&$.hasOwnProperty("info")&&this._idrList.appendArray($.info.syncPoints)}catch($e){this._pendingSegments[V].unshift($),$e.code===22?(this._isBufferFull||this._emitter.emit(Tt.BUFFER_FULL),this._isBufferFull=!0):(B.e(this.TAG,$e.message),this._emitter.emit(Tt.ERROR,{code:$e.code,msg:$e.message}))}}}}},{key:"_onSourceOpen",value:function(){if(B.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var H=this._pendingSourceBufferInit;H.length;){var V=H.shift();this.appendInitSegment(V,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(Tt.SOURCE_OPEN)}},{key:"_onSourceEnded",value:function(){B.v(this.TAG,"MediaSource onSourceEnded")}},{key:"_onSourceClose",value:function(){B.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 H=this._pendingSegments;return H.video.length>0||H.audio.length>0}},{key:"_hasPendingRemoveRanges",value:function(){var H=this._pendingRemoveRanges;return H.video.length>0||H.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(Tt.UPDATE_END)}},{key:"_onSourceBufferError",value:function(H){B.e(this.TAG,"SourceBuffer Error: ".concat(H))}}]),Ee}(),Ct=Et,dt={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},Nt={NETWORK_EXCEPTION:_.EXCEPTION,NETWORK_STATUS_CODE_INVALID:_.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:_.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:_.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:Pe.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:Pe.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:Pe.CODEC_UNSUPPORTED},Xt=function(){function Ee(se,H){if(Object(q.a)(this,Ee),this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new z.a,this._config=te(),typeof H=="object"&&Object.assign(this._config,H),se.type.toLowerCase()!=="flv")throw new s("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 V=x.chrome&&(x.version.major<50||x.version.major===50&&x.version.build<2661);this._alwaysSeekKeyframe=!!(V||x.msedge||x.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return Object(ue.a)(Ee,[{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(H,V){var $=this;H===Re.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(function(){$._emitter.emit(Re.MEDIA_INFO,$.mediaInfo)}):H===Re.STATISTICS_INFO&&(this._statisticsInfo!=null&&Promise.resolve().then(function(){$._emitter.emit(Re.STATISTICS_INFO,$.statisticsInfo)})),this._emitter.addListener(H,V)}},{key:"off",value:function(H,V){this._emitter.removeListener(H,V)}},{key:"attachMediaElement",value:function(H){var V=this;if(this._mediaElement=H,H.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),H.addEventListener("seeking",this.e.onvSeeking),H.addEventListener("canplay",this.e.onvCanPlay),H.addEventListener("stalled",this.e.onvStalled),H.addEventListener("progress",this.e.onvProgress),this._msectl=new Ct(this._config),this._msectl.on(Tt.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(Tt.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(Tt.SOURCE_OPEN,function(){V._mseSourceOpened=!0,V._hasPendingLoad&&(V._hasPendingLoad=!1,V.load())}),this._msectl.on(Tt.ERROR,function($){V._emitter.emit(Re.ERROR,dt.MEDIA_ERROR,Nt.MEDIA_MSE_ERROR,$)}),this._msectl.attachMediaElement(H),this._pendingSeekTime!=null)try{H.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch($){}}},{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 H=this;if(!this._mediaElement)throw new m("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new m("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 ft(this._mediaDataSource,this._config),this._transmuxer.on(Se.INIT_SEGMENT,function(V,$){H._msectl.appendInitSegment($)}),this._transmuxer.on(Se.MEDIA_SEGMENT,function(V,$){if(H._msectl.appendMediaSegment($),H._config.lazyLoad&&!H._config.isLive){var ee=H._mediaElement.currentTime;$.info.endDts>=(ee+H._config.lazyLoadMaxDuration)*1e3&&(H._progressChecker==null&&(B.v(H.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),H._suspendTransmuxer()))}}),this._transmuxer.on(Se.LOADING_COMPLETE,function(){H._msectl.endOfStream(),H._emitter.emit(Re.LOADING_COMPLETE)}),this._transmuxer.on(Se.RECOVERED_EARLY_EOF,function(){H._emitter.emit(Re.RECOVERED_EARLY_EOF)}),this._transmuxer.on(Se.IO_ERROR,function(V,$){H._emitter.emit(Re.ERROR,dt.NETWORK_ERROR,V,$)}),this._transmuxer.on(Se.DEMUX_ERROR,function(V,$){H._emitter.emit(Re.ERROR,dt.MEDIA_ERROR,V,{code:-1,msg:$})}),this._transmuxer.on(Se.MEDIA_INFO,function(V){H._mediaInfo=V,H._emitter.emit(Re.MEDIA_INFO,Object.assign({},V))}),this._transmuxer.on(Se.METADATA_ARRIVED,function(V){H._emitter.emit(Re.METADATA_ARRIVED,V)}),this._transmuxer.on(Se.SCRIPTDATA_ARRIVED,function(V){H._emitter.emit(Re.SCRIPTDATA_ARRIVED,V)}),this._transmuxer.on(Se.STATISTICS_INFO,function(V){H._statisticsInfo=H._fillStatisticsInfo(V),H._emitter.emit(Re.STATISTICS_INFO,Object.assign({},H._statisticsInfo))}),this._transmuxer.on(Se.RECOMMEND_SEEKPOINT,function(V){H._mediaElement&&!H._config.accurateSeek&&(H._requestSetTime=!0,H._mediaElement.currentTime=V/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(H){this._mediaElement.volume=H}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(H){this._mediaElement.muted=H}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(H){this._mediaElement?this._internalSeek(H):this._pendingSeekTime=H}},{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(H){if(H.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return H;var V=!0,$=0,ee=0;if(this._mediaElement.getVideoPlaybackQuality){var xe=this._mediaElement.getVideoPlaybackQuality();$=xe.totalVideoFrames,ee=xe.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?($=this._mediaElement.webkitDecodedFrameCount,ee=this._mediaElement.webkitDroppedFrameCount):V=!1;return V&&(H.decodedFrames=$,H.droppedFrames=ee),H}},{key:"_onmseUpdateEnd",value:function(){if(!this._config.lazyLoad||this._config.isLive)return;for(var H=this._mediaElement.buffered,V=this._mediaElement.currentTime,$=0,ee=0,xe=0;xe<H.length;xe++){var Ue=H.start(xe),$e=H.end(xe);if(Ue<=V&&V<$e){$=Ue,ee=$e;break}}ee>=V+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(B.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},{key:"_onmseBufferFull",value:function(){B.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 H=this._mediaElement.currentTime,V=this._mediaElement.buffered,$=!1,ee=0;ee<V.length;ee++){var xe=V.start(ee),Ue=V.end(ee);if(H>=xe&&H<Ue){H>=Ue-this._config.lazyLoadRecoverDuration&&($=!0);break}}$&&(window.clearInterval(this._progressChecker),this._progressChecker=null,$&&(B.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}},{key:"_isTimepointBuffered",value:function(H){for(var V=this._mediaElement.buffered,$=0;$<V.length;$++){var ee=V.start($),xe=V.end($);if(H>=ee&&H<xe)return!0}return!1}},{key:"_internalSeek",value:function(H){var V=this._isTimepointBuffered(H),$=!1,ee=0;if(H<1&&this._mediaElement.buffered.length>0){var xe=this._mediaElement.buffered.start(0);(xe<1&&H<xe||x.safari)&&($=!0,ee=x.safari?.1:xe)}if($)this._requestSetTime=!0,this._mediaElement.currentTime=ee;else if(V){if(!this._alwaysSeekKeyframe)this._requestSetTime=!0,this._mediaElement.currentTime=H;else{var Ue=this._msectl.getNearestKeyframe(Math.floor(H*1e3));this._requestSetTime=!0,Ue!=null?this._mediaElement.currentTime=Ue.dts/1e3:this._mediaElement.currentTime=H}this._progressChecker!=null&&this._checkProgressAndResume()}else this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(H),this._transmuxer.seek(Math.floor(H*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=H)}},{key:"_checkAndApplyUnbufferedSeekpoint",value:function(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){var H=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(H)||(this._progressChecker!=null&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(H),this._transmuxer.seek(Math.floor(H*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=H))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},{key:"_checkAndResumeStuckPlayback",value:function(H){var V=this._mediaElement;if(H||!this._receivedCanPlay||V.readyState<2){var $=V.buffered;$.length>0&&V.currentTime<$.start(0)&&(B.w(this.TAG,"Playback seems stuck at ".concat(V.currentTime,", seek to ").concat($.start(0))),this._requestSetTime=!0,this._mediaElement.currentTime=$.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)}},{key:"_onvLoadedMetadata",value:function(H){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)}},{key:"_onvSeeking",value:function(H){var V=this._mediaElement.currentTime,$=this._mediaElement.buffered;if(this._requestSetTime){this._requestSetTime=!1;return}if(V<1&&$.length>0){var ee=$.start(0);if(ee<1&&V<ee||x.safari){this._requestSetTime=!0,this._mediaElement.currentTime=x.safari?.1:ee;return}}if(this._isTimepointBuffered(V)){if(this._alwaysSeekKeyframe){var xe=this._msectl.getNearestKeyframe(Math.floor(V*1e3));xe!=null&&(this._requestSetTime=!0,this._mediaElement.currentTime=xe.dts/1e3)}this._progressChecker!=null&&this._checkProgressAndResume();return}this._seekpointRecord={seekPoint:V,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},{key:"_onvCanPlay",value:function(H){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)}},{key:"_onvStalled",value:function(H){this._checkAndResumeStuckPlayback(!0)}},{key:"_onvProgress",value:function(H){this._checkAndResumeStuckPlayback()}}]),Ee}(),Dt=Xt,an=function(){function Ee(se,H){if(Object(q.a)(this,Ee),this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new z.a,this._config=te(),typeof H=="object"&&Object.assign(this._config,H),se.type.toLowerCase()==="flv")throw new s("NativePlayer does't support flv MediaDataSource input!");if(se.hasOwnProperty("segments"))throw new s("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(ue.a)(Ee,[{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(H,V){var $=this;H===Re.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){$._emitter.emit(Re.MEDIA_INFO,$.mediaInfo)}):H===Re.STATISTICS_INFO&&(this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){$._emitter.emit(Re.STATISTICS_INFO,$.statisticsInfo)})),this._emitter.addListener(H,V)}},{key:"off",value:function(H,V){this._emitter.removeListener(H,V)}},{key:"attachMediaElement",value:function(H){if(this._mediaElement=H,H.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{H.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(V){}}},{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 m("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(H){this._mediaElement.volume=H}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(H){this._mediaElement.muted=H}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(H){this._mediaElement?this._mediaElement.currentTime=H:this._pendingSeekTime=H}},{key:"mediaInfo",get:function(){var H=this._mediaElement instanceof HTMLAudioElement?"audio/":"video/",V={mimeType:H+this._mediaDataSource.type};return this._mediaElement&&(V.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(V.width=this._mediaElement.videoWidth,V.height=this._mediaElement.videoHeight)),V}},{key:"statisticsInfo",get:function(){var H={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return H;var V=!0,$=0,ee=0;if(this._mediaElement.getVideoPlaybackQuality){var xe=this._mediaElement.getVideoPlaybackQuality();$=xe.totalVideoFrames,ee=xe.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?($=this._mediaElement.webkitDecodedFrameCount,ee=this._mediaElement.webkitDroppedFrameCount):V=!1;return V&&(H.decodedFrames=$,H.droppedFrames=ee),H}},{key:"_onvLoadedMetadata",value:function(H){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(Re.MEDIA_INFO,this.mediaInfo)}},{key:"_reportStatisticsInfo",value:function(){this._emitter.emit(Re.STATISTICS_INFO,this.statisticsInfo)}}]),Ee}(),nn=an;fe.install();function An(Ee,se){var H=Ee;if(H==null||typeof H!="object")throw new s("MediaDataSource must be an javascript object!");if(!H.hasOwnProperty("type"))throw new s("MediaDataSource must has type field to indicate video file type!");switch(H.type){case"flv":return new Dt(H,se);default:return new nn(H,se)}}function _n(){return ve.supportMSEH264Playback()}function At(){return ve.getFeatureList()}var jt={};jt.createPlayer=An,jt.isSupported=_n,jt.getFeatureList=At,jt.BaseLoader=r,jt.LoaderStatus=h,jt.LoaderErrors=_,jt.Events=Re,jt.ErrorTypes=dt,jt.ErrorDetails=Nt,jt.FlvPlayer=Dt,jt.NativePlayer=nn,jt.LoggingControl=ge,Object.defineProperty(jt,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var on=ce.a=jt},GcTH:function(We,ce){const M=/[&<>"']/,q=/[&<>"']/g,ue=/[<>"']|&(?!#?\w+;)/,re=/[<>"']|&(?!#?\w+;)/g,fe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ae=x=>fe[x];function z(x,P){if(P){if(M.test(x))return x.replace(q,ae)}else if(ue.test(x))return x.replace(re,ae);return x}const R=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function B(x){return x.replace(R,(P,T)=>(T=T.toLowerCase(),T==="colon"?":":T.charAt(0)==="#"?T.charAt(1)==="x"?String.fromCharCode(parseInt(T.substring(2),16)):String.fromCharCode(+T.substring(1)):""))}const n=/(^|[^\[])\^/g;function W(x,P){x=x.source||x,P=P||"";const T={replace:(A,b)=>(b=b.source||b,b=b.replace(n,"$1"),x=x.replace(A,b),T),getRegex:()=>new RegExp(x,P)};return T}const D=/[^\w:]/g,N=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function d(x,P,T){if(x){let A;try{A=decodeURIComponent(B(T)).replace(D,"").toLowerCase()}catch(b){return null}if(A.indexOf("javascript:")===0||A.indexOf("vbscript:")===0||A.indexOf("data:")===0)return null}P&&!N.test(T)&&(T=_(P,T));try{T=encodeURI(T).replace(/%25/g,"%")}catch(A){return null}return T}const m={},s=/^[^:]+:\/*[^/]*$/,g=/^([^:]+:)[\s\S]*$/,h=/^([^:]+:\/*[^/]*)[\s\S]*$/;function _(x,P){m[" "+x]||(s.test(x)?m[" "+x]=x+"/":m[" "+x]=w(x,"/",!0)),x=m[" "+x];const T=x.indexOf(":")===-1;return P.substring(0,2)==="//"?T?P:x.replace(g,"$1")+P:P.charAt(0)==="/"?T?P:x.replace(h,"$1")+P:x+P}const r={exec:function(){}};function v(x){let P=1,T,A;for(;P<arguments.length;P++){T=arguments[P];for(A in T)Object.prototype.hasOwnProperty.call(T,A)&&(x[A]=T[A])}return x}function S(x,P){const T=x.replace(/\|/g,(C,p,i)=>{let f=!1,o=p;for(;--o>=0&&i[o]==="\\";)f=!f;return f?"|":" |"}),A=T.split(/ \|/);let b=0;if(A.length>P)A.splice(P);else for(;A.length<P;)A.push("");for(;b<A.length;b++)A[b]=A[b].trim().replace(/\\\|/g,"|");return A}function w(x,P,T){const A=x.length;if(A===0)return"";let b=0;for(;b<A;){const C=x.charAt(A-b-1);if(C===P&&!T)b++;else if(C!==P&&T)b++;else break}return x.substr(0,A-b)}function I(x,P){if(x.indexOf(P[1])===-1)return-1;const T=x.length;let A=0,b=0;for(;b<T;b++)if(x[b]==="\\")b++;else if(x[b]===P[0])A++;else if(x[b]===P[1]&&(A--,A<0))return b;return-1}function E(x){x&&x.sanitize&&!x.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")}We.exports={escape:z,unescape:B,edit:W,cleanUrl:d,resolveUrl:_,noopTest:r,merge:v,splitCells:S,rtrim:w,findClosingBracket:I,checkSanitizeDeprecation:E}},GgEA:function(We,ce,M){},Gq82:function(We,ce,M){"use strict";M.d(ce,"a",function(){return d});var q=M("XjgL"),ue=M("aVTQ"),re=M("6ASS"),fe=M("fNpE"),ae=M("T/Jt"),z=M.n(ae),R=M("B/uU"),B=M("qoVz"),n=M("+E2i"),W=M("VUat"),D=["children"],N=["fixed"];function d(_){return Object(B.a)(_).filter(function(r){return ae.isValidElement(r)}).map(function(r){var v=r.key,S=r.props,w=S.children,I=Object(fe.a)(S,D),E=Object(re.a)({key:v},I);return w&&(E.children=d(w)),E})}function m(_){return _.reduce(function(r,v){var S=v.fixed,w=S===!0?"left":S,I=v.children;return I&&I.length>0?[].concat(Object(ue.a)(r),Object(ue.a)(m(I).map(function(E){return Object(re.a)({fixed:w},E)}))):[].concat(Object(ue.a)(r),[Object(re.a)(Object(re.a)({},v),{},{fixed:w})])},[])}function s(_){for(var r=!0,v=0;v<_.length;v+=1){var S=_[v];if(r&&S.fixed!=="left")r=!1;else if(!r&&S.fixed==="left"){Object(R.a)(!1,"Index ".concat(v-1," of `columns` missing `fixed='left'` prop."));break}}for(var w=!0,I=_.length-1;I>=0;I-=1){var E=_[I];if(w&&E.fixed!=="right")w=!1;else if(!w&&E.fixed==="right"){Object(R.a)(!1,"Index ".concat(I+1," of `columns` missing `fixed='right'` prop."));break}}}function g(_){return _.map(function(r){var v=r.fixed,S=Object(fe.a)(r,N),w=v;return v==="left"?w="right":v==="right"&&(w="left"),Object(re.a)({fixed:w},S)})}function h(_,r){var v=_.prefixCls,S=_.columns,w=_.children,I=_.expandable,E=_.expandedKeys,x=_.columnTitle,P=_.getRowKey,T=_.onTriggerExpand,A=_.expandIcon,b=_.rowExpandable,C=_.expandIconColumnIndex,p=_.direction,i=_.expandRowByClick,f=_.columnWidth,o=_.fixed,a=ae.useMemo(function(){return S||d(w)},[S,w]),L=ae.useMemo(function(){if(I){var F,j=a.slice();if(!j.includes(W.a)){var G=C||0;G>=0&&j.splice(G,0,W.a)}var Y=j.indexOf(W.a);j=j.filter(function(he,Re){return he!==W.a||Re===Y});var te=a[Y],de;(o==="left"||o)&&!C?de="left":(o==="right"||o)&&C===a.length?de="right":de=te?te.fixed:null;var ve=(F={},Object(q.a)(F,n.a,{className:"".concat(v,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),Object(q.a)(F,"title",x),Object(q.a)(F,"fixed",de),Object(q.a)(F,"className","".concat(v,"-row-expand-icon-cell")),Object(q.a)(F,"width",f),Object(q.a)(F,"render",function(Re,we,ge){var Ne=P(we,ge),ze=E.has(Ne),nt=b?b(we):!0,Ge=A({prefixCls:v,expanded:ze,expandable:nt,record:we,onExpand:T});return i?ae.createElement("span",{onClick:function(Be){return Be.stopPropagation()}},Ge):Ge}),F);return j.map(function(he){return he===W.a?ve:he})}return a.filter(function(he){return he!==W.a})},[I,a,P,E,A,p]),y=ae.useMemo(function(){var F=L;return r&&(F=r(F)),F.length||(F=[{render:function(){return null}}]),F},[r,L,p]),l=ae.useMemo(function(){return p==="rtl"?g(m(y)):m(y)},[y,p]);return[y,l]}ce.b=h},HmJG:function(We,ce,M){},Hw79:function(We,ce,M){We.exports={pagination:"pagination___2VQzP",info:"info___1saw2"}},IEJz:function(We,ce,M){"use strict";function q(ue){return null}ce.a=q},IxHN:function(We,ce,M){"use strict";var q=M("T/Jt"),ue=M.n(q),re=M("07cG"),fe=M.n(re);ce.a=function(ae){var z=ae.message,R=ae.className,B=ae.children,n=ae.style,W=n===void 0?{}:n;return ue.a.createElement("div",{className:"".concat(fe.a.idsRingWrapper," ").concat(R)},ue.a.createElement("div",{className:fe.a.ldsRing},ue.a.createElement("div",null),ue.a.createElement("div",null),ue.a.createElement("div",null),ue.a.createElement("div",null)),z?ue.a.createElement("p",{style:W},z):null,B)}},J66h:function(We,ce,M){(function(q){var ue,re;(function(fe,ae){We.exports=ae(fe)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof q!="undefined"?q:this,function(fe){"use strict";fe=fe||{};var ae=fe.Base64,z="2.6.4",R="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",B=function(i){for(var f={},o=0,a=i.length;o<a;o++)f[i.charAt(o)]=o;return f}(R),n=String.fromCharCode,W=function(i){if(i.length<2){var f=i.charCodeAt(0);return f<128?i:f<2048?n(192|f>>>6)+n(128|f&63):n(224|f>>>12&15)+n(128|f>>>6&63)+n(128|f&63)}else{var f=65536+(i.charCodeAt(0)-55296)*1024+(i.charCodeAt(1)-56320);return n(240|f>>>18&7)+n(128|f>>>12&63)+n(128|f>>>6&63)+n(128|f&63)}},D=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,N=function(i){return i.replace(D,W)},d=function(i){var f=[0,2,1][i.length%3],o=i.charCodeAt(0)<<16|(i.length>1?i.charCodeAt(1):0)<<8|(i.length>2?i.charCodeAt(2):0),a=[R.charAt(o>>>18),R.charAt(o>>>12&63),f>=2?"=":R.charAt(o>>>6&63),f>=1?"=":R.charAt(o&63)];return a.join("")},m=fe.btoa&&typeof fe.btoa=="function"?function(i){return fe.btoa(i)}:function(i){if(i.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return i.replace(/[\s\S]{1,3}/g,d)},s=function(i){return m(N(String(i)))},g=function(i){return i.replace(/[+\/]/g,function(f){return f=="+"?"-":"_"}).replace(/=/g,"")},h=function(i,f){return f?g(s(i)):s(i)},_=function(i){return h(i,!0)},r;fe.Uint8Array&&(r=function(i,f){for(var o="",a=0,L=i.length;a<L;a+=3){var y=i[a],l=i[a+1],F=i[a+2],j=y<<16|l<<8|F;o+=R.charAt(j>>>18)+R.charAt(j>>>12&63)+(typeof l!="undefined"?R.charAt(j>>>6&63):"=")+(typeof F!="undefined"?R.charAt(j&63):"=")}return f?g(o):o});var v=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,S=function(i){switch(i.length){case 4:var f=(7&i.charCodeAt(0))<<18|(63&i.charCodeAt(1))<<12|(63&i.charCodeAt(2))<<6|63&i.charCodeAt(3),o=f-65536;return n((o>>>10)+55296)+n((o&1023)+56320);case 3:return n((15&i.charCodeAt(0))<<12|(63&i.charCodeAt(1))<<6|63&i.charCodeAt(2));default:return n((31&i.charCodeAt(0))<<6|63&i.charCodeAt(1))}},w=function(i){return i.replace(v,S)},I=function(i){var f=i.length,o=f%4,a=(f>0?B[i.charAt(0)]<<18:0)|(f>1?B[i.charAt(1)]<<12:0)|(f>2?B[i.charAt(2)]<<6:0)|(f>3?B[i.charAt(3)]:0),L=[n(a>>>16),n(a>>>8&255),n(a&255)];return L.length-=[0,0,2,1][o],L.join("")},E=fe.atob&&typeof fe.atob=="function"?function(i){return fe.atob(i)}:function(i){return i.replace(/\S{1,4}/g,I)},x=function(i){return E(String(i).replace(/[^A-Za-z0-9\+\/]/g,""))},P=function(i){return w(E(i))},T=function(i){return String(i).replace(/[-_]/g,function(f){return f=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},A=function(i){return P(T(i))},b;fe.Uint8Array&&(b=function(i){return Uint8Array.from(x(T(i)),function(f){return f.charCodeAt(0)})});var C=function(){var i=fe.Base64;return fe.Base64=ae,i};if(fe.Base64={VERSION:z,atob:x,btoa:m,fromBase64:A,toBase64:h,utob:N,encode:h,encodeURI:_,btou:w,decode:A,noConflict:C,fromUint8Array:r,toUint8Array:b},typeof Object.defineProperty=="function"){var p=function(i){return{value:i,enumerable:!1,writable:!0,configurable:!0}};fe.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",p(function(){return A(this)})),Object.defineProperty(String.prototype,"toBase64",p(function(i){return h(this,i)})),Object.defineProperty(String.prototype,"toBase64URI",p(function(){return h(this,!0)}))}}return fe.Meteor&&(Base64=fe.Base64),We.exports?We.exports.Base64=fe.Base64:!(ue=[],re=function(){return fe.Base64}.apply(ce,ue),re!==void 0&&(We.exports=re)),{Base64:fe.Base64}})}).call(this,M("IGO8"))},JOrW:function(We,ce,M){We.exports=M.p+"static/gf.a4054c89.svg"},JYp7:function(We,ce,M){"use strict";M.d(ce,"a",function(){return q});var q;(function(ue){function re(v){return v&&typeof v=="object"&&typeof v[Symbol.iterator]=="function"}ue.is=re;const fe=Object.freeze([]);function ae(){return fe}ue.empty=ae;function*z(v){yield v}ue.single=z;function R(v){return v||fe}ue.from=R;function B(v){return!v||v[Symbol.iterator]().next().done===!0}ue.isEmpty=B;function n(v){return v[Symbol.iterator]().next().value}ue.first=n;function W(v,S){for(const w of v)if(S(w))return!0;return!1}ue.some=W;function D(v,S){for(const w of v)if(S(w))return w;return}ue.find=D;function*N(v,S){for(const w of v)S(w)&&(yield w)}ue.filter=N;function*d(v,S){let w=0;for(const I of v)yield S(I,w++)}ue.map=d;function*m(...v){for(const S of v)for(const w of S)yield w}ue.concat=m;function*s(v){for(const S of v)for(const w of S)yield w}ue.concatNested=s;function g(v,S,w){let I=w;for(const E of v)I=S(I,E);return I}ue.reduce=g;function*h(v,S,w=v.length){for(S<0&&(S+=v.length),w<0?w+=v.length:w>v.length&&(w=v.length);S<w;S++)yield v[S]}ue.slice=h;function _(v,S=Number.POSITIVE_INFINITY){const w=[];if(S===0)return[w,v];const I=v[Symbol.iterator]();for(let E=0;E<S;E++){const x=I.next();if(x.done)return[w,ue.empty()];w.push(x.value)}return[w,{[Symbol.iterator](){return I}}]}ue.consume=_;function r(v,S,w=(I,E)=>I===E){const I=v[Symbol.iterator](),E=S[Symbol.iterator]();for(;;){const x=I.next(),P=E.next();if(x.done!==P.done)return!1;if(x.done)return!0;if(!w(x.value,P.value))return!1}}ue.equals=r})(q||(q={}))},LuSS:function(We,ce,M){"use strict";M.d(ce,"a",function(){return fe});var q=M("FER5"),ue={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},re=M("b3aT");function fe(d){var m={r:0,g:0,b:0},s=1,g=null,h=null,_=null,r=!1,v=!1;return typeof d=="string"&&(d=D(d)),typeof d=="object"&&(N(d.r)&&N(d.g)&&N(d.b)?(m=Object(q.g)(d.r,d.g,d.b),r=!0,v=String(d.r).substr(-1)==="%"?"prgb":"rgb"):N(d.h)&&N(d.s)&&N(d.v)?(g=Object(re.c)(d.s),h=Object(re.c)(d.v),m=Object(q.c)(d.h,g,h),r=!0,v="hsv"):N(d.h)&&N(d.s)&&N(d.l)&&(g=Object(re.c)(d.s),_=Object(re.c)(d.l),m=Object(q.b)(d.h,g,_),r=!0,v="hsl"),Object.prototype.hasOwnProperty.call(d,"a")&&(s=d.a)),s=Object(re.b)(s),{ok:r,format:d.format||v,r:Math.min(255,Math.max(m.r,0)),g:Math.min(255,Math.max(m.g,0)),b:Math.min(255,Math.max(m.b,0)),a:s}}var ae="[-\\+]?\\d+%?",z="[-\\+]?\\d*\\.\\d+%?",R="(?:".concat(z,")|(?:").concat(ae,")"),B="[\\s|\\(]+(".concat(R,")[,|\\s]+(").concat(R,")[,|\\s]+(").concat(R,")\\s*\\)?"),n="[\\s|\\(]+(".concat(R,")[,|\\s]+(").concat(R,")[,|\\s]+(").concat(R,")[,|\\s]+(").concat(R,")\\s*\\)?"),W={CSS_UNIT:new RegExp(R),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+n),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+n),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function D(d){if(d=d.trim().toLowerCase(),d.length===0)return!1;var m=!1;if(ue[d])d=ue[d],m=!0;else if(d==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var s=W.rgb.exec(d);return s?{r:s[1],g:s[2],b:s[3]}:(s=W.rgba.exec(d),s?{r:s[1],g:s[2],b:s[3],a:s[4]}:(s=W.hsl.exec(d),s?{h:s[1],s:s[2],l:s[3]}:(s=W.hsla.exec(d),s?{h:s[1],s:s[2],l:s[3],a:s[4]}:(s=W.hsv.exec(d),s?{h:s[1],s:s[2],v:s[3]}:(s=W.hsva.exec(d),s?{h:s[1],s:s[2],v:s[3],a:s[4]}:(s=W.hex8.exec(d),s?{r:Object(q.d)(s[1]),g:Object(q.d)(s[2]),b:Object(q.d)(s[3]),a:Object(q.a)(s[4]),format:m?"name":"hex8"}:(s=W.hex6.exec(d),s?{r:Object(q.d)(s[1]),g:Object(q.d)(s[2]),b:Object(q.d)(s[3]),format:m?"name":"hex"}:(s=W.hex4.exec(d),s?{r:Object(q.d)(s[1]+s[1]),g:Object(q.d)(s[2]+s[2]),b:Object(q.d)(s[3]+s[3]),a:Object(q.a)(s[4]+s[4]),format:m?"name":"hex8"}:(s=W.hex3.exec(d),s?{r:Object(q.d)(s[1]+s[1]),g:Object(q.d)(s[2]+s[2]),b:Object(q.d)(s[3]+s[3]),format:m?"name":"hex"}:!1)))))))))}function N(d){return Boolean(W.CSS_UNIT.exec(String(d)))}},M8RZ:function(We,ce,M){"use strict";M.d(ce,"a",function(){return n});var q=M("gKMJ"),ue=M("d9ep"),re=M("BSjk"),fe=M("FA6E"),ae=M("T/Jt"),z=M.n(ae),R=M("gLfR"),B=M.n(R),n=function(W){Object(re.a)(N,W);var D=Object(fe.a)(N);function N(d){var m;Object(q.a)(this,N),m=D.call(this,d);var s=window.document;return m.node=s.createElement("div"),s.body.appendChild(m.node),m}return Object(ue.a)(N,[{key:"render",value:function(){var m=this.props.children;return Object(R.createPortal)(m,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),N}(z.a.Component)},MFOe:function(We,ce,M){(function(q){var ue=z(),re=R(),fe=B(),ae=typeof window!="undefined"?window:q;We.exports={assign:ue,create:re,trim:fe,bind:n,slice:W,each:D,map:N,pluck:d,isList:m,isFunction:s,isObject:g,Global:ae};function z(){return Object.assign?Object.assign:function(_,r,v,S){for(var w=1;w<arguments.length;w++)D(Object(arguments[w]),function(I,E){_[E]=I});return _}}function R(){if(Object.create)return function(r,v,S,w){var I=W(arguments,1);return ue.apply(this,[Object.create(r)].concat(I))};{function h(){}return function(r,v,S,w){var I=W(arguments,1);return h.prototype=r,ue.apply(this,[new h].concat(I))}}}function B(){return String.prototype.trim?function(_){return String.prototype.trim.call(_)}:function(_){return _.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function n(h,_){return function(){return _.apply(h,Array.prototype.slice.call(arguments,0))}}function W(h,_){return Array.prototype.slice.call(h,_||0)}function D(h,_){d(h,function(r,v){return _(r,v),!1})}function N(h,_){var r=m(h)?[]:{};return d(h,function(v,S){return r[S]=_(v,S),!1}),r}function d(h,_){if(m(h)){for(var r=0;r<h.length;r++)if(_(h[r],r))return h[r]}else for(var v in h)if(h.hasOwnProperty(v)&&_(h[v],v))return h[v]}function m(h){return h!=null&&typeof h!="function"&&typeof h.length=="number"}function s(h){return h&&{}.toString.call(h)==="[object Function]"}function g(h){return h&&{}.toString.call(h)==="[object Object]"}}).call(this,M("IGO8"))},MI8n:function(We,ce,M){"use strict";M.d(ce,"c",function(){return ae}),M.d(ce,"b",function(){return n}),M.d(ce,"e",function(){return W}),M.d(ce,"a",function(){return D}),M.d(ce,"d",function(){return N}),M.d(ce,"f",function(){return d});var q=M("/cxE"),ue=M("pmY6"),re=M("24hK"),fe=M("5Y4S"),ae;(function(m){m.None=()=>ue.a.None;function s(i){return(f,o=null,a)=>{let L=!1,y;return y=i(l=>L?void 0:(y?y.dispose():L=!0,f.call(o,l)),null,a),L&&y.dispose(),y}}m.once=s;function g(i,f){return w((o,a=null,L)=>i(y=>o.call(a,f(y)),null,L))}m.map=g;function h(i,f){return w((o,a=null,L)=>i(y=>{f(y),o.call(a,y)},null,L))}m.forEach=h;function _(i,f){return w((o,a=null,L)=>i(y=>f(y)&&o.call(a,y),null,L))}m.filter=_;function r(i){return i}m.signal=r;function v(...i){return(f,o=null,a)=>Object(ue.e)(...i.map(L=>L(y=>f.call(o,y),null,a)))}m.any=v;function S(i,f,o){let a=o;return g(i,L=>(a=f(a,L),a))}m.reduce=S;function w(i){let f;const o=new n({onFirstListenerAdd(){f=i(o.fire,o)},onLastListenerRemove(){f.dispose()}});return o.event}function I(i,f,o=100,a=!1,L){let y,l,F,j=0;const G=new n({leakWarningThreshold:L,onFirstListenerAdd(){y=i(Y=>{j++,l=f(l,Y),a&&!F&&(G.fire(l),l=void 0),clearTimeout(F),F=setTimeout(()=>{const te=l;l=void 0,F=void 0,(!a||j>1)&&G.fire(te),j=0},o)})},onLastListenerRemove(){y.dispose()}});return G.event}m.debounce=I;function E(i,f=(o,a)=>o===a){let o=!0,a;return _(i,L=>{const y=o||!f(L,a);return o=!1,a=L,y})}m.latch=E;function x(i,f){return[m.filter(i,f),m.filter(i,o=>!f(o))]}m.split=x;function P(i,f=!1,o=[]){let a=o.slice(),L=i(F=>{a?a.push(F):l.fire(F)});const y=()=>{a&&a.forEach(F=>l.fire(F)),a=null},l=new n({onFirstListenerAdd(){L||(L=i(F=>l.fire(F)))},onFirstListenerDidAdd(){a&&(f?setTimeout(y):y())},onLastListenerRemove(){L&&L.dispose(),L=null}});return l.event}m.buffer=P;class T{constructor(i){this.event=i}map(i){return new T(g(this.event,i))}forEach(i){return new T(h(this.event,i))}filter(i){return new T(_(this.event,i))}reduce(i,f){return new T(S(this.event,i,f))}latch(){return new T(E(this.event))}debounce(i,f=100,o=!1,a){return new T(I(this.event,i,f,o,a))}on(i,f,o){return this.event(i,f,o)}once(i,f,o){return s(this.event)(i,f,o)}}function A(i){return new T(i)}m.chain=A;function b(i,f,o=a=>a){const a=(...F)=>l.fire(o(...F)),L=()=>i.on(f,a),y=()=>i.removeListener(f,a),l=new n({onFirstListenerAdd:L,onLastListenerRemove:y});return l.event}m.fromNodeEventEmitter=b;function C(i,f,o=a=>a){const a=(...F)=>l.fire(o(...F)),L=()=>i.addEventListener(f,a),y=()=>i.removeEventListener(f,a),l=new n({onFirstListenerAdd:L,onLastListenerRemove:y});return l.event}m.fromDOMEventEmitter=C;function p(i){return new Promise(f=>s(i)(f))}m.toPromise=p})(ae||(ae={}));class z{constructor(m){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${m}_${z._idPool++}`}start(m){this._stopWatch=new fe.a(!0),this._listenerCount=m}stop(){if(this._stopWatch){const m=this._stopWatch.elapsed();this._elapsedOverall+=m,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${m.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}z._idPool=0;let R=-1;class B{constructor(m,s=Math.random().toString(18).slice(2,5)){this.customThreshold=m,this.name=s,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(m){let s=R;if(typeof this.customThreshold=="number"&&(s=this.customThreshold),s<=0||m<s)return;this._stacks||(this._stacks=new Map);const g=new Error().stack.split(`
`).slice(3).join(`
`),h=this._stacks.get(g)||0;if(this._stacks.set(g,h+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=s*.5;let _,r=0;for(const[v,S]of this._stacks)(!_||r<S)&&(_=v,r=S);console.warn(`[${this.name}] potential listener LEAK detected, having ${m} listeners already. MOST frequent listener (${r}):`),console.warn(_)}return()=>{const _=this._stacks.get(g)||0;this._stacks.set(g,_-1)}}}class n{constructor(m){var s;this._disposed=!1,this._options=m,this._leakageMon=R>0?new B(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((s=this._options)===null||s===void 0?void 0:s._profName)?new z(this._options._profName):void 0}get event(){return this._event||(this._event=(m,s,g)=>{var h;this._listeners||(this._listeners=new re.a);const _=this._listeners.isEmpty();_&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const r=this._listeners.push(s?[m,s]:m);_&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,m,s);const v=(h=this._leakageMon)===null||h===void 0?void 0:h.check(this._listeners.size),S=Object(ue.i)(()=>{if(v&&v(),!this._disposed&&(r(),this._options&&this._options.onLastListenerRemove)){const w=this._listeners&&!this._listeners.isEmpty();w||this._options.onLastListenerRemove(this)}});return g instanceof ue.b?g.add(S):Array.isArray(g)&&g.push(S),S}),this._event}fire(m){var s,g;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new re.a);for(let h of this._listeners)this._deliveryQueue.push([h,m]);for((s=this._perfMon)===null||s===void 0||s.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[h,_]=this._deliveryQueue.shift();try{typeof h=="function"?h.call(void 0,_):h[0].call(h[1],_)}catch(r){Object(q.f)(r)}}(g=this._perfMon)===null||g===void 0||g.stop()}}dispose(){var m,s,g,h,_;this._disposed||(this._disposed=!0,(m=this._listeners)===null||m===void 0||m.clear(),(s=this._deliveryQueue)===null||s===void 0||s.clear(),(h=(g=this._options)===null||g===void 0?void 0:g.onLastListenerRemove)===null||h===void 0||h.call(g),(_=this._leakageMon)===null||_===void 0||_.dispose())}}class W extends n{constructor(m){super(m);this._isPaused=0,this._eventQueue=new re.a,this._mergeFn=m==null?void 0:m.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const m=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(m))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(m){this._listeners&&(this._isPaused!==0?this._eventQueue.push(m):super.fire(m))}}class D extends W{constructor(m){var s;super(m);this._delay=(s=m.delay)!==null&&s!==void 0?s:100}fire(m){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(m)}}class N{constructor(){this.buffers=[]}wrapEvent(m){return(s,g,h)=>m(_=>{const r=this.buffers[this.buffers.length-1];r?r.push(()=>s.call(g,_)):s.call(g,_)},void 0,h)}bufferEvents(m){const s=[];this.buffers.push(s);const g=m();return this.buffers.pop(),s.forEach(h=>h()),g}}class d{constructor(){this.listening=!1,this.inputEvent=ae.None,this.inputEventListener=ue.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(m){this.inputEvent=m,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=m(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(We,ce,M){"use strict";(function(q,ue){M.d(ce,"b",function(){return g}),M.d(ce,"i",function(){return v}),M.d(ce,"f",function(){return S}),M.d(ce,"d",function(){return w}),M.d(ce,"g",function(){return I}),M.d(ce,"h",function(){return E}),M.d(ce,"c",function(){return x}),M.d(ce,"k",function(){return P}),M.d(ce,"j",function(){return T}),M.d(ce,"a",function(){return A}),M.d(ce,"e",function(){return p});var re;const fe="en";let ae=!1,z=!1,R=!1,B=!1,n=!1,W=!1,D=!1,N,d=fe,m,s;const g=typeof self=="object"?self:typeof q=="object"?q:{};let h;typeof g.vscode!="undefined"&&typeof g.vscode.process!="undefined"?h=g.vscode.process:typeof ue!="undefined"&&(h=ue);const _=typeof((re=h==null?void 0:h.versions)===null||re===void 0?void 0:re.electron)=="string"&&h.type==="renderer";if(typeof navigator=="object"&&!_)s=navigator.userAgent,ae=s.indexOf("Windows")>=0,z=s.indexOf("Macintosh")>=0,D=(s.indexOf("Macintosh")>=0||s.indexOf("iPad")>=0||s.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,R=s.indexOf("Linux")>=0,W=!0,N=navigator.language,d=N;else if(typeof h=="object"){ae=h.platform==="win32",z=h.platform==="darwin",R=h.platform==="linux",B=R&&!!h.env.SNAP&&!!h.env.SNAP_REVISION,N=fe,d=fe;const i=h.env.VSCODE_NLS_CONFIG;if(i)try{const f=JSON.parse(i),o=f.availableLanguages["*"];N=f.locale,d=o||fe,m=f._translationsConfigFile}catch(f){}n=!0}else console.error("Unable to resolve platform.");let r=0;z?r=1:ae?r=3:R&&(r=2);const v=ae,S=z,w=R,I=n,E=W,x=D,P=s,T=function(){if(g.setImmediate)return g.setImmediate.bind(g);if(typeof g.postMessage=="function"&&!g.importScripts){let o=[];g.addEventListener("message",L=>{if(L.data&&L.data.vscodeSetImmediateId)for(let y=0,l=o.length;y<l;y++){const F=o[y];if(F.id===L.data.vscodeSetImmediateId){o.splice(y,1),F.callback();return}}});let a=0;return L=>{const y=++a;o.push({id:y,callback:L}),g.postMessage({vscodeSetImmediateId:y},"*")}}if(typeof(h==null?void 0:h.nextTick)=="function")return h.nextTick.bind(h);const f=Promise.resolve();return o=>f.then(o)}(),A=z||D?2:ae?1:3;let b=!0,C=!1;function p(){if(!C){C=!0;const i=new Uint8Array(2);i[0]=1,i[1]=2;const f=new Uint16Array(i.buffer);b=f[0]===(2<<8)+1}return b}}).call(this,M("IGO8"),M("B0ME"))},MRIS:function(We,ce,M){"use strict";var q=M("T/Jt"),ue=M.n(q),re=q.createContext(!1);ce.a=re},MVJL:function(We,ce,M){We.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(We,ce,M){"use strict";M.d(ce,"C",function(){return q}),M.d(ce,"v",function(){return re}),M.d(ce,"s",function(){return fe}),M.d(ce,"t",function(){return ae}),M.d(ce,"U",function(){return z}),M.d(ce,"J",function(){return R}),M.d(ce,"O",function(){return B}),M.d(ce,"p",function(){return n}),M.d(ce,"T",function(){return W}),M.d(ce,"q",function(){return D}),M.d(ce,"N",function(){return N}),M.d(ce,"M",function(){return d}),M.d(ce,"Q",function(){return m}),M.d(ce,"u",function(){return s}),M.d(ce,"x",function(){return g}),M.d(ce,"I",function(){return h}),M.d(ce,"f",function(){return _}),M.d(ce,"h",function(){return r}),M.d(ce,"g",function(){return v}),M.d(ce,"i",function(){return S}),M.d(ce,"G",function(){return w}),M.d(ce,"H",function(){return I}),M.d(ce,"r",function(){return E}),M.d(ce,"R",function(){return x}),M.d(ce,"d",function(){return P}),M.d(ce,"e",function(){return T}),M.d(ce,"E",function(){return A}),M.d(ce,"F",function(){return b}),M.d(ce,"j",function(){return C}),M.d(ce,"z",function(){return p}),M.d(ce,"K",function(){return f}),M.d(ce,"L",function(){return o}),M.d(ce,"m",function(){return L}),M.d(ce,"k",function(){return l}),M.d(ce,"A",function(){return j}),M.d(ce,"a",function(){return G}),M.d(ce,"n",function(){return Y}),M.d(ce,"l",function(){return te}),M.d(ce,"D",function(){return de}),M.d(ce,"B",function(){return ve}),M.d(ce,"b",function(){return he}),M.d(ce,"S",function(){return Re}),M.d(ce,"o",function(){return we}),M.d(ce,"P",function(){return ge}),M.d(ce,"w",function(){return Ne}),M.d(ce,"c",function(){return ze}),M.d(ce,"y",function(){return Xe});function q(be){return!be||typeof be!="string"?!0:be.trim().length===0}const ue=/{(\d+)}/g;function re(be,...Le){return Le.length===0?be:be.replace(ue,function(le,ye){const Te=parseInt(ye,10);return isNaN(Te)||Te<0||Te>=Le.length?le:Le[Te]})}function fe(be){return be.replace(/[<>&]/g,function(Le){switch(Le){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return Le}})}function ae(be){return be.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function z(be,Le=" "){const le=R(be,Le);return B(le,Le)}function R(be,Le){if(!be||!Le)return be;const le=Le.length;if(le===0||be.length===0)return be;let ye=0;for(;be.indexOf(Le,ye)===ye;)ye=ye+le;return be.substring(ye)}function B(be,Le){if(!be||!Le)return be;const le=Le.length,ye=be.length;if(le===0||ye===0)return be;let Te=ye,Pe=-1;for(;!(Pe=be.lastIndexOf(Le,Te-1),Pe===-1||Pe+le!==Te);){if(Pe===0)return"";Te=Pe}return be.substring(0,Te)}function n(be){return be.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function W(be){return be.replace(/\*/g,"")}function D(be,Le,le={}){if(!be)throw new Error("Cannot create regex from empty string");Le||(be=ae(be)),le.wholeWord&&(/\B/.test(be.charAt(0))||(be="\\b"+be),/\B/.test(be.charAt(be.length-1))||(be=be+"\\b"));let ye="";return le.global&&(ye+="g"),le.matchCase||(ye+="i"),le.multiline&&(ye+="m"),le.unicode&&(ye+="u"),new RegExp(be,ye)}function N(be){if(be.source==="^"||be.source==="^$"||be.source==="$"||be.source==="^\\s*$")return!1;const Le=be.exec("");return!!(Le&&be.lastIndex===0)}function d(be){return(be.global?"g":"")+(be.ignoreCase?"i":"")+(be.multiline?"m":"")+(be.unicode?"u":"")}function m(be){return be.split(/\r\n|\r|\n/)}function s(be){for(let Le=0,le=be.length;Le<le;Le++){const ye=be.charCodeAt(Le);if(ye!==32&&ye!==9)return Le}return-1}function g(be,Le=0,le=be.length){for(let ye=Le;ye<le;ye++){const Te=be.charCodeAt(ye);if(Te!==32&&Te!==9)return be.substring(Le,ye)}return be.substring(Le,le)}function h(be,Le=be.length-1){for(let le=Le;le>=0;le--){const ye=be.charCodeAt(le);if(ye!==32&&ye!==9)return le}return-1}function _(be,Le){return be<Le?-1:be>Le?1:0}function r(be,Le,le=0,ye=be.length,Te=0,Pe=Le.length){for(;le<ye&&Te<Pe;le++,Te++){let ct=be.charCodeAt(le),st=Le.charCodeAt(Te);if(ct<st)return-1;if(ct>st)return 1}const He=ye-le,Ye=Pe-Te;return He<Ye?-1:He>Ye?1:0}function v(be,Le){return S(be,Le,0,be.length,0,Le.length)}function S(be,Le,le=0,ye=be.length,Te=0,Pe=Le.length){for(;le<ye&&Te<Pe;le++,Te++){let ct=be.charCodeAt(le),st=Le.charCodeAt(Te);if(ct===st)continue;if(ct>=128||st>=128)return r(be.toLowerCase(),Le.toLowerCase(),le,ye,Te,Pe);w(ct)&&(ct-=32),w(st)&&(st-=32);const vt=ct-st;if(vt===0)continue;return vt}const He=ye-le,Ye=Pe-Te;return He<Ye?-1:He>Ye?1:0}function w(be){return be>=97&&be<=122}function I(be){return be>=65&&be<=90}function E(be,Le){return be.length===Le.length&&S(be,Le)===0}function x(be,Le){const le=Le.length;return Le.length>be.length?!1:S(be,Le,0,le)===0}function P(be,Le){let le,ye=Math.min(be.length,Le.length);for(le=0;le<ye;le++)if(be.charCodeAt(le)!==Le.charCodeAt(le))return le;return ye}function T(be,Le){let le,ye=Math.min(be.length,Le.length);const Te=be.length-1,Pe=Le.length-1;for(le=0;le<ye;le++)if(be.charCodeAt(Te-le)!==Le.charCodeAt(Pe-le))return le;return ye}function A(be){return 55296<=be&&be<=56319}function b(be){return 56320<=be&&be<=57343}function C(be,Le){return(be-55296<<10)+(Le-56320)+65536}function p(be,Le,le){const ye=be.charCodeAt(le);if(A(ye)&&le+1<Le){const Te=be.charCodeAt(le+1);if(b(Te))return C(ye,Te)}return ye}function i(be,Le){const le=be.charCodeAt(Le-1);if(b(le)&&Le>1){const ye=be.charCodeAt(Le-2);if(A(ye))return C(ye,le)}return le}function f(be,Le){const le=nt.getInstance(),ye=Le,Te=be.length,Pe=p(be,Te,Le);Le+=Pe>=65536?2:1;let He=le.getGraphemeBreakType(Pe);for(;Le<Te;){const Ye=p(be,Te,Le),ct=le.getGraphemeBreakType(Ye);if(ze(He,ct))break;Le+=Ye>=65536?2:1,He=ct}return Le-ye}function o(be,Le){const le=nt.getInstance(),ye=Le,Te=i(be,Le);Le-=Te>=65536?2:1;let Pe=le.getGraphemeBreakType(Te);for(;Le>0;){const He=i(be,Le),Ye=le.getGraphemeBreakType(He);if(ze(Ye,Pe))break;Le-=He>=65536?2:1,Pe=Ye}return ye-Le}const a=/(?:[\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 L(be){return a.test(be)}const y=/(?:[\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 l(be){return y.test(be)}const F=/^[\t\n\r\x20-\x7E]*$/;function j(be){return F.test(be)}const G=/[\u2028\u2029]/;function Y(be){return G.test(be)}function te(be){for(let Le=0,le=be.length;Le<le;Le++)if(de(be.charCodeAt(Le)))return!0;return!1}function de(be){return be=+be,be>=11904&&be<=55215||be>=63744&&be<=64255||be>=65281&&be<=65374}function ve(be){return be>=127462&&be<=127487||be===8986||be===8987||be===9200||be===9203||be>=9728&&be<=10175||be===11088||be===11093||be>=127744&&be<=128591||be>=128640&&be<=128764||be>=128992&&be<=129003||be>=129280&&be<=129535||be>=129648&&be<=129750}const he=String.fromCharCode(65279);function Re(be){return!!(be&&be.length>0&&be.charCodeAt(0)===65279)}function we(be,Le=!1){return be?(Le&&(be=be.replace(/\\./g,"")),be.toLowerCase()!==be):!1}function ge(be){const Le=90-65+1;return be=be%(2*Le),be<Le?String.fromCharCode(97+be):String.fromCharCode(65+be-Le)}function Ne(be){const Le=nt.getInstance();return Le.getGraphemeBreakType(be)}function ze(be,Le){return be===0?Le!==5&&Le!==7:be===2&&Le===3?!1:be===4||be===2||be===3||(Le===4||Le===2||Le===3)?!0:be===8&&(Le===8||Le===9||Le===11||Le===12)||((be===11||be===9)&&(Le===9||Le===10)||((be===12||be===10)&&Le===10||(Le===5||Le===13||(Le===7||(be===1||be===13&&Le===14)))))?!1:!(be===6&&Le===6)}class nt{constructor(){this._data=Ge()}static getInstance(){return nt._INSTANCE||(nt._INSTANCE=new nt),nt._INSTANCE}getGraphemeBreakType(be){if(be<32)return be===10?3:be===13?2:4;if(be<127)return 0;const Le=this._data,le=Le.length/3;let ye=1;for(;ye<=le;)if(be<Le[3*ye])ye=2*ye;else if(be>Le[3*ye+1])ye=2*ye+1;else return Le[3*ye+2];return 0}}nt._INSTANCE=null;function Ge(){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 Xe(be,Le){if(be===0)return 0;const le=Be(be,Le);if(le!==void 0)return le;const ye=i(Le,be);return be-=_e(ye),be}function Be(be,Le){let le=i(Le,be);for(be-=_e(le);Ze(le)||le===65039||le===8419;){if(be===0)return;le=i(Le,be),be-=_e(le)}if(!ve(le))return;if(be>=0){const ye=i(Le,be);ye===8205&&(be-=_e(ye))}return be}function _e(be){return be>=65536?2:1}function Ze(be){return 127995<=be&&be<=127999}},ODXe:function(We,ce,M){"use strict";M.d(ce,"a",function(){return ae});function q(z){if(Array.isArray(z))return z}function ue(z,R){var B=z==null?null:typeof Symbol!="undefined"&&z[Symbol.iterator]||z["@@iterator"];if(B!=null){var n,W,D,N,d=[],m=!0,s=!1;try{if(D=(B=B.call(z)).next,R===0){if(Object(B)!==B)return;m=!1}else for(;!(m=(n=D.call(B)).done)&&(d.push(n.value),d.length!==R);m=!0);}catch(g){s=!0,W=g}finally{try{if(!m&&B.return!=null&&(N=B.return(),Object(N)!==N))return}finally{if(s)throw W}}return d}}var re=M("BsWD");function fe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ae(z,R){return q(z)||ue(z,R)||Object(re.a)(z,R)||fe()}},"OkW/":function(We,ce,M){},Ot1p:function(We,ce,M){"use strict";var q=M("c3Iv"),ue=M("rBQ5"),re=M("sh+1"),fe=M("8OG5"),ae=M("mgsT"),z=M("IYef"),R=M("Hqw+"),B=M("Hbia"),n=M("XXmO"),W=M.n(n),D=M("T/Jt"),N=M.n(D),d=M("VrN/"),m=M.n(d),s=M("bdgK"),g=M("p77/"),h=M("Bd2K"),_=M("ELLl"),r=M("19Vz"),v=M("lZu9"),S=M("+NIl"),w=M("kSUc"),I=M("9Bee"),E=function(Fe){var it=Fe.value,Ie=it===void 0?"":it,Qe=Fe.className,rt=Fe.showTextOnly,ft=Fe.showLines,It=Fe.style,Tt=It===void 0?{}:It,Et=Object(D.useMemo)(function(){return""},[Ie]);return N.a.createElement(N.a.Fragment,null,N.a.createElement("div",{dangerouslySetInnerHTML:{__html:Et}}))},x=M("HPgX"),P=M("dejd"),T=M("C+DQ"),A=M("1vsH"),b=M("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 p(Fe){var it=Fe.onActionCallback,Ie=Fe.title,Qe=Fe.icon,rt=Fe.actionName,ft=Fe.className,It=ft===void 0?"":ft,Tt=Fe.children;function Et(){it(rt)}return N.a.createElement("a",{title:Ie,className:It,onClick:Et},N.a.createElement("i",{className:"md-iconfont ".concat(Qe)}),Tt)}var i=function(Fe){var it=Fe.watch,Ie=Fe.showNullButton,Qe=Fe.onActionCallback,rt=Fe.fullScreen,ft=Fe.insertTemp,It=Fe.hidetoolBar,Tt=Fe.uuid,Et=Fe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(A.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(A.G)("_educoder_session"),"&key=").concat(Tt,"&api=").concat(encodeURIComponent(b.a.PROXY_SERVER)));var Ct=[].concat(C,[{title:"".concat(it?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(it?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return N.a.createElement("ul",{className:"markdown-toolbar-container"},!It&&Ct.map(function(dt,Nt){return N.a.createElement("li",{key:Nt},dt.actionName?N.a.createElement(p,Object(x.a)({},dt,{onActionCallback:Qe})):N.a.createElement("span",{className:"v-line"}))}),Ie?N.a.createElement("li",null,N.a.createElement(p,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Qe},N.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ft&&N.a.createElement("li",null,N.a.createElement(p,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ft),onActionCallback:Qe},N.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),N.a.createElement("li",{className:"btn-full-screen"},N.a.createElement(p,{icon:"".concat(rt?"icon-shrink":"icon-enlarge"),title:rt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Qe})))},f=M("M8RZ"),o=M("dLI4"),a=M("4d5L"),L=M("y6Ii"),y=M("Wuip"),l=M("47JS"),F=M("TOZL"),j={labelCol:{span:4},wrapperCol:{span:20}},G=function(Fe){var it=Fe.callback,Ie=Fe.onCancel;function Qe(rt){it(rt)}return N.a.createElement(y.a,Object(x.a)({},j,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Qe}),N.a.createElement(y.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},N.a.createElement(F.a,null)),N.a.createElement(y.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},N.a.createElement(F.a,null)),N.a.createElement("div",{className:"flex-container flex-end"},N.a.createElement(a.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),N.a.createElement(a.a,{type:"ghost",onClick:Ie},"\u53D6\u6D88")))},Y=M("7ahc"),te=M("HmJG"),de=M("BjJ7"),ve=y.a.useForm,he={width:280,marginRight:10},Re={labelCol:{span:5},wrapperCol:{span:19}},we=function(Fe){var it=Fe.callback,Ie=Fe.onCancel,Qe=ve(),rt=Object(R.a)(Qe,1),ft=rt[0];function It(Ct){it(Ct)}function Tt(Ct,dt){if(Ct.status===-1){ae.b.error(Ct.message);return}ft.setFieldsValue({src:"/api/attachments/".concat(Ct.id),type:dt.type})}function Et(Ct){var dt=Ct.target.files[0];Ne(dt,Tt)}return N.a.createElement(y.a,Object(x.a)({form:ft},Re,{className:"upload-image-panel",onFinish:It}),N.a.createElement(y.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},N.a.createElement("div",{className:"flex-container"},N.a.createElement(y.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},N.a.createElement(F.a,{style:he})),N.a.createElement(ge,{onFileChange:Et}))),N.a.createElement(y.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},N.a.createElement(F.a,{style:{width:264}})),N.a.createElement(y.a.Item,{style:{textAlign:"right"}},N.a.createElement(a.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),N.a.createElement(a.a,{type:"ghost",onClick:Ie},"\u53D6\u6D88")))};function ge(Fe){var it=Fe.onFileChange;return N.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",N.a.createElement("input",{type:"file",onChange:it}))}function Ne(Fe,it){if(!Fe)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ie=new FormData;Ie.append("editormd-image-file",Fe),Ie.append("file_param_name","editormd-image-file"),Ie.append("byxhr","true");var Qe=new window.XMLHttpRequest;Qe.withCredentials=!0,Qe.addEventListener("load",function(rt){it(JSON.parse(rt.target.responseText),Fe)},!1),Qe.addEventListener("error",function(rt){console.error(rt)},!1),Qe.open("POST","".concat(de.a,"/api/attachments.json")),Qe.send(Ie)}var ze=M("XlT3"),nt=M("e7Hv"),Ge=M("2yBE"),Xe=M("5LYH"),Be=Xe.a.Group,_e={margin:"0 8px"},Ze=function(Fe){var it=Fe.callback,Ie=Fe.onCancel;function Qe(rt){it(rt)}return N.a.createElement(y.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Qe},N.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},N.a.createElement("span",{style:_e},"\u5355\u5143\u683C\u6570\uFF1A"),N.a.createElement("span",{style:_e},"\u884C\u6570"),N.a.createElement(y.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},N.a.createElement(nt.a,null)),N.a.createElement("span",{style:_e},"\u5217\u6570"),N.a.createElement(y.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},N.a.createElement(nt.a,null))),N.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},N.a.createElement("span",{style:_e},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),N.a.createElement(y.a.Item,{name:"align"},N.a.createElement(Be,null,N.a.createElement(Xe.a,{value:"default"},N.a.createElement("i",{className:"fa fa-align-justify"})),N.a.createElement(Xe.a,{value:"left"},N.a.createElement("i",{className:"fa fa-align-left"})),N.a.createElement(Xe.a,{value:"center"},N.a.createElement("i",{className:"fa fa-align-center"})),N.a.createElement(Xe.a,{value:"right"},N.a.createElement("i",{className:"fa fa-align-right"}))))),N.a.createElement("div",{className:"flex-container flex-end"},N.a.createElement(a.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),N.a.createElement(a.a,{type:"ghost",onClick:Ie},"\u53D6\u6D88")))},be=M("ErOA"),Le=M("7Cbv"),le="link",ye="upload-image",Te="code-block",Pe="add-table",He="------------",Ye={default:He,left:":".concat(He),center:":".concat(He,":"),right:"".concat(He,":")},ct=M("9VGf"),st,vt;function qe(){}var mt=0,yt=1e4,Je="\u2581",et=`
**\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 De(Fe){return/^\d+$/.test(Fe)?"".concat(Fe,"px"):Fe}var ke=navigator.platform.toUpperCase().indexOf("MAC")>=0,Me=ke?"Cmd":"Ctrl",me=["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"],Ce=(st={},Object(B.a)(st,Me+"-B","bold"),Object(B.a)(st,Me+"-I","italic"),st),Oe=(vt={},Object(B.a)(vt,le,"\u6DFB\u52A0\u94FE\u63A5"),Object(B.a)(vt,Te,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(B.a)(vt,ye,"\u6DFB\u52A0\u6587\u4EF6"),Object(B.a)(vt,Pe,"\u6DFB\u52A0\u8868\u683C"),vt),Se=ce.a=function(Fe){var it=Fe.defaultValue,Ie=it===void 0?"":it,Qe=Fe.onChange,rt=Fe.width,ft=rt===void 0?"100%":rt,It=Fe.height,Tt=It===void 0?400:It,Et=Fe.miniToolbar,Ct=Et===void 0?!1:Et,dt=Fe.isFocus,Nt=dt===void 0?!1:dt,Xt=Fe.watch,Dt=Fe.insertTemp,an=Fe.mode,nn=an===void 0?"markdown":an,An=Fe.id,_n=An===void 0?"markdown-editor-id":An,At=Fe.showResizeBar,jt=At===void 0?!1:At,on=Fe.noStorage,Ee=on===void 0?!1:on,se=Fe.showNullButton,H=se===void 0?!1:se,V=Fe.hidetoolBar,$=V===void 0?!1:V,ee=Fe.fullScreen,xe=ee===void 0?!1:ee,Ue=Fe.onBlur,$e=Fe.onCMBeforeChange,pt=Fe.onFullScreen,xt=Fe.className,Ve=xt===void 0?"":xt,ht=Fe.disablePaste,Rt=ht===void 0?!1:ht,lt=Fe.placeholder,Pt=lt===void 0?"":lt,Wt=Fe.values,Bt=Wt===void 0?"":Wt,wt=Object(D.useState)(null),Q=Object(R.a)(wt,2),k=Q[0],U=Q[1],X=Object(D.useState)(Ie),ie=Object(R.a)(X,2),J=ie[0],Ae=ie[1],tt=Object(D.useState)(Xt),kt=Object(R.a)(tt,2),Mt=kt[0],gt=kt[1],$t=Object(D.useState)(xe),mn=Object(R.a)($t,2),Mn=mn[0],lr=mn[1],Kn=Object(D.useState)(""),ur=Object(R.a)(Kn,2),dr=ur[0],hr=ur[1],Dr=Object(D.useState)(0),Cr=Object(R.a)(Dr,2),Wn=Cr[0],Er=Cr[1],zr=Object(D.useState)(Tt),vi=Object(R.a)(zr,2),xr=vi[0],Zr=vi[1],_i=Object(D.useState)(!1),yi=Object(R.a)(_i,2),qr=yi[0],di=yi[1],Pr=Object(D.useRef)(Object(Le.a)()),Nr=Object(D.useRef)(!1),Sr=Object(D.useRef)(),Qn=Object(D.useRef)(),Or=Object(D.useRef)(),er=Object(D.useRef)(),Wr=Object(D.useRef)(),Rr=function(){var hn=Object(z.a)(W.a.mark(function kn(){var wn,tr;return W.a.wrap(function(sn){for(;;)switch(sn.prev=sn.next){case 0:return sn.next=2,Object(be.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Pr.current}});case 2:tr=sn.sent,tr!=null&&(wn=tr.attachments)!==null&&wn!==void 0&&wn.length&&(console.log("cm:",k,Qn),tr.attachments.map(function(zn){zn.content_type.indexOf("image")>-1?k.replaceSelection("![,](/api/attachments/".concat(zn.id,"?type=").concat(zn.content_type,")")):zn.content_type.indexOf("video")>-1?k.replaceSelection('<video width="100%" controls src="'.concat(b.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):zn.content_type.indexOf("pdf")>-1?k.replaceSelection('<a href="'.concat(b.a.API_SERVER,"/api/attachments/").concat(zn.id,"?type=").concat(zn.content_type,'&disposition=inline" target="_blank">').concat(zn.name,"</a>")):k.replaceSelection("[".concat(zn.name,"](").concat(b.a.API_SERVER,"/api/attachments/").concat(zn.id,"?type=").concat(zn.content_type,")"))}));case 4:case"end":return sn.stop()}},kn)}));return function(){return hn.apply(this,arguments)}}();Object(D.useEffect)(function(){Ae(Bt),k==null||k.setValue(Bt)},[Bt]),Object(D.useEffect)(function(){pt==null||pt(Mn)},[Mn]),Object(D.useEffect)(function(){if(Qn.current){var hn=m.a.fromTextArea(Qn.current,{mode:nn,lineNumbers:!Ct,lineWrapping:!0,value:Ie,autoCloseTags:!0,autoCloseBrackets:!0});Nt&&hn.focus();function kn(wn,tr){if(Rt){tr.preventDefault();return}var Gn=tr.clipboardData;if(Gn){var sn=Gn.types.toString(),zn=Gn.items;if(sn==="Files"||Gn.types.indexOf("Files")>-1){if(tr.preventDefault(),nn=="stex")return;try{var Ir,Xr=zn[1];((Ir=zn[0])===null||Ir===void 0?void 0:Ir.kind)==="file"&&(Xr=zn[0]);var nr=Xr.getAsFile(),Ui=nr.name.split(".").pop();Ne(nr,function(fr){if(fr.id){var ot,St,Ht;(nr==null||((ot=nr.type)===null||ot===void 0)?void 0:ot.indexOf("image"))>-1?hn.replaceSelection("![,](/api/attachments/".concat(fr.id,"?type=").concat(fr.content_type,")")):(nr==null||((St=nr.type)===null||St===void 0)?void 0:St.indexOf("video"))>-1?hn.replaceSelection('<video width="100%" controls src="'.concat(b.a.API_SERVER,"/api/attachments/").concat(fr.id,'"></video>')):(nr==null||((Ht=nr.type)===null||Ht===void 0)?void 0:Ht.indexOf("pdf"))>-1?hn.replaceSelection('<a href="'.concat(b.a.API_SERVER,"/api/attachments/").concat(fr.id,"?type=").concat(nr.type,'&disposition=inline" target="_blank">').concat(nr.name,"</a>")):me.includes(Ui)?hn.replaceSelection('<a href="'.concat(b.a.API_SERVER,"/api/attachments/").concat(fr.id,'?type=office&disposition=inline" target="_blank">').concat(nr.name,"</a>")):hn.replaceSelection("[".concat(nr.name,"](").concat(b.a.API_SERVER,"/api/attachments/").concat(fr.id,"?type=").concat(fr.content_type,")"))}else(fr==null?void 0:fr.status)===401&&(document.location.href="/user/login")})}catch(fr){ae.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return hn.on("paste",kn),hn.on("dragleave",function(wn,tr){Or.current.classList.remove("mouse-hover-md")}),hn.on("dragover",function(wn,tr){Or.current.classList.add("mouse-hover-md")}),hn.on("drop",function(wn,tr){Or.current.classList.add("mouse-hover-md");var Gn;if(Gn=tr.dataTransfer.files,Gn.length>0){tr.preventDefault(),tr.stopPropagation();for(var sn=function(Xr){var nr=Gn[Xr],Ui=nr.name.split(".").pop();Ne(nr,function(fr){if(fr.id){var ot,St,Ht;(nr==null||((ot=nr.type)===null||ot===void 0)?void 0:ot.indexOf("image"))>-1?hn.replaceSelection("![,](/api/attachments/".concat(fr.id,"?type=").concat(fr.content_type,")")):(nr==null||((St=nr.type)===null||St===void 0)?void 0:St.indexOf("video"))>-1?hn.replaceSelection('<video width="100%" controls src="'.concat(b.a.API_SERVER,"/api/attachments/").concat(fr.id,'"></video>')):(nr==null||((Ht=nr.type)===null||Ht===void 0)?void 0:Ht.indexOf("pdf"))>-1?hn.replaceSelection('<a href="'.concat(b.a.API_SERVER,"/api/attachments/").concat(fr.id,"?type=").concat(nr.type,'&disposition=inline" target="_blank">').concat(nr.name,"</a>")):me.includes(Ui)?hn.replaceSelection('<a href="'.concat(b.a.API_SERVER,"/api/attachments/").concat(fr.id,'?type=office&disposition=inline" target="_blank">').concat(nr.name,"</a>")):hn.replaceSelection("[".concat(nr.name,"](").concat(b.a.API_SERVER,"/api/attachments/").concat(fr.id,"?type=").concat(fr.content_type,")"))}else(fr==null?void 0:fr.status)===401&&(document.location.href="/user/login")})},zn=0;zn<Gn.length;zn++)sn(zn)}}),U(hn),function(){hn.off("paste",kn)}}},[]);var Vr=Object(D.useCallback)(function(){if(Or.current)try{}catch(hn){console.log(hn,"---- to set md editor body height")}},[xr,Or,Mn]);Object(D.useEffect)(function(){function hn(){var wn=new s.a(function(tr){var Gn=Object(re.a)(tr),sn;try{for(Gn.s();!(sn=Gn.n()).done;){var zn=sn.value;(zn.target.offsetHeight>0||zn.target.offsetWidth>0)&&(Vr(),k.setSize("100%","100%"),k.refresh())}}catch(Ir){Gn.e(Ir)}finally{Gn.f()}});return wn.observe(Qn.current.parentElement),wn}if(k){var kn=hn();return function(){kn.unobserve(Qn.current.parentElement)}}},[k,Vr]),Object(D.useEffect)(function(){if(k){for(var hn=[],kn=function(){var zn=tr[wn];Gn=Object(R.a)(zn,2);var Ir=Gn[0],Xr=Gn[1],nr=Object(B.a)({},Ir,function(){Ar(Xr)});hn.push(nr),k.addKeyMap(nr)},wn=0,tr=Object.entries(Ce);wn<tr.length;wn++){var Gn;kn()}return Sr.current=setInterval(function(){Nr.current&&Rr()},4e3),function(){clearInterval(Sr.current);var sn=Object(re.a)(hn),zn;try{for(sn.s();!(zn=sn.n()).done;){var Ir=zn.value;k.removeKeyMap(Ir)}}catch(Xr){sn.e(Xr)}finally{sn.f()}}}},[k]),Object(D.useEffect)(function(){xe!==Mn&&lr(xe)},[xe]),Object(ct.a)(function(){if(!Ee&&Wn>0){var hn=new Date().getTime(),kn=window.sessionStorage.getItem(_n);hn>=Wn+yt&&(!kn||kn!==J)&&(window.sessionStorage.setItem(_n,J),di(!0))}},yt),Object(D.useEffect)(function(){gt(Xt)},[k,Xt]),Object(D.useEffect)(function(){k&&(Nt&&k.focus())},[k,Nt]),Object(D.useEffect)(function(){if(Mt&&k){var hn=k.getScrollerElement();function kn(wn){var tr=wn.target;if(Wr.current){var Gn=tr.scrollTop/tr.scrollHeight;Wr.current.scrollTop=Wr.current.scrollHeight*Gn}}return hn.addEventListener("scroll",kn),function(){hn.removeEventListener("scroll",kn)}}},[k,Mt]),Object(D.useEffect)(function(){if(k&&$e){function hn(kn,wn){$e(kn,wn)}return k.on("beforeChange",hn),function(){k.off("beforeChange",hn)}}},[k,$e]),Object(D.useEffect)(function(){if(k&&Ue){function hn(){Ue(k.getValue())}return k.on("blur",hn),function(){k.off("blur",hn)}}},[k,Ue]),Object(D.useEffect)(function(){if(k){function hn(kn){var wn=kn.getValue();Ae(wn),Er(new Date().getTime()),kn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Qe&&Qe(wn)}return k.on("change",hn),function(){k.off("change",hn)}}},[k,Qe]),Object(D.useEffect)(function(){k&&(Ie==null?(k.setValue(""),Ae("")):Ie!==k.getValue()&&(k.setValue(Ie),Ae(Ie),k.setCursor(k.lineCount(),0)))},[k,Ie]);var Ar=Object(D.useCallback)(function(hn){var kn=k.getCursor(),wn=k.getSelection(),tr=wn.split(`
`);switch(hn){case"bold":return k.replaceSelection("**"+wn+"**"),wn===""&&k.setCursor(kn.line,kn.ch+2),k.focus();case"italic":return k.replaceSelection("*"+wn+"*"),wn===""&&k.setCursor(kn.line,kn.ch+1),k.focus();case"code":return k.replaceSelection("`"+wn+"`"),wn===""&&k.setCursor(kn.line,kn.ch+1),k.focus();case"inline-latex":return k.replaceSelection("`$$"+wn+"$$`"),wn===""&&k.setCursor(kn.line,kn.ch+3),k.focus();case"latex":return k.replaceSelection("```latex\n"+wn+"\n```"),k.setCursor(kn.line+1,wn.length+1),k.focus();case"line-break":return k.replaceSelection(`<br/>
`),k.focus();case"list-ul":return wn===""?k.replaceSelection("- "+wn):k.replaceSelection(tr.map(function(Gn){return Gn===""?"":"- ".concat(Gn)}).join(`
`)),k.focus();case"list-ol":return wn===""?k.replaceSelection("1. "+wn):k.replaceSelection(tr.map(function(Gn,sn){return Gn===""?"":"".concat(sn+1,". ").concat(Gn)}).join(`
`)),k.focus();case"add-null-ch":return wn===""&&k.setCursor(kn.line,kn.ch+1),k.replaceSelection(Je),k.focus();case"inster-template-1":return wn===""&&k.setCursor(kn.line,kn.ch),k.replaceSelection(et),k.focus();case"eraser":return k.setValue(""),k.focus();case"trigger-watch":return gt(!Mt),k.focus();case"trigger-full-screen":return lr(!Mn),k.focus();case le:hr(le);return;case Te:hr(Te);return;case ye:hr(ye);return;case Pe:hr(Pe);return;default:throw new Error}},[k,Mt,Mn]),Ri=Object(D.useCallback)(function(hn){hr("");switch(dr){case le:var kn=hn.title,wn=hn.link;return k.replaceSelection("[".concat(kn,"](").concat(wn,")")),k.focus();case Te:var tr=hn.language,Gn=hn.content;return k.replaceSelection(["```"+tr,Gn,"```"].join(`
`)),k.focus();case ye:var sn=hn.src,zn=hn.alt;return zn?k.replaceSelection("![ ".concat(zn," ]( ").concat(sn,' "').concat(zn,'" )')):k.replaceSelection("![,](".concat(sn,")")),k.focus();case Pe:for(var Ir=hn.row,Xr=hn.col,nr=hn.align,Ui=`
`,fr=0;fr<Ir;fr++){for(var ot=[],St=[],Ht=0;Ht<Xr;Ht++)fr===1&&St.push(Ye[nr]),ot.push(" ");fr===1&&(Ui+="| ".concat(St.join(" | "),` |
`)),Ui+="| ".concat(ot.join(Xr===1?"":" | "),` |
`)}return k.replaceSelection(Ui+`
`),k.focus();default:throw new Error}},[k,dr]),Hi=Object(D.useMemo)(function(){switch(dr){case le:return N.a.createElement(G,{callback:Ri,onCancel:ri});case Te:return N.a.createElement(Y.b,{callback:Ri,onCancel:ri});case ye:return N.a.createElement(we,{callback:Ri,onCancel:ri});case Pe:return N.a.createElement(Ze,{callback:Ri,onCancel:ri});default:return null}},[dr]);function ri(){hr("")}Object(D.useEffect)(function(){if(er.current){var hn=er.current,kn=!1,wn=0;function tr(zn){kn=!0,wn=zn.pageY}function Gn(){kn=!1}function sn(zn){if(kn){var Ir=zn.pageY-wn;Ir<0&&(Ir=0),Ir>300&&(Ir=300);var Xr=Tt+Ir+"px";Zr(Xr)}}return hn.addEventListener("mousedown",tr),document.addEventListener("mousemove",sn),document.addEventListener("mouseup",Gn),function(){hn.removeEventListener("mousedown",tr),document.removeEventListener("mousemove",sn),document.removeEventListener("mouseup",Gn)}}},[k,er]),Object(D.useEffect)(function(){Zr(Tt)},[Tt]);var Ur=De(ft),ci=De(xr),ii={width:Ur,height:ci},$i=Object(D.useMemo)(function(){if(Wn){var hn=new Date(Wn),kn=hn.getHours(),wn=hn.getMinutes(),tr=hn.getSeconds();return kn=kn<10?"0"+kn:kn,wn=wn<10?"0"+wn:wn,tr=tr<10?"0"+tr:tr,"".concat(kn,":").concat(wn,":").concat(tr)}return 0},[Wn]);function Ni(){window.sessionStorage.removeItem(_n),di(!1),Er(0)}function hi(){di(!1),Er(0),k.setValue(window.sessionStorage.getItem(_n))}function ua(hn,kn){var wn=k.getValue();wn=wn.replace(hn,kn),Ae(wn),k==null||k.setValue(wn)}return N.a.createElement(D.Fragment,null,N.a.createElement("div",{className:"markdown-editor-wrapper",ref:Or},N.a.createElement("div",{className:"markdown-editor-container ".concat(Ve," ").concat(Mt?"on-preview":""," ").concat(Ct?"mini":""," ").concat(Mn?"full-screen":""),style:ii},N.a.createElement(i,{insertTemp:Dt,watch:Mt,fullScreen:Mn,showNullButton:H,onActionCallback:Ar,hidetoolBar:$,uuid:Pr.current,setOpenPhones:function(){Nr.current=!0}}),N.a.createElement("div",{className:"markdown-editor-body"},N.a.createElement("div",{className:"codemirror-container"},N.a.createElement("textarea",{ref:Qn,placeholder:Pt})),Mt?N.a.createElement("div",{ref:Wr,className:"preview-container"},nn==="stex"&&N.a.createElement(E,{value:J}),nn!=="stex"&&N.a.createElement(I.a,{edit:!0,value:J,replaces:ua})):null))),jt?N.a.createElement("a",{ref:er,className:"editor-resize"}):null,N.a.createElement(f.a,null,Oe[dr]?N.a.createElement(ue.a,{centered:!0,title:Oe[dr],visible:!0,onCancel:ri,footer:null,className:"markdown-popup-form"},Hi):null))}},P5Jw:function(We,ce,M){"use strict";var q=M("rHrb"),ue=q.CopyToClipboard;ue.CopyToClipboard=ue,We.exports=ue},PD8m:function(We,ce){We.exports={name:"memoryStorage",read:q,write:ue,each:re,remove:fe,clearAll:ae};var M={};function q(z){return M[z]}function ue(z,R){M[z]=R}function re(z){for(var R in M)M.hasOwnProperty(R)&&z(M[R],R)}function fe(z){delete M[z]}function ae(z){M={}}},QOAJ:function(We,ce,M){"use strict";var q=M("U+Vu"),ue=Object(q.a)();ce.a=ue},RELg:function(We,ce,M){var q=M("MFOe"),ue=q.Global;We.exports={name:"oldIE-userDataStorage",write:R,read:B,each:n,remove:W,clearAll:D};var re="storejs",fe=ue.document,ae=m(),z=(ue.navigator?ue.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function R(s,g){if(z)return;var h=d(s);ae(function(_){_.setAttribute(h,g),_.save(re)})}function B(s){if(z)return;var g=d(s),h=null;return ae(function(_){h=_.getAttribute(g)}),h}function n(s){ae(function(g){for(var h=g.XMLDocument.documentElement.attributes,_=h.length-1;_>=0;_--){var r=h[_];s(g.getAttribute(r.name),r.name)}})}function W(s){var g=d(s);ae(function(h){h.removeAttribute(g),h.save(re)})}function D(){ae(function(s){var g=s.XMLDocument.documentElement.attributes;s.load(re);for(var h=g.length-1;h>=0;h--)s.removeAttribute(g[h].name);s.save(re)})}var N=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function d(s){return s.replace(/^\d/,"___$&").replace(N,"___")}function m(){if(!fe||!fe.documentElement||!fe.documentElement.addBehavior)return null;var s="script",g,h,_;try{h=new ActiveXObject("htmlfile"),h.open(),h.write("<"+s+">document.w=window</"+s+'><iframe src="/favicon.ico"></iframe>'),h.close(),g=h.w.frames[0].document,_=g.createElement("div")}catch(r){_=fe.createElement("div"),g=fe.body}return function(r){var v=[].slice.call(arguments,0);v.unshift(_),g.appendChild(_),_.addBehavior("#default#userData"),_.load(re),r.apply(this,v),g.removeChild(_);return}}},RpDr:function(We,ce,M){"use strict";M.d(ce,"a",function(){return I}),M.d(ce,"c",function(){return P});var q=M("dLI4"),ue=M("4d5L"),re=M("Hqw+"),fe=M("YaWb"),ae=M("Hbia"),z=M("47JS"),R=M("TOZL"),B=M("T/Jt"),n=M.n(B),W=M("8Skl"),D=M("y3Kf"),N=M("bdLU"),d=M("J66h"),m=M.n(d),s=M("++UQ"),g=M.n(s),h=M("IxHN"),_=M("9Bee"),r=M("1vsH"),v,S=R.a.TextArea,w={visible:!1,tabIndex:"0"},I=(v={},Object(ae.a)(v,N.a.NOMATCH,"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D"),Object(ae.a)(v,N.a.OK,"\u8C03\u8BD5\u901A\u8FC7"),Object(ae.a)(v,2,"\u8C03\u8BD5\u8D85\u65F6"),Object(ae.a)(v,3,"\u8C03\u8BD5pod\u5931\u8D25"),Object(ae.a)(v,4,"\u7F16\u8BD1\u5931\u8D25"),Object(ae.a)(v,5,"\u6267\u884C\u5931\u8D25"),v),E;(function(A){A[A.SET_VISIBLE=0]="SET_VISIBLE",A[A.SET_TABINDEX=1]="SET_TABINDEX"})(E||(E={}));function x(A,b){switch(b.type){case E.SET_VISIBLE:return Object(fe.a)(Object(fe.a)({},A),{},{visible:b.payload});case E.SET_TABINDEX:return Object(fe.a)(Object(fe.a)({},A),{},{tabIndex:b.payload});default:throw new Error}}function P(A){var b=A.status,C=A.error_msg,p=A.output,i=A.input,f=A.expected_output,o=A.is_file,a=A.input_file_url,L=A.output_file_url,y=A.expected_output_file_url,l=null,F={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(b){case N.a.NOMATCH:l=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!o&&n.a.createElement(_.a,{value:i,style:F}),o&&n.a.createElement("div",{style:F},n.a.createElement("a",{onClick:function(){return Object(r.y)(a,i)}},i)),n.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!o&&n.a.createElement(_.a,{value:p&&d.Base64.decode(p)||"",style:F}),o&&n.a.createElement("div",{style:F},n.a.createElement("a",{onClick:function(){return Object(r.y)(L,p)}},p)),n.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!o&&n.a.createElement(_.a,{value:f&&d.Base64.decode(f)||"",style:F}),o&&n.a.createElement("div",{style:F},n.a.createElement("a",{onClick:function(){return Object(r.y)(y,f)}},f)));break;case N.a.EXECUTEFAILURE:l=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!o&&n.a.createElement(_.a,{value:i,style:F}),o&&n.a.createElement("div",{style:F},n.a.createElement("a",{onClick:function(){return Object(r.y)(a,i)}},i)),n.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),n.a.createElement("pre",{className:"error"},d.Base64.decode(C)));break;case N.a.COMPILEFAILURE:l=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!o&&n.a.createElement(_.a,{value:i,style:F}),o&&n.a.createElement("div",{style:F},n.a.createElement("a",{onClick:function(){return Object(r.y)(a,i)}},i)),n.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),n.a.createElement("pre",{className:"error"},d.Base64.decode(C)));break;case N.a.PODFAILURE:l=n.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case N.a.TIMEOUT:l=n.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return n.a.createElement(n.a.Fragment,null," ",l," ")}function T(A){var b=A.status,C=A.error_msg,p=A.execute_time,i=A.output,f=A.input,o=A.expected_output,a=A.is_file,L=A.input_file_url,y=A.output_file_url,l=A.expected_output_file_url,F=null;switch(b){case N.a.OK:F=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",p),n.a.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),n.a.createElement("pre",null,d.Base64.decode(i)));break;case N.a.NOMATCH:F=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",null,"\u8F93\u5165\uFF1A",n.a.createElement("pre",null,f)),n.a.createElement("p",null,"\u8F93\u51FA\uFF1A",i&&d.Base64.decode(i)),n.a.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",o&&d.Base64.decode(o)));break;case N.a.EXECUTEFAILURE:F=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,f)),n.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),n.a.createElement("pre",{className:"error"},d.Base64.decode(C)));break;case N.a.COMPILEFAILURE:F=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,f)),n.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),n.a.createElement("pre",{className:"error"},d.Base64.decode(C)));break;case N.a.PODFAILURE:F=n.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case N.a.TIMEOUT:F=n.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return n.a.createElement(n.a.Fragment,null," ",F," ")}ce.b=function(A){var b=A.id,C=A.input,p=A.debuging,i=A.submitting,f=A.executingMessage,o=A.debugResult,a=A.onChangeInput,L=A.onDebugCode,y=A.onSubmitCode,l=Object(B.useReducer)(x,w),F=Object(re.a)(l,2),j=F[0],G=F[1],Y=j.visible,te=j.tabIndex;Object(B.useEffect)(function(){G({type:E.SET_VISIBLE,payload:!1})},[b]);function de(we){var ge=we.target.id;G({type:E.SET_TABINDEX,payload:ge})}function ve(){G({type:E.SET_VISIBLE,payload:!Y})}var he=Object(B.useMemo)(function(){if(o){var we=o.status;return n.a.createElement(n.a.Fragment,null,T(o))}return null},[o]);function Re(){G({type:E.SET_VISIBLE,payload:!0}),G({type:E.SET_TABINDEX,payload:"1"}),L()}return n.a.createElement("div",{className:"test-case-panel"},n.a.createElement("div",{className:"test-case-panel-body ".concat(Y?"active":"")},n.a.createElement("ul",{className:"s-navs"},n.a.createElement("li",null,n.a.createElement("a",{className:te==="0"?"active":"",id:"0",onClick:de},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")),n.a.createElement("li",null,n.a.createElement("a",{className:te==="1"?"active":"",id:"1",onClick:de},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))),n.a.createElement("div",{className:"tab-panel-body ".concat(te==="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:a})),n.a.createElement("div",{className:"tab-panel-body ".concat(te==="1"?"":"hide")},p?n.a.createElement(h.a,{message:f}):o?n.a.createElement("section",{style:{height:200}}," ",he," "):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(Y?"up":""),onClick:ve},Y?n.a.createElement(W.a,null):n.a.createElement(D.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(ue.a,{id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),n.a.createElement(ue.a,{id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),n.a.createElement(ue.a,{className:"btn-green",type:"ghost",loading:p,onClick:Re},"\u8C03\u8BD5\u4EE3\u7801"),n.a.createElement(ue.a,{type:"primary",loading:i,disabled:i,onClick:function(){G({type:E.SET_VISIBLE,payload:!1}),y()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},"S/kP":function(We,ce,M){We.exports=M.p+"static/time.69bc8c81.svg"},SJMd:function(We,ce){/**
* @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 M,q,ue,re=!1,fe,ae;window.PR_SHOULD_USE_CONTINUATION=!0;var z,R;(function(){var B=window,n=["break,continue,do,else,for,if,return,while"],W=[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"],D=[W,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],N=[D,"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=[D,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],m=[D,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",g=[D,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],h="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",_=[n,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],r=[n,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[n,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],S=[N,m,d,g,h,_,r,v],w=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,I="str",E="kwd",x="com",P="typ",T="lit",A="pun",b="pln",C="tag",p="dec",i="src",f="atn",o="atv",a="nocode",L="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function y(Be){for(var _e=0,Ze=!1,be=!1,Le=0,le=Be.length;Le<le;++Le){var ye=Be[Le];if(ye.ignoreCase)be=!0;else if(/[a-z]/i.test(ye.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ze=!0,be=!1;break}}var Te={b:8,t:9,n:10,v:11,f:12,r:13};function Pe(vt){var qe=vt.charCodeAt(0);if(qe!==92)return qe;var mt=vt.charAt(1);return qe=Te[mt],qe||("0"<=mt&&mt<="7"?parseInt(vt.substring(1),8):mt==="u"||mt==="x"?parseInt(vt.substring(2),16):vt.charCodeAt(1))}function He(vt){if(vt<32)return(vt<16?"\\x0":"\\x")+vt.toString(16);var qe=String.fromCharCode(vt);return qe==="\\"||qe==="-"||qe==="]"||qe==="^"?"\\"+qe:qe}function Ye(vt){var qe=vt.substring(1,vt.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")),mt=[],yt=qe[0]==="^",Je=["["];yt&&Je.push("^");for(var et=yt?1:0,De=qe.length;et<De;++et){var ke=qe[et];if(/\\[bdsw]/i.test(ke))Je.push(ke);else{var Me=Pe(ke),me;et+2<De&&qe[et+1]==="-"?(me=Pe(qe[et+2]),et+=2):me=Me,mt.push([Me,me]),me<65||Me>122||(me<65||Me>90||mt.push([Math.max(65,Me)|32,Math.min(me,90)|32]),me<97||Me>122||mt.push([Math.max(97,Me)&~32,Math.min(me,122)&~32]))}}mt.sort(function(Fe,it){return Fe[0]-it[0]||it[1]-Fe[1]});for(var Ce=[],Oe=[],et=0;et<mt.length;++et){var Se=mt[et];Se[0]<=Oe[1]+1?Oe[1]=Math.max(Oe[1],Se[1]):Ce.push(Oe=Se)}for(var et=0;et<Ce.length;++et){var Se=Ce[et];Je.push(He(Se[0])),Se[1]>Se[0]&&(Se[1]+1>Se[0]&&Je.push("-"),Je.push(He(Se[1])))}return Je.push("]"),Je.join("")}function ct(vt){for(var qe=vt.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")),mt=qe.length,yt=[],Je=0,et=0;Je<mt;++Je){var De=qe[Je];if(De==="(")++et;else if(De.charAt(0)==="\\"){var ke=+De.substring(1);ke&&(ke<=et?yt[ke]=-1:qe[Je]=He(ke))}}for(var Je=1;Je<yt.length;++Je)yt[Je]===-1&&(yt[Je]=++_e);for(var Je=0,et=0;Je<mt;++Je){var De=qe[Je];if(De==="(")++et,yt[et]||(qe[Je]="(?:");else if(De.charAt(0)==="\\"){var ke=+De.substring(1);ke&&ke<=et&&(qe[Je]="\\"+yt[ke])}}for(var Je=0;Je<mt;++Je)qe[Je]==="^"&&qe[Je+1]!=="^"&&(qe[Je]="");if(vt.ignoreCase&&Ze)for(var Je=0;Je<mt;++Je){var De=qe[Je],Me=De.charAt(0);De.length>=2&&Me==="["?qe[Je]=Ye(De):Me!=="\\"&&(qe[Je]=De.replace(/[a-zA-Z]/g,function(Oe){var Se=Oe.charCodeAt(0);return"["+String.fromCharCode(Se&~32,Se|32)+"]"}))}return qe.join("")}for(var st=[],Le=0,le=Be.length;Le<le;++Le){var ye=Be[Le];if(ye.global||ye.multiline)throw new Error(""+ye);st.push("(?:"+ct(ye)+")")}return new RegExp(st.join("|"),be?"gi":"g")}function l(Be,_e){var Ze=/(?:^|\s)nocode(?:\s|$)/,be=[],Le=0,le=[],ye=0;function Te(Pe){var He=Pe.nodeType;if(He==1){if(Ze.test(Pe.className))return;for(var Ye=Pe.firstChild;Ye;Ye=Ye.nextSibling)Te(Ye);var ct=Pe.nodeName.toLowerCase();(ct==="br"||ct==="li")&&(be[ye]=`
`,le[ye<<1]=Le++,le[ye++<<1|1]=Pe)}else if(He==3||He==4){var st=Pe.nodeValue;st.length&&(_e?st=st.replace(/\r\n?/g,`
`):st=st.replace(/[ \t\r\n]+/g," "),be[ye]=st,le[ye<<1]=Le,Le+=st.length,le[ye++<<1|1]=Pe)}}return Te(Be),{sourceCode:be.join("").replace(/\n$/,""),spans:le}}function F(Be,_e,Ze,be,Le){if(!Ze)return;var le={sourceNode:Be,pre:1,langExtension:null,numberLines:null,sourceCode:Ze,spans:null,basePos:_e,decorations:null};be(le),Le.push.apply(Le,le.decorations)}var j=/\S/;function G(Be){for(var _e=void 0,Ze=Be.firstChild;Ze;Ze=Ze.nextSibling){var be=Ze.nodeType;_e=be===1?_e?Be:Ze:be===3&&j.test(Ze.nodeValue)?Be:_e}return _e===Be?void 0:_e}function Y(Be,_e){var Ze={},be;(function(){for(var ye=Be.concat(_e),Te=[],Pe={},He=0,Ye=ye.length;He<Ye;++He){var ct=ye[He],st=ct[3];if(st)for(var vt=st.length;--vt>=0;)Ze[st.charAt(vt)]=ct;var qe=ct[1],mt=""+qe;Pe.hasOwnProperty(mt)||(Te.push(qe),Pe[mt]=null)}Te.push(/[\0-\uffff]/),be=y(Te)})();var Le=_e.length,le=function(ye){for(var Te=ye.sourceCode,Pe=ye.basePos,He=ye.sourceNode,Ye=[Pe,b],ct=0,st=Te.match(be)||[],vt={},qe=0,mt=st.length;qe<mt;++qe){var yt=st[qe],Je=vt[yt],et=void 0,De;if(typeof Je=="string")De=!1;else{var ke=Ze[yt.charAt(0)];if(ke)et=yt.match(ke[1]),Je=ke[0];else{for(var Me=0;Me<Le;++Me)if(ke=_e[Me],et=yt.match(ke[1]),et){Je=ke[0];break}et||(Je=b)}De=Je.length>=5&&Je.substring(0,5)==="lang-",De&&!(et&&typeof et[1]=="string")&&(De=!1,Je=i),De||(vt[yt]=Je)}var me=ct;if(ct+=yt.length,!De)Ye.push(Pe+me,Je);else{var Ce=et[1],Oe=yt.indexOf(Ce),Se=Oe+Ce.length;et[2]&&(Se=yt.length-et[2].length,Oe=Se-Ce.length);var Fe=Je.substring(5);F(He,Pe+me,yt.substring(0,Oe),le,Ye),F(He,Pe+me+Oe,Ce,ge(Fe,Ce),Ye),F(He,Pe+me+Se,yt.substring(Se),le,Ye)}}ye.decorations=Ye};return le}function te(Be){var _e=[],Ze=[];Be.tripleQuotedStrings?_e.push([I,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Be.multiLineStrings?_e.push([I,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):_e.push([I,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Be.verbatimStrings&&Ze.push([I,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var be=Be.hashComments;be&&(Be.cStyleComments?(be>1?_e.push([x,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):_e.push([x,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ze.push([I,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):_e.push([x,/^#[^\r\n]*/,null,"#"])),Be.cStyleComments&&(Ze.push([x,/^\/\/[^\r\n]*/,null]),Ze.push([x,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Le=Be.regexLiterals;if(Le){var le=Le>1?"":`
\r`,ye=le?".":"[\\S\\s]",Te="/(?=[^/*"+le+"])(?:[^/\\x5B\\x5C"+le+"]|\\x5C"+ye+"|\\x5B(?:[^\\x5C\\x5D"+le+"]|\\x5C"+ye+")*(?:\\x5D|$))+/";Ze.push(["lang-regex",RegExp("^"+L+"("+Te+")")])}var Pe=Be.types;Pe&&Ze.push([P,Pe]);var He=(""+Be.keywords).replace(/^ | $/g,"");He.length&&Ze.push([E,new RegExp("^(?:"+He.replace(/[\s,]+/g,"|")+")\\b"),null]),_e.push([b,/^\s+/,null,` \r
\xA0`]);var Ye="^.[^\\s\\w.$@'\"`/\\\\]*";return Be.regexLiterals&&(Ye+="(?!s*/)"),Ze.push([T,/^@[a-z_$][a-z_$@0-9]*/i,null],[P,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[b,/^[a-z_$][a-z_$@0-9]*/i,null],[T,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[b,/^\\[\s\S]?/,null],[A,new RegExp(Ye),null]),Y(_e,Ze)}var de=te({keywords:S,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ve(Be,_e,Ze){for(var be=/(?:^|\s)nocode(?:\s|$)/,Le=/\r\n?|\n/,le=Be.ownerDocument,ye=le.createElement("li");Be.firstChild;)ye.appendChild(Be.firstChild);var Te=[ye];function Pe(qe){var mt=qe.nodeType;if(mt==1&&!be.test(qe.className))if(qe.nodeName==="br")He(qe),qe.parentNode&&qe.parentNode.removeChild(qe);else for(var yt=qe.firstChild;yt;yt=yt.nextSibling)Pe(yt);else if((mt==3||mt==4)&&Ze){var Je=qe.nodeValue,et=Je.match(Le);if(et){var De=Je.substring(0,et.index);qe.nodeValue=De;var ke=Je.substring(et.index+et[0].length);if(ke){var Me=qe.parentNode;Me.insertBefore(le.createTextNode(ke),qe.nextSibling)}He(qe),De||qe.parentNode.removeChild(qe)}}}function He(qe){for(;!qe.nextSibling;)if(qe=qe.parentNode,!qe)return;function mt(et,De){var ke=De?et.cloneNode(!1):et,Me=et.parentNode;if(Me){var me=mt(Me,1),Ce=et.nextSibling;me.appendChild(ke);for(var Oe=Ce;Oe;Oe=Ce)Ce=Oe.nextSibling,me.appendChild(Oe)}return ke}for(var yt=mt(qe.nextSibling,0),Je;(Je=yt.parentNode)&&Je.nodeType===1;)yt=Je;Te.push(yt)}for(var Ye=0;Ye<Te.length;++Ye)Pe(Te[Ye]);_e===(_e|0)&&Te[0].setAttribute("value",_e);var ct=le.createElement("ol");ct.className="linenums";for(var st=Math.max(0,_e-1|0)||0,Ye=0,vt=Te.length;Ye<vt;++Ye)ye=Te[Ye],ye.className="L"+(Ye+st)%10,ye.firstChild||ye.appendChild(le.createTextNode("\xA0")),ct.appendChild(ye);Be.appendChild(ct)}function he(Be){var _e=/\bMSIE\s(\d+)/.exec(navigator.userAgent);_e=_e&&+_e[1]<=8;var Ze=/\n/g,be=Be.sourceCode,Le=be.length,le=0,ye=Be.spans,Te=ye.length,Pe=0,He=Be.decorations,Ye=He.length,ct=0;He[Ye]=Le;var st,vt;for(vt=st=0;vt<Ye;)He[vt]!==He[vt+2]?(He[st++]=He[vt++],He[st++]=He[vt++]):vt+=2;for(Ye=st,vt=st=0;vt<Ye;){for(var qe=He[vt],mt=He[vt+1],yt=vt+2;yt+2<=Ye&&He[yt+1]===mt;)yt+=2;He[st++]=qe,He[st++]=mt,vt=yt}Ye=He.length=st;var Je=Be.sourceNode,et="";Je&&(et=Je.style.display,Je.style.display="none");try{for(var De=null;Pe<Te;){var ke=ye[Pe],Me=ye[Pe+2]||Le,me=He[ct+2]||Le,yt=Math.min(Me,me),Ce=ye[Pe+1],Oe;if(Ce.nodeType!==1&&(Oe=be.substring(le,yt))){_e&&(Oe=Oe.replace(Ze,"\r")),Ce.nodeValue=Oe;var Se=Ce.ownerDocument,Fe=Se.createElement("span");Fe.className=He[ct+1];var it=Ce.parentNode;it.replaceChild(Fe,Ce),Fe.appendChild(Ce),le<Me&&(ye[Pe+1]=Ce=Se.createTextNode(be.substring(yt,Me)),it.insertBefore(Ce,Fe.nextSibling))}le=yt,le>=Me&&(Pe+=2),le>=me&&(ct+=2)}}finally{Je&&(Je.style.display=et)}}var Re={};function we(Be,_e){for(var Ze=_e.length;--Ze>=0;){var be=_e[Ze];Re.hasOwnProperty(be)?B.console&&console.warn("cannot override language handler %s",be):Re[be]=Be}}function ge(Be,_e){return Be&&Re.hasOwnProperty(Be)||(Be=/^\s*</.test(_e)?"default-markup":"default-code"),Re[Be]}we(de,["default-code"]),we(Y([],[[b,/^[^<?]+/],[p,/^<!\w[^>]*(?:>|$)/],[x,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[A,/^(?:<[%?]|[%?]>)/],["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"]),we(Y([[b,/^[\s]+/,null,` \r
`],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[C,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[f,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[A,/^[=<>\/]+/],["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"]),we(Y([],[[o,/^[\s\S]+/]]),["uq.val"]),we(te({keywords:N,hashComments:!0,cStyleComments:!0,types:w}),["c","cc","cpp","cxx","cyc","m"]),we(te({keywords:"null,true,false"}),["json"]),we(te({keywords:m,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:w}),["cs"]),we(te({keywords:d,cStyleComments:!0}),["java"]),we(te({keywords:v,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),we(te({keywords:_,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),we(te({keywords:h,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),we(te({keywords:r,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),we(te({keywords:g,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),we(te({keywords:s,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),we(Y([],[[I,/^[\s\S]+/]]),["regex"]);function Ne(Be){var _e=Be.langExtension;try{var Ze=l(Be.sourceNode,Be.pre),be=Ze.sourceCode;Be.sourceCode=be,Be.spans=Ze.spans,Be.basePos=0,ge(_e,be)(Be),he(Be)}catch(Le){B.console&&console.log(Le&&Le.stack||Le)}}function ze(Be,_e,Ze){var be=Ze||!1,Le=_e||null,le=document.createElement("div");le.innerHTML="<pre>"+Be+"</pre>",le=le.firstChild,be&&ve(le,be,!0);var ye={langExtension:Le,numberLines:be,sourceNode:le,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Ne(ye),le.innerHTML}function nt(Be,_e){var Ze=_e||document.body,be=Ze.ownerDocument||document;function Le(ke){return Ze.getElementsByTagName(ke)}for(var le=[Le("pre"),Le("code"),Le("xmp")],ye=[],Te=0;Te<le.length;++Te)for(var Pe=0,He=le[Te].length;Pe<He;++Pe)ye.push(le[Te][Pe]);le=null;var Ye=Date;Ye.now||(Ye={now:function(){return+new Date}});var ct=0,st=/\blang(?:uage)?-([\w.]+)(?!\S)/,vt=/\bprettyprint\b/,qe=/\bprettyprinted\b/,mt=/pre|xmp/i,yt=/^code$/i,Je=/^(?:pre|code|xmp)$/i,et={};function De(){for(var ke=B.PR_SHOULD_USE_CONTINUATION?Ye.now()+250:Infinity;ct<ye.length&&Ye.now()<ke;ct++){for(var Me=ye[ct],me=et,Ce=Me;Ce=Ce.previousSibling;){var Oe=Ce.nodeType,Se=(Oe===7||Oe===8)&&Ce.nodeValue;if(Se?!/^\??prettify\b/.test(Se):Oe!==3||/\S/.test(Ce.nodeValue))break;if(Se){me={},Se.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Xt,Dt,an){me[Dt]=an});break}}var Fe=Me.className;if((me!==et||vt.test(Fe))&&!qe.test(Fe)){for(var it=!1,Ie=Me.parentNode;Ie;Ie=Ie.parentNode){var Qe=Ie.tagName;if(Je.test(Qe)&&Ie.className&&vt.test(Ie.className)){it=!0;break}}if(!it){Me.className+=" prettyprinted";var rt=me.lang;if(!rt){rt=Fe.match(st);var ft;!rt&&(ft=G(Me))&&yt.test(ft.tagName)&&(rt=ft.className.match(st)),rt&&(rt=rt[1])}var It;if(mt.test(Me.tagName))It=1;else{var Tt=Me.currentStyle,Et=be.defaultView,Ct=Tt?Tt.whiteSpace:Et&&Et.getComputedStyle?Et.getComputedStyle(Me,null).getPropertyValue("white-space"):0;It=Ct&&Ct.substring(0,3)==="pre"}var dt=me.linenums;(dt=dt==="true"||+dt)||(dt=Fe.match(/\blinenums\b(?::(\d+))?/),dt=dt?dt[1]&&dt[1].length?+dt[1]:!0:!1),dt&&ve(Me,dt,It);var Nt={langExtension:rt,sourceNode:Me,numberLines:dt,pre:It,sourceCode:null,basePos:null,spans:null,decorations:null};Ne(Nt)}}}ct<ye.length?B.setTimeout(De,250):typeof Be=="function"&&Be()}De()}var Ge=B.PR={createSimpleLexer:Y,registerLangHandler:we,sourceDecorator:te,PR_ATTRIB_NAME:f,PR_ATTRIB_VALUE:o,PR_COMMENT:x,PR_DECLARATION:p,PR_KEYWORD:E,PR_LITERAL:T,PR_NOCODE:a,PR_PLAIN:b,PR_PUNCTUATION:A,PR_SOURCE:i,PR_STRING:I,PR_TAG:C,PR_TYPE:P,prettyPrintOne:re?B.prettyPrintOne=ze:z=ze,prettyPrint:R=re?B.prettyPrint=nt:R=nt},Xe=B.define;typeof Xe=="function"&&Xe.amd&&Xe("google-code-prettify",[],function(){return Ge})})()},T8No:function(We,ce,M){"use strict";M.d(ce,"a",function(){return R}),M.d(ce,"e",function(){return B}),M.d(ce,"c",function(){return A}),M.d(ce,"b",function(){return b}),M.d(ce,"d",function(){return C}),M.d(ce,"f",function(){return f});var q=M("MNsG"),ue=M("N0LK"),re=M("Cg/j");let fe=q.k||"";const ae=new Map;ae.set("false",!1),ae.set("true",!0),ae.set("isMac",q.f),ae.set("isLinux",q.d),ae.set("isWindows",q.i),ae.set("isWeb",q.h),ae.set("isMacNative",q.f&&!q.h),ae.set("isEdge",fe.indexOf("Edg/")>=0),ae.set("isFirefox",fe.indexOf("Firefox")>=0),ae.set("isChrome",fe.indexOf("Chrome")>=0),ae.set("isSafari",fe.indexOf("Safari")>=0);const z=Object.prototype.hasOwnProperty;class R{static has(a){return N.create(a)}static equals(a,L){return d.create(a,L)}static regex(a,L){return I.create(a,L)}static not(a){return h.create(a)}static and(...a){return P.create(a,null)}static or(...a){return T.create(a,null,!0)}static deserialize(a,L=!1){return a?this._deserializeOrExpression(a,L):void 0}static _deserializeOrExpression(a,L){let y=a.split("||");return T.create(y.map(l=>this._deserializeAndExpression(l,L)),null,!0)}static _deserializeAndExpression(a,L){let y=a.split("&&");return P.create(y.map(l=>this._deserializeOne(l,L)),null)}static _deserializeOne(a,L){if(a=a.trim(),a.indexOf("!=")>=0){let y=a.split("!=");return g.create(y[0].trim(),this._deserializeValue(y[1],L))}if(a.indexOf("==")>=0){let y=a.split("==");return d.create(y[0].trim(),this._deserializeValue(y[1],L))}if(a.indexOf("=~")>=0){let y=a.split("=~");return I.create(y[0].trim(),this._deserializeRegexValue(y[1],L))}if(a.indexOf(" in ")>=0){let y=a.split(" in ");return m.create(y[0].trim(),y[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(a)){const y=a.split(">=");return v.create(y[0].trim(),y[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(a)){const y=a.split(">");return r.create(y[0].trim(),y[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(a)){const y=a.split("<=");return w.create(y[0].trim(),y[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(a)){const y=a.split("<");return S.create(y[0].trim(),y[1].trim())}return/^\!\s*/.test(a)?h.create(a.substr(1).trim()):N.create(a)}static _deserializeValue(a,L){if(a=a.trim(),a==="true")return!0;if(a==="false")return!1;let y=/^'([^']*)'$/.exec(a);return y?y[1].trim():a}static _deserializeRegexValue(a,L){if(Object(ue.C)(a)){if(L)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let y=a.indexOf("/"),l=a.lastIndexOf("/");if(y===l||y<0){if(L)throw new Error(`bad regexp-value '${a}', missing /-enclosure`);return console.warn(`bad regexp-value '${a}', missing /-enclosure`),null}let F=a.slice(y+1,l),j=a[l+1]==="i"?"i":"";try{return new RegExp(F,j)}catch(G){if(L)throw new Error(`bad regexp-value '${a}', parse error: ${G}`);return console.warn(`bad regexp-value '${a}', parse error: ${G}`),null}}}function B(a,L){const y=a?a.substituteConstants():void 0,l=L?L.substituteConstants():void 0;return!y&&!l?!0:!y||!l?!1:y.equals(l)}function n(a,L){return a.cmp(L)}class W{constructor(){this.type=0}cmp(a){return this.type-a.type}equals(a){return a.type===this.type}substituteConstants(){return this}evaluate(a){return!1}serialize(){return"false"}keys(){return[]}negate(){return D.INSTANCE}}W.INSTANCE=new W;class D{constructor(){this.type=1}cmp(a){return this.type-a.type}equals(a){return a.type===this.type}substituteConstants(){return this}evaluate(a){return!0}serialize(){return"true"}keys(){return[]}negate(){return W.INSTANCE}}D.INSTANCE=new D;class N{constructor(a,L){this.key=a,this.negated=L,this.type=2}static create(a,L=null){const y=ae.get(a);return typeof y=="boolean"?y?D.INSTANCE:W.INSTANCE:new N(a,L)}cmp(a){return a.type!==this.type?this.type-a.type:p(this.key,a.key)}equals(a){return a.type===this.type?this.key===a.key:!1}substituteConstants(){const a=ae.get(this.key);return typeof a=="boolean"?a?D.INSTANCE:W.INSTANCE:this}evaluate(a){return!!a.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=h.create(this.key,this)),this.negated}}class d{constructor(a,L,y){this.key=a,this.value=L,this.negated=y,this.type=4}static create(a,L,y=null){if(typeof L=="boolean")return L?N.create(a,y):h.create(a,y);const l=ae.get(a);if(typeof l=="boolean"){const F=l?"true":"false";return L===F?D.INSTANCE:W.INSTANCE}return new d(a,L,y)}cmp(a){return a.type!==this.type?this.type-a.type:i(this.key,this.value,a.key,a.value)}equals(a){return a.type===this.type?this.key===a.key&&this.value===a.value:!1}substituteConstants(){const a=ae.get(this.key);if(typeof a=="boolean"){const L=a?"true":"false";return this.value===L?D.INSTANCE:W.INSTANCE}return this}evaluate(a){return a.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=g.create(this.key,this.value,this)),this.negated}}class m{constructor(a,L){this.key=a,this.valueKey=L,this.type=10,this.negated=null}static create(a,L){return new m(a,L)}cmp(a){return a.type!==this.type?this.type-a.type:i(this.key,this.valueKey,a.key,a.valueKey)}equals(a){return a.type===this.type?this.key===a.key&&this.valueKey===a.valueKey:!1}substituteConstants(){return this}evaluate(a){const L=a.getValue(this.valueKey),y=a.getValue(this.key);return Array.isArray(L)?L.indexOf(y)>=0:typeof y=="string"&&typeof L=="object"&&L!==null?z.call(L,y):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=s.create(this)),this.negated}}class s{constructor(a){this._actual=a,this.type=11}static create(a){return new s(a)}cmp(a){return a.type!==this.type?this.type-a.type:this._actual.cmp(a._actual)}equals(a){return a.type===this.type?this._actual.equals(a._actual):!1}substituteConstants(){return this}evaluate(a){return!this._actual.evaluate(a)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class g{constructor(a,L,y){this.key=a,this.value=L,this.negated=y,this.type=5}static create(a,L,y=null){if(typeof L=="boolean")return L?h.create(a,y):N.create(a,y);const l=ae.get(a);if(typeof l=="boolean"){const F=l?"true":"false";return L===F?W.INSTANCE:D.INSTANCE}return new g(a,L,y)}cmp(a){return a.type!==this.type?this.type-a.type:i(this.key,this.value,a.key,a.value)}equals(a){return a.type===this.type?this.key===a.key&&this.value===a.value:!1}substituteConstants(){const a=ae.get(this.key);if(typeof a=="boolean"){const L=a?"true":"false";return this.value===L?W.INSTANCE:D.INSTANCE}return this}evaluate(a){return a.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 h{constructor(a,L){this.key=a,this.negated=L,this.type=3}static create(a,L=null){const y=ae.get(a);return typeof y=="boolean"?y?W.INSTANCE:D.INSTANCE:new h(a,L)}cmp(a){return a.type!==this.type?this.type-a.type:p(this.key,a.key)}equals(a){return a.type===this.type?this.key===a.key:!1}substituteConstants(){const a=ae.get(this.key);return typeof a=="boolean"?a?W.INSTANCE:D.INSTANCE:this}evaluate(a){return!a.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=N.create(this.key,this)),this.negated}}function _(a,L){if(typeof a=="string"){const y=parseFloat(a);isNaN(y)||(a=y)}return typeof a=="string"||typeof a=="number"?L(a):W.INSTANCE}class r{constructor(a,L,y){this.key=a,this.value=L,this.negated=y,this.type=12}static create(a,L,y=null){return _(L,l=>new r(a,l,y))}cmp(a){return a.type!==this.type?this.type-a.type:i(this.key,this.value,a.key,a.value)}equals(a){return a.type===this.type?this.key===a.key&&this.value===a.value:!1}substituteConstants(){return this}evaluate(a){return typeof this.value=="string"?!1:parseFloat(a.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=w.create(this.key,this.value,this)),this.negated}}class v{constructor(a,L,y){this.key=a,this.value=L,this.negated=y,this.type=13}static create(a,L,y=null){return _(L,l=>new v(a,l,y))}cmp(a){return a.type!==this.type?this.type-a.type:i(this.key,this.value,a.key,a.value)}equals(a){return a.type===this.type?this.key===a.key&&this.value===a.value:!1}substituteConstants(){return this}evaluate(a){return typeof this.value=="string"?!1:parseFloat(a.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(a,L,y){this.key=a,this.value=L,this.negated=y,this.type=14}static create(a,L,y=null){return _(L,l=>new S(a,l,y))}cmp(a){return a.type!==this.type?this.type-a.type:i(this.key,this.value,a.key,a.value)}equals(a){return a.type===this.type?this.key===a.key&&this.value===a.value:!1}substituteConstants(){return this}evaluate(a){return typeof this.value=="string"?!1:parseFloat(a.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=v.create(this.key,this.value,this)),this.negated}}class w{constructor(a,L,y){this.key=a,this.value=L,this.negated=y,this.type=15}static create(a,L,y=null){return _(L,l=>new w(a,l,y))}cmp(a){return a.type!==this.type?this.type-a.type:i(this.key,this.value,a.key,a.value)}equals(a){return a.type===this.type?this.key===a.key&&this.value===a.value:!1}substituteConstants(){return this}evaluate(a){return typeof this.value=="string"?!1:parseFloat(a.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=r.create(this.key,this.value,this)),this.negated}}class I{constructor(a,L){this.key=a,this.regexp=L,this.type=7,this.negated=null}static create(a,L){return new I(a,L)}cmp(a){if(a.type!==this.type)return this.type-a.type;if(this.key<a.key)return-1;if(this.key>a.key)return 1;const L=this.regexp?this.regexp.source:"",y=a.regexp?a.regexp.source:"";return L<y?-1:L>y?1:0}equals(a){if(a.type===this.type){const L=this.regexp?this.regexp.source:"",y=a.regexp?a.regexp.source:"";return this.key===a.key&&L===y}return!1}substituteConstants(){return this}evaluate(a){let L=a.getValue(this.key);return this.regexp?this.regexp.test(L):!1}serialize(){const a=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${a}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=E.create(this)),this.negated}}class E{constructor(a){this._actual=a,this.type=8}static create(a){return new E(a)}cmp(a){return a.type!==this.type?this.type-a.type:this._actual.cmp(a._actual)}equals(a){return a.type===this.type?this._actual.equals(a._actual):!1}substituteConstants(){return this}evaluate(a){return!this._actual.evaluate(a)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function x(a){let L=null;for(let y=0,l=a.length;y<l;y++){const F=a[y].substituteConstants();if(a[y]!==F&&L===null){L=[];for(let j=0;j<y;j++)L[j]=a[j]}L!==null&&(L[y]=F)}return L===null?a:L}class P{constructor(a,L){this.expr=a,this.negated=L,this.type=6}static create(a,L){return P._normalizeArr(a,L)}cmp(a){if(a.type!==this.type)return this.type-a.type;if(this.expr.length<a.expr.length)return-1;if(this.expr.length>a.expr.length)return 1;for(let L=0,y=this.expr.length;L<y;L++){const l=n(this.expr[L],a.expr[L]);if(l!==0)return l}return 0}equals(a){if(a.type===this.type){if(this.expr.length!==a.expr.length)return!1;for(let L=0,y=this.expr.length;L<y;L++)if(!this.expr[L].equals(a.expr[L]))return!1;return!0}return!1}substituteConstants(){const a=x(this.expr);return a===this.expr?this:P.create(a,this.negated)}evaluate(a){for(let L=0,y=this.expr.length;L<y;L++)if(!this.expr[L].evaluate(a))return!1;return!0}static _normalizeArr(a,L){const y=[];let l=!1;for(const F of a){if(!F)continue;if(F.type===1){l=!0;continue}if(F.type===0)return W.INSTANCE;if(F.type===6){y.push(...F.expr);continue}y.push(F)}if(y.length===0&&l)return D.INSTANCE;if(y.length===0)return;if(y.length===1)return y[0];y.sort(n);for(let F=1;F<y.length;F++)y[F-1].equals(y[F])&&(y.splice(F,1),F--);if(y.length===1)return y[0];for(;y.length>1;){const F=y[y.length-1];if(F.type!==9)break;y.pop();const j=y.pop(),G=y.length===0,Y=T.create(F.expr.map(te=>P.create([te,j],null)),null,G);Y&&(y.push(Y),y.sort(n))}return y.length===1?y[0]:new P(y,L)}serialize(){return this.expr.map(a=>a.serialize()).join(" && ")}keys(){const a=[];for(let L of this.expr)a.push(...L.keys());return a}negate(){if(!this.negated){const a=[];for(let L of this.expr)a.push(L.negate());this.negated=T.create(a,this,!0)}return this.negated}}class T{constructor(a,L){this.expr=a,this.negated=L,this.type=9}static create(a,L,y){return T._normalizeArr(a,L,y)}cmp(a){if(a.type!==this.type)return this.type-a.type;if(this.expr.length<a.expr.length)return-1;if(this.expr.length>a.expr.length)return 1;for(let L=0,y=this.expr.length;L<y;L++){const l=n(this.expr[L],a.expr[L]);if(l!==0)return l}return 0}equals(a){if(a.type===this.type){if(this.expr.length!==a.expr.length)return!1;for(let L=0,y=this.expr.length;L<y;L++)if(!this.expr[L].equals(a.expr[L]))return!1;return!0}return!1}substituteConstants(){const a=x(this.expr);return a===this.expr?this:T.create(a,this.negated,!1)}evaluate(a){for(let L=0,y=this.expr.length;L<y;L++)if(this.expr[L].evaluate(a))return!0;return!1}static _normalizeArr(a,L,y){let l=[],F=!1;if(a){for(let j=0,G=a.length;j<G;j++){const Y=a[j];if(!Y)continue;if(Y.type===0){F=!0;continue}if(Y.type===1)return D.INSTANCE;if(Y.type===9){l=l.concat(Y.expr);continue}l.push(Y)}if(l.length===0&&F)return W.INSTANCE;l.sort(n)}if(l.length===0)return;if(l.length===1)return l[0];for(let j=1;j<l.length;j++)l[j-1].equals(l[j])&&(l.splice(j,1),j--);if(l.length===1)return l[0];if(y){for(let j=0;j<l.length;j++)for(let G=j+1;G<l.length;G++)f(l[j],l[G])&&(l.splice(G,1),G--);if(l.length===1)return l[0]}return new T(l,L)}serialize(){return this.expr.map(a=>a.serialize()).join(" || ")}keys(){const a=[];for(let L of this.expr)a.push(...L.keys());return a}negate(){if(!this.negated){let a=[];for(let L of this.expr)a.push(L.negate());for(;a.length>1;){const L=a.shift(),y=a.shift(),l=[];for(const j of o(L))for(const G of o(y))l.push(P.create([j,G],null));const F=a.length===0;a.unshift(T.create(l,null,F))}this.negated=a[0]}return this.negated}}class A extends N{constructor(a,L,y){super(a,null);this._defaultValue=L,typeof y=="object"?A._info.push(Object.assign(Object.assign({},y),{key:a})):y!==!0&&A._info.push({key:a,description:y,type:L!=null?typeof L:void 0})}static all(){return A._info.values()}bindTo(a){return a.createKey(this.key,this._defaultValue)}getValue(a){return a.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(a){return d.create(this.key,a)}}A._info=[];const b=Object(re.c)("contextKeyService"),C="setContext";function p(a,L){return a<L?-1:a>L?1:0}function i(a,L,y,l){return a<y?-1:a>y?1:L<l?-1:L>l?1:0}function f(a,L){if(L.type===6&&a.type!==9&&a.type!==6){for(const F of L.expr)if(a.equals(F))return!0}const y=a.negate(),l=o(y).concat(o(L));l.sort(n);for(let F=0;F<l.length;F++){const j=l[F],G=j.negate();for(let Y=F+1;Y<l.length;Y++){const te=l[Y];if(G.equals(te))return!0}}return!1}function o(a){return a.type===9?a.expr:[a]}},TSYQ:function(We,ce,M){var q,ue;/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/(function(){"use strict";var re={}.hasOwnProperty,fe="[native code]";function ae(){for(var z=[],R=0;R<arguments.length;R++){var B=arguments[R];if(!B)continue;var n=typeof B;if(n==="string"||n==="number")z.push(B);else if(Array.isArray(B)){if(B.length){var W=ae.apply(null,B);W&&z.push(W)}}else if(n==="object"){if(B.toString!==Object.prototype.toString&&!B.toString.toString().includes("[native code]")){z.push(B.toString());continue}for(var D in B)re.call(B,D)&&B[D]&&z.push(D)}}return z.join(" ")}We.exports?(ae.default=ae,We.exports=ae):!(q=[],ue=function(){return ae}.apply(ce,q),ue!==void 0&&(We.exports=ue))})()},TXwP:function(We,ce,M){var q,ue;(function(){var re;(function(){"use strict";var ae=[,,function(n){function W(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=[]}W.prototype.clone_empty=function(){var d=new W(this.__parent);return d.set_indent(this.__indent_count,this.__alignment_count),d},W.prototype.item=function(d){return d<0?this.__items[this.__items.length+d]:this.__items[d]},W.prototype.has_match=function(d){for(var m=this.__items.length-1;m>=0;m--)if(this.__items[m].match(d))return!0;return!1},W.prototype.set_indent=function(d,m){this.is_empty()&&(this.__indent_count=d||0,this.__alignment_count=m||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},W.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)},W.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},W.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},W.prototype.is_empty=function(){return this.__items.length===0},W.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},W.prototype.push=function(d){this.__items.push(d);var m=d.lastIndexOf(`
`);m!==-1?this.__character_count=d.length-m:this.__character_count+=d.length},W.prototype.pop=function(){var d=null;return this.is_empty()||(d=this.__items.pop(),this.__character_count-=d.length),d},W.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},W.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},W.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},W.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 D(d,m){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)),m=m||"",d.indent_level>0&&(m=new Array(d.indent_level+1).join(this.__indent_string)),this.__base_string=m,this.__base_string_length=m.length}D.prototype.get_indent_size=function(d,m){var s=this.__base_string_length;return m=m||0,d<0&&(s=0),s+=d*this.__indent_size,s+=m,s},D.prototype.get_indent_string=function(d,m){var s=this.__base_string;return m=m||0,d<0&&(d=0,s=""),m+=d*this.__indent_size,this.__ensure_cache(m),s+=this.__cache[m],s},D.prototype.__ensure_cache=function(d){for(;d>=this.__cache.length;)this.__add_column()},D.prototype.__add_column=function(){var d=this.__cache.length,m=0,s="";this.__indent_size&&d>=this.__indent_size&&(m=Math.floor(d/this.__indent_size),d-=m*this.__indent_size,s=new Array(m+1).join(this.__indent_string)),d&&(s+=new Array(d+1).join(" ")),this.__cache.push(s)};function N(d,m){this.__indent_cache=new D(d,m),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 W(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}N.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},N.prototype.get_line_number=function(){return this.__lines.length},N.prototype.get_indent_string=function(d,m){return this.__indent_cache.get_indent_string(d,m)},N.prototype.get_indent_size=function(d,m){return this.__indent_cache.get_indent_size(d,m)},N.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},N.prototype.add_new_line=function(d){return this.is_empty()||!d&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},N.prototype.get_code=function(d){this.trim(!0);var m=this.current_line.pop();m&&(m[m.length-1]===`
`&&(m=m.replace(/\n+$/g,"")),this.current_line.push(m)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
`);return d!==`
`&&(s=s.replace(/[\n]/g,d)),s},N.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},N.prototype.set_indent=function(d,m){return d=d||0,m=m||0,this.next_line.set_indent(d,m),this.__lines.length>1?(this.current_line.set_indent(d,m),!0):(this.current_line.set_indent(),!1)},N.prototype.add_raw_token=function(d){for(var m=0;m<d.newlines;m++)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},N.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()},N.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(" "))},N.prototype.remove_indent=function(d){for(var m=this.__lines.length;d<m;)this.__lines[d]._remove_indent(),d++;this.current_line._remove_wrap_indent()},N.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},N.prototype.just_added_newline=function(){return this.current_line.is_empty()},N.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},N.prototype.ensure_empty_line_above=function(d,m){for(var s=this.__lines.length-2;s>=0;){var g=this.__lines[s];if(g.is_empty())break;if(g.item(0).indexOf(d)!==0&&g.item(-1)!==m){this.__lines.splice(s+1,0,new W(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},n.exports.Output=N},,,,function(n){function W(d,m){this.raw_options=D(d,m),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"])}W.prototype._get_array=function(d,m){var s=this.raw_options[d],g=m||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(g=s.concat()):typeof s=="string"&&(g=s.split(/[^a-zA-Z0-9_\/\-]+/)),g},W.prototype._get_boolean=function(d,m){var s=this.raw_options[d],g=s===void 0?!!m:!!s;return g},W.prototype._get_characters=function(d,m){var s=this.raw_options[d],g=m||"";return typeof s=="string"&&(g=s.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),g},W.prototype._get_number=function(d,m){var s=this.raw_options[d];m=parseInt(m,10),isNaN(m)&&(m=0);var g=parseInt(s,10);return isNaN(g)&&(g=m),g},W.prototype._get_selection=function(d,m,s){var g=this._get_selection_list(d,m,s);if(g.length!==1)throw new Error("Invalid Option Value: The option '"+d+`' can only be one of the following values:
`+m+`
You passed in: '`+this.raw_options[d]+"'");return g[0]},W.prototype._get_selection_list=function(d,m,s){if(!m||m.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[m[0]],!this._is_valid_selection(s,m))throw new Error("Invalid Default Value!");var g=this._get_array(d,s);if(!this._is_valid_selection(g,m))throw new Error("Invalid Option Value: The option '"+d+`' can contain only the following values:
`+m+`
You passed in: '`+this.raw_options[d]+"'");return g},W.prototype._is_valid_selection=function(d,m){return d.length&&m.length&&!d.some(function(s){return m.indexOf(s)===-1})};function D(d,m){var s={};d=N(d);var g;for(g in d)g!==m&&(s[g]=d[g]);if(m&&d[m])for(g in d[m])s[g]=d[m][g];return s}function N(d){var m={},s;for(s in d){var g=s.replace(/-/g,"_");m[g]=d[s]}return m}n.exports.Options=W,n.exports.normalizeOpts=N,n.exports.mergeOpts=D},,function(n){var W=RegExp.prototype.hasOwnProperty("sticky");function D(N){this.__input=N||"",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 N=null;return this.hasNext()&&(N=this.__input.charAt(this.__position),this.__position+=1),N},D.prototype.peek=function(N){var d=null;return N=N||0,N+=this.__position,N>=0&&N<this.__input_length&&(d=this.__input.charAt(N)),d},D.prototype.__match=function(N,d){N.lastIndex=d;var m=N.exec(this.__input);return m&&!(W&&N.sticky)&&(m.index!==d&&(m=null)),m},D.prototype.test=function(N,d){return d=d||0,d+=this.__position,d>=0&&d<this.__input_length?!!this.__match(N,d):!1},D.prototype.testChar=function(N,d){var m=this.peek(d);return N.lastIndex=0,m!==null&&N.test(m)},D.prototype.match=function(N){var d=this.__match(N,this.__position);return d?this.__position+=d[0].length:d=null,d},D.prototype.read=function(N,d,m){var s="",g;return N&&(g=this.match(N),g&&(s+=g[0])),d&&(g||!N)&&(s+=this.readUntil(d,m)),s},D.prototype.readUntil=function(N,d){var m="",s=this.__position;N.lastIndex=this.__position;var g=N.exec(this.__input);return g?(s=g.index,d&&(s+=g[0].length)):s=this.__input_length,m=this.__input.substring(this.__position,s),this.__position=s,m},D.prototype.readUntilAfter=function(N){return this.readUntil(N,!0)},D.prototype.get_regexp=function(N,d){var m=null,s="g";return d&&W&&(s="y"),typeof N=="string"&&N!==""?m=new RegExp(N,s):N&&(m=new RegExp(N.source,s)),m},D.prototype.get_literal_regexp=function(N){return RegExp(N.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},D.prototype.peekUntilAfter=function(N){var d=this.__position,m=this.readUntilAfter(N);return this.__position=d,m},D.prototype.lookBack=function(N){var d=this.__position-1;return d>=N.length&&this.__input.substring(d-N.length,d).toLowerCase()===N},n.exports.InputScanner=D},,,,,function(n){function W(D,N){D=typeof D=="string"?D:D.source,N=typeof N=="string"?N:N.source,this.__directives_block_pattern=new RegExp(D+/ beautify( \w+[:]\w+)+ /.source+N,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(D+/\sbeautify\signore:end\s/.source+N,"g")}W.prototype.get_directives=function(D){if(!D.match(this.__directives_block_pattern))return null;var N={};this.__directive_pattern.lastIndex=0;for(var d=this.__directive_pattern.exec(D);d;)N[d[1]]=d[2],d=this.__directive_pattern.exec(D);return N},W.prototype.readIgnored=function(D){return D.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=W},,function(n,W,D){var N=D(16).Beautifier,d=D(17).Options;function m(s,g){var h=new N(s,g);return h.beautify()}n.exports=m,n.exports.defaultOptions=function(){return new d}},function(n,W,D){var N=D(17).Options,d=D(2).Output,m=D(8).InputScanner,s=D(13).Directives,g=new s(/\/\*/,/\*\//),h=/\r\n|[\r\n]/,_=/\r\n|[\r\n]/g,r=/\s/,v=/(?:\s|\n)+/g,S=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,w=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function I(E,x){this._source_text=E||"",this._options=new N(x),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"]}I.prototype.eatString=function(E){var x="";for(this._ch=this._input.next();this._ch;){if(x+=this._ch,this._ch==="\\")x+=this._input.next();else if(E.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return x},I.prototype.eatWhitespace=function(E){for(var x=r.test(this._input.peek()),P=0;r.test(this._input.peek());)this._ch=this._input.next(),E&&this._ch===`
`&&((P===0||P<this._options.max_preserve_newlines)&&(P++,this._output.add_new_line(!0)));return x},I.prototype.foundNestedPseudoClass=function(){for(var E=0,x=1,P=this._input.peek(x);P;){if(P==="{")return!0;if(P==="(")E+=1;else if(P===")"){if(E===0)return!1;E-=1}else if(P===";"||P==="}")return!1;x++,P=this._input.peek(x)}return!1},I.prototype.print_string=function(E){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(E)},I.prototype.preserveSingleSpace=function(E){E&&(this._output.space_before_token=!0)},I.prototype.indent=function(){this._indentLevel++},I.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},I.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var E=this._source_text,x=this._options.eol;x==="auto"&&(x=`
`,E&&h.test(E||"")&&(x=E.match(h)[0])),E=E.replace(_,`
`);var P=E.match(/^[\t ]*/)[0];this._output=new d(this._options,P),this._input=new m(E),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var T=0,A=!1,b=!1,C=!1,p=!1,i=!1,f=!1,o=this._ch,a=!1,L,y,l;L=this._input.read(v),y=L!=="",l=o,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),o=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var F=this._input.read(S),j=g.get_directives(F);j&&j.ignore==="start"&&(F+=g.readIgnored(this._input)),this.print_string(F),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(w)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(y),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var G=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);G.match(/[ :]$/)&&(G=this.eatString(": ").replace(/\s$/,""),this.print_string(G),this._output.space_before_token=!0),G=G.replace(/\s$/,""),G==="extend"?p=!0:G==="import"&&(i=!0),G in this.NESTED_AT_RULE?(this._nestedLevel+=1,G in this.CONDITIONAL_GROUP_RULE&&(C=!0)):!A&&T===0&&G.indexOf(":")!==-1&&(b=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(y),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")b&&(b=!1,this.outdent()),C?(C=!1,A=this._indentLevel>=this._nestedLevel):A=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&A&&(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)):(l==="("?this._output.space_before_token=!1:l!==","&&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(),l==="{"&&this._output.trim(!0),i=!1,p=!1,b&&(this.outdent(),b=!1),this.print_string(this._ch),A=!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 Y=0;Y<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;Y++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[Y])){a=!0;break}(A||C)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!p&&T===0?(this.print_string(":"),b||(b=!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 te=l==='"'||l==="'";this.preserveSingleSpace(te||y),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")a=!1,T===0?(b&&(this.outdent(),b=!1),p=!1,i=!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(),T++,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(")")),T&&(T--,this.outdent()));else{var de=!1;this._input.lookBack("with")&&(de=!0),this.preserveSingleSpace(y||de),this.print_string(this._ch),b&&l==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),f=!0):(this.eatWhitespace(),T++,this.indent())}else if(this._ch===")")T&&(T--,this.outdent()),f&&this._input.peek()===";"&&this._options.selector_separator_newline&&(f=!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&&(!b||f)&&T===0&&!i&&!p?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!b&&T===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&r.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(y),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),r.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var ve=l==='"'||l==="'";this.preserveSingleSpace(ve||y),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&a&&this._output.add_new_line()}var he=this._output.get_code(x);return he},n.exports.Beautifier=I},function(n,W,D){var N=D(6).Options;function d(m){N.call(this,m,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var s=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||s;var g=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var h=0;h<g.length;h++)g[h]!=="expand"?this.brace_style="collapse":this.brace_style=g[h]}d.prototype=new N,n.exports.Options=d}],z={};function R(n){var W=z[n];if(W!==void 0)return W.exports;var D=z[n]={exports:{}};return ae[n](D,D.exports,R),D.exports}var B=R(15);re=B})();var fe=re;!(q=[],ue=function(){return{css_beautify:fe}}.apply(ce,q),ue!==void 0&&(We.exports=ue))})()},TcMa:function(We,ce,M){We.exports={desc:"desc___qlRMF",info:"info___JEaKq","commit-info":"commit-info___3-4e0"}},TqI3:function(We,ce,M){"use strict";M.d(ce,"a",function(){return q});function q(ue,re,fe,ae,z){var R=fe[ue]||{},B=fe[re]||{},n,W;R.fixed==="left"?n=ae.left[ue]:B.fixed==="right"&&(W=ae.right[re]);var D=!1,N=!1,d=!1,m=!1,s=fe[re+1],g=fe[ue-1];if(z==="rtl"){if(n!==void 0){var h=g&&g.fixed==="left";m=!h}else if(W!==void 0){var _=s&&s.fixed==="right";d=!_}}else if(n!==void 0){var r=s&&s.fixed==="left";D=!r}else if(W!==void 0){var v=g&&g.fixed==="right";N=!v}return{fixLeft:n,fixRight:W,lastFixLeft:D,firstFixRight:N,lastFixRight:d,firstFixLeft:m,isSticky:ae.isSticky}}},"U+Vu":function(We,ce,M){"use strict";M.d(ce,"a",function(){return B}),M.d(ce,"b",function(){return n});var q=M("36hc"),ue=M("T/Jt"),re=M.n(ue),fe=M("s7W6"),ae=M("HnKm"),z=M("1HCi"),R=M.n(z);function B(){var W=ue.createContext(null),D=function(d){var m=d.value,s=d.children,g=ue.useRef(m);g.current=m;var h=ue.useState(function(){return{getValue:function(){return g.current},listeners:new Set}}),_=Object(q.a)(h,1),r=_[0];return Object(fe.a)(function(){r.listeners.forEach(function(v){v(m)})},[m]),ue.createElement(W.Provider,{value:r},s)};return{Context:W,Provider:D}}function n(W,D){var N=Object(ae.a)(D),d=ue.useContext(W==null?void 0:W.Context),m=d||{},s=m.listeners,g=m.getValue,h=ue.useState(function(){return N(d?g():null)}),_=Object(q.a)(h,2),r=_[0],v=_[1];return Object(fe.a)(function(){if(!d)return;function S(w){v(function(I){var E=N(w);return R()(I,E)?I:E})}return s.add(S),function(){s.delete(S)}},[d]),r}},U8pU:function(We,ce,M){"use strict";M.d(ce,"a",function(){return q});function q(ue){return q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(re){return typeof re}:function(re){return re&&typeof Symbol=="function"&&re.constructor===Symbol&&re!==Symbol.prototype?"symbol":typeof re},q(ue)}},UZu5:function(We,ce,M){},VEzc:function(We,ce,M){We.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"}},VTBJ:function(We,ce,M){"use strict";M.d(ce,"a",function(){return re});var q=M("rePB");function ue(fe,ae){var z=Object.keys(fe);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(fe);ae&&(R=R.filter(function(B){return Object.getOwnPropertyDescriptor(fe,B).enumerable})),z.push.apply(z,R)}return z}function re(fe){for(var ae=1;ae<arguments.length;ae++){var z=arguments[ae]!=null?arguments[ae]:{};ae%2?ue(Object(z),!0).forEach(function(R){Object(q.a)(fe,R,z[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(fe,Object.getOwnPropertyDescriptors(z)):ue(Object(z)).forEach(function(R){Object.defineProperty(fe,R,Object.getOwnPropertyDescriptor(z,R))})}return fe}},VUat:function(We,ce,M){"use strict";M.d(ce,"a",function(){return q});var q={}},VbWF:function(We,ce,M){"use strict";var q=M("T/Jt"),ue=M.n(q),re=q.createContext({renderWithProps:!1});ce.a=re},Vhoy:function(We,ce,M){"use strict";M.d(ce,"d",function(){return fe}),M.d(ce,"e",function(){return ae}),M.d(ce,"c",function(){return z}),M.d(ce,"b",function(){return R}),M.d(ce,"a",function(){return B});var q=M("MI8n");class ue{constructor(){this._icons=new Map,this._onDidRegister=new q.b}add(n){const W=this._icons.get(n.id);W?n.description?W.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 re=new ue,fe=re;function ae(n,W){return new R(n,W)}function z(n){return n?n.replace(/\$\((.*?)\)/g,(W,D)=>` ${D} `).trim():""}class R{constructor(n,W,D){this.id=n,this.definition=W,this.description=D,re.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var B;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9\\-]+",n.iconModifierExpression="~[A-Za-z]+";const W=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function D(m){if(m instanceof R)return["codicon","codicon-"+m.id];const s=W.exec(m.id);if(!s)return D(R.error);let[,g,h]=s;const _=["codicon","codicon-"+g];return h&&_.push("codicon-modifier-"+h.substr(1)),_}n.asClassNameArray=D;function N(m){return D(m).join(" ")}n.asClassName=N;function d(m){return"."+D(m).join(".")}n.asCSSSelector=d})(B||(B={})),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"})}(R||(R={}))},"VrN/":function(We,ce,M){(function(q,ue){We.exports=ue()})(this,function(){"use strict";var q=navigator.userAgent,ue=navigator.platform,re=/gecko\/\d/i.test(q),fe=/MSIE \d/.test(q),ae=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(q),z=/Edge\/(\d+)/.exec(q),R=fe||ae||z,B=R&&(fe?document.documentMode||6:+(z||ae)[1]),n=!z&&/WebKit\//.test(q),W=n&&/Qt\/\d+\.\d+/.test(q),D=!z&&/Chrome\//.test(q),N=/Opera\//.test(q),d=/Apple Computer/.test(navigator.vendor),m=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(q),s=/PhantomJS/.test(q),g=!z&&/AppleWebKit/.test(q)&&/Mobile\/\w+/.test(q),h=/Android/.test(q),_=g||h||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(q),r=g||/Mac/.test(ue),v=/\bCrOS\b/.test(q),S=/win/i.test(ue),w=N&&q.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(N=!1,n=!0);var I=r&&(W||N&&(w==null||w<12.11)),E=re||R&&B>=9;function x(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var P=function(e,t){var c=e.className,u=x(t).exec(c);if(u){var O=c.slice(u.index+u[0].length);e.className=c.slice(0,u.index)+(O?u[1]+O:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function A(e,t){return T(e).appendChild(t)}function b(e,t,c,u){var O=document.createElement(e);if(c&&(O.className=c),u&&(O.style.cssText=u),typeof t=="string")O.appendChild(document.createTextNode(t));else if(t)for(var K=0;K<t.length;++K)O.appendChild(t[K]);return O}function C(e,t,c,u){var O=b(e,t,c,u);return O.setAttribute("role","presentation"),O}var p;document.createRange?p=function(e,t,c,u){var O=document.createRange();return O.setEnd(u||e,c),O.setStart(e,t),O}:p=function(e,t,c){var u=document.body.createTextRange();try{u.moveToElementText(e.parentNode)}catch(O){return u}return u.collapse(!0),u.moveEnd("character",c),u.moveStart("character",t),u};function i(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 f(){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 o(e,t){var c=e.className;x(t).test(c)||(e.className+=(c?" ":"")+t)}function a(e,t){for(var c=e.split(" "),u=0;u<c.length;u++)c[u]&&!x(c[u]).test(t)&&(t+=" "+c[u]);return t}var L=function(e){e.select()};g?L=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:R&&(L=function(e){try{e.select()}catch(t){}});function y(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function l(e,t,c){t||(t={});for(var u in e)e.hasOwnProperty(u)&&(c!==!1||!t.hasOwnProperty(u))&&(t[u]=e[u]);return t}function F(e,t,c,u,O){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var K=u||0,Z=O||0;;){var ne=e.indexOf(" ",K);if(ne<0||ne>=t)return Z+(t-K);Z+=ne-K,Z+=c-Z%c,K=ne+1}}var j=function(){this.id=null,this.f=null,this.time=0,this.handler=y(this.onTimeout,this)};j.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},j.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 G(e,t){for(var c=0;c<e.length;++c)if(e[c]==t)return c;return-1}var Y=50,te={toString:function(){return"CodeMirror.Pass"}},de={scroll:!1},ve={origin:"*mouse"},he={origin:"+move"};function Re(e,t,c){for(var u=0,O=0;;){var K=e.indexOf(" ",u);K==-1&&(K=e.length);var Z=K-u;if(K==e.length||O+Z>=t)return u+Math.min(Z,t-O);if(O+=K-u,O+=c-O%c,u=K+1,O>=t)return u}}var we=[""];function ge(e){for(;we.length<=e;)we.push(Ne(we)+" ");return we[e]}function Ne(e){return e[e.length-1]}function ze(e,t){for(var c=[],u=0;u<e.length;u++)c[u]=t(e[u],u);return c}function nt(e,t,c){for(var u=0,O=c(t);u<e.length&&c(e[u])<=O;)u++;e.splice(u,0,t)}function Ge(){}function Xe(e,t){var c;return Object.create?c=Object.create(e):(Ge.prototype=e,c=new Ge),t&&l(t,c),c}var Be=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function _e(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Be.test(e))}function Ze(e,t){return t?t.source.indexOf("\\w")>-1&&_e(e)?!0:t.test(e):_e(e)}function be(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Le=/[\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 le(e){return e.charCodeAt(0)>=768&&Le.test(e)}function ye(e,t,c){for(;(c<0?t>0:t<e.length)&&le(e.charAt(t));)t+=c;return t}function Te(e,t,c){for(var u=t>c?-1:1;;){if(t==c)return t;var O=(t+c)/2,K=u<0?Math.ceil(O):Math.floor(O);if(K==t)return e(K)?t:c;e(K)?c=K:t=K+u}}function Pe(e,t,c,u){if(!e)return u(t,c,"ltr",0);for(var O=!1,K=0;K<e.length;++K){var Z=e[K];(Z.from<c&&Z.to>t||t==c&&Z.to==t)&&(u(Math.max(Z.from,t),Math.min(Z.to,c),Z.level==1?"rtl":"ltr",K),O=!0)}O||u(t,c,"ltr")}var He=null;function Ye(e,t,c){var u;He=null;for(var O=0;O<e.length;++O){var K=e[O];if(K.from<t&&K.to>t)return O;K.to==t&&(K.from!=K.to&&c=="before"?u=O:He=O),K.from==t&&(K.from!=K.to&&c!="before"?u=O:He=O)}return u!=null?u:He}var ct=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function c(pe){return pe<=247?e.charAt(pe):1424<=pe&&pe<=1524?"R":1536<=pe&&pe<=1785?t.charAt(pe-1536):1774<=pe&&pe<=2220?"r":8192<=pe&&pe<=8203?"w":pe==8204?"b":"L"}var u=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,O=/[stwN]/,K=/[LRr]/,Z=/[Lb1n]/,ne=/[1n]/;function oe(pe,je,Ke){this.level=pe,this.from=je,this.to=Ke}return function(pe,je){var Ke=je=="ltr"?"L":"R";if(pe.length==0||je=="ltr"&&!u.test(pe))return!1;for(var ut=pe.length,at=[],Ot=0;Ot<ut;++Ot)at.push(c(pe.charCodeAt(Ot)));for(var Ut=0,Gt=Ke;Ut<ut;++Ut){var Jt=at[Ut];Jt=="m"?at[Ut]=Gt:Gt=Jt}for(var rn=0,Qt=Ke;rn<ut;++rn){var dn=at[rn];dn=="1"&&Qt=="r"?at[rn]="n":K.test(dn)&&(Qt=dn,dn=="r"&&(at[rn]="R"))}for(var Pn=1,On=at[0];Pn<ut-1;++Pn){var or=at[Pn];or=="+"&&On=="1"&&at[Pn+1]=="1"?at[Pn]="1":or==","&&On==at[Pn+1]&&(On=="1"||On=="n")&&(at[Pn]=On),On=or}for(var Lr=0;Lr<ut;++Lr){var li=at[Lr];if(li==",")at[Lr]="N";else if(li=="%"){var Br=void 0;for(Br=Lr+1;Br<ut&&at[Br]=="%";++Br);for(var Mi=Lr&&at[Lr-1]=="!"||Br<ut&&at[Br]=="1"?"1":"N",wi=Lr;wi<Br;++wi)at[wi]=Mi;Lr=Br-1}}for(var Jr=0,Ti=Ke;Jr<ut;++Jr){var pi=at[Jr];Ti=="L"&&pi=="1"?at[Jr]="L":K.test(pi)&&(Ti=pi)}for(var ni=0;ni<ut;++ni)if(O.test(at[ni])){var Qr=void 0;for(Qr=ni+1;Qr<ut&&O.test(at[Qr]);++Qr);for(var Kr=(ni?at[ni-1]:Ke)=="L",Ci=(Qr<ut?at[Qr]:Ke)=="L",La=Kr==Ci?Kr?"L":"R":Ke,la=ni;la<Qr;++la)at[la]=La;ni=Qr-1}for(var gi=[],Ji,ui=0;ui<ut;)if(Z.test(at[ui])){var jo=ui;for(++ui;ui<ut&&Z.test(at[ui]);++ui);gi.push(new oe(0,jo,ui))}else{var qi=ui,ma=gi.length,ga=je=="rtl"?1:0;for(++ui;ui<ut&&at[ui]!="L";++ui);for(var Ei=qi;Ei<ui;)if(ne.test(at[Ei])){qi<Ei&&(gi.splice(ma,0,new oe(1,qi,Ei)),ma+=ga);var Ia=Ei;for(++Ei;Ei<ui&&ne.test(at[Ei]);++Ei);gi.splice(ma,0,new oe(2,Ia,Ei)),ma+=ga,qi=Ei}else++Ei;qi<ui&&gi.splice(ma,0,new oe(1,qi,ui))}return je=="ltr"&&(gi[0].level==1&&(Ji=pe.match(/^\s+/))&&(gi[0].from=Ji[0].length,gi.unshift(new oe(0,0,Ji[0].length))),Ne(gi).level==1&&(Ji=pe.match(/\s+$/))&&(Ne(gi).to-=Ji[0].length,gi.push(new oe(0,ut-Ji[0].length,ut)))),je=="rtl"?gi.reverse():gi}}();function st(e,t){var c=e.order;return c==null&&(c=e.order=ct(e.text,t)),c}var vt=[],qe=function(e,t,c){if(e.addEventListener)e.addEventListener(t,c,!1);else if(e.attachEvent)e.attachEvent("on"+t,c);else{var u=e._handlers||(e._handlers={});u[t]=(u[t]||vt).concat(c)}};function mt(e,t){return e._handlers&&e._handlers[t]||vt}function yt(e,t,c){if(e.removeEventListener)e.removeEventListener(t,c,!1);else if(e.detachEvent)e.detachEvent("on"+t,c);else{var u=e._handlers,O=u&&u[t];if(O){var K=G(O,c);K>-1&&(u[t]=O.slice(0,K).concat(O.slice(K+1)))}}}function Je(e,t){var c=mt(e,t);if(!c.length)return;for(var u=Array.prototype.slice.call(arguments,2),O=0;O<c.length;++O)c[O].apply(null,u)}function et(e,t,c){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Je(e,c||t.type,e,t),Oe(t)||t.codemirrorIgnore}function De(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var c=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),u=0;u<t.length;++u)G(c,t[u])==-1&&c.push(t[u])}function ke(e,t){return mt(e,t).length>0}function Me(e){e.prototype.on=function(t,c){qe(this,t,c)},e.prototype.off=function(t,c){yt(this,t,c)}}function me(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ce(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Oe(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Se(e){me(e),Ce(e)}function Fe(e){return e.target||e.srcElement}function it(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),r&&e.ctrlKey&&t==1&&(t=3),t}var Ie=function(){if(R&&B<9)return!1;var e=b("div");return"draggable"in e||"dragDrop"in e}(),Qe;function rt(e){if(Qe==null){var t=b("span","\u200B");A(e,b("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Qe=t.offsetWidth<=1&&t.offsetHeight>2&&!(R&&B<8))}var c=Qe?b("span","\u200B"):b("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return c.setAttribute("cm-text",""),c}var ft;function It(e){if(ft!=null)return ft;var t=A(e,document.createTextNode("A\u062EA")),c=p(t,0,1).getBoundingClientRect(),u=p(t,1,2).getBoundingClientRect();return T(e),!c||c.left==c.right?!1:ft=u.right-c.right<3}var Tt=`
b`.split(/\n/).length!=3?function(e){for(var t=0,c=[],u=e.length;t<=u;){var O=e.indexOf(`
`,t);O==-1&&(O=e.length);var K=e.slice(t,e.charAt(O-1)=="\r"?O-1:O),Z=K.indexOf("\r");Z!=-1?(c.push(K.slice(0,Z)),t+=Z+1):(c.push(K),t=O+1)}return c}:function(e){return e.split(/\r\n?|\n/)},Et=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},Ct=function(){var e=b("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),dt=null;function Nt(e){if(dt!=null)return dt;var t=A(e,b("span","x")),c=t.getBoundingClientRect(),u=p(t,0,1).getBoundingClientRect();return dt=Math.abs(c.left-u.left)>1}var Xt={},Dt={};function an(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Xt[e]=t}function nn(e,t){Dt[e]=t}function An(e){if(typeof e=="string"&&Dt.hasOwnProperty(e))e=Dt[e];else if(e&&typeof e.name=="string"&&Dt.hasOwnProperty(e.name)){var t=Dt[e.name];typeof t=="string"&&(t={name:t}),e=Xe(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return An("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return An("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function _n(e,t){t=An(t);var c=Xt[t.name];if(!c)return _n(e,"text/plain");var u=c(e,t);if(At.hasOwnProperty(t.name)){var O=At[t.name];for(var K in O){if(!O.hasOwnProperty(K))continue;u.hasOwnProperty(K)&&(u["_"+K]=u[K]),u[K]=O[K]}}if(u.name=t.name,t.helperType&&(u.helperType=t.helperType),t.modeProps)for(var Z in t.modeProps)u[Z]=t.modeProps[Z];return u}var At={};function jt(e,t){var c=At.hasOwnProperty(e)?At[e]:At[e]={};l(t,c)}function on(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var c={};for(var u in t){var O=t[u];O instanceof Array&&(O=O.concat([])),c[u]=O}return c}function Ee(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 H=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};H.prototype.eol=function(){return this.pos>=this.string.length},H.prototype.sol=function(){return this.pos==this.lineStart},H.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},H.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},H.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},H.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},H.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},H.prototype.skipToEnd=function(){this.pos=this.string.length},H.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},H.prototype.backUp=function(e){this.pos-=e},H.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=F(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},H.prototype.indentation=function(){return F(this.string,null,this.tabSize)-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},H.prototype.match=function(e,t,c){if(typeof e=="string"){var u=function(Z){return c?Z.toLowerCase():Z},O=this.string.substr(this.pos,e.length);if(u(O)==u(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)}},H.prototype.current=function(){return this.string.slice(this.start,this.pos)},H.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},H.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},H.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function V(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 u=0;;++u){var O=c.children[u],K=O.chunkSize();if(t<K){c=O;break}t-=K}return c.lines[t]}function $(e,t,c){var u=[],O=t.line;return e.iter(t.line,c.line+1,function(K){var Z=K.text;O==c.line&&(Z=Z.slice(0,c.ch)),O==t.line&&(Z=Z.slice(t.ch)),u.push(Z),++O}),u}function ee(e,t,c){var u=[];return e.iter(t,c,function(O){u.push(O.text)}),u}function xe(e,t){var c=t-e.height;if(c)for(var u=e;u;u=u.parent)u.height+=c}function Ue(e){if(e.parent==null)return null;for(var t=e.parent,c=G(t.lines,e),u=t.parent;u;t=u,u=u.parent)for(var O=0;!(u.children[O]==t);++O)c+=u.children[O].chunkSize();return c+t.first}function $e(e,t){var c=e.first;e:do{for(var u=0;u<e.children.length;++u){var O=e.children[u],K=O.height;if(t<K){e=O;continue e}t-=K,c+=O.chunkSize()}return c}while(!e.lines);for(var Z=0;Z<e.lines.length;++Z){var ne=e.lines[Z],oe=ne.height;if(t<oe)break;t-=oe}return c+Z}function pt(e,t){return t>=e.first&&t<e.first+e.size}function xt(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Ve(e,t,c){if(c===void 0&&(c=null),!(this instanceof Ve))return new Ve(e,t,c);this.line=e,this.ch=t,this.sticky=c}function ht(e,t){return e.line-t.line||e.ch-t.ch}function Rt(e,t){return e.sticky==t.sticky&&ht(e,t)==0}function lt(e){return Ve(e.line,e.ch)}function Pt(e,t){return ht(e,t)<0?t:e}function Wt(e,t){return ht(e,t)<0?e:t}function Bt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function wt(e,t){if(t.line<e.first)return Ve(e.first,0);var c=e.first+e.size-1;return t.line>c?Ve(c,V(e,c).text.length):Q(t,V(e,t.line).text.length)}function Q(e,t){var c=e.ch;return c==null||c>t?Ve(e.line,t):c<0?Ve(e.line,0):e}function k(e,t){for(var c=[],u=0;u<t.length;u++)c[u]=wt(e,t[u]);return c}var U=function(e,t){this.state=e,this.lookAhead=t},X=function(e,t,c,u){this.state=t,this.doc=e,this.line=c,this.maxLookAhead=u||0,this.baseTokens=null,this.baseTokenPos=1};X.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},X.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}},X.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},X.fromSaved=function(e,t,c){return t instanceof U?new X(e,on(e.mode,t.state),c,t.lookAhead):new X(e,on(e.mode,t),c)},X.prototype.save=function(e){var t=e!==!1?on(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new U(t,this.maxLookAhead):t};function ie(e,t,c,u){var O=[e.state.modeGen],K={};Mn(e,t.text,e.doc.mode,c,function(pe,je){return O.push(pe,je)},K,u);for(var Z=c.state,ne=function(pe){c.baseTokens=O;var je=e.state.overlays[pe],Ke=1,ut=0;c.state=!0,Mn(e,t.text,je.mode,c,function(at,Ot){for(var Ut=Ke;ut<at;){var Gt=O[Ke];Gt>at&&O.splice(Ke,1,at,O[Ke+1],Gt),Ke+=2,ut=Math.min(at,Gt)}if(!Ot)return;if(je.opaque)O.splice(Ut,Ke-Ut,at,"overlay "+Ot),Ke=Ut+2;else for(;Ut<Ke;Ut+=2){var Jt=O[Ut+1];O[Ut+1]=(Jt?Jt+" ":"")+"overlay "+Ot}},K),c.state=Z,c.baseTokens=null,c.baseTokenPos=1},oe=0;oe<e.state.overlays.length;++oe)ne(oe);return{styles:O,classes:K.bgClass||K.textClass?K:null}}function J(e,t,c){if(!t.styles||t.styles[0]!=e.state.modeGen){var u=Ae(e,Ue(t)),O=t.text.length>e.options.maxHighlightLength&&on(e.doc.mode,u.state),K=ie(e,t,u);O&&(u.state=O),t.stateAfter=u.save(!O),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 Ae(e,t,c){var u=e.doc,O=e.display;if(!u.mode.startState)return new X(u,!0,t);var K=lr(e,t,c),Z=K>u.first&&V(u,K-1).stateAfter,ne=Z?X.fromSaved(u,Z,K):new X(u,se(u.mode),K);return u.iter(K,t,function(oe){tt(e,oe.text,ne);var pe=ne.line;oe.stateAfter=pe==t-1||pe%5==0||pe>=O.viewFrom&&pe<O.viewTo?ne.save():null,ne.nextLine()}),c&&(u.modeFrontier=ne.line),ne}function tt(e,t,c,u){var O=e.doc.mode,K=new H(t,e.options.tabSize,c);for(K.start=K.pos=u||0,t==""&&kt(O,c.state);!K.eol();)Mt(O,K,c.state),K.start=K.pos}function kt(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var c=Ee(e,t);if(c.mode.blankLine)return c.mode.blankLine(c.state)}function Mt(e,t,c,u){for(var O=0;O<10;O++){u&&(u[0]=Ee(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 gt=function(e,t,c){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=c};function $t(e,t,c,u){var O=e.doc,K=O.mode,Z;t=wt(O,t);var ne=V(O,t.line),oe=Ae(e,t.line,c),pe=new H(ne.text,e.options.tabSize,oe),je;for(u&&(je=[]);(u||pe.pos<t.ch)&&!pe.eol();)pe.start=pe.pos,Z=Mt(K,pe,oe.state),u&&je.push(new gt(pe,Z,on(O.mode,oe.state)));return u?je:new gt(pe,Z,oe.state)}function mn(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 u=c[1]?"bgClass":"textClass";t[u]==null?t[u]=c[2]:new RegExp("(?:^|\\s)"+c[2]+"(?:$|\\s)").test(t[u])||(t[u]+=" "+c[2])}return e}function Mn(e,t,c,u,O,K,Z){var ne=c.flattenSpans;ne==null&&(ne=e.options.flattenSpans);var oe=0,pe=null,je=new H(t,e.options.tabSize,u),Ke,ut=e.options.addModeClass&&[null];for(t==""&&mn(kt(c,u.state),K);!je.eol();){if(je.pos>e.options.maxHighlightLength?(ne=!1,Z&&tt(e,t,u,je.pos),je.pos=t.length,Ke=null):Ke=mn(Mt(c,je,u.state,ut),K),ut){var at=ut[0].name;at&&(Ke="m-"+(Ke?at+" "+Ke:at))}if(!ne||pe!=Ke){for(;oe<je.start;)oe=Math.min(je.start,oe+5e3),O(oe,pe);pe=Ke}je.start=je.pos}for(;oe<je.pos;){var Ot=Math.min(je.pos,oe+5e3);O(Ot,pe),oe=Ot}}function lr(e,t,c){for(var u,O,K=e.doc,Z=c?-1:t-(e.doc.mode.innerMode?1e3:100),ne=t;ne>Z;--ne){if(ne<=K.first)return K.first;var oe=V(K,ne-1),pe=oe.stateAfter;if(pe&&(!c||ne+(pe instanceof U?pe.lookAhead:0)<=K.modeFrontier))return ne;var je=F(oe.text,null,e.options.tabSize);(O==null||u>je)&&(O=ne-1,u=je)}return O}function Kn(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var c=e.first,u=t-1;u>c;u--){var O=V(e,u).stateAfter;if(O&&(!(O instanceof U)||u+O.lookAhead<t)){c=u+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,c)}var ur=!1,dr=!1;function hr(){ur=!0}function Dr(){dr=!0}function Cr(e,t,c){this.marker=e,this.from=t,this.to=c}function Wn(e,t){if(e)for(var c=0;c<e.length;++c){var u=e[c];if(u.marker==t)return u}}function Er(e,t){for(var c,u=0;u<e.length;++u)e[u]!=t&&(c||(c=[])).push(e[u]);return c}function zr(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function vi(e,t,c){var u;if(e)for(var O=0;O<e.length;++O){var K=e[O],Z=K.marker,ne=K.from==null||(Z.inclusiveLeft?K.from<=t:K.from<t);if(ne||K.from==t&&Z.type=="bookmark"&&(!c||!K.marker.insertLeft)){var oe=K.to==null||(Z.inclusiveRight?K.to>=t:K.to>t);(u||(u=[])).push(new Cr(Z,K.from,oe?null:K.to))}}return u}function xr(e,t,c){var u;if(e)for(var O=0;O<e.length;++O){var K=e[O],Z=K.marker,ne=K.to==null||(Z.inclusiveRight?K.to>=t:K.to>t);if(ne||K.from==t&&Z.type=="bookmark"&&(!c||K.marker.insertLeft)){var oe=K.from==null||(Z.inclusiveLeft?K.from<=t:K.from<t);(u||(u=[])).push(new Cr(Z,oe?null:K.from-t,K.to==null?null:K.to-t))}}return u}function Zr(e,t){if(t.full)return null;var c=pt(e,t.from.line)&&V(e,t.from.line).markedSpans,u=pt(e,t.to.line)&&V(e,t.to.line).markedSpans;if(!c&&!u)return null;var O=t.from.ch,K=t.to.ch,Z=ht(t.from,t.to)==0,ne=vi(c,O,Z),oe=xr(u,K,Z),pe=t.text.length==1,je=Ne(t.text).length+(pe?O:0);if(ne)for(var Ke=0;Ke<ne.length;++Ke){var ut=ne[Ke];if(ut.to==null){var at=Wn(oe,ut.marker);at?pe&&(ut.to=at.to==null?null:at.to+je):ut.to=O}}if(oe)for(var Ot=0;Ot<oe.length;++Ot){var Ut=oe[Ot];if(Ut.to!=null&&(Ut.to+=je),Ut.from==null){var Gt=Wn(ne,Ut.marker);Gt||(Ut.from=je,pe&&(ne||(ne=[])).push(Ut))}else Ut.from+=je,pe&&(ne||(ne=[])).push(Ut)}ne&&(ne=_i(ne)),oe&&oe!=ne&&(oe=_i(oe));var Jt=[ne];if(!pe){var rn=t.text.length-2,Qt;if(rn>0&&ne)for(var dn=0;dn<ne.length;++dn)ne[dn].to==null&&(Qt||(Qt=[])).push(new Cr(ne[dn].marker,null,null));for(var Pn=0;Pn<rn;++Pn)Jt.push(Qt);Jt.push(oe)}return Jt}function _i(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 yi(e,t,c){var u=null;if(e.iter(t.line,c.line+1,function(at){if(at.markedSpans)for(var Ot=0;Ot<at.markedSpans.length;++Ot){var Ut=at.markedSpans[Ot].marker;Ut.readOnly&&(!u||G(u,Ut)==-1)&&(u||(u=[])).push(Ut)}}),!u)return null;for(var O=[{from:t,to:c}],K=0;K<u.length;++K)for(var Z=u[K],ne=Z.find(0),oe=0;oe<O.length;++oe){var pe=O[oe];if(ht(pe.to,ne.from)<0||ht(pe.from,ne.to)>0)continue;var je=[oe,1],Ke=ht(pe.from,ne.from),ut=ht(pe.to,ne.to);(Ke<0||!Z.inclusiveLeft&&!Ke)&&je.push({from:pe.from,to:ne.from}),(ut>0||!Z.inclusiveRight&&!ut)&&je.push({from:ne.to,to:pe.to}),O.splice.apply(O,je),oe+=je.length-3}return O}function qr(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 di(e,t){if(!t)return;for(var c=0;c<t.length;++c)t[c].marker.attachLine(e);e.markedSpans=t}function Pr(e){return e.inclusiveLeft?-1:0}function Nr(e){return e.inclusiveRight?1:0}function Sr(e,t){var c=e.lines.length-t.lines.length;if(c!=0)return c;var u=e.find(),O=t.find(),K=ht(u.from,O.from)||Pr(e)-Pr(t);if(K)return-K;var Z=ht(u.to,O.to)||Nr(e)-Nr(t);return Z||t.id-e.id}function Qn(e,t){var c=dr&&e.markedSpans,u;if(c)for(var O=void 0,K=0;K<c.length;++K)O=c[K],O.marker.collapsed&&(t?O.from:O.to)==null&&(!u||Sr(u,O.marker)<0)&&(u=O.marker);return u}function Or(e){return Qn(e,!0)}function er(e){return Qn(e,!1)}function Wr(e,t){var c=dr&&e.markedSpans,u;if(c)for(var O=0;O<c.length;++O){var K=c[O];K.marker.collapsed&&(K.from==null||K.from<t)&&(K.to==null||K.to>t)&&(!u||Sr(u,K.marker)<0)&&(u=K.marker)}return u}function Rr(e,t,c,u,O){var K=V(e,t),Z=dr&&K.markedSpans;if(Z)for(var ne=0;ne<Z.length;++ne){var oe=Z[ne];if(!oe.marker.collapsed)continue;var pe=oe.marker.find(0),je=ht(pe.from,c)||Pr(oe.marker)-Pr(O),Ke=ht(pe.to,u)||Nr(oe.marker)-Nr(O);if(je>=0&&Ke<=0||je<=0&&Ke>=0)continue;if(je<=0&&(oe.marker.inclusiveRight&&O.inclusiveLeft?ht(pe.to,c)>=0:ht(pe.to,c)>0)||je>=0&&(oe.marker.inclusiveRight&&O.inclusiveLeft?ht(pe.from,u)<=0:ht(pe.from,u)<0))return!0}}function Vr(e){for(var t;t=Or(e);)e=t.find(-1,!0).line;return e}function Ar(e){for(var t;t=er(e);)e=t.find(1,!0).line;return e}function Ri(e){for(var t,c;t=er(e);)e=t.find(1,!0).line,(c||(c=[])).push(e);return c}function Hi(e,t){var c=V(e,t),u=Vr(c);return c==u?t:Ue(u)}function ri(e,t){if(t>e.lastLine())return t;var c=V(e,t),u;if(!Ur(e,c))return t;for(;u=er(c);)c=u.find(1,!0).line;return Ue(c)+1}function Ur(e,t){var c=dr&&t.markedSpans;if(c)for(var u=void 0,O=0;O<c.length;++O){if(u=c[O],!u.marker.collapsed)continue;if(u.from==null)return!0;if(u.marker.widgetNode)continue;if(u.from==0&&u.marker.inclusiveLeft&&ci(e,t,u))return!0}}function ci(e,t,c){if(c.to==null){var u=c.marker.find(1,!0);return ci(e,u.line,Wn(u.line.markedSpans,c.marker))}if(c.marker.inclusiveRight&&c.to==t.text.length)return!0;for(var O=void 0,K=0;K<t.markedSpans.length;++K)if(O=t.markedSpans[K],O.marker.collapsed&&!O.marker.widgetNode&&O.from==c.to&&(O.to==null||O.to!=c.from)&&(O.marker.inclusiveLeft||c.marker.inclusiveRight)&&ci(e,t,O))return!0}function ii(e){e=Vr(e);for(var t=0,c=e.parent,u=0;u<c.lines.length;++u){var O=c.lines[u];if(O==e)break;t+=O.height}for(var K=c.parent;K;c=K,K=c.parent)for(var Z=0;Z<K.children.length;++Z){var ne=K.children[Z];if(ne==c)break;t+=ne.height}return t}function $i(e){if(e.height==0)return 0;for(var t=e.text.length,c,u=e;c=Or(u);){var O=c.find(0,!0);u=O.from.line,t+=O.from.ch-O.to.ch}for(u=e;c=er(u);){var K=c.find(0,!0);t-=u.text.length-K.from.ch,u=K.to.line,t+=u.text.length-K.to.ch}return t}function Ni(e){var t=e.display,c=e.doc;t.maxLine=V(c,c.first),t.maxLineLength=$i(t.maxLine),t.maxLineChanged=!0,c.iter(function(u){var O=$i(u);O>t.maxLineLength&&(t.maxLineLength=O,t.maxLine=u)})}var hi=function(e,t,c){this.text=e,di(this,t),this.height=c?c(this):1};hi.prototype.lineNo=function(){return Ue(this)},Me(hi);function ua(e,t,c,u){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),qr(e),di(e,c);var O=u?u(e):1;O!=e.height&&xe(e,O)}function hn(e){e.parent=null,qr(e)}var kn={},wn={};function tr(e,t){if(!e||/^\s*$/.test(e))return null;var c=t.addModeClass?wn:kn;return c[e]||(c[e]=e.replace(/\S+/g,"cm-$&"))}function Gn(e,t){var c=C("span",null,null,n?"padding-right: .1px":null),u={pre:C("pre",[c],"CodeMirror-line"),content:c,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var O=0;O<=(t.rest?t.rest.length:0);O++){var K=O?t.rest[O-1]:t.line,Z=void 0;u.pos=0,u.addToken=zn,It(e.display.measure)&&(Z=st(K,e.doc.direction))&&(u.addToken=Xr(u.addToken,Z)),u.map=[];var ne=t!=e.display.externalMeasured&&Ue(K);Ui(K,u,J(e,K,ne)),K.styleClasses&&(K.styleClasses.bgClass&&(u.bgClass=a(K.styleClasses.bgClass,u.bgClass||"")),K.styleClasses.textClass&&(u.textClass=a(K.styleClasses.textClass,u.textClass||""))),u.map.length==0&&u.map.push(0,0,u.content.appendChild(rt(e.display.measure))),O==0?(t.measure.map=u.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(u.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(n){var oe=u.content.lastChild;(/\bcm-tab\b/.test(oe.className)||oe.querySelector&&oe.querySelector(".cm-tab"))&&(u.content.className="cm-tab-wrap-hack")}return Je(e,"renderLine",e,t.line,u.pre),u.pre.className&&(u.textClass=a(u.pre.className,u.textClass||"")),u}function sn(e){var t=b("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function zn(e,t,c,u,O,K,Z){if(!t)return;var ne=e.splitSpaces?Ir(t,e.trailingSpace):t,oe=e.cm.state.specialChars,pe=!1,je;if(!oe.test(t))e.col+=t.length,je=document.createTextNode(ne),e.map.push(e.pos,e.pos+t.length,je),R&&B<9&&(pe=!0),e.pos+=t.length;else{je=document.createDocumentFragment();for(var Ke=0;;){oe.lastIndex=Ke;var ut=oe.exec(t),at=ut?ut.index-Ke:t.length-Ke;if(at){var Ot=document.createTextNode(ne.slice(Ke,Ke+at));R&&B<9?je.appendChild(b("span",[Ot])):je.appendChild(Ot),e.map.push(e.pos,e.pos+at,Ot),e.col+=at,e.pos+=at}if(!ut)break;Ke+=at+1;var Ut=void 0;if(ut[0]==" "){var Gt=e.cm.options.tabSize,Jt=Gt-e.col%Gt;Ut=je.appendChild(b("span",ge(Jt),"cm-tab")),Ut.setAttribute("role","presentation"),Ut.setAttribute("cm-text"," "),e.col+=Jt}else ut[0]=="\r"||ut[0]==`
`?(Ut=je.appendChild(b("span",ut[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ut.setAttribute("cm-text",ut[0]),e.col+=1):(Ut=e.cm.options.specialCharPlaceholder(ut[0]),Ut.setAttribute("cm-text",ut[0]),R&&B<9?je.appendChild(b("span",[Ut])):je.appendChild(Ut),e.col+=1);e.map.push(e.pos,e.pos+1,Ut),e.pos++}}if(e.trailingSpace=ne.charCodeAt(t.length-1)==32,c||u||O||pe||K||Z){var rn=c||"";u&&(rn+=u),O&&(rn+=O);var Qt=b("span",[je],rn,K);if(Z)for(var dn in Z)Z.hasOwnProperty(dn)&&dn!="style"&&dn!="class"&&Qt.setAttribute(dn,Z[dn]);return e.content.appendChild(Qt)}e.content.appendChild(je)}function Ir(e,t){if(e.length>1&&!/ /.test(e))return e;for(var c=t,u="",O=0;O<e.length;O++){var K=e.charAt(O);K==" "&&c&&(O==e.length-1||e.charCodeAt(O+1)==32)&&(K="\xA0"),u+=K,c=K==" "}return u}function Xr(e,t){return function(c,u,O,K,Z,ne,oe){O=O?O+" cm-force-border":"cm-force-border";for(var pe=c.pos,je=pe+u.length;;){for(var Ke=void 0,ut=0;ut<t.length&&!(Ke=t[ut],Ke.to>pe&&Ke.from<=pe);ut++);if(Ke.to>=je)return e(c,u,O,K,Z,ne,oe);e(c,u.slice(0,Ke.to-pe),O,K,null,ne,oe),K=null,u=u.slice(Ke.to-pe),pe=Ke.to}}}function nr(e,t,c,u){var O=!u&&c.widgetNode;O&&e.map.push(e.pos,e.pos+t,O),!u&&e.cm.display.input.needsContentAttribute&&(O||(O=e.content.appendChild(document.createElement("span"))),O.setAttribute("cm-marker",c.id)),O&&(e.cm.display.input.setUneditable(O),e.content.appendChild(O)),e.pos+=t,e.trailingSpace=!1}function Ui(e,t,c){var u=e.markedSpans,O=e.text,K=0;if(!u){for(var Z=1;Z<c.length;Z+=2)t.addToken(t,O.slice(K,K=c[Z]),tr(c[Z+1],t.cm.options));return}for(var ne=O.length,oe=0,pe=1,je="",Ke,ut,at=0,Ot,Ut,Gt,Jt,rn;;){if(at==oe){Ot=Ut=Gt=ut="",rn=null,Jt=null,at=Infinity;for(var Qt=[],dn=void 0,Pn=0;Pn<u.length;++Pn){var On=u[Pn],or=On.marker;if(or.type=="bookmark"&&On.from==oe&&or.widgetNode)Qt.push(or);else if(On.from<=oe&&(On.to==null||On.to>oe||or.collapsed&&On.to==oe&&On.from==oe)){if(On.to!=null&&On.to!=oe&&at>On.to&&(at=On.to,Ut=""),or.className&&(Ot+=" "+or.className),or.css&&(ut=(ut?ut+";":"")+or.css),or.startStyle&&On.from==oe&&(Gt+=" "+or.startStyle),or.endStyle&&On.to==at&&(dn||(dn=[])).push(or.endStyle,On.to),or.title&&((rn||(rn={})).title=or.title),or.attributes)for(var Lr in or.attributes)(rn||(rn={}))[Lr]=or.attributes[Lr];or.collapsed&&(!Jt||Sr(Jt.marker,or)<0)&&(Jt=On)}else On.from>oe&&at>On.from&&(at=On.from)}if(dn)for(var li=0;li<dn.length;li+=2)dn[li+1]==at&&(Ut+=" "+dn[li]);if(!Jt||Jt.from==oe)for(var Br=0;Br<Qt.length;++Br)nr(t,0,Qt[Br]);if(Jt&&(Jt.from||0)==oe){if(nr(t,(Jt.to==null?ne+1:Jt.to)-oe,Jt.marker,Jt.from==null),Jt.to==null)return;Jt.to==oe&&(Jt=!1)}}if(oe>=ne)break;for(var Mi=Math.min(ne,at);;){if(je){var wi=oe+je.length;if(!Jt){var Jr=wi>Mi?je.slice(0,Mi-oe):je;t.addToken(t,Jr,Ke?Ke+Ot:Ot,Gt,oe+Jr.length==at?Ut:"",ut,rn)}if(wi>=Mi){je=je.slice(Mi-oe),oe=Mi;break}oe=wi,Gt=""}je=O.slice(K,K=c[pe++]),Ke=tr(c[pe++],t.cm.options)}}}function fr(e,t,c){this.line=t,this.rest=Ri(t),this.size=this.rest?Ue(Ne(this.rest))-c+1:1,this.node=this.text=null,this.hidden=Ur(e,t)}function ot(e,t,c){for(var u=[],O,K=t;K<c;K=O){var Z=new fr(e.doc,V(e.doc,K),K);O=K+Z.size,u.push(Z)}return u}var St=null;function Ht(e){St?St.ops.push(e):e.ownsGroup=St={ops:[e],delayedCallbacks:[]}}function ln(e){var t=e.delayedCallbacks,c=0;do{for(;c<t.length;c++)t[c].call(null);for(var u=0;u<e.ops.length;u++){var O=e.ops[u];if(O.cursorActivityHandlers)for(;O.cursorActivityCalled<O.cursorActivityHandlers.length;)O.cursorActivityHandlers[O.cursorActivityCalled++].call(null,O.cm)}}while(c<t.length)}function Hn(e,t){var c=e.ownsGroup;if(!c)return;try{ln(c)}finally{St=null,t(c)}}var Cn=null;function _t(e,t){var c=mt(e,t);if(!c.length)return;var u=Array.prototype.slice.call(arguments,2),O;St?O=St.delayedCallbacks:Cn?O=Cn:(O=Cn=[],setTimeout(Lt,0));for(var K=function(ne){O.push(function(){return c[ne].apply(null,u)})},Z=0;Z<c.length;++Z)K(Z)}function Lt(){var e=Cn;Cn=null;for(var t=0;t<e.length;++t)e[t]()}function gn(e,t,c,u){for(var O=0;O<t.changes.length;O++){var K=t.changes[O];K=="text"?vn(e,t):K=="gutter"?Nn(e,t,c,u):K=="class"?Vn(e,t):K=="widget"&&Tn(e,t,u)}t.changes=null}function bt(e){return e.node==e.text&&(e.node=b("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),R&&B<8&&(e.node.style.zIndex=2)),e.node}function cn(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 u=bt(t);t.background=u.insertBefore(b("div",null,c),u.firstChild),e.display.input.setUneditable(t.background)}}function Ft(e,t){var c=e.display.externalMeasured;return c&&c.line==t.line?(e.display.externalMeasured=null,t.measure=c.measure,c.built):Gn(e,t)}function vn(e,t){var c=t.text.className,u=Ft(e,t);t.text==t.node&&(t.node=u.pre),t.text.parentNode.replaceChild(u.pre,t.text),t.text=u.pre,u.bgClass!=t.bgClass||u.textClass!=t.textClass?(t.bgClass=u.bgClass,t.textClass=u.textClass,Vn(e,t)):c&&(t.text.className=c)}function Vn(e,t){cn(e,t),t.line.wrapClass?bt(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 Nn(e,t,c,u){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 O=bt(t);t.gutterBackground=b("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?u.fixedPos:-u.gutterTotalWidth)+"px; width: "+u.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),O.insertBefore(t.gutterBackground,t.text)}var K=t.line.gutterMarkers;if(e.options.lineNumbers||K){var Z=bt(t),ne=t.gutter=b("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?u.fixedPos:-u.gutterTotalWidth)+"px");if(e.display.input.setUneditable(ne),Z.insertBefore(ne,t.text),t.line.gutterClass&&(ne.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!K||!K["CodeMirror-linenumbers"])&&(t.lineNumber=ne.appendChild(b("div",xt(e.options,c),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+u.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),K)for(var oe=0;oe<e.display.gutterSpecs.length;++oe){var pe=e.display.gutterSpecs[oe].className,je=K.hasOwnProperty(pe)&&K[pe];je&&ne.appendChild(b("div",[je],"CodeMirror-gutter-elt","left: "+u.gutterLeft[pe]+"px; width: "+u.gutterWidth[pe]+"px"))}}}function Tn(e,t,c){t.alignable&&(t.alignable=null);for(var u=x("CodeMirror-linewidget"),O=t.node.firstChild,K=void 0;O;O=K)K=O.nextSibling,u.test(O.className)&&t.node.removeChild(O);In(e,t,c)}function Yn(e,t,c,u){var O=Ft(e,t);return t.text=t.node=O.pre,O.bgClass&&(t.bgClass=O.bgClass),O.textClass&&(t.textClass=O.textClass),Vn(e,t),Nn(e,t,c,u),In(e,t,u),t.node}function In(e,t,c){if($n(e,t.line,t,c,!0),t.rest)for(var u=0;u<t.rest.length;u++)$n(e,t.rest[u],t,c,!1)}function $n(e,t,c,u,O){if(!t.widgets)return;for(var K=bt(c),Z=0,ne=t.widgets;Z<ne.length;++Z){var oe=ne[Z],pe=b("div",[oe.node],"CodeMirror-linewidget"+(oe.className?" "+oe.className:""));oe.handleMouseEvents||pe.setAttribute("cm-ignore-events","true"),rr(oe,pe,c,u),e.display.input.setUneditable(pe),O&&oe.above?K.insertBefore(pe,c.gutter||c.text):K.appendChild(pe),_t(oe,"redraw")}}function rr(e,t,c,u){if(e.noHScroll){(c.alignable||(c.alignable=[])).push(t);var O=u.wrapperWidth;t.style.left=u.fixedPos+"px",e.coverGutter||(O-=u.gutterTotalWidth,t.style.paddingLeft=u.gutterTotalWidth+"px"),t.style.width=O+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-u.gutterTotalWidth+"px"))}function _r(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!i(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;"),A(t.display.measure,b("div",[e.node],null,c))}return e.height=e.node.parentNode.offsetHeight}function Bn(e,t){for(var c=Fe(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 gr(e){return e.lineSpace.offsetTop}function mr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function sr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=A(e.measure,b("pre","x","CodeMirror-line-like")),c=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,u={left:parseInt(c.paddingLeft),right:parseInt(c.paddingRight)};return!isNaN(u.left)&&!isNaN(u.right)&&(e.cachedPaddingH=u),u}function Un(e){return Y-e.display.nativeBarWidth}function Jn(e){return e.display.scroller.clientWidth-Un(e)-e.display.barWidth}function Xn(e){return e.display.scroller.clientHeight-Un(e)-e.display.barHeight}function Vt(e,t,c){var u=e.options.lineWrapping,O=u&&Jn(e);if(!t.measure.heights||u&&t.measure.width!=O){var K=t.measure.heights=[];if(u){t.measure.width=O;for(var Z=t.text.firstChild.getClientRects(),ne=0;ne<Z.length-1;ne++){var oe=Z[ne],pe=Z[ne+1];Math.abs(oe.bottom-pe.bottom)>2&&K.push((oe.bottom+pe.top)/2-c.top)}}K.push(c.bottom-c.top)}}function Rn(e,t,c){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var u=0;u<e.rest.length;u++)if(e.rest[u]==t)return{map:e.measure.maps[u],cache:e.measure.caches[u]};for(var O=0;O<e.rest.length;O++)if(Ue(e.rest[O])>c)return{map:e.measure.maps[O],cache:e.measure.caches[O],before:!0}}function cr(e,t){t=Vr(t);var c=Ue(t),u=e.display.externalMeasured=new fr(e.doc,t,c);u.lineN=c;var O=u.built=Gn(e,u);return u.text=O.pre,A(e.display.lineMeasure,O.pre),u}function un(e,t,c,u){return bn(e,Sn(e,t),c,u)}function fn(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Ii(e,t)];var c=e.display.externalMeasured;if(c&&t>=c.lineN&&t<c.lineN+c.size)return c}function Sn(e,t){var c=Ue(t),u=fn(e,c);u&&!u.text?u=null:u&&u.changes&&(gn(e,u,c,Hr(e)),e.curOp.forceUpdate=!0),u||(u=cr(e,t));var O=Rn(u,t,c);return{line:t,view:u,rect:null,map:O.map,cache:O.cache,before:O.before,hasHeights:!1}}function bn(e,t,c,u,O){t.before&&(c=-1);var K=c+(u||""),Z;return t.cache.hasOwnProperty(K)?Z=t.cache[K]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Vt(e,t.view,t.rect),t.hasHeights=!0),Z=Yt(e,t,c,u),Z.bogus||(t.cache[K]=Z)),{left:Z.left,right:Z.right,top:O?Z.rtop:Z.top,bottom:O?Z.rbottom:Z.bottom}}var yn={left:0,right:0,top:0,bottom:0};function En(e,t,c){for(var u,O,K,Z,ne,oe,pe=0;pe<e.length;pe+=3)if(ne=e[pe],oe=e[pe+1],t<ne?(O=0,K=1,Z="left"):t<oe?(O=t-ne,K=O+1):(pe==e.length-3||t==oe&&e[pe+3]>t)&&(K=oe-ne,O=K-1,t>=oe&&(Z="right")),O!=null){if(u=e[pe+2],ne==oe&&c==(u.insertLeft?"left":"right")&&(Z=c),c=="left"&&O==0)for(;pe&&e[pe-2]==e[pe-3]&&e[pe-1].insertLeft;)u=e[(pe-=3)+2],Z="left";if(c=="right"&&O==oe-ne)for(;pe<e.length-3&&e[pe+3]==e[pe+4]&&!e[pe+5].insertLeft;)u=e[(pe+=3)+2],Z="right";break}return{node:u,start:O,end:K,collapse:Z,coverStart:ne,coverEnd:oe}}function zt(e,t){var c=yn;if(t=="left")for(var u=0;u<e.length&&!((c=e[u]).left!=c.right);u++);else for(var O=e.length-1;O>=0&&!((c=e[O]).left!=c.right);O--);return c}function Yt(e,t,c,u){var O=En(t.map,c,u),K=O.node,Z=O.start,ne=O.end,oe=O.collapse,pe;if(K.nodeType==3){for(var je=0;je<4;je++){for(;Z&&le(t.line.text.charAt(O.coverStart+Z));)--Z;for(;O.coverStart+ne<O.coverEnd&&le(t.line.text.charAt(O.coverStart+ne));)++ne;if(R&&B<9&&Z==0&&ne==O.coverEnd-O.coverStart?pe=K.parentNode.getBoundingClientRect():pe=zt(p(K,Z,ne).getClientRects(),u),pe.left||pe.right||Z==0)break;ne=Z,Z=Z-1,oe="right"}R&&B<11&&(pe=qt(e.display.measure,pe))}else{Z>0&&(oe=u="right");var Ke;e.options.lineWrapping&&(Ke=K.getClientRects()).length>1?pe=Ke[u=="right"?Ke.length-1:0]:pe=K.getBoundingClientRect()}if(R&&B<9&&!Z&&(!pe||!pe.left&&!pe.right)){var ut=K.parentNode.getClientRects()[0];ut?pe={left:ut.left,right:ut.left+ir(e.display),top:ut.top,bottom:ut.bottom}:pe=yn}for(var at=pe.top-t.rect.top,Ot=pe.bottom-t.rect.top,Ut=(at+Ot)/2,Gt=t.view.measure.heights,Jt=0;Jt<Gt.length-1&&!(Ut<Gt[Jt]);Jt++);var rn=Jt?Gt[Jt-1]:0,Qt=Gt[Jt],dn={left:(oe=="right"?pe.right:pe.left)-t.rect.left,right:(oe=="left"?pe.left:pe.right)-t.rect.left,top:rn,bottom:Qt};return!pe.left&&!pe.right&&(dn.bogus=!0),e.options.singleCursorHeightPerLine||(dn.rtop=at,dn.rbottom=Ot),dn}function qt(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Nt(e))return t;var c=screen.logicalXDPI/screen.deviceXDPI,u=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*c,right:t.right*c,top:t.top*u,bottom:t.bottom*u}}function tn(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 Kt(e){e.display.externalMeasure=null,T(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)tn(e.display.view[t])}function Zt(e){Kt(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function pn(){return D&&h?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function vr(){return D&&h?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function kr(e){var t=0;if(e.widgets)for(var c=0;c<e.widgets.length;++c)e.widgets[c].above&&(t+=_r(e.widgets[c]));return t}function ai(e,t,c,u,O){if(!O){var K=kr(t);c.top+=K,c.bottom+=K}if(u=="line")return c;u||(u="local");var Z=ii(t);if(u=="local"?Z+=gr(e.display):Z-=e.display.viewOffset,u=="page"||u=="window"){var ne=e.display.lineSpace.getBoundingClientRect();Z+=ne.top+(u=="window"?0:vr());var oe=ne.left+(u=="window"?0:pn());c.left+=oe,c.right+=oe}return c.top+=Z,c.bottom+=Z,c}function Yr(e,t,c){if(c=="div")return t;var u=t.left,O=t.top;if(c=="page")u-=pn(),O-=vr();else if(c=="local"||!c){var K=e.display.sizer.getBoundingClientRect();u+=K.left,O+=K.top}var Z=e.display.lineSpace.getBoundingClientRect();return{left:u-Z.left,top:O-Z.top}}function Oi(e,t,c,u,O){return u||(u=V(e.doc,t.line)),ai(e,u,un(e,u,t.ch,O),c)}function pr(e,t,c,u,O,K){u=u||V(e.doc,t.line),O||(O=Sn(e,u));function Z(Ot,Ut){var Gt=bn(e,O,Ot,Ut?"right":"left",K);return Ut?Gt.left=Gt.right:Gt.right=Gt.left,ai(e,u,Gt,c)}var ne=st(u,e.doc.direction),oe=t.ch,pe=t.sticky;if(oe>=u.text.length?(oe=u.text.length,pe="before"):oe<=0&&(oe=0,pe="after"),!ne)return Z(pe=="before"?oe-1:oe,pe=="before");function je(Ot,Ut,Gt){var Jt=ne[Ut],rn=Jt.level==1;return Z(Gt?Ot-1:Ot,rn!=Gt)}var Ke=Ye(ne,oe,pe),ut=He,at=je(oe,Ke,pe=="before");return ut!=null&&(at.other=je(oe,ut,pe!="before")),at}function Ai(e,t){var c=0;t=wt(e.doc,t),e.options.lineWrapping||(c=ir(e.display)*t.ch);var u=V(e.doc,t.line),O=ii(u)+gr(e.display);return{left:c,right:c,top:O,bottom:O+u.height}}function Fi(e,t,c,u,O){var K=Ve(e,t,c);return K.xRel=O,u&&(K.outside=u),K}function zi(e,t,c){var u=e.doc;if(c+=e.display.viewOffset,c<0)return Fi(u.first,0,null,-1,-1);var O=$e(u,c),K=u.first+u.size-1;if(O>K)return Fi(u.first+u.size-1,V(u,K).text.length,null,1,1);t<0&&(t=0);for(var Z=V(u,O);;){var ne=ea(e,Z,O,t,c),oe=Wr(Z,ne.ch+(ne.xRel>0||ne.outside>0?1:0));if(!oe)return ne;var pe=oe.find(1);if(pe.line==O)return pe;Z=V(u,O=pe.line)}}function ji(e,t,c,u){u-=kr(t);var O=t.text.length,K=Te(function(Z){return bn(e,c,Z-1).bottom<=u},O,0);return O=Te(function(Z){return bn(e,c,Z).top>u},K,O),{begin:K,end:O}}function da(e,t,c,u){c||(c=Sn(e,t));var O=ai(e,t,bn(e,c,u),"line").top;return ji(e,t,c,O)}function xi(e,t,c,u){return e.bottom<=c?!1:e.top>c?!0:(u?e.left:e.right)>t}function ea(e,t,c,u,O){O-=ii(t);var K=Sn(e,t),Z=kr(t),ne=0,oe=t.text.length,pe=!0,je=st(t,e.doc.direction);if(je){var Ke=(e.options.lineWrapping?yr:Da)(e,t,c,K,je,u,O);pe=Ke.level!=1,ne=pe?Ke.from:Ke.to-1,oe=pe?Ke.to:Ke.from-1}var ut=null,at=null,Ot=Te(function(Pn){var On=bn(e,K,Pn);return On.top+=Z,On.bottom+=Z,xi(On,u,O,!1)?(On.top<=O&&On.left<=u&&(ut=Pn,at=On),!0):!1},ne,oe),Ut,Gt,Jt=!1;if(at){var rn=u-at.left<at.right-u,Qt=rn==pe;Ot=ut+(Qt?0:1),Gt=Qt?"after":"before",Ut=rn?at.left:at.right}else{!pe&&(Ot==oe||Ot==ne)&&Ot++,Gt=Ot==0?"after":Ot==t.text.length?"before":bn(e,K,Ot-(pe?1:0)).bottom+Z<=O==pe?"after":"before";var dn=pr(e,Ve(c,Ot,Gt),"line",t,K);Ut=dn.left,Jt=O<dn.top?-1:O>=dn.bottom?1:0}return Ot=ye(t.text,Ot,1),Fi(c,Ot,Gt,Jt,u-Ut)}function Da(e,t,c,u,O,K,Z){var ne=Te(function(Ke){var ut=O[Ke],at=ut.level!=1;return xi(pr(e,Ve(c,at?ut.to:ut.from,at?"before":"after"),"line",t,u),K,Z,!0)},0,O.length-1),oe=O[ne];if(ne>0){var pe=oe.level!=1,je=pr(e,Ve(c,pe?oe.from:oe.to,pe?"after":"before"),"line",t,u);xi(je,K,Z,!0)&&je.top>Z&&(oe=O[ne-1])}return oe}function yr(e,t,c,u,O,K,Z){var ne=ji(e,t,u,Z),oe=ne.begin,pe=ne.end;/\s/.test(t.text.charAt(pe-1))&&pe--;for(var je=null,Ke=null,ut=0;ut<O.length;ut++){var at=O[ut];if(at.from>=pe||at.to<=oe)continue;var Ot=at.level!=1,Ut=bn(e,u,Ot?Math.min(pe,at.to)-1:Math.max(oe,at.from)).right,Gt=Ut<K?K-Ut+1e9:Ut-K;(!je||Ke>Gt)&&(je=at,Ke=Gt)}return je||(je=O[O.length-1]),je.from<oe&&(je={from:oe,to:je.to,level:je.level}),je.to>pe&&(je={from:je.from,to:pe,level:je.level}),je}var Ln;function Zn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Ln==null){Ln=b("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Ln.appendChild(document.createTextNode("x")),Ln.appendChild(b("br"));Ln.appendChild(document.createTextNode("x"))}A(e.measure,Ln);var c=Ln.offsetHeight/50;return c>3&&(e.cachedTextHeight=c),T(e.measure),c||1}function ir(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=b("span","xxxxxxxxxx"),c=b("pre",[t],"CodeMirror-line-like");A(e.measure,c);var u=t.getBoundingClientRect(),O=(u.right-u.left)/10;return O>2&&(e.cachedCharWidth=O),O||10}function Hr(e){for(var t=e.display,c={},u={},O=t.gutters.clientLeft,K=t.gutters.firstChild,Z=0;K;K=K.nextSibling,++Z){var ne=e.display.gutterSpecs[Z].className;c[ne]=K.offsetLeft+K.clientLeft+O,u[ne]=K.clientWidth}return{fixedPos:qn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:c,gutterWidth:u,wrapperWidth:t.wrapper.clientWidth}}function qn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Li(e){var t=Zn(e.display),c=e.options.lineWrapping,u=c&&Math.max(5,e.display.scroller.clientWidth/ir(e.display)-3);return function(O){if(Ur(e.doc,O))return 0;var K=0;if(O.widgets)for(var Z=0;Z<O.widgets.length;Z++)O.widgets[Z].height&&(K+=O.widgets[Z].height);return c?K+(Math.ceil(O.text.length/u)||1)*t:K+t}}function Ki(e){var t=e.doc,c=Li(e);t.iter(function(u){var O=c(u);O!=u.height&&xe(u,O)})}function ei(e,t,c,u){var O=e.display;if(!c&&Fe(t).getAttribute("cm-not-content")=="true")return null;var K,Z,ne=O.lineSpace.getBoundingClientRect();try{K=t.clientX-ne.left,Z=t.clientY-ne.top}catch(Ke){return null}var oe=zi(e,K,Z),pe;if(u&&oe.xRel>0&&(pe=V(e.doc,oe.line).text).length==oe.ch){var je=F(pe,pe.length,e.options.tabSize)-pe.length;oe=Ve(oe.line,Math.max(0,Math.round((K-sr(e.display).left)/ir(e.display))-je))}return oe}function Ii(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var c=e.display.view,u=0;u<c.length;u++)if(t-=c[u].size,t<0)return u}function Fr(e,t,c,u){t==null&&(t=e.doc.first),c==null&&(c=e.doc.first+e.doc.size),u||(u=0);var O=e.display;if(u&&c<O.viewTo&&(O.updateLineNumbers==null||O.updateLineNumbers>t)&&(O.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=O.viewTo)dr&&Hi(e.doc,t)<O.viewTo&&jn(e);else if(c<=O.viewFrom)dr&&ri(e.doc,c+u)>O.viewFrom?jn(e):(O.viewFrom+=u,O.viewTo+=u);else if(t<=O.viewFrom&&c>=O.viewTo)jn(e);else if(t<=O.viewFrom){var K=Dn(e,c,c+u,1);K?(O.view=O.view.slice(K.index),O.viewFrom=K.lineN,O.viewTo+=u):jn(e)}else if(c>=O.viewTo){var Z=Dn(e,t,t,-1);Z?(O.view=O.view.slice(0,Z.index),O.viewTo=Z.lineN):jn(e)}else{var ne=Dn(e,t,t,-1),oe=Dn(e,c,c+u,1);ne&&oe?(O.view=O.view.slice(0,ne.index).concat(ot(e,ne.lineN,oe.lineN)).concat(O.view.slice(oe.index)),O.viewTo+=u):jn(e)}var pe=O.externalMeasured;pe&&(c<pe.lineN?pe.lineN+=u:t<pe.lineN+pe.size&&(O.externalMeasured=null))}function fi(e,t,c){e.curOp.viewChanged=!0;var u=e.display,O=e.display.externalMeasured;if(O&&t>=O.lineN&&t<O.lineN+O.size&&(u.externalMeasured=null),t<u.viewFrom||t>=u.viewTo)return;var K=u.view[Ii(e,t)];if(K.node==null)return;var Z=K.changes||(K.changes=[]);G(Z,c)==-1&&Z.push(c)}function jn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Dn(e,t,c,u){var O=Ii(e,t),K,Z=e.display.view;if(!dr||c==e.doc.first+e.doc.size)return{index:O,lineN:c};for(var ne=e.display.viewFrom,oe=0;oe<O;oe++)ne+=Z[oe].size;if(ne!=t){if(u>0){if(O==Z.length-1)return null;K=ne+Z[O].size-t,O++}else K=ne-t;t+=K,c+=K}for(;Hi(e.doc,c)!=c;){if(O==(u<0?0:Z.length-1))return null;c+=u*Z[O-(u<0?1:0)].size,O+=u}return{index:O,lineN:c}}function ar(e,t,c){var u=e.display,O=u.view;O.length==0||t>=u.viewTo||c<=u.viewFrom?(u.view=ot(e,t,c),u.viewFrom=t):(u.viewFrom>t?u.view=ot(e,t,u.viewFrom).concat(u.view):u.viewFrom<t&&(u.view=u.view.slice(Ii(e,t))),u.viewFrom=t,u.viewTo<c?u.view=u.view.concat(ot(e,u.viewTo,c)):u.viewTo>c&&(u.view=u.view.slice(0,Ii(e,c)))),u.viewTo=c}function en(e){for(var t=e.display.view,c=0,u=0;u<t.length;u++){var O=t[u];!O.hidden&&(!O.node||O.changes)&&++c}return c}function Fn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function wr(e,t){t===void 0&&(t=!0);for(var c=e.doc,u={},O=u.cursors=document.createDocumentFragment(),K=u.selection=document.createDocumentFragment(),Z=0;Z<c.sel.ranges.length;Z++){if(!t&&Z==c.sel.primIndex)continue;var ne=c.sel.ranges[Z];if(ne.from().line>=e.display.viewTo||ne.to().line<e.display.viewFrom)continue;var oe=ne.empty();(oe||e.options.showCursorWhenSelecting)&&$r(e,ne.head,O),oe||va(e,ne,K)}return u}function $r(e,t,c){var u=pr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),O=c.appendChild(b("div","\xA0","CodeMirror-cursor"));if(O.style.left=u.left+"px",O.style.top=u.top+"px",O.style.height=Math.max(0,u.bottom-u.top)*e.options.cursorHeight+"px",u.other){var K=c.appendChild(b("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));K.style.display="",K.style.left=u.other.left+"px",K.style.top=u.other.top+"px",K.style.height=(u.other.bottom-u.other.top)*.85+"px"}}function jr(e,t){return e.top-t.top||e.left-t.left}function va(e,t,c){var u=e.display,O=e.doc,K=document.createDocumentFragment(),Z=sr(e.display),ne=Z.left,oe=Math.max(u.sizerWidth,Jn(e)-u.sizer.offsetLeft)-Z.right,pe=O.direction=="ltr";function je(Qt,dn,Pn,On){dn<0&&(dn=0),dn=Math.round(dn),On=Math.round(On),K.appendChild(b("div",null,"CodeMirror-selected","position: absolute; left: "+Qt+`px;
top: `+dn+"px; width: "+(Pn==null?oe-Qt:Pn)+`px;
height: `+(On-dn)+"px"))}function Ke(Qt,dn,Pn){var On=V(O,Qt),or=On.text.length,Lr,li;function Br(Jr,Ti){return Oi(e,Ve(Qt,Jr),"div",On,Ti)}function Mi(Jr,Ti,pi){var ni=da(e,On,null,Jr),Qr=Ti=="ltr"==(pi=="after")?"left":"right",Kr=pi=="after"?ni.begin:ni.end-(/\s/.test(On.text.charAt(ni.end-1))?2:1);return Br(Kr,Qr)[Qr]}var wi=st(On,O.direction);return Pe(wi,dn||0,Pn==null?or:Pn,function(Jr,Ti,pi,ni){var Qr=pi=="ltr",Kr=Br(Jr,Qr?"left":"right"),Ci=Br(Ti-1,Qr?"right":"left"),La=dn==null&&Jr==0,la=Pn==null&&Ti==or,gi=ni==0,Ji=!wi||ni==wi.length-1;if(Ci.top-Kr.top<=3){var ui=(pe?La:la)&&gi,jo=(pe?la:La)&&Ji,qi=ui?ne:(Qr?Kr:Ci).left,ma=jo?oe:(Qr?Ci:Kr).right;je(qi,Kr.top,ma-qi,Kr.bottom)}else{var ga,Ei,Ia,Bo;Qr?(ga=pe&&La&&gi?ne:Kr.left,Ei=pe?oe:Mi(Jr,pi,"before"),Ia=pe?ne:Mi(Ti,pi,"after"),Bo=pe&&la&&Ji?oe:Ci.right):(ga=pe?Mi(Jr,pi,"before"):ne,Ei=!pe&&La&&gi?oe:Kr.right,Ia=!pe&&la&&Ji?ne:Ci.left,Bo=pe?Mi(Ti,pi,"after"):oe),je(ga,Kr.top,Ei-ga,Kr.bottom),Kr.bottom<Ci.top&&je(ne,Kr.bottom,null,Ci.top),je(Ia,Ci.top,Bo-Ia,Ci.bottom)}(!Lr||jr(Kr,Lr)<0)&&(Lr=Kr),jr(Ci,Lr)<0&&(Lr=Ci),(!li||jr(Kr,li)<0)&&(li=Kr),jr(Ci,li)<0&&(li=Ci)}),{start:Lr,end:li}}var ut=t.from(),at=t.to();if(ut.line==at.line)Ke(ut.line,ut.ch,at.ch);else{var Ot=V(O,ut.line),Ut=V(O,at.line),Gt=Vr(Ot)==Vr(Ut),Jt=Ke(ut.line,ut.ch,Gt?Ot.text.length+1:null).end,rn=Ke(at.line,Gt?0:null,at.ch).start;Gt&&(Jt.top<rn.top-2?(je(Jt.right,Jt.top,null,Jt.bottom),je(ne,rn.top,rn.left,rn.bottom)):je(Jt.right,Jt.top,rn.left-Jt.right,Jt.bottom)),Jt.bottom<rn.top&&je(ne,Jt.bottom,null,rn.top)}c.appendChild(K)}function xn(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()||Di(e),t.cursorDiv.style.visibility=(c=!c)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function ta(e){e.state.focused||(e.display.input.focus(),Gi(e))}function _a(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Di(e))},100)}function Gi(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Je(e,"focus",e,t),e.state.focused=!0,o(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()),xn(e)}function Di(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Je(e,"blur",e,t),e.state.focused=!1,P(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Pi(e){for(var t=e.display,c=t.lineDiv.offsetTop,u=0;u<t.view.length;u++){var O=t.view[u],K=e.options.lineWrapping,Z=void 0,ne=0;if(O.hidden)continue;if(R&&B<8){var oe=O.node.offsetTop+O.node.offsetHeight;Z=oe-c,c=oe}else{var pe=O.node.getBoundingClientRect();Z=pe.bottom-pe.top,!K&&O.text.firstChild&&(ne=O.text.firstChild.getBoundingClientRect().right-pe.left-1)}var je=O.line.height-Z;if((je>.005||je<-.005)&&(xe(O.line,Z),Qi(O.line),O.rest))for(var Ke=0;Ke<O.rest.length;Ke++)Qi(O.rest[Ke]);if(ne>e.display.sizerWidth){var ut=Math.ceil(ne/ir(e.display));ut>e.display.maxLineLength&&(e.display.maxLineLength=ut,e.display.maxLine=O.line,e.display.maxLineChanged=!0)}}}function Qi(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var c=e.widgets[t],u=c.node.parentNode;u&&(c.height=u.offsetHeight)}}function Vi(e,t,c){var u=c&&c.top!=null?Math.max(0,c.top):e.scroller.scrollTop;u=Math.floor(u-gr(e));var O=c&&c.bottom!=null?c.bottom:u+e.wrapper.clientHeight,K=$e(t,u),Z=$e(t,O);if(c&&c.ensure){var ne=c.ensure.from.line,oe=c.ensure.to.line;ne<K?(K=ne,Z=$e(t,ii(V(t,ne))+e.wrapper.clientHeight)):Math.min(oe,t.lastLine())>=Z&&(K=$e(t,ii(V(t,oe))-e.wrapper.clientHeight),Z=oe)}return{from:K,to:Math.max(Z,K+1)}}function na(e,t){if(et(e,"scrollCursorIntoView"))return;var c=e.display,u=c.sizer.getBoundingClientRect(),O=null;if(t.top+u.top<0?O=!0:t.bottom+u.top>(window.innerHeight||document.documentElement.clientHeight)&&(O=!1),O!=null&&!s){var K=b("div","\u200B",null,`position: absolute;
top: `+(t.top-c.viewOffset-gr(e.display))+`px;
height: `+(t.bottom-t.top+Un(e)+c.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(K),K.scrollIntoView(O),e.display.lineSpace.removeChild(K)}}function go(e,t,c,u){u==null&&(u=0);var O;!e.options.lineWrapping&&t==c&&(t=t.ch?Ve(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,c=t.sticky=="before"?Ve(t.line,t.ch+1,"before"):t);for(var K=0;K<5;K++){var Z=!1,ne=pr(e,t),oe=!c||c==t?ne:pr(e,c);O={left:Math.min(ne.left,oe.left),top:Math.min(ne.top,oe.top)-u,right:Math.max(ne.left,oe.left),bottom:Math.max(ne.bottom,oe.bottom)+u};var pe=vo(e,O),je=e.doc.scrollTop,Ke=e.doc.scrollLeft;if(pe.scrollTop!=null&&(ka(e,pe.scrollTop),Math.abs(e.doc.scrollTop-je)>1&&(Z=!0)),pe.scrollLeft!=null&&(ca(e,pe.scrollLeft),Math.abs(e.doc.scrollLeft-Ke)>1&&(Z=!0)),!Z)break}return O}function ti(e,t){var c=vo(e,t);c.scrollTop!=null&&ka(e,c.scrollTop),c.scrollLeft!=null&&ca(e,c.scrollLeft)}function vo(e,t){var c=e.display,u=Zn(e.display);t.top<0&&(t.top=0);var O=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:c.scroller.scrollTop,K=Xn(e),Z={};t.bottom-t.top>K&&(t.bottom=t.top+K);var ne=e.doc.height+mr(c),oe=t.top<u,pe=t.bottom>ne-u;if(t.top<O)Z.scrollTop=oe?0:t.top;else if(t.bottom>O+K){var je=Math.min(t.top,(pe?ne:t.bottom)-K);je!=O&&(Z.scrollTop=je)}var Ke=e.options.fixedGutter?0:c.gutters.offsetWidth,ut=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:c.scroller.scrollLeft-Ke,at=Jn(e)-c.gutters.offsetWidth,Ot=t.right-t.left>at;return Ot&&(t.right=t.left+at),t.left<10?Z.scrollLeft=0:t.left<ut?Z.scrollLeft=Math.max(0,t.left+Ke-(Ot?0:10)):t.right>at+ut-3&&(Z.scrollLeft=t.right+(Ot?0:10)-at),Z}function _o(e,t){if(t==null)return;qa(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function ya(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 Qs(e,t){qa(e),e.curOp.scrollToPos=t}function qa(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var c=Ai(e,t.from),u=Ai(e,t.to);Wo(e,c,u,t.margin)}}function Wo(e,t,c,u){var O=vo(e,{left:Math.min(t.left,c.left),top:Math.min(t.top,c.top)-u,right:Math.max(t.right,c.right),bottom:Math.max(t.bottom,c.bottom)+u});Pa(e,O.scrollLeft,O.scrollTop)}function ka(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;re||bo(e,{top:t}),Ho(e,t,!0),re&&bo(e),Ua(e,100)}function Ho(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 ca(e,t,c,u){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)&&!u)return;e.doc.scrollLeft=t,Xo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Ma(e){var t=e.display,c=t.gutters.offsetWidth,u=Math.round(e.doc.height+mr(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:u,scrollHeight:u+Un(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:c}}var ha=function(e,t,c){this.cm=c;var u=this.vert=b("div",[b("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),O=this.horiz=b("div",[b("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");u.tabIndex=O.tabIndex=-1,e(u),e(O),qe(u,"scroll",function(){u.clientHeight&&t(u.scrollTop,"vertical")}),qe(O,"scroll",function(){O.clientWidth&&t(O.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,R&&B<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,u=e.nativeBarWidth;if(c){this.vert.style.display="block",this.vert.style.bottom=t?u+"px":"0";var O=e.viewHeight-(t?u:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+O)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=c?u+"px":"0",this.horiz.style.left=e.barLeft+"px";var K=e.viewWidth-e.barLeft-(c?u: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&&(u==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:c?u:0,bottom:t?u: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=r&&!m?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new j,this.disableVert=new j},ha.prototype.enableZeroWidthBar=function(e,t,c){e.style.pointerEvents="auto";function u(){var O=e.getBoundingClientRect(),K=c=="vert"?document.elementFromPoint(O.right-1,(O.top+O.bottom)/2):document.elementFromPoint((O.right+O.left)/2,O.bottom-1);K!=e?e.style.pointerEvents="none":t.set(1e3,u)}t.set(1e3,u)},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=Ma(e));var c=e.display.barWidth,u=e.display.barHeight;Ko(e,t);for(var O=0;O<4&&c!=e.display.barWidth||u!=e.display.barHeight;O++)c!=e.display.barWidth&&e.options.lineWrapping&&Pi(e),Ko(e,Ma(e)),c=e.display.barWidth,u=e.display.barHeight}function Ko(e,t){var c=e.display,u=c.scrollbars.update(t);c.sizer.style.paddingRight=(c.barWidth=u.right)+"px",c.sizer.style.paddingBottom=(c.barHeight=u.bottom)+"px",c.heightForcer.style.borderBottom=u.bottom+"px solid transparent",u.right&&u.bottom?(c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=u.bottom+"px",c.scrollbarFiller.style.width=u.right+"px"):c.scrollbarFiller.style.display="",u.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=u.bottom+"px",c.gutterFiller.style.width=t.gutterWidth+"px"):c.gutterFiller.style.display=""}var Go={native:ha,null:Na};function zo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&P(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Go[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),qe(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"?ca(e,t):ka(e,t)},e),e.display.scrollbars.addClass&&o(e.display.wrapper,e.display.scrollbars.addClass)}var Zs=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:++Zs},Ht(e.curOp)}function pa(e){var t=e.curOp;t&&Hn(t,function(c){for(var u=0;u<c.ops.length;u++)c.ops[u].cm.curOp=null;qs(c)})}function qs(e){for(var t=e.ops,c=0;c<t.length;c++)el(t[c]);for(var u=0;u<t.length;u++)tl(t[u]);for(var O=0;O<t.length;O++)nl(t[O]);for(var K=0;K<t.length;K++)rl(t[K]);for(var Z=0;Z<t.length;Z++)il(t[Z])}function el(e){var t=e.cm,c=t.display;ol(t),e.updateMaxLine&&Ni(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 eo(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&yo(e.cm,e.update)}function nl(e){var t=e.cm,c=t.display;e.updatedDisplay&&Pi(t),e.barMeasure=Ma(t),c.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=un(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+Un(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,c.sizer.offsetLeft+e.adjustWidthTo-Jn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=c.input.prepareSelection())}function rl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&ca(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var c=e.focus&&e.focus==f();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,c),(e.updatedDisplay||e.startHeight!=t.doc.height)&&ba(t,e.barMeasure),e.updatedDisplay&&xo(t,e.barMeasure),e.selectionChanged&&xn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),c&&ta(e.cm)}function il(e){var t=e.cm,c=t.display,u=t.doc;if(e.updatedDisplay&&Vo(t,e.update),c.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(c.wheelStartX=c.wheelStartY=null),e.scrollTop!=null&&Ho(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&ca(t,e.scrollLeft,!0,!0),e.scrollToPos){var O=go(t,wt(u,e.scrollToPos.from),wt(u,e.scrollToPos.to),e.scrollToPos.margin);na(t,O)}var K=e.maybeHiddenMarkers,Z=e.maybeUnhiddenMarkers;if(K)for(var ne=0;ne<K.length;++ne)K[ne].lines.length||Je(K[ne],"hide");if(Z)for(var oe=0;oe<Z.length;++oe)Z[oe].lines.length&&Je(Z[oe],"unhide");c.wrapper.offsetHeight&&(u.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Je(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function ki(e,t){if(e.curOp)return t();fa(e);try{return t()}finally{pa(e)}}function oi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);fa(e);try{return t.apply(e,arguments)}finally{pa(e)}}}function bi(e){return function(){if(this.curOp)return e.apply(this,arguments);fa(this);try{return e.apply(this,arguments)}finally{pa(this)}}}function si(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,y(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var c=+new Date+e.options.workTime,u=Ae(e,t.highlightFrontier),O=[];t.iter(u.line,Math.min(t.first+t.size,e.display.viewTo+500),function(K){if(u.line>=e.display.viewFrom){var Z=K.styles,ne=K.text.length>e.options.maxHighlightLength?on(t.mode,u.state):null,oe=ie(e,K,u,!0);ne&&(u.state=ne),K.styles=oe.styles;var pe=K.styleClasses,je=oe.classes;je?K.styleClasses=je:pe&&(K.styleClasses=null);for(var Ke=!Z||Z.length!=K.styles.length||pe!=je&&(!pe||!je||pe.bgClass!=je.bgClass||pe.textClass!=je.textClass),ut=0;!Ke&&ut<Z.length;++ut)Ke=Z[ut]!=K.styles[ut];Ke&&O.push(u.line),K.stateAfter=u.save(),u.nextLine()}else K.text.length<=e.options.maxHighlightLength&&tt(e,K.text,u),K.stateAfter=u.line%5==0?u.save():null,u.nextLine();if(+new Date>c)return Ua(e,e.options.workDelay),!0}),t.highlightFrontier=u.line,t.modeFrontier=Math.max(t.modeFrontier,u.line),O.length&&ki(e,function(){for(var K=0;K<O.length;K++)fi(e,O[K],"text")})}var eo=function(e,t,c){var u=e.display;this.viewport=t,this.visible=Vi(u,e.doc,t),this.editorIsHidden=!u.wrapper.offsetWidth,this.wrapperHeight=u.wrapper.clientHeight,this.wrapperWidth=u.wrapper.clientWidth,this.oldDisplayWidth=Jn(e),this.force=c,this.dims=Hr(e),this.events=[]};eo.prototype.signal=function(e,t){ke(e,t)&&this.events.push(arguments)},eo.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Je.apply(null,this.events[e])};function ol(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Un(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Un(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=f();if(!t||!i(e.display.lineDiv,t))return null;var c={activeElt:t};if(window.getSelection){var u=window.getSelection();u.anchorNode&&u.extend&&i(e.display.lineDiv,u.anchorNode)&&(c.anchorNode=u.anchorNode,c.anchorOffset=u.anchorOffset,c.focusNode=u.focusNode,c.focusOffset=u.focusOffset)}return c}function ll(e){if(!e||!e.activeElt||e.activeElt==f())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&i(document.body,e.anchorNode)&&i(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 yo(e,t){var c=e.display,u=e.doc;if(t.editorIsHidden)return jn(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;Yo(e)&&(jn(e),t.dims=Hr(e));var O=u.first+u.size,K=Math.max(t.visible.from-e.options.viewportMargin,u.first),Z=Math.min(O,t.visible.to+e.options.viewportMargin);c.viewFrom<K&&K-c.viewFrom<20&&(K=Math.max(u.first,c.viewFrom)),c.viewTo>Z&&c.viewTo-Z<20&&(Z=Math.min(O,c.viewTo)),dr&&(K=Hi(e.doc,K),Z=ri(e.doc,Z));var ne=K!=c.viewFrom||Z!=c.viewTo||c.lastWrapHeight!=t.wrapperHeight||c.lastWrapWidth!=t.wrapperWidth;ar(e,K,Z),c.viewOffset=ii(V(e.doc,c.viewFrom)),e.display.mover.style.top=c.viewOffset+"px";var oe=en(e);if(!ne&&oe==0&&!t.force&&c.renderedView==c.view&&(c.updateLineNumbers==null||c.updateLineNumbers>=c.viewTo))return!1;var pe=sl(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(pe),T(c.cursorDiv),T(c.selectionDiv),c.gutters.style.height=c.sizer.style.minHeight=0,ne&&(c.lastWrapHeight=t.wrapperHeight,c.lastWrapWidth=t.wrapperWidth,Ua(e,400)),c.updateLineNumbers=null,!0}function Vo(e,t){for(var c=t.viewport,u=!0;;u=!1){if(!u||!e.options.lineWrapping||t.oldDisplayWidth==Jn(e)){if(c&&c.top!=null&&(c={top:Math.min(e.doc.height+mr(e.display)-Xn(e),c.top)}),t.visible=Vi(e.display,e.doc,c),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else u&&(t.visible=Vi(e.display,e.doc,c));if(!yo(e,t))break;Pi(e);var O=Ma(e);Fn(e),ba(e,O),xo(e,O),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 bo(e,t){var c=new eo(e,t);if(yo(e,c)){Pi(e),Vo(e,c);var u=Ma(e);Fn(e),ba(e,u),xo(e,u),c.finish()}}function ul(e,t,c){var u=e.display,O=e.options.lineNumbers,K=u.lineDiv,Z=K.firstChild;function ne(Ot){var Ut=Ot.nextSibling;return n&&r&&e.display.currentWheelTarget==Ot?Ot.style.display="none":Ot.parentNode.removeChild(Ot),Ut}for(var oe=u.view,pe=u.viewFrom,je=0;je<oe.length;je++){var Ke=oe[je];if(!Ke.hidden)if(!Ke.node||Ke.node.parentNode!=K){var ut=Yn(e,Ke,pe,c);K.insertBefore(ut,Z)}else{for(;Z!=Ke.node;)Z=ne(Z);var at=O&&t!=null&&t<=pe&&Ke.lineNumber;Ke.changes&&(G(Ke.changes,"gutter")>-1&&(at=!1),gn(e,Ke,pe,c)),at&&(T(Ke.lineNumber),Ke.lineNumber.appendChild(document.createTextNode(xt(e.options,pe)))),Z=Ke.node.nextSibling}pe+=Ke.size}for(;Z;)Z=ne(Z)}function Eo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function xo(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+Un(e)+"px"}function Xo(e){var t=e.display,c=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var u=qn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,O=t.gutters.offsetWidth,K=u+"px",Z=0;Z<c.length;Z++)if(!c[Z].hidden){e.options.fixedGutter&&(c[Z].gutter&&(c[Z].gutter.style.left=K),c[Z].gutterBackground&&(c[Z].gutterBackground.style.left=K));var ne=c[Z].alignable;if(ne)for(var oe=0;oe<ne.length;oe++)ne[oe].style.left=K}e.options.fixedGutter&&(t.gutters.style.left=u+O+"px")}function Yo(e){if(!e.options.lineNumbers)return!1;var t=e.doc,c=xt(e.options,t.first+t.size-1),u=e.display;if(c.length!=u.lineNumChars){var O=u.measure.appendChild(b("div",[b("div",c)],"CodeMirror-linenumber CodeMirror-gutter-elt")),K=O.firstChild.offsetWidth,Z=O.offsetWidth-K;return u.lineGutter.style.width="",u.lineNumInnerWidth=Math.max(K,u.lineGutter.offsetWidth-Z)+1,u.lineNumWidth=u.lineNumInnerWidth+Z,u.lineNumChars=u.lineNumInnerWidth?c.length:-1,u.lineGutter.style.width=u.lineNumWidth+"px",Eo(e.display),!0}return!1}function So(e,t){for(var c=[],u=!1,O=0;O<e.length;O++){var K=e[O],Z=null;if(typeof K!="string"&&(Z=K.style,K=K.className),K=="CodeMirror-linenumbers")if(t)u=!0;else continue;c.push({className:K,style:Z})}return t&&!u&&c.push({className:"CodeMirror-linenumbers",style:null}),c}function $o(e){var t=e.gutters,c=e.gutterSpecs;T(t),e.lineGutter=null;for(var u=0;u<c.length;++u){var O=c[u],K=O.className,Z=O.style,ne=t.appendChild(b("div",null,"CodeMirror-gutter "+K));Z&&(ne.style.cssText=Z),K=="CodeMirror-linenumbers"&&(e.lineGutter=ne,ne.style.width=(e.lineNumWidth||1)+"px")}t.style.display=c.length?"":"none",Eo(e)}function Fa(e){$o(e.display),Fr(e),Xo(e)}function dl(e,t,c,u){var O=this;this.input=c,O.scrollbarFiller=b("div",null,"CodeMirror-scrollbar-filler"),O.scrollbarFiller.setAttribute("cm-not-content","true"),O.gutterFiller=b("div",null,"CodeMirror-gutter-filler"),O.gutterFiller.setAttribute("cm-not-content","true"),O.lineDiv=C("div",null,"CodeMirror-code"),O.selectionDiv=b("div",null,null,"position: relative; z-index: 1"),O.cursorDiv=b("div",null,"CodeMirror-cursors"),O.measure=b("div",null,"CodeMirror-measure"),O.lineMeasure=b("div",null,"CodeMirror-measure"),O.lineSpace=C("div",[O.measure,O.lineMeasure,O.selectionDiv,O.cursorDiv,O.lineDiv],null,"position: relative; outline: none");var K=C("div",[O.lineSpace],"CodeMirror-lines");O.mover=b("div",[K],null,"position: relative"),O.sizer=b("div",[O.mover],"CodeMirror-sizer"),O.sizerWidth=null,O.heightForcer=b("div",null,null,"position: absolute; height: "+Y+"px; width: 1px;"),O.gutters=b("div",null,"CodeMirror-gutters"),O.lineGutter=null,O.scroller=b("div",[O.sizer,O.heightForcer,O.gutters],"CodeMirror-scroll"),O.scroller.setAttribute("tabIndex","-1"),O.wrapper=b("div",[O.scrollbarFiller,O.gutterFiller,O.scroller],"CodeMirror"),R&&B<8&&(O.gutters.style.zIndex=-1,O.scroller.style.paddingRight=0),!n&&!(re&&_)&&(O.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(O.wrapper):e(O.wrapper)),O.viewFrom=O.viewTo=t.first,O.reportedViewFrom=O.reportedViewTo=t.first,O.view=[],O.renderedView=null,O.externalMeasured=null,O.viewOffset=0,O.lastWrapHeight=O.lastWrapWidth=0,O.updateLineNumbers=null,O.nativeBarWidth=O.barHeight=O.barWidth=0,O.scrollbarsClipped=!1,O.lineNumWidth=O.lineNumInnerWidth=O.lineNumChars=null,O.alignWidgets=!1,O.cachedCharWidth=O.cachedTextHeight=O.cachedPaddingH=null,O.maxLine=null,O.maxLineLength=0,O.maxLineChanged=!1,O.wheelDX=O.wheelDY=O.wheelStartX=O.wheelStartY=null,O.shift=!1,O.selForContextMenu=null,O.activeTouch=null,O.gutterSpecs=So(u.gutters,u.lineNumbers),$o(O),c.init(O)}var to=0,Bi=null;R?Bi=-.53:re?Bi=15:D?Bi=-.7:d&&(Bi=-1/3);function Jo(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 cl(e){var t=Jo(e);return t.x*=Bi,t.y*=Bi,t}function Qo(e,t){var c=Jo(t),u=c.x,O=c.y,K=e.display,Z=K.scroller,ne=Z.scrollWidth>Z.clientWidth,oe=Z.scrollHeight>Z.clientHeight;if(!(u&&ne||O&&oe))return;if(O&&r&&n){e:for(var pe=t.target,je=K.view;pe!=Z;pe=pe.parentNode)for(var Ke=0;Ke<je.length;Ke++)if(je[Ke].node==pe){e.display.currentWheelTarget=pe;break e}}if(u&&!re&&!N&&Bi!=null){O&&oe&&ka(e,Math.max(0,Z.scrollTop+O*Bi)),ca(e,Math.max(0,Z.scrollLeft+u*Bi)),(!O||O&&oe)&&me(t),K.wheelStartX=null;return}if(O&&Bi!=null){var ut=O*Bi,at=e.doc.scrollTop,Ot=at+K.wrapper.clientHeight;ut<0?at=Math.max(0,at+ut-50):Ot=Math.min(e.doc.height,Ot+ut+50),bo(e,{top:at,bottom:Ot})}to<20&&(K.wheelStartX==null?(K.wheelStartX=Z.scrollLeft,K.wheelStartY=Z.scrollTop,K.wheelDX=u,K.wheelDY=O,setTimeout(function(){if(K.wheelStartX==null)return;var Ut=Z.scrollLeft-K.wheelStartX,Gt=Z.scrollTop-K.wheelStartY,Jt=Gt&&K.wheelDY&&Gt/K.wheelDY||Ut&&K.wheelDX&&Ut/K.wheelDX;if(K.wheelStartX=K.wheelStartY=null,!Jt)return;Bi=(Bi*to+Jt)/(to+1),++to},200)):(K.wheelDX+=u,K.wheelDY+=O))}var Wi=function(e,t){this.ranges=e,this.primIndex=t};Wi.prototype.primary=function(){return this.ranges[this.primIndex]},Wi.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],u=e.ranges[t];if(!Rt(c.anchor,u.anchor)||!Rt(c.head,u.head))return!1}return!0},Wi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new br(lt(this.ranges[t].anchor),lt(this.ranges[t].head));return new Wi(e,this.primIndex)},Wi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Wi.prototype.contains=function(e,t){t||(t=e);for(var c=0;c<this.ranges.length;c++){var u=this.ranges[c];if(ht(t,u.from())>=0&&ht(e,u.to())<=0)return c}return-1};var br=function(e,t){this.anchor=e,this.head=t};br.prototype.from=function(){return Wt(this.anchor,this.head)},br.prototype.to=function(){return Pt(this.anchor,this.head)},br.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Xi(e,t,c){var u=e&&e.options.selectionsMayTouch,O=t[c];t.sort(function(ut,at){return ht(ut.from(),at.from())}),c=G(t,O);for(var K=1;K<t.length;K++){var Z=t[K],ne=t[K-1],oe=ht(ne.to(),Z.from());if(u&&!Z.empty()?oe>0:oe>=0){var pe=Wt(ne.from(),Z.from()),je=Pt(ne.to(),Z.to()),Ke=ne.empty()?Z.from()==Z.head:ne.from()==ne.head;K<=c&&--c,t.splice(--K,2,new br(Ke?je:pe,Ke?pe:je))}}return new Wi(t,c)}function ra(e,t){return new Wi([new br(e,t||e)],0)}function ia(e){return e.text?Ve(e.from.line+e.text.length-1,Ne(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Zo(e,t){if(ht(e,t.from)<0)return e;if(ht(e,t.to)<=0)return ia(t);var c=e.line+t.text.length-(t.to.line-t.from.line)-1,u=e.ch;return e.line==t.to.line&&(u+=ia(t).ch-t.to.ch),Ve(c,u)}function wo(e,t){for(var c=[],u=0;u<e.sel.ranges.length;u++){var O=e.sel.ranges[u];c.push(new br(Zo(O.anchor,t),Zo(O.head,t)))}return Xi(e.cm,c,e.sel.primIndex)}function qo(e,t,c){return e.line==t.line?Ve(c.line,e.ch-t.ch+c.ch):Ve(c.line+(e.line-t.line),e.ch)}function hl(e,t,c){for(var u=[],O=Ve(e.first,0),K=O,Z=0;Z<t.length;Z++){var ne=t[Z],oe=qo(ne.from,O,K),pe=qo(ia(ne),O,K);if(O=ne.to,K=pe,c=="around"){var je=e.sel.ranges[Z],Ke=ht(je.head,je.anchor)<0;u[Z]=new br(Ke?pe:oe,Ke?oe:pe)}else u[Z]=new br(oe,oe)}return new Wi(u,e.sel.primIndex)}function To(e){e.doc.mode=_n(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&&Fr(e)}function es(e,t){return t.from.ch==0&&t.to.ch==0&&Ne(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Co(e,t,c,u){function O(rn){return c?c[rn]:null}function K(rn,Qt,dn){ua(rn,Qt,dn,u),_t(rn,"change",rn,t)}function Z(rn,Qt){for(var dn=[],Pn=rn;Pn<Qt;++Pn)dn.push(new hi(pe[Pn],O(Pn),u));return dn}var ne=t.from,oe=t.to,pe=t.text,je=V(e,ne.line),Ke=V(e,oe.line),ut=Ne(pe),at=O(pe.length-1),Ot=oe.line-ne.line;if(t.full)e.insert(0,Z(0,pe.length)),e.remove(pe.length,e.size-pe.length);else if(es(e,t)){var Ut=Z(0,pe.length-1);K(Ke,Ke.text,at),Ot&&e.remove(ne.line,Ot),Ut.length&&e.insert(ne.line,Ut)}else if(je==Ke)if(pe.length==1)K(je,je.text.slice(0,ne.ch)+ut+je.text.slice(oe.ch),at);else{var Gt=Z(1,pe.length-1);Gt.push(new hi(ut+je.text.slice(oe.ch),at,u)),K(je,je.text.slice(0,ne.ch)+pe[0],O(0)),e.insert(ne.line+1,Gt)}else if(pe.length==1)K(je,je.text.slice(0,ne.ch)+pe[0]+Ke.text.slice(oe.ch),O(0)),e.remove(ne.line+1,Ot);else{K(je,je.text.slice(0,ne.ch)+pe[0],O(0)),K(Ke,ut+Ke.text.slice(oe.ch),at);var Jt=Z(1,pe.length-1);Ot>1&&e.remove(ne.line+1,Ot-1),e.insert(ne.line+1,Jt)}_t(e,"change",e,t)}function aa(e,t,c){function u(O,K,Z){if(O.linked)for(var ne=0;ne<O.linked.length;++ne){var oe=O.linked[ne];if(oe.doc==K)continue;var pe=Z&&oe.sharedHist;if(c&&!pe)continue;t(oe.doc,pe),u(oe.doc,O,pe)}}u(e,null,!0)}function ts(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Ki(e),To(e),ns(e),e.options.lineWrapping||Ni(e),e.options.mode=t.modeOption,Fr(e)}function ns(e){(e.doc.direction=="rtl"?o:P)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){ki(e,function(){ns(e),Fr(e)})}function no(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 Ro(e,t){var c={from:lt(t.from),to:ia(t),text:$(e,t.from,t.to)};return as(e,c,t.from.line,t.to.line+1),aa(e,function(u){return as(u,c,t.from.line,t.to.line+1)},!0),c}function rs(e){for(;e.length;){var t=Ne(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return rs(e.done),Ne(e.done);if(e.done.length&&!Ne(e.done).ranges)return Ne(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ne(e.done)}function is(e,t,c,u){var O=e.history;O.undone.length=0;var K=+new Date,Z,ne;if((O.lastOp==u||O.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&O.lastModTime>K-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(Z=pl(O,O.lastOp==u)))ne=Ne(Z.changes),ht(t.from,t.to)==0&&ht(t.from,ne.to)==0?ne.to=ia(t):Z.changes.push(Ro(e,t));else{var oe=Ne(O.done);for((!oe||!oe.ranges)&&ro(e.sel,O.done),Z={changes:[Ro(e,t)],generation:O.generation},O.done.push(Z);O.done.length>O.undoDepth;)O.done.shift(),O.done[0].ranges||O.done.shift()}O.done.push(c),O.generation=++O.maxGeneration,O.lastModTime=O.lastSelTime=K,O.lastOp=O.lastSelOp=u,O.lastOrigin=O.lastSelOrigin=t.origin,ne||Je(e,"historyAdded")}function ml(e,t,c,u){var O=t.charAt(0);return O=="*"||O=="+"&&c.ranges.length==u.ranges.length&&c.somethingSelected()==u.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,c,u){var O=e.history,K=u&&u.origin;c==O.lastSelOp||K&&O.lastSelOrigin==K&&(O.lastModTime==O.lastSelTime&&O.lastOrigin==K||ml(e,K,Ne(O.done),t))?O.done[O.done.length-1]=t:ro(t,O.done),O.lastSelTime=+new Date,O.lastSelOrigin=K,O.lastSelOp=c,u&&u.clearRedo!==!1&&rs(O.undone)}function ro(e,t){var c=Ne(t);c&&c.ranges&&c.equals(e)||t.push(e)}function as(e,t,c,u){var O=t["spans_"+e.id],K=0;e.iter(Math.max(e.first,c),Math.min(e.first+e.size,u),function(Z){Z.markedSpans&&((O||(O=t["spans_"+e.id]={}))[K]=Z.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 _l(e,t){var c=t["spans_"+e.id];if(!c)return null;for(var u=[],O=0;O<t.text.length;++O)u.push(vl(c[O]));return u}function os(e,t){var c=_l(e,t),u=Zr(e,t);if(!c)return u;if(!u)return c;for(var O=0;O<c.length;++O){var K=c[O],Z=u[O];if(K&&Z){e:for(var ne=0;ne<Z.length;++ne){for(var oe=Z[ne],pe=0;pe<K.length;++pe)if(K[pe].marker==oe.marker)continue e;K.push(oe)}}else Z&&(c[O]=Z)}return c}function Ea(e,t,c){for(var u=[],O=0;O<e.length;++O){var K=e[O];if(K.ranges){u.push(c?Wi.prototype.deepCopy.call(K):K);continue}var Z=K.changes,ne=[];u.push({changes:ne});for(var oe=0;oe<Z.length;++oe){var pe=Z[oe],je=void 0;if(ne.push({from:pe.from,to:pe.to,text:pe.text}),t)for(var Ke in pe)(je=Ke.match(/^spans_(\d+)$/))&&(G(t,Number(je[1]))>-1&&(Ne(ne)[Ke]=pe[Ke],delete pe[Ke]))}}return u}function Oo(e,t,c,u){if(u){var O=e.anchor;if(c){var K=ht(t,O)<0;K!=ht(c,O)<0?(O=t,t=c):K!=ht(t,c)<0&&(t=c)}return new br(O,t)}else return new br(c||t,t)}function io(e,t,c,u,O){O==null&&(O=e.cm&&(e.cm.display.shift||e.extend)),mi(e,new Wi([Oo(e.sel.primary(),t,c,O)],0),u)}function ss(e,t,c){for(var u=[],O=e.cm&&(e.cm.display.shift||e.extend),K=0;K<e.sel.ranges.length;K++)u[K]=Oo(e.sel.ranges[K],t[K],null,O);var Z=Xi(e.cm,u,e.sel.primIndex);mi(e,Z,c)}function Ao(e,t,c,u){var O=e.sel.ranges.slice(0);O[t]=c,mi(e,Xi(e.cm,O,e.sel.primIndex),u)}function ls(e,t,c,u){mi(e,ra(t,c),u)}function yl(e,t,c){var u={ranges:t.ranges,update:function(O){this.ranges=[];for(var K=0;K<O.length;K++)this.ranges[K]=new br(wt(e,O[K].anchor),wt(e,O[K].head))},origin:c&&c.origin};return Je(e,"beforeSelectionChange",e,u),e.cm&&Je(e.cm,"beforeSelectionChange",e.cm,u),u.ranges!=t.ranges?Xi(e.cm,u.ranges,u.ranges.length-1):t}function us(e,t,c){var u=e.history.done,O=Ne(u);O&&O.ranges?(u[u.length-1]=t,ao(e,t,c)):mi(e,t,c)}function mi(e,t,c){ao(e,t,c),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,c)}function ao(e,t,c){(ke(e,"beforeSelectionChange")||e.cm&&ke(e.cm,"beforeSelectionChange"))&&(t=yl(e,t,c));var u=c&&c.bias||(ht(t.primary().head,e.sel.primary().head)<0?-1:1);ds(e,hs(e,t,u,!0)),!(c&&c.scroll===!1)&&e.cm&&ya(e.cm)}function ds(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,De(e.cm)),_t(e,"cursorActivity",e)}function cs(e){ds(e,hs(e,e.sel,null,!1))}function hs(e,t,c,u){for(var O,K=0;K<t.ranges.length;K++){var Z=t.ranges[K],ne=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[K],oe=oo(e,Z.anchor,ne&&ne.anchor,c,u),pe=oo(e,Z.head,ne&&ne.head,c,u);(O||oe!=Z.anchor||pe!=Z.head)&&(O||(O=t.ranges.slice(0,K)),O[K]=new br(oe,pe))}return O?Xi(e.cm,O,t.primIndex):t}function xa(e,t,c,u,O){var K=V(e,t.line);if(K.markedSpans)for(var Z=0;Z<K.markedSpans.length;++Z){var ne=K.markedSpans[Z],oe=ne.marker,pe="selectLeft"in oe?!oe.selectLeft:oe.inclusiveLeft,je="selectRight"in oe?!oe.selectRight:oe.inclusiveRight;if((ne.from==null||(pe?ne.from<=t.ch:ne.from<t.ch))&&(ne.to==null||(je?ne.to>=t.ch:ne.to>t.ch))){if(O&&(Je(oe,"beforeCursorEnter"),oe.explicitlyCleared))if(K.markedSpans){--Z;continue}else break;if(!oe.atomic)continue;if(c){var Ke=oe.find(u<0?1:-1),ut=void 0;if((u<0?je:pe)&&(Ke=fs(e,Ke,-u,Ke&&Ke.line==t.line?K:null)),Ke&&Ke.line==t.line&&(ut=ht(Ke,c))&&(u<0?ut<0:ut>0))return xa(e,Ke,t,u,O)}var at=oe.find(u<0?-1:1);return(u<0?pe:je)&&(at=fs(e,at,u,at.line==t.line?K:null)),at?xa(e,at,t,u,O):null}}return t}function oo(e,t,c,u,O){var K=u||1,Z=xa(e,t,c,K,O)||!O&&xa(e,t,c,K,!0)||xa(e,t,c,-K,O)||!O&&xa(e,t,c,-K,!0);return Z||(e.cantEdit=!0,Ve(e.first,0))}function fs(e,t,c,u){return c<0&&t.ch==0?t.line>e.first?wt(e,Ve(t.line-1)):null:c>0&&t.ch==(u||V(e,t.line)).text.length?t.line<e.first+e.size-1?Ve(t.line+1,0):null:new Ve(t.line,t.ch+c)}function ps(e){e.setSelection(Ve(e.firstLine(),0),Ve(e.lastLine()),de)}function ms(e,t,c){var u={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return u.canceled=!0}};return c&&(u.update=function(O,K,Z,ne){O&&(u.from=wt(e,O)),K&&(u.to=wt(e,K)),Z&&(u.text=Z),ne!==void 0&&(u.origin=ne)}),Je(e,"beforeChange",e,u),e.cm&&Je(e.cm,"beforeChange",e.cm,u),u.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:u.from,to:u.to,text:u.text,origin:u.origin}}function Sa(e,t,c){if(e.cm){if(!e.cm.curOp)return oi(e.cm,Sa)(e,t,c);if(e.cm.state.suppressEdits)return}if((ke(e,"beforeChange")||e.cm&&ke(e.cm,"beforeChange"))&&(t=ms(e,t,!0),!t))return;var u=ur&&!c&&yi(e,t.from,t.to);if(u)for(var O=u.length-1;O>=0;--O)gs(e,{from:u[O].from,to:u[O].to,text:O?[""]:t.text,origin:t.origin});else gs(e,t)}function gs(e,t){if(t.text.length==1&&t.text[0]==""&&ht(t.from,t.to)==0)return;var c=wo(e,t);is(e,t,c,e.cm?e.cm.curOp.id:NaN),Ba(e,t,c,Zr(e,t));var u=[];aa(e,function(O,K){!K&&G(u,O.history)==-1&&(bs(O.history,t),u.push(O.history)),Ba(O,t,null,Zr(O,t))})}function so(e,t,c){var u=e.cm&&e.cm.state.suppressEdits;if(u&&!c)return;for(var O=e.history,K,Z=e.sel,ne=t=="undo"?O.done:O.undone,oe=t=="undo"?O.undone:O.done,pe=0;pe<ne.length&&!(K=ne[pe],c?K.ranges&&!K.equals(e.sel):!K.ranges);pe++);if(pe==ne.length)return;for(O.lastOrigin=O.lastSelOrigin=null;;)if(K=ne.pop(),K.ranges){if(ro(K,oe),c&&!K.equals(e.sel)){mi(e,K,{clearRedo:!1});return}Z=K}else if(u){ne.push(K);return}else break;var je=[];ro(Z,oe),oe.push({changes:je,generation:O.generation}),O.generation=K.generation||++O.maxGeneration;for(var Ke=ke(e,"beforeChange")||e.cm&&ke(e.cm,"beforeChange"),ut=function(Ut){var Gt=K.changes[Ut];if(Gt.origin=t,Ke&&!ms(e,Gt,!1))return ne.length=0,{};je.push(Ro(e,Gt));var Jt=Ut?wo(e,Gt):Ne(ne);Ba(e,Gt,Jt,os(e,Gt)),!Ut&&e.cm&&e.cm.scrollIntoView({from:Gt.from,to:ia(Gt)});var rn=[];aa(e,function(Qt,dn){!dn&&G(rn,Qt.history)==-1&&(bs(Qt.history,Gt),rn.push(Qt.history)),Ba(Qt,Gt,null,os(Qt,Gt))})},at=K.changes.length-1;at>=0;--at){var Ot=ut(at);if(Ot)return Ot.v}}function vs(e,t){if(t==0)return;if(e.first+=t,e.sel=new Wi(ze(e.sel.ranges,function(O){return new br(Ve(O.anchor.line+t,O.anchor.ch),Ve(O.head.line+t,O.head.ch))}),e.sel.primIndex),e.cm){Fr(e.cm,e.first,e.first-t,t);for(var c=e.cm.display,u=c.viewFrom;u<c.viewTo;u++)fi(e.cm,u,"gutter")}}function Ba(e,t,c,u){if(e.cm&&!e.cm.curOp)return oi(e.cm,Ba)(e,t,c,u);if(t.to.line<e.first){vs(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 O=t.text.length-1-(e.first-t.from.line);vs(e,O),t={from:Ve(e.first,0),to:Ve(t.to.line+O,t.to.ch),text:[Ne(t.text)],origin:t.origin}}var K=e.lastLine();t.to.line>K&&(t={from:t.from,to:Ve(K,V(e,K).text.length),text:[t.text[0]],origin:t.origin}),t.removed=$(e,t.from,t.to),c||(c=wo(e,t)),e.cm?bl(e.cm,t,u):Co(e,t,u),ao(e,c,de),e.cantEdit&&oo(e,Ve(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,c){var u=e.doc,O=e.display,K=t.from,Z=t.to,ne=!1,oe=K.line;e.options.lineWrapping||(oe=Ue(Vr(V(u,K.line))),u.iter(oe,Z.line+1,function(at){if(at==O.maxLine)return ne=!0,!0})),u.sel.contains(t.from,t.to)>-1&&De(e),Co(u,t,c,Li(e)),e.options.lineWrapping||(u.iter(oe,K.line+t.text.length,function(at){var Ot=$i(at);Ot>O.maxLineLength&&(O.maxLine=at,O.maxLineLength=Ot,O.maxLineChanged=!0,ne=!1)}),ne&&(e.curOp.updateMaxLine=!0)),Kn(u,K.line),Ua(e,400);var pe=t.text.length-(Z.line-K.line)-1;t.full?Fr(e):K.line==Z.line&&t.text.length==1&&!es(e.doc,t)?fi(e,K.line,"text"):Fr(e,K.line,Z.line+1,pe);var je=ke(e,"changes"),Ke=ke(e,"change");if(Ke||je){var ut={from:K,to:Z,text:t.text,removed:t.removed,origin:t.origin};Ke&&_t(e,"change",e,ut),je&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(ut)}e.display.selForContextMenu=null}function wa(e,t,c,u,O){var K;u||(u=c),ht(u,c)<0&&(K=[u,c],c=K[0],u=K[1]),typeof t=="string"&&(t=e.splitLines(t)),Sa(e,{from:c,to:u,text:t,origin:O})}function _s(e,t,c,u){c<e.line?e.line+=u:t<e.line&&(e.line=t,e.ch=0)}function ys(e,t,c,u){for(var O=0;O<e.length;++O){var K=e[O],Z=!0;if(K.ranges){K.copied||(K=e[O]=K.deepCopy(),K.copied=!0);for(var ne=0;ne<K.ranges.length;ne++)_s(K.ranges[ne].anchor,t,c,u),_s(K.ranges[ne].head,t,c,u);continue}for(var oe=0;oe<K.changes.length;++oe){var pe=K.changes[oe];if(c<pe.from.line)pe.from=Ve(pe.from.line+u,pe.from.ch),pe.to=Ve(pe.to.line+u,pe.to.ch);else if(t<=pe.to.line){Z=!1;break}}Z||(e.splice(0,O+1),O=0)}}function bs(e,t){var c=t.from.line,u=t.to.line,O=t.text.length-(u-c)-1;ys(e.done,c,u,O),ys(e.undone,c,u,O)}function Wa(e,t,c,u){var O=t,K=t;return typeof t=="number"?K=V(e,Bt(e,t)):O=Ue(t),O==null?null:(u(K,O)&&e.cm&&fi(e.cm,O,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,u=e+t;c<u;++c){var O=this.lines[c];this.height-=O.height,hn(O),_t(O,"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 u=0;u<t.length;++u)t[u].parent=this},iterN:function(e,t,c){for(var u=e+t;e<u;++e)if(c(this.lines[e]))return!0}};function Ka(e){this.children=e;for(var t=0,c=0,u=0;u<e.length;++u){var O=e[u];t+=O.chunkSize(),c+=O.height,O.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 u=this.children[c],O=u.chunkSize();if(e<O){var K=Math.min(t,O-e),Z=u.height;if(u.removeInner(e,K),this.height-=Z-u.height,O==K&&(this.children.splice(c--,1),u.parent=null),(t-=K)==0)break;e=0}else e-=O}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ha))){var ne=[];this.collapse(ne),this.children=[new Ha(ne)],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 u=0;u<this.children.length;++u){var O=this.children[u],K=O.chunkSize();if(e<=K){if(O.insertInner(e,t,c),O.lines&&O.lines.length>50){for(var Z=O.lines.length%25+25,ne=Z;ne<O.lines.length;){var oe=new Ha(O.lines.slice(ne,ne+=25));O.height-=oe.height,this.children.splice(++u,0,oe),oe.parent=this}O.lines=O.lines.slice(0,Z),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 O=G(e.parent.children,e);e.parent.children.splice(O+1,0,c)}else{var u=new Ka(e.children);u.parent=e,e.children=[u,c],e=u}c.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,c){for(var u=0;u<this.children.length;++u){var O=this.children[u],K=O.chunkSize();if(e<K){var Z=Math.min(t,K-e);if(O.iterN(e,Z,c))return!0;if((t-=Z)==0)break;e=0}else e-=K}}};var Ga=function(e,t,c){if(c)for(var u in c)c.hasOwnProperty(u)&&(this[u]=c[u]);this.doc=e,this.node=t};Ga.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,c=this.line,u=Ue(c);if(u==null||!t)return;for(var O=0;O<t.length;++O)t[O]==this&&t.splice(O--,1);t.length||(c.widgets=null);var K=_r(this);xe(c,Math.max(0,c.height-K)),e&&(ki(e,function(){Es(e,c,-K),fi(e,u,"widget")}),_t(e,"lineWidgetCleared",e,this,u))},Ga.prototype.changed=function(){var e=this,t=this.height,c=this.doc.cm,u=this.line;this.height=null;var O=_r(this)-t;if(!O)return;Ur(this.doc,u)||xe(u,u.height+O),c&&ki(c,function(){c.curOp.forceUpdate=!0,Es(c,u,O),_t(c,"lineWidgetChanged",c,e,Ue(u))})},Me(Ga);function Es(e,t,c){ii(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&_o(e,c)}function El(e,t,c,u){var O=new Ga(e,c,u),K=e.cm;return K&&O.noHScroll&&(K.display.alignWidgets=!0),Wa(e,t,"widget",function(Z){var ne=Z.widgets||(Z.widgets=[]);if(O.insertAt==null?ne.push(O):ne.splice(Math.min(ne.length-1,Math.max(0,O.insertAt)),0,O),O.line=Z,K&&!Ur(e,Z)){var oe=ii(Z)<e.scrollTop;xe(Z,Z.height+_r(O)),oe&&_o(K,O.height),K.curOp.forceUpdate=!0}return!0}),K&&_t(K,"lineWidgetAdded",K,O,typeof t=="number"?t:Ue(t)),O}var xs=0,oa=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++xs};oa.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&fa(e),ke(this,"clear")){var c=this.find();c&&_t(this,"clear",c.from,c.to)}for(var u=null,O=null,K=0;K<this.lines.length;++K){var Z=this.lines[K],ne=Wn(Z.markedSpans,this);e&&!this.collapsed?fi(e,Ue(Z),"text"):e&&(ne.to!=null&&(O=Ue(Z)),ne.from!=null&&(u=Ue(Z))),Z.markedSpans=Er(Z.markedSpans,ne),ne.from==null&&this.collapsed&&!Ur(this.doc,Z)&&e&&xe(Z,Zn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var oe=0;oe<this.lines.length;++oe){var pe=Vr(this.lines[oe]),je=$i(pe);je>e.display.maxLineLength&&(e.display.maxLine=pe,e.display.maxLineLength=je,e.display.maxLineChanged=!0)}u!=null&&e&&this.collapsed&&Fr(e,u,O+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&cs(e.doc)),e&&_t(e,"markerCleared",e,this,u,O),t&&pa(e),this.parent&&this.parent.clear()},oa.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var c,u,O=0;O<this.lines.length;++O){var K=this.lines[O],Z=Wn(K.markedSpans,this);if(Z.from!=null&&(c=Ve(t?K:Ue(K),Z.from),e==-1))return c;if(Z.to!=null&&(u=Ve(t?K:Ue(K),Z.to),e==1))return u}return c&&{from:c,to:u}},oa.prototype.changed=function(){var e=this,t=this.find(-1,!0),c=this,u=this.doc.cm;if(!t||!u)return;ki(u,function(){var O=t.line,K=Ue(t.line),Z=fn(u,K);if(Z&&(tn(Z),u.curOp.selectionChanged=u.curOp.forceUpdate=!0),u.curOp.updateMaxLine=!0,!Ur(c.doc,O)&&c.height!=null){var ne=c.height;c.height=null;var oe=_r(c)-ne;oe&&xe(O,O.height+oe)}_t(u,"markerChanged",u,e)})},oa.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||G(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},oa.prototype.detachLine=function(e){if(this.lines.splice(G(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Me(oa);function Ta(e,t,c,u,O){if(u&&u.shared)return xl(e,t,c,u,O);if(e.cm&&!e.cm.curOp)return oi(e.cm,Ta)(e,t,c,u,O);var K=new oa(e,O),Z=ht(t,c);if(u&&l(u,K,!1),Z>0||Z==0&&K.clearWhenEmpty!==!1)return K;if(K.replacedWith&&(K.collapsed=!0,K.widgetNode=C("span",[K.replacedWith],"CodeMirror-widget"),u.handleMouseEvents||K.widgetNode.setAttribute("cm-ignore-events","true"),u.insertLeft&&(K.widgetNode.insertLeft=!0)),K.collapsed){if(Rr(e,t.line,t,c,K)||t.line!=c.line&&Rr(e,c.line,t,c,K))throw new Error("Inserting collapsed marker partially overlapping an existing one");Dr()}K.addToHistory&&is(e,{from:t,to:c,origin:"markText"},e.sel,NaN);var ne=t.line,oe=e.cm,pe;if(e.iter(ne,c.line+1,function(Ke){oe&&K.collapsed&&!oe.options.lineWrapping&&Vr(Ke)==oe.display.maxLine&&(pe=!0),K.collapsed&&ne!=t.line&&xe(Ke,0),zr(Ke,new Cr(K,ne==t.line?t.ch:null,ne==c.line?c.ch:null)),++ne}),K.collapsed&&e.iter(t.line,c.line+1,function(Ke){Ur(e,Ke)&&xe(Ke,0)}),K.clearOnEnter&&qe(K,"beforeCursorEnter",function(){return K.clear()}),K.readOnly&&(hr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),K.collapsed&&(K.id=++xs,K.atomic=!0),oe){if(pe&&(oe.curOp.updateMaxLine=!0),K.collapsed)Fr(oe,t.line,c.line+1);else if(K.className||K.startStyle||K.endStyle||K.css||K.attributes||K.title)for(var je=t.line;je<=c.line;je++)fi(oe,je,"text");K.atomic&&cs(oe.doc),_t(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();_t(this,"clear")},za.prototype.find=function(e,t){return this.primary.find(e,t)},Me(za);function xl(e,t,c,u,O){u=l(u),u.shared=!1;var K=[Ta(e,t,c,u,O)],Z=K[0],ne=u.widgetNode;return aa(e,function(oe){ne&&(u.widgetNode=ne.cloneNode(!0)),K.push(Ta(oe,wt(oe,t),wt(oe,c),u,O));for(var pe=0;pe<oe.linked.length;++pe)if(oe.linked[pe].isParent)return;Z=Ne(K)}),new za(K,Z)}function Ss(e){return e.findMarks(Ve(e.first,0),e.clipPos(Ve(e.lastLine())),function(t){return t.parent})}function Sl(e,t){for(var c=0;c<t.length;c++){var u=t[c],O=u.find(),K=e.clipPos(O.from),Z=e.clipPos(O.to);if(ht(K,Z)){var ne=Ta(e,K,Z,u.primary,u.primary.type);u.markers.push(ne),ne.parent=u}}}function wl(e){for(var t=function(u){var O=e[u],K=[O.primary.doc];aa(O.primary.doc,function(oe){return K.push(oe)});for(var Z=0;Z<O.markers.length;Z++){var ne=O.markers[Z];G(K,ne.doc)==-1&&(ne.parent=null,O.markers.splice(Z--,1))}},c=0;c<e.length;c++)t(c)}var Tl=0,Si=function(e,t,c,u,O){if(!(this instanceof Si))return new Si(e,t,c,u,O);c==null&&(c=0),Ka.call(this,[new Ha([new hi("",null)])]),this.first=c,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=c;var K=Ve(c,0);this.sel=ra(K),this.history=new no(null),this.id=++Tl,this.modeOption=t,this.lineSep=u,this.direction=O=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Co(this,{from:K,to:K,text:e}),mi(this,ra(K),de)};Si.prototype=Xe(Ka.prototype,{constructor:Si,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,u=0;u<t.length;++u)c+=t[u].height;this.insertInner(e-this.first,t,c)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=ee(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:si(function(e){var t=Ve(this.first,0),c=this.first+this.size-1;Sa(this,{from:t,to:Ve(c,V(this,c).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Pa(this.cm,0,0),mi(this,ra(t),de)}),replaceRange:function(e,t,c,u){t=wt(this,t),c=c?wt(this,c):t,wa(this,e,t,c,u)},getRange:function(e,t,c){var u=$(this,wt(this,e),wt(this,t));return c===!1?u:u.join(c||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(pt(this,e))return V(this,e)},getLineNumber:function(e){return Ue(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=V(this,e)),Vr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return wt(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:si(function(e,t,c){ls(this,wt(this,typeof e=="number"?Ve(e,t||0):e),null,c)}),setSelection:si(function(e,t,c){ls(this,wt(this,e),wt(this,t||e),c)}),extendSelection:si(function(e,t,c){io(this,wt(this,e),t&&wt(this,t),c)}),extendSelections:si(function(e,t){ss(this,k(this,e),t)}),extendSelectionsBy:si(function(e,t){var c=ze(this.sel.ranges,e);ss(this,k(this,c),t)}),setSelections:si(function(e,t,c){if(!e.length)return;for(var u=[],O=0;O<e.length;O++)u[O]=new br(wt(this,e[O].anchor),wt(this,e[O].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),mi(this,Xi(this.cm,u,t),c)}),addSelection:si(function(e,t,c){var u=this.sel.ranges.slice(0);u.push(new br(wt(this,e),wt(this,t||e))),mi(this,Xi(this.cm,u,u.length-1),c)}),getSelection:function(e){for(var t=this.sel.ranges,c,u=0;u<t.length;u++){var O=$(this,t[u].from(),t[u].to());c=c?c.concat(O):O}return e===!1?c:c.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],c=this.sel.ranges,u=0;u<c.length;u++){var O=$(this,c[u].from(),c[u].to());e!==!1&&(O=O.join(e||this.lineSeparator())),t[u]=O}return t},replaceSelection:function(e,t,c){for(var u=[],O=0;O<this.sel.ranges.length;O++)u[O]=e;this.replaceSelections(u,t,c||"+input")},replaceSelections:si(function(e,t,c){for(var u=[],O=this.sel,K=0;K<O.ranges.length;K++){var Z=O.ranges[K];u[K]={from:Z.from(),to:Z.to(),text:this.splitLines(e[K]),origin:c}}for(var ne=t&&t!="end"&&hl(this,u,t),oe=u.length-1;oe>=0;oe--)Sa(this,u[oe]);ne?us(this,ne):this.cm&&ya(this.cm)}),undo:si(function(){so(this,"undo")}),redo:si(function(){so(this,"redo")}),undoSelection:si(function(){so(this,"undo",!0)}),redoSelection:si(function(){so(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,u=0;u<e.done.length;u++)e.done[u].ranges||++t;for(var O=0;O<e.undone.length;O++)e.undone[O].ranges||++c;return{undo:t,redo:c}},clearHistory:function(){var e=this;this.history=new no(this.history.maxGeneration),aa(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 no(this.history.maxGeneration);t.done=Ea(e.done.slice(0),null,!0),t.undone=Ea(e.undone.slice(0),null,!0)},setGutterMarker:si(function(e,t,c){return Wa(this,e,"gutter",function(u){var O=u.gutterMarkers||(u.gutterMarkers={});return O[t]=c,!c&&be(O)&&(u.gutterMarkers=null),!0})}),clearGutter:si(function(e){var t=this;this.iter(function(c){c.gutterMarkers&&c.gutterMarkers[e]&&Wa(t,c,"gutter",function(){return c.gutterMarkers[e]=null,be(c.gutterMarkers)&&(c.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!pt(this,e))return null;if(t=e,e=V(this,e),!e)return null}else if(t=Ue(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:si(function(e,t,c){return Wa(this,e,t=="gutter"?"gutter":"class",function(u){var O=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!u[O])u[O]=c;else{if(x(c).test(u[O]))return!1;u[O]+=" "+c}return!0})}),removeLineClass:si(function(e,t,c){return Wa(this,e,t=="gutter"?"gutter":"class",function(u){var O=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",K=u[O];if(K)if(c==null)u[O]=null;else{var Z=K.match(x(c));if(!Z)return!1;var ne=Z.index+Z[0].length;u[O]=K.slice(0,Z.index)+(!Z.index||ne==K.length?"":" ")+K.slice(ne)||null}else return!1;return!0})}),addLineWidget:si(function(e,t,c){return El(this,e,t,c)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,c){return Ta(this,wt(this,e),wt(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=wt(this,e),Ta(this,e,e,c,"bookmark")},findMarksAt:function(e){e=wt(this,e);var t=[],c=V(this,e.line).markedSpans;if(c)for(var u=0;u<c.length;++u){var O=c[u];(O.from==null||O.from<=e.ch)&&(O.to==null||O.to>=e.ch)&&t.push(O.marker.parent||O.marker)}return t},findMarks:function(e,t,c){e=wt(this,e),t=wt(this,t);var u=[],O=e.line;return this.iter(e.line,t.line+1,function(K){var Z=K.markedSpans;if(Z)for(var ne=0;ne<Z.length;ne++){var oe=Z[ne];!(oe.to!=null&&O==e.line&&e.ch>=oe.to||oe.from==null&&O!=e.line||oe.from!=null&&O==t.line&&oe.from>=t.ch)&&(!c||c(oe.marker))&&u.push(oe.marker.parent||oe.marker)}++O}),u},getAllMarks:function(){var e=[];return this.iter(function(t){var c=t.markedSpans;if(c)for(var u=0;u<c.length;++u)c[u].from!=null&&e.push(c[u].marker)}),e},posFromIndex:function(e){var t,c=this.first,u=this.lineSeparator().length;return this.iter(function(O){var K=O.text.length+u;if(K>e)return t=e,!0;e-=K,++c}),wt(this,Ve(c,t))},indexFromPos:function(e){e=wt(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(u){t+=u.text.length+c}),t},copy:function(e){var t=new Si(ee(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 u=new Si(ee(this,t,c),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(u.history=this.history),(this.linked||(this.linked=[])).push({doc:u,sharedHist:e.sharedHist}),u.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Sl(u,Ss(this)),u},unlinkDoc:function(e){if(e instanceof Mr&&(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),wl(Ss(this));break}if(e.history==this.history){var u=[e.id];aa(e,function(O){return u.push(O.id)},!0),e.history=new no(null),e.history.done=Ea(this.history.done,u),e.history.undone=Ea(this.history.undone,u)}},iterLinkedDocs:function(e){aa(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Tt(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:si(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)})}),Si.prototype.eachLine=Si.prototype.iter;var ws=0;function Cl(e){var t=this;if(Ts(t),et(t,e)||Bn(t.display,e))return;me(e),R&&(ws=+new Date);var c=ei(t,e,!0),u=e.dataTransfer.files;if(!c||t.isReadOnly())return;if(u&&u.length&&window.FileReader&&window.File)for(var O=u.length,K=Array(O),Z=0,ne=function(){++Z==O&&oi(t,function(){c=wt(t.doc,c);var at={from:c,to:c,text:t.doc.splitLines(K.filter(function(Ot){return Ot!=null}).join(t.doc.lineSeparator())),origin:"paste"};Sa(t.doc,at),us(t.doc,ra(wt(t.doc,c),wt(t.doc,ia(at))))})()},oe=function(at,Ot){if(t.options.allowDropFileTypes&&G(t.options.allowDropFileTypes,at.type)==-1){ne();return}var Ut=new FileReader;Ut.onerror=function(){return ne()},Ut.onload=function(){var Gt=Ut.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Gt)){ne();return}K[Ot]=Gt,ne()},Ut.readAsText(at)},pe=0;pe<u.length;pe++)oe(u[pe],pe);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 je=e.dataTransfer.getData("Text");if(je){var Ke;if(t.state.draggingText&&!t.state.draggingText.copy&&(Ke=t.listSelections()),ao(t.doc,ra(c,c)),Ke)for(var ut=0;ut<Ke.length;++ut)wa(t.doc,"",Ke[ut].anchor,Ke[ut].head,"drag");t.replaceSelection(je,"around","paste"),t.display.input.focus()}}catch(at){}}}function Rl(e,t){if(R&&(!e.state.draggingText||+new Date-ws<100)){Se(t);return}if(et(e,t)||Bn(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d){var c=b("img",null,null,"position: fixed; left: 0; top: 0;");c.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",N&&(c.width=c.height=1,e.display.wrapper.appendChild(c),c._top=c.offsetTop),t.dataTransfer.setDragImage(c,0,0),N&&c.parentNode.removeChild(c)}}function Ol(e,t){var c=ei(e,t);if(!c)return;var u=document.createDocumentFragment();$r(e,c,u),e.display.dragCursor||(e.display.dragCursor=b("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),A(e.display.dragCursor,u)}function Ts(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Cs(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),c=[],u=0;u<t.length;u++){var O=t[u].CodeMirror;O&&c.push(O)}c.length&&c[0].operation(function(){for(var K=0;K<c.length;K++)e(c[K])})}var Rs=!1;function Al(){if(Rs)return;Ll(),Rs=!0}function Ll(){var e;qe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Cs(Il)},100))}),qe(window,"blur",function(){return Cs(Di)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var sa={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++)sa[Va+48]=sa[Va+96]=String(Va);for(var lo=65;lo<=90;lo++)sa[lo]=String.fromCharCode(lo);for(var Xa=1;Xa<=12;Xa++)sa[Xa+111]=sa[Xa+63235]="F"+Xa;var Zi={};Zi.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"},Zi.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"},Zi.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"},Zi.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"]},Zi.default=r?Zi.macDefault:Zi.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var c,u,O,K,Z=0;Z<t.length-1;Z++){var ne=t[Z];if(/^(cmd|meta|m)$/i.test(ne))K=!0;else if(/^a(lt)?$/i.test(ne))c=!0;else if(/^(c|ctrl|control)$/i.test(ne))u=!0;else if(/^s(hift)?$/i.test(ne))O=!0;else throw new Error("Unrecognized modifier name: "+ne)}return c&&(e="Alt-"+e),u&&(e="Ctrl-"+e),K&&(e="Cmd-"+e),O&&(e="Shift-"+e),e}function Pl(e){var t={};for(var c in e)if(e.hasOwnProperty(c)){var u=e[c];if(/^(name|fallthrough|(de|at)tach)$/.test(c))continue;if(u=="..."){delete e[c];continue}for(var O=ze(c.split(" "),Dl),K=0;K<O.length;K++){var Z=void 0,ne=void 0;K==O.length-1?(ne=O.join(" "),Z=u):(ne=O.slice(0,K+1).join(" "),Z="...");var oe=t[ne];if(!oe)t[ne]=Z;else if(oe!=Z)throw new Error("Inconsistent bindings for "+ne)}delete e[c]}for(var pe in t)e[pe]=t[pe];return e}function Ca(e,t,c,u){t=uo(t);var O=t.call?t.call(e,u):t[e];if(O===!1)return"nothing";if(O==="...")return"multi";if(O!=null&&c(O))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Ca(e,t.fallthrough,c,u);for(var K=0;K<t.fallthrough.length;K++){var Z=Ca(e,t.fallthrough[K],c,u);if(Z)return Z}}}function Os(e){var t=typeof e=="string"?e:sa[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function As(e,t,c){var u=e;return t.altKey&&u!="Alt"&&(e="Alt-"+e),(I?t.metaKey:t.ctrlKey)&&u!="Ctrl"&&(e="Ctrl-"+e),(I?t.ctrlKey:t.metaKey)&&u!="Mod"&&(e="Cmd-"+e),!c&&t.shiftKey&&u!="Shift"&&(e="Shift-"+e),e}function Ls(e,t){if(N&&e.keyCode==34&&e.char)return!1;var c=sa[e.keyCode];return c==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(c=e.code),As(c,e,t))}function uo(e){return typeof e=="string"?Zi[e]:e}function Ra(e,t){for(var c=e.doc.sel.ranges,u=[],O=0;O<c.length;O++){for(var K=t(c[O]);u.length&&ht(K.from,Ne(u).to)<=0;){var Z=u.pop();if(ht(Z.from,K.from)<0){K.from=Z.from;break}}u.push(K)}ki(e,function(){for(var ne=u.length-1;ne>=0;ne--)wa(e.doc,"",u[ne].from,u[ne].to,"+delete");ya(e)})}function Lo(e,t,c){var u=ye(e.text,t+c,c);return u<0||u>e.text.length?null:u}function Io(e,t,c){var u=Lo(e,t.ch,c);return u==null?null:new Ve(t.line,u,c<0?"after":"before")}function Do(e,t,c,u,O){if(e){t.doc.direction=="rtl"&&(O=-O);var K=st(c,t.doc.direction);if(K){var Z=O<0?Ne(K):K[0],ne=O<0==(Z.level==1),oe=ne?"after":"before",pe;if(Z.level>0||t.doc.direction=="rtl"){var je=Sn(t,c);pe=O<0?c.text.length-1:0;var Ke=bn(t,je,pe).top;pe=Te(function(ut){return bn(t,je,ut).top==Ke},O<0==(Z.level==1)?Z.from:Z.to-1,pe),oe=="before"&&(pe=Lo(c,pe,1))}else pe=O<0?Z.to:Z.from;return new Ve(u,pe,oe)}}return new Ve(u,O<0?c.text.length:0,O<0?"before":"after")}function kl(e,t,c,u){var O=st(t,e.doc.direction);if(!O)return Io(t,c,u);c.ch>=t.text.length?(c.ch=t.text.length,c.sticky="before"):c.ch<=0&&(c.ch=0,c.sticky="after");var K=Ye(O,c.ch,c.sticky),Z=O[K];if(e.doc.direction=="ltr"&&Z.level%2==0&&(u>0?Z.to>c.ch:Z.from<c.ch))return Io(t,c,u);var ne=function(Jt,rn){return Lo(t,Jt instanceof Ve?Jt.ch:Jt,rn)},oe,pe=function(Jt){return e.options.lineWrapping?(oe=oe||Sn(e,t),da(e,t,oe,Jt)):{begin:0,end:t.text.length}},je=pe(c.sticky=="before"?ne(c,-1):c.ch);if(e.doc.direction=="rtl"||Z.level==1){var Ke=Z.level==1==u<0,ut=ne(c,Ke?1:-1);if(ut!=null&&(Ke?ut<=Z.to&&ut<=je.end:ut>=Z.from&&ut>=je.begin)){var at=Ke?"before":"after";return new Ve(c.line,ut,at)}}var Ot=function(Jt,rn,Qt){for(var dn=function(Lr,li){return li?new Ve(c.line,ne(Lr,1),"before"):new Ve(c.line,Lr,"after")};Jt>=0&&Jt<O.length;Jt+=rn){var Pn=O[Jt],On=rn>0==(Pn.level!=1),or=On?Qt.begin:ne(Qt.end,-1);if(Pn.from<=or&&or<Pn.to)return dn(or,On);if(or=On?Pn.from:ne(Pn.to,-1),Qt.begin<=or&&or<Qt.end)return dn(or,On)}},Ut=Ot(K+u,u,je);if(Ut)return Ut;var Gt=u>0?je.end:ne(je.begin,-1);return Gt!=null&&!(u>0&&Gt==t.text.length)&&(Ut=Ot(u>0?0:O.length-1,u,pe(Gt)),Ut)?Ut:null}var Ya={selectAll:ps,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),de)},killLine:function(e){return Ra(e,function(t){if(t.empty()){var c=V(e.doc,t.head.line).text.length;return t.head.ch==c&&t.head.line<e.lastLine()?{from:t.head,to:Ve(t.head.line+1,0)}:{from:t.head,to:Ve(t.head.line,c)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Ra(e,function(t){return{from:Ve(t.from().line,0),to:wt(e.doc,Ve(t.to().line+1,0))}})},delLineLeft:function(e){return Ra(e,function(t){return{from:Ve(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Ra(e,function(t){var c=e.charCoords(t.head,"div").top+5,u=e.coordsChar({left:0,top:c},"div");return{from:u,to:t.from()}})},delWrappedLineRight:function(e){return Ra(e,function(t){var c=e.charCoords(t.head,"div").top+5,u=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:c},"div");return{from:t.from(),to:u}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(Ve(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Ve(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Is(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Ds(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Ml(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var c=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:c},"div")},he)},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")},he)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var c=e.cursorCoords(t.head,"div").top+5,u=e.coordsChar({left:0,top:c},"div");return u.ch<e.getLine(u.line).search(/\S/)?Ds(e,t.head):u},he)},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(),u=e.options.tabSize,O=0;O<c.length;O++){var K=c[O].from(),Z=F(e.getLine(K.line),K.ch,u);t.push(ge(u-Z%u))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return ki(e,function(){for(var t=e.listSelections(),c=[],u=0;u<t.length;u++){if(!t[u].empty())continue;var O=t[u].head,K=V(e.doc,O.line).text;if(K){if(O.ch==K.length&&(O=new Ve(O.line,O.ch-1)),O.ch>0)O=new Ve(O.line,O.ch+1),e.replaceRange(K.charAt(O.ch-1)+K.charAt(O.ch-2),Ve(O.line,O.ch-2),O,"+transpose");else if(O.line>e.doc.first){var Z=V(e.doc,O.line-1).text;Z&&(O=new Ve(O.line,1),e.replaceRange(K.charAt(0)+e.doc.lineSeparator()+Z.charAt(Z.length-1),Ve(O.line-1,Z.length-1),O,"+transpose"))}}c.push(new br(O,O))}e.setSelections(c)})},newlineAndIndent:function(e){return ki(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 u=0;u<t.length;u++)e.indentLine(t[u].from().line,null,!0);ya(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Is(e,t){var c=V(e.doc,t),u=Vr(c);return u!=c&&(t=Ue(u)),Do(!0,e,u,t,1)}function Ml(e,t){var c=V(e.doc,t),u=Ar(c);return u!=c&&(t=Ue(u)),Do(!0,e,c,t,-1)}function Ds(e,t){var c=Is(e,t.line),u=V(e.doc,c.line),O=st(u,e.doc.direction);if(!O||O[0].level==0){var K=Math.max(c.ch,u.text.search(/\S/)),Z=t.line==c.line&&t.ch<=K&&t.ch;return Ve(c.line,Z?0:K,c.sticky)}return c}function co(e,t,c){if(typeof t=="string"&&(t=Ya[t],!t))return!1;e.display.input.ensurePolled();var u=e.display.shift,O=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),c&&(e.display.shift=!1),O=t(e)!=te}finally{e.display.shift=u,e.state.suppressEdits=!1}return O}function Nl(e,t,c){for(var u=0;u<e.state.keyMaps.length;u++){var O=Ca(t,e.state.keyMaps[u],c,e);if(O)return O}return e.options.extraKeys&&Ca(t,e.options.extraKeys,c,e)||Ca(t,e.options.keyMap,c,e)}var Ul=new j;function $a(e,t,c,u){var O=e.state.keySeq;if(O){if(Os(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==O&&(e.state.keySeq=null,e.display.input.reset())}),Ps(e,O+" "+t,c,u))return!0}return Ps(e,t,c,u)}function Ps(e,t,c,u){var O=Nl(e,t,u);return O=="multi"&&(e.state.keySeq=t),O=="handled"&&_t(e,"keyHandled",e,t,c),(O=="handled"||O=="multi")&&(me(c),xn(e)),!!O}function ks(e,t){var c=Ls(t,!0);return c?t.shiftKey&&!e.state.keySeq?$a(e,"Shift-"+c,t,function(u){return co(e,u,!0)})||$a(e,c,t,function(u){if(typeof u=="string"?/^go[A-Z]/.test(u):u.motion)return co(e,u)}):$a(e,c,t,function(u){return co(e,u)}):!1}function Fl(e,t,c){return $a(e,"'"+c+"'",t,function(u){return co(e,u,!0)})}var Po=null;function Ms(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=f(),et(t,e))return;R&&B<11&&e.keyCode==27&&(e.returnValue=!1);var c=e.keyCode;t.display.shift=c==16||e.shiftKey;var u=ks(t,e);N&&(Po=u?c:null,!u&&c==88&&!Ct&&(r?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),re&&!r&&!u&&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;o(t,"CodeMirror-crosshair");function c(u){(u.keyCode==18||!u.altKey)&&(P(t,"CodeMirror-crosshair"),yt(document,"keyup",c),yt(document,"mouseover",c))}qe(document,"keyup",c),qe(document,"mouseover",c)}function Ns(e){e.keyCode==16&&(this.doc.sel.shift=!1),et(this,e)}function Us(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Bn(t.display,e)||et(t,e)||e.ctrlKey&&!e.altKey||r&&e.metaKey)return;var c=e.keyCode,u=e.charCode;if(N&&c==Po){Po=null,me(e);return}if(N&&(!e.which||e.which<10)&&ks(t,e))return;var O=String.fromCharCode(u==null?c:u);if(O=="\b")return;if(Fl(t,e,O))return;t.display.input.onKeyPress(e)}var Bl=400,ko=function(e,t,c){this.time=e,this.pos=t,this.button=c};ko.prototype.compare=function(e,t,c){return this.time+Bl>e&&ht(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 ko(c,e,t),Ja=null,"double"):(Ja=new ko(c,e,t),Qa=null,"single")}function Fs(e){var t=this,c=t.display;if(et(t,e)||c.activeTouch&&c.input.supportsTouch())return;if(c.input.ensurePolled(),c.shift=e.shiftKey,Bn(c,e)){n||(c.scroller.draggable=!1,setTimeout(function(){return c.scroller.draggable=!0},100));return}if(Mo(t,e))return;var u=ei(t,e),O=it(e),K=u?Wl(u,O):"single";if(window.focus(),O==1&&t.state.selectingText&&t.state.selectingText(e),u&&Hl(t,O,u,K,e))return;O==1?u?Gl(t,u,K,e):Fe(e)==c.scroller&&me(e):O==2?(u&&io(t.doc,u),setTimeout(function(){return c.input.focus()},20)):O==3&&(E?t.display.input.onContextMenu(e):_a(t))}function Hl(e,t,c,u,O){var K="Click";return u=="double"?K="Double"+K:u=="triple"&&(K="Triple"+K),K=(t==1?"Left":t==2?"Middle":"Right")+K,$a(e,As(K,O),O,function(Z){if(typeof Z=="string"&&(Z=Ya[Z]),!Z)return!1;var ne=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ne=Z(e,c)!=te}finally{e.state.suppressEdits=!1}return ne})}function Kl(e,t,c){var u=e.getOption("configureMouse"),O=u?u(e,t,c):{};if(O.unit==null){var K=v?c.shiftKey&&c.metaKey:c.altKey;O.unit=K?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(O.extend==null||e.doc.extend)&&(O.extend=e.doc.extend||c.shiftKey),O.addNew==null&&(O.addNew=r?c.metaKey:c.ctrlKey),O.moveOnDrag==null&&(O.moveOnDrag=!(r?c.altKey:c.ctrlKey)),O}function Gl(e,t,c,u){R?setTimeout(y(ta,e),0):e.curOp.focus=f();var O=Kl(e,c,u),K=e.doc.sel,Z;e.options.dragDrop&&Ie&&!e.isReadOnly()&&c=="single"&&(Z=K.contains(t))>-1&&(ht((Z=K.ranges[Z]).from(),t)<0||t.xRel>0)&&(ht(Z.to(),t)>0||t.xRel<0)?zl(e,u,t,O):Vl(e,u,t,O)}function zl(e,t,c,u){var O=e.display,K=!1,Z=oi(e,function(pe){n&&(O.scroller.draggable=!1),e.state.draggingText=!1,yt(O.wrapper.ownerDocument,"mouseup",Z),yt(O.wrapper.ownerDocument,"mousemove",ne),yt(O.scroller,"dragstart",oe),yt(O.scroller,"drop",Z),K||(me(pe),u.addNew||io(e.doc,c,null,null,u.extend),n&&!d||R&&B==9?setTimeout(function(){O.wrapper.ownerDocument.body.focus({preventScroll:!0}),O.input.focus()},20):O.input.focus())}),ne=function(pe){K=K||Math.abs(t.clientX-pe.clientX)+Math.abs(t.clientY-pe.clientY)>=10},oe=function(){return K=!0};n&&(O.scroller.draggable=!0),e.state.draggingText=Z,Z.copy=!u.moveOnDrag,O.scroller.dragDrop&&O.scroller.dragDrop(),qe(O.wrapper.ownerDocument,"mouseup",Z),qe(O.wrapper.ownerDocument,"mousemove",ne),qe(O.scroller,"dragstart",oe),qe(O.scroller,"drop",Z),_a(e),setTimeout(function(){return O.input.focus()},20)}function js(e,t,c){if(c=="char")return new br(t,t);if(c=="word")return e.findWordAt(t);if(c=="line")return new br(Ve(t.line,0),wt(e.doc,Ve(t.line+1,0)));var u=c(e,t);return new br(u.from,u.to)}function Vl(e,t,c,u){var O=e.display,K=e.doc;me(t);var Z,ne,oe=K.sel,pe=oe.ranges;if(u.addNew&&!u.extend?(ne=K.sel.contains(c),ne>-1?Z=pe[ne]:Z=new br(c,c)):(Z=K.sel.primary(),ne=K.sel.primIndex),u.unit=="rectangle")u.addNew||(Z=new br(c,c)),c=ei(e,t,!0,!0),ne=-1;else{var je=js(e,c,u.unit);u.extend?Z=Oo(Z,je.anchor,je.head,u.extend):Z=je}u.addNew?ne==-1?(ne=pe.length,mi(K,Xi(e,pe.concat([Z]),ne),{scroll:!1,origin:"*mouse"})):pe.length>1&&pe[ne].empty()&&u.unit=="char"&&!u.extend?(mi(K,Xi(e,pe.slice(0,ne).concat(pe.slice(ne+1)),0),{scroll:!1,origin:"*mouse"}),oe=K.sel):Ao(K,ne,Z,ve):(ne=0,mi(K,new Wi([Z],0),ve),oe=K.sel);var Ke=c;function ut(Qt){if(ht(Ke,Qt)==0)return;if(Ke=Qt,u.unit=="rectangle"){for(var dn=[],Pn=e.options.tabSize,On=F(V(K,c.line).text,c.ch,Pn),or=F(V(K,Qt.line).text,Qt.ch,Pn),Lr=Math.min(On,or),li=Math.max(On,or),Br=Math.min(c.line,Qt.line),Mi=Math.min(e.lastLine(),Math.max(c.line,Qt.line));Br<=Mi;Br++){var wi=V(K,Br).text,Jr=Re(wi,Lr,Pn);Lr==li?dn.push(new br(Ve(Br,Jr),Ve(Br,Jr))):wi.length>Jr&&dn.push(new br(Ve(Br,Jr),Ve(Br,Re(wi,li,Pn))))}dn.length||dn.push(new br(c,c)),mi(K,Xi(e,oe.ranges.slice(0,ne).concat(dn),ne),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Qt)}else{var Ti=Z,pi=js(e,Qt,u.unit),ni=Ti.anchor,Qr;ht(pi.anchor,ni)>0?(Qr=pi.head,ni=Wt(Ti.from(),pi.anchor)):(Qr=pi.anchor,ni=Pt(Ti.to(),pi.head));var Kr=oe.ranges.slice(0);Kr[ne]=Xl(e,new br(wt(K,ni),Qr)),mi(K,Xi(e,Kr,ne),ve)}}var at=O.wrapper.getBoundingClientRect(),Ot=0;function Ut(Qt){var dn=++Ot,Pn=ei(e,Qt,!0,u.unit=="rectangle");if(!Pn)return;if(ht(Pn,Ke)!=0){e.curOp.focus=f(),ut(Pn);var On=Vi(O,K);(Pn.line>=On.to||Pn.line<On.from)&&setTimeout(oi(e,function(){Ot==dn&&Ut(Qt)}),150)}else{var or=Qt.clientY<at.top?-20:Qt.clientY>at.bottom?20:0;or&&setTimeout(oi(e,function(){if(Ot!=dn)return;O.scroller.scrollTop+=or,Ut(Qt)}),50)}}function Gt(Qt){e.state.selectingText=!1,Ot=Infinity,Qt&&(me(Qt),O.input.focus()),yt(O.wrapper.ownerDocument,"mousemove",Jt),yt(O.wrapper.ownerDocument,"mouseup",rn),K.history.lastSelOrigin=null}var Jt=oi(e,function(Qt){Qt.buttons===0||!it(Qt)?Gt(Qt):Ut(Qt)}),rn=oi(e,Gt);e.state.selectingText=rn,qe(O.wrapper.ownerDocument,"mousemove",Jt),qe(O.wrapper.ownerDocument,"mouseup",rn)}function Xl(e,t){var c=t.anchor,u=t.head,O=V(e.doc,c.line);if(ht(c,u)==0&&c.sticky==u.sticky)return t;var K=st(O);if(!K)return t;var Z=Ye(K,c.ch,c.sticky),ne=K[Z];if(ne.from!=c.ch&&ne.to!=c.ch)return t;var oe=Z+(ne.from==c.ch==(ne.level!=1)?0:1);if(oe==0||oe==K.length)return t;var pe;if(u.line!=c.line)pe=(u.line-c.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var je=Ye(K,u.ch,u.sticky),Ke=je-Z||(u.ch-c.ch)*(ne.level==1?-1:1);je==oe-1||je==oe?pe=Ke<0:pe=Ke>0}var ut=K[oe+(pe?-1:0)],at=pe==(ut.level==1),Ot=at?ut.from:ut.to,Ut=at?"after":"before";return c.ch==Ot&&c.sticky==Ut?t:new br(new Ve(c.line,Ot,Ut),u)}function Bs(e,t,c,u){var O,K;if(t.touches)O=t.touches[0].clientX,K=t.touches[0].clientY;else try{O=t.clientX,K=t.clientY}catch(ut){return!1}if(O>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;u&&me(t);var Z=e.display,ne=Z.lineDiv.getBoundingClientRect();if(K>ne.bottom||!ke(e,c))return Oe(t);K-=ne.top-Z.viewOffset;for(var oe=0;oe<e.display.gutterSpecs.length;++oe){var pe=Z.gutters.childNodes[oe];if(pe&&pe.getBoundingClientRect().right>=O){var je=$e(e.doc,K),Ke=e.display.gutterSpecs[oe];return Je(e,c,e,je,Ke.className,t),Oe(t)}}}function Mo(e,t){return Bs(e,t,"gutterClick",!0)}function Ws(e,t){if(Bn(e.display,t)||Yl(e,t))return;if(et(e,t,"contextmenu"))return;E||e.display.input.onContextMenu(t)}function Yl(e,t){return ke(e,"gutterContextMenu")?Bs(e,t,"gutterContextMenu",!1):!1}function Hs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Zt(e)}var Oa={toString:function(){return"CodeMirror.Init"}},Ks={},ho={};function $l(e){var t=e.optionHandlers;function c(u,O,K,Z){e.defaults[u]=O,K&&(t[u]=Z?function(ne,oe,pe){pe!=Oa&&K(ne,oe,pe)}:K)}e.defineOption=c,e.Init=Oa,c("value","",function(u,O){return u.setValue(O)},!0),c("mode",null,function(u,O){u.doc.modeOption=O,To(u)},!0),c("indentUnit",2,To,!0),c("indentWithTabs",!1),c("smartIndent",!0),c("tabSize",4,function(u){ja(u),Zt(u),Fr(u)},!0),c("lineSeparator",null,function(u,O){if(u.doc.lineSep=O,!O)return;var K=[],Z=u.doc.first;u.doc.iter(function(oe){for(var pe=0;;){var je=oe.text.indexOf(O,pe);if(je==-1)break;pe=je+O.length,K.push(Ve(Z,je))}Z++});for(var ne=K.length-1;ne>=0;ne--)wa(u.doc,O,K[ne],Ve(K[ne].line,K[ne].ch+O.length))}),c("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(u,O,K){u.state.specialChars=new RegExp(O.source+(O.test(" ")?"":"| "),"g"),K!=Oa&&u.refresh()}),c("specialCharPlaceholder",sn,function(u){return u.refresh()},!0),c("electricChars",!0),c("inputStyle",_?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),c("spellcheck",!1,function(u,O){return u.getInputField().spellcheck=O},!0),c("autocorrect",!1,function(u,O){return u.getInputField().autocorrect=O},!0),c("autocapitalize",!1,function(u,O){return u.getInputField().autocapitalize=O},!0),c("rtlMoveVisually",!S),c("wholeLineUpdateBefore",!0),c("theme","default",function(u){Hs(u),Fa(u)},!0),c("keyMap","default",function(u,O,K){var Z=uo(O),ne=K!=Oa&&uo(K);ne&&ne.detach&&ne.detach(u,Z),Z.attach&&Z.attach(u,ne||null)}),c("extraKeys",null),c("configureMouse",null),c("lineWrapping",!1,Ql,!0),c("gutters",[],function(u,O){u.display.gutterSpecs=So(O,u.options.lineNumbers),Fa(u)},!0),c("fixedGutter",!0,function(u,O){u.display.gutters.style.left=O?qn(u.display)+"px":"0",u.refresh()},!0),c("coverGutterNextToScrollbar",!1,function(u){return ba(u)},!0),c("scrollbarStyle","native",function(u){zo(u),ba(u),u.display.scrollbars.setScrollTop(u.doc.scrollTop),u.display.scrollbars.setScrollLeft(u.doc.scrollLeft)},!0),c("lineNumbers",!1,function(u,O){u.display.gutterSpecs=So(u.options.gutters,O),Fa(u)},!0),c("firstLineNumber",1,Fa,!0),c("lineNumberFormatter",function(u){return u},Fa,!0),c("showCursorWhenSelecting",!1,Fn,!0),c("resetSelectionOnContextMenu",!0),c("lineWiseCopyCut",!0),c("pasteLinesPerSelection",!0),c("selectionsMayTouch",!1),c("readOnly",!1,function(u,O){O=="nocursor"&&(Di(u),u.display.input.blur()),u.display.input.readOnlyChanged(O)}),c("screenReaderLabel",null,function(u,O){O=O===""?null:O,u.display.input.screenReaderLabelChanged(O)}),c("disableInput",!1,function(u,O){O||u.display.input.reset()},!0),c("dragDrop",!0,Jl),c("allowDropFileTypes",null),c("cursorBlinkRate",530),c("cursorScrollMargin",0),c("cursorHeight",1,Fn,!0),c("singleCursorHeightPerLine",!0,Fn,!0),c("workTime",100),c("workDelay",100),c("flattenSpans",!0,ja,!0),c("addModeClass",!1,ja,!0),c("pollInterval",100),c("undoDepth",200,function(u,O){return u.doc.history.undoDepth=O}),c("historyEventDelay",1250),c("viewportMargin",10,function(u){return u.refresh()},!0),c("maxHighlightLength",1e4,ja,!0),c("moveInputWithCursor",!0,function(u,O){O||u.display.input.resetPosition()}),c("tabindex",null,function(u,O){return u.display.input.getField().tabIndex=O||""}),c("autofocus",null),c("direction","ltr",function(u,O){return u.doc.setDirection(O)},!0),c("phrases",null)}function Jl(e,t,c){var u=c&&c!=Oa;if(!t!=!u){var O=e.display.dragFunctions,K=t?qe:yt;K(e.display.scroller,"dragstart",O.start),K(e.display.scroller,"dragenter",O.enter),K(e.display.scroller,"dragover",O.over),K(e.display.scroller,"dragleave",O.leave),K(e.display.scroller,"drop",O.drop)}}function Ql(e){e.options.lineWrapping?(o(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(P(e.display.wrapper,"CodeMirror-wrap"),Ni(e)),Ki(e),Fr(e),Zt(e),setTimeout(function(){return ba(e)},100)}function Mr(e,t){var c=this;if(!(this instanceof Mr))return new Mr(e,t);this.options=t=t?l(t):{},l(Ks,t,!1);var u=t.value;typeof u=="string"?u=new Si(u,t.mode,null,t.lineSeparator,t.direction):t.mode&&(u.modeOption=t.mode),this.doc=u;var O=new Mr.inputStyles[t.inputStyle](this),K=this.display=new dl(e,u,O,t);K.wrapper.CodeMirror=this,Hs(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),zo(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 j,keySeq:null,specialChars:null},t.autofocus&&!_&&K.input.focus(),R&&B<11&&setTimeout(function(){return c.display.input.reset(!0)},20),Zl(this),Al(),fa(this),this.curOp.forceUpdate=!0,ts(this,u),t.autofocus&&!_||this.hasFocus()?setTimeout(function(){c.hasFocus()&&!c.state.focused&&Gi(c)},20):Di(this);for(var Z in ho)ho.hasOwnProperty(Z)&&ho[Z](this,t[Z],Oa);Yo(this),t.finishInit&&t.finishInit(this);for(var ne=0;ne<No.length;++ne)No[ne](this);pa(this),n&&t.lineWrapping&&getComputedStyle(K.lineDiv).textRendering=="optimizelegibility"&&(K.lineDiv.style.textRendering="auto")}Mr.defaults=Ks,Mr.optionHandlers=ho;function Zl(e){var t=e.display;qe(t.scroller,"mousedown",oi(e,Fs)),R&&B<11?qe(t.scroller,"dblclick",oi(e,function(oe){if(et(e,oe))return;var pe=ei(e,oe);if(!pe||Mo(e,oe)||Bn(e.display,oe))return;me(oe);var je=e.findWordAt(pe);io(e.doc,je.anchor,je.head)})):qe(t.scroller,"dblclick",function(oe){return et(e,oe)||me(oe)}),qe(t.scroller,"contextmenu",function(oe){return Ws(e,oe)}),qe(t.input.getField(),"contextmenu",function(oe){t.scroller.contains(oe.target)||Ws(e,oe)});var c,u={end:0};function O(){t.activeTouch&&(c=setTimeout(function(){return t.activeTouch=null},1e3),u=t.activeTouch,u.end=+new Date)}function K(oe){if(oe.touches.length!=1)return!1;var pe=oe.touches[0];return pe.radiusX<=1&&pe.radiusY<=1}function Z(oe,pe){if(pe.left==null)return!0;var je=pe.left-oe.left,Ke=pe.top-oe.top;return je*je+Ke*Ke>20*20}qe(t.scroller,"touchstart",function(oe){if(!et(e,oe)&&!K(oe)&&!Mo(e,oe)){t.input.ensurePolled(),clearTimeout(c);var pe=+new Date;t.activeTouch={start:pe,moved:!1,prev:pe-u.end<=300?u:null},oe.touches.length==1&&(t.activeTouch.left=oe.touches[0].pageX,t.activeTouch.top=oe.touches[0].pageY)}}),qe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),qe(t.scroller,"touchend",function(oe){var pe=t.activeTouch;if(pe&&!Bn(t,oe)&&pe.left!=null&&!pe.moved&&new Date-pe.start<300){var je=e.coordsChar(t.activeTouch,"page"),Ke;!pe.prev||Z(pe,pe.prev)?Ke=new br(je,je):!pe.prev.prev||Z(pe,pe.prev.prev)?Ke=e.findWordAt(je):Ke=new br(Ve(je.line,0),wt(e.doc,Ve(je.line+1,0))),e.setSelection(Ke.anchor,Ke.head),e.focus(),me(oe)}O()}),qe(t.scroller,"touchcancel",O),qe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ka(e,t.scroller.scrollTop),ca(e,t.scroller.scrollLeft,!0),Je(e,"scroll",e))}),qe(t.scroller,"mousewheel",function(oe){return Qo(e,oe)}),qe(t.scroller,"DOMMouseScroll",function(oe){return Qo(e,oe)}),qe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(oe){et(e,oe)||Se(oe)},over:function(oe){et(e,oe)||(Ol(e,oe),Se(oe))},start:function(oe){return Rl(e,oe)},drop:oi(e,Cl),leave:function(oe){et(e,oe)||Ts(e)}};var ne=t.input.getField();qe(ne,"keyup",function(oe){return Ns.call(e,oe)}),qe(ne,"keydown",oi(e,Ms)),qe(ne,"keypress",oi(e,Us)),qe(ne,"focus",function(oe){return Gi(e,oe)}),qe(ne,"blur",function(oe){return Di(e,oe)})}var No=[];Mr.defineInitHook=function(e){return No.push(e)};function Za(e,t,c,u){var O=e.doc,K;c==null&&(c="add"),c=="smart"&&(O.mode.indent?K=Ae(e,t).state:c="prev");var Z=e.options.tabSize,ne=V(O,t),oe=F(ne.text,null,Z);ne.stateAfter&&(ne.stateAfter=null);var pe=ne.text.match(/^\s*/)[0],je;if(!u&&!/\S/.test(ne.text))je=0,c="not";else if(c=="smart"&&(je=O.mode.indent(K,ne.text.slice(pe.length),ne.text),je==te||je>150)){if(!u)return;c="prev"}c=="prev"?t>O.first?je=F(V(O,t-1).text,null,Z):je=0:c=="add"?je=oe+e.options.indentUnit:c=="subtract"?je=oe-e.options.indentUnit:typeof c=="number"&&(je=oe+c),je=Math.max(0,je);var Ke="",ut=0;if(e.options.indentWithTabs)for(var at=Math.floor(je/Z);at;--at)ut+=Z,Ke+=" ";if(ut<je&&(Ke+=ge(je-ut)),Ke!=pe)return wa(O,Ke,Ve(t,0),Ve(t,pe.length),"+input"),ne.stateAfter=null,!0;for(var Ot=0;Ot<O.sel.ranges.length;Ot++){var Ut=O.sel.ranges[Ot];if(Ut.head.line==t&&Ut.head.ch<pe.length){var Gt=Ve(t,pe.length);Ao(O,Ot,new br(Gt,Gt));break}}}var Yi=null;function fo(e){Yi=e}function Uo(e,t,c,u,O){var K=e.doc;e.display.shift=!1,u||(u=K.sel);var Z=+new Date-200,ne=O=="paste"||e.state.pasteIncoming>Z,oe=Tt(t),pe=null;if(ne&&u.ranges.length>1)if(Yi&&Yi.text.join(`
`)==t){if(u.ranges.length%Yi.text.length==0){pe=[];for(var je=0;je<Yi.text.length;je++)pe.push(K.splitLines(Yi.text[je]))}}else oe.length==u.ranges.length&&e.options.pasteLinesPerSelection&&(pe=ze(oe,function(Jt){return[Jt]}));for(var Ke=e.curOp.updateInput,ut=u.ranges.length-1;ut>=0;ut--){var at=u.ranges[ut],Ot=at.from(),Ut=at.to();at.empty()&&(c&&c>0?Ot=Ve(Ot.line,Ot.ch-c):e.state.overwrite&&!ne?Ut=Ve(Ut.line,Math.min(V(K,Ut.line).text.length,Ut.ch+Ne(oe).length)):ne&&Yi&&Yi.lineWise&&Yi.text.join(`
`)==oe.join(`
`)&&(Ot=Ut=Ve(Ot.line,0)));var Gt={from:Ot,to:Ut,text:pe?pe[ut%pe.length]:oe,origin:O||(ne?"paste":e.state.cutIncoming>Z?"cut":"+input")};Sa(e.doc,Gt),_t(e,"inputRead",e,Gt)}t&&!ne&&zs(e,t),ya(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ke),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Gs(e,t){var c=e.clipboardData&&e.clipboardData.getData("Text");if(c)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&ki(t,function(){return Uo(t,c,0,null,"paste")}),!0}function zs(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var c=e.doc.sel,u=c.ranges.length-1;u>=0;u--){var O=c.ranges[u];if(O.head.ch>100||u&&c.ranges[u-1].head.line==O.head.line)continue;var K=e.getModeAt(O.head),Z=!1;if(K.electricChars){for(var ne=0;ne<K.electricChars.length;ne++)if(t.indexOf(K.electricChars.charAt(ne))>-1){Z=Za(e,O.head.line,"smart");break}}else K.electricInput&&(K.electricInput.test(V(e.doc,O.head.line).text.slice(0,O.head.ch))&&(Z=Za(e,O.head.line,"smart")));Z&&_t(e,"electricInput",e,O.head.line)}}function Vs(e){for(var t=[],c=[],u=0;u<e.doc.sel.ranges.length;u++){var O=e.doc.sel.ranges[u].head.line,K={anchor:Ve(O,0),head:Ve(O+1,0)};c.push(K),t.push(e.getRange(K.anchor,K.head))}return{text:t,ranges:c}}function Xs(e,t,c,u){e.setAttribute("autocorrect",c?"":"off"),e.setAttribute("autocapitalize",u?"":"off"),e.setAttribute("spellcheck",!!t)}function Ys(){var e=b("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=b("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return n?e.style.width="1000px":e.setAttribute("wrap","off"),g&&(e.style.border="1px solid black"),Xs(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(u,O){var K=this.options,Z=K[u];if(K[u]==O&&u!="mode")return;K[u]=O,t.hasOwnProperty(u)&&oi(this,t[u])(this,O,Z),Je(this,"optionChange",this,u)},getOption:function(u){return this.options[u]},getDoc:function(){return this.doc},addKeyMap:function(u,O){this.state.keyMaps[O?"push":"unshift"](uo(u))},removeKeyMap:function(u){for(var O=this.state.keyMaps,K=0;K<O.length;++K)if(O[K]==u||O[K].name==u)return O.splice(K,1),!0},addOverlay:bi(function(u,O){var K=u.token?u:e.getMode(this.options,u);if(K.startState)throw new Error("Overlays may not be stateful.");nt(this.state.overlays,{mode:K,modeSpec:u,opaque:O&&O.opaque,priority:O&&O.priority||0},function(Z){return Z.priority}),this.state.modeGen++,Fr(this)}),removeOverlay:bi(function(u){for(var O=this.state.overlays,K=0;K<O.length;++K){var Z=O[K].modeSpec;if(Z==u||typeof u=="string"&&Z.name==u){O.splice(K,1),this.state.modeGen++,Fr(this);return}}}),indentLine:bi(function(u,O,K){typeof O!="string"&&typeof O!="number"&&(O==null?O=this.options.smartIndent?"smart":"prev":O=O?"add":"subtract"),pt(this.doc,u)&&Za(this,u,O,K)}),indentSelection:bi(function(u){for(var O=this.doc.sel.ranges,K=-1,Z=0;Z<O.length;Z++){var ne=O[Z];if(ne.empty())ne.head.line>K&&(Za(this,ne.head.line,u,!0),K=ne.head.line,Z==this.doc.sel.primIndex&&ya(this));else{var oe=ne.from(),pe=ne.to(),je=Math.max(K,oe.line);K=Math.min(this.lastLine(),pe.line-(pe.ch?0:1))+1;for(var Ke=je;Ke<K;++Ke)Za(this,Ke,u);var ut=this.doc.sel.ranges;oe.ch==0&&O.length==ut.length&&ut[Z].from().ch>0&&Ao(this.doc,Z,new br(oe,ut[Z].to()),de)}}}),getTokenAt:function(u,O){return $t(this,u,O)},getLineTokens:function(u,O){return $t(this,Ve(u),O,!0)},getTokenTypeAt:function(u){u=wt(this.doc,u);var O=J(this,V(this.doc,u.line)),K=0,Z=(O.length-1)/2,ne=u.ch,oe;if(ne==0)oe=O[2];else for(;;){var pe=K+Z>>1;if((pe?O[pe*2-1]:0)>=ne)Z=pe;else if(O[pe*2+1]<ne)K=pe+1;else{oe=O[pe*2+2];break}}var je=oe?oe.indexOf("overlay "):-1;return je<0?oe:je==0?null:oe.slice(0,je-1)},getModeAt:function(u){var O=this.doc.mode;return O.innerMode?e.innerMode(O,this.getTokenAt(u).state).mode:O},getHelper:function(u,O){return this.getHelpers(u,O)[0]},getHelpers:function(u,O){var K=[];if(!c.hasOwnProperty(O))return K;var Z=c[O],ne=this.getModeAt(u);if(typeof ne[O]=="string")Z[ne[O]]&&K.push(Z[ne[O]]);else if(ne[O])for(var oe=0;oe<ne[O].length;oe++){var pe=Z[ne[O][oe]];pe&&K.push(pe)}else ne.helperType&&Z[ne.helperType]?K.push(Z[ne.helperType]):Z[ne.name]&&K.push(Z[ne.name]);for(var je=0;je<Z._global.length;je++){var Ke=Z._global[je];Ke.pred(ne,this)&&G(K,Ke.val)==-1&&K.push(Ke.val)}return K},getStateAfter:function(u,O){var K=this.doc;return u=Bt(K,u==null?K.first+K.size-1:u),Ae(this,u+1,O).state},cursorCoords:function(u,O){var K,Z=this.doc.sel.primary();return u==null?K=Z.head:typeof u=="object"?K=wt(this.doc,u):K=u?Z.from():Z.to(),pr(this,K,O||"page")},charCoords:function(u,O){return Oi(this,wt(this.doc,u),O||"page")},coordsChar:function(u,O){return u=Yr(this,u,O||"page"),zi(this,u.left,u.top)},lineAtHeight:function(u,O){return u=Yr(this,{top:u,left:0},O||"page").top,$e(this.doc,u+this.display.viewOffset)},heightAtLine:function(u,O,K){var Z=!1,ne;if(typeof u=="number"){var oe=this.doc.first+this.doc.size-1;u<this.doc.first?u=this.doc.first:u>oe&&(u=oe,Z=!0),ne=V(this.doc,u)}else ne=u;return ai(this,ne,{top:0,left:0},O||"page",K||Z).top+(Z?this.doc.height-ii(ne):0)},defaultTextHeight:function(){return Zn(this.display)},defaultCharWidth:function(){return ir(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(u,O,K,Z,ne){var oe=this.display;u=pr(this,wt(this.doc,u));var pe=u.bottom,je=u.left;if(O.style.position="absolute",O.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(O),oe.sizer.appendChild(O),Z=="over")pe=u.top;else if(Z=="above"||Z=="near"){var Ke=Math.max(oe.wrapper.clientHeight,this.doc.height),ut=Math.max(oe.sizer.clientWidth,oe.lineSpace.clientWidth);(Z=="above"||u.bottom+O.offsetHeight>Ke)&&u.top>O.offsetHeight?pe=u.top-O.offsetHeight:u.bottom+O.offsetHeight<=Ke&&(pe=u.bottom),je+O.offsetWidth>ut&&(je=ut-O.offsetWidth)}O.style.top=pe+"px",O.style.left=O.style.right="",ne=="right"?(je=oe.sizer.clientWidth-O.offsetWidth,O.style.right="0px"):(ne=="left"?je=0:ne=="middle"&&(je=(oe.sizer.clientWidth-O.offsetWidth)/2),O.style.left=je+"px"),K&&ti(this,{left:je,top:pe,right:je+O.offsetWidth,bottom:pe+O.offsetHeight})},triggerOnKeyDown:bi(Ms),triggerOnKeyPress:bi(Us),triggerOnKeyUp:Ns,triggerOnMouseDown:bi(Fs),execCommand:function(u){if(Ya.hasOwnProperty(u))return Ya[u].call(null,this)},triggerElectric:bi(function(u){zs(this,u)}),findPosH:function(u,O,K,Z){var ne=1;O<0&&(ne=-1,O=-O);for(var oe=wt(this.doc,u),pe=0;pe<O&&!(oe=Fo(this.doc,oe,ne,K,Z),oe.hitSide);++pe);return oe},moveH:bi(function(u,O){var K=this;this.extendSelectionsBy(function(Z){return K.display.shift||K.doc.extend||Z.empty()?Fo(K.doc,Z.head,u,O,K.options.rtlMoveVisually):u<0?Z.from():Z.to()},he)}),deleteH:bi(function(u,O){var K=this.doc.sel,Z=this.doc;K.somethingSelected()?Z.replaceSelection("",null,"+delete"):Ra(this,function(ne){var oe=Fo(Z,ne.head,u,O,!1);return u<0?{from:oe,to:ne.head}:{from:ne.head,to:oe}})}),findPosV:function(u,O,K,Z){var ne=1,oe=Z;O<0&&(ne=-1,O=-O);for(var pe=wt(this.doc,u),je=0;je<O;++je){var Ke=pr(this,pe,"div");if(oe==null?oe=Ke.left:Ke.left=oe,pe=$s(this,Ke,ne,K),pe.hitSide)break}return pe},moveV:bi(function(u,O){var K=this,Z=this.doc,ne=[],oe=!this.display.shift&&!Z.extend&&Z.sel.somethingSelected();if(Z.extendSelectionsBy(function(je){if(oe)return u<0?je.from():je.to();var Ke=pr(K,je.head,"div");je.goalColumn!=null&&(Ke.left=je.goalColumn),ne.push(Ke.left);var ut=$s(K,Ke,u,O);return O=="page"&&je==Z.sel.primary()&&_o(K,Oi(K,ut,"div").top-Ke.top),ut},he),ne.length)for(var pe=0;pe<Z.sel.ranges.length;pe++)Z.sel.ranges[pe].goalColumn=ne[pe]}),findWordAt:function(u){var O=this.doc,K=V(O,u.line).text,Z=u.ch,ne=u.ch;if(K){var oe=this.getHelper(u,"wordChars");(u.sticky=="before"||ne==K.length)&&Z?--Z:++ne;for(var pe=K.charAt(Z),je=Ze(pe,oe)?function(Ke){return Ze(Ke,oe)}:/\s/.test(pe)?function(Ke){return/\s/.test(Ke)}:function(Ke){return!/\s/.test(Ke)&&!Ze(Ke)};Z>0&&je(K.charAt(Z-1));)--Z;for(;ne<K.length&&je(K.charAt(ne));)++ne}return new br(Ve(u.line,Z),Ve(u.line,ne))},toggleOverwrite:function(u){if(u!=null&&u==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?o(this.display.cursorDiv,"CodeMirror-overwrite"):P(this.display.cursorDiv,"CodeMirror-overwrite"),Je(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==f()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:bi(function(u,O){Pa(this,u,O)}),getScrollInfo:function(){var u=this.display.scroller;return{left:u.scrollLeft,top:u.scrollTop,height:u.scrollHeight-Un(this)-this.display.barHeight,width:u.scrollWidth-Un(this)-this.display.barWidth,clientHeight:Xn(this),clientWidth:Jn(this)}},scrollIntoView:bi(function(u,O){u==null?(u={from:this.doc.sel.primary().head,to:null},O==null&&(O=this.options.cursorScrollMargin)):typeof u=="number"?u={from:Ve(u,0),to:null}:u.from==null&&(u={from:u,to:null}),u.to||(u.to=u.from),u.margin=O||0,u.from.line!=null?Qs(this,u):Wo(this,u.from,u.to,u.margin)}),setSize:bi(function(u,O){var K=this,Z=function(oe){return typeof oe=="number"||/^\d+$/.test(String(oe))?oe+"px":oe};u!=null&&(this.display.wrapper.style.width=Z(u)),O!=null&&(this.display.wrapper.style.height=Z(O)),this.options.lineWrapping&&Kt(this);var ne=this.display.viewFrom;this.doc.iter(ne,this.display.viewTo,function(oe){if(oe.widgets){for(var pe=0;pe<oe.widgets.length;pe++)if(oe.widgets[pe].noHScroll){fi(K,ne,"widget");break}}++ne}),this.curOp.forceUpdate=!0,Je(this,"refresh",this)}),operation:function(u){return ki(this,u)},startOperation:function(){return fa(this)},endOperation:function(){return pa(this)},refresh:bi(function(){var u=this.display.cachedTextHeight;Fr(this),this.curOp.forceUpdate=!0,Zt(this),Pa(this,this.doc.scrollLeft,this.doc.scrollTop),Eo(this.display),(u==null||Math.abs(u-Zn(this.display))>.5||this.options.lineWrapping)&&Ki(this),Je(this,"refresh",this)}),swapDoc:bi(function(u){var O=this.doc;return O.cm=null,this.state.selectingText&&this.state.selectingText(),ts(this,u),Zt(this),this.display.input.reset(),Pa(this,u.scrollLeft,u.scrollTop),this.curOp.forceScroll=!0,_t(this,"swapDoc",this,O),O}),phrase:function(u){var O=this.options.phrases;return O&&Object.prototype.hasOwnProperty.call(O,u)?O[u]:u},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}},Me(e),e.registerHelper=function(u,O,K){c.hasOwnProperty(u)||(c[u]=e[u]={_global:[]}),c[u][O]=K},e.registerGlobalHelper=function(u,O,K,Z){e.registerHelper(u,O,Z),c[u]._global.push({pred:K,val:Z})}}function Fo(e,t,c,u,O){var K=t,Z=c,ne=V(e,t.line),oe=O&&e.direction=="rtl"?-c:c;function pe(){var rn=t.line+oe;return rn<e.first||rn>=e.first+e.size?!1:(t=new Ve(rn,t.ch,t.sticky),ne=V(e,rn))}function je(rn){var Qt;if(u=="codepoint"){var dn=ne.text.charCodeAt(t.ch+(u>0?0:-1));isNaN(dn)?Qt=null:Qt=new Ve(t.line,Math.max(0,Math.min(ne.text.length,t.ch+c*(dn>=55296&&dn<56320?2:1))),-c)}else O?Qt=kl(e.cm,ne,t,c):Qt=Io(ne,t,c);if(Qt==null)if(!rn&&pe())t=Do(O,e.cm,ne,t.line,oe);else return!1;else t=Qt;return!0}if(u=="char"||u=="codepoint")je();else if(u=="column")je(!0);else if(u=="word"||u=="group")for(var Ke=null,ut=u=="group",at=e.cm&&e.cm.getHelper(t,"wordChars"),Ot=!0;!(c<0&&!je(!Ot));Ot=!1){var Ut=ne.text.charAt(t.ch)||`
`,Gt=Ze(Ut,at)?"w":ut&&Ut==`
`?"n":!ut||/\s/.test(Ut)?null:"p";if(ut&&!Ot&&!Gt&&(Gt="s"),Ke&&Ke!=Gt){c<0&&(c=1,je(),t.sticky="after");break}if(Gt&&(Ke=Gt),c>0&&!je(!Ot))break}var Jt=oo(e,t,K,Z,!0);return Rt(K,Jt)&&(Jt.hitSide=!0),Jt}function $s(e,t,c,u){var O=e.doc,K=t.left,Z;if(u=="page"){var ne=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),oe=Math.max(ne-.5*Zn(e.display),3);Z=(c>0?t.bottom:t.top)+c*oe}else u=="line"&&(Z=c>0?t.bottom+3:t.top-3);for(var pe;!(pe=zi(e,K,Z),!pe.outside);){if(c<0?Z<=0:Z>=O.height){pe.hitSide=!0;break}Z+=c*5}return pe}var Tr=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new j,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Tr.prototype.init=function(e){var t=this,c=this,u=c.cm,O=c.div=e.lineDiv;Xs(O,u.options.spellcheck,u.options.autocorrect,u.options.autocapitalize);function K(ne){for(var oe=ne.target;oe;oe=oe.parentNode){if(oe==O)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(oe.className))break}return!1}qe(O,"paste",function(ne){if(!K(ne)||et(u,ne)||Gs(ne,u))return;B<=11&&setTimeout(oi(u,function(){return t.updateFromDOM()}),20)}),qe(O,"compositionstart",function(ne){t.composing={data:ne.data,done:!1}}),qe(O,"compositionupdate",function(ne){t.composing||(t.composing={data:ne.data,done:!1})}),qe(O,"compositionend",function(ne){t.composing&&(ne.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),qe(O,"touchstart",function(){return c.forceCompositionEnd()}),qe(O,"input",function(){t.composing||t.readFromDOMSoon()});function Z(ne){if(!K(ne)||et(u,ne))return;if(u.somethingSelected())fo({lineWise:!1,text:u.getSelections()}),ne.type=="cut"&&u.replaceSelection("",null,"cut");else if(u.options.lineWiseCopyCut){var oe=Vs(u);fo({lineWise:!0,text:oe.text}),ne.type=="cut"&&u.operation(function(){u.setSelections(oe.ranges,0,de),u.replaceSelection("",null,"cut")})}else return;if(ne.clipboardData){ne.clipboardData.clearData();var pe=Yi.text.join(`
`);if(ne.clipboardData.setData("Text",pe),ne.clipboardData.getData("Text")==pe){ne.preventDefault();return}}var je=Ys(),Ke=je.firstChild;u.display.lineSpace.insertBefore(je,u.display.lineSpace.firstChild),Ke.value=Yi.text.join(`
`);var ut=document.activeElement;L(Ke),setTimeout(function(){u.display.lineSpace.removeChild(je),ut.focus(),ut==O&&c.showPrimarySelection()},50)}qe(O,"copy",Z),qe(O,"cut",Z)},Tr.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Tr.prototype.prepareSelection=function(){var e=wr(this.cm,!1);return e.focus=document.activeElement==this.div,e},Tr.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Tr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Tr.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,c=t.doc.sel.primary(),u=c.from(),O=c.to();if(t.display.viewTo==t.display.viewFrom||u.line>=t.display.viewTo||O.line<t.display.viewFrom){e.removeAllRanges();return}var K=po(t,e.anchorNode,e.anchorOffset),Z=po(t,e.focusNode,e.focusOffset);if(K&&!K.bad&&Z&&!Z.bad&&ht(Wt(K,Z),u)==0&&ht(Pt(K,Z),O)==0)return;var ne=t.display.view,oe=u.line>=t.display.viewFrom&&Js(t,u)||{node:ne[0].measure.map[2],offset:0},pe=O.line<t.display.viewTo&&Js(t,O);if(!pe){var je=ne[ne.length-1].measure,Ke=je.maps?je.maps[je.maps.length-1]:je.map;pe={node:Ke[Ke.length-1],offset:Ke[Ke.length-2]-Ke[Ke.length-3]}}if(!oe||!pe){e.removeAllRanges();return}var ut=e.rangeCount&&e.getRangeAt(0),at;try{at=p(oe.node,oe.offset,pe.offset,pe.node)}catch(Ot){}at&&(!re&&t.state.focused?(e.collapse(oe.node,oe.offset),at.collapsed||(e.removeAllRanges(),e.addRange(at))):(e.removeAllRanges(),e.addRange(at)),ut&&e.anchorNode==null?e.addRange(ut):re&&this.startGracePeriod()),this.rememberSelection()},Tr.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)},Tr.prototype.showMultipleSelections=function(e){A(this.cm.display.cursorDiv,e.cursors),A(this.cm.display.selectionDiv,e.selection)},Tr.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Tr.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return i(this.div,t)},Tr.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Tr.prototype.blur=function(){this.div.blur()},Tr.prototype.getField=function(){return this.div},Tr.prototype.supportsTouch=function(){return!0},Tr.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():ki(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)},Tr.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Tr.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(h&&D&&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=po(t,e.anchorNode,e.anchorOffset),u=po(t,e.focusNode,e.focusOffset);c&&u&&ki(t,function(){mi(t.doc,ra(c,u),de),(c.bad||u.bad)&&(t.curOp.selectionChanged=!0)})},Tr.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,c=e.doc.sel.primary(),u=c.from(),O=c.to();if(u.ch==0&&u.line>e.firstLine()&&(u=Ve(u.line-1,V(e.doc,u.line-1).length)),O.ch==V(e.doc,O.line).text.length&&O.line<e.lastLine()&&(O=Ve(O.line+1,0)),u.line<t.viewFrom||O.line>t.viewTo-1)return!1;var K,Z,ne;u.line==t.viewFrom||(K=Ii(e,u.line))==0?(Z=Ue(t.view[0].line),ne=t.view[0].node):(Z=Ue(t.view[K].line),ne=t.view[K-1].node.nextSibling);var oe=Ii(e,O.line),pe,je;if(oe==t.view.length-1?(pe=t.viewTo-1,je=t.lineDiv.lastChild):(pe=Ue(t.view[oe+1].line)-1,je=t.view[oe+1].node.previousSibling),!ne)return!1;for(var Ke=e.doc.splitLines(tu(e,ne,je,Z,pe)),ut=$(e.doc,Ve(Z,0),Ve(pe,V(e.doc,pe).text.length));Ke.length>1&&ut.length>1;)if(Ne(Ke)==Ne(ut))Ke.pop(),ut.pop(),pe--;else if(Ke[0]==ut[0])Ke.shift(),ut.shift(),Z++;else break;for(var at=0,Ot=0,Ut=Ke[0],Gt=ut[0],Jt=Math.min(Ut.length,Gt.length);at<Jt&&Ut.charCodeAt(at)==Gt.charCodeAt(at);)++at;for(var rn=Ne(Ke),Qt=Ne(ut),dn=Math.min(rn.length-(Ke.length==1?at:0),Qt.length-(ut.length==1?at:0));Ot<dn&&rn.charCodeAt(rn.length-Ot-1)==Qt.charCodeAt(Qt.length-Ot-1);)++Ot;if(Ke.length==1&&ut.length==1&&Z==u.line)for(;at&&at>u.ch&&rn.charCodeAt(rn.length-Ot-1)==Qt.charCodeAt(Qt.length-Ot-1);)at--,Ot++;Ke[Ke.length-1]=rn.slice(0,rn.length-Ot).replace(/^\u200b+/,""),Ke[0]=Ke[0].slice(at).replace(/\u200b+$/,"");var Pn=Ve(Z,at),On=Ve(pe,ut.length?Ne(ut).length-Ot:0);if(Ke.length>1||Ke[0]||ht(Pn,On))return wa(e.doc,Ke,Pn,On,"+input"),!0},Tr.prototype.ensurePolled=function(){this.forceCompositionEnd()},Tr.prototype.reset=function(){this.forceCompositionEnd()},Tr.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Tr.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)},Tr.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&ki(this.cm,function(){return Fr(e.cm)})},Tr.prototype.setUneditable=function(e){e.contentEditable="false"},Tr.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||oi(this.cm,Uo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Tr.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Tr.prototype.onContextMenu=function(){},Tr.prototype.resetPosition=function(){},Tr.prototype.needsContentAttribute=!0;function Js(e,t){var c=fn(e,t.line);if(!c||c.hidden)return null;var u=V(e.doc,t.line),O=Rn(c,u,t.line),K=st(u,e.doc.direction),Z="left";if(K){var ne=Ye(K,t.ch);Z=ne%2?"right":"left"}var oe=En(O.map,t.ch,Z);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,u,O){var K="",Z=!1,ne=e.doc.lineSeparator(),oe=!1;function pe(at){return function(Ot){return Ot.id==at}}function je(){Z&&(K+=ne,oe&&(K+=ne),Z=oe=!1)}function Ke(at){at&&(je(),K+=at)}function ut(at){if(at.nodeType==1){var Ot=at.getAttribute("cm-text");if(Ot){Ke(Ot);return}var Ut=at.getAttribute("cm-marker"),Gt;if(Ut){var Jt=e.findMarks(Ve(u,0),Ve(O+1,0),pe(+Ut));Jt.length&&(Gt=Jt[0].find(0))&&Ke($(e.doc,Gt.from,Gt.to).join(ne));return}if(at.getAttribute("contenteditable")=="false")return;var rn=/^(pre|div|p|li|table|br)$/i.test(at.nodeName);if(!/^br$/i.test(at.nodeName)&&at.textContent.length==0)return;rn&&je();for(var Qt=0;Qt<at.childNodes.length;Qt++)ut(at.childNodes[Qt]);/^(pre|p)$/i.test(at.nodeName)&&(oe=!0),rn&&(Z=!0)}else at.nodeType==3&&Ke(at.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(ut(t),t==c);)t=t.nextSibling,oe=!1;return K}function po(e,t,c){var u;if(t==e.display.lineDiv){if(u=e.display.lineDiv.childNodes[c],!u)return Aa(e.clipPos(Ve(e.display.viewTo-1)),!0);t=null,c=0}else for(u=t;;u=u.parentNode){if(!u||u==e.display.lineDiv)return null;if(u.parentNode&&u.parentNode==e.display.lineDiv)break}for(var O=0;O<e.display.view.length;O++){var K=e.display.view[O];if(K.node==u)return nu(K,t,c)}}function nu(e,t,c){var u=e.text.firstChild,O=!1;if(!t||!i(u,t))return Aa(Ve(Ue(e.line),0),!0);if(t==u&&(O=!0,t=u.childNodes[c],c=0,!t)){var K=e.rest?Ne(e.rest):e.line;return Aa(Ve(Ue(K),K.text.length),O)}var Z=t.nodeType==3?t:null,ne=t;for(!Z&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(Z=t.firstChild,c&&(c=Z.nodeValue.length));ne.parentNode!=u;)ne=ne.parentNode;var oe=e.measure,pe=oe.maps;function je(Gt,Jt,rn){for(var Qt=-1;Qt<(pe?pe.length:0);Qt++)for(var dn=Qt<0?oe.map:pe[Qt],Pn=0;Pn<dn.length;Pn+=3){var On=dn[Pn+2];if(On==Gt||On==Jt){var or=Ue(Qt<0?e.line:e.rest[Qt]),Lr=dn[Pn]+rn;return(rn<0||On!=Gt)&&(Lr=dn[Pn+(rn?1:0)]),Ve(or,Lr)}}}var Ke=je(Z,ne,c);if(Ke)return Aa(Ke,O);for(var ut=ne.nextSibling,at=Z?Z.nodeValue.length-c:0;ut;ut=ut.nextSibling){if(Ke=je(ut,ut.firstChild,0),Ke)return Aa(Ve(Ke.line,Ke.ch-at),O);at+=ut.textContent.length}for(var Ot=ne.previousSibling,Ut=c;Ot;Ot=Ot.previousSibling){if(Ke=je(Ot,Ot.firstChild,-1),Ke)return Aa(Ve(Ke.line,Ke.ch+Ut),O);Ut+=Ot.textContent.length}}var Gr=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new j,this.hasSelection=!1,this.composing=null};Gr.prototype.init=function(e){var t=this,c=this,u=this.cm;this.createField(e);var O=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(O.style.width="0px"),qe(O,"input",function(){R&&B>=9&&t.hasSelection&&(t.hasSelection=null),c.poll()}),qe(O,"paste",function(Z){if(et(u,Z)||Gs(Z,u))return;u.state.pasteIncoming=+new Date,c.fastPoll()});function K(Z){if(et(u,Z))return;if(u.somethingSelected())fo({lineWise:!1,text:u.getSelections()});else if(u.options.lineWiseCopyCut){var ne=Vs(u);fo({lineWise:!0,text:ne.text}),Z.type=="cut"?u.setSelections(ne.ranges,null,de):(c.prevInput="",O.value=ne.text.join(`
`),L(O))}else return;Z.type=="cut"&&(u.state.cutIncoming=+new Date)}qe(O,"cut",K),qe(O,"copy",K),qe(e.scroller,"paste",function(Z){if(Bn(e,Z)||et(u,Z))return;if(!O.dispatchEvent){u.state.pasteIncoming=+new Date,c.focus();return}var ne=new Event("paste");ne.clipboardData=Z.clipboardData,O.dispatchEvent(ne)}),qe(e.lineSpace,"selectstart",function(Z){Bn(e,Z)||me(Z)}),qe(O,"compositionstart",function(){var Z=u.getCursor("from");c.composing&&c.composing.range.clear(),c.composing={start:Z,range:u.markText(Z,u.getCursor("to"),{className:"CodeMirror-composing"})}}),qe(O,"compositionend",function(){c.composing&&(c.poll(),c.composing.range.clear(),c.composing=null)})},Gr.prototype.createField=function(e){this.wrapper=Ys(),this.textarea=this.wrapper.firstChild},Gr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Gr.prototype.prepareSelection=function(){var e=this.cm,t=e.display,c=e.doc,u=wr(e);if(e.options.moveInputWithCursor){var O=pr(e,c.sel.primary().head,"div"),K=t.wrapper.getBoundingClientRect(),Z=t.lineDiv.getBoundingClientRect();u.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,O.top+Z.top-K.top)),u.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,O.left+Z.left-K.left))}return u},Gr.prototype.showSelection=function(e){var t=this.cm,c=t.display;A(c.cursorDiv,e.cursors),A(c.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Gr.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&&L(this.textarea),R&&B>=9&&(this.hasSelection=c)}else e||(this.prevInput=this.textarea.value="",R&&B>=9&&(this.hasSelection=null))},Gr.prototype.getField=function(){return this.textarea},Gr.prototype.supportsTouch=function(){return!1},Gr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!_||f()!=this.textarea))try{this.textarea.focus()}catch(e){}},Gr.prototype.blur=function(){this.textarea.blur()},Gr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Gr.prototype.receivedFocus=function(){this.slowPoll()},Gr.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()})},Gr.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function c(){var u=t.poll();!u&&!e?(e=!0,t.polling.set(60,c)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,c)},Gr.prototype.poll=function(){var e=this,t=this.cm,c=this.textarea,u=this.prevInput;if(this.contextMenuPending||!t.state.focused||Et(c)&&!u&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var O=c.value;if(O==u&&!t.somethingSelected())return!1;if(R&&B>=9&&this.hasSelection===O||r&&/[\uf700-\uf7ff]/.test(O))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var K=O.charCodeAt(0);if(K==8203&&!u&&(u="\u200B"),K==8666)return this.reset(),this.cm.execCommand("undo")}for(var Z=0,ne=Math.min(u.length,O.length);Z<ne&&u.charCodeAt(Z)==O.charCodeAt(Z);)++Z;return ki(t,function(){Uo(t,O.slice(Z),u.length-Z,null,e.composing?"*compose":null),O.length>1e3||O.indexOf(`
`)>-1?c.value=e.prevInput="":e.prevInput=O,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Gr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Gr.prototype.onKeyPress=function(){R&&B>=9&&(this.hasSelection=null),this.fastPoll()},Gr.prototype.onContextMenu=function(e){var t=this,c=t.cm,u=c.display,O=t.textarea;t.contextMenuPending&&t.contextMenuPending();var K=ei(c,e),Z=u.scroller.scrollTop;if(!K||N)return;var ne=c.options.resetSelectionOnContextMenu;ne&&c.doc.sel.contains(K)==-1&&oi(c,mi)(c.doc,ra(K),de);var oe=O.style.cssText,pe=t.wrapper.style.cssText,je=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",O.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-je.top-5)+"px; left: "+(e.clientX-je.left-5)+`px;
z-index: 1000; background: `+(R?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ke;n&&(Ke=window.scrollY),u.input.focus(),n&&window.scrollTo(null,Ke),u.input.reset(),c.somethingSelected()||(O.value=t.prevInput=" "),t.contextMenuPending=at,u.selForContextMenu=c.doc.sel,clearTimeout(u.detectingSelectAll);function ut(){if(O.selectionStart!=null){var Ut=c.somethingSelected(),Gt="\u200B"+(Ut?O.value:"");O.value="\u21DA",O.value=Gt,t.prevInput=Ut?"":"\u200B",O.selectionStart=1,O.selectionEnd=Gt.length,u.selForContextMenu=c.doc.sel}}function at(){if(t.contextMenuPending!=at)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=pe,O.style.cssText=oe,R&&B<9&&u.scrollbars.setScrollTop(u.scroller.scrollTop=Z),O.selectionStart!=null){(!R||R&&B<9)&&ut();var Ut=0,Gt=function(){u.selForContextMenu==c.doc.sel&&O.selectionStart==0&&O.selectionEnd>0&&t.prevInput=="\u200B"?oi(c,ps)(c):Ut++<10?u.detectingSelectAll=setTimeout(Gt,500):(u.selForContextMenu=null,u.input.reset())};u.detectingSelectAll=setTimeout(Gt,200)}}if(R&&B>=9&&ut(),E){Se(e);var Ot=function(){yt(window,"mouseup",Ot),setTimeout(at,20)};qe(window,"mouseup",Ot)}else setTimeout(at,50)},Gr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Gr.prototype.setUneditable=function(){},Gr.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?l(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=f();t.autofocus=c==e||e.getAttribute("autofocus")!=null&&c==document.body}function u(){e.value=ne.getValue()}var O;if(e.form&&(qe(e.form,"submit",u),!t.leaveSubmitMethodAlone)){var K=e.form;O=K.submit;try{var Z=K.submit=function(){u(),K.submit=O,K.submit(),K.submit=Z}}catch(oe){}}t.finishInit=function(oe){oe.save=u,oe.getTextArea=function(){return e},oe.toTextArea=function(){oe.toTextArea=isNaN,u(),e.parentNode.removeChild(oe.getWrapperElement()),e.style.display="",e.form&&(yt(e.form,"submit",u),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=O))}},e.style.display="none";var ne=Mr(function(oe){return e.parentNode.insertBefore(oe,e.nextSibling)},t);return ne}function iu(e){e.off=yt,e.on=qe,e.wheelEventPixels=cl,e.Doc=Si,e.splitLines=Tt,e.countColumn=F,e.findColumn=Re,e.isWordChar=_e,e.Pass=te,e.signal=Je,e.Line=hi,e.changeEnd=ia,e.scrollbarModel=Go,e.Pos=Ve,e.cmpPos=ht,e.modes=Xt,e.mimeModes=Dt,e.resolveMode=An,e.getMode=_n,e.modeExtensions=At,e.extendMode=jt,e.copyState=on,e.startState=se,e.innerMode=Ee,e.commands=Ya,e.keyMap=Zi,e.keyName=Ls,e.isModifierKey=Os,e.lookupKey=Ca,e.normalizeKeyMap=Pl,e.StringStream=H,e.SharedTextMarker=za,e.TextMarker=oa,e.LineWidget=Ga,e.e_preventDefault=me,e.e_stopPropagation=Ce,e.e_stop=Se,e.addClass=o,e.contains=i,e.rmClass=P,e.keyNames=sa}$l(Mr),ql(Mr);var au="iter insert remove copy getEditor constructor".split(" ");for(var mo in Si.prototype)Si.prototype.hasOwnProperty(mo)&&G(au,mo)<0&&(Mr.prototype[mo]=function(e){return function(){return e.apply(this.doc,arguments)}}(Si.prototype[mo]));return Me(Si),Mr.inputStyles={textarea:Gr,contenteditable:Tr},Mr.defineMode=function(e){!Mr.defaults.mode&&e!="null"&&(Mr.defaults.mode=e),an.apply(this,arguments)},Mr.defineMIME=nn,Mr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Mr.defineMIME("text/plain","null"),Mr.defineExtension=function(e,t){Mr.prototype[e]=t},Mr.defineDocExtension=function(e,t){Si.prototype[e]=t},Mr.fromTextArea=ru,iu(Mr),Mr.version="5.58.2",Mr})},W7jJ:function(We,ce,M){"use strict";M.r(ce);var q=M("HPgX"),ue=M("ftSv"),re=M("FrBR"),fe=M("SCzF"),ae=M("VUml"),z=M("RCAX"),R=M("8OG5"),B=M("mgsT"),n=M("c3Iv"),W=M("rBQ5"),D=M("IYef"),N=M("Hqw+"),d=M("YaWb"),m=M("F2qU"),s=M("+N/d"),g=M("XXmO"),h=M.n(g),_=M("T/Jt"),r=M.n(_),v=M("Fvcw"),S=M("GIiI"),w=M("3ptp"),I=M("9kvl"),E=M("GNbK"),x=M("7qur"),P=M("cDPC"),T=M("m3rI"),A=M("RCxd"),b=M("EHPI"),C=M("J66h"),p=M("uMZB"),i=M.n(p),f=M("sNtx"),o=M("RpDr"),a=M("dLI4"),L=M("4d5L"),y=M("y6Ii"),l=M("Wuip"),F=M("47JS"),j=M("TOZL"),G=j.a.TextArea,Y=5e3,te=function(ot){var St=ot.callback,Ht=ot.onCancel,ln=ot.notes;function Hn(Cn){St(Cn)}return r.a.createElement(l.a,{className:"note-form-panel",onFinish:Hn,initialValues:{notes:ln}},r.a.createElement(l.a.Item,{name:"notes",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9"},{max:Y,message:"\u7B14\u8BB0\u6700\u5927\u5B57\u6570\u4E3A".concat(Y)}]},r.a.createElement(G,{placeholder:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9",rows:5})),r.a.createElement(l.a.Item,{style:{textAlign:"right"}},r.a.createElement(L.a,{type:"ghost",onClick:Ht,style:{marginRight:10}}," ","\u53D6\u6D88"," "),r.a.createElement(L.a,{type:"primary",htmlType:"submit"}," ","\u63D0\u4EA4"," ")))},de=M("ZsLC"),ve=M.n(de),he=M("w7s4"),Re=M("HC/W"),we=M("eFXf"),ge=M("v6r8"),Ne=M("Hw79"),ze=M.n(Ne),nt=M("ye1Q"),Ge=M("lfch"),Xe=M("bdLU"),Be=M("1vsH"),_e=M("wd/R"),Ze=M.n(_e),be=ge.a.Column,Le=function(ot){var St=ot.submitResult,Ht=ot.submitting,ln=ot.submitRecords,Hn=ot.page,Cn=ot.onPageChange,_t=ot.topicId,Lt=St||{},gn=Lt.status,bt=Lt.id,cn=Lt.input,Ft=Lt.output,vn=Lt.expected_output,Vn=Lt.is_file,Nn=Lt.input_file_url,Tn=Lt.output_file_url,Yn=Lt.expected_output_file_url,In=Lt.error_msg,$n=ln||{},rr=$n.records,_r=$n.records_count,Bn=Object(w.i)();function gr(){Vn?navigator.clipboard.writeText(C.Base64.decode(In)).then(function(){B.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")}):navigator.clipboard.writeText(C.Base64.decode(Ft)).then(function(){B.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")})}return r.a.createElement(z.a,{spinning:Ht,tip:"\u8BC4\u6D4B\u4E2D...",indicator:r.a.createElement(nt.a,{style:{fontSize:24},spin:!0})},bt?r.a.createElement(r.a.Fragment,null,r.a.createElement("ul",{className:ze.a.info},r.a.createElement("li",null,"\u6267\u884C\u7ED3\u679C\uFF1A",r.a.createElement("span",{className:gn===Xe.a.OK?"c-green":"c-red"},o.a[gn])),r.a.createElement("li",{className:ze.a.error},r.a.createElement("a",{onClick:gr},"\u590D\u5236\u9519\u8BEF\u4FE1\u606F ",r.a.createElement(Ge.a,null)," ")),r.a.createElement("li",null,r.a.createElement(E.a,{to:"/problems/".concat(_t,"/record-detail/").concat(bt,"?backId=").concat(Bn==null?void 0:Bn.save_identifier)},"\u663E\u793A\u8BE6\u60C5 >"," "))),gn!==Xe.a.OK?r.a.createElement(r.a.Fragment,null,r.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),r.a.createElement("pre",null,!Vn&&cn,Vn&&r.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(Be.y)(Nn,cn)}},cn)),r.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),r.a.createElement("pre",null,(gn===4||gn===5)&&C.Base64.decode(In),gn!=4&&gn!=5&&(Vn?r.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(Be.y)(Tn,Ft)}},Ft):C.Base64.decode(Ft))),r.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),r.a.createElement("pre",null,!Vn&&C.Base64.decode(vn),Vn&&r.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(Be.y)(Yn,vn)}},vn))):null):null,(rr==null?void 0:rr.length)>0?r.a.createElement(ge.a,{dataSource:rr,rowKey:"id",pagination:!1},r.a.createElement(be,{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"created_at",key:"created_at",render:function(sr,Un){return r.a.createElement("span",null," ",Ze()(sr).format("YYYY-MM-DD HH:mm:ss"))}}),r.a.createElement(be,{title:"\u63D0\u4EA4\u7ED3\u679C",dataIndex:"status",key:"status",render:function(sr,Un){var Jn;return r.a.createElement(E.a,{className:sr===0?"c-green":"c-red",to:"/problems/".concat(_t,"/record-detail/").concat(Un.id,"?backId=").concat(Bn==null?void 0:Bn.save_identifier)},(Jn=o.a[sr])===null||Jn===void 0?void 0:Jn.replace("\u8C03\u8BD5","\u8BC4\u6D4B"))}}),r.a.createElement(be,{title:"\u6267\u884C\u7528\u65F6 (S)",dataIndex:"execute_time",key:"execute_time"}),r.a.createElement(be,{title:"\u5185\u5B58\u6D88\u8017\uFF08MB\uFF09",dataIndex:"execute_memory",key:"execute_memory"}),r.a.createElement(be,{title:"\u8BED\u8A00",dataIndex:"language",key:"language"})):null,_r>15?r.a.createElement(Re.a,{className:ze.a.pagination,current:Hn,pageSize:15,total:_r,onChange:Cn}):null)},le=M("BdwD"),ye=M("CDKA"),Te=M("d7ih"),Pe=M("Ioa6"),He=M("laMX"),Ye=M("TcMa"),ct=M.n(Ye),st=M("9Bee"),vt={1:{name:"\u7B80\u5355",color:"#52c41a"},2:{name:"\u9002\u4E2D",color:"#faad14"},3:{name:"\u56F0\u96BE",color:"#f5222d"}},qe=function(ot){var St=ot.hack,Ht=ot.onTriggerPraise,ln=ot.toDiscuss,Hn=St.language,Cn=St.difficulty,_t=St.time_limit,Lt=St.username,gn=St.user_path,bt=St.user_praise,cn=St.comments_count,Ft=St.praises_count,vn=St.description,Vn=St.pass_count,Nn=St.submit_count,Tn=Object(w.h)();console.log(St.language,"language");var Yn=vt[Cn];return r.a.createElement(r.a.Fragment,null,r.a.createElement("ul",{className:ct.a.info},r.a.createElement("li",null,"\u96BE\u5EA6\uFF1A",r.a.createElement(He.a,{color:Yn.color},Yn.name)),r.a.createElement("li",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236\uFF1A",r.a.createElement("b",null,_t,"\u79D2"))),r.a.createElement(st.a,{value:vn,className:ct.a.desc}),r.a.createElement("ul",{className:ct.a["commit-info"]},r.a.createElement("li",null,r.a.createElement(Te.b,{size:4},r.a.createElement("span",null,"\u901A\u8FC7\u6B21\u6570")," ",r.a.createElement("b",null,Vn))),r.a.createElement("li",null,r.a.createElement(Te.b,{size:4},r.a.createElement("span",null,"\u63D0\u4EA4\u6B21\u6570")," ",r.a.createElement("b",null,Nn))," "),r.a.createElement("li",{style:{flex:"1 0 0"}}),r.a.createElement("li",null,r.a.createElement(Te.b,{size:4},r.a.createElement("i",{className:"iconfont icon-huifu1",onClick:ln})," ",r.a.createElement("b",null,cn))," ")))},mt=M("dhSg"),yt=M("ps8w"),Je=M.n(yt),et=M("nc60"),De=M("M8RZ"),ke=M("OkW/"),Me=M("ErOA");function me(ot){return Object(Me.c)("comments.json",ot)}function Ce(ot){return Object(Me.f)("/discusses/".concat(ot,"/plus.json"),{container_type:"Discuss",type:1})}function Oe(ot){return Object(Me.f)("comments/reply.json",ot)}function Se(ot){return Object(Me.f)("comments.json",ot)}function Fe(ot){return Object(Me.f)("comments/".concat(ot==null?void 0:ot.id,"/hidden.json"),ot)}function it(ot){return Object(Me.b)("comments/".concat(ot==null?void 0:ot.id,".json"))}var Ie=M("GgEA"),Qe=M("AMnG"),rt=M("xKgJ");function ft(ot){var St=ot.author;return r.a.createElement("a",{href:"/users/".concat(St.login),target:"_blank"},r.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"50",style:{borderRadius:"50%"},src:"".concat(T.a.IMG_SERVER,"/images/").concat(St.image_url),width:"50"}))}function It(ot){var St=ot.data,Ht=ot.index,ln=ot.parentDiscussIndex,Hn=ot.user,Cn=ot.onSetActionType,_t=St.author,Lt=St.can_delete,gn=St.content,bt=St.id,cn=St.time;function Ft(){Cn({id:bt,index:Ht,type:"delete-discuss",parentDiscussIndex:ln,message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}var vn=Hn.admin||Lt||_t.user_id===Hn.user_id;return r.a.createElement("div",{className:"discuss-item-container second-discuss "},r.a.createElement(ft,{author:_t}),r.a.createElement("section",null,r.a.createElement("div",{className:"discuss-info"},r.a.createElement("a",{href:"/users/".concat(_t.login),target:"_blank"},_t.name),r.a.createElement("span",{className:"grey"},cn),r.a.createElement("div",{className:"btn-group",style:{marginBottom:0}},vn?r.a.createElement("a",{onClick:Ft,title:"\u5220\u9664"},r.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),r.a.createElement(st.a,{className:"discuss-content",value:gn})))}var Tt=function(ot){var St=ot.user,Ht=ot.data,ln=ot.index,Hn=ot.onPlusDiscuss,Cn=ot.onSetActionType,_t=ot.activeDiscussIndex,Lt=ot.onReplyDiscuss,gn=ot.onSetActiveDiscussIndex,bt=Ht.content,cn=Ht.children,Ft=Ht.hidden,vn=Ht.id,Vn=Ht.praise_count,Nn=Ht.time,Tn=Ht.user_praise,Yn=Ht.can_delete,In=Ht.author;console.log(Yn&&(!cn||cn.length==0),"children22");function $n(){gn(vn)}function rr(){Hn(vn,!Tn,ln)}function _r(){Cn({id:vn,index:ln,type:"delete-discuss",message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}function Bn(){Cn({id:vn,index:ln,params:{hidden:Ft?"0":"1"},type:"hidden-discuss",message:Ft?"\u786E\u5B9A\u8981\u53D6\u6D88\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417":"\u786E\u5B9A\u8981\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417"})}var gr=St.admin||St.user_id===In.user_id;return r.a.createElement("div",{className:"discuss-item-container",key:vn},r.a.createElement(ft,{author:In}),r.a.createElement("section",null,r.a.createElement("div",{className:"discuss-info"},r.a.createElement("a",{href:"/users/".concat(In.login),target:"_blank"}," ",In.name," "),r.a.createElement("span",{className:"grey"},Nn)),r.a.createElement(st.a,{className:"discuss-content",value:bt}),cn&&cn.length>0?r.a.createElement("div",{className:"reply-discuss-container"},cn.map(function(mr,sr){return r.a.createElement(It,{key:mr.id,data:mr,index:sr,user:St,onSetActionType:Cn,parentDiscussIndex:ln})})):null,r.a.createElement("div",{className:"btn-group"},Object(rt.v)()?r.a.createElement("a",{onClick:Bn,title:Ft?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF\u8BC4\u8BBA"},r.a.createElement("i",{className:Ft?"iconfont icon-yincangbiyan":"fa fa-eye"})):null,Yn&&(!cn||cn.length==0)?r.a.createElement("a",{onClick:_r,title:"\u5220\u9664"},r.a.createElement("i",{className:"iconfont icon-shanchu"})):null,r.a.createElement("a",{onClick:$n,title:"\u56DE\u590D"}," ",r.a.createElement("i",{className:"iconfont icon-huifu1"})," "),r.a.createElement("a",{onClick:rr,className:Tn?"c-orange":""},r.a.createElement("i",{className:Tn?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),r.a.createElement("span",null,Vn||""))),r.a.createElement(Qe.a,{id:vn,activeDiscussIndex:_t,onReplyDiscuss:Lt})))},Et=M("kaH+"),Ct=M("Wx9E"),dt=M("Ot1p"),Nt=function(ot){var St=ot.user_praise,Ht=ot.praise_count,ln=ot.praisePlus,Hn=ot.onCreateDiscuss,Cn=ot.discuss_count,_t=Object(_.useState)(!1),Lt=Object(N.a)(_t,2),gn=Lt[0],bt=Lt[1],cn=Object(_.useState)(""),Ft=Object(N.a)(cn,2),vn=Ft[0],Vn=Ft[1];function Nn(rr){Vn(rr)}function Tn(){bt(!0)}function Yn(){bt(!1)}function In(){return $n.apply(this,arguments)}function $n(){return $n=Object(D.a)(h.a.mark(function rr(){return h.a.wrap(function(Bn){for(;;)switch(Bn.prev=Bn.next){case 0:Hn(vn),Vn(""),bt(!1);case 3:case"end":return Bn.stop()}},rr)})),$n.apply(this,arguments)}return r.a.createElement("div",{className:"dis-input-editor-container ".concat(gn?"active":""," ")},r.a.createElement("div",{className:gn?"text-area hide":"text-area"},r.a.createElement("input",{placeholder:"\u8BF4\u70B9\u4EC0\u4E48",onClick:Tn}),r.a.createElement("a",{style:{alignItems:"center"}}," ",r.a.createElement("i",{className:"iconfont icon-huifu1"})," \xA0 \xA0",Cn," "),r.a.createElement("a",{className:"c-light-black",onClick:ln,style:{alignItems:"center"},title:St?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},r.a.createElement("i",{className:"mr3 ".concat(St?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),Ht?r.a.createElement("span",null,Ht):"")),gn?r.a.createElement("div",{className:"input-mask",onClick:Yn}):null,r.a.createElement("div",{className:gn?"md-container":"md-container hide"},r.a.createElement(dt.a,{id:"discuss-input-editor",miniToolbar:!0,watch:!1,noStorage:!0,defaultValue:vn,height:240,onChange:Nn}),r.a.createElement("div",{className:"tip-container",onClick:Yn},r.a.createElement("a",{className:"btn-send",onClick:In}," ","\u53D1\u9001"," "))))},Xt={loading:!1,page:1,data:[],count:0,actionType:null,activeDiscussIndex:null},Dt;(function(ot){ot[ot.GET_DISCUSSES=0]="GET_DISCUSSES",ot[ot.TOP_OR_DOWN_DISCUSS=1]="TOP_OR_DOWN_DISCUSS",ot[ot.ACTIVE_DISCUSS_INDEX=2]="ACTIVE_DISCUSS_INDEX",ot[ot.PLUS_DISCUSS=3]="PLUS_DISCUSS",ot[ot.SET_ACTION_TYPE=4]="SET_ACTION_TYPE",ot[ot.SET_PAGE=5]="SET_PAGE",ot[ot.SHOW_DISCUSSES_LOADING=6]="SHOW_DISCUSSES_LOADING"})(Dt||(Dt={}));function an(ot,St){switch(St.type){case Dt.SHOW_DISCUSSES_LOADING:return Object(d.a)(Object(d.a)({},ot),{},{loading:!0});case Dt.GET_DISCUSSES:return Object(d.a)(Object(d.a)({},ot),St.payload);case Dt.TOP_OR_DOWN_DISCUSS:return Object(d.a)(Object(d.a)({},ot),St.payload);case Dt.SET_ACTION_TYPE:return Object(d.a)(Object(d.a)({},ot),St.payload);case Dt.PLUS_DISCUSS:return Object(d.a)(Object(d.a)({},ot),St.payload);case Dt.SET_PAGE:return Object(d.a)(Object(d.a)({},ot),{},{page:St.payload});case Dt.ACTIVE_DISCUSS_INDEX:return Object(d.a)(Object(d.a)({},ot),St.payload);default:throw new Error}}var nn=function(ot){var St=ot.user,Ht=ot.identifier,ln=ot.hack,Hn=ot.onTriggerPraise,Cn=ot.setDiscussTotal,_t=Object(_.useReducer)(an,Xt),Lt=Object(N.a)(_t,2),gn=Lt[0],bt=Lt[1],cn=gn.loading,Ft=gn.page,vn=gn.data,Vn=gn.count,Nn=gn.actionType,Tn=gn.activeDiscussIndex,Yn=Object(_.useCallback)(Object(D.a)(h.a.mark(function Rn(){var cr,un,fn;return h.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return bt({type:Dt.SHOW_DISCUSSES_LOADING}),bn.next=3,me({container_type:"Practice",container_identifier:Ht,limit:10,page:Ft});case 3:cr=bn.sent,un=cr.comments,fn=cr.disscuss_count,bt({type:Dt.GET_DISCUSSES,payload:{data:un,count:fn,loading:!1}}),Cn(fn);case 7:case"end":return bn.stop()}},Rn)})),[Ft,Ht]);Object(_.useEffect)(function(){Yn()},[Ht,Ft]);function In(Rn){bt({type:Dt.SET_PAGE,page:Rn})}function $n(Rn){bt({type:Dt.SET_ACTION_TYPE,payload:{actionType:Rn}})}function rr(Rn){Tn===Rn?bt({type:Dt.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}):bt({type:Dt.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:Rn}})}function _r(Rn,cr,un){return Bn.apply(this,arguments)}function Bn(){return Bn=Object(D.a)(h.a.mark(function Rn(cr,un,fn){var Sn;return h.a.wrap(function(yn){for(;;)switch(yn.prev=yn.next){case 0:return yn.prev=0,yn.next=3,Ce(cr);case 3:Sn=yn.sent,vn[fn].user_praise=un,vn[fn].praise_count=Sn.praise_count,bt({type:Dt.PLUS_DISCUSS,payload:{data:Object(et.a)(vn)}}),yn.next=12;break;case 9:yn.prev=9,yn.t0=yn.catch(0),console.log(yn.t0);case 12:case"end":return yn.stop()}},Rn,null,[[0,9]])})),Bn.apply(this,arguments)}function gr(){return mr.apply(this,arguments)}function mr(){return mr=Object(D.a)(h.a.mark(function Rn(){var cr,un,fn,Sn,bn;return h.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:if(cr=Nn.id,un=Nn.params,fn=Nn.type,Sn=Nn.index,bn=Nn.parentDiscussIndex,!(fn==="hidden-discuss")){En.next=7;break}return console.log(un,"params"),En.next=5,Fe(Object(d.a)({id:cr,container_type:"Practice",container_identifier:Ht},un));case 5:bn?vn[bn].children[Sn].hidden=un.hidden==1:vn[Sn].hidden=un.hidden==1,bt({type:Dt.SET_ACTION_TYPE,payload:{actionType:null,data:Object(et.a)(vn)}});case 7:if(!(fn==="delete-discuss")){En.next=13;break}return En.next=10,it({id:cr,container_type:"Practice",container_identifier:Ht});case 10:return bt({type:Dt.SET_ACTION_TYPE,payload:{actionType:null}}),En.next=13,Yn();case 13:case"end":return En.stop()}},Rn)})),mr.apply(this,arguments)}function sr(){bt({type:Dt.SET_ACTION_TYPE,payload:{actionType:null}})}function Un(Rn,cr){return Jn.apply(this,arguments)}function Jn(){return Jn=Object(D.a)(h.a.mark(function Rn(cr,un){return h.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:return Sn.prev=0,Sn.next=3,Oe({container_type:"Practice",container_identifier:Ht,comments:{content:un,parent_id:cr}});case 3:Yn(),Sn.next=9;break;case 6:Sn.prev=6,Sn.t0=Sn.catch(0),console.log(Sn.t0);case 9:case"end":return Sn.stop()}},Rn,null,[[0,6]])})),Jn.apply(this,arguments)}function Xn(Rn){return Vt.apply(this,arguments)}function Vt(){return Vt=Object(D.a)(h.a.mark(function Rn(cr){return h.a.wrap(function(fn){for(;;)switch(fn.prev=fn.next){case 0:return bt({type:Dt.SHOW_DISCUSSES_LOADING}),fn.next=3,Se({comments:{content:cr},container_type:"Practice",container_identifier:Ht});case 3:Yn();case 4:case"end":return fn.stop()}},Rn)})),Vt.apply(this,arguments)}return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"discuss-panel"},vn.length===0?r.a.createElement(le.a,null):vn.map(function(Rn,cr){return r.a.createElement(Tt,{onReplyDiscuss:Un,onPlusDiscuss:_r,onSetActiveDiscussIndex:rr,onSetActionType:$n,data:Rn,index:cr,user:St,activeDiscussIndex:Tn})}),Vn>10?r.a.createElement("div",{className:"pagination-container"},r.a.createElement(Re.a,{showQuickJumper:!0,onChange:In,current:Ft,total:Vn})):null),r.a.createElement(Nt,{user_praise:ln.user_praise,praise_count:ln.praises_count,praisePlus:Hn,discuss_count:ln.comments_count,onCreateDiscuss:Xn}),r.a.createElement(De.a,null,r.a.createElement(W.a,{centered:!0,title:"\u63D0\u793A",visible:!!Nn,onOk:gr,onCancel:sr},r.a.createElement("p",null,Nn?Nn.message:"")),r.a.createElement(Et.a,null)))},An=M("1FX+"),_n=M.n(An),At=M("pYxM"),jt=M.n(At),on=M("sB/4"),Ee=M.n(on),se=M("Wtmd"),H=M.n(se),V=M("CNDd"),$=M.n(V),ee=M("nCk5"),xe=M.n(ee),Ue=M("kovY"),$e=M.n(Ue),pt=function(St){var Ht=St.style,ln=Ht===void 0?{}:Ht,Hn=St.onClick,Cn=St.onAssist,_t=St.onHide,Lt=St.data,gn=St.active,bt=St.showLine;return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:gn===(Lt==null?void 0:Lt.id)?"".concat(jt.a.list," ").concat(jt.a.active):jt.a.list,style:ln,onClick:function(){return Hn(Lt)}},(Lt==null?void 0:Lt.video)&&r.a.createElement("div",{className:jt.a.left},r.a.createElement("img",{src:Lt==null?void 0:Lt.video_cover}),r.a.createElement("div",null,r.a.createElement("img",{src:Ee.a}),r.a.createElement("span",null,Lt==null?void 0:Lt.video_duration)),r.a.createElement("div",{className:jt.a.mask})),r.a.createElement("div",{className:jt.a.right},r.a.createElement("div",{className:jt.a.name},r.a.createElement("img",{src:T.a.IMG_SERVER+"/images/"+(Lt==null?void 0:Lt.image_url),width:30,height:30}),r.a.createElement("div",{title:Lt==null?void 0:Lt.name,className:jt.a.title},Lt==null?void 0:Lt.name),(Lt==null?void 0:Lt.is_authority)&&r.a.createElement("div",{className:jt.a.b},"\u5B98\u65B9"),(Lt==null?void 0:Lt.is_excellent)&&r.a.createElement("div",{className:jt.a.a},"\u7CBE\u9009")),r.a.createElement("div",{className:jt.a.des},r.a.createElement(st.a,{showLines:2,showTextOnly:!0,value:(Lt==null?void 0:Lt.content)||"\u6682\u65E0\u5185\u5BB9"})),r.a.createElement("div",{className:jt.a.tag},r.a.createElement("span",{className:"current",onClick:function(Ft){Ft.stopPropagation(),Cn(Lt)}},r.a.createElement("img",{src:Lt!=null&&Lt.user_liker?$.a:H.a}),r.a.createElement("span",{style:{color:Lt!=null&&Lt.user_liker?"#0152d9":"#656f87"}},Lt==null?void 0:Lt.praises_count)),r.a.createElement("span",null,r.a.createElement("img",{src:xe.a}),r.a.createElement("span",null,Lt==null?void 0:Lt.discusses_count)),r.a.createElement("span",null,r.a.createElement("img",{src:$e.a}),r.a.createElement("span",null,Lt==null?void 0:Lt.viewed_count)),Object(rt.v)()&&r.a.createElement("span",{className:"current",style:{color:"#0152d9",marginRight:0,userSelect:"none"},onClick:function(Ft){Ft.stopPropagation(),_t(Lt)}},Lt!=null&&Lt.is_hidden?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF")))),bt&&r.a.createElement("div",{className:jt.a.line}))},xt=pt,Ve=M("YfA7"),ht=M("e4Gi"),Rt=M("Z8dc"),lt=M.n(Rt),Pt=M("7+5b"),Wt=M.n(Pt),Bt=M("twBr"),wt=M.n(Bt),Q=M("oE5q"),k=M.n(Q),U=M("9+Du"),X=function(St){var Ht,ln=St.onClose,Hn=St.onOk,Cn=St.identifier,_t=St.active,Lt=l.a.useForm(),gn=Object(N.a)(Lt,1),bt=gn[0],cn=Object(_.useState)({}),Ft=Object(N.a)(cn,2),vn=Ft[0],Vn=Ft[1],Nn=Object(_.useState)(!1),Tn=Object(N.a)(Nn,2),Yn=Tn[0],In=Tn[1],$n=Object(_.useState)(!1),rr=Object(N.a)($n,2),_r=rr[0],Bn=rr[1],gr=Object(_.useState)([]),mr=Object(N.a)(gr,2),sr=mr[0],Un=mr[1],Jn=Object(rt.x)(),Xn=Object(w.i)();Object(_.useEffect)(function(){_t&&Vt()},[_t]);var Vt=function(){var tn=Object(D.a)(h.a.mark(function Kt(){var Zt,pn,vr,kr,ai,Yr,Oi,pr,Ai,Fi,zi,ji;return h.a.wrap(function(xi){for(;;)switch(xi.prev=xi.next){case 0:return xi.next=2,Object(x.k)(Cn,{active:_t});case 2:Zt=xi.sent,(Zt==null?void 0:Zt.status)===0&&(Yr={name:Zt==null||((pn=Zt.data)===null||pn===void 0)?void 0:pn.name,content:Zt==null||((vr=Zt.data)===null||vr===void 0)?void 0:vr.content},bt.setFieldsValue(Yr),Vn(Yr),Zt!=null&&(kr=Zt.data)!==null&&kr!==void 0&&(ai=kr.videos)!==null&&ai!==void 0&&ai[0]&&Un([{video_id:Zt==null||((Oi=Zt.data)===null||Oi===void 0||((pr=Oi.videos)===null||pr===void 0||((Ai=pr[0])===null||Ai===void 0)))?void 0:Ai.video_id,name:Zt==null||((Fi=Zt.data)===null||Fi===void 0||((zi=Fi.videos)===null||zi===void 0||((ji=zi[0])===null||ji===void 0)))?void 0:ji.title,loaded:100}]));case 4:case"end":return xi.stop()}},Kt)}));return function(){return tn.apply(this,arguments)}}(),Rn=function(Kt,Zt){Vn(Object(d.a)({},Zt))},cr=function(){var tn=Object(D.a)(h.a.mark(function Kt(Zt){var pn,vr,kr,ai,Yr;return h.a.wrap(function(pr){for(;;)switch(pr.prev=pr.next){case 0:if(vr={videos:sr,articles:Zt},Bn(!0),!_t){pr.next=9;break}return vr.active=_t,pr.next=6,Object(x.j)(Cn,vr);case 6:kr=pr.sent,pr.next=12;break;case 9:return pr.next=11,Object(x.a)(Cn,vr);case 11:kr=pr.sent;case 12:((pn=kr)===null||pn===void 0?void 0:pn.status)===0&&(console.log(_t||((ai=kr)===null||ai===void 0?void 0:ai.id),44),Hn(_t||((Yr=kr)===null||Yr===void 0?void 0:Yr.id))),Bn(!1);case 14:case"end":return pr.stop()}},Kt)}));return function(Zt){return tn.apply(this,arguments)}}(),un=function(Kt){var Zt=1024,pn=Kt.name.toLowerCase();return pn&&pn.indexOf(".avi")==-1&&pn.indexOf(".flv")==-1&&pn.indexOf(".f4v")==-1&&pn.indexOf(".m4v")==-1&&pn.indexOf(".mov")==-1&&pn.indexOf(".mp4")==-1&&pn.indexOf(".rmvb")==-1&&pn.indexOf(".swf")==-1&&pn.indexOf(".webm")==-1&&pn.indexOf(".wmv")==-1?(B.b.info("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u683C\u5F0F"),!0):Kt.size>Zt*1024*1024?(B.b.info("\u89C6\u9891\u5927\u5C0F\u8D85\u8FC7".concat(Zt,"M")),!0):sr!=null&&sr.find(function(vr){return vr.name===Kt.name})?(B.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},fn=function(Kt,Zt){W.a.confirm({title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:r.a.createElement("div",{className:"tc"},"\u60A8\u786E\u8BA4\u8981",Zt?"\u5220\u9664":"\u53D6\u6D88\u4E0A\u4F20","\u8BE5\u89C6\u9891\u5417\uFF1F"),onOk:function(){Un([])}})},Sn={accept:".mkv, .flv, .f4v, .rmvb, .swf, video/mp4,video/x-m4v,video/flv,video/f4v,video/rmvb,video/swf,video/*",onBefore:un,onBeginInitFile:function(Kt){In(!0),Un([{name:Kt.filename,loaded:0}])},onComplete:function(Kt){Un([{name:Kt.filename,loaded:Kt.percent,video_id:Kt.id}]),In(!1)},onError:function(){Un([]),In(!1)},onProgress:function(Kt){Un([{name:Kt.filename,loaded:Kt.percent}])},chunkSize:1024*1024*2,options:{user_id:Jn==null?void 0:Jn.user_id}},bn=function(){return r.a.createElement(U.a,Sn,r.a.createElement("div",{className:lt.a.main},r.a.createElement("img",{src:Wt.a,alt:""}),r.a.createElement("span",null,"\u4E0A\u4F20\u89C6\u9891")))},yn=function(Kt){return r.a.createElement("div",{className:lt.a.mainLoading},r.a.createElement("div",{className:lt.a.proWarp},r.a.createElement("div",{className:lt.a.pro},r.a.createElement("div",{style:{width:Kt}})),r.a.createElement("span",null,Kt||0,"%")),r.a.createElement("aside",null,"\u4E0A\u4F20\u4E2D"),r.a.createElement("div",{className:lt.a.tip},r.a.createElement(ht.a,{getPopupContainer:function(pn){return pn.parentNode},title:r.a.createElement("div",null,r.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",r.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"),r.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),r.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},r.a.createElement("img",{src:k.a,alt:""}))))},En=function(Kt){return r.a.createElement("div",{className:lt.a.mainSucceed},r.a.createElement("img",{src:wt.a,alt:""}),r.a.createElement("span",null,"\u4E0A\u4F20\u6210\u529F"),r.a.createElement("div",{className:lt.a.tip},r.a.createElement(ht.a,{getPopupContainer:function(pn){return pn.parentNode},title:r.a.createElement("div",null,r.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",r.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"),r.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),r.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},r.a.createElement("img",{src:k.a,alt:""}))),r.a.createElement("div",{className:lt.a.del,onClick:function(){return fn(Kt.name,Kt.loaded==100)}},r.a.createElement("i",{className:"iconfont icon-shanchu7 mr5"}),"\u5220\u9664\u89C6\u9891"))},zt=function(){return r.a.createElement(r.a.Fragment,null,sr==null?void 0:sr.map(function(Kt,Zt){return r.a.createElement(r.a.Fragment,{key:Zt},Kt.loaded==100?En(Kt):yn(Kt.loaded))}))},Yt=function(){W.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:ln})},qt=sr==null?void 0:sr.length;return r.a.createElement("div",{className:lt.a.listForm},r.a.createElement("header",null,_t?"\u7F16\u8F91":"\u53D1\u5E03","\u9898\u89E3"),r.a.createElement("section",{className:lt.a.scroll,id:"sss"},r.a.createElement("div",{className:lt.a.formWrap}," ",r.a.createElement(l.a,{form:bt,scrollToFirstError:!0,layout:"vertical",onValuesChange:Rn,onFinish:cr},r.a.createElement(l.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"}]},r.a.createElement(j.a,{bordered:!1,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26",suffix:"".concat(((Ht=vn.name)===null||Ht===void 0?void 0:Ht.length)||0,"/60")})),r.a.createElement(l.a.Item,{name:"content",label:"\u5185\u5BB9:"},r.a.createElement(dt.a,{defaultValue:vn.content||"",watch:!0})))),r.a.createElement("div",{className:lt.a.upload},qt?zt():bn())),r.a.createElement("div",{className:lt.a.btns},r.a.createElement(L.a,{onClick:Yt,type:"primary",ghost:!0},"\u5173\u95ED"),r.a.createElement(L.a,{loading:_r,disabled:Yn,onClick:function(){return bt.submit()},type:"primary"},"\u53D1\u5E03\u9898\u89E3")))},ie=X,J=M("kmrB"),Ae=M("Jv1h"),tt=M("CaVn"),kt=M.n(tt),Mt=M("s8/Y"),gt=M.n(Mt),$t=M("JOrW"),mn=M.n($t),Mn=M("gqXR"),lr=M.n(Mn),Kn=M("6NPb"),ur=M("o3AU"),dr=M("EOh4"),hr=M("V/dS"),Dr=M("wW8i"),Cr=M.n(Dr),Wn=M("MVJL"),Er=M.n(Wn),zr=function(St){var Ht=St.id,ln=St.cb,Hn=Object(_.useState)(""),Cn=Object(N.a)(Hn,2),_t=Cn[0],Lt=Cn[1];return r.a.createElement("aside",{className:"mt10"},r.a.createElement(dt.a,{defaultValue:_t,id:"writeForumsReviewId",onChange:function(bt){Lt(bt)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),r.a.createElement(ur.a,null,r.a.createElement(hr.a,{flex:"1"}),r.a.createElement(hr.a,null,r.a.createElement(L.a,{type:"primary",size:"large",onClick:Object(D.a)(h.a.mark(function gn(){return h.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:_t===""?B.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"):ln(Ht,_t);case 1:case"end":return cn.stop()}},gn)}))},"\u53D1\u9001"))))},vi=function(St){var Ht,ln=St.data;return r.a.createElement("div",{className:Er.a.thirdlyLevelDiscuss},r.a.createElement("span",{className:"c-grey-333"},r.a.createElement("span",{className:"font 14 c-light-primary"},ln==null||((Ht=ln.author)===null||Ht===void 0)?void 0:Ht.name),"@",r.a.createElement("span",{className:"font 14 c-light-primary"},ln==null?void 0:ln.parent_name),":"),r.a.createElement(st.a,{value:ln==null?void 0:ln.content}))},xr=function(St){var Ht,ln,Hn,Cn,_t=St.data,Lt=St.onReplyDiscuss,gn=St.thirdlyReply,bt=St.setThirdlyReply,cn=Object(rt.x)();return console.log(cn,"user"),r.a.createElement("div",{className:Er.a.list},r.a.createElement("img",{src:T.a.IMG_SERVER+"/images/"+(_t==null||((Ht=_t.author)===null||Ht===void 0)?void 0:Ht.image_url)}),r.a.createElement("div",{className:Er.a.wrap},r.a.createElement("div",{className:"font14",style:{marginBottom:6}},r.a.createElement("span",{className:"c-grey-333"},_t==null||((ln=_t.author)===null||ln===void 0)?void 0:ln.name),(cn==null?void 0:cn.login)!==(_t==null||((Hn=_t.author)===null||Hn===void 0)?void 0:Hn.login)&&r.a.createElement("span",{onClick:function(){return bt(_t==null?void 0:_t.id)},className:"c-grey-999 current",style:{float:"right"}},r.a.createElement("i",{className:"iconfont icon-huifu3 mr3 font12"}),r.a.createElement("span",null,"\u56DE\u590D"))),r.a.createElement(st.a,{value:_t==null?void 0:_t.content}),_t==null||((Cn=_t.children)===null||Cn===void 0)?void 0:Cn.map(function(Ft){return r.a.createElement(vi,{key:Ft.id,data:Ft})}),gn===(_t==null?void 0:_t.id)&&r.a.createElement("div",null,r.a.createElement(zr,{id:_t==null?void 0:_t.id,cb:Lt}),r.a.createElement("div",{style:{textAlign:"end",paddingTop:20},onClick:function(){return bt(null)},className:"c-light-primary current"},r.a.createElement("i",{style:{transform:"scale(0.7)",display:"inline-block"},className:"iconfont icon-shouqi font12"}),"\u6536\u8D77\u56DE\u590D")),r.a.createElement("div",{className:Er.a.line})))},Zr=function(St){var Ht,ln,Hn,Cn,_t=St.data,Lt=St.onReplyDiscuss,gn=St.secondReply,bt=St.setSecondReply,cn=St.thirdlyReply,Ft=St.setThirdlyReply,vn=St.onPlusDiscuss,Vn=Object(_.useState)(!1),Nn=Object(N.a)(Vn,2),Tn=Nn[0],Yn=Nn[1];return console.log(_t,"data"),r.a.createElement("div",{className:Er.a.discussItem},r.a.createElement("div",{className:Er.a.list},r.a.createElement("img",{src:T.a.IMG_SERVER+"/images/"+(_t==null||((Ht=_t.author)===null||Ht===void 0)?void 0:Ht.image_url)}),r.a.createElement("div",{className:Er.a.wrap},r.a.createElement("div",{className:"font14",style:{marginBottom:6}},r.a.createElement("span",{className:"c-grey-333 mr30"},_t==null||((ln=_t.author)===null||ln===void 0)?void 0:ln.name),r.a.createElement("span",{className:"c-grey-999"},_t==null?void 0:_t.time)),r.a.createElement(st.a,{value:_t==null?void 0:_t.content}),r.a.createElement("div",{className:Er.a.btns},r.a.createElement("div",{onClick:function(){return vn(_t==null?void 0:_t.id)},className:_t!=null&&_t.user_praise?"c-light-primary":"c-grey-999"},r.a.createElement("i",{className:"iconfont icon-xiaodianzan2 mr3"}),r.a.createElement("span",null,_t==null?void 0:_t.praise_count)),r.a.createElement("div",{onClick:function(){var $n;if((_t==null||(($n=_t.children)===null||$n===void 0)?void 0:$n.length)===0)return;bt(null),Yn(!Tn)},style:{color:Tn?"#0152d9":"#999999"}},r.a.createElement("i",{className:"iconfont icon-xiaopinglun2 mr3"}),r.a.createElement("span",null,Tn?"\u6536\u8D77\u8BC4\u8BBA":_t==null||((Hn=_t.children)===null||Hn===void 0)?void 0:Hn.length)),r.a.createElement("div",{onClick:function(){Yn(!1),bt(gn===(_t==null?void 0:_t.id)?null:_t==null?void 0:_t.id)},style:{color:gn===(_t==null?void 0:_t.id)?"#0152d9":"#999999"}},r.a.createElement("i",{className:"iconfont icon-huifu3 mr3"}),r.a.createElement("span",null,gn===(_t==null?void 0:_t.id)?"\u6536\u8D77\u56DE\u590D":"\u56DE\u590D"))),gn===(_t==null?void 0:_t.id)&&r.a.createElement(zr,{id:_t==null?void 0:_t.id,cb:function($n,rr){Lt($n,rr),Yn(!0)}}),Tn&&r.a.createElement("div",{className:Er.a.secondLevelDiscuss},_t==null||((Cn=_t.children)===null||Cn===void 0)?void 0:Cn.map(function(In){return r.a.createElement(xr,{thirdlyReply:cn,setThirdlyReply:Ft,key:In.id,data:In,onReplyDiscuss:Lt})})))))},_i=Zr,yi=function(St){var Ht=St.identifier,ln=St.active,Hn=St.onOk,Cn=Object(_.useState)(""),_t=Object(N.a)(Cn,2),Lt=_t[0],gn=_t[1],bt=Object(_.useState)(1),cn=Object(N.a)(bt,2),Ft=cn[0],vn=cn[1],Vn=Object(_.useState)([]),Nn=Object(N.a)(Vn,2),Tn=Nn[0],Yn=Nn[1],In=Object(_.useState)(0),$n=Object(N.a)(In,2),rr=$n[0],_r=$n[1],Bn=Object(_.useState)(null),gr=Object(N.a)(Bn,2),mr=gr[0],sr=gr[1],Un=Object(_.useState)(null),Jn=Object(N.a)(Un,2),Xn=Jn[0],Vt=Jn[1];Object(_.useEffect)(function(){Rn(1),vn(1)},[ln]);var Rn=function(){var bn=Object(D.a)(h.a.mark(function yn(En){var zt;return h.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:return qt.next=2,me({container_type:"QuestionSolutionArticle",container_identifier:ln,limit:5,page:En});case 2:zt=qt.sent,zt!=null&&zt.comments&&(Yn((zt==null?void 0:zt.comments)||[]),vn(En),_r(zt==null?void 0:zt.disscuss_count));case 4:case"end":return qt.stop()}},yn)}));return function(En){return bn.apply(this,arguments)}}(),cr=function(){var bn=Object(D.a)(h.a.mark(function yn(){var En;return h.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:if(!(Lt==="")){Yt.next=3;break}return B.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Yt.abrupt("return");case 3:return Yt.next=5,Se({comments:{content:Lt},container_type:"QuestionSolutionArticle",container_identifier:ln});case 5:En=Yt.sent,En!=null&&En.discuss&&(gn(""),Rn(Ft),Hn());case 7:case"end":return Yt.stop()}},yn)}));return function(){return bn.apply(this,arguments)}}(),un=function(){var bn=Object(D.a)(h.a.mark(function yn(En,zt,Yt){var qt;return h.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:return Kt.next=2,Oe({container_type:"QuestionSolutionArticle",container_identifier:ln,comments:{content:zt,parent_id:En}});case 2:qt=Kt.sent,sr(null),Vt(null),Rn(Ft);case 6:case"end":return Kt.stop()}},yn)}));return function(En,zt,Yt){return bn.apply(this,arguments)}}(),fn=function(){var bn=Object(D.a)(h.a.mark(function yn(En){var zt;return h.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:return qt.next=2,Ce(En);case 2:zt=qt.sent,Rn(Ft);case 4:case"end":return qt.stop()}},yn)}));return function(En){return bn.apply(this,arguments)}}(),Sn=function(yn){vn(yn),Rn(yn)};return r.a.createElement("div",{className:Cr.a.discuss},r.a.createElement("aside",{className:Cr.a.reply,style:{borderWidth:rr?1:0}},r.a.createElement(dt.a,{defaultValue:Lt,id:"writeForumsReviewId",onChange:function(yn){gn(yn)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),r.a.createElement(ur.a,null,r.a.createElement(hr.a,{flex:"1"}),r.a.createElement(hr.a,null,r.a.createElement(L.a,{type:"primary",size:"large",onClick:function(){return cr()}},"\u53D1\u9001")))),Tn==null?void 0:Tn.map(function(bn){return r.a.createElement(_i,{secondReply:mr,setSecondReply:sr,thirdlyReply:Xn,setThirdlyReply:Vt,key:bn.id,data:bn,onReplyDiscuss:un,onPlusDiscuss:fn})}),r.a.createElement(Re.a,{className:Cr.a.pagination,showTotal:function(yn){return r.a.createElement("span",{style:{color:"#656F87"}},"\u5171",r.a.createElement("span",{className:"c-light-primary"},yn),"\u6761\u6570\u636E")},current:Ft,onChange:Sn,total:rr,showSizeChanger:!1,showQuickJumper:!0,hideOnSinglePage:!0,pageSize:5}))},qr=yi,di=M("hgre"),Pr=function(St){var Ht,ln,Hn,Cn,_t,Lt,gn,bt,cn,Ft,vn=St.active,Vn=St.identifier,Nn=St.onAssist,Tn=St.onEdit,Yn=St.onArticlesSkip,In=St.onClose,$n=St.onOk,rr=St.onDelete,_r=St.detailsIndex,Bn=St.btnShowStatus,gr=Object(_.useState)(!0),mr=Object(N.a)(gr,2),sr=mr[0],Un=mr[1],Jn=Object(_.useState)({}),Xn=Object(N.a)(Jn,2),Vt=Xn[0],Rn=Xn[1];Object(_.useEffect)(function(){vn&&cr()},[vn,_r]);var cr=function(){var yn=Object(D.a)(h.a.mark(function En(){var zt,Yt,qt=arguments;return h.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:return zt=qt.length>0&&qt[0]!==void 0?qt[0]:!0,zt&&Un(!0),Kt.next=4,Object(x.d)(Vn,{active:vn});case 4:Yt=Kt.sent,(Yt==null?void 0:Yt.status)===0&&Rn((Yt==null?void 0:Yt.data)||{}),Un(!1);case 7:case"end":return Kt.stop()}},En)}));return function(){return yn.apply(this,arguments)}}(),un=function(){var yn=Object(D.a)(h.a.mark(function En(zt){var Yt;return h.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:return tn.next=2,Object(x.g)(Vn,Object(d.a)({active:vn},zt));case 2:Yt=tn.sent,(Yt==null?void 0:Yt.status)===0&&(cr(!1),$n());case 4:case"end":return tn.stop()}},En)}));return function(zt){return yn.apply(this,arguments)}}(),fn=function(){var yn=Object(D.a)(h.a.mark(function En(zt){var Yt;return h.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:return tn.next=2,Object(x.c)(Vn,{active:zt==null?void 0:zt.id});case 2:Yt=tn.sent,Yt.status===0&&(cr(!1),$n());case 4:case"end":return tn.stop()}},En)}));return function(zt){return yn.apply(this,arguments)}}(),Sn=function(En){W.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 rr(En)}})},bn=function(){cr(!1),$n()};return r.a.createElement("div",{className:kt.a.listDetails},r.a.createElement(Ae.a,{className:"pt20 pl20 pr20",loading:sr,active:!0,paragraph:{rows:5}},r.a.createElement("div",{className:kt.a.head},r.a.createElement("div",{className:kt.a.name},r.a.createElement("div",{title:Vt==null?void 0:Vt.name,className:kt.a.title},Vt==null?void 0:Vt.name),(Vt==null?void 0:Vt.is_authority)&&r.a.createElement("div",{className:kt.a.b},"\u5B98\u65B9"),(Vt==null?void 0:Vt.is_excellent)&&r.a.createElement("div",{className:kt.a.a},"\u7CBE\u9009")),r.a.createElement("div",{className:kt.a.tag},r.a.createElement("img",{src:T.a.IMG_SERVER+"/images/"+(Vt==null?void 0:Vt.image_url)}),r.a.createElement("div",{className:"c-grey-333 ml5 mr20 font14"},Vt==null?void 0:Vt.username),r.a.createElement("div",{style:{display:"inline-block",marginBottom:-2},className:"c-grey-999 mr20 font12"},"\u53D1\u5E03\u4E8E",Ze()(Vt==null?void 0:Vt.created_at).format("YYYY-MM-DD")),r.a.createElement("span",null,r.a.createElement("img",{src:H.a}),r.a.createElement("span",null,Vt==null?void 0:Vt.praises_count)),r.a.createElement("span",null,r.a.createElement("img",{src:xe.a}),r.a.createElement("span",null,Vt==null?void 0:Vt.discusses_count)),r.a.createElement("span",null,r.a.createElement("img",{src:$e.a}),r.a.createElement("span",null,Vt==null?void 0:Vt.viewed_count)),r.a.createElement("div",{className:kt.a.btn},(Object(rt.v)()||(Vt==null?void 0:Vt.is_self))&&r.a.createElement(r.a.Fragment,null,r.a.createElement(L.a,{onClick:function(){return Sn(Vt)},type:"primary",ghost:!0},"\u5220\u9664"),r.a.createElement(L.a,{onClick:function(){return Tn(Vt)},type:"primary",ghost:!0},"\u7F16\u8F91")),Object(rt.v)()&&r.a.createElement(L.a,{onClick:function(){return un({is_authority:!(Vt!=null&&Vt.is_authority)})},type:"primary"},r.a.createElement("img",{src:mn.a}),Vt!=null&&Vt.is_authority?"\u53D6\u6D88":"\u8BBE\u4E3A","\u5B98\u65B9"),Object(rt.v)()&&r.a.createElement(L.a,{onClick:function(){return un({is_excellent:!(Vt!=null&&Vt.is_excellent)})},type:"primary"},r.a.createElement("img",{src:gt.a}),Vt!=null&&Vt.is_excellent?"\u53D6\u6D88":"\u8BBE\u4E3A","\u7CBE\u9009")))),r.a.createElement("div",{className:kt.a.scroll},(Vt==null||((Ht=Vt.videos)===null||Ht===void 0||((ln=Ht[0])===null||ln===void 0))?void 0:ln.id)&&r.a.createElement("div",{className:kt.a.video},r.a.createElement(z.a,{tip:"\u6B63\u5728\u8F6C\u7801\uFF0C\u8BF7\u7A0D\u7B49...",spinning:!(Vt!=null&&(Hn=Vt.videos)!==null&&Hn!==void 0&&(Cn=Hn[0])!==null&&Cn!==void 0&&Cn.transcoded)},r.a.createElement(di.a,{poster:Vt==null||((_t=Vt.videos)===null||_t===void 0||((Lt=_t[0])===null||Lt===void 0))?void 0:Lt.cover_url,src:(Vt==null||((gn=Vt.videos)===null||gn===void 0||((bt=gn[0])===null||bt===void 0))?void 0:bt.play_url)||"",videoId:Vt==null||((cn=Vt.videos)===null||cn===void 0||((Ft=cn[0])===null||Ft===void 0))?void 0:Ft.id,logWatchHistory:function(){}}))),r.a.createElement(st.a,{className:kt.a.html,value:(Vt==null?void 0:Vt.content)||""}),r.a.createElement("div",{onClick:function(){return fn(Vt)},className:kt.a.g},r.a.createElement("img",{className:"mr10",src:(Vt!=null&&Vt.user_liker,lr.a)}),r.a.createElement("span",null,Vt==null?void 0:Vt.praises_count)),r.a.createElement(qr,{onOk:bn,active:vn,identifier:Vn})),r.a.createElement("div",{className:kt.a.btns},r.a.createElement(L.a,{onClick:function(){return In()},type:"primary",ghost:!0},"\u5173\u95ED"),Bn[0]&&r.a.createElement(L.a,{onClick:function(En){return Yn(En,"prev")},style:{marginLeft:20},type:"primary"},"\u4E0A\u4E00\u9898\u89E3"),Bn[1]&&r.a.createElement(L.a,{onClick:function(En){return Yn(En,"next")},style:{marginLeft:20},type:"primary"},"\u4E0B\u4E00\u9898\u89E3"))))},Nr=Pr,Sr=M("3tLw"),Qn=M.n(Sr),Or=M("ek7X"),er=M("0NbB"),Wr=function(St){var Ht=St.identifier,ln=St.tabStatus,Hn=St.setFilterListTotal,Cn=St.setListStatus,_t={page:1,limit:10,total:0,search:"",save_search:"",sort_by:"updated_at",sort_direction:null},Lt=Object(_.useState)(Object(d.a)({},_t)),gn=Object(N.a)(Lt,2),bt=gn[0],cn=gn[1],Ft=Object(_.useState)(!1),vn=Object(N.a)(Ft,2),Vn=vn[0],Nn=vn[1],Tn=Object(_.useState)(0),Yn=Object(N.a)(Tn,2),In=Yn[0],$n=Yn[1],rr=Object(_.useState)(1),_r=Object(N.a)(rr,2),Bn=_r[0],gr=_r[1],mr=Object(_.useState)(null),sr=Object(N.a)(mr,2),Un=sr[0],Jn=sr[1],Xn=Object(_.useState)([]),Vt=Object(N.a)(Xn,2),Rn=Vt[0],cr=Vt[1],un=Object(_.useState)([!0,!0]),fn=Object(N.a)(un,2),Sn=fn[0],bn=fn[1],yn=Object(_.useState)(0),En=Object(N.a)(yn,2),zt=En[0],Yt=En[1],qt=Object(_.useRef)(null);Object(_.useEffect)(function(){pr()},[ln]),Object(_.useEffect)(function(){tn()},[Un]),Object(_.useEffect)(function(){Zt(Object(d.a)({},_t)),pr()},[Ht]),Object(_.useEffect)(function(){return window.addEventListener("resize",Kt),Cn(zt),function(){window.removeEventListener("resize",Kt)}},[zt]);var tn=function(){var yr=Object(D.a)(h.a.mark(function Ln(){var Zn,ir;return h.a.wrap(function(qn){for(;;)switch(qn.prev=qn.next){case 0:if(Un){qn.next=3;break}return bn([!0,!0]),qn.abrupt("return");case 3:Zn=[!0,!0],ir=Rn==null?void 0:Rn.findIndex(function(Li){return Li.id===Un}),ir===0&&bt.page===1&&(Zn[0]=!1),(bt.page-1)*bt.limit+(ir+1)===bt.total&&(Zn[1]=!1),bn(Zn);case 8:case"end":return qn.stop()}},Ln)}));return function(){return yr.apply(this,arguments)}}(),Kt=function(){if(zt){var Ln,Zn=window.innerWidth-((Ln=qt.current)===null||Ln===void 0?void 0:Ln.clientWidth);$n(Zn)}},Zt=function(){var yr=Object(D.a)(h.a.mark(function Ln(Zn){var ir,Hr,qn,Li;return h.a.wrap(function(ei){for(;;)switch(ei.prev=ei.next){case 0:return Nn(!0),ei.next=3,Object(x.f)(Ht,Zn);case 3:return ir=ei.sent,(ir==null?void 0:ir.status)===0&&(cr((ir==null||((Hr=ir.data)===null||Hr===void 0)?void 0:Hr.articles)||[]),cn(Object(d.a)(Object(d.a)({},Zn),{},{total:ir==null||((qn=ir.data)===null||qn===void 0)?void 0:qn.articles_count})),Hn(ir==null||((Li=ir.data)===null||Li===void 0)?void 0:Li.articles_count)),Nn(!1),ei.abrupt("return",ir);case 7:case"end":return ei.stop()}},Ln)}));return function(Zn){return yr.apply(this,arguments)}}(),pn=function(){(bt==null?void 0:bt.sort_direction)===null?bt.sort_direction="asc":(bt==null?void 0:bt.sort_direction)==="asc"?bt.sort_direction="desc":(bt==null?void 0:bt.sort_direction)==="desc"&&(bt.sort_direction=null),bt.page=1,pr(),cn(Object(d.a)({},bt)),Zt(bt)},vr=function(){bt.page=1,bt.search=bt==null?void 0:bt.save_search,pr(),cn(Object(d.a)({},bt)),Zt(bt)},kr=function(){var Ln,Zn=document.getElementsByClassName("btn-resize");Zn[0].style.visibility="hidden";var ir=window.innerWidth-((Ln=qt.current)===null||Ln===void 0?void 0:Ln.clientWidth);$n(ir)},ai=function(){kr(),Yt(1)},Yr=function(Ln){kr(),Jn(Ln==null?void 0:Ln.id),Yt(3)},Oi=function(Ln){kr(),Jn(Ln==null?void 0:Ln.id),Yt(2)},pr=function(){var Ln=document.getElementsByClassName("btn-resize");Ln[0].style.visibility="visible",$n(0),Yt(0),Jn(null)},Ai=function(Ln){Yt(3),Jn(Ln),bt.page=1,cn(Object(d.a)({},bt)),Zt(bt)},Fi=function(Ln){Yt(3),Jn(Ln),cn(Object(d.a)({},bt)),Zt(bt)},zi=function(Ln){cn(Object(d.a)({},bt)),Zt(bt)},ji=function(){var yr=Object(D.a)(h.a.mark(function Ln(Zn){var ir;return h.a.wrap(function(qn){for(;;)switch(qn.prev=qn.next){case 0:return qn.next=2,Object(x.c)(Ht,{active:Zn==null?void 0:Zn.id});case 2:ir=qn.sent,ir.status===0&&(Zt(bt),gr(Bn+1));case 4:case"end":return qn.stop()}},Ln)}));return function(Zn){return yr.apply(this,arguments)}}(),da=function(){var yr=Object(D.a)(h.a.mark(function Ln(Zn){var ir;return h.a.wrap(function(qn){for(;;)switch(qn.prev=qn.next){case 0:return qn.next=2,Object(x.e)(Ht,{active:Zn==null?void 0:Zn.id});case 2:ir=qn.sent,ir.status===0&&(Zt(bt),gr(Bn+1));case 4:case"end":return qn.stop()}},Ln)}));return function(Zn){return yr.apply(this,arguments)}}(),xi=function(){var yr=Object(D.a)(h.a.mark(function Ln(Zn){var ir;return h.a.wrap(function(qn){for(;;)switch(qn.prev=qn.next){case 0:return qn.next=2,Object(x.i)(Ht,{active:Zn==null?void 0:Zn.id});case 2:ir=qn.sent,ir.status===0&&(pr(),Zt(bt));case 4:case"end":return qn.stop()}},Ln)}));return function(Zn){return yr.apply(this,arguments)}}(),ea=function(Ln){bt.page=Ln,cn(Object(d.a)({},bt)),Zt(bt)},Da=function(){var yr=Object(D.a)(h.a.mark(function Ln(Zn,ir){var Hr,qn,Li,Ki,ei,Ii,Fr,fi,jn,Dn,ar;return h.a.wrap(function(Fn){for(;;)switch(Fn.prev=Fn.next){case 0:if(Hr=Rn==null?void 0:Rn.findIndex(function(wr){return wr.id===Un}),console.log(Hr,ir,22),!(ir==="prev")){Fn.next=21;break}if(!(Hr===void 0)){Fn.next=6;break}return B.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),Fn.abrupt("return");case 6:if(!(Hr===0)){Fn.next=19;break}if(!(bt.page===1)){Fn.next=10;break}return B.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),Fn.abrupt("return");case 10:if(!(bt.page!==1)){Fn.next=17;break}return bt.page=bt.page-1,cn(Object(d.a)({},bt)),Fn.next=15,Zt(bt);case 15:qn=Fn.sent,(qn==null?void 0:qn.status)===0&&(Ii=qn==null||((Li=qn.data)===null||Li===void 0)?void 0:Li.articles[(qn==null||((Ki=qn.data)===null||Ki===void 0||((ei=Ki.articles)===null||ei===void 0))?void 0:ei.length)-1],Jn(Ii==null?void 0:Ii.id),console.log(Zn.target,555));case 17:Fn.next=21;break;case 19:Fr=Rn[Hr-1],Jn(Fr==null?void 0:Fr.id);case 21:if(!(ir==="next")){Fn.next=39;break}if(!(Hr===void 0)){Fn.next=25;break}return B.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),Fn.abrupt("return");case 25:if(!((bt.page-1)*bt.limit+(Hr+1)===bt.total)){Fn.next=28;break}return B.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),Fn.abrupt("return");case 28:if(!(Hr+1===bt.limit)){Fn.next=37;break}return bt.page=bt.page+1,cn(Object(d.a)({},bt)),Fn.next=33,Zt(bt);case 33:fi=Fn.sent,(fi==null?void 0:fi.status)===0&&(Dn=fi==null||((jn=fi.data)===null||jn===void 0)?void 0:jn.articles[0],Jn(Dn==null?void 0:Dn.id)),Fn.next=39;break;case 37:ar=Rn[Hr+1],Jn(ar==null?void 0:ar.id);case 39:case"end":return Fn.stop()}},Ln)}));return function(Zn,ir){return yr.apply(this,arguments)}}();return r.a.createElement("div",{className:_n.a.wrap,ref:qt},r.a.createElement("div",{className:_n.a.head},r.a.createElement("div",{className:_n.a.sort,onClick:pn},r.a.createElement("span",null,"\u6700\u65B0"),r.a.createElement("aside",null,r.a.createElement(Or.a,{style:{color:(bt==null?void 0:bt.sort_direction)==="asc"?"#0152d9":"#bfbfbf"}}),r.a.createElement(er.a,{style:{color:(bt==null?void 0:bt.sort_direction)==="desc"?"#0152d9":"#bfbfbf"}}))),r.a.createElement(j.a.Search,{value:bt.save_search,className:_n.a["oj-width-input"],placeholder:"\u641C\u7D22\u9898\u89E3",onChange:function(Ln){bt.save_search=Ln.target.value,cn(Object(d.a)({},bt))},onSearch:vr}),r.a.createElement("div",{onClick:ai,className:_n.a.btn},r.a.createElement("img",{src:Qn.a}),"\u5199\u9898\u89E3")),r.a.createElement("div",{className:_n.a.listWarp},r.a.createElement(z.a,{spinning:Vn,className:"mt20"},Rn==null?void 0:Rn.map(function(yr,Ln){var Zn=!0;return Ln+1===Rn.length&&Ln!==0&&(Zn=!1),r.a.createElement(xt,{active:Un,key:yr.id,data:yr,showLine:Zn,onClick:Yr,onAssist:ji,onHide:da})}),(Rn==null?void 0:Rn.length)===0&&r.a.createElement(le.a,{customText:"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"}))),r.a.createElement(Re.a,{className:_n.a.pagination,showTotal:function(Ln){return r.a.createElement("span",{style:{color:"#656F87"}},"\u5171",r.a.createElement("span",{className:"c-light-primary"},Ln),"\u6761\u6570\u636E")},total:bt.total,showSizeChanger:!1,current:bt==null?void 0:bt.page,onChange:ea,hideOnSinglePage:!0,showQuickJumper:!0}),zt>0&&r.a.createElement("div",{className:_n.a.fixedRight,style:{width:In}},zt===1&&r.a.createElement(ie,{identifier:Ht,onClose:pr,onOk:Ai}),zt===2&&r.a.createElement(ie,{active:Un,identifier:Ht,onClose:pr,onOk:Fi}),zt===3&&r.a.createElement(Nr,{btnShowStatus:Sn,onArticlesSkip:Da,detailsIndex:Bn,active:Un,identifier:Ht,onClose:pr,onOk:zi,onEdit:Oi,onAssist:ji,onDelete:xi})))},Rr=Wr,Vr=M("VEzc"),Ar=M.n(Vr),Ri=function(St){var Ht,ln=St.visible,Hn=St.onVisible,Cn=St.value,_t=St.onChange,Lt=St.setIndex,gn={page:1,per_page:30,total:0,tag_discipline_id:[],search:"",save_search:"",difficulty:null},bt=Object(_.useState)(gn),cn=Object(N.a)(bt,2),Ft=cn[0],vn=cn[1],Vn=Object(_.useState)([]),Nn=Object(N.a)(Vn,2),Tn=Nn[0],Yn=Nn[1],In=Object(_.useState)([]),$n=Object(N.a)(In,2),rr=$n[0],_r=$n[1],Bn=Object(_.useState)(!1),gr=Object(N.a)(Bn,2),mr=gr[0],sr=gr[1],Un=Object(_.useRef)([]),Jn=Object(_.useRef)(null),Xn=Object(w.i)();Object(_.useEffect)(function(){return Xn!=null&&Xn.id&&(Jn.current=setInterval(function(){Vt(30)},3e4)),function(){clearInterval(Jn.current)}},[]);var Vt=function(){var zt=Object(D.a)(h.a.mark(function Yt(qt){var tn;return h.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return Zt.next=2,Object(x.r)(Xn==null?void 0:Xn.id,{practice_time:qt});case 2:tn=Zt.sent;case 3:case"end":return Zt.stop()}},Yt)}));return function(qt){return zt.apply(this,arguments)}}();Object(_.useEffect)(function(){bn(Ft),fn()},[]),Object(_.useEffect)(function(){return window.addEventListener("click",cr),function(){window.removeEventListener("click",cr)}},[Xn==null?void 0:Xn.save_identifier,ln]),Object(_.useEffect)(function(){var zt=Un.current.findIndex(function(Zt){return Zt.identifier===(Xn==null?void 0:Xn.save_identifier)}),Yt=Un.current[zt-1],qt=Un.current[zt+1],tn=document.getElementById("oj-prev"),Kt=document.getElementById("oj-next");Yt?tn.style.display="block":tn.style.display="none",qt?Kt.style.display="block":Kt.style.display="none"},[Xn==null?void 0:Xn.save_identifier,Un.current]);var Rn=function(Yt,qt){if(Yt.id===qt)return Yt;for(var tn=0,Kt=Yt;Kt=Kt.parentNode;tn++){if(Kt.id===qt)return Kt;if(Kt==document.documentElement)return!1}},cr=function(){var zt=Object(D.a)(h.a.mark(function Yt(qt){var tn,Kt,Zt;return h.a.wrap(function(vr){for(;;)switch(vr.prev=vr.next){case 0:if(!Rn(qt.target,"oj-drawer")&&ln&&Hn(!1),tn=Un.current.findIndex(function(kr){return kr.identifier===(Xn==null?void 0:Xn.save_identifier)}),Kt=Un.current[tn-1],Zt=Un.current[tn+1],!(qt.target.id==="oj-prev")){vr.next=14;break}if(!(!Kt||tn===-1)){vr.next=8;break}return B.b.warn("\u4E0A\u4E00\u9898\u4E0D\u5B58\u5728"),vr.abrupt("return");case 8:return qt.target.style.pointerEvents="none",qt.target.style.cursor="not-allowed",vr.next=12,yn(Kt==null?void 0:Kt.identifier);case 12:Lt("0"),setTimeout(function(){qt.target.style.pointerEvents="auto",qt.target.style.cursor="pointer"},400);case 14:if(!(qt.target.id==="oj-next"||qt.target.id==="oj-modal-next")){vr.next=24;break}if(!(!Zt||tn===-1)){vr.next=18;break}return B.b.warn("\u4E0B\u4E00\u9898\u4E0D\u5B58\u5728"),vr.abrupt("return");case 18:return qt.target.style.pointerEvents="none",qt.target.style.cursor="not-allowed",vr.next=22,yn(Zt==null?void 0:Zt.identifier);case 22:Lt("0"),setTimeout(function(){qt.target.style.pointerEvents="auto",qt.target.style.cursor="pointer"},400);case 24:case"end":return vr.stop()}},Yt)}));return function(qt){return zt.apply(this,arguments)}}();Object(_.useEffect)(function(){_t(Xn==null?void 0:Xn.save_identifier);var zt=rr.findIndex(function(Yt){return Yt.some(function(qt){return qt.identifier===(Xn==null?void 0:Xn.save_identifier)})});zt===-1?vn(Object(d.a)(Object(d.a)({},Ft),{},{page:1})):vn(Object(d.a)(Object(d.a)({},Ft),{},{page:zt+1}))},[Xn==null?void 0:Xn.save_identifier,rr]);var un=function(Yt){Ft.page=1,Ft.tag_discipline_id=Yt,vn(Object(d.a)({},Ft)),bn(Ft)},fn=function(){var zt=Object(D.a)(h.a.mark(function Yt(){var qt;return h.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:return Kt.next=2,Object(Me.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice",position:"index"}});case 2:qt=Kt.sent,Yn(qt.tag_disciplines||[]);case 4:case"end":return Kt.stop()}},Yt)}));return function(){return zt.apply(this,arguments)}}(),Sn=function(Yt){Ft.page=1,Ft.difficulty=typeof Yt=="number"?Yt:null,vn(Object(d.a)({},Ft)),bn(Ft)},bn=function(){var zt=Object(D.a)(h.a.mark(function Yt(qt){var tn,Kt,Zt,pn,vr,kr;return h.a.wrap(function(Yr){for(;;)switch(Yr.prev=Yr.next){case 0:return sr(!0),Yr.next=3,Object(x.p)(qt);case 3:if(tn=Yr.sent,tn!=null&&tn.practices_list){for(Zt=tn==null||((Kt=tn.practices_list)===null||Kt===void 0)?void 0:Kt.length,pn=[],vr=0;vr<Zt;vr+=Ft==null?void 0:Ft.per_page)pn.push(tn==null||((kr=tn.practices_list)===null||kr===void 0)?void 0:kr.slice(vr,vr+(Ft==null?void 0:Ft.per_page)));vn(Object(d.a)(Object(d.a)({},Ft),{},{total:tn==null?void 0:tn.practices_count})),Un.current=(tn==null?void 0:tn.practices_list)||[],_r(pn)}sr(!1);case 6:case"end":return Yr.stop()}},Yt)}));return function(qt){return zt.apply(this,arguments)}}(),yn=function(){var zt=Object(D.a)(h.a.mark(function Yt(qt,tn){var Kt;return h.a.wrap(function(pn){for(;;)switch(pn.prev=pn.next){case 0:return pn.next=2,Object(Me.a)("/api/practices/".concat(qt,"/start"),{method:"get"});case 2:Kt=pn.sent,(Kt==null?void 0:Kt.status)===0&&I.d.push("/problems/".concat(Kt==null?void 0:Kt.identifier,"/oj/").concat(qt));case 4:case"end":return pn.stop()}},Yt)}));return function(qt,tn){return zt.apply(this,arguments)}}(),En=function(Yt){Ft.page=Yt,vn(Object(d.a)({},Ft))};return r.a.createElement("div",{className:Ar.a.wrap,id:"oj-drawer",style:{left:ln?0:-700}},r.a.createElement("div",{className:Ar.a.head},r.a.createElement("div",{className:Ar.a.title},"\u9898\u76EE\u5217\u8868"),r.a.createElement(j.a.Search,{value:Ft==null?void 0:Ft.save_search,placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0\u641C\u7D22",style:{width:178,marginLeft:"auto",marginRight:10},onChange:function(Yt){Ft.save_search=Yt.target.value,vn(Object(d.a)({},Ft))},onSearch:function(){Ft.page=1,Ft.search=Ft.save_search,vn(Object(d.a)({},Ft)),bn(Ft)}}),r.a.createElement(fe.a,{value:Ft==null?void 0:Ft.tag_discipline_id,style:{width:210},mode:"multiple",placeholder:"\u9009\u62E9\u77E5\u8BC6\u70B9",showSearch:!1,showArrow:!0,getPopupContainer:function(Yt){return Yt.parentNode},maxTagTextLength:2,maxTagCount:2,onChange:un},Tn.map(function(zt){return r.a.createElement(fe.a.Option,{key:zt.id,value:zt.id},zt.name)})),r.a.createElement(fe.a,{style:{width:70,marginLeft:10},allowClear:!0,placeholder:"\u96BE\u5EA6",getPopupContainer:function(Yt){return Yt.parentNode},value:Ft==null?void 0:Ft.difficulty,onChange:Sn},r.a.createElement(fe.a.Option,{value:1},"\u7B80\u5355"),r.a.createElement(fe.a.Option,{value:2},"\u9002\u4E2D"),r.a.createElement(fe.a.Option,{value:3},"\u56F0\u96BE"))),r.a.createElement("div",{className:Ar.a.content},r.a.createElement(z.a,{spinning:mr},rr==null||((Ht=rr[Ft.page-1])===null||Ht===void 0)?void 0:Ht.map(function(zt){return r.a.createElement("div",{key:zt.identifier,className:Ar.a.list,onClick:function(qt){return yn(zt.identifier,qt)}},r.a.createElement("i",{style:{visibility:Cn===zt.identifier?"visible":"hidden"},className:"iconfont icon-wancheng1 c-green-29b"}),r.a.createElement("span",{style:{fontWeight:Cn===zt.identifier?"bold":400,color:Cn===zt.identifier?"#ffffff":"#bac4cd"},title:zt==null?void 0:zt.name},zt.name),(zt==null?void 0:zt.difficulty)===1&&r.a.createElement("b",{style:{color:"#2FA34F"}},"\u7B80\u5355"),(zt==null?void 0:zt.difficulty)===2&&r.a.createElement("b",{style:{color:"#0152d9"}},"\u9002\u4E2D"),(zt==null?void 0:zt.difficulty)===3&&r.a.createElement("b",{style:{color:"#FA6400"}},"\u56F0\u96BE"))}))),r.a.createElement("div",{className:Ar.a.footer},r.a.createElement(Re.a,{showTotal:function(Yt){return r.a.createElement("span",{style:{color:"#656F87"}},"\u5171",r.a.createElement("span",{className:"c-light-primary"},Yt),"\u6761\u6570\u636E")},total:Ft.total,pageSize:Ft==null?void 0:Ft.per_page,current:Ft==null?void 0:Ft.page,showSizeChanger:!1,onChange:En,showQuickJumper:!0,hideOnSinglePage:!0})))},Hi=Ri,ri=function(ot){var St,Ht=ot.hack,ln=ot.onTriggerPraise,Hn=ot.topicId,Cn=ot.page,_t=ot.onPageChange,Lt=ot.user,gn=ot.submitRecords,bt=ot.submitting,cn=ot.submitResult,Ft=Object(w.h)(),vn=Object(_.useState)((Ft==null||((St=Ft.query)===null||St===void 0)?void 0:St.tab)||"0"),Vn=Object(N.a)(vn,2),Nn=Vn[0],Tn=Vn[1],Yn=Object(_.useState)(0),In=Object(N.a)(Yn,2),$n=In[0],rr=In[1],_r=Object(_.useState)(0),Bn=Object(N.a)(_r,2),gr=Bn[0],mr=Bn[1],sr=Object(_.useState)(0),Un=Object(N.a)(sr,2),Jn=Un[0],Xn=Un[1],Vt=Object(_.useState)(),Rn=Object(N.a)(Vt,2),cr=Rn[0],un=Rn[1],fn=Object(_.useState)(!1),Sn=Object(N.a)(fn,2),bn=Sn[0],yn=Sn[1];function En(Yt){var qt=Yt.target.id;if(Nn==="3"&&qt!==Nn&&(gr===1||gr===2)){W.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(){Tn(qt)}});return}Tn(qt)}Object(_.useEffect)(function(){var Yt=mt.a.subscribe("to-commit-info",function(){Tn("1")});return Yt},[]);function zt(){Tn("2")}return r.a.createElement("div",{className:ve.a["left-panel"]},r.a.createElement("ul",{className:"".concat(ve.a["s-navs"]," ").concat(ve.a["bg-white"]," ").concat(ve.a.b1)},r.a.createElement("li",{className:"mr40 current"},r.a.createElement("img",{onClick:function(){return yn(!0)},src:Je.a})),r.a.createElement("li",{className:ve.a["oj-mr"]},r.a.createElement("a",{className:Nn==="0"?ve.a.active:"",id:"0",onClick:En},"\u4EFB\u52A1\u63CF\u8FF0")),r.a.createElement("li",{className:ve.a["oj-mr"]},r.a.createElement("a",{className:Nn==="3"?ve.a.active:"",id:"3",onClick:En},"\u9898\u89E3",Jn?"(".concat(Jn,")"):"")),r.a.createElement("li",{className:ve.a["oj-mr"]},r.a.createElement("a",{className:Nn==="2"?ve.a.active:"",id:"2",onClick:En},"\u8BC4\u8BBA",$n?"(".concat($n,")"):"")),r.a.createElement("li",null,r.a.createElement("a",{className:Nn==="1"?ve.a.active:"",id:"1",onClick:En},"\u63D0\u4EA4\u8BB0\u5F55"))),r.a.createElement("div",{className:"".concat(ve.a["tab-panel-body"]," ").concat(Nn==="0"?"":"hide"),style:{padding:"0 0 0 16px"}},r.a.createElement(qe,{hack:Ht,onTriggerPraise:ln,toDiscuss:zt})),r.a.createElement("div",{className:"".concat(ve.a["tab-panel-body"]," ").concat(Nn==="1"?"":"hide")},gn!=null&&gn.records_count?r.a.createElement(Le,{page:Cn,onPageChange:_t,topicId:Hn,submitting:bt,submitRecords:gn,submitResult:cn}):r.a.createElement(le.a,null)),r.a.createElement("div",{className:"".concat(ve.a["tab-panel-body"]," ").concat(Nn==="2"?"":"hide"),style:{padding:0}},r.a.createElement(nn,{setDiscussTotal:rr,user:Lt,identifier:Ht.identifier,hack:Ht,onTriggerPraise:ln})),r.a.createElement("div",{className:"".concat(ve.a["tab-panel-body"]," ").concat(Nn==="3"?"":"hide"),style:{padding:0}},r.a.createElement(Rr,{setListStatus:mr,setFilterListTotal:Xn,tabStatus:Nn,identifier:Ht.identifier})),r.a.createElement(Hi,{visible:bn,setIndex:Tn,onVisible:function(qt){return yn(qt)},value:cr,onChange:function(qt){return un(qt)}}))},Ur=M("+aKw"),ci=M("oFv4"),ii=M.n(ci),$i=M("S/kP"),Ni=M.n($i),hi=M("t/PP"),ua=M.n(hi),hn=M("LvDl"),kn=M.n(hn),wn=M("P5Jw"),tr=s.a.Countdown,Gn={Java:"java",C:"c",Python:"py","C++":"c"},sn;(function(ot){ot[ot.SET_LOADING=0]="SET_LOADING",ot[ot.GET_DATA=1]="GET_DATA",ot[ot.GET_SUBMIT_RECORDS=2]="GET_SUBMIT_RECORDS",ot[ot.SET_DATA=3]="SET_DATA",ot[ot.SET_DEBUGING=4]="SET_DEBUGING",ot[ot.SET_SUBMITING=5]="SET_SUBMITING",ot[ot.SET_EXECUTE_MESSAGE=6]="SET_EXECUTE_MESSAGE",ot[ot.SET_EXECUTE_RESULT=7]="SET_EXECUTE_RESULT",ot[ot.SET_SUBMIT_RESULT=8]="SET_SUBMIT_RESULT",ot[ot.SET_SHOW_NOTE=9]="SET_SHOW_NOTE",ot[ot.SET_PAGE=10]="SET_PAGE",ot[ot.GET_LANGUAGE=11]="GET_LANGUAGE",ot[ot.GET_DRAWER=12]="GET_DRAWER"})(sn||(sn={}));function zn(){return new Date().getTime()}var Ir={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 Xr(ot,St){switch(St.type){case sn.GET_DATA:return Object(d.a)(Object(d.a)({},ot),St.payload);case sn.SET_DATA:return Object(d.a)(Object(d.a)({},ot),{},{data:St.payload});case sn.SET_LOADING:return Object(d.a)(Object(d.a)({},ot),{},{loading:St.payload});case sn.GET_LANGUAGE:return Object(d.a)(Object(d.a)({},ot),{},{languageList:St.payload});case sn.GET_DRAWER:return Object(d.a)(Object(d.a)({},ot),{},{drawerData:St.payload});case sn.SET_SHOW_NOTE:return Object(d.a)(Object(d.a)({},ot),{},{showNote:St.payload});case sn.SET_DEBUGING:return Object(d.a)(Object(d.a)({},ot),{},{debuging:St.payload});case sn.SET_SUBMITING:return Object(d.a)(Object(d.a)({},ot),{},{submitting:St.payload});case sn.GET_SUBMIT_RECORDS:return Object(d.a)(Object(d.a)({},ot),{},{submitRecords:St.payload});case sn.SET_PAGE:return Object(d.a)(Object(d.a)({},ot),{},{submitRecordPage:St.payload});case sn.SET_EXECUTE_MESSAGE:return Object(d.a)(Object(d.a)({},ot),{},{executingMessage:St.payload});case sn.SET_EXECUTE_RESULT:return Object(d.a)(Object(d.a)({},ot),St.payload);case sn.SET_SUBMIT_RESULT:return Object(d.a)(Object(d.a)({},ot),St.payload);default:throw new Error}}var nr=ce.default=function(ot){var St,Ht,ln=ot.children,Hn=Object(_.useReducer)(Xr,Ir),Cn=Object(N.a)(Hn,2),_t=Cn[0],Lt=Cn[1],gn=Object(w.i)(),bt=gn.id,cn=Object(w.g)(),Ft=Object(w.h)(),vn=_t.languageValue,Vn=_t.languageList,Nn=_t.loading,Tn=_t.data,Yn=_t.debugResult,In=_t.submitResult,$n=_t.submitRecords,rr=_t.submitRecordPage,_r=_t.showNote,Bn=_t.debuging,gr=_t.submitting,mr=_t.executingMessage,sr=Object(_.useState)("#FFF"),Un=Object(N.a)(sr,2),Jn=Un[0],Xn=Un[1],Vt=Object(_.useState)(null),Rn=Object(N.a)(Vt,2),cr=Rn[0],un=Rn[1],fn=Object(_.useState)({}),Sn=Object(N.a)(fn,2),bn=Sn[0],yn=Sn[1],En=Object(_.useState)(!1),zt=Object(N.a)(En,2),Yt=zt[0],qt=zt[1],tn=Object(_.useRef)(null),Kt=Object(_.useRef)(null),Zt=Tn==null?void 0:Tn.user,pn=Tn==null?void 0:Tn.hack;Object(_.useEffect)(function(){return Object(I.c)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!1}),Object(I.c)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),function(){Object(I.c)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!0}),Object(I.c)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!1})}},[]),Object(_.useEffect)(function(){setTimeout(function(){document.title="\u5728\u7EBF\u5237\u9898"},400)}),Object(_.useEffect)(function(){if(Yt){var jn,Dn=document.getElementById("oj-next"),ar=document.getElementById("oj-modal-next");(Dn==null||((jn=Dn.style)===null||jn===void 0)?void 0:jn.display)==="none"?ar.style.display="none":ar.style.display="block"}},[Yt]),Object(_.useEffect)(function(){function jn(){return Dn.apply(this,arguments)}function Dn(){return Dn=Object(D.a)(h.a.mark(function ar(){var en,Fn,wr,$r,jr;return h.a.wrap(function(xn){for(;;)switch(xn.prev=xn.next){case 0:return xn.next=2,Object(x.m)(bt);case 2:en=xn.sent,en.status===401?document.location.href="/user/login":(en.hack=en.practice,en.hack.code=C.Base64.decode(en==null||((Fn=en.hack)===null||Fn===void 0)?void 0:Fn.code),jr="".concat(Zt==null?void 0:Zt.login,"-language"),localStorage.getItem(jr)&&(en.hack.language=localStorage.getItem(jr)),Kt.current=kn.a.cloneDeep(en),Kt.current.language=en==null||((wr=en.hack)===null||wr===void 0)?void 0:wr.language,Lt({type:sn.GET_DATA,payload:{loading:!1,data:en}}),Lt({type:sn.SET_SUBMIT_RESULT,payload:{languageValue:en==null||(($r=en.hack)===null||$r===void 0)?void 0:$r.language}}));case 4:case"end":return xn.stop()}},ar)})),Dn.apply(this,arguments)}bt&&jn()},[bt]),Object(_.useEffect)(function(){Lt({type:sn.SET_SUBMIT_RESULT,payload:{debugResult:void 0}}),Yr(),qt(!1)},[bt]),Object(_.useEffect)(function(){clearTimeout(tn.current)},[bt]),Object(_.useEffect)(function(){kr()},[bt,rr]);var vr=function(){window.parent.postMessage("backExercise","*")};function kr(){return ai.apply(this,arguments)}function ai(){return ai=Object(D.a)(h.a.mark(function jn(){var Dn;return h.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return en.prev=0,en.next=3,Object(x.o)(bt,{limit:15,page:rr});case 3:Dn=en.sent,Lt({type:sn.GET_SUBMIT_RECORDS,payload:Dn}),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()}},jn,null,[[0,7]])})),ai.apply(this,arguments)}function Yr(){return Oi.apply(this,arguments)}function Oi(){return Oi=Object(D.a)(h.a.mark(function jn(){var Dn;return h.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return en.prev=0,en.next=3,Object(x.w)(bt);case 3:Dn=en.sent,Lt({type:sn.GET_LANGUAGE,payload:Dn==null?void 0:Dn.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()}},jn,null,[[0,7]])})),Oi.apply(this,arguments)}function pr(jn){Lt({type:sn.SET_PAGE,payload:jn})}function Ai(jn){return Fi.apply(this,arguments)}function Fi(){return Fi=Object(D.a)(h.a.mark(function jn(Dn){var ar,en,Fn,wr,$r,jr;return h.a.wrap(function(xn){for(;;)switch(xn.prev=xn.next){case 0:return $r=((ar=window)===null||ar===void 0||((en=ar.location)===null||en===void 0||((Fn=en.pathname)===null||Fn===void 0||((wr=Fn.split("/"))===null||wr===void 0)))?void 0:wr[2])||bt,xn.next=3,Object(x.v)($r,Dn||{code:C.Base64.encode(pn.code),language:vn});case 3:return jr=xn.sent,xn.abrupt("return",jr);case 5:case"end":return xn.stop()}},jn)})),Fi.apply(this,arguments)}function zi(){return ji.apply(this,arguments)}function ji(){return ji=Object(D.a)(h.a.mark(function jn(){var Dn,ar,en,Fn,wr,$r,jr;return h.a.wrap(function(xn){for(;;)switch(xn.prev=xn.next){case 0:if(!gr){xn.next=2;break}return xn.abrupt("return");case 2:return Lt({type:sn.SET_SUBMITING,payload:!0}),xn.prev=3,mt.a.publish("to-commit-info"),xn.next=7,Ai();case 7:if(Dn=xn.sent,!(Dn.status===0)){xn.next=21;break}return jr=function(){return jr=Object(D.a)(h.a.mark(function _a(){var Gi,Di,Pi,Qi,Vi,na;return h.a.wrap(function(ti){for(;;)switch(ti.prev=ti.next){case 0:return ti.next=2,Object(x.l)(bt,"submit");case 2:if(Gi=ti.sent,Di=Gi.status,Pi=Gi.data,Qi=zn(),Vi=Qi-wr>(Fn+3)*1e3,Di!==0&&!Vi&&setTimeout($r,1e3),!Vi){ti.next=12;break}return W.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),Lt({type:sn.SET_SUBMITING,payload:!1}),ti.abrupt("return");case 12:if(!(Di===0)){ti.next=19;break}return Pi.status===2&&W.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),ti.next=16,Object(x.o)(bt,{limit:15,page:rr});case 16:na=ti.sent,Lt({type:sn.SET_SUBMIT_RESULT,payload:Object(d.a)(Object(d.a)({},_t),{},{submitResult:Pi,submitting:!1,submitRecords:na})}),(Pi==null?void 0:Pi.status)===0&&qt(!0);case 19:case"end":return ti.stop()}},_a)})),jr.apply(this,arguments)},$r=function(){return jr.apply(this,arguments)},ar={},xn.next=14,Object(x.s)(bt,ar);case 14:if(en=xn.sent,!(en.status===-1)){xn.next=18;break}return window.parent.location.href="/classrooms/".concat(Ft.query.coursesId,"/exercise/").concat(Ft.query.exercisesId,"/detail"),xn.abrupt("return");case 18:Fn=pn.time_limit,wr=zn(),$r();case 21:xn.next=26;break;case 23:xn.prev=23,xn.t0=xn.catch(3),Lt({type:sn.SET_SUBMITING,payload:!1});case 26:case"end":return xn.stop()}},jn,null,[[3,23]])})),ji.apply(this,arguments)}function da(){return xi.apply(this,arguments)}function xi(){return xi=Object(D.a)(h.a.mark(function jn(){var Dn,ar,en,Fn,wr,$r,jr;return h.a.wrap(function(xn){for(;;)switch(xn.prev=xn.next){case 0:return _t.debuging=!0,Lt({type:sn.SET_DEBUGING,payload:!0}),xn.prev=2,xn.next=5,Ai();case 5:if(Dn=xn.sent,!(Dn.status===0)){xn.next=21;break}return jr=function(){return jr=Object(D.a)(h.a.mark(function _a(){var Gi,Di,Pi,Qi,Vi,na;return h.a.wrap(function(ti){for(;;)switch(ti.prev=ti.next){case 0:return ti.next=2,Object(x.l)(bt,"debug");case 2:if(Gi=ti.sent,Di=Gi.status,Pi=Gi.message,Qi=Gi.data,Vi=zn(),na=Vi-wr>(ar+3)*1e3,Di!==0&&!na&&(Lt({type:sn.SET_EXECUTE_MESSAGE,payload:Pi}),setTimeout($r,1e3)),!na){ti.next=13;break}return W.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),Lt({type:sn.SET_DEBUGING,payload:!1}),ti.abrupt("return");case 13:Di===0&&(Lt({type:sn.SET_DEBUGING,payload:!1}),Qi.status===2&&W.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),Lt({type:sn.SET_EXECUTE_RESULT,payload:Object(d.a)(Object(d.a)({},_t),{},{debugResult:Qi,debuging:!1})}));case 14:case"end":return ti.stop()}},_a)})),jr.apply(this,arguments)},$r=function(){return jr.apply(this,arguments)},ar=pn.time_limit,en={input:encodeURIComponent(Tn.test_case.input)},xn.next=13,Object(x.h)(bt,en);case 13:if(Fn=xn.sent,!(Fn.status===-1)){xn.next=17;break}return window.parent.location.href="/classrooms/".concat(Ft.query.coursesId,"/exercise/").concat(Ft.query.exercisesId,"/detail"),xn.abrupt("return");case 17:wr=zn(),$r(),xn.next=22;break;case 21:Lt({type:sn.SET_DEBUGING,payload:!1});case 22:xn.next=27;break;case 24:xn.prev=24,xn.t0=xn.catch(2),console.log(xn.t0);case 27:return xn.prev=27,xn.finish(27);case 29:case"end":return xn.stop()}},jn,null,[[2,24,27,29]])})),xi.apply(this,arguments)}function ea(jn){var Dn;clearTimeout(tn.current),tn.current=setTimeout(function(){var ar;Ai({code:C.Base64.encode(jn),language:Kt==null||((ar=Kt.current)===null||ar===void 0)?void 0:ar.language})},2e3),Lt({type:sn.SET_DATA,payload:Object(d.a)(Object(d.a)({},Kt==null?void 0:Kt.current),{},{hack:Object(d.a)(Object(d.a)({},Kt==null||((Dn=Kt.current)===null||Dn===void 0)?void 0:Dn.hack),{},{code:jn})})})}function Da(jn){var Dn=jn.target.value;Lt({type:sn.SET_DATA,payload:Object(d.a)(Object(d.a)({},Tn),{},{test_case:{input:Dn}})})}var yr=function(){var jn=Object(D.a)(h.a.mark(function Dn(ar){var en,Fn,wr,$r,jr;return h.a.wrap(function(xn){for(;;)switch(xn.prev=xn.next){case 0:return Lt({type:sn.SET_LOADING,payload:!0}),xn.next=3,Ai();case 3:if(en=xn.sent,!(en.status===0)){xn.next=14;break}return Lt({type:sn.SET_SUBMIT_RESULT,payload:{languageValue:ar}}),Kt.current.language=ar,Fn="".concat(Zt==null?void 0:Zt.login,"-language"),localStorage.setItem(Fn,ar),xn.next=11,Object(x.w)(bt);case 11:wr=xn.sent,wr.status===0&&(jr=wr==null||(($r=wr.data)===null||$r===void 0)?void 0:$r.find(function(ta){return ta.language===ar}),ea(C.Base64.decode(jr.code))),setTimeout(function(){Lt({type:sn.SET_LOADING,payload:!1})},300);case 14:case"end":return xn.stop()}},Dn)}));return function(ar){return jn.apply(this,arguments)}}();function Ln(){return Zn.apply(this,arguments)}function Zn(){return Zn=Object(D.a)(h.a.mark(function jn(){var Dn;return h.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return en.prev=0,en.next=3,Object(x.q)(bt,{language:vn});case 3:Dn=en.sent,Dn.status===401?cn.replace("/login",{from:Ft.pathname}):(ea(C.Base64.decode(Dn.code)),Yr()),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()}},jn,null,[[0,7]])})),Zn.apply(this,arguments)}function ir(){W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:r.a.createElement("p",null,"\u521D\u59CB\u4EE3\u7801\u6709\u4FEE\u6539\uFF0C\u66F4\u65B0\u540E\u5C06\u8986\u76D6\u73B0\u6709\u4EE3\u7801\u54E6~ ",r.a.createElement("br",null),"\u8BF7\u5C06\u60A8\u7F16\u8F91\u7684\u4EE3\u7801\u4FDD\u5B58\u81F3\u672C\u5730\uFF0C\u4EE5\u9632\u4E22\u5931"),onOk:function(){return Object(D.a)(h.a.mark(function Dn(){var ar;return h.a.wrap(function(Fn){for(;;)switch(Fn.prev=Fn.next){case 0:return Fn.next=2,Object(x.t)(bt,{language:vn});case 2:ar=Fn.sent,ar.status===401?cn.replace("/login",{from:Ft.pathname}):ea(C.Base64.decode(ar.code));case 4:case"end":return Fn.stop()}},Dn)}))()}})}function Hr(){Lt({type:sn.SET_SHOW_NOTE,payload:!0})}function qn(){Lt({type:sn.SET_SHOW_NOTE,payload:!1})}function Li(jn){return Ki.apply(this,arguments)}function Ki(){return Ki=Object(D.a)(h.a.mark(function jn(Dn){return h.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return en.next=2,Object(x.b)(bt,Dn);case 2:Lt({type:sn.GET_DATA,payload:{showNote:!1,data:Object(d.a)(Object(d.a)({},Tn),{},{hack:Object(d.a)(Object(d.a)({},pn),{},{notes:Dn.notes})})}});case 3:case"end":return en.stop()}},jn)})),Ki.apply(this,arguments)}var ei={input:Tn==null||((St=Tn.test_case)===null||St===void 0)?void 0:St.input,language:pn==null?void 0:pn.language,code:pn==null?void 0:pn.code,title:"main."+Gn[pn==null?void 0:pn.language],modify_code:pn==null?void 0:pn.modify_code,notes:pn==null?void 0:pn.notes,debugResult:Yn,debuging:Bn,submitting:gr,executingMessage:mr,id:bt,languageValue:vn,languageList:Vn,onChangeLanguage:yr,onCancelNote:qn,onAddNote:Li,showNote:_r,onShowNote:Hr,onSubmitCode:zi,onChangeCode:ea,onChangeInput:Da,onDebugCode:da,onResetCode:Ln,onSyncCode:ir,onUpdateCode:Ai};function Ii(){return Fr.apply(this,arguments)}function Fr(){return Fr=Object(D.a)(h.a.mark(function jn(){var Dn,ar,en;return h.a.wrap(function(wr){for(;;)switch(wr.prev=wr.next){case 0:return wr.next=2,Object(x.u)(pn.id,{container_type:"Hack",type:1});case 2:Dn=wr.sent,ar=Dn.praise_count,en=Object(d.a)(Object(d.a)({},Tn),{},{hack:Object(d.a)(Object(d.a)({},pn),{},{praises_count:ar,user_praise:!pn.user_praise})}),Lt({type:sn.SET_DATA,payload:en});case 6:case"end":return wr.stop()}},jn)})),Fr.apply(this,arguments)}var fi={topicId:bt,submitResult:In,submitRecords:$n,submitting:gr,page:rr,onPageChange:pr,hack:pn,user:Tn==null?void 0:Tn.user,onTriggerPraise:Ii};return console.log(Tn,Kt==null?void 0:Kt.current,"data--------"),r.a.createElement(r.a.Fragment,null,r.a.createElement(z.a,{className:"oj-custom-large-spin",size:"large",spinning:Nn},Tn?r.a.createElement("div",{className:"oj-custom-warp"},r.a.createElement("header",{className:i.a.header,style:{minWidth:1200}},r.a.createElement("div",null,r.a.createElement("img",{src:"".concat(T.a.IMG_SERVER,"/images/").concat(Zt.image_url),alt:"user",width:30}),r.a.createElement("span",null,Zt.name)),r.a.createElement("h2",{className:"flex-wrp flex_box_column flex_box_center"},r.a.createElement("div",null,pn.name),r.a.createElement(Ur.a,{onChange:function(Dn){},className:"font12 c-grey-999"})),r.a.createElement(wn.CopyToClipboard,{text:"".concat((Ht=window.location)===null||Ht===void 0?void 0:Ht.origin,"/problems/").concat(pn.identifier,"/share"),onCopy:function(){return B.b.success("\u590D\u5236\u9898\u76EE\u94FE\u63A5\u6210\u529F")}},r.a.createElement("span",{className:i.a.btn_back,style:{marginRight:10,cursor:"pointer"}}," ",r.a.createElement("i",{className:"iconfont icon-fenxiang1 font14 mr5"}),"\u5206\u4EAB\u9898\u76EE")),pn.edit_privilege?r.a.createElement(E.a,{className:i.a.btn_back,to:"/problems/".concat(pn.identifier,"/ojedit"),style:{marginRight:10}}," ",r.a.createElement(v.a,null)," \u7F16\u8F91"):null,r.a.createElement(E.a,{className:i.a.btn_back,onClick:function(){},to:"/problems"}," ",r.a.createElement(S.a,null),"\u9000\u51FA")),r.a.createElement(P.a,{hideResize:!0,className:"my-problems oj-problems",leftChild:r.a.createElement(ri,fi),rightChild:r.a.createElement(fr,ei)})):null),r.a.createElement(W.a,{centered:!0,closable:!1,width:680,footer:null,visible:Yt,className:"oj-modal"},r.a.createElement("section",{className:"oj-modal-content"},r.a.createElement("div",{className:"oj-modal-head"},r.a.createElement("img",{src:ii.a,alt:""}),r.a.createElement("i",{onClick:function(){return qt(!1)},className:"iconfont icon-guanbi1"})),r.a.createElement("aside",null,r.a.createElement("img",{className:"mr30",src:ua.a}),"\u8FD0\u884C\u65F6\u95F4:\xA0",r.a.createElement("span",{style:{color:"#75d6ba",marginRight:100}},In==null?void 0:In.execute_time,"s"),"\u4F18\u4E8E",r.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(In==null?void 0:In.time_better_than)||100,"%"),"\u7684\u7528\u6237"),r.a.createElement("aside",{className:"mb50"},r.a.createElement("img",{src:Ni.a,className:"mr30"}),r.a.createElement("span",{className:"oj-modal-tt"},r.a.createElement("span",null,r.a.createElement("span",null,"\u5360\u7528\u5185\u5B58:\xA0"),r.a.createElement("span",{className:"c-light-primary"},In==null?void 0:In.execute_memory,"mb")),r.a.createElement("span",null,r.a.createElement("span",null))),"\u4F18\u4E8E",r.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(In==null?void 0:In.memory_better_than)||100,"%"),"\u7684\u7528\u6237"),r.a.createElement("div",{id:"oj-modal-next",className:"oj-modal-btn"},"\u8FDB\u5165\u4E0B\u4E00\u9898"))))};function Ui(ot){var St=ot.languageValue,Ht=ot.languageList,ln=ot.onChangeLanguage,Hn=ot.title,Cn=ot.modify_code,_t=ot.onSyncCode,Lt=ot.onShowCodeSetting,gn=ot.onResetCode,bt=Object(w.h)(),cn=function(){W.a.confirm({title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",icon:r.a.createElement(A.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:gn})};return r.a.createElement("div",{className:"action-bar"},r.a.createElement(fe.a,{className:"oj-select",value:St,style:{width:100},placeholder:"\u9009\u62E9\u8BED\u8A00",onChange:ln},Ht==null?void 0:Ht.map(function(Ft){return r.a.createElement(fe.a.Option,{key:Ft.language,value:Ft.language},Ft.language)})),r.a.createElement("span",null),r.a.createElement("a",{title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",onClick:cn},r.a.createElement("i",{className:"iconfont icon-zhongzhi font-20 "})),r.a.createElement("a",{onClick:Lt},r.a.createElement("i",{className:"iconfont icon-shezhi"})))}function fr(ot){var St=ot.id,Ht=ot.input,ln=ot.showNote,Hn=ot.onShowNote,Cn=ot.notes,_t=ot.onCancelNote,Lt=ot.onAddNote,gn=ot.debugResult,bt=ot.language,cn=ot.debuging,Ft=ot.submitting,vn=ot.executingMessage,Vn=ot.code,Nn=ot.onSubmitCode,Tn=ot.onDebugCode,Yn=ot.onChangeCode,In=ot.onChangeInput,$n=ot.onUpdateCode,rr=Object(ue.a)(ot,["id","input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode"]);function _r(gr){return r.a.createElement(Ui,Object(q.a)({},rr,{onShowCodeSetting:gr}))}var Bn={id:St,input:Ht,debugResult:gn,debuging:cn,submitting:Ft,executingMessage:vn,onDebugCode:Tn,onChangeCode:Yn,onSubmitCode:Nn,onChangeInput:In};return r.a.createElement("div",{className:"right-panel"},r.a.createElement(b.a,{language:bt,value:Vn,onChange:Yn,ActionBarRender:_r}),r.a.createElement("div",{className:"note-form-area ".concat(ln?"active":"")},r.a.createElement(te,{onCancel:_t,notes:Cn,callback:Lt})),r.a.createElement(o.b,Bn))}},Wtmd:function(We,ce,M){We.exports=M.p+"static/c.449b07b7.svg"},Wx9E:function(We,ce,M){},YA0V:function(We,ce,M){"use strict";M.d(ce,"a",function(){return R});var q=M("T/Jt"),ue=M.n(q),re=M("Dpym"),fe=M("3GYr"),ae=M("0lMV");function z(B){var n=B.children,W=B.stickyOffsets,D=B.flattenColumns,N=q.useContext(re.a),d=N.prefixCls,m=D.length-1,s=D[m],g=q.useMemo(function(){return{stickyOffsets:W,flattenColumns:D,scrollColumnIndex:(s==null?void 0:s.scrollbar)?m:null}},[s,D,m,W]);return q.createElement(ae.a.Provider,{value:g},q.createElement("tfoot",{className:"".concat(d,"-summary")},n))}ce.b=z;var R=fe.a},YLkp:function(We,ce,M){"use strict";function q(ue){return null}ce.a=q},Z8dc:function(We,ce,M){We.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(We,ce,M){"use strict";var q=M("s2St"),ue=M("KUJN"),re=M("FrBR"),fe=M("SCzF"),ae=M("T/Jt"),z=M.n(ae),R=M("lOMy"),B=M.n(R),n=fe.a.Option;ce.a=function(W){var D=W.onFontSizeChange,N=W.cmFontSize,d=W.cmCodeMode,m=W.onCodeModeChange,s=W.onTabToSpace,g=W.className,h=g===void 0?"":g,_=W.tabToSpace,r=W.children;return z.a.createElement("div",{className:"tpi-code-setting ".concat(h)},z.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),z.a.createElement("section",null,z.a.createElement("div",{className:"file-item"},z.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),z.a.createElement(fe.a,{bordered:!1,size:"small",value:d,onChange:m},z.a.createElement(n,{value:"vs"},"\u767D\u8272\u80CC\u666F"),z.a.createElement(n,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),z.a.createElement("div",{className:"file-item"},z.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),z.a.createElement(fe.a,{bordered:!1,size:"small",value:N,onChange:D},z.a.createElement(n,{value:12},"12px"),z.a.createElement(n,{value:14},"14px"),z.a.createElement(n,{value:16},"16px"),z.a.createElement(n,{value:18},"18px"),z.a.createElement(n,{value:20},"20px"),z.a.createElement(n,{value:22},"22px"))),z.a.createElement("div",{className:"file-item"},z.a.createElement("b",null,"Tab\u8F6C\u6362"),z.a.createElement(ue.a,{checked:_,onChange:s}))),z.a.createElement("h3",null,"\u5FEB\u6377\u952E"),z.a.createElement("section",null,z.a.createElement("div",{className:"file-item"},z.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),z.a.createElement("span",null,"Ctrl + S")),z.a.createElement("div",{className:"file-item"},z.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),z.a.createElement("span",null,"F1 / Alt + F1")),z.a.createElement("div",{className:"file-item"},z.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),z.a.createElement("span",null,"Ctrl + ]/[")),z.a.createElement("div",{className:"file-item"},z.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),z.a.createElement("span",null,"Ctrl + Shift + \\")),z.a.createElement("div",{className:"file-item"},z.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),z.a.createElement("span",null,"Home")),z.a.createElement("div",{className:"file-item"},z.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),z.a.createElement("span",null,"End"))),r)}},ZW9T:function(We,ce,M){"use strict";M.d(ce,"a",function(){return y});var q=M("YaWb"),ue=M("nc60"),re=M("8OG5"),fe=M("mgsT"),ae=M("sh+1"),z=M("Hqw+"),R=M("ftSv"),B=M("T/Jt"),n=M.n(B),W=M("bdgK"),D=M("IYef"),N=M("XXmO"),d=M.n(N),m={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},s={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},g={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(`
`)}]},h={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(`
`)}]},_=M("5VLF"),r=M.n(_),v={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(F,j){return j.map(function(G){return{label:G,kind:F.languages.CompletionItemKind.Keyword,insertText:G}})},w=function(F){return Object.keys(v.tables).map(function(j){return{label:j,kind:F.languages.CompletionItemKind.Variable,insertText:j}})},I=function(F,j){var G=v.tables[F];return G?G.map(function(Y){return{label:Y,kind:j.languages.CompletionItemKind.Field,insertText:Y}}):[]};function E(l,F,j,G,Y){var te=F.getWordUntilPosition(j),de={startLineNumber:j.lineNumber,endLineNumber:j.lineNumber,startColumn:te.startColumn,endColumn:te.endColumn},ve=G.map(function(he){return{label:he,kind:l.languages.CompletionItemKind.Keyword,insertText:he,insertTextRules:l.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:de}});return Y.map(function(he){ve.push(Object(q.a)(Object(q.a)({},he),{},{range:de}))}),ve}var x=function(l){v.languages.map(function(Y){return l.languages.registerDocumentFormattingEditProvider(Y,{provideDocumentFormattingEdits:function(de,ve,he){return Object(D.a)(d.a.mark(function Re(){var we;return d.a.wrap(function(Ne){for(;;)switch(Ne.prev=Ne.next){case 0:return we=r()(de.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}),Ne.abrupt("return",[{range:de.getFullModelRange(),text:we}]);case 2:case"end":return Ne.stop()}},Re)}))()}}),Y});var F=g.quickKey.map(function(Y){return{label:Y.label,kind:l.languages.CompletionItemKind.Method,insertText:Y.content,insertTextRules:l.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),j=h.quickKey.map(function(Y){return{label:Y.label,kind:l.languages.CompletionItemKind.Method,insertText:Y.content,insertTextRules:l.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),G=s.quickKey.map(function(Y){return{label:Y.label,kind:l.languages.CompletionItemKind.Method,insertText:Y.content,insertTextRules:l.languages.CompletionItemInsertTextRule.InsertAsSnippet}});l.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(te,de){var ve=te.getWordUntilPosition(de),he={startLineNumber:de.lineNumber,endLineNumber:de.lineNumber,startColumn:ve.startColumn,endColumn:ve.endColumn},Re=te.getLineContent(de.lineNumber).substring(ve.startColumn-2,ve.endColumn);return{suggestions:[].concat(Object(ue.a)(g.keywords.map(function(we){return{label:we,kind:l.languages.CompletionItemKind.Function,documentation:we,insertText:we,insertTextRules:l.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:he}})),Object(ue.a)(g.quickKey.map(function(we){return{label:we.label,kind:l.languages.CompletionItemKind.Function,documentation:we.content,insertText:Re.startsWith("#")?we.content.replace(/#/,""):we.content,insertTextRules:l.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:he}})))}}}),l.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(te,de){var ve=te.getWordUntilPosition(de),he={startLineNumber:de.lineNumber,endLineNumber:de.lineNumber,startColumn:ve.startColumn,endColumn:ve.endColumn};return{suggestions:Object(ue.a)(m.keywords.map(function(Re){return{label:Re,kind:l.languages.CompletionItemKind.Function,documentation:Re,insertText:Re,insertTextRules:l.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:he}}))}}}),l.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(te,de){var ve=te.getWordUntilPosition(de),he={startLineNumber:de.lineNumber,endLineNumber:de.lineNumber,startColumn:ve.startColumn,endColumn:ve.endColumn},Re=te.getLineContent(de.lineNumber).substring(ve.startColumn-2,ve.endColumn);return{suggestions:[].concat(Object(ue.a)(s.keywords.map(function(we){return{label:we,kind:l.languages.CompletionItemKind.Function,documentation:we,insertText:we,insertTextRules:l.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:he}})),Object(ue.a)(s.quickKey.map(function(we){return{label:we.label,kind:l.languages.CompletionItemKind.Function,documentation:we.content,insertText:Re.startsWith("#")?we.content.replace(/#/,""):we.content,insertTextRules:l.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:he}})))}}}),l.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(te,de){var ve=te.getWordUntilPosition(de),he={startLineNumber:de.lineNumber,endLineNumber:de.lineNumber,startColumn:ve.startColumn,endColumn:ve.endColumn},Re=te.getLineContent(de.lineNumber).substring(ve.startColumn-2,ve.endColumn);return{suggestions:[].concat(Object(ue.a)(h.keywords.map(function(we){return{label:we,kind:l.languages.CompletionItemKind.Function,documentation:we,insertText:we,insertTextRules:l.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:he}})),Object(ue.a)(h.quickKey.map(function(we){return{label:we.label,kind:l.languages.CompletionItemKind.Function,documentation:we.content,insertText:Re.startsWith("#")?we.content.replace(/#/,""):we.content,insertTextRules:l.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:he}})))}}})},P="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",T=M("fjLI"),A=M("LvDl"),b=M("+ua5");function C(l){return/^\d+$/.test(l)?"".concat(l,"px"):l}function p(){}var i=!1,f={"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 o(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],F=l;if(Array.isArray(l)){for(var j=0;j<l.length;j++){var G=f[l[j]];if(G)return G}return F[0]}return f[F]||F}var a=null,L=ce.b=function(l){var F=l.width,j=F===void 0?"100%":F,G=l.height,Y=G===void 0?"100%":G,te=l.value,de=l.language,ve=de===void 0?"javascript":de,he=l.style,Re=he===void 0?{}:he,we=l.options,ge=we===void 0?{}:we,Ne=l.overrideServices,ze=Ne===void 0?{}:Ne,nt=l.theme,Ge=nt===void 0?"vs-dark":nt,Xe=l.onEditBlur,Be=l.onSave,_e=l.autoHeight,Ze=_e===void 0?!1:_e,be=l.forbidCopy,Le=be===void 0?!1:be,le=l.onChange,ye=le===void 0?p:le,Te=l.editorDidMount,Pe=Te===void 0?p:Te,He=l.onFocus,Ye=He===void 0?p:He,ct=l.filename,st=ct===void 0?"educoder.txt":ct,vt=l.errorLine,qe=l.errorContent,mt=qe===void 0?"":qe,yt=Object(R.a)(l,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),Je=Object(B.useRef)(),et=Object(B.useRef)({}),De=Object(B.useRef)(),ke=Object(B.useRef)(),Me=Object(B.useRef)(!1),me=Object(B.useRef)(),Ce=Object(B.useState)(!1),Oe=Object(z.a)(Ce,2),Se=Oe[0],Fe=Oe[1];function it(){var At;return Je.current&&(At=new W.a(function(jt){var on=Object(ae.a)(jt),Ee;try{for(on.s();!(Ee=on.n()).done;){var se=Ee.value;(se.target.offsetHeight>0||se.target.offsetWidth>0)&&et.current.instance.layout()}}catch(H){on.e(H)}finally{on.f()}}),At.observe(Je.current)),At}function Ie(){fe.b.warn(decodeURIComponent(P))}var Qe=function(){var jt=et.current.instance;if(te!=null&&jt&&Se){var on=jt.getModel();on&&te!==on.getValue()&&(i=!0,on.setValue(te),jt.layout(),i=!1)}};Object(B.useEffect)(function(){ke.current&&clearTimeout(ke.current),ke.current=setTimeout(function(){Qe()},500)},[te,Se,et.current]),Object(B.useEffect)(function(){if(vt&&et.current&&et.current.instance){var At=et.current.instance;At.changeViewZones(function(on){var Ee=document.createElement("div");Ee.style.padding="10px 20px",Ee.style.width="calc(100% - 20px)",Ee.className="my-error-line-wrp",Ee.innerHTML=mt,on.addZone({afterLineNumber:vt||11,heightInLines:3,domNode:Ee})});var jt={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}};At.addOverlayWidget(jt),At.revealPositionInCenter({lineNumber:20,column:1})}},[vt,et.current,Se]);function rt(){var At=et.current.instance;if(At){var jt=At.getSelection(),on=et.current.pastePos||{},Ee=new a.Range(on.startLineNumber||jt.endLineNumber,on.startColumn||jt.endColumn,on.endLineNumber||jt.endLineNumber,on.endColumn||jt.endColumn);setTimeout(function(){At.executeEdits("",[{range:Ee,text:""}])},300)}}function ft(At){(window.navigator.platform.match("Mac")?At.metaKey:At.ctrlKey)&&At.keyCode==83&&(At.preventDefault(),Be())}var It=function(){if(Ze&&et.current.instance){var jt=et.current.instance.getContentHeight();An(jt<Y?Y:jt)}else An(Y)};function Tt(At){var jt=document.createEvent("MouseEvents");jt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),At.dispatchEvent(jt)}function Et(At,jt){var on=window.URL||window.webkitURL||window,Ee=new Blob([jt]),se=document.createElementNS("http://www.w3.org/1999/xhtml","a");se.href=on.createObjectURL(Ee),se.download=At,Tt(se)}Object(B.useEffect)(function(){It()},[It]),Object(B.useEffect)(function(){Je.current&&!Se&&M.e(26).then(M.t.bind(null,"M/lh",7)).then(function(At){try{a=At,et.current.instance=a.editor.create(Je.current,{value:te,language:o(ve),theme:Ge,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},ze);var jt=et.current.instance,on=T.d._menuItems,Ee=Object(ue.a)(on).find(function(ee){return ee[0]._debugName=="EditorContext"}),se=Ee[1],H=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],V=function(xe,Ue){var $e=xe._first;do{var pt,xt,Ve=Ue.includes((pt=$e.element)===null||pt===void 0||((xt=pt.command)===null||xt===void 0)?void 0:xt.id);Ve&&xe._remove($e)}while($e=$e.next)};if(Pe(jt,a),setTimeout(function(){It(),et.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Et(st||"educoder.txt",jt.getValue())}}),jt.getDomNode().addEventListener("input",function(){De.current.autoFormat&&jt.getAction("editor.action.formatDocument").run()})},500),et.current.subscription=jt.onDidChangeModelContent(function(ee){Me.current?clearTimeout(me.current):(It(),ye(jt.getValue(),ee)),me.current=setTimeout(function(){Me.current=!1},500)}),window.Monaco||x(a,o(ve)),Le&&(V(se,H),Je.current.classList.add("noCopyPaste"),jt.onKeyDown(function(ee){var xe=ee.keyCode,Ue=ee.ctrlKey,$e=ee.metaKey;(xe===33||xe===52)&&($e||Ue)&&(Ie(),ee.preventDefault())})),window.Monaco=a,Xe&&jt.onDidBlurEditorWidget(function(){Xe(jt.getValue())}),Ye&&jt.onDidFocusEditorText(function(){Ye(jt.getValue())}),Le){jt.addCommand(a.KeyMod.CtrlCmd|a.KeyCode.KEY_V,function(){return Ie(),null}),jt.onDidPaste(function(ee){et.current.pastePos=ee});try{window.addEventListener("paste",rt)}catch(ee){}}var $=it();return Fe(!0),function(){var ee=et.current.instance;ee.dispose();var xe=ee.getModel();xe&&xe.dispose(),et.current.subscription&&et.current.subscription.dispose(),Le&&window.removeEventListener("paste",rt),$.unobserve(Je.current)}}catch(ee){}})},[]),Object(B.useEffect)(function(){var At=et.current.instance;if(At&&Se)return document.addEventListener("keydown",ft,!1),function(){document.removeEventListener("keydown",ft)}},[Be,Se]),Object(B.useEffect)(function(){var At=et.current.instance;if(At&&Se){var jt=o(ve);a.editor.setModelLanguage(At.getModel(),jt),console.log("language:",ve,At.getModel(),jt)}},[ve,Se]),Object(B.useEffect)(function(){var At=et.current.instance;At&&Se&&a.editor.setTheme(Ge)},[Ge,Se]),Object(B.useEffect)(function(){var At=et.current.instance;De.current=ge,At&&Se&&(At.updateOptions(Object(q.a)({},ge)),setTimeout(function(){At.getModel().updateOptions(Object(q.a)({},ge))},200))},[JSON.stringify(ge),Se]),Object(B.useEffect)(function(){var At=et.current.instance;At&&Se&&At.layout()},[j,Y,Se]);var Ct=Object(B.useState)(C(j)),dt=Object(z.a)(Ct,2),Nt=dt[0],Xt=dt[1],Dt=Object(B.useState)(C(Y)),an=Object(z.a)(Dt,2),nn=an[0],An=an[1],_n=Object(q.a)(Object(q.a)({},Re),{},{width:Nt,height:nn});return n.a.createElement("div",{className:"my-monaco-editor",ref:Je,style:_n})};function y(l){var F=l.width,j=F===void 0?"100%":F,G=l.height,Y=G===void 0?"100%":G,te=l.original,de=l.modified,ve=l.language,he=l.options,Re=he===void 0?{}:he,we=Object(B.useRef)(),ge=Object(B.useState)(null),Ne=Object(z.a)(ge,2),ze=Ne[0],nt=Ne[1];function Ge(Ze){var be;return we.current&&(be=new W.a(function(Le){var le=Object(ae.a)(Le),ye;try{for(le.s();!(ye=le.n()).done;){var Te=ye.value;(Te.target.offsetHeight>0||Te.target.offsetWidth>0)&&Ze.layout()}}catch(Pe){le.e(Pe)}finally{le.f()}}),be.observe(we.current)),be}Object(B.useEffect)(function(){we.current&&M.e(26).then(M.t.bind(null,"M/lh",7)).then(function(Ze){a=Ze;var be=a.editor.createDiffEditor(we.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},Re),{},{wordWrap:!0}));nt(be);var Le=Ge(be);return function(){be.dispose();var le=be.getModel();le&&le.dispose(),Le.unobserve(we.current)}})},[]),Object(B.useEffect)(function(){ze&&ze.setModel({original:a.editor.createModel(te,ve),modified:a.editor.createModel(de,ve)})},[te,de,ve,ze]);var Xe=C(j),Be=C(Y),_e={width:Xe,height:Be};return n.a.createElement("div",{className:"my-diff-editor",ref:we,style:_e})}},Zaiq:function(We,ce,M){"use strict";M.d(ce,"a",function(){return x.a});var q=M("yuO0"),ue=M("XjgL"),re=M("kxoy"),fe=M("6ASS"),ae=M("aVTQ"),z=M("eA01"),R=M("fXDJ"),B=M("fhFH"),n=M("BPTR"),W=M("udol"),D=M("27eb"),N=M.n(D),d=M("sg8A"),m=M("E0BR"),s=M("B/uU"),g=M("T/Jt"),h=M("c27x");function _(Ge){var Xe=Ge.dropPosition,Be=Ge.dropLevelOffset,_e=Ge.indent,Ze={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(Xe){case-1:Ze.top=0,Ze.left=-Be*_e;break;case 1:Ze.bottom=0,Ze.left=-Be*_e;break;case 0:Ze.bottom=0,Ze.left=_e;break}return g.createElement("div",{style:Ze})}function r(Ge){if(Ge==null)throw new TypeError("Cannot destructure "+Ge)}var v=M("36hc"),S=M("fNpE"),w=M("s7W6"),I=M("JTpS"),E=M("J5No"),x=M("0pdE");function P(Ge,Xe){var Be=g.useState(!1),_e=Object(v.a)(Be,2),Ze=_e[0],be=_e[1];g.useLayoutEffect(function(){if(Ze)return Ge(),function(){Xe()}},[Ze]),g.useLayoutEffect(function(){return be(!0),function(){be(!1)}},[])}var T=M("rgEC"),A=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],b=function(Xe,Be){var _e=Xe.className,Ze=Xe.style,be=Xe.motion,Le=Xe.motionNodes,le=Xe.motionType,ye=Xe.onMotionStart,Te=Xe.onMotionEnd,Pe=Xe.active,He=Xe.treeNodeRequiredProps,Ye=Object(S.a)(Xe,A),ct=g.useState(!0),st=Object(v.a)(ct,2),vt=st[0],qe=st[1],mt=g.useContext(h.a),yt=mt.prefixCls,Je=Le&&le!=="hide";Object(w.a)(function(){Le&&(Je!==vt&&qe(Je))},[Le]);var et=function(){Le&&ye()},De=g.useRef(!1),ke=function(){Le&&!De.current&&(De.current=!0,Te())};P(et,ke);var Me=function(Ce){Je===Ce&&ke()};return Le?g.createElement(E.default,Object(q.a)({ref:Be,visible:vt},be,{motionAppear:le==="show",onVisibleChanged:Me}),function(me,Ce){var Oe=me.className,Se=me.style;return g.createElement("div",{ref:Ce,className:N()("".concat(yt,"-treenode-motion"),Oe),style:Se},Le.map(function(Fe){var it=Object(q.a)({},(r(Fe.data),Fe.data)),Ie=Fe.title,Qe=Fe.key,rt=Fe.isStart,ft=Fe.isEnd;delete it.children;var It=Object(T.g)(Qe,He);return g.createElement(x.a,Object(q.a)({},it,It,{title:Ie,active:Pe,data:Fe.data,key:Qe,isStart:rt,isEnd:ft}))}))}):g.createElement(x.a,Object(q.a)({domRef:Be,className:_e,style:Ze},Ye,{active:Pe}))};b.displayName="MotionTreeNode";var C=g.forwardRef(b),p=C;function i(){var Ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Be=Ge.length,_e=Xe.length;if(Math.abs(Be-_e)!==1)return{add:!1,key:null};function Ze(be,Le){var le=new Map;be.forEach(function(Te){le.set(Te,!0)});var ye=Le.filter(function(Te){return!le.has(Te)});return ye.length===1?ye[0]:null}return Be<_e?{add:!0,key:Ze(Ge,Xe)}:{add:!1,key:Ze(Xe,Ge)}}function f(Ge,Xe,Be){var _e=Ge.findIndex(function(le){return le.key===Be}),Ze=Ge[_e+1],be=Xe.findIndex(function(le){return le.key===Be});if(Ze){var Le=Xe.findIndex(function(le){return le.key===Ze.key});return Xe.slice(be+1,Le)}return Xe.slice(be+1)}var o=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],a={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},L=function(){},y="RC_TREE_MOTION_".concat(Math.random()),l={key:y},F={key:y,level:0,index:0,pos:"0",node:l,nodes:[l]},j={parent:null,children:[],pos:F.pos,data:l,title:null,key:y,isStart:[],isEnd:[]};function G(Ge,Xe,Be,_e){return Xe===!1||!Be?Ge:Ge.slice(0,Math.ceil(Be/_e)+1)}function Y(Ge){var Xe=Ge.key,Be=Ge.pos;return Object(T.f)(Xe,Be)}function te(Ge){for(var Xe=String(Ge.data.key),Be=Ge;Be.parent;)Be=Be.parent,Xe="".concat(Be.data.key," > ").concat(Xe);return Xe}var de=g.forwardRef(function(Ge,Xe){var Be=Ge.prefixCls,_e=Ge.data,Ze=Ge.selectable,be=Ge.checkable,Le=Ge.expandedKeys,le=Ge.selectedKeys,ye=Ge.checkedKeys,Te=Ge.loadedKeys,Pe=Ge.loadingKeys,He=Ge.halfCheckedKeys,Ye=Ge.keyEntities,ct=Ge.disabled,st=Ge.dragging,vt=Ge.dragOverNodeKey,qe=Ge.dropPosition,mt=Ge.motion,yt=Ge.height,Je=Ge.itemHeight,et=Ge.virtual,De=Ge.focusable,ke=Ge.activeItem,Me=Ge.focused,me=Ge.tabIndex,Ce=Ge.onKeyDown,Oe=Ge.onFocus,Se=Ge.onBlur,Fe=Ge.onActiveChange,it=Ge.onListChangeStart,Ie=Ge.onListChangeEnd,Qe=Object(S.a)(Ge,o),rt=g.useRef(null),ft=g.useRef(null);g.useImperativeHandle(Xe,function(){return{scrollTo:function(xt){rt.current.scrollTo(xt)},getIndentWidth:function(){return ft.current.offsetWidth}}});var It=g.useState(Le),Tt=Object(v.a)(It,2),Et=Tt[0],Ct=Tt[1],dt=g.useState(_e),Nt=Object(v.a)(dt,2),Xt=Nt[0],Dt=Nt[1],an=g.useState(_e),nn=Object(v.a)(an,2),An=nn[0],_n=nn[1],At=g.useState([]),jt=Object(v.a)(At,2),on=jt[0],Ee=jt[1],se=g.useState(null),H=Object(v.a)(se,2),V=H[0],$=H[1],ee=g.useRef(_e);ee.current=_e;function xe(){var pt=ee.current;Dt(pt),_n(pt),Ee([]),$(null),Ie()}Object(w.a)(function(){Ct(Le);var pt=i(Et,Le);if(pt.key!==null)if(pt.add){var xt=Xt.findIndex(function(Wt){var Bt=Wt.key;return Bt===pt.key}),Ve=G(f(Xt,_e,pt.key),et,yt,Je),ht=Xt.slice();ht.splice(xt+1,0,j),_n(ht),Ee(Ve),$("show")}else{var Rt=_e.findIndex(function(Wt){var Bt=Wt.key;return Bt===pt.key}),lt=G(f(_e,Xt,pt.key),et,yt,Je),Pt=_e.slice();Pt.splice(Rt+1,0,j),_n(Pt),Ee(lt),$("hide")}else Xt!==_e&&(Dt(_e),_n(_e))},[Le,_e]),g.useEffect(function(){st||xe()},[st]);var Ue=mt?An:_e,$e={expandedKeys:Le,selectedKeys:le,loadedKeys:Te,loadingKeys:Pe,checkedKeys:ye,halfCheckedKeys:He,dragOverNodeKey:vt,dropPosition:qe,keyEntities:Ye};return g.createElement(g.Fragment,null,Me&&ke&&g.createElement("span",{style:a,"aria-live":"assertive"},te(ke)),g.createElement("div",null,g.createElement("input",{style:a,disabled:De===!1||ct,tabIndex:De!==!1?me:null,onKeyDown:Ce,onFocus:Oe,onBlur:Se,value:"",onChange:L,"aria-label":"for screen reader"})),g.createElement("div",{className:"".concat(Be,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},g.createElement("div",{className:"".concat(Be,"-indent")},g.createElement("div",{ref:ft,className:"".concat(Be,"-indent-unit")}))),g.createElement(I.a,Object(q.a)({},Qe,{data:Ue,itemKey:Y,height:yt,fullHeight:!1,virtual:et,itemHeight:Je,prefixCls:"".concat(Be,"-list"),ref:rt,onVisibleChange:function(xt,Ve){var ht=new Set(xt),Rt=Ve.filter(function(lt){return!ht.has(lt)});Rt.some(function(lt){return Y(lt)===y})&&xe()}}),function(pt){var xt=pt.pos,Ve=Object(q.a)({},(r(pt.data),pt.data)),ht=pt.title,Rt=pt.key,lt=pt.isStart,Pt=pt.isEnd,Wt=Object(T.f)(Rt,xt);delete Ve.key,delete Ve.children;var Bt=Object(T.g)(Wt,$e);return g.createElement(p,Object(q.a)({},Ve,Bt,{title:ht,active:!!ke&&Rt===ke.key,pos:xt,data:pt.data,isStart:lt,isEnd:Pt,motion:mt,motionNodes:Rt===y?on:null,motionType:V,onMotionStart:it,onMotionEnd:xe,treeNodeRequiredProps:$e,onMouseMove:function(){Fe(null)}}))}))});de.displayName="NodeList";var ve=de,he=M("ju+a"),Re=M("vqdp"),we=M("El5i"),ge=10,Ne=function(Ge){Object(n.a)(Be,Ge);var Xe=Object(W.a)(Be);function Be(){var _e;Object(z.a)(this,Be);for(var Ze=arguments.length,be=new Array(Ze),Le=0;Le<Ze;Le++)be[Le]=arguments[Le];return _e=Xe.call.apply(Xe,[this].concat(be)),_e.destroyed=!1,_e.delayedDragEnterLogic=void 0,_e.loadingRetryTimes={},_e.state={keyEntities:{},indent:null,selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],draggingNodeKey:null,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null,fieldNames:Object(T.d)()},_e.dragStartMousePosition=null,_e.dragNode=void 0,_e.currentMouseOverDroppableNodeKey=null,_e.listRef=g.createRef(),_e.onNodeDragStart=function(le,ye){var Te=_e.state,Pe=Te.expandedKeys,He=Te.keyEntities,Ye=_e.props.onDragStart,ct=ye.props.eventKey;_e.dragNode=ye,_e.dragStartMousePosition={x:le.clientX,y:le.clientY};var st=Object(he.b)(Pe,ct);_e.setState({draggingNodeKey:ct,dragChildrenKeys:Object(he.f)(ct,He),indent:_e.listRef.current.getIndentWidth()}),_e.setExpandedKeys(st),window.addEventListener("dragend",_e.onWindowDragEnd),Ye==null||Ye({event:le,node:Object(T.b)(ye.props)})},_e.onNodeDragEnter=function(le,ye){var Te=_e.state,Pe=Te.expandedKeys,He=Te.keyEntities,Ye=Te.dragChildrenKeys,ct=Te.flattenNodes,st=Te.indent,vt=_e.props,qe=vt.onDragEnter,mt=vt.onExpand,yt=vt.allowDrop,Je=vt.direction,et=ye.props,De=et.pos,ke=et.eventKey,Me=Object(B.a)(_e),me=Me.dragNode;if(_e.currentMouseOverDroppableNodeKey!==ke&&(_e.currentMouseOverDroppableNodeKey=ke),!me){_e.resetDragState();return}var Ce=Object(he.c)(le,me,ye,st,_e.dragStartMousePosition,yt,ct,He,Pe,Je),Oe=Ce.dropPosition,Se=Ce.dropLevelOffset,Fe=Ce.dropTargetKey,it=Ce.dropContainerKey,Ie=Ce.dropTargetPos,Qe=Ce.dropAllowed,rt=Ce.dragOverNodeKey;if(Ye.indexOf(Fe)!==-1||!Qe){_e.resetDragState();return}if(_e.delayedDragEnterLogic||(_e.delayedDragEnterLogic={}),Object.keys(_e.delayedDragEnterLogic).forEach(function(ft){clearTimeout(_e.delayedDragEnterLogic[ft])}),me.props.eventKey!==ye.props.eventKey&&(le.persist(),_e.delayedDragEnterLogic[De]=window.setTimeout(function(){if(_e.state.draggingNodeKey===null)return;var ft=Object(ae.a)(Pe),It=Object(we.a)(He,ye.props.eventKey);It&&(It.children||[]).length&&(ft=Object(he.a)(Pe,ye.props.eventKey)),"expandedKeys"in _e.props||_e.setExpandedKeys(ft),mt==null||mt(ft,{node:Object(T.b)(ye.props),expanded:!0,nativeEvent:le.nativeEvent})},800)),me.props.eventKey===Fe&&Se===0){_e.resetDragState();return}_e.setState({dragOverNodeKey:rt,dropPosition:Oe,dropLevelOffset:Se,dropTargetKey:Fe,dropContainerKey:it,dropTargetPos:Ie,dropAllowed:Qe}),qe==null||qe({event:le,node:Object(T.b)(ye.props),expandedKeys:Pe})},_e.onNodeDragOver=function(le,ye){var Te=_e.state,Pe=Te.dragChildrenKeys,He=Te.flattenNodes,Ye=Te.keyEntities,ct=Te.expandedKeys,st=Te.indent,vt=_e.props,qe=vt.onDragOver,mt=vt.allowDrop,yt=vt.direction,Je=Object(B.a)(_e),et=Je.dragNode;if(!et)return;var De=Object(he.c)(le,et,ye,st,_e.dragStartMousePosition,mt,He,Ye,ct,yt),ke=De.dropPosition,Me=De.dropLevelOffset,me=De.dropTargetKey,Ce=De.dropContainerKey,Oe=De.dropAllowed,Se=De.dropTargetPos,Fe=De.dragOverNodeKey;if(Pe.indexOf(me)!==-1||!Oe)return;et.props.eventKey===me&&Me===0?_e.state.dropPosition===null&&_e.state.dropLevelOffset===null&&_e.state.dropTargetKey===null&&_e.state.dropContainerKey===null&&_e.state.dropTargetPos===null&&_e.state.dropAllowed===!1&&_e.state.dragOverNodeKey===null||_e.resetDragState():ke===_e.state.dropPosition&&Me===_e.state.dropLevelOffset&&me===_e.state.dropTargetKey&&Ce===_e.state.dropContainerKey&&Se===_e.state.dropTargetPos&&Oe===_e.state.dropAllowed&&Fe===_e.state.dragOverNodeKey||_e.setState({dropPosition:ke,dropLevelOffset:Me,dropTargetKey:me,dropContainerKey:Ce,dropTargetPos:Se,dropAllowed:Oe,dragOverNodeKey:Fe}),qe==null||qe({event:le,node:Object(T.b)(ye.props)})},_e.onNodeDragLeave=function(le,ye){_e.currentMouseOverDroppableNodeKey===ye.props.eventKey&&!le.currentTarget.contains(le.relatedTarget)&&(_e.resetDragState(),_e.currentMouseOverDroppableNodeKey=null);var Te=_e.props.onDragLeave;Te==null||Te({event:le,node:Object(T.b)(ye.props)})},_e.onWindowDragEnd=function(le){_e.onNodeDragEnd(le,null,!0),window.removeEventListener("dragend",_e.onWindowDragEnd)},_e.onNodeDragEnd=function(le,ye){var Te=_e.props.onDragEnd;_e.setState({dragOverNodeKey:null}),_e.cleanDragState(),Te==null||Te({event:le,node:Object(T.b)(ye.props)}),_e.dragNode=null,window.removeEventListener("dragend",_e.onWindowDragEnd)},_e.onNodeDrop=function(le,ye){var Te,Pe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,He=_e.state,Ye=He.dragChildrenKeys,ct=He.dropPosition,st=He.dropTargetKey,vt=He.dropTargetPos,qe=He.dropAllowed;if(!qe)return;var mt=_e.props.onDrop;if(_e.setState({dragOverNodeKey:null}),_e.cleanDragState(),st===null)return;var yt=Object(fe.a)(Object(fe.a)({},Object(T.g)(st,_e.getTreeNodeRequiredProps())),{},{active:((Te=_e.getActiveItem())===null||Te===void 0?void 0:Te.key)===st,data:Object(we.a)(_e.state.keyEntities,st).node}),Je=Ye.indexOf(st)!==-1;Object(s.a)(!Je,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var et=Object(he.h)(vt),De={event:le,node:Object(T.b)(yt),dragNode:_e.dragNode?Object(T.b)(_e.dragNode.props):null,dragNodesKeys:[_e.dragNode.props.eventKey].concat(Ye),dropToGap:ct!==0,dropPosition:ct+Number(et[et.length-1])};Pe||(mt==null||mt(De)),_e.dragNode=null},_e.cleanDragState=function(){var le=_e.state.draggingNodeKey;le!==null&&_e.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),_e.dragStartMousePosition=null,_e.currentMouseOverDroppableNodeKey=null},_e.triggerExpandActionExpand=function(le,ye){var Te=_e.state,Pe=Te.expandedKeys,He=Te.flattenNodes,Ye=ye.expanded,ct=ye.key,st=ye.isLeaf;if(st||le.shiftKey||le.metaKey||le.ctrlKey)return;var vt=He.filter(function(mt){return mt.key===ct})[0],qe=Object(T.b)(Object(fe.a)(Object(fe.a)({},Object(T.g)(ct,_e.getTreeNodeRequiredProps())),{},{data:vt.data}));_e.setExpandedKeys(Ye?Object(he.b)(Pe,ct):Object(he.a)(Pe,ct)),_e.onNodeExpand(le,qe)},_e.onNodeClick=function(le,ye){var Te=_e.props,Pe=Te.onClick,He=Te.expandAction;He==="click"&&_e.triggerExpandActionExpand(le,ye),Pe==null||Pe(le,ye)},_e.onNodeDoubleClick=function(le,ye){var Te=_e.props,Pe=Te.onDoubleClick,He=Te.expandAction;He==="doubleClick"&&_e.triggerExpandActionExpand(le,ye),Pe==null||Pe(le,ye)},_e.onNodeSelect=function(le,ye){var Te=_e.state.selectedKeys,Pe=_e.state,He=Pe.keyEntities,Ye=Pe.fieldNames,ct=_e.props,st=ct.onSelect,vt=ct.multiple,qe=ye.selected,mt=ye[Ye.key],yt=!qe;yt?vt?Te=Object(he.a)(Te,mt):Te=[mt]:Te=Object(he.b)(Te,mt);var Je=Te.map(function(et){var De=Object(we.a)(He,et);return De?De.node:null}).filter(function(et){return et});_e.setUncontrolledState({selectedKeys:Te}),st==null||st(Te,{event:"select",selected:yt,node:ye,selectedNodes:Je,nativeEvent:le.nativeEvent})},_e.onNodeCheck=function(le,ye,Te){var Pe=_e.state,He=Pe.keyEntities,Ye=Pe.checkedKeys,ct=Pe.halfCheckedKeys,st=_e.props,vt=st.checkStrictly,qe=st.onCheck,mt=ye.key,yt,Je={event:"check",node:ye,checked:Te,nativeEvent:le.nativeEvent};if(vt){var et=Te?Object(he.a)(Ye,mt):Object(he.b)(Ye,mt),De=Object(he.b)(ct,mt);yt={checked:et,halfChecked:De},Je.checkedNodes=et.map(function(Se){return Object(we.a)(He,Se)}).filter(function(Se){return Se}).map(function(Se){return Se.node}),_e.setUncontrolledState({checkedKeys:et})}else{var ke=Object(Re.a)([].concat(Object(ae.a)(Ye),[mt]),!0,He),Me=ke.checkedKeys,me=ke.halfCheckedKeys;if(!Te){var Ce=new Set(Me);Ce.delete(mt);var Oe=Object(Re.a)(Array.from(Ce),{checked:!1,halfCheckedKeys:me},He);Me=Oe.checkedKeys,me=Oe.halfCheckedKeys}yt=Me,Je.checkedNodes=[],Je.checkedNodesPositions=[],Je.halfCheckedKeys=me,Me.forEach(function(Se){var Fe=Object(we.a)(He,Se);if(!Fe)return;var it=Fe.node,Ie=Fe.pos;Je.checkedNodes.push(it),Je.checkedNodesPositions.push({node:it,pos:Ie})}),_e.setUncontrolledState({checkedKeys:Me},!1,{halfCheckedKeys:me})}qe==null||qe(yt,Je)},_e.onNodeLoad=function(le){var ye=le.key,Te=new Promise(function(Pe,He){_e.setState(function(Ye){var ct=Ye.loadedKeys,st=ct===void 0?[]:ct,vt=Ye.loadingKeys,qe=vt===void 0?[]:vt,mt=_e.props,yt=mt.loadData,Je=mt.onLoad;if(!yt||st.indexOf(ye)!==-1||qe.indexOf(ye)!==-1)return null;var et=yt(le);return et.then(function(){var De=_e.state.loadedKeys,ke=Object(he.a)(De,ye);Je==null||Je(ke,{event:"load",node:le}),_e.setUncontrolledState({loadedKeys:ke}),_e.setState(function(Me){return{loadingKeys:Object(he.b)(Me.loadingKeys,ye)}}),Pe()}).catch(function(De){if(_e.setState(function(Me){return{loadingKeys:Object(he.b)(Me.loadingKeys,ye)}}),_e.loadingRetryTimes[ye]=(_e.loadingRetryTimes[ye]||0)+1,_e.loadingRetryTimes[ye]>=ge){var ke=_e.state.loadedKeys;Object(s.a)(!1,"Retry for `loadData` many times but still failed. No more retry."),_e.setUncontrolledState({loadedKeys:Object(he.a)(ke,ye)}),Pe()}He(De)}),{loadingKeys:Object(he.a)(qe,ye)}})});return Te.catch(function(){}),Te},_e.onNodeMouseEnter=function(le,ye){var Te=_e.props.onMouseEnter;Te==null||Te({event:le,node:ye})},_e.onNodeMouseLeave=function(le,ye){var Te=_e.props.onMouseLeave;Te==null||Te({event:le,node:ye})},_e.onNodeContextMenu=function(le,ye){var Te=_e.props.onRightClick;Te&&(le.preventDefault(),Te({event:le,node:ye}))},_e.onFocus=function(){var le=_e.props.onFocus;_e.setState({focused:!0});for(var ye=arguments.length,Te=new Array(ye),Pe=0;Pe<ye;Pe++)Te[Pe]=arguments[Pe];le==null||le.apply(void 0,Te)},_e.onBlur=function(){var le=_e.props.onBlur;_e.setState({focused:!1}),_e.onActiveChange(null);for(var ye=arguments.length,Te=new Array(ye),Pe=0;Pe<ye;Pe++)Te[Pe]=arguments[Pe];le==null||le.apply(void 0,Te)},_e.getTreeNodeRequiredProps=function(){var le=_e.state,ye=le.expandedKeys,Te=le.selectedKeys,Pe=le.loadedKeys,He=le.loadingKeys,Ye=le.checkedKeys,ct=le.halfCheckedKeys,st=le.dragOverNodeKey,vt=le.dropPosition,qe=le.keyEntities;return{expandedKeys:ye||[],selectedKeys:Te||[],loadedKeys:Pe||[],loadingKeys:He||[],checkedKeys:Ye||[],halfCheckedKeys:ct||[],dragOverNodeKey:st,dropPosition:vt,keyEntities:qe}},_e.setExpandedKeys=function(le){var ye=_e.state,Te=ye.treeData,Pe=ye.fieldNames,He=Object(T.e)(Te,le,Pe);_e.setUncontrolledState({expandedKeys:le,flattenNodes:He},!0)},_e.onNodeExpand=function(le,ye){var Te=_e.state.expandedKeys,Pe=_e.state,He=Pe.listChanging,Ye=Pe.fieldNames,ct=_e.props,st=ct.onExpand,vt=ct.loadData,qe=ye.expanded,mt=ye[Ye.key];if(He)return;var yt=Te.indexOf(mt),Je=!qe;if(Object(s.a)(qe&&yt!==-1||!qe&&yt===-1,"Expand state not sync with index check"),Je?Te=Object(he.a)(Te,mt):Te=Object(he.b)(Te,mt),_e.setExpandedKeys(Te),st==null||st(Te,{node:ye,expanded:Je,nativeEvent:le.nativeEvent}),Je&&vt){var et=_e.onNodeLoad(ye);et&&et.then(function(){var De=Object(T.e)(_e.state.treeData,Te,Ye);_e.setUncontrolledState({flattenNodes:De})}).catch(function(){var De=_e.state.expandedKeys,ke=Object(he.b)(De,mt);_e.setExpandedKeys(ke)})}},_e.onListChangeStart=function(){_e.setUncontrolledState({listChanging:!0})},_e.onListChangeEnd=function(){setTimeout(function(){_e.setUncontrolledState({listChanging:!1})})},_e.onActiveChange=function(le){var ye=_e.state.activeKey,Te=_e.props.onActiveChange;if(ye===le)return;_e.setState({activeKey:le}),le!==null&&_e.scrollTo({key:le}),Te==null||Te(le)},_e.getActiveItem=function(){var le=_e.state,ye=le.activeKey,Te=le.flattenNodes;return ye===null?null:Te.find(function(Pe){var He=Pe.key;return He===ye})||null},_e.offsetActiveKey=function(le){var ye=_e.state,Te=ye.flattenNodes,Pe=ye.activeKey,He=Te.findIndex(function(st){var vt=st.key;return vt===Pe});He===-1&&le<0&&(He=Te.length),He=(He+le+Te.length)%Te.length;var Ye=Te[He];if(Ye){var ct=Ye.key;_e.onActiveChange(ct)}else _e.onActiveChange(null)},_e.onKeyDown=function(le){var ye=_e.state,Te=ye.activeKey,Pe=ye.expandedKeys,He=ye.checkedKeys,Ye=ye.fieldNames,ct=_e.props,st=ct.onKeyDown,vt=ct.checkable,qe=ct.selectable;switch(le.which){case d.a.UP:{_e.offsetActiveKey(-1),le.preventDefault();break}case d.a.DOWN:{_e.offsetActiveKey(1),le.preventDefault();break}}var mt=_e.getActiveItem();if(mt&&mt.data){var yt=_e.getTreeNodeRequiredProps(),Je=mt.data.isLeaf===!1||!!(mt.data[Ye.children]||[]).length,et=Object(T.b)(Object(fe.a)(Object(fe.a)({},Object(T.g)(Te,yt)),{},{data:mt.data,active:!0}));switch(le.which){case d.a.LEFT:{Je&&Pe.includes(Te)?_e.onNodeExpand({},et):mt.parent&&_e.onActiveChange(mt.parent.key),le.preventDefault();break}case d.a.RIGHT:{Je&&!Pe.includes(Te)?_e.onNodeExpand({},et):mt.children&&mt.children.length&&_e.onActiveChange(mt.children[0].key),le.preventDefault();break}case d.a.ENTER:case d.a.SPACE:{vt&&!et.disabled&&et.checkable!==!1&&!et.disableCheckbox?_e.onNodeCheck({},et,!He.includes(Te)):!vt&&qe&&!et.disabled&&et.selectable!==!1&&_e.onNodeSelect({},et);break}}}st==null||st(le)},_e.setUncontrolledState=function(le){var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!_e.destroyed){var Pe=!1,He=!0,Ye={};Object.keys(le).forEach(function(ct){if(ct in _e.props){He=!1;return}Pe=!0,Ye[ct]=le[ct]}),Pe&&(!ye||He)&&_e.setState(Object(fe.a)(Object(fe.a)({},Ye),Te))}},_e.scrollTo=function(le){_e.listRef.current.scrollTo(le)},_e}return Object(R.a)(Be,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var Ze=this.props.activeKey;Ze!==void 0&&Ze!==this.state.activeKey&&(this.setState({activeKey:Ze}),Ze!==null&&this.scrollTo({key:Ze}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var Ze,be=this.state,Le=be.focused,le=be.flattenNodes,ye=be.keyEntities,Te=be.draggingNodeKey,Pe=be.activeKey,He=be.dropLevelOffset,Ye=be.dropContainerKey,ct=be.dropTargetKey,st=be.dropPosition,vt=be.dragOverNodeKey,qe=be.indent,mt=this.props,yt=mt.prefixCls,Je=mt.className,et=mt.style,De=mt.showLine,ke=mt.focusable,Me=mt.tabIndex,me=Me===void 0?0:Me,Ce=mt.selectable,Oe=mt.showIcon,Se=mt.icon,Fe=mt.switcherIcon,it=mt.draggable,Ie=mt.checkable,Qe=mt.checkStrictly,rt=mt.disabled,ft=mt.motion,It=mt.loadData,Tt=mt.filterTreeNode,Et=mt.height,Ct=mt.itemHeight,dt=mt.virtual,Nt=mt.titleRender,Xt=mt.dropIndicatorRender,Dt=mt.onContextMenu,an=mt.onScroll,nn=mt.direction,An=mt.rootClassName,_n=mt.rootStyle,At=Object(m.a)(this.props,{aria:!0,data:!0}),jt;return it&&(Object(re.a)(it)==="object"?jt=it:typeof it=="function"?jt={nodeDraggable:it}:jt={}),g.createElement(h.a.Provider,{value:{prefixCls:yt,selectable:Ce,showIcon:Oe,icon:Se,switcherIcon:Fe,draggable:jt,draggingNodeKey:Te,checkable:Ie,checkStrictly:Qe,disabled:rt,keyEntities:ye,dropLevelOffset:He,dropContainerKey:Ye,dropTargetKey:ct,dropPosition:st,dragOverNodeKey:vt,indent:qe,direction:nn,dropIndicatorRender:Xt,loadData:It,filterTreeNode:Tt,titleRender:Nt,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},g.createElement("div",{role:"tree",className:N()(yt,Je,An,(Ze={},Object(ue.a)(Ze,"".concat(yt,"-show-line"),De),Object(ue.a)(Ze,"".concat(yt,"-focused"),Le),Object(ue.a)(Ze,"".concat(yt,"-active-focused"),Pe!==null),Ze)),style:_n},g.createElement(ve,Object(q.a)({ref:this.listRef,prefixCls:yt,style:et,data:le,disabled:rt,selectable:Ce,checkable:!!Ie,motion:ft,dragging:Te!==null,height:Et,itemHeight:Ct,virtual:dt,focusable:ke,focused:Le,tabIndex:me,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:Dt,onScroll:an},this.getTreeNodeRequiredProps(),At))))}}],[{key:"getDerivedStateFromProps",value:function(Ze,be){var Le=be.prevProps,le={prevProps:Ze};function ye(ke){return!Le&&ke in Ze||Le&&Le[ke]!==Ze[ke]}var Te,Pe=be.fieldNames;if(ye("fieldNames")&&(Pe=Object(T.d)(Ze.fieldNames),le.fieldNames=Pe),ye("treeData")?Te=Ze.treeData:ye("children")&&(Object(s.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),Te=Object(T.c)(Ze.children)),Te){le.treeData=Te;var He=Object(T.a)(Te,{fieldNames:Pe});le.keyEntities=Object(fe.a)(Object(ue.a)({},y,F),He.keyEntities)}var Ye=le.keyEntities||be.keyEntities;if(ye("expandedKeys")||Le&&ye("autoExpandParent"))le.expandedKeys=Ze.autoExpandParent||!Le&&Ze.defaultExpandParent?Object(he.e)(Ze.expandedKeys,Ye):Ze.expandedKeys;else if(!Le&&Ze.defaultExpandAll){var ct=Object(fe.a)({},Ye);delete ct[y],le.expandedKeys=Object.keys(ct).map(function(ke){return ct[ke].key})}else!Le&&Ze.defaultExpandedKeys&&(le.expandedKeys=Ze.autoExpandParent||Ze.defaultExpandParent?Object(he.e)(Ze.defaultExpandedKeys,Ye):Ze.defaultExpandedKeys);if(le.expandedKeys||delete le.expandedKeys,Te||le.expandedKeys){var st=Object(T.e)(Te||be.treeData,le.expandedKeys||be.expandedKeys,Pe);le.flattenNodes=st}if(Ze.selectable&&(ye("selectedKeys")?le.selectedKeys=Object(he.d)(Ze.selectedKeys,Ze):!Le&&Ze.defaultSelectedKeys&&(le.selectedKeys=Object(he.d)(Ze.defaultSelectedKeys,Ze))),Ze.checkable){var vt;if(ye("checkedKeys")?vt=Object(he.g)(Ze.checkedKeys)||{}:!Le&&Ze.defaultCheckedKeys?vt=Object(he.g)(Ze.defaultCheckedKeys)||{}:Te&&(vt=Object(he.g)(Ze.checkedKeys)||{checkedKeys:be.checkedKeys,halfCheckedKeys:be.halfCheckedKeys}),vt){var qe=vt,mt=qe.checkedKeys,yt=mt===void 0?[]:mt,Je=qe.halfCheckedKeys,et=Je===void 0?[]:Je;if(!Ze.checkStrictly){var De=Object(Re.a)(yt,!0,Ye);yt=De.checkedKeys,et=De.halfCheckedKeys}le.checkedKeys=yt,le.halfCheckedKeys=et}}return ye("loadedKeys")&&(le.loadedKeys=Ze.loadedKeys),le}}]),Be}(g.Component);Ne.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:_,allowDrop:function(){return!0},expandAction:!1},Ne.TreeNode=x.a;var ze=Ne,nt=ce.b=ze},ZsLC:function(We,ce,M){We.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"}},a3WO:function(We,ce,M){"use strict";M.d(ce,"a",function(){return q});function q(ue,re){(re==null||re>ue.length)&&(re=ue.length);for(var fe=0,ae=new Array(re);fe<re;fe++)ae[fe]=ue[fe];return ae}},b3aT:function(We,ce,M){"use strict";M.d(ce,"a",function(){return q}),M.d(ce,"b",function(){return ae}),M.d(ce,"c",function(){return z}),M.d(ce,"d",function(){return R});function q(B,n){re(B)&&(B="100%");var W=fe(B);return B=n===360?B:Math.min(n,Math.max(0,parseFloat(B))),W&&(B=parseInt(String(B*n),10)/100),Math.abs(B-n)<1e-6?1:(n===360?B=(B<0?B%n+n:B%n)/parseFloat(String(n)):B=B%n/parseFloat(String(n)),B)}function ue(B){return Math.min(1,Math.max(0,B))}function re(B){return typeof B=="string"&&B.indexOf(".")!==-1&&parseFloat(B)===1}function fe(B){return typeof B=="string"&&B.indexOf("%")!==-1}function ae(B){return B=parseFloat(B),(isNaN(B)||B<0||B>1)&&(B=1),B}function z(B){return B<=1?"".concat(Number(B)*100,"%"):B}function R(B){return B.length===1?"0"+B:String(B)}},bCnd:function(We,ce,M){"use strict";M.d(ce,"b",function(){return fe}),M.d(ce,"a",function(){return ae});var q=M("je13"),ue=M.n(q),re=!1;function fe(z,R){var B=ue.a.get("__ec");B||(B={}),B[z]=R,ue.a.set("__ec",B)}function ae(z,R){var B=ue.a.get("__ec");return B?B[z]===void 0?R:B[z]:R}},bdLU:function(We,ce,M){"use strict";M.d(ce,"a",function(){return q});var q;(function(ue){ue[ue.NOMATCH=-1]="NOMATCH",ue[ue.OK=0]="OK",ue[ue.TIMEOUT=2]="TIMEOUT",ue[ue.PODFAILURE=3]="PODFAILURE",ue[ue.COMPILEFAILURE=4]="COMPILEFAILURE",ue[ue.EXECUTEFAILURE=5]="EXECUTEFAILURE"})(q||(q={}))},bdgK:function(We,ce,M){"use strict";(function(q){var ue=function(){if(typeof Map!="undefined")return Map;function p(i,f){var o=-1;return i.some(function(a,L){return a[0]===f?(o=L,!0):!1}),o}return function(){function i(){this.__entries__=[]}return Object.defineProperty(i.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),i.prototype.get=function(f){var o=p(this.__entries__,f),a=this.__entries__[o];return a&&a[1]},i.prototype.set=function(f,o){var a=p(this.__entries__,f);~a?this.__entries__[a][1]=o:this.__entries__.push([f,o])},i.prototype.delete=function(f){var o=this.__entries__,a=p(o,f);~a&&o.splice(a,1)},i.prototype.has=function(f){return!!~p(this.__entries__,f)},i.prototype.clear=function(){this.__entries__.splice(0)},i.prototype.forEach=function(f,o){o===void 0&&(o=null);for(var a=0,L=this.__entries__;a<L.length;a++){var y=L[a];f.call(o,y[1],y[0])}},i}()}(),re=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,fe=function(){return typeof q!="undefined"&&q.Math===Math?q:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),ae=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(fe):function(p){return setTimeout(function(){return p(Date.now())},1e3/60)}}(),z=2;function R(p,i){var f=!1,o=!1,a=0;function L(){f&&(f=!1,p()),o&&l()}function y(){ae(L)}function l(){var F=Date.now();if(f){if(F-a<z)return;o=!0}else f=!0,o=!1,setTimeout(y,i);a=F}return l}var B=20,n=["top","right","bottom","left","width","height","size","weight"],W=typeof MutationObserver!="undefined",D=function(){function p(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=R(this.refresh.bind(this),B)}return p.prototype.addObserver=function(i){~this.observers_.indexOf(i)||this.observers_.push(i),this.connected_||this.connect_()},p.prototype.removeObserver=function(i){var f=this.observers_,o=f.indexOf(i);~o&&f.splice(o,1),!f.length&&this.connected_&&this.disconnect_()},p.prototype.refresh=function(){var i=this.updateObservers_();i&&this.refresh()},p.prototype.updateObservers_=function(){var i=this.observers_.filter(function(f){return f.gatherActive(),f.hasActive()});return i.forEach(function(f){return f.broadcastActive()}),i.length>0},p.prototype.connect_=function(){if(!re||this.connected_)return;document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),W?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0},p.prototype.disconnect_=function(){if(!re||!this.connected_)return;document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1},p.prototype.onTransitionEnd_=function(i){var f=i.propertyName,o=f===void 0?"":f,a=n.some(function(L){return!!~o.indexOf(L)});a&&this.refresh()},p.getInstance=function(){return this.instance_||(this.instance_=new p),this.instance_},p.instance_=null,p}(),N=function(p,i){for(var f=0,o=Object.keys(i);f<o.length;f++){var a=o[f];Object.defineProperty(p,a,{value:i[a],enumerable:!1,writable:!1,configurable:!0})}return p},d=function(p){var i=p&&p.ownerDocument&&p.ownerDocument.defaultView;return i||fe},m=E(0,0,0,0);function s(p){return parseFloat(p)||0}function g(p){for(var i=[],f=1;f<arguments.length;f++)i[f-1]=arguments[f];return i.reduce(function(o,a){var L=p["border-"+a+"-width"];return o+s(L)},0)}function h(p){for(var i=["top","right","bottom","left"],f={},o=0,a=i;o<a.length;o++){var L=a[o],y=p["padding-"+L];f[L]=s(y)}return f}function _(p){var i=p.getBBox();return E(0,0,i.width,i.height)}function r(p){var i=p.clientWidth,f=p.clientHeight;if(!i&&!f)return m;var o=d(p).getComputedStyle(p),a=h(o),L=a.left+a.right,y=a.top+a.bottom,l=s(o.width),F=s(o.height);if(o.boxSizing==="border-box"&&(Math.round(l+L)!==i&&(l-=g(o,"left","right")+L),Math.round(F+y)!==f&&(F-=g(o,"top","bottom")+y)),!S(p)){var j=Math.round(l+L)-i,G=Math.round(F+y)-f;Math.abs(j)!==1&&(l-=j),Math.abs(G)!==1&&(F-=G)}return E(a.left,a.top,l,F)}var v=function(){return typeof SVGGraphicsElement!="undefined"?function(p){return p instanceof d(p).SVGGraphicsElement}:function(p){return p instanceof d(p).SVGElement&&typeof p.getBBox=="function"}}();function S(p){return p===d(p).document.documentElement}function w(p){return re?v(p)?_(p):r(p):m}function I(p){var i=p.x,f=p.y,o=p.width,a=p.height,L=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,y=Object.create(L.prototype);return N(y,{x:i,y:f,width:o,height:a,top:f,right:i+o,bottom:a+f,left:i}),y}function E(p,i,f,o){return{x:p,y:i,width:f,height:o}}var x=function(){function p(i){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=E(0,0,0,0),this.target=i}return p.prototype.isActive=function(){var i=w(this.target);return this.contentRect_=i,i.width!==this.broadcastWidth||i.height!==this.broadcastHeight},p.prototype.broadcastRect=function(){var i=this.contentRect_;return this.broadcastWidth=i.width,this.broadcastHeight=i.height,i},p}(),P=function(){function p(i,f){var o=I(f);N(this,{target:i,contentRect:o})}return p}(),T=function(){function p(i,f,o){if(this.activeObservations_=[],this.observations_=new ue,typeof i!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=i,this.controller_=f,this.callbackCtx_=o}return p.prototype.observe=function(i){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element=="undefined"||!(Element instanceof Object))return;if(!(i instanceof d(i).Element))throw new TypeError('parameter 1 is not of type "Element".');var f=this.observations_;if(f.has(i))return;f.set(i,new x(i)),this.controller_.addObserver(this),this.controller_.refresh()},p.prototype.unobserve=function(i){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element=="undefined"||!(Element instanceof Object))return;if(!(i instanceof d(i).Element))throw new TypeError('parameter 1 is not of type "Element".');var f=this.observations_;if(!f.has(i))return;f.delete(i),f.size||this.controller_.removeObserver(this)},p.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},p.prototype.gatherActive=function(){var i=this;this.clearActive(),this.observations_.forEach(function(f){f.isActive()&&i.activeObservations_.push(f)})},p.prototype.broadcastActive=function(){if(!this.hasActive())return;var i=this.callbackCtx_,f=this.activeObservations_.map(function(o){return new P(o.target,o.broadcastRect())});this.callback_.call(i,f,i),this.clearActive()},p.prototype.clearActive=function(){this.activeObservations_.splice(0)},p.prototype.hasActive=function(){return this.activeObservations_.length>0},p}(),A=typeof WeakMap!="undefined"?new WeakMap:new ue,b=function(){function p(i){if(!(this instanceof p))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var f=D.getInstance(),o=new T(i,f,this);A.set(this,o)}return p}();["observe","unobserve","disconnect"].forEach(function(p){b.prototype[p]=function(){var i;return(i=A.get(this))[p].apply(i,arguments)}});var C=function(){return typeof fe.ResizeObserver!="undefined"?fe.ResizeObserver:b}();ce.a=C}).call(this,M("IGO8"))},c27x:function(We,ce,M){"use strict";M.d(ce,"a",function(){return re});var q=M("T/Jt"),ue=M.n(q),re=q.createContext(null)},c5Ni:function(We,ce,M){},cDPC:function(We,ce,M){"use strict";var q=M("Hqw+"),ue=M("T/Jt"),re=M.n(ue),fe=M("i3hx"),ae=M.n(fe);ce.a=function(z){var R=z.defaultX,B=R===void 0?"40%":R,n=z.leftChild,W=z.rightChild,D=z.className,N=z.hideResize,d=N===void 0?!1:N,m=Object(ue.useState)(B),s=Object(q.a)(m,2),g=s[0],h=s[1],_=Object(ue.useRef)();function r(){_.current=!0}Object(ue.useEffect)(function(){function w(E){_.current&&h(E.pageX)}function I(){_.current=!1}return window.addEventListener("mousemove",w),window.addEventListener("mouseup",I),function(){window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",I)}},[]);var v=typeof g=="number"&&g!==.01?"".concat(g,"px"):B,S="calc(100% - ".concat(d?"0px":"4px"," - ").concat(v,")");return re.a.createElement("div",{className:"split-panel-container ".concat(D)},re.a.createElement("section",{style:{width:v,display:g===.01?"none":""}},n),re.a.createElement("section",{className:"resize-x-bar",onMouseDown:r},re.a.createElement("a",{className:"btn-resize"},re.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},re.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"})))),re.a.createElement("section",{style:{width:S}},W))}},dejd:function(We,ce,M){},fcyK:function(We,ce,M){},fjLI:function(We,ce,M){"use strict";M.d(ce,"f",function(){return d}),M.d(ce,"b",function(){return m}),M.d(ce,"a",function(){return s}),M.d(ce,"d",function(){return g}),M.d(ce,"e",function(){return h}),M.d(ce,"c",function(){return _});var q=M("8HAY"),ue=M("Vhoy"),re=M("MI8n"),fe=M("JYp7"),ae=M("pmY6"),z=M("24hK"),R=M("nnTU"),B=M("T8No"),n=M("Cg/j"),W=M("t9D7"),D=function(r,v,S,w){var I=arguments.length,E=I<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,S):w,x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(r,v,S,w);else for(var P=r.length-1;P>=0;P--)(x=r[P])&&(E=(I<3?x(E):I>3?x(v,S,E):x(v,S))||E);return I>3&&E&&Object.defineProperty(v,S,E),E},N=function(r,v){return function(S,w){v(S,w,r)}};function d(r){return r.command!==void 0}class m{constructor(r){this.id=m._idPool++,this._debugName=r}}m._idPool=0,m.CommandPalette=new m("CommandPalette"),m.EditorContext=new m("EditorContext"),m.SimpleEditorContext=new m("SimpleEditorContext"),m.EditorContextCopy=new m("EditorContextCopy"),m.EditorContextPeek=new m("EditorContextPeek"),m.MenubarEditMenu=new m("MenubarEditMenu"),m.MenubarCopy=new m("MenubarCopy"),m.MenubarGoMenu=new m("MenubarGoMenu"),m.MenubarSelectionMenu=new m("MenubarSelectionMenu"),m.InlineCompletionsActions=new m("InlineCompletionsActions");const s=Object(n.c)("menuService"),g=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new re.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:r=>r===m.CommandPalette}}addCommand(r){return this.addCommands(fe.a.single(r))}addCommands(r){for(const v of r)this._commands.set(v.id,v);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(ae.i)(()=>{let v=!1;for(const S of r)v=this._commands.delete(S.id)||v;v&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(r){return this._commands.get(r)}getCommands(){const r=new Map;return this._commands.forEach((v,S)=>r.set(S,v)),r}appendMenuItem(r,v){return this.appendMenuItems(fe.a.single({id:r,item:v}))}appendMenuItems(r){const v=new Set,S=new z.a;for(const{id:w,item:I}of r){let E=this._menuItems.get(w);E||(E=new z.a,this._menuItems.set(w,E)),S.push(E.push(I)),v.add(w)}return this._onDidChangeMenu.fire(v),Object(ae.i)(()=>{if(S.size>0){for(let w of S)w();this._onDidChangeMenu.fire(v),S.clear()}})}getMenuItems(r){let v;return this._menuItems.has(r)?v=[...this._menuItems.get(r)]:v=[],r===m.CommandPalette&&this._appendImplicitItems(v),v}_appendImplicitItems(r){const v=new Set;for(const S of r)d(S)&&(v.add(S.command.id),S.alt&&v.add(S.alt.id));this._commands.forEach((S,w)=>{v.has(w)||r.push({command:S})})}};class h extends q.e{constructor(r,v,S,w){super(`submenuitem.${r.submenu.id}`,typeof r.title=="string"?r.title:r.title.value,[],"submenu");this.item=r,this._menuService=v,this._contextKeyService=S,this._options=w}get actions(){const r=[],v=this._menuService.createMenu(this.item.submenu,this._contextKeyService),S=v.getActions(this._options);v.dispose();for(const[,w]of S)w.length>0&&(r.push(...w),r.push(new q.d));return r.length&&r.pop(),r}}let _=class r{constructor(v,S,w,I,E){var x,P;if(this._commandService=E,this.id=v.id,this.label=(w==null?void 0:w.renderShortTitle)&&v.shortTitle?typeof v.shortTitle=="string"?v.shortTitle:v.shortTitle.value:typeof v.title=="string"?v.title:v.title.value,this.tooltip=(P=typeof v.tooltip=="string"?v.tooltip:(x=v.tooltip)===null||x===void 0?void 0:x.value)!==null&&P!==void 0?P:"",this.enabled=!v.precondition||I.contextMatchesRules(v.precondition),this.checked=void 0,v.toggled){const T=v.toggled.condition?v.toggled:{condition:v.toggled};this.checked=I.contextMatchesRules(T.condition),this.checked&&T.tooltip&&(this.tooltip=typeof T.tooltip=="string"?T.tooltip:T.tooltip.value),T.title&&(this.label=typeof T.title=="string"?T.title:T.title.value)}this.item=v,this.alt=S?new r(S,void 0,w,I,E):void 0,this._options=w,W.d.isThemeIcon(v.icon)&&(this.class=ue.a.asClassName(v.icon))}dispose(){}run(...v){var S,w;let I=[];return((S=this._options)===null||S===void 0?void 0:S.arg)&&(I=[...I,this._options.arg]),((w=this._options)===null||w===void 0?void 0:w.shouldForwardArgs)&&(I=[...I,...v]),this._commandService.executeCommand(this.id,...I)}};_=D([N(3,B.b),N(4,R.b)],_)},gRFJ:function(We,ce,M){We.exports=[M("rdUC"),M("ynwM"),M("RELg"),M("DlR+"),M("CrYA"),M("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(We){return We<10?"0"+We:We}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(We){return rx_escapable.lastIndex=0,rx_escapable.test(We)?'"'+We.replace(rx_escapable,function(ce){var M=meta[ce];return typeof M=="string"?M:"\\u"+("0000"+ce.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+We+'"'}function str(We,ce){var M,q,ue,re,fe=gap,ae,z=ce[We];z&&typeof z=="object"&&typeof z.toJSON=="function"&&(z=z.toJSON(We)),typeof rep=="function"&&(z=rep.call(ce,We,z));switch(typeof z){case"string":return quote(z);case"number":return isFinite(z)?String(z):"null";case"boolean":case"null":return String(z);case"object":if(!z)return"null";if(gap+=indent,ae=[],Object.prototype.toString.apply(z)==="[object Array]"){for(re=z.length,M=0;M<re;M+=1)ae[M]=str(M,z)||"null";return ue=ae.length===0?"[]":gap?`[
`+gap+ae.join(`,
`+gap)+`
`+fe+"]":"["+ae.join(",")+"]",gap=fe,ue}if(rep&&typeof rep=="object")for(re=rep.length,M=0;M<re;M+=1)typeof rep[M]=="string"&&(q=rep[M],ue=str(q,z),ue&&ae.push(quote(q)+(gap?": ":":")+ue));else for(q in z)Object.prototype.hasOwnProperty.call(z,q)&&(ue=str(q,z),ue&&ae.push(quote(q)+(gap?": ":":")+ue));return ue=ae.length===0?"{}":gap?`{
`+gap+ae.join(`,
`+gap)+`
`+fe+"}":"{"+ae.join(",")+"}",gap=fe,ue}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(We,ce,M){var q;if(gap="",indent="",typeof M=="number")for(q=0;q<M;q+=1)indent+=" ";else typeof M=="string"&&(indent=M);if(rep=ce,ce&&typeof ce!="function"&&(typeof ce!="object"||typeof ce.length!="number"))throw new Error("JSON.stringify");return str("",{"":We})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(We,ce){var M,q,ue=We[ce];if(ue&&typeof ue=="object")for(M in ue)Object.prototype.hasOwnProperty.call(ue,M)&&(q=walk(ue,M),q!==void 0?ue[M]=q:delete ue[M]);return reviver.call(We,ce,ue)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(We){return"\\u"+("0000"+We.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(We,ce,M){We.exports=M.p+"static/g.37db56e1.svg"},hgre:function(We,ce,M){"use strict";var q=M("8OG5"),ue=M("mgsT"),re=M("IYef"),fe=M("XXmO"),ae=M.n(fe),z=M("T/Jt"),R=M.n(z),B=M("GUcZ"),n=M("ulZh"),W=M.n(n),D=M("xKgJ"),N=M("P5Jw"),d=M.n(N),m=M("bntm"),s=M("4xil"),g=M.n(s);function h(S){if(isNaN(S))return{minutes:"00",seconds:"00"};var w=new Date(S*1e3).toISOString().substr(11,8);return{hour:w.substr(0,2),minutes:w.substr(3,2),seconds:w.substr(6,2)}}Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2}});function _(S,w){return S-w}function r(S){S.sort(_);for(var w=0,I=0;I<S.length-1;I++){var E=Math.abs(S[I+1]-S[I]);E<21&&(w+=E)}return w}var v=/(android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini)/i;ce.a=Object(z.forwardRef)(function(S,w){var I,E=S.src,x=S.toLog,P=S.videoId,T=S.logWatchHistory,A=S.courseId,b=A===void 0?null:A,C=S.startTime,p=S.handlePause,i=p===void 0?function(){}:p,f=S.handlePlay,o=f===void 0?function(){}:f,a=S.handlePlayEnded,L=a===void 0?function(){}:a,y=S.videoSpeed,l=y===void 0?1:y,F=E==null||((I=E.split("."))===null||I===void 0)?void 0:I.pop(),j=F==="flv",G=Object(z.useRef)(),Y=Object(z.useRef)(),te=Object(z.useRef)(),de=Object(z.useRef)(),ve=Object(z.useRef)(),he=Object(z.useRef)(),Re=Object(z.useRef)(),we=Object(z.useRef)(),ge=Object(z.useRef)(),Ne=Object(z.useRef)(),ze=Object(z.useRef)(),nt=Object(z.useRef)(),Ge=Object(z.useRef)(),Xe=Object(z.useRef)(),Be=navigator.userAgent.toLowerCase().match(v),_e=Be?Be[0]:"pc",Ze=Object(z.useRef)(!1),be=Object(D.x)(),Le=0,le=0,ye=0,Te=null,Pe=!1,He=20,Ye=1,ct=!1,st=!1,vt=[];Object(z.useImperativeHandle)(w,function(){return{getLastUpdatedTime:function(){return G.current.currentTime},getDuration:function(){return G.current.duration}}});var qe=Object(z.useCallback)(function(De){var ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Me={point:G.current.currentTime};Te?(Me.log_id=Te,Me.watch_duration=r(vt),Me.total_duration=le):(b?(Me.video_id=parseInt(P,10),Me.course_id=b):Me.video_id=P,Me.duration=Le,Me.device=_e),ke&&(Me.ed="1");function me(){return Ce.apply(this,arguments)}function Ce(){return Ce=Object(re.a)(ae.a.mark(function Oe(){var Se;return ae.a.wrap(function(it){for(;;)switch(it.prev=it.next){case 0:return ct=!0,it.next=3,T(Me);case 3:Se=it.sent,Te=Se,ct=!1,De&&De();case 7:case"end":return it.stop()}},Oe)})),Ce.apply(this,arguments)}me()},[P,b]);Object(z.useEffect)(function(){ue.b.destroy();var De=null;return B.a.isSupported&&j&&E&&(E==null?void 0:E.indexOf(".m3u8"))<0?(De=B.a.createPlayer({type:"flv",volume:.8,cors:!0,url:E,muted:!1}),G.current&&(De.attachMediaElement(G.current),De.load())):G.current.setAttribute("src",E),yt(),function(){De&&(De.unload(),De.pause(),De.destroy(),De=null)}},[G,j,E]);function mt(){G.current.paused?(de.current.style.display="none",ve.current.style.display="block"):(de.current.style.display="block",ve.current.style.display="none")}function yt(){ze.current.style.display="none",Ge.current.style.display="none",nt.current.style.display="none",G.current.muted||G.current.volume===0?ze.current.style.display="block":G.current.volume>0&&G.current.volume<=.5?Ge.current.style.display="block":nt.current.style.display="block"}Object(z.useEffect)(function(){var De=document.getElementById("play"),ke=document.querySelectorAll(".playback-icons use");function Me(){o(),C&&!Ze.current&&(G.current.currentTime=C),Ze.current=!0,vt.push(G.current.currentTime),Pe||(Pe=!0,x&&qe())}function me(){return Ce.apply(this,arguments)}function Ce(){return Ce=Object(re.a)(ae.a.mark(function Ct(){return ae.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:mt(),vt.push(G.current.currentTime),x&&qe(function(){Te=null,ye=0,Pe=!1,ct=!1,st=!1,vt=[],le=0,Ye=1},!0);case 3:case"end":return Nt.stop()}},Ct)})),Ce.apply(this,arguments)}function Oe(){he.current.value=Math.round(G.current.currentTime),Re.current.value=Math.round(G.current.currentTime)}function Se(){var Ct=h(Math.round(G.current.currentTime));ge.current.innerText="".concat(Ct.hour>0?Ct.hour+":":"").concat(Ct.minutes,":").concat(Ct.seconds),ge.current.setAttribute("datetime","".concat(Ct.hour>0?" "+Ct.hour+" ":"").concat(Ct.minutes,"m ").concat(Ct.seconds,"s"))}function Fe(){var Ct=Math.round(G.current.duration);he.current.setAttribute("max",Ct),Re.current.setAttribute("max",Ct);var dt=h(Ct);we.current.innerText="".concat(dt.hour>0?dt.hour+":":"").concat(dt.minutes,":").concat(dt.seconds),we.current.setAttribute("datetime","".concat(dt.hour>0?" "+dt.hour+" ":"").concat(dt.minutes,"m ").concat(dt.seconds,"s"))}function it(){var Ct=Math.round(G.current.duration);he.current.setAttribute("max",Ct),Re.current.setAttribute("max",Ct);var dt=h(Ct);we.current.innerText="".concat(dt.hour>0?dt.hour+":":"").concat(dt.minutes,":").concat(dt.seconds),we.current.setAttribute("datetime","".concat(dt.hour>0?" "+dt.hour+" ":"").concat(dt.minutes,"m ").concat(dt.seconds,"s")),Oe(),Se();var Nt=Y.current.getBoundingClientRect(),Xt=Nt.width,Dt=Nt.height,an=Nt.x,nn=Nt.y;if(an<0||nn<0||!Xt)return;if(!st){var An=G.current.currentTime,_n=An-ye;Math.abs(_n)<10?(le+=Math.abs(_n),ye=An,ct||le-Ye*He>=0&&(Ye++,vt.push(ye),x&&qe())):(ye=An,x&&qe())}}function Ie(){st=!0}function Qe(){G.current.playing&&vt.push(G.current.currentTime,ye),ye=G.current.currentTime,st=!1}function rt(){Le=G.current.duration,Le<=20&&(He=Le/3),G.current.addEventListener("play",Me)}function ft(Ct){Ct.preventDefault(),Object(m.a)()?(G.current.style.width="100%",G.current.style.height="100%"):G.current.style.cssText=""}function It(){i()}function Tt(Ct){var dt=Ct.target.dataset.seek?Ct.target.dataset.seek:Ct.target.value;G.current.currentTime=dt,Re.current.value=dt,he.current.value=dt}function Et(Ct){var dt=Math.round(Ct.offsetX/Ct.target.clientWidth*parseInt(Ct.target.getAttribute("max"),10));he.current.setAttribute("data-seek",dt);var Nt=h(dt);Ne.current.textContent="".concat(Nt.hour>0?Nt.hour+":":"").concat(Nt.minutes,":").concat(Nt.seconds);var Xt=G.current.getBoundingClientRect();Ne.current.style.left="".concat(Ct.pageX-Xt.left,"px")}return te.current.addEventListener(Object(m.c)(),ft),G.current.addEventListener("canplay",rt),G.current.addEventListener("ended",me),G.current.addEventListener("seeking",Ie),G.current.addEventListener("seeked",Qe),G.current.addEventListener("loadedmetadata",Fe),he.current.addEventListener("mousemove",Et),he.current.addEventListener("input",Tt),G.current.addEventListener("timeupdate",it),G.current.addEventListener("pause",It),G.current.addEventListener("volumechange",yt),function(){G.current.removeEventListener("canplay",rt),G.current.removeEventListener("play",Me),G.current.removeEventListener("ended",me),G.current.removeEventListener("seeking",Ie),G.current.removeEventListener("seeked",Qe),he.current.removeEventListener("mousemove",Et),he.current.removeEventListener("input",Tt),G.current.removeEventListener("timeupdate",it),G.current.removeEventListener("pause",It),G.current.removeEventListener("loadedmetadata",Fe),G.current.removeEventListener("volumechange",yt),G.current.playing&&(vt.push(ye,G.current.currentTime),x&&qe())}},[G,E]),Object(z.useEffect)(function(){if(G.current.onended=function(){L(G)},G.current.oncontextmenu=function(){return!1},(E==null?void 0:E.indexOf(".m3u8"))>-1){if(G.current.canPlayType("application/vnd.apple.mpegurl"))G.current.src=E;else if(W.a.isSupported()){var De=new W.a;De.loadSource(E),De.attachMedia(G.current)}}},[E]),Object(z.useEffect)(function(){G.current.playbackRate=l},[l]);var Je=function(){G.current.paused||G.current.ended?G.current.play():G.current.pause(),mt()};function et(){G.current.muted=!G.current.muted,G.current.muted?(Xe.current.setAttribute("data-volume",volume.value),Xe.current.value=0):Xe.current.value=Xe.current.dataset.volume}return R.a.createElement("div",{style:{position:"relative"},ref:te},R.a.createElement("div",{ref:Y,className:"".concat(g.a.watermark," animated_alternate animate__animated_10s animate__infinite animate__stepstart ").concat(g.a.animate__loop)},be?be.login:" "),R.a.createElement("div",{className:g.a.container},R.a.createElement("div",{className:g.a["video-container"],id:"video-container"},R.a.createElement("div",{className:g.a["playback-animation"],id:"playback-animation"},R.a.createElement("svg",{className:g.a["playback-icons"]},R.a.createElement("use",{className:"hidden",href:"#play-icon"}),R.a.createElement("use",{href:"#pause"}))),R.a.createElement("video",{className:g.a.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:G,autoPlay:!1}),R.a.createElement("div",{className:"".concat(g.a["video-controls"]," "),id:"video-controls"},R.a.createElement("div",{className:g.a["bottom-controls"]},R.a.createElement("div",{className:g.a["left-controls"]},R.a.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:Je},R.a.createElement("svg",{className:g.a["playback-icons"]},R.a.createElement("use",{ref:ve,href:"#play-icon"}),R.a.createElement("use",{ref:de,style:{display:"none"},href:"#pause"}))),R.a.createElement("div",{className:g.a.time},R.a.createElement("time",{id:"time-elapsed",ref:ge},"00:00"),R.a.createElement("span",null," / "),R.a.createElement("time",{id:"duration",ref:we},"00:00"))),R.a.createElement("div",{className:g.a["right-controls"]},R.a.createElement(N.CopyToClipboard,{text:E,onCopy:function(){return ue.b.success("\u590D\u5236\u6210\u529F")}},R.a.createElement("button",{"data-title":"\u590D\u5236\u94FE\u63A5"},R.a.createElement("i",{className:"icon-lianjie2 iconfont",style:{fontSize:"12px",color:"white"}}))),R.a.createElement("div",{className:g.a["volume-controls"]},R.a.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:g.a["volume-button"],id:"volume-button",onClick:et},R.a.createElement("i",{ref:ze,className:"icon-a-bianzu8 iconfont",style:{fontSize:"14px",color:"white"}}),R.a.createElement("i",{ref:Ge,className:"icon-shengyinkaibeifen iconfont",style:{fontSize:"14px",color:"white"}}),R.a.createElement("i",{ref:nt,className:"icon-shengyinkai iconfont",style:{fontSize:"14px",color:"white"}})),R.a.createElement("input",{className:g.a.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:Xe,style:{display:"none"},onClick:yt})),R.a.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:g.a["fullscreen-button"],onClick:function(){Object(m.a)()?Object(m.b)():Object(m.d)(te.current)}},R.a.createElement("i",{className:"icon-fangda1 iconfont",style:{fontSize:"12px",color:"white"}})))),R.a.createElement("div",{className:g.a["video-progress"]},R.a.createElement("progress",{ref:Re,value:"0",min:"0"}),R.a.createElement("input",{className:g.a.seek,ref:he,value:"0",min:"0",type:"range",step:"1"}),R.a.createElement("div",{className:g.a["seek-tooltip"],ref:Ne,id:"seek-tooltip"},"00:00"))))),R.a.createElement("svg",{style:{display:"none"}},R.a.createElement("defs",null,R.a.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},R.a.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),R.a.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},R.a.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),R.a.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},R.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"})),R.a.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},R.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"})),R.a.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},R.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"})),R.a.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},R.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"})),R.a.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},R.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"})),R.a.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},R.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"})))))})},hkPH:function(We,ce,M){"use strict";var q=M("yuO0"),ue=M("XjgL"),re=M("kxoy"),fe=M("36hc"),ae=M("fNpE"),z=M("T/Jt"),R=M("27eb"),B=M.n(R),n=M("sg8A"),W=M("s7W6"),D=M("Eiay"),N=M("eA01"),d=M("fXDJ");function m(){return typeof BigInt=="function"}function s(F){var j=F.trim(),G=j.startsWith("-");G&&(j=j.slice(1)),j=j.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),j.startsWith(".")&&(j="0".concat(j));var Y=j||"0",te=Y.split("."),de=te[0]||"0",ve=te[1]||"0";de==="0"&&ve==="0"&&(G=!1);var he=G?"-":"";return{negative:G,negativeStr:he,trimStr:Y,integerStr:de,decimalStr:ve,fullStr:"".concat(he).concat(Y)}}function g(F){var j=String(F);return!Number.isNaN(Number(j))&&j.includes("e")}function h(F){var j=String(F);if(g(F)){var G=Number(j.slice(j.indexOf("e-")+2)),Y=j.match(/\.(\d+)/);return(Y==null?void 0:Y[1])&&(G+=Y[1].length),G}return j.includes(".")&&r(j)?j.length-j.indexOf(".")-1:0}function _(F){var j=String(F);if(g(F)){if(F>Number.MAX_SAFE_INTEGER)return String(m()?BigInt(F).toString():Number.MAX_SAFE_INTEGER);if(F<Number.MIN_SAFE_INTEGER)return String(m()?BigInt(F).toString():Number.MIN_SAFE_INTEGER);j=F.toFixed(h(j))}return s(j).fullStr}function r(F){return typeof F=="number"?!Number.isNaN(F):F?/^\s*-?\d+(\.\d+)?\s*$/.test(F)||/^\s*-?\d+\.\s*$/.test(F)||/^\s*-?\.\d+\s*$/.test(F):!1}function v(F){var j=typeof F=="number"?_(F):s(F).fullStr,G=j.includes(".");return G?s(j.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:F+"0"}var S=function(){function F(j){if(Object(N.a)(this,F),this.origin="",this.number=void 0,this.empty=void 0,!j&&j!==0||!String(j).trim()){this.empty=!0;return}this.origin=String(j),this.number=Number(j)}return Object(d.a)(F,[{key:"negate",value:function(){return new F(-this.toNumber())}},{key:"add",value:function(G){if(this.isInvalidate())return new F(G);var Y=Number(G);if(Number.isNaN(Y))return this;var te=this.number+Y;if(te>Number.MAX_SAFE_INTEGER)return new F(Number.MAX_SAFE_INTEGER);if(te<Number.MIN_SAFE_INTEGER)return new F(Number.MIN_SAFE_INTEGER);var de=Math.max(h(this.number),h(Y));return new F(te.toFixed(de))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return Number.isNaN(this.number)}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(G){return this.toNumber()===(G==null?void 0:G.toNumber())}},{key:"lessEquals",value:function(G){return this.add(G.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return G?this.isInvalidate()?"":_(this.number):this.origin}}]),F}(),w=function(){function F(j){if(Object(N.a)(this,F),this.origin="",this.negative=void 0,this.integer=void 0,this.decimal=void 0,this.decimalLen=void 0,this.empty=void 0,this.nan=void 0,!j&&j!==0||!String(j).trim()){this.empty=!0;return}if(this.origin=String(j),j==="-"){this.nan=!0;return}var G=j;if(g(G)&&(G=Number(G)),G=typeof G=="string"?G:_(G),r(G)){var Y=s(G);this.negative=Y.negative;var te=Y.trimStr.split(".");this.integer=BigInt(te[0]);var de=te[1]||"0";this.decimal=BigInt(de),this.decimalLen=de.length}else this.nan=!0}return Object(d.a)(F,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(G){var Y="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(G,"0"));return BigInt(Y)}},{key:"negate",value:function(){var G=new F(this.toString());return G.negative=!G.negative,G}},{key:"add",value:function(G){if(this.isInvalidate())return new F(G);var Y=new F(G);if(Y.isInvalidate())return this;var te=Math.max(this.getDecimalStr().length,Y.getDecimalStr().length),de=this.alignDecimal(te),ve=Y.alignDecimal(te),he=(de+ve).toString(),Re=s(he),we=Re.negativeStr,ge=Re.trimStr,Ne="".concat(we).concat(ge.padStart(te+1,"0"));return new F("".concat(Ne.slice(0,-te),".").concat(Ne.slice(-te)))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(G){return this.toString()===(G==null?void 0:G.toString())}},{key:"lessEquals",value:function(G){return this.add(G.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return G?this.isInvalidate()?"":s("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),F}();function I(F){return m()?new w(F):new S(F)}function E(F,j,G){var Y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(F==="")return"";var te=s(F),de=te.negativeStr,ve=te.integerStr,he=te.decimalStr,Re="".concat(j).concat(he),we="".concat(de).concat(ve);if(G>=0){var ge=Number(he[G]);if(ge>=5&&!Y){var Ne=I(F).add("".concat(de,"0.").concat("0".repeat(G)).concat(10-ge));return E(Ne.toString(),j,G,Y)}return G===0?we:"".concat(we).concat(j).concat(he.padEnd(G,"0").slice(0,G))}return Re===".0"?we:"".concat(we).concat(Re)}var x=M("EOd9"),P=200,T=600;function A(F){var j=F.prefixCls,G=F.upNode,Y=F.downNode,te=F.upDisabled,de=F.downDisabled,ve=F.onStep,he=z.useRef(),Re=z.useRef();Re.current=ve;var we=function(Be,_e){Be.preventDefault(),Re.current(_e);function Ze(){Re.current(_e),he.current=setTimeout(Ze,P)}he.current=setTimeout(Ze,T)},ge=function(){clearTimeout(he.current)};if(z.useEffect(function(){return ge},[]),Object(x.a)())return null;var Ne="".concat(j,"-handler"),ze=B()(Ne,"".concat(Ne,"-up"),Object(ue.a)({},"".concat(Ne,"-up-disabled"),te)),nt=B()(Ne,"".concat(Ne,"-down"),Object(ue.a)({},"".concat(Ne,"-down-disabled"),de)),Ge={unselectable:"on",role:"button",onMouseUp:ge,onMouseLeave:ge};return z.createElement("div",{className:"".concat(Ne,"-wrap")},z.createElement("span",Object(q.a)({},Ge,{onMouseDown:function(Be){we(Be,!0)},"aria-label":"Increase Value","aria-disabled":te,className:ze}),G||z.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-up-inner")})),z.createElement("span",Object(q.a)({},Ge,{onMouseDown:function(Be){we(Be,!1)},"aria-label":"Decrease Value","aria-disabled":de,className:nt}),Y||z.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-down-inner")})))}var b=M("B/uU");function C(F,j){var G=Object(z.useRef)(null);function Y(){try{var de=F.selectionStart,ve=F.selectionEnd,he=F.value,Re=he.substring(0,de),we=he.substring(ve);G.current={start:de,end:ve,value:he,beforeTxt:Re,afterTxt:we}}catch(ge){}}function te(){if(F&&G.current&&j)try{var de=F.value,ve=G.current,he=ve.beforeTxt,Re=ve.afterTxt,we=ve.start,ge=de.length;if(de.endsWith(Re))ge=de.length-G.current.afterTxt.length;else if(de.startsWith(he))ge=he.length;else{var Ne=he[we-1],ze=de.indexOf(Ne,we-1);ze!==-1&&(ge=ze+1)}F.setSelectionRange(ge,ge)}catch(nt){Object(b.a)(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(nt.message))}}return[Y,te]}var p=M("IRwA"),i=function(){var F=Object(z.useRef)(0),j=function(){p.a.cancel(F.current)};return Object(z.useEffect)(function(){return j},[]),function(G){j(),F.current=Object(p.a)(function(){G()})}},f=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","controls","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep"],o=function(j,G){return j||G.isEmpty()?G.toString():G.toNumber()},a=function(j){var G=I(j);return G.isInvalidate()?null:G},L=z.forwardRef(function(F,j){var G,Y=F.prefixCls,te=Y===void 0?"rc-input-number":Y,de=F.className,ve=F.style,he=F.min,Re=F.max,we=F.step,ge=we===void 0?1:we,Ne=F.defaultValue,ze=F.value,nt=F.disabled,Ge=F.readOnly,Xe=F.upHandler,Be=F.downHandler,_e=F.keyboard,Ze=F.controls,be=Ze===void 0?!0:Ze,Le=F.stringMode,le=F.parser,ye=F.formatter,Te=F.precision,Pe=F.decimalSeparator,He=F.onChange,Ye=F.onInput,ct=F.onPressEnter,st=F.onStep,vt=Object(ae.a)(F,f),qe="".concat(te,"-input"),mt=z.useRef(null),yt=z.useState(!1),Je=Object(fe.a)(yt,2),et=Je[0],De=Je[1],ke=z.useRef(!1),Me=z.useRef(!1),me=z.useRef(!1),Ce=z.useState(function(){return I(ze!=null?ze:Ne)}),Oe=Object(fe.a)(Ce,2),Se=Oe[0],Fe=Oe[1];function it(ht){ze===void 0&&Fe(ht)}var Ie=z.useCallback(function(ht,Rt){return Rt?void 0:Te>=0?Te:Math.max(h(ht),h(ge))},[Te,ge]),Qe=z.useCallback(function(ht){var Rt=String(ht);if(le)return le(Rt);var lt=Rt;return Pe&&(lt=lt.replace(Pe,".")),lt.replace(/[^\w.-]+/g,"")},[le,Pe]),rt=z.useRef(""),ft=z.useCallback(function(ht,Rt){if(ye)return ye(ht,{userTyping:Rt,input:String(rt.current)});var lt=typeof ht=="number"?_(ht):ht;if(!Rt){var Pt=Ie(lt,Rt);if(r(lt)&&(Pe||Pt>=0)){var Wt=Pe||".";lt=E(lt,Wt,Pt)}}return lt},[ye,Ie,Pe]),It=z.useState(function(){var ht=Ne!=null?Ne:ze;return Se.isInvalidate()&&["string","number"].includes(Object(re.a)(ht))?Number.isNaN(ht)?"":ht:ft(Se.toString(),!1)}),Tt=Object(fe.a)(It,2),Et=Tt[0],Ct=Tt[1];rt.current=Et;function dt(ht,Rt){Ct(ft(ht.isInvalidate()?ht.toString(!1):ht.toString(!Rt),Rt))}var Nt=z.useMemo(function(){return a(Re)},[Re,Te]),Xt=z.useMemo(function(){return a(he)},[he,Te]),Dt=z.useMemo(function(){return!Nt||!Se||Se.isInvalidate()?!1:Nt.lessEquals(Se)},[Nt,Se]),an=z.useMemo(function(){return!Xt||!Se||Se.isInvalidate()?!1:Se.lessEquals(Xt)},[Xt,Se]),nn=C(mt.current,et),An=Object(fe.a)(nn,2),_n=An[0],At=An[1],jt=function(Rt){return Nt&&!Rt.lessEquals(Nt)?Nt:Xt&&!Xt.lessEquals(Rt)?Xt:null},on=function(Rt){return!jt(Rt)},Ee=function(Rt,lt){var Pt=Rt,Wt=on(Pt)||Pt.isEmpty();if(!Pt.isEmpty()&&!lt&&(Pt=jt(Pt)||Pt,Wt=!0),!Ge&&!nt&&Wt){var Bt=Pt.toString(),wt=Ie(Bt,lt);return wt>=0&&(Pt=I(E(Bt,".",wt)),on(Pt)||(Pt=I(E(Bt,".",wt,!0)))),Pt.equals(Se)||(it(Pt),He==null||He(Pt.isEmpty()?null:o(Le,Pt)),ze===void 0&&dt(Pt,lt)),Pt}return Se},se=i(),H=function ht(Rt){if(_n(),Ct(Rt),!Me.current){var lt=Qe(Rt),Pt=I(lt);Pt.isNaN()||Ee(Pt,!0)}Ye==null||Ye(Rt),se(function(){var Wt=Rt;le||(Wt=Rt.replace(/。/g,".")),Wt!==Rt&&ht(Wt)})},V=function(){Me.current=!0},$=function(){Me.current=!1,H(mt.current.value)},ee=function(Rt){H(Rt.target.value)},xe=function(Rt){var lt;if(Rt&&Dt||!Rt&&an)return;ke.current=!1;var Pt=I(me.current?v(ge):ge);Rt||(Pt=Pt.negate());var Wt=(Se||I(0)).add(Pt.toString()),Bt=Ee(Wt,!1);st==null||st(o(Le,Bt),{offset:me.current?v(ge):ge,type:Rt?"up":"down"}),(lt=mt.current)===null||lt===void 0||lt.focus()},Ue=function(Rt){var lt=I(Qe(Et)),Pt=lt;lt.isNaN()?Pt=Se:Pt=Ee(lt,Rt),ze!==void 0?dt(Se,!1):Pt.isNaN()||dt(Pt,!1)},$e=function(){ke.current=!0},pt=function(Rt){var lt=Rt.which,Pt=Rt.shiftKey;if(ke.current=!0,Pt?me.current=!0:me.current=!1,lt===n.a.ENTER&&(Me.current||(ke.current=!1),Ue(!1),ct==null||ct(Rt)),_e===!1)return;!Me.current&&[n.a.UP,n.a.DOWN].includes(lt)&&(xe(n.a.UP===lt),Rt.preventDefault())},xt=function(){ke.current=!1,me.current=!1},Ve=function(){Ue(!1),De(!1),ke.current=!1};return Object(W.b)(function(){Se.isInvalidate()||dt(Se,!1)},[Te]),Object(W.b)(function(){var ht=I(ze);Fe(ht);var Rt=I(Qe(Et));(!ht.equals(Rt)||!ke.current||ye)&&dt(ht,ke.current)},[ze]),Object(W.b)(function(){ye&&At()},[Et]),z.createElement("div",{className:B()(te,de,(G={},Object(ue.a)(G,"".concat(te,"-focused"),et),Object(ue.a)(G,"".concat(te,"-disabled"),nt),Object(ue.a)(G,"".concat(te,"-readonly"),Ge),Object(ue.a)(G,"".concat(te,"-not-a-number"),Se.isNaN()),Object(ue.a)(G,"".concat(te,"-out-of-range"),!Se.isInvalidate()&&!on(Se)),G)),style:ve,onFocus:function(){De(!0)},onBlur:Ve,onKeyDown:pt,onKeyUp:xt,onCompositionStart:V,onCompositionEnd:$,onBeforeInput:$e},be&&z.createElement(A,{prefixCls:te,upNode:Xe,downNode:Be,upDisabled:Dt,downDisabled:an,onStep:xe}),z.createElement("div",{className:"".concat(qe,"-wrap")},z.createElement("input",Object(q.a)({autoComplete:"off",role:"spinbutton","aria-valuemin":he,"aria-valuemax":Re,"aria-valuenow":Se.isInvalidate()?null:Se.toString(),step:ge},vt,{ref:Object(D.a)(mt,j),className:qe,value:Et,onChange:ee,disabled:nt,readOnly:Ge}))))});L.displayName="InputNumber";var y=L,l=ce.a=y},i3hx:function(We,ce,M){},ic2d:function(We,ce,M){"use strict";M.d(ce,"a",function(){return fe});var q=M("FWmy"),ue=M("746U");class re{constructor(){this.data=new Map}add(ae,z){q.a(ue.l(ae)),q.a(ue.k(z)),q.a(!this.data.has(ae),"There is already an extension with this id"),this.data.set(ae,z)}as(ae){return this.data.get(ae)||null}}const fe=new re},je13:function(We,ce,M){var q=M("5nXd"),ue=M("gRFJ"),re=[M("uQRt")];We.exports=q.createStore(ue,re)},"ju+a":function(We,ce,M){"use strict";M.d(ce,"b",function(){return N}),M.d(ce,"a",function(){return d}),M.d(ce,"h",function(){return m}),M.d(ce,"f",function(){return s}),M.d(ce,"c",function(){return _}),M.d(ce,"d",function(){return r}),M.d(ce,"g",function(){return w}),M.d(ce,"e",function(){return I});var q=M("aVTQ"),ue=M("kxoy"),re=M("yuO0"),fe=M("fNpE"),ae=M("B/uU"),z=M("T/Jt"),R=M.n(z),B=M("0pdE"),n=M("El5i"),W=M("rgEC"),D=["children"];function N(E,x){if(!E)return[];var P=E.slice(),T=P.indexOf(x);return T>=0&&P.splice(T,1),P}function d(E,x){var P=(E||[]).slice();return P.indexOf(x)===-1&&P.push(x),P}function m(E){return E.split("-")}function s(E,x){var P=[],T=Object(n.a)(x,E);function A(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];b.forEach(function(C){var p=C.key,i=C.children;P.push(p),A(i)})}return A(T.children),P}function g(E){if(E.parent){var x=m(E.pos);return Number(x[x.length-1])===E.parent.children.length-1}return!1}function h(E){var x=m(E.pos);return Number(x[x.length-1])===0}function _(E,x,P,T,A,b,C,p,i,f){var o,a=E.clientX,L=E.clientY,y=E.target.getBoundingClientRect(),l=y.top,F=y.height,j=(f==="rtl"?-1:1)*(((A==null?void 0:A.x)||0)-a),G=(j-12)/T,Y=Object(n.a)(p,P.props.eventKey);if(L<l+F/2){var te=C.findIndex(function(Be){return Be.key===Y.key}),de=te<=0?0:te-1,ve=C[de].key;Y=Object(n.a)(p,ve)}var he=Y.key,Re=Y,we=Y.key,ge=0,Ne=0;if(!i.includes(he))for(var ze=0;ze<G&&g(Y);ze+=1)Y=Y.parent,Ne+=1;var nt=x.props.data,Ge=Y.node,Xe=!0;return h(Y)&&Y.level===0&&L<l+F/2&&b({dragNode:nt,dropNode:Ge,dropPosition:-1})&&Y.key===P.props.eventKey?ge=-1:(Re.children||[]).length&&i.includes(we)?b({dragNode:nt,dropNode:Ge,dropPosition:0})?ge=0:Xe=!1:Ne===0?G>-1.5?b({dragNode:nt,dropNode:Ge,dropPosition:1})?ge=1:Xe=!1:b({dragNode:nt,dropNode:Ge,dropPosition:0})?ge=0:b({dragNode:nt,dropNode:Ge,dropPosition:1})?ge=1:Xe=!1:b({dragNode:nt,dropNode:Ge,dropPosition:1})?ge=1:Xe=!1,{dropPosition:ge,dropLevelOffset:Ne,dropTargetKey:Y.key,dropTargetPos:Y.pos,dragOverNodeKey:we,dropContainerKey:ge===0?null:((o=Y.parent)===null||o===void 0?void 0:o.key)||null,dropAllowed:Xe}}function r(E,x){if(!E)return;var P=x.multiple;return P?E.slice():E.length?[E[0]]:E}var v=function(x){return x};function S(E,x){if(!E)return[];var P=x||{},T=P.processProps,A=T===void 0?v:T,b=Array.isArray(E)?E:[E];return b.map(function(C){var p=C.children,i=Object(fe.a)(C,D),f=S(p,x);return R.a.createElement(B.a,Object(re.a)({key:i.key},A(i)),f)})}function w(E){if(!E)return null;var x;if(Array.isArray(E))x={checkedKeys:E,halfCheckedKeys:void 0};else if(Object(ue.a)(E)==="object")x={checkedKeys:E.checked||void 0,halfCheckedKeys:E.halfChecked||void 0};else return Object(ae.a)(!1,"`checkedKeys` is not an array or an object"),null;return x}function I(E,x){var P=new Set;function T(A){if(P.has(A))return;var b=Object(n.a)(x,A);if(!b)return;P.add(A);var C=b.parent,p=b.node;if(p.disabled)return;C&&T(C.key)}return(E||[]).forEach(function(A){T(A)}),Object(q.a)(P)}},kQR0:function(We,ce,M){"use strict";M.d(ce,"a",function(){return Oe});var q=M("XjgL"),ue=M("yuO0"),re=M("6ASS"),fe=M("aVTQ"),ae=M("36hc"),z=M("kxoy"),R=M("T/Jt"),B=M("bBMO"),n=M("E0BR"),W=M("cZC0"),D=M("27eb"),N=M.n(D),d=M("1HCi"),m=M.n(d),s=M("B/uU"),g=M("s3yx"),h=M("tybu"),_=M("YLkp"),r=M("IEJz"),v=M("x/L2"),S=M("Dpym"),w=M("TqI3"),I=M("5Und");function E(Ie){var Qe=Ie.cells,rt=Ie.stickyOffsets,ft=Ie.flattenColumns,It=Ie.rowComponent,Tt=Ie.cellComponent,Et=Ie.onHeaderRow,Ct=Ie.index,dt=R.useContext(S.a),Nt=dt.prefixCls,Xt=dt.direction,Dt;Et&&(Dt=Et(Qe.map(function(nn){return nn.column}),Ct));var an=Object(I.a)(Qe.map(function(nn){return nn.column}));return R.createElement(It,Dt,Qe.map(function(nn,An){var _n=nn.column,At=Object(w.a)(nn.colStart,nn.colEnd,ft,rt,Xt),jt;return _n&&_n.onHeaderCell&&(jt=nn.column.onHeaderCell(_n)),R.createElement(v.a,Object(ue.a)({},nn,{ellipsis:_n.ellipsis,align:_n.align,component:Tt,prefixCls:Nt,key:an[An]},At,{additionalProps:jt,rowType:"header"}))}))}E.displayName="HeaderRow";var x=E;function P(Ie){var Qe=[];function rt(Et,Ct){var dt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Qe[dt]=Qe[dt]||[];var Nt=Ct,Xt=Et.filter(Boolean).map(function(Dt){var an={key:Dt.key,className:Dt.className||"",children:Dt.title,column:Dt,colStart:Nt},nn=1,An=Dt.children;return An&&An.length>0&&(nn=rt(An,Nt,dt+1).reduce(function(_n,At){return _n+At},0),an.hasSubColumns=!0),"colSpan"in Dt&&(nn=Dt.colSpan),"rowSpan"in Dt&&(an.rowSpan=Dt.rowSpan),an.colSpan=nn,an.colEnd=an.colStart+nn-1,Qe[dt].push(an),Nt+=nn,nn});return Xt}rt(Ie,0);for(var ft=Qe.length,It=function(Ct){Qe[Ct].forEach(function(dt){!("rowSpan"in dt)&&!dt.hasSubColumns&&(dt.rowSpan=ft-Ct)})},Tt=0;Tt<ft;Tt+=1)It(Tt);return Qe}function T(Ie){var Qe=Ie.stickyOffsets,rt=Ie.columns,ft=Ie.flattenColumns,It=Ie.onHeaderRow,Tt=R.useContext(S.a),Et=Tt.prefixCls,Ct=Tt.getComponent,dt=R.useMemo(function(){return P(rt)},[rt]),Nt=Ct(["header","wrapper"],"thead"),Xt=Ct(["header","row"],"tr"),Dt=Ct(["header","cell"],"th");return R.createElement(Nt,{className:"".concat(Et,"-thead")},dt.map(function(an,nn){var An=R.createElement(x,{key:nn,flattenColumns:ft,cells:an,stickyOffsets:Qe,rowComponent:Xt,cellComponent:Dt,onHeaderRow:It,index:nn});return An}))}var A=T,b=M("ynYK"),C=R.createContext(null),p=C;function i(Ie){var Qe=Ie.prefixCls,rt=Ie.children,ft=Ie.component,It=Ie.cellComponent,Tt=Ie.className,Et=Ie.expanded,Ct=Ie.colSpan,dt=Ie.isEmpty,Nt=R.useContext(S.a),Xt=Nt.scrollbarSize,Dt=R.useContext(p),an=Dt.fixHeader,nn=Dt.fixColumn,An=Dt.componentWidth,_n=Dt.horizonScroll;return R.useMemo(function(){var At=rt;return(dt?_n:nn)&&(At=R.createElement("div",{style:{width:An-(an?Xt:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Qe,"-expanded-row-fixed")},An!==0&&At)),R.createElement(ft,{className:Tt,style:{display:Et?null:"none"}},R.createElement(v.a,{component:It,prefixCls:Qe,colSpan:Ct},At))},[rt,ft,Tt,Et,Ct,dt,Xt,An,nn,an,_n])}var f=i,o=R.createContext(null),a=o;function L(Ie){var Qe=Ie.className,rt=Ie.style,ft=Ie.record,It=Ie.index,Tt=Ie.renderIndex,Et=Ie.rowKey,Ct=Ie.rowExpandable,dt=Ie.expandedKeys,Nt=Ie.onRow,Xt=Ie.indent,Dt=Xt===void 0?0:Xt,an=Ie.rowComponent,nn=Ie.cellComponent,An=Ie.childrenColumnName,_n=R.useContext(S.a),At=_n.prefixCls,jt=_n.fixedInfoList,on=R.useContext(b.a),Ee=on.flattenColumns,se=on.expandableType,H=on.expandRowByClick,V=on.onTriggerExpand,$=on.rowClassName,ee=on.expandedRowClassName,xe=on.indentSize,Ue=on.expandIcon,$e=on.expandedRowRender,pt=on.expandIconColumnIndex,xt=R.useState(!1),Ve=Object(ae.a)(xt,2),ht=Ve[0],Rt=Ve[1],lt=dt&&dt.has(Ie.recordKey);R.useEffect(function(){lt&&Rt(!0)},[lt]);var Pt=se==="row"&&(!Ct||Ct(ft)),Wt=se==="nest",Bt=An&&ft&&ft[An],wt=Pt||Wt,Q=R.useRef(V);Q.current=V;var k=function(){Q.current.apply(Q,arguments)},U=Nt==null?void 0:Nt(ft,It),X=function($t){var mn;H&&wt&&k(ft,$t);for(var Mn=arguments.length,lr=new Array(Mn>1?Mn-1:0),Kn=1;Kn<Mn;Kn++)lr[Kn-1]=arguments[Kn];U==null||((mn=U.onClick)===null||mn===void 0)||mn.call.apply(mn,[U,$t].concat(lr))},ie;typeof $=="string"?ie=$:typeof $=="function"&&(ie=$(ft,It,Dt));var J=Object(I.a)(Ee),Ae=R.createElement(an,Object(ue.a)({},U,{"data-row-key":Et,className:N()(Qe,"".concat(At,"-row"),"".concat(At,"-row-level-").concat(Dt),ie,U&&U.className),style:Object(re.a)(Object(re.a)({},rt),U?U.style:null),onClick:X}),Ee.map(function(gt,$t){var mn=gt.render,Mn=gt.dataIndex,lr=gt.className,Kn=J[$t],ur=jt[$t],dr;$t===(pt||0)&&Wt&&(dr=R.createElement(R.Fragment,null,R.createElement("span",{style:{paddingLeft:"".concat(xe*Dt,"px")},className:"".concat(At,"-row-indent indent-level-").concat(Dt)}),Ue({prefixCls:At,expanded:lt,expandable:Bt,record:ft,onExpand:k})));var hr;return gt.onCell&&(hr=gt.onCell(ft,It)),R.createElement(v.a,Object(ue.a)({className:lr,ellipsis:gt.ellipsis,align:gt.align,component:nn,prefixCls:At,key:Kn,record:ft,index:It,renderIndex:Tt,dataIndex:Mn,render:mn,shouldCellUpdate:gt.shouldCellUpdate,expanded:dr&&lt},ur,{appendNode:dr,additionalProps:hr}))})),tt;if(Pt&&(ht||lt)){var kt=$e(ft,It,Dt+1,lt),Mt=ee&&ee(ft,It,Dt);tt=R.createElement(f,{expanded:lt,className:N()("".concat(At,"-expanded-row"),"".concat(At,"-expanded-row-level-").concat(Dt+1),Mt),prefixCls:At,component:an,cellComponent:nn,colSpan:Ee.length,isEmpty:!1},kt)}return R.createElement(R.Fragment,null,Ae,tt)}L.displayName="BodyRow";var y=L;function l(Ie,Qe,rt,ft,It,Tt){var Et=[];Et.push({record:Ie,indent:Qe,index:Tt});var Ct=It(Ie),dt=ft==null?void 0:ft.has(Ct);if(Ie&&Array.isArray(Ie[rt])&&dt)for(var Nt=0;Nt<Ie[rt].length;Nt+=1){var Xt=l(Ie[rt][Nt],Qe+1,rt,ft,It,Nt);Et.push.apply(Et,Object(fe.a)(Xt))}return Et}function F(Ie,Qe,rt,ft){var It=R.useMemo(function(){if(rt==null?void 0:rt.size){for(var Tt=[],Et=0;Et<(Ie==null?void 0:Ie.length);Et+=1){var Ct=Ie[Et];Tt.push.apply(Tt,Object(fe.a)(l(Ct,0,Qe,rt,ft,Et)))}return Tt}return Ie==null?void 0:Ie.map(function(dt,Nt){return{record:dt,indent:0,index:Nt}})},[Ie,Qe,rt,ft]);return It}var j=M("QOAJ"),G=M("VbWF");function Y(Ie){var Qe=Ie.columnKey,rt=Ie.onColumnResize,ft=R.useRef();return R.useEffect(function(){ft.current&&rt(Qe,ft.current.offsetWidth)},[]),R.createElement(g.a,{data:Qe},R.createElement("td",{ref:ft,style:{padding:0,border:0,height:0}},R.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function te(Ie){var Qe=Ie.prefixCls,rt=Ie.columnsKey,ft=Ie.onColumnResize;return R.createElement("tr",{"aria-hidden":"true",className:"".concat(Qe,"-measure-row"),style:{height:0,fontSize:0}},R.createElement(g.a.Collection,{onBatchResize:function(Tt){Tt.forEach(function(Et){var Ct=Et.data,dt=Et.size;ft(Ct,dt.offsetWidth)})}},rt.map(function(It){return R.createElement(Y,{key:It,columnKey:It,onColumnResize:ft})})))}function de(Ie){var Qe=Ie.data,rt=Ie.getRowKey,ft=Ie.measureColumnWidth,It=Ie.expandedKeys,Tt=Ie.onRow,Et=Ie.rowExpandable,Ct=Ie.emptyNode,dt=Ie.childrenColumnName,Nt=R.useContext(a),Xt=Nt.onColumnResize,Dt=R.useContext(S.a),an=Dt.prefixCls,nn=Dt.getComponent,An=R.useContext(b.a),_n=An.flattenColumns,At=F(Qe,dt,It,rt),jt=R.useRef({renderWithProps:!1}),on=R.useState(-1),Ee=Object(ae.a)(on,2),se=Ee[0],H=Ee[1],V=R.useState(-1),$=Object(ae.a)(V,2),ee=$[0],xe=$[1],Ue=R.useCallback(function(pt,xt){H(pt),xe(xt)},[]),$e=R.useMemo(function(){var pt=nn(["body","wrapper"],"tbody"),xt=nn(["body","row"],"tr"),Ve=nn(["body","cell"],"td"),ht;Qe.length?ht=At.map(function(lt,Pt){var Wt=lt.record,Bt=lt.indent,wt=lt.index,Q=rt(Wt,Pt);return R.createElement(y,{key:Q,rowKey:Q,record:Wt,recordKey:Q,index:Pt,renderIndex:wt,rowComponent:xt,cellComponent:Ve,expandedKeys:It,onRow:Tt,getRowKey:rt,rowExpandable:Et,childrenColumnName:dt,indent:Bt})}):ht=R.createElement(f,{expanded:!0,className:"".concat(an,"-placeholder"),prefixCls:an,component:xt,cellComponent:Ve,colSpan:_n.length,isEmpty:!0},Ct);var Rt=Object(I.a)(_n);return R.createElement(pt,{className:"".concat(an,"-tbody")},ft&&R.createElement(te,{prefixCls:an,columnsKey:Rt,onColumnResize:Xt}),ht)},[Qe,an,Tt,ft,It,rt,nn,Ct,_n,dt,Xt,Et,At]);return R.createElement(G.a.Provider,{value:jt.current},R.createElement(j.a.Provider,{value:{startRow:se,endRow:ee,onHover:Ue}},$e))}var ve=R.memo(de);ve.displayName="Body";var he=ve,Re=M("Gq82");function we(Ie){var Qe=Object(R.useRef)(Ie),rt=Object(R.useState)({}),ft=Object(ae.a)(rt,2),It=ft[1],Tt=Object(R.useRef)(null),Et=Object(R.useRef)([]);function Ct(dt){Et.current.push(dt);var Nt=Promise.resolve();Tt.current=Nt,Nt.then(function(){if(Tt.current===Nt){var Xt=Et.current,Dt=Qe.current;Et.current=[],Xt.forEach(function(an){Qe.current=an(Qe.current)}),Tt.current=null,Dt!==Qe.current&&It({})}})}return Object(R.useEffect)(function(){return function(){Tt.current=null}},[]),[Qe.current,Ct]}function ge(Ie){var Qe=Object(R.useRef)(Ie||null),rt=Object(R.useRef)();function ft(){window.clearTimeout(rt.current)}function It(Et){Qe.current=Et,ft(),rt.current=window.setTimeout(function(){Qe.current=null,rt.current=void 0},100)}function Tt(){return Qe.current}return Object(R.useEffect)(function(){return ft},[]),[It,Tt]}function Ne(Ie,Qe,rt){var ft=Object(R.useMemo)(function(){for(var It=[],Tt=[],Et=0,Ct=0,dt=0;dt<Qe;dt+=1)if(rt==="rtl"){Tt[dt]=Ct,Ct+=Ie[dt]||0;var Nt=Qe-dt-1;It[Nt]=Et,Et+=Ie[Nt]||0}else{It[dt]=Et,Et+=Ie[dt]||0;var Xt=Qe-dt-1;Tt[Xt]=Ct,Ct+=Ie[Xt]||0}return{left:It,right:Tt}},[Ie,Qe,rt]);return ft}var ze=Ne,nt=M("fNpE"),Ge=M("+E2i"),Xe=["columnType"];function Be(Ie){for(var Qe=Ie.colWidths,rt=Ie.columns,ft=Ie.columCount,It=[],Tt=ft||rt.length,Et=!1,Ct=Tt-1;Ct>=0;Ct-=1){var dt=Qe[Ct],Nt=rt&&rt[Ct],Xt=Nt&&Nt[Ge.a];if(dt||Xt||Et){var Dt=Xt||{},an=Dt.columnType,nn=Object(nt.a)(Dt,Xe);It.unshift(R.createElement("col",Object(ue.a)({key:Ct,style:{width:dt}},nn))),Et=!0}}return R.createElement("colgroup",null,It)}var _e=Be;function Ze(Ie){var Qe=Ie.className,rt=Ie.children;return R.createElement("div",{className:Qe},rt)}var be=Ze,Le=M("YA0V");function le(Ie){var Qe,rt=Ie.prefixCls,ft=Ie.record,It=Ie.onExpand,Tt=Ie.expanded,Et=Ie.expandable,Ct="".concat(rt,"-row-expand-icon");if(!Et)return R.createElement("span",{className:N()(Ct,"".concat(rt,"-row-spaced"))});var dt=function(Xt){It(ft,Xt),Xt.stopPropagation()};return R.createElement("span",{className:N()(Ct,(Qe={},Object(q.a)(Qe,"".concat(rt,"-row-expanded"),Tt),Object(q.a)(Qe,"".concat(rt,"-row-collapsed"),!Tt),Qe)),onClick:dt})}function ye(Ie,Qe,rt){var ft=[];function It(Tt){(Tt||[]).forEach(function(Et,Ct){ft.push(Qe(Et,Ct)),It(Et[rt])})}return It(Ie),ft}var Te=M("1bEF"),Pe=M("tty/"),He=function(Qe,rt){var ft,It,Tt=Qe.scrollBodyRef,Et=Qe.onScroll,Ct=Qe.offsetScroll,dt=Qe.container,Nt=R.useContext(S.a),Xt=Nt.prefixCls,Dt=((ft=Tt.current)===null||ft===void 0?void 0:ft.scrollWidth)||0,an=((It=Tt.current)===null||It===void 0?void 0:It.clientWidth)||0,nn=Dt&&an*(an/Dt),An=R.useRef(),_n=we({scrollLeft:0,isHiddenScrollBar:!1}),At=Object(ae.a)(_n,2),jt=At[0],on=At[1],Ee=R.useRef({delta:0,x:0}),se=R.useState(!1),H=Object(ae.a)(se,2),V=H[0],$=H[1],ee=function(){$(!1)},xe=function(Ve){Ve.persist(),Ee.current.delta=Ve.pageX-jt.scrollLeft,Ee.current.x=0,$(!0),Ve.preventDefault()},Ue=function(Ve){var ht,Rt=Ve||((ht=window)===null||ht===void 0?void 0:ht.event),lt=Rt.buttons;if(!V||lt===0){V&&$(!1);return}var Pt=Ee.current.x+Ve.pageX-Ee.current.x-Ee.current.delta;Pt<=0&&(Pt=0),Pt+nn>=an&&(Pt=an-nn),Et({scrollLeft:Pt/an*(Dt+2)}),Ee.current.x=Ve.pageX},$e=function(){if(!Tt.current)return;var Ve=Object(Pe.b)(Tt.current).top,ht=Ve+Tt.current.offsetHeight,Rt=dt===window?document.documentElement.scrollTop+window.innerHeight:Object(Pe.b)(dt).top+dt.clientHeight;ht-Object(h.a)()<=Rt||Ve>=Rt-Ct?on(function(lt){return Object(re.a)(Object(re.a)({},lt),{},{isHiddenScrollBar:!0})}):on(function(lt){return Object(re.a)(Object(re.a)({},lt),{},{isHiddenScrollBar:!1})})},pt=function(Ve){on(function(ht){return Object(re.a)(Object(re.a)({},ht),{},{scrollLeft:Ve/Dt*an||0})})};return R.useImperativeHandle(rt,function(){return{setScrollLeft:pt}}),R.useEffect(function(){var xt=Object(Te.a)(document.body,"mouseup",ee,!1),Ve=Object(Te.a)(document.body,"mousemove",Ue,!1);return $e(),function(){xt.remove(),Ve.remove()}},[nn,V]),R.useEffect(function(){var xt=Object(Te.a)(dt,"scroll",$e,!1),Ve=Object(Te.a)(window,"resize",$e,!1);return function(){xt.remove(),Ve.remove()}},[dt]),R.useEffect(function(){jt.isHiddenScrollBar||on(function(xt){var Ve=Tt.current;return Ve?Object(re.a)(Object(re.a)({},xt),{},{scrollLeft:Ve.scrollLeft/Ve.scrollWidth*Ve.clientWidth}):xt})},[jt.isHiddenScrollBar]),Dt<=an||!nn||jt.isHiddenScrollBar?null:R.createElement("div",{style:{height:Object(h.a)(),width:an,bottom:Ct},className:"".concat(Xt,"-sticky-scroll")},R.createElement("div",{onMouseDown:xe,ref:An,className:N()("".concat(Xt,"-sticky-scroll-bar"),Object(q.a)({},"".concat(Xt,"-sticky-scroll-bar-active"),V)),style:{width:"".concat(nn,"px"),transform:"translate3d(".concat(jt.scrollLeft,"px, 0, 0)")}}))},Ye=R.forwardRef(He),ct=M("Zfln"),st=Object(ct.a)()?window:null;function vt(Ie,Qe){var rt=Object(z.a)(Ie)==="object"?Ie:{},ft=rt.offsetHeader,It=ft===void 0?0:ft,Tt=rt.offsetSummary,Et=Tt===void 0?0:Tt,Ct=rt.offsetScroll,dt=Ct===void 0?0:Ct,Nt=rt.getContainer,Xt=Nt===void 0?function(){return st}:Nt,Dt=Xt()||st;return R.useMemo(function(){var an=!!Ie;return{isSticky:an,stickyClassName:an?"".concat(Qe,"-sticky-holder"):"",offsetHeader:It,offsetSummary:Et,offsetScroll:dt,container:Dt}},[dt,It,Et,Qe,Dt])}var qe=M("Eiay"),mt=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"];function yt(Ie,Qe){return Object(R.useMemo)(function(){for(var rt=[],ft=0;ft<Qe;ft+=1){var It=Ie[ft];if(It!==void 0)rt[ft]=It;else return null}return rt},[Ie.join("_"),Qe])}var Je=R.forwardRef(function(Ie,Qe){var rt=Ie.className,ft=Ie.noData,It=Ie.columns,Tt=Ie.flattenColumns,Et=Ie.colWidths,Ct=Ie.columCount,dt=Ie.stickyOffsets,Nt=Ie.direction,Xt=Ie.fixHeader,Dt=Ie.stickyTopOffset,an=Ie.stickyBottomOffset,nn=Ie.stickyClassName,An=Ie.onScroll,_n=Ie.maxContentScroll,At=Ie.children,jt=Object(nt.a)(Ie,mt),on=R.useContext(S.a),Ee=on.prefixCls,se=on.scrollbarSize,H=on.isSticky,V=H&&!Xt?0:se,$=R.useRef(null),ee=R.useCallback(function(Rt){Object(qe.b)(Qe,Rt),Object(qe.b)($,Rt)},[]);R.useEffect(function(){var Rt;function lt(Pt){var Wt=Pt.currentTarget,Bt=Pt.deltaX;Bt&&(An({currentTarget:Wt,scrollLeft:Wt.scrollLeft+Bt}),Pt.preventDefault())}return(Rt=$.current)===null||Rt===void 0||Rt.addEventListener("wheel",lt),function(){var Pt;(Pt=$.current)===null||Pt===void 0||Pt.removeEventListener("wheel",lt)}},[]);var xe=R.useMemo(function(){return Tt.every(function(Rt){return Rt.width>=0})},[Tt]),Ue=Tt[Tt.length-1],$e={fixed:Ue?Ue.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(Ee,"-cell-scrollbar")}}},pt=Object(R.useMemo)(function(){return V?[].concat(Object(fe.a)(It),[$e]):It},[V,It]),xt=Object(R.useMemo)(function(){return V?[].concat(Object(fe.a)(Tt),[$e]):Tt},[V,Tt]),Ve=Object(R.useMemo)(function(){var Rt=dt.right,lt=dt.left;return Object(re.a)(Object(re.a)({},dt),{},{left:Nt==="rtl"?[].concat(Object(fe.a)(lt.map(function(Pt){return Pt+V})),[0]):lt,right:Nt==="rtl"?Rt:[].concat(Object(fe.a)(Rt.map(function(Pt){return Pt+V})),[0]),isSticky:H})},[V,dt,H]),ht=yt(Et,Ct);return R.createElement("div",{style:Object(re.a)({overflow:"hidden"},H?{top:Dt,bottom:an}:{}),ref:ee,className:N()(rt,Object(q.a)({},nn,!!nn))},R.createElement("table",{style:{tableLayout:"fixed",visibility:ft||ht?null:"hidden"}},(!ft||!_n||xe)&&R.createElement(_e,{colWidths:ht?[].concat(Object(fe.a)(ht),[V]):[],columCount:Ct+1,columns:xt}),At(Object(re.a)(Object(re.a)({},jt),{},{stickyOffsets:Ve,columns:pt,flattenColumns:xt}))))});Je.displayName="FixedHolder";var et=Je,De=M("3GYr"),ke=M("MRIS"),Me=M("VUat"),me=[],Ce={},Oe="rc-table-internal-hook",Se=R.memo(function(Ie){var Qe=Ie.children;return Qe},function(Ie,Qe){return m()(Ie.props,Qe.props)?Ie.pingLeft!==Qe.pingLeft||Ie.pingRight!==Qe.pingRight:!1});function Fe(Ie){var Qe,rt=Ie.prefixCls,ft=Ie.className,It=Ie.rowClassName,Tt=Ie.style,Et=Ie.data,Ct=Ie.rowKey,dt=Ie.scroll,Nt=Ie.tableLayout,Xt=Ie.direction,Dt=Ie.title,an=Ie.footer,nn=Ie.summary,An=Ie.id,_n=Ie.showHeader,At=Ie.components,jt=Ie.emptyText,on=Ie.onRow,Ee=Ie.onHeaderRow,se=Ie.internalHooks,H=Ie.transformColumns,V=Ie.internalRefs,$=Ie.sticky,ee=Et||me,xe=!!ee.length,Ue=R.useCallback(function(un,fn){return Object(I.b)(At||{},un)||fn},[At]),$e=R.useMemo(function(){return typeof Ct=="function"?Ct:function(un){var fn=un&&un[Ct];return fn}},[Ct]),pt=Object(Ge.b)(Ie),xt=pt.expandIcon,Ve=pt.expandedRowKeys,ht=pt.defaultExpandedRowKeys,Rt=pt.defaultExpandAllRows,lt=pt.expandedRowRender,Pt=pt.columnTitle,Wt=pt.onExpand,Bt=pt.onExpandedRowsChange,wt=pt.expandRowByClick,Q=pt.rowExpandable,k=pt.expandIconColumnIndex,U=pt.expandedRowClassName,X=pt.childrenColumnName,ie=pt.indentSize,J=xt||le,Ae=X||"children",tt=R.useMemo(function(){return lt?"row":Ie.expandable&&se===Oe&&Ie.expandable.__PARENT_RENDER_ICON__||ee.some(function(un){return un&&Object(z.a)(un)==="object"&&un[Ae]})?"nest":!1},[!!lt,ee]),kt=R.useState(function(){return ht||(Rt?ye(ee,$e,Ae):[])}),Mt=Object(ae.a)(kt,2),gt=Mt[0],$t=Mt[1],mn=R.useMemo(function(){return new Set(Ve||gt||[])},[Ve,gt]),Mn=R.useCallback(function(un){var fn=$e(un,ee.indexOf(un)),Sn,bn=mn.has(fn);bn?(mn.delete(fn),Sn=Object(fe.a)(mn)):Sn=[].concat(Object(fe.a)(mn),[fn]),$t(Sn),Wt&&Wt(!bn,un),Bt&&Bt(Sn)},[$e,mn,ee,Wt,Bt]),lr=R.useState(0),Kn=Object(ae.a)(lr,2),ur=Kn[0],dr=Kn[1],hr=Object(Re.b)(Object(re.a)(Object(re.a)(Object(re.a)({},Ie),pt),{},{expandable:!!lt,columnTitle:Pt,expandedKeys:mn,getRowKey:$e,onTriggerExpand:Mn,expandIcon:J,expandIconColumnIndex:k,direction:Xt}),se===Oe?H:null),Dr=Object(ae.a)(hr,2),Cr=Dr[0],Wn=Dr[1],Er=R.useMemo(function(){return{columns:Cr,flattenColumns:Wn}},[Cr,Wn]),zr=R.useRef(),vi=R.useRef(),xr=R.useRef(),Zr=R.useRef(),_i=R.useRef(),yi=R.useState(!1),qr=Object(ae.a)(yi,2),di=qr[0],Pr=qr[1],Nr=R.useState(!1),Sr=Object(ae.a)(Nr,2),Qn=Sr[0],Or=Sr[1],er=we(new Map),Wr=Object(ae.a)(er,2),Rr=Wr[0],Vr=Wr[1],Ar=Object(I.a)(Wn),Ri=Ar.map(function(un){return Rr.get(un)}),Hi=R.useMemo(function(){return Ri},[Ri.join("_")]),ri=ze(Hi,Wn.length,Xt),Ur=dt&&Object(I.c)(dt.y),ci=dt&&Object(I.c)(dt.x)||Boolean(pt.fixed),ii=ci&&Wn.some(function(un){var fn=un.fixed;return fn}),$i=R.useRef(),Ni=vt($,rt),hi=Ni.isSticky,ua=Ni.offsetHeader,hn=Ni.offsetSummary,kn=Ni.offsetScroll,wn=Ni.stickyClassName,tr=Ni.container,Gn=nn==null?void 0:nn(ee),sn=(Ur||hi)&&R.isValidElement(Gn)&&Gn.type===De.a&&Gn.props.fixed,zn,Ir,Xr;Ur&&(Ir={overflowY:"scroll",maxHeight:dt.y}),ci&&(zn={overflowX:"auto"},Ur||(Ir={overflowY:"hidden"}),Xr={width:(dt==null?void 0:dt.x)===!0?"auto":dt==null?void 0:dt.x,minWidth:"100%"});var nr=R.useCallback(function(un,fn){Object(B.a)(zr.current)&&Vr(function(Sn){if(Sn.get(un)!==fn){var bn=new Map(Sn);return bn.set(un,fn),bn}return Sn})},[]),Ui=ge(null),fr=Object(ae.a)(Ui,2),ot=fr[0],St=fr[1];function Ht(un,fn){if(!fn)return;typeof fn=="function"?fn(un):fn.scrollLeft!==un&&(fn.scrollLeft=un)}var ln=function(fn){var Sn=fn.currentTarget,bn=fn.scrollLeft,yn=Xt==="rtl",En=typeof bn=="number"?bn:Sn.scrollLeft,zt=Sn||Ce;if(!St()||St()===zt){var Yt;ot(zt),Ht(En,vi.current),Ht(En,xr.current),Ht(En,_i.current),Ht(En,(Yt=$i.current)===null||Yt===void 0?void 0:Yt.setScrollLeft)}if(Sn){var qt=Sn.scrollWidth,tn=Sn.clientWidth;if(qt===tn){Pr(!1),Or(!1);return}yn?(Pr(-En<qt-tn),Or(-En>0)):(Pr(En>0),Or(En<qt-tn))}},Hn=function(){ci&&xr.current?ln({currentTarget:xr.current}):(Pr(!1),Or(!1))},Cn=function(fn){var Sn=fn.width;Sn!==ur&&(Hn(),dr(zr.current?zr.current.offsetWidth:Sn))},_t=R.useRef(!1);R.useEffect(function(){_t.current&&Hn()},[ci,Et,Cr.length]),R.useEffect(function(){_t.current=!0},[]);var Lt=R.useState(0),gn=Object(ae.a)(Lt,2),bt=gn[0],cn=gn[1],Ft=R.useState(!0),vn=Object(ae.a)(Ft,2),Vn=vn[0],Nn=vn[1];R.useEffect(function(){xr.current instanceof Element?cn(Object(h.b)(xr.current).width):cn(Object(h.b)(Zr.current).width),Nn(Object(W.a)("position","sticky"))},[]),R.useEffect(function(){se===Oe&&V&&(V.body.current=xr.current)});var Tn=Ue(["table"],"table"),Yn=R.useMemo(function(){return Nt||(ii?(dt==null?void 0:dt.x)==="max-content"?"auto":"fixed":Ur||hi||Wn.some(function(un){var fn=un.ellipsis;return fn})?"fixed":"auto")},[Ur,ii,Wn,Nt,hi]),In,$n={colWidths:Hi,columCount:Wn.length,stickyOffsets:ri,onHeaderRow:Ee,fixHeader:Ur,scroll:dt},rr=R.useMemo(function(){return xe?null:typeof jt=="function"?jt():jt},[xe,jt]),_r=R.createElement(he,{data:ee,measureColumnWidth:Ur||ci||hi,expandedKeys:mn,rowExpandable:Q,getRowKey:$e,onRow:on,emptyNode:rr,childrenColumnName:Ae}),Bn=R.createElement(_e,{colWidths:Wn.map(function(un){var fn=un.width;return fn}),columns:Wn}),gr=Ue(["body"]);if(Ur||hi){var mr;typeof gr=="function"?(mr=gr(ee,{scrollbarSize:bt,ref:xr,onScroll:ln}),$n.colWidths=Wn.map(function(un,fn){var Sn=un.width,bn=fn===Cr.length-1?Sn-bt:Sn;return typeof bn=="number"&&!Number.isNaN(bn)?bn:(Object(s.a)(!1,"When use `components.body` with render props. Each column should have a fixed `width` value."),0)})):mr=R.createElement("div",{style:Object(re.a)(Object(re.a)({},zn),Ir),onScroll:ln,ref:xr,className:N()("".concat(rt,"-body"))},R.createElement(Tn,{style:Object(re.a)(Object(re.a)({},Xr),{},{tableLayout:Yn})},Bn,_r,!sn&&Gn&&R.createElement(Le.b,{stickyOffsets:ri,flattenColumns:Wn},Gn)));var sr=Object(re.a)(Object(re.a)(Object(re.a)({noData:!ee.length,maxContentScroll:ci&&dt.x==="max-content"},$n),Er),{},{direction:Xt,stickyClassName:wn,onScroll:ln});In=R.createElement(R.Fragment,null,_n!==!1&&R.createElement(et,Object(ue.a)({},sr,{stickyTopOffset:ua,className:"".concat(rt,"-header"),ref:vi}),function(un){return R.createElement(R.Fragment,null,R.createElement(A,un),sn==="top"&&R.createElement(Le.b,un,Gn))}),mr,sn&&sn!=="top"&&R.createElement(et,Object(ue.a)({},sr,{stickyBottomOffset:hn,className:"".concat(rt,"-summary"),ref:_i}),function(un){return R.createElement(Le.b,un,Gn)}),hi&&R.createElement(Ye,{ref:$i,offsetScroll:kn,scrollBodyRef:xr,onScroll:ln,container:tr}))}else In=R.createElement("div",{style:Object(re.a)(Object(re.a)({},zn),Ir),className:N()("".concat(rt,"-content")),onScroll:ln,ref:xr},R.createElement(Tn,{style:Object(re.a)(Object(re.a)({},Xr),{},{tableLayout:Yn})},Bn,_n!==!1&&R.createElement(A,Object(ue.a)({},$n,Er)),_r,Gn&&R.createElement(Le.b,{stickyOffsets:ri,flattenColumns:Wn},Gn)));var Un=Object(n.a)(Ie,{aria:!0,data:!0}),Jn=R.createElement("div",Object(ue.a)({className:N()(rt,ft,(Qe={},Object(q.a)(Qe,"".concat(rt,"-rtl"),Xt==="rtl"),Object(q.a)(Qe,"".concat(rt,"-ping-left"),di),Object(q.a)(Qe,"".concat(rt,"-ping-right"),Qn),Object(q.a)(Qe,"".concat(rt,"-layout-fixed"),Nt==="fixed"),Object(q.a)(Qe,"".concat(rt,"-fixed-header"),Ur),Object(q.a)(Qe,"".concat(rt,"-fixed-column"),ii),Object(q.a)(Qe,"".concat(rt,"-scroll-horizontal"),ci),Object(q.a)(Qe,"".concat(rt,"-has-fix-left"),Wn[0]&&Wn[0].fixed),Object(q.a)(Qe,"".concat(rt,"-has-fix-right"),Wn[Wn.length-1]&&Wn[Wn.length-1].fixed==="right"),Qe)),style:Tt,id:An,ref:zr},Un),R.createElement(Se,{pingLeft:di,pingRight:Qn,props:Object(re.a)(Object(re.a)({},Ie),{},{stickyOffsets:ri,mergedExpandedKeys:mn})},Dt&&R.createElement(be,{className:"".concat(rt,"-title")},Dt(ee)),R.createElement("div",{ref:Zr,className:"".concat(rt,"-container")},In),an&&R.createElement(be,{className:"".concat(rt,"-footer")},an(ee))));ci&&(Jn=R.createElement(g.a,{onResize:Cn},Jn));var Xn=R.useMemo(function(){return{prefixCls:rt,getComponent:Ue,scrollbarSize:bt,direction:Xt,fixedInfoList:Wn.map(function(un,fn){return Object(w.a)(fn,fn,Wn,ri,Xt)}),isSticky:hi}},[rt,Ue,bt,Xt,Wn,ri,hi]),Vt=R.useMemo(function(){return Object(re.a)(Object(re.a)({},Er),{},{tableLayout:Yn,rowClassName:It,expandedRowClassName:U,expandIcon:J,expandableType:tt,expandRowByClick:wt,expandedRowRender:lt,onTriggerExpand:Mn,expandIconColumnIndex:k,indentSize:ie,allColumnsFixedLeft:Er.flattenColumns.every(function(un){return un.fixed==="left"})})},[Er,Yn,It,U,J,tt,wt,lt,Mn,k,ie]),Rn=R.useMemo(function(){return{componentWidth:ur,fixHeader:Ur,fixColumn:ii,horizonScroll:ci}},[ur,Ur,ii,ci]),cr=R.useMemo(function(){return{onColumnResize:nr}},[nr]);return R.createElement(ke.a.Provider,{value:Vn},R.createElement(S.a.Provider,{value:Xn},R.createElement(b.a.Provider,{value:Vt},R.createElement(p.Provider,{value:Rn},R.createElement(a.Provider,{value:cr},Jn)))))}Fe.EXPAND_COLUMN=Me.a,Fe.Column=r.a,Fe.ColumnGroup=_.a,Fe.Summary=Le.a,Fe.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var it=ce.b=Fe},kSUc:function(We,ce,M){},kYCC:function(We,ce,M){"use strict";var q=M("kQR0"),ue=M("YA0V");M.d(ce,"b",function(){return ue.a});var re=M("IEJz"),fe=M("YLkp"),ae=M("+E2i");M.d(ce,"a",function(){return ae.a}),ce.c=q.b},"kaH+":function(We,ce,M){"use strict";var q=M("dLI4"),ue=M("4d5L"),re=M("Hqw+"),fe=M("T/Jt"),ae=M.n(fe),z=M("UZu5"),R=M.n(z),B=M("dhSg"),n=M("rLCj"),W=M("dF/Y"),D=M("4i/N");ce.a=function(){var N=Object(fe.useState)(""),d=Object(re.a)(N,2),m=d[0],s=d[1],g=Object(fe.useState)(0),h=Object(re.a)(g,2),_=h[0],r=h[1],v=Object(fe.useRef)("");Object(fe.useEffect)(function(){var T=B.a.subscribe("preview-image",function(A){s(A),document.body.style.overflow="hidden"});return T},[]),Object(fe.useEffect)(function(){return document.addEventListener("keydown",S),function(){document.removeEventListener("keydown",S)}},[]),Object(fe.useEffect)(function(){v.current=m},[m]);function S(T){T.keyCode==27&&v.current&&w()}function w(){document.body.style.overflow="auto",s("")}function I(){r(_+90)}var E=Object(fe.useRef)(),x=Object(fe.useRef)(),P=function(A){(A.nativeEvent.target===E.current||A.nativeEvent.target===x.current)&&w()};return ae.a.createElement(fe.Fragment,null,m?ae.a.createElement("div",{className:"image-preview-container",ref:E,onClick:P},ae.a.createElement("div",{className:"button-group"},ae.a.createElement(ue.a,{onClick:I},"\u65CB\u8F6C",ae.a.createElement(n.a,null)),ae.a.createElement(ue.a,{href:m},"\u4E0B\u8F7D",ae.a.createElement(W.a,null)),ae.a.createElement(ue.a,{onClick:w},"\u5173\u95ED",ae.a.createElement(D.a,null))),ae.a.createElement("div",{className:"preview-wrp-group",ref:x},ae.a.createElement("img",{className:"image-preview",src:m,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(_,"deg)")}}))):null)}},kovY:function(We,ce,M){We.exports=M.p+"static/e.528a21cb.svg"},lOMy:function(We,ce,M){},lZu9:function(We,ce,M){(function(q){q(M("VrN/"),M("1eCo"),M("8EBN"))})(function(q){"use strict";q.defineMode("markdown",function(ue,re){var fe=q.getMode(ue,"text/html"),ae=fe.name=="null";function z(y){if(q.findModeByName){var l=q.findModeByName(y);l&&(y=l.mime||l.mimes[0])}var F=q.getMode(ue,y);return F.name=="null"?null:F}re.highlightFormatting===void 0&&(re.highlightFormatting=!1),re.maxBlockquoteDepth===void 0&&(re.maxBlockquoteDepth=0),re.taskLists===void 0&&(re.taskLists=!1),re.strikethrough===void 0&&(re.strikethrough=!1),re.emoji===void 0&&(re.emoji=!1),re.fencedCodeBlockHighlighting===void 0&&(re.fencedCodeBlockHighlighting=!0),re.fencedCodeBlockDefaultMode===void 0&&(re.fencedCodeBlockDefaultMode="text/plain"),re.xml===void 0&&(re.xml=!0),re.tokenTypeOverrides===void 0&&(re.tokenTypeOverrides={});var R={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 B in R)R.hasOwnProperty(B)&&re.tokenTypeOverrides[B]&&(R[B]=re.tokenTypeOverrides[B]);var n=/^([*\-_])(?:\s*\1){2,}\s*$/,W=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,D=/^\[(x| )\](?=\s)/i,N=re.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,d=/^ {0,3}(?:\={1,}|-{2,})\s*$/,m=/^[^#!\[\]*_\\<>` "'(~:]+/,s=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,g=/^\s*\[[^\]]+?\]:.*$/,h=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,_=" ";function r(y,l,F){return l.f=l.inline=F,F(y,l)}function v(y,l,F){return l.f=l.block=F,F(y,l)}function S(y){return!y||!/\S/.test(y.string)}function w(y){if(y.linkTitle=!1,y.linkHref=!1,y.linkText=!1,y.em=!1,y.strong=!1,y.strikethrough=!1,y.quote=0,y.indentedCode=!1,y.f==E){var l=ae;if(!l){var F=q.innerMode(fe,y.htmlState);l=F.mode.name=="xml"&&F.state.tagStart===null&&!F.state.context&&F.state.tokenize.isInText}l&&(y.f=A,y.block=I,y.htmlState=null)}return y.trailingSpace=0,y.trailingSpaceNewLine=!1,y.prevLine=y.thisLine,y.thisLine={stream:null},null}function I(y,l){var F=y.column()===l.indentation,j=S(l.prevLine.stream),G=l.indentedCode,Y=l.prevLine.hr,te=l.list!==!1,de=(l.listStack[l.listStack.length-1]||0)+3;l.indentedCode=!1;var ve=l.indentation;if(l.indentationDiff===null&&(l.indentationDiff=l.indentation,te)){for(l.list=null;ve<l.listStack[l.listStack.length-1];)l.listStack.pop(),l.listStack.length?l.indentation=l.listStack[l.listStack.length-1]:l.list=!1;l.list!==!1&&(l.indentationDiff=ve-l.listStack[l.listStack.length-1])}var he=!j&&!Y&&!l.prevLine.header&&(!te||!G)&&!l.prevLine.fencedCodeEnd,Re=(l.list===!1||Y||j)&&l.indentation<=de&&y.match(n),we=null;if(l.indentationDiff>=4&&(G||l.prevLine.fencedCodeEnd||l.prevLine.header||j))return y.skipToEnd(),l.indentedCode=!0,R.code;if(y.eatSpace())return null;if(F&&l.indentation<=de&&(we=y.match(N))&&we[1].length<=6)return l.quote=0,l.header=we[1].length,l.thisLine.header=!0,re.highlightFormatting&&(l.formatting="header"),l.f=l.inline,P(l);if(l.indentation<=de&&y.eat(">"))return l.quote=F?1:l.quote+1,re.highlightFormatting&&(l.formatting="quote"),y.eatSpace(),P(l);if(!Re&&!l.setext&&F&&l.indentation<=de&&(we=y.match(W))){var ge=we[1]?"ol":"ul";return l.indentation=ve+y.current().length,l.list=!0,l.quote=0,l.listStack.push(l.indentation),l.em=!1,l.strong=!1,l.code=!1,l.strikethrough=!1,re.taskLists&&y.match(D,!1)&&(l.taskList=!0),l.f=l.inline,re.highlightFormatting&&(l.formatting=["list","list-"+ge]),P(l)}else{if(F&&l.indentation<=de&&(we=y.match(s,!0)))return l.quote=0,l.fencedEndRE=new RegExp(we[1]+"+ *$"),l.localMode=re.fencedCodeBlockHighlighting&&z(we[2]||re.fencedCodeBlockDefaultMode),l.localMode&&(l.localState=q.startState(l.localMode)),l.f=l.block=x,re.highlightFormatting&&(l.formatting="code-block"),l.code=-1,P(l);if(l.setext||(!he||!te)&&!l.quote&&l.list===!1&&!l.code&&!Re&&!g.test(y.string)&&(we=y.lookAhead(1))&&(we=we.match(d)))return l.setext?(l.header=l.setext,l.setext=0,y.skipToEnd(),re.highlightFormatting&&(l.formatting="header")):(l.header=we[0].charAt(0)=="="?1:2,l.setext=l.header),l.thisLine.header=!0,l.f=l.inline,P(l);if(Re)return y.skipToEnd(),l.hr=!0,l.thisLine.hr=!0,R.hr;if(y.peek()==="[")return r(y,l,f)}return r(y,l,l.inline)}function E(y,l){var F=fe.token(y,l.htmlState);if(!ae){var j=q.innerMode(fe,l.htmlState);(j.mode.name=="xml"&&j.state.tagStart===null&&!j.state.context&&j.state.tokenize.isInText||l.md_inside&&y.current().indexOf(">")>-1)&&(l.f=A,l.block=I,l.htmlState=null)}return F}function x(y,l){var F=l.listStack[l.listStack.length-1]||0,j=l.indentation<F,G=F+3;if(l.fencedEndRE&&l.indentation<=G&&(j||y.match(l.fencedEndRE))){re.highlightFormatting&&(l.formatting="code-block");var Y;return j||(Y=P(l)),l.localMode=l.localState=null,l.block=I,l.f=A,l.fencedEndRE=null,l.code=0,l.thisLine.fencedCodeEnd=!0,j?v(y,l,l.block):Y}else return l.localMode?l.localMode.token(y,l.localState):(y.skipToEnd(),R.code)}function P(y){var l=[];if(y.formatting){l.push(R.formatting),typeof y.formatting=="string"&&(y.formatting=[y.formatting]);for(var F=0;F<y.formatting.length;F++)l.push(R.formatting+"-"+y.formatting[F]),y.formatting[F]==="header"&&l.push(R.formatting+"-"+y.formatting[F]+"-"+y.header),y.formatting[F]==="quote"&&(!re.maxBlockquoteDepth||re.maxBlockquoteDepth>=y.quote?l.push(R.formatting+"-"+y.formatting[F]+"-"+y.quote):l.push("error"))}if(y.taskOpen)return l.push("meta"),l.length?l.join(" "):null;if(y.taskClosed)return l.push("property"),l.length?l.join(" "):null;if(y.linkHref?l.push(R.linkHref,"url"):(y.strong&&l.push(R.strong),y.em&&l.push(R.em),y.strikethrough&&l.push(R.strikethrough),y.emoji&&l.push(R.emoji),y.linkText&&l.push(R.linkText),y.code&&l.push(R.code),y.image&&l.push(R.image),y.imageAltText&&l.push(R.imageAltText,"link"),y.imageMarker&&l.push(R.imageMarker)),y.header&&l.push(R.header,R.header+"-"+y.header),y.quote&&(l.push(R.quote),!re.maxBlockquoteDepth||re.maxBlockquoteDepth>=y.quote?l.push(R.quote+"-"+y.quote):l.push(R.quote+"-"+re.maxBlockquoteDepth)),y.list!==!1){var j=(y.listStack.length-1)%3;j?j===1?l.push(R.list2):l.push(R.list3):l.push(R.list1)}return y.trailingSpaceNewLine?l.push("trailing-space-new-line"):y.trailingSpace&&l.push("trailing-space-"+(y.trailingSpace%2?"a":"b")),l.length?l.join(" "):null}function T(y,l){return y.match(m,!0)?P(l):void 0}function A(y,l){var F=l.text(y,l);if(typeof F!="undefined")return F;if(l.list)return l.list=null,P(l);if(l.taskList){var j=y.match(D,!0)[1]===" ";return j?l.taskOpen=!0:l.taskClosed=!0,re.highlightFormatting&&(l.formatting="task"),l.taskList=!1,P(l)}if(l.taskOpen=!1,l.taskClosed=!1,l.header&&y.match(/^#+$/,!0))return re.highlightFormatting&&(l.formatting="header"),P(l);var G=y.next();if(l.linkTitle){l.linkTitle=!1;var Y=G;G==="("&&(Y=")"),Y=(Y+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var te="^\\s*(?:[^"+Y+"\\\\]+|\\\\\\\\|\\\\.)"+Y;if(y.match(new RegExp(te),!0))return R.linkHref}if(G==="`"){var de=l.formatting;re.highlightFormatting&&(l.formatting="code"),y.eatWhile("`");var ve=y.current().length;if(l.code==0&&(!l.quote||ve==1))return l.code=ve,P(l);if(ve==l.code){var he=P(l);return l.code=0,he}else return l.formatting=de,P(l)}else if(l.code)return P(l);if(G==="\\"&&(y.next(),re.highlightFormatting)){var Re=P(l),we=R.formatting+"-escape";return Re?Re+" "+we:we}if(G==="!"&&y.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return l.imageMarker=!0,l.image=!0,re.highlightFormatting&&(l.formatting="image"),P(l);if(G==="["&&l.imageMarker&&y.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return l.imageMarker=!1,l.imageAltText=!0,re.highlightFormatting&&(l.formatting="image"),P(l);if(G==="]"&&l.imageAltText){re.highlightFormatting&&(l.formatting="image");var Re=P(l);return l.imageAltText=!1,l.image=!1,l.inline=l.f=C,Re}if(G==="["&&!l.image)return l.linkText&&y.match(/^.*?\]/)||(l.linkText=!0,re.highlightFormatting&&(l.formatting="link")),P(l);if(G==="]"&&l.linkText){re.highlightFormatting&&(l.formatting="link");var Re=P(l);return l.linkText=!1,l.inline=l.f=y.match(/\(.*?\)| ?\[.*?\]/,!1)?C:A,Re}if(G==="<"&&y.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){l.f=l.inline=b,re.highlightFormatting&&(l.formatting="link");var Re=P(l);return Re?Re+=" ":Re="",Re+R.linkInline}if(G==="<"&&y.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){l.f=l.inline=b,re.highlightFormatting&&(l.formatting="link");var Re=P(l);return Re?Re+=" ":Re="",Re+R.linkEmail}if(re.xml&&G==="<"&&y.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ge=y.string.indexOf(">",y.pos);if(ge!=-1){var Ne=y.string.substring(y.start,ge);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ne)&&(l.md_inside=!0)}return y.backUp(1),l.htmlState=q.startState(fe),v(y,l,E)}if(re.xml&&G==="<"&&y.match(/^\/\w*?>/))return l.md_inside=!1,"tag";if(G==="*"||G==="_"){for(var ze=1,nt=y.pos==1?" ":y.string.charAt(y.pos-2);ze<3&&y.eat(G);)ze++;var Ge=y.peek()||" ",Xe=!/\s/.test(Ge)&&(!h.test(Ge)||/\s/.test(nt)||h.test(nt)),Be=!/\s/.test(nt)&&(!h.test(nt)||/\s/.test(Ge)||h.test(Ge)),_e=null,Ze=null;if(ze%2&&(!l.em&&Xe&&(G==="*"||!Be||h.test(nt))?_e=!0:l.em==G&&Be&&(G==="*"||!Xe||h.test(Ge))&&(_e=!1)),ze>1&&(!l.strong&&Xe&&(G==="*"||!Be||h.test(nt))?Ze=!0:l.strong==G&&Be&&(G==="*"||!Xe||h.test(Ge))&&(Ze=!1)),Ze!=null||_e!=null){re.highlightFormatting&&(l.formatting=_e==null?"strong":Ze==null?"em":"strong em"),_e===!0&&(l.em=G),Ze===!0&&(l.strong=G);var he=P(l);return _e===!1&&(l.em=!1),Ze===!1&&(l.strong=!1),he}}else if(G===" "&&(y.eat("*")||y.eat("_"))){if(y.peek()===" ")return P(l);y.backUp(1)}if(re.strikethrough){if(G==="~"&&y.eatWhile(G)){if(l.strikethrough){re.highlightFormatting&&(l.formatting="strikethrough");var he=P(l);return l.strikethrough=!1,he}else if(y.match(/^[^\s]/,!1))return l.strikethrough=!0,re.highlightFormatting&&(l.formatting="strikethrough"),P(l)}else if(G===" "&&y.match(/^~~/,!0)){if(y.peek()===" ")return P(l);y.backUp(2)}}if(re.emoji&&G===":"&&y.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){l.emoji=!0,re.highlightFormatting&&(l.formatting="emoji");var be=P(l);return l.emoji=!1,be}return G===" "&&(y.match(/^ +$/,!1)?l.trailingSpace++:l.trailingSpace&&(l.trailingSpaceNewLine=!0)),P(l)}function b(y,l){var F=y.next();if(F===">"){l.f=l.inline=A,re.highlightFormatting&&(l.formatting="link");var j=P(l);return j?j+=" ":j="",j+R.linkInline}return y.match(/^[^>]+/,!0),R.linkInline}function C(y,l){if(y.eatSpace())return null;var F=y.next();return F==="("||F==="["?(l.f=l.inline=i(F==="("?")":"]"),re.highlightFormatting&&(l.formatting="link-string"),l.linkHref=!0,P(l)):"error"}var p={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function i(y){return function(l,F){var j=l.next();if(j===y){F.f=F.inline=A,re.highlightFormatting&&(F.formatting="link-string");var G=P(F);return F.linkHref=!1,G}return l.match(p[y]),F.linkHref=!0,P(F)}}function f(y,l){return y.match(/^([^\]\\]|\\.)*\]:/,!1)?(l.f=o,y.next(),re.highlightFormatting&&(l.formatting="link"),l.linkText=!0,P(l)):r(y,l,A)}function o(y,l){if(y.match(/^\]:/,!0)){l.f=l.inline=a,re.highlightFormatting&&(l.formatting="link");var F=P(l);return l.linkText=!1,F}return y.match(/^([^\]\\]|\\.)+/,!0),R.linkText}function a(y,l){return y.eatSpace()?null:(y.match(/^[^\s]+/,!0),y.peek()===void 0?l.linkTitle=!0:y.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),l.f=l.inline=A,R.linkHref+" url")}var L={startState:function(){return{f:I,prevLine:{stream:null},thisLine:{stream:null},block:I,htmlState:null,indentation:0,inline:A,text:T,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(y){return{f:y.f,prevLine:y.prevLine,thisLine:y.thisLine,block:y.block,htmlState:y.htmlState&&q.copyState(fe,y.htmlState),indentation:y.indentation,localMode:y.localMode,localState:y.localMode?q.copyState(y.localMode,y.localState):null,inline:y.inline,text:y.text,formatting:!1,linkText:y.linkText,linkTitle:y.linkTitle,linkHref:y.linkHref,code:y.code,em:y.em,strong:y.strong,strikethrough:y.strikethrough,emoji:y.emoji,header:y.header,setext:y.setext,hr:y.hr,taskList:y.taskList,list:y.list,listStack:y.listStack.slice(0),quote:y.quote,indentedCode:y.indentedCode,trailingSpace:y.trailingSpace,trailingSpaceNewLine:y.trailingSpaceNewLine,md_inside:y.md_inside,fencedEndRE:y.fencedEndRE}},token:function(y,l){if(l.formatting=!1,y!=l.thisLine.stream){if(l.header=0,l.hr=!1,y.match(/^\s*$/,!0))return w(l),null;if(l.prevLine=l.thisLine,l.thisLine={stream:y},l.taskList=!1,l.trailingSpace=0,l.trailingSpaceNewLine=!1,!l.localState&&(l.f=l.block,l.f!=E)){var F=y.match(/^\s*/,!0)[0].replace(/\t/g,_).length;if(l.indentation=F,l.indentationDiff=null,F>0)return null}}return l.f(y,l)},innerMode:function(y){return y.block==E?{state:y.htmlState,mode:fe}:y.localState?{state:y.localState,mode:y.localMode}:{state:y,mode:L}},indent:function(y,l,F){return y.block==E&&fe.indent?fe.indent(y.htmlState,l,F):y.localState&&y.localMode.indent?y.localMode.indent(y.localState,l,F):q.Pass},blankLine:w,getType:P,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return L},"xml"),q.defineMIME("text/markdown","markdown"),q.defineMIME("text/x-markdown","markdown")})},nCk5:function(We,ce,M){We.exports=M.p+"static/d.d198d73b.svg"},nEHx:function(We,ce,M){"use strict";M.d(ce,"a",function(){return q});var q;(function(ue){ue.DARK="dark",ue.LIGHT="light",ue.HIGH_CONTRAST="hc"})(q||(q={}))},nWbc:function(We,ce,M){},nnTU:function(We,ce,M){"use strict";M.d(ce,"b",function(){return R}),M.d(ce,"a",function(){return B});var q=M("MI8n"),ue=M("JYp7"),re=M("pmY6"),fe=M("24hK"),ae=M("746U"),z=M("Cg/j");const R=Object(z.c)("commandService"),B=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new q.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,W){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!W)throw new Error("invalid command");return this.registerCommand({id:n,handler:W})}if(n.description){const s=[];for(let h of n.description.args)s.push(h.constraint);const g=n.handler;n.handler=function(h,..._){return Object(ae.o)(_,s),g(h,..._)}}const{id:D}=n;let N=this._commands.get(D);N||(N=new fe.a,this._commands.set(D,N));let d=N.unshift(n),m=Object(re.i)(()=>{d();const s=this._commands.get(D);(s==null?void 0:s.isEmpty())&&this._commands.delete(D)});return this._onDidRegisterCommand.fire(D),m}registerCommandAlias(n,W){return B.registerCommand(n,(D,...N)=>D.get(R).executeCommand(W,...N))}getCommand(n){const W=this._commands.get(n);return!W||W.isEmpty()?void 0:ue.a.first(W)}getCommands(){const n=new Map;for(const W of this._commands.keys()){const D=this.getCommand(W);D&&n.set(W,D)}return n}};B.registerCommand("noop",()=>{})},o46R:function(We,ce,M){"use strict";M.d(ce,"a",function(){return re});var q=M("U8pU");function ue(fe,ae){if(Object(q.a)(fe)!=="object"||fe===null)return fe;var z=fe[Symbol.toPrimitive];if(z!==void 0){var R=z.call(fe,ae||"default");if(Object(q.a)(R)!=="object")return R;throw new TypeError("@@toPrimitive must return a primitive value.")}return(ae==="string"?String:Number)(fe)}function re(fe){var ae=ue(fe,"string");return Object(q.a)(ae)==="symbol"?ae:String(ae)}},oE5q:function(We,ce,M){We.exports=M.p+"static/t.bba328b8.svg"},oFv4:function(We,ce,M){We.exports=M.p+"static/internal.da228387.png"},osHv:function(We,ce,M){(function(q){q(M("VrN/"))})(function(q){"use strict";var ue=q.Pos;function re(h,_){return h.line-_.line||h.ch-_.ch}var fe="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",ae=fe+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",z=new RegExp("<(/?)(["+fe+"]["+ae+"]*)","g");function R(h,_,r,v){this.line=_,this.ch=r,this.cm=h,this.text=h.getLine(_),this.min=v?Math.max(v.from,h.firstLine()):h.firstLine(),this.max=v?Math.min(v.to-1,h.lastLine()):h.lastLine()}function B(h,_){var r=h.cm.getTokenTypeAt(ue(h.line,_));return r&&/\btag\b/.test(r)}function n(h){return h.line>=h.max?void 0:(h.ch=0,h.text=h.cm.getLine(++h.line),!0)}function W(h){return h.line<=h.min?void 0:(h.text=h.cm.getLine(--h.line),h.ch=h.text.length,!0)}function D(h){for(;;){var _=h.text.indexOf(">",h.ch);if(_==-1){if(n(h))continue;return}if(!B(h,_+1)){h.ch=_+1;continue}var r=h.text.lastIndexOf("/",_),v=r>-1&&!/\S/.test(h.text.slice(r+1,_));return h.ch=_+1,v?"selfClose":"regular"}}function N(h){for(;;){var _=h.ch?h.text.lastIndexOf("<",h.ch-1):-1;if(_==-1){if(W(h))continue;return}if(!B(h,_+1)){h.ch=_;continue}z.lastIndex=_,h.ch=_;var r=z.exec(h.text);if(r&&r.index==_)return r}}function d(h){for(;;){z.lastIndex=h.ch;var _=z.exec(h.text);if(!_){if(n(h))continue;return}if(!B(h,_.index+1)){h.ch=_.index+1;continue}return h.ch=_.index+_[0].length,_}}function m(h){for(;;){var _=h.ch?h.text.lastIndexOf(">",h.ch-1):-1;if(_==-1){if(W(h))continue;return}if(!B(h,_+1)){h.ch=_;continue}var r=h.text.lastIndexOf("/",_),v=r>-1&&!/\S/.test(h.text.slice(r+1,_));return h.ch=_+1,v?"selfClose":"regular"}}function s(h,_){for(var r=[];;){var v=d(h),S,w=h.line,I=h.ch-(v?v[0].length:0);if(!v||!(S=D(h)))return;if(S=="selfClose")continue;if(v[1]){for(var E=r.length-1;E>=0;--E)if(r[E]==v[2]){r.length=E;break}if(E<0&&(!_||_==v[2]))return{tag:v[2],from:ue(w,I),to:ue(h.line,h.ch)}}else r.push(v[2])}}function g(h,_){for(var r=[];;){var v=m(h);if(!v)return;if(v=="selfClose"){N(h);continue}var S=h.line,w=h.ch,I=N(h);if(!I)return;if(I[1])r.push(I[2]);else{for(var E=r.length-1;E>=0;--E)if(r[E]==I[2]){r.length=E;break}if(E<0&&(!_||_==I[2]))return{tag:I[2],from:ue(h.line,h.ch),to:ue(S,w)}}}}q.registerHelper("fold","xml",function(h,_){for(var r=new R(h,_.line,0);;){var v=d(r);if(!v||r.line!=_.line)return;var S=D(r);if(!S)return;if(!v[1]&&S!="selfClose"){var w=ue(r.line,r.ch),I=s(r,v[2]);return I&&re(I.from,w)>0?{from:w,to:I.from}:null}}}),q.findMatchingTag=function(h,_,r){var v=new R(h,_.line,_.ch,r);if(v.text.indexOf(">")==-1&&v.text.indexOf("<")==-1)return;var S=D(v),w=S&&ue(v.line,v.ch),I=S&&N(v);if(!S||!I||re(v,_)>0)return;var E={from:ue(v.line,v.ch),to:w,tag:I[2]};return S=="selfClose"?{open:E,close:null,at:"open"}:I[1]?{open:g(v,I[2]),close:E,at:"close"}:(v=new R(h,w.line,w.ch,r),{open:E,close:s(v,I[2]),at:"open"})},q.findEnclosingTag=function(h,_,r,v){for(var S=new R(h,_.line,_.ch,r);;){var w=g(S,v);if(!w)break;var I=new R(h,_.line,_.ch,r),E=s(I,w.tag);if(E)return{open:w,close:E}}},q.scanForClosingTag=function(h,_,r,v){var S=new R(h,_.line,_.ch,v?{from:0,to:v}:null);return s(S,r)}})},p5ED:function(We,ce,M){"use strict";var q=M("dLI4"),ue=M("4d5L"),re=M("YfA7"),fe=M("e4Gi"),ae=M("YaWb"),z=M("IYef"),R=M("Hqw+"),B=M("XXmO"),n=M.n(B),W=M("T/Jt"),D=M.n(W),N=M("vHTk"),d=M.n(N),m=M("yEEn"),s=M("ZW9T"),g=M("1vsH"),h=M("V0Rq"),_=M("m3rI");ce.a=function(r){var v,S,w,I,E,x,P,T=r.editOffice,A=T===void 0?"view":T,b=r.data,C=r.theme,p=r.type,i=r.filename,f=r.monacoEditor,o=r.className,a=r.style,L=r.close,y=r.onClose,l=r.hasMask,F=r.disabledDownload,j=Object(W.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),G=Object(R.a)(j,2),Y=G[0],te=G[1],de=Object(W.useState)(""),ve=Object(R.a)(de,2),he=ve[0],Re=ve[1],we=Object(W.useState)(),ge=Object(R.a)(we,2),Ne=ge[0],ze=ge[1],nt=window.ENV==="build"?"/react/build":"",Ge=_.a.PROXY_SERVER||location.origin,Xe,Be=1024*1024,_e=10*Be,Ze=Object(W.useRef)();(v=b)!==null&&v!==void 0&&v.startsWith("/api")&&p!=="txt"&&(b=_.a.API_SERVER+b),p==="office"&&(Xe=Object(g.U)(b).filesize,Xe>_e&&(p="other")),i&&f&&(f.filename=i),Object(W.useEffect)(function(){var ye,Te,Pe=(ye=document.cookie)===null||ye===void 0||((Te=ye.replace(/\s/g,""))===null||Te===void 0)?void 0:Te.split(";");Pe==null||Pe.map(function(He){var Ye=He.split("=");Ye[0]==="_educoder_session"&&Re(Ye[1])})},[]),Object(W.useEffect)(function(){p==="office"&&be()},[p,b]);var be=function(){var ye=Object(z.a)(n.a.mark(function Te(){var Pe,He,Ye;return n.a.wrap(function(st){for(;;)switch(st.prev=st.next){case 0:return console.log("data:",b),Pe=b,b.startsWith("http")||(Pe=location.origin+Pe),He=new URL(Pe).pathname.split("/").pop(),st.next=6,Object(h.V)({attachment_id:He});case 6:Ye=st.sent,ze(Ye);case 8:case"end":return st.stop()}},Te)}));return function(){return ye.apply(this,arguments)}}(),Le=function(){if(b.startsWith("http")||b.startsWith("blob:")){le();return}Object(g.z)(i||"educoder",b,i)},le=function(){Object(g.x)(i||"educoder",decodeURIComponent(b))};return D.a.createElement("div",{style:Object(ae.a)({},a||{}),className:"".concat(l&&d.a.bgBlack," ").concat(p?d.a.wrp:"hide")},L&&D.a.createElement("div",{className:d.a.close,ref:Ze},!F&&D.a.createElement(fe.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ze.current}},D.a.createElement("span",{onClick:le},D.a.createElement("i",{className:"icon-quxiaozhiding"}))),D.a.createElement(fe.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ze.current}},D.a.createElement("span",{className:"",onClick:y},D.a.createElement("i",{className:"icon-guanbi1"})))),D.a.createElement("div",{className:"".concat(d.a[o]," ").concat(o," ").concat(d.a.monaco," ").concat(p==="txt"?"show":"hide")},p==="txt"&&D.a.createElement(s.b,f)),p==="audio"&&D.a.createElement("audio",{src:"".concat(((S=b)===null||S===void 0?void 0:S.indexOf("http://"))>-1||((w=b)===null||w===void 0?void 0:w.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(b),autoPlay:!0}),p==="video"&&D.a.createElement(D.a.Fragment,null,((I=b)===null||I===void 0?void 0:I.indexOf("http"))>-1?D.a.createElement("video",{controls:!0,src:"".concat(b),autoPlay:!0}):D.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(b),autoPlay:!0})),p==="office"&&Ne&&D.a.createElement("iframe",{src:"".concat(nt,"/office.html?key=").concat(Ne.key,"&url=").concat(Ge+Ne.url,"&callbackUrl=").concat(Ge+Ne.callbackUrl,"&fileType=").concat(Ne.fileType,"&title=").concat(Ne.title,"&model=").concat(A,"&officeServer=").concat(_.a.OFFICE_SERVER,"&disabledDownload=").concat(!!F)}),p==="html"&&D.a.createElement("iframe",{src:b+"&disposition=inline"}),p==="pdf"&&D.a.createElement("iframe",{src:"".concat(nt,"/js/pdfview/index.html?url=").concat(b,"&disabledDownload=").concat(!!F)}),p==="image"&&D.a.createElement("img",{src:"".concat(((E=b)===null||E===void 0?void 0:E.indexOf("http://"))>-1||((x=b)===null||x===void 0?void 0:x.indexOf("https://"))>-1||(P=b)!==null&&P!==void 0&&P.startsWith("/api")?"":"data:image/png;base64,").concat(b)}),p==="other"&&D.a.createElement("div",null,D.a.createElement(ue.a,{type:"primary",size:"large",onClick:Le},D.a.createElement(m.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),p==="download"&&D.a.createElement(ue.a,{type:"primary",size:"large",onClick:Le},D.a.createElement(m.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(We,ce,M){},pYxM:function(We,ce,M){We.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(We,ce,M){"use strict";M.d(ce,"h",function(){return W}),M.d(ce,"g",function(){return N}),M.d(ce,"f",function(){return d}),M.d(ce,"e",function(){return m}),M.d(ce,"i",function(){return s}),M.d(ce,"b",function(){return g}),M.d(ce,"a",function(){return h}),M.d(ce,"d",function(){return _}),M.d(ce,"c",function(){return r});var q=M("C/vA"),ue=M("JYp7");const re=!1;let fe=null;function ae(v){fe=v}if(re){const v="__is_disposable_tracked__";ae(new class{trackDisposable(S){const w=new Error("Potentially leaked disposable").stack;setTimeout(()=>{S[v]||console.log(w)},3e3)}setParent(S,w){if(S&&S!==h.None)try{S[v]=!0}catch(I){}}markAsDisposed(S){if(S&&S!==h.None)try{S[v]=!0}catch(w){}}markAsSingleton(S){}})}function z(v){return fe==null||fe.trackDisposable(v),v}function R(v){fe==null||fe.markAsDisposed(v)}function B(v,S){fe==null||fe.setParent(v,S)}function n(v,S){if(!fe)return;for(const w of v)fe.setParent(w,S)}function W(v){return fe==null||fe.markAsSingleton(v),v}class D extends Error{constructor(v){super(`Encountered errors while disposing of store. Errors: [${v.join(", ")}]`);this.errors=v}}function N(v){return typeof v.dispose=="function"&&v.dispose.length===0}function d(v){if(ue.a.is(v)){let S=[];for(const w of v)if(w)try{w.dispose()}catch(I){S.push(I)}if(S.length===1)throw S[0];if(S.length>1)throw new D(S);return Array.isArray(v)?[]:v}else if(v)return v.dispose(),v}function m(...v){const S=s(()=>d(v));return n(v,S),S}function s(v){const S=z({dispose:Object(q.a)(()=>{R(S),v()})});return S}class g{constructor(){this._toDispose=new Set,this._isDisposed=!1,z(this)}dispose(){if(this._isDisposed)return;R(this),this._isDisposed=!0,this.clear()}clear(){try{d(this._toDispose.values())}finally{this._toDispose.clear()}}add(v){if(!v)return v;if(v===this)throw new Error("Cannot register a disposable on itself!");return B(v,this),this._isDisposed?g.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(v),v}}g.DISABLE_DISPOSED_WARNING=!1;class h{constructor(){this._store=new g,z(this),B(this._store,this)}dispose(){R(this),this._store.dispose()}_register(v){if(v===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(v)}}h.None=Object.freeze({dispose(){}});class _{constructor(){this._isDisposed=!1,z(this)}get value(){return this._isDisposed?void 0:this._value}set value(v){var S;if(this._isDisposed||v===this._value)return;(S=this._value)===null||S===void 0||S.dispose(),v&&B(v,this),this._value=v}clear(){this.value=void 0}dispose(){var v;this._isDisposed=!0,R(this),(v=this._value)===null||v===void 0||v.dispose(),this._value=void 0}clearAndLeak(){const v=this._value;return this._value=void 0,v&&B(v,null),v}}class r{constructor(v){this.object=v}dispose(){}}},ps8w:function(We,ce,M){We.exports=M.p+"static/show.76eb9b3c.svg"},psGv:function(We,ce,M){var q,ue;(function(){var re;(function(){"use strict";var R=[,,function(D){function N(s){this.__parent=s,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}N.prototype.clone_empty=function(){var s=new N(this.__parent);return s.set_indent(this.__indent_count,this.__alignment_count),s},N.prototype.item=function(s){return s<0?this.__items[this.__items.length+s]:this.__items[s]},N.prototype.has_match=function(s){for(var g=this.__items.length-1;g>=0;g--)if(this.__items[g].match(s))return!0;return!1},N.prototype.set_indent=function(s,g){this.is_empty()&&(this.__indent_count=s||0,this.__alignment_count=g||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},N.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)},N.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},N.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var s=this.__parent.current_line;return s.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),s.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),s.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,s.__items[0]===" "&&(s.__items.splice(0,1),s.__character_count-=1),!0}return!1},N.prototype.is_empty=function(){return this.__items.length===0},N.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},N.prototype.push=function(s){this.__items.push(s);var g=s.lastIndexOf(`
`);g!==-1?this.__character_count=s.length-g:this.__character_count+=s.length},N.prototype.pop=function(){var s=null;return this.is_empty()||(s=this.__items.pop(),this.__character_count-=s.length),s},N.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},N.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},N.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},N.prototype.toString=function(){var s="";return this.is_empty()?this.__parent.indent_empty_lines&&(s=this.__parent.get_indent_string(this.__indent_count)):(s=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),s+=this.__items.join("")),s};function d(s,g){this.__cache=[""],this.__indent_size=s.indent_size,this.__indent_string=s.indent_char,s.indent_with_tabs||(this.__indent_string=new Array(s.indent_size+1).join(s.indent_char)),g=g||"",s.indent_level>0&&(g=new Array(s.indent_level+1).join(this.__indent_string)),this.__base_string=g,this.__base_string_length=g.length}d.prototype.get_indent_size=function(s,g){var h=this.__base_string_length;return g=g||0,s<0&&(h=0),h+=s*this.__indent_size,h+=g,h},d.prototype.get_indent_string=function(s,g){var h=this.__base_string;return g=g||0,s<0&&(s=0,h=""),g+=s*this.__indent_size,this.__ensure_cache(g),h+=this.__cache[g],h},d.prototype.__ensure_cache=function(s){for(;s>=this.__cache.length;)this.__add_column()},d.prototype.__add_column=function(){var s=this.__cache.length,g=0,h="";this.__indent_size&&s>=this.__indent_size&&(g=Math.floor(s/this.__indent_size),s-=g*this.__indent_size,h=new Array(g+1).join(this.__indent_string)),s&&(h+=new Array(s+1).join(" ")),this.__cache.push(h)};function m(s,g){this.__indent_cache=new d(s,g),this.raw=!1,this._end_with_newline=s.end_with_newline,this.indent_size=s.indent_size,this.wrap_line_length=s.wrap_line_length,this.indent_empty_lines=s.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new N(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(s,g){return this.__indent_cache.get_indent_string(s,g)},m.prototype.get_indent_size=function(s,g){return this.__indent_cache.get_indent_size(s,g)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(s){return this.is_empty()||!s&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(s){this.trim(!0);var g=this.current_line.pop();g&&(g[g.length-1]===`
`&&(g=g.replace(/\n+$/g,"")),this.current_line.push(g)),this._end_with_newline&&this.__add_outputline();var h=this.__lines.join(`
`);return s!==`
`&&(h=h.replace(/[\n]/g,s)),h},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(s,g){return s=s||0,g=g||0,this.next_line.set_indent(s,g),this.__lines.length>1?(this.current_line.set_indent(s,g),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(s){for(var g=0;g<s.newlines;g++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(s.whitespace_before),this.current_line.push(s.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(s){this.__add_space_before_token(),this.current_line.push(s),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},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(s){for(var g=this.__lines.length;s<g;)this.__lines[s]._remove_indent(),s++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(s){for(s=s===void 0?!1:s,this.current_line.trim();s&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},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(s,g){for(var h=this.__lines.length-2;h>=0;){var _=this.__lines[h];if(_.is_empty())break;if(_.item(0).indexOf(s)!==0&&_.item(-1)!==g){this.__lines.splice(h+1,0,new N(this)),this.previous_line=this.__lines[this.__lines.length-2];break}h--}},D.exports.Output=m},function(D){function N(d,m,s,g){this.type=d,this.text=m,this.comments_before=null,this.newlines=s||0,this.whitespace_before=g||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}D.exports.Token=N},,,function(D){function N(s,g){this.raw_options=d(s,g),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"])}N.prototype._get_array=function(s,g){var h=this.raw_options[s],_=g||[];return typeof h=="object"?h!==null&&typeof h.concat=="function"&&(_=h.concat()):typeof h=="string"&&(_=h.split(/[^a-zA-Z0-9_\/\-]+/)),_},N.prototype._get_boolean=function(s,g){var h=this.raw_options[s],_=h===void 0?!!g:!!h;return _},N.prototype._get_characters=function(s,g){var h=this.raw_options[s],_=g||"";return typeof h=="string"&&(_=h.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),_},N.prototype._get_number=function(s,g){var h=this.raw_options[s];g=parseInt(g,10),isNaN(g)&&(g=0);var _=parseInt(h,10);return isNaN(_)&&(_=g),_},N.prototype._get_selection=function(s,g,h){var _=this._get_selection_list(s,g,h);if(_.length!==1)throw new Error("Invalid Option Value: The option '"+s+`' can only be one of the following values:
`+g+`
You passed in: '`+this.raw_options[s]+"'");return _[0]},N.prototype._get_selection_list=function(s,g,h){if(!g||g.length===0)throw new Error("Selection list cannot be empty.");if(h=h||[g[0]],!this._is_valid_selection(h,g))throw new Error("Invalid Default Value!");var _=this._get_array(s,h);if(!this._is_valid_selection(_,g))throw new Error("Invalid Option Value: The option '"+s+`' can contain only the following values:
`+g+`
You passed in: '`+this.raw_options[s]+"'");return _},N.prototype._is_valid_selection=function(s,g){return s.length&&g.length&&!s.some(function(h){return g.indexOf(h)===-1})};function d(s,g){var h={};s=m(s);var _;for(_ in s)_!==g&&(h[_]=s[_]);if(g&&s[g])for(_ in s[g])h[_]=s[g][_];return h}function m(s){var g={},h;for(h in s){var _=h.replace(/-/g,"_");g[_]=s[h]}return g}D.exports.Options=N,D.exports.normalizeOpts=m,D.exports.mergeOpts=d},,function(D){var N=RegExp.prototype.hasOwnProperty("sticky");function d(m){this.__input=m||"",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 m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},d.prototype.peek=function(m){var s=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(s=this.__input.charAt(m)),s},d.prototype.__match=function(m,s){m.lastIndex=s;var g=m.exec(this.__input);return g&&!(N&&m.sticky)&&(g.index!==s&&(g=null)),g},d.prototype.test=function(m,s){return s=s||0,s+=this.__position,s>=0&&s<this.__input_length?!!this.__match(m,s):!1},d.prototype.testChar=function(m,s){var g=this.peek(s);return m.lastIndex=0,g!==null&&m.test(g)},d.prototype.match=function(m){var s=this.__match(m,this.__position);return s?this.__position+=s[0].length:s=null,s},d.prototype.read=function(m,s,g){var h="",_;return m&&(_=this.match(m),_&&(h+=_[0])),s&&(_||!m)&&(h+=this.readUntil(s,g)),h},d.prototype.readUntil=function(m,s){var g="",h=this.__position;m.lastIndex=this.__position;var _=m.exec(this.__input);return _?(h=_.index,s&&(h+=_[0].length)):h=this.__input_length,g=this.__input.substring(this.__position,h),this.__position=h,g},d.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},d.prototype.get_regexp=function(m,s){var g=null,h="g";return s&&N&&(h="y"),typeof m=="string"&&m!==""?g=new RegExp(m,h):m&&(g=new RegExp(m.source,h)),g},d.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},d.prototype.peekUntilAfter=function(m){var s=this.__position,g=this.readUntilAfter(m);return this.__position=s,g},d.prototype.lookBack=function(m){var s=this.__position-1;return s>=m.length&&this.__input.substring(s-m.length,s).toLowerCase()===m},D.exports.InputScanner=d},function(D,N,d){var m=d(8).InputScanner,s=d(3).Token,g=d(10).TokenStream,h=d(11).WhitespacePattern,_={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},r=function(v,S){this._input=new m(v),this._options=S||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new h(this._input)};r.prototype.tokenize=function(){this._input.restart(),this.__tokens=new g,this._reset();for(var v,S=new s(_.START,""),w=null,I=[],E=new g;S.type!==_.EOF;){for(v=this._get_next_token(S,w);this._is_comment(v);)E.add(v),v=this._get_next_token(S,w);E.isEmpty()||(v.comments_before=E,E=new g),v.parent=w,this._is_opening(v)?(I.push(w),w=v):w&&this._is_closing(v,w)&&(v.opened=w,w.closed=v,w=I.pop(),v.parent=w),v.previous=S,S.next=v,this.__tokens.add(v),S=v}return this.__tokens},r.prototype._is_first_token=function(){return this.__tokens.isEmpty()},r.prototype._reset=function(){},r.prototype._get_next_token=function(v,S){this._readWhitespace();var w=this._input.read(/.+/g);return w?this._create_token(_.RAW,w):this._create_token(_.EOF,"")},r.prototype._is_comment=function(v){return!1},r.prototype._is_opening=function(v){return!1},r.prototype._is_closing=function(v,S){return!1},r.prototype._create_token=function(v,S){var w=new s(v,S,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return w},r.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},D.exports.Tokenizer=r,D.exports.TOKEN=_},function(D){function N(d){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=d}N.prototype.restart=function(){this.__position=0},N.prototype.isEmpty=function(){return this.__tokens_length===0},N.prototype.hasNext=function(){return this.__position<this.__tokens_length},N.prototype.next=function(){var d=null;return this.hasNext()&&(d=this.__tokens[this.__position],this.__position+=1),d},N.prototype.peek=function(d){var m=null;return d=d||0,d+=this.__position,d>=0&&d<this.__tokens_length&&(m=this.__tokens[d]),m},N.prototype.add=function(d){this.__parent_token&&(d.parent=this.__parent_token),this.__tokens.push(d),this.__tokens_length+=1},D.exports.TokenStream=N},function(D,N,d){var m=d(12).Pattern;function s(g,h){m.call(this,g,h),h?this._line_regexp=this._input.get_regexp(h._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}s.prototype=new m,s.prototype.__set_whitespace_patterns=function(g,h){g+="\\t ",h+="\\n\\r",this._match_pattern=this._input.get_regexp("["+g+h+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+h+"]")},s.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var g=this._input.read(this._match_pattern);if(g===" ")this.whitespace_before_token=" ";else if(g){var h=this.__split(this._newline_regexp,g);this.newline_count=h.length-1,this.whitespace_before_token=h[this.newline_count]}return g},s.prototype.matching=function(g,h){var _=this._create();return _.__set_whitespace_patterns(g,h),_._update(),_},s.prototype._create=function(){return new s(this._input,this)},s.prototype.__split=function(g,h){g.lastIndex=0;for(var _=0,r=[],v=g.exec(h);v;)r.push(h.substring(_,v.index)),_=v.index+v[0].length,v=g.exec(h);return _<h.length?r.push(h.substring(_,h.length)):r.push(""),r},D.exports.WhitespacePattern=s},function(D){function N(d,m){this._input=d,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)}N.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},N.prototype.read_match=function(){return this._input.match(this._match_pattern)},N.prototype.until_after=function(d){var m=this._create();return m._until_after=!0,m._until_pattern=this._input.get_regexp(d),m._update(),m},N.prototype.until=function(d){var m=this._create();return m._until_after=!1,m._until_pattern=this._input.get_regexp(d),m._update(),m},N.prototype.starting_with=function(d){var m=this._create();return m._starting_pattern=this._input.get_regexp(d,!0),m._update(),m},N.prototype.matching=function(d){var m=this._create();return m._match_pattern=this._input.get_regexp(d,!0),m._update(),m},N.prototype._create=function(){return new N(this._input,this)},N.prototype._update=function(){},D.exports.Pattern=N},function(D){function N(d,m){d=typeof d=="string"?d:d.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(d+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(d+/\sbeautify\signore:end\s/.source+m,"g")}N.prototype.get_directives=function(d){if(!d.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var s=this.__directive_pattern.exec(d);s;)m[s[1]]=s[2],s=this.__directive_pattern.exec(d);return m},N.prototype.readIgnored=function(d){return d.readUntilAfter(this.__directives_end_ignore_pattern)},D.exports.Directives=N},function(D,N,d){var m=d(12).Pattern,s={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function g(h,_){m.call(this,h,_),this.__template_pattern=null,this._disabled=Object.assign({},s),this._excluded=Object.assign({},s),_&&(this.__template_pattern=this._input.get_regexp(_.__template_pattern),this._excluded=Object.assign(this._excluded,_._excluded),this._disabled=Object.assign(this._disabled,_._disabled));var r=new m(h);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}/)}}g.prototype=new m,g.prototype._create=function(){return new g(this._input,this)},g.prototype._update=function(){this.__set_templated_pattern()},g.prototype.disable=function(h){var _=this._create();return _._disabled[h]=!0,_._update(),_},g.prototype.read_options=function(h){var _=this._create();for(var r in s)_._disabled[r]=h.templating.indexOf(r)===-1;return _._update(),_},g.prototype.exclude=function(h){var _=this._create();return _._excluded[h]=!0,_._update(),_},g.prototype.read=function(){var h="";this._match_pattern?h=this._input.read(this._starting_pattern):h=this._input.read(this._starting_pattern,this.__template_pattern);for(var _=this._read_template();_;)this._match_pattern?_+=this._input.read(this._match_pattern):_+=this._input.readUntil(this.__template_pattern),h+=_,_=this._read_template();return this._until_after&&(h+=this._input.readUntilAfter(this._until_pattern)),h},g.prototype.__set_templated_pattern=function(){var h=[];this._disabled.php||h.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||h.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||h.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(h.push(this.__patterns.django._starting_pattern.source),h.push(this.__patterns.django_value._starting_pattern.source),h.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||h.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&h.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+h.join("|")+")")},g.prototype._read_template=function(){var h="",_=this._input.peek();if(_==="<"){var r=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&r==="?"&&(h=h||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&r==="%"&&(h=h||this.__patterns.erb.read())}else _==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(h=h||this.__patterns.handlebars_comment.read(),h=h||this.__patterns.handlebars_unescaped.read(),h=h||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(h=h||this.__patterns.django_value.read()),this._excluded.django||(h=h||this.__patterns.django_comment.read(),h=h||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(h=h||this.__patterns.smarty_comment.read(),h=h||this.__patterns.smarty_literal.read(),h=h||this.__patterns.smarty.read()));return h},D.exports.TemplatablePattern=g},,,,function(D,N,d){var m=d(19).Beautifier,s=d(20).Options;function g(h,_,r,v){var S=new m(h,_,r,v);return S.beautify()}D.exports=g,D.exports.defaultOptions=function(){return new s}},function(D,N,d){var m=d(20).Options,s=d(2).Output,g=d(21).Tokenizer,h=d(21).TOKEN,_=/\r\n|[\r\n]/,r=/\r\n|[\r\n]/g,v=function(C,p){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 s(C,p)};v.prototype.current_line_has_match=function(C){return this._output.current_line.has_match(C)},v.prototype.set_space_before_token=function(C,p){this._output.space_before_token=C,this._output.non_breaking_space=p},v.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},v.prototype.add_raw_token=function(C){this._output.add_raw_token(C)},v.prototype.print_preserved_newlines=function(C){var p=0;C.type!==h.TEXT&&C.previous.type!==h.TEXT&&(p=C.newlines?1:0),this.preserve_newlines&&(p=C.newlines<this.max_preserve_newlines+1?C.newlines:this.max_preserve_newlines+1);for(var i=0;i<p;i++)this.print_newline(i>0);return p!==0},v.prototype.traverse_whitespace=function(C){return C.whitespace_before||C.newlines?(this.print_preserved_newlines(C)||(this._output.space_before_token=!0),!0):!1},v.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},v.prototype.print_newline=function(C){this._output.add_new_line(C)},v.prototype.print_token=function(C){C.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(C.text))},v.prototype.indent=function(){this.indent_level++},v.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 p=null,i=C.next;i.type!==h.EOF&&C.closed!==i;){if(i.type===h.ATTRIBUTE&&i.text==="type"){i.next&&i.next.type===h.EQUALS&&i.next.next&&i.next.next.type===h.VALUE&&(p=i.next.next.text);break}i=i.next}return p},w=function(C,p){var i=null,f=null;return p.closed?(C==="script"?i="text/javascript":C==="style"&&(i="text/css"),i=S(p)||i,i.search("text/css")>-1?f="css":i.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?f="javascript":i.search(/(text|application|dojo)\/(x-)?(html)/)>-1?f="html":i.search(/test\/null/)>-1&&(f="null"),f):null};function I(C,p){return p.indexOf(C)!==-1}function E(C,p,i){this.parent=C||null,this.tag=p?p.tag_name:"",this.indent_level=i||0,this.parser_token=p||null}function x(C){this._printer=C,this._current_frame=null}x.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},x.prototype.record_tag=function(C){var p=new E(this._current_frame,C,this._printer.indent_level);this._current_frame=p},x.prototype._try_pop_frame=function(C){var p=null;return C&&(p=C.parser_token,this._printer.indent_level=C.indent_level,this._current_frame=C.parent),p},x.prototype._get_frame=function(C,p){for(var i=this._current_frame;i&&!(C.indexOf(i.tag)!==-1);){if(p&&p.indexOf(i.tag)!==-1){i=null;break}i=i.parent}return i},x.prototype.try_pop=function(C,p){var i=this._get_frame([C],p);return this._try_pop_frame(i)},x.prototype.indent_to_tag=function(C){var p=this._get_frame(C);p&&(this._printer.indent_level=p.indent_level)};function P(C,p,i,f){this._source_text=C||"",p=p||{},this._js_beautify=i,this._css_beautify=f,this._tag_stack=null;var o=new m(p,"html");this._options=o,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"}P.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var C=this._source_text,p=this._options.eol;this._options.eol==="auto"&&(p=`
`,C&&_.test(C)&&(p=C.match(_)[0])),C=C.replace(r,`
`);var i=C.match(/^[\t ]*/)[0],f={text:"",type:""},o=new T,a=new v(this._options,i),L=new g(C,this._options).tokenize();this._tag_stack=new x(a);for(var y=null,l=L.next();l.type!==h.EOF;)l.type===h.TAG_OPEN||l.type===h.COMMENT?(y=this._handle_tag_open(a,l,o,f),o=y):l.type===h.ATTRIBUTE||l.type===h.EQUALS||l.type===h.VALUE||l.type===h.TEXT&&!o.tag_complete?y=this._handle_inside_tag(a,l,o,L):l.type===h.TAG_CLOSE?y=this._handle_tag_close(a,l,o):l.type===h.TEXT?y=this._handle_text(a,l,o):a.add_raw_token(l),f=y,l=L.next();var F=a._output.get_code(p);return F},P.prototype._handle_tag_close=function(C,p,i){var f={text:p.text,type:p.type};return C.alignment_size=0,i.tag_complete=!0,C.set_space_before_token(p.newlines||p.whitespace_before!=="",!0),i.is_unformatted?C.add_raw_token(p):(i.tag_start_char==="<"&&(C.set_space_before_token(p.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&i.has_wrapped_attrs&&C.print_newline(!1)),C.print_token(p)),i.indent_content&&!(i.is_unformatted||i.is_content_unformatted)&&(C.indent(),i.indent_content=!1),!i.is_inline_element&&!(i.is_unformatted||i.is_content_unformatted)&&C.set_wrap_point(),f},P.prototype._handle_inside_tag=function(C,p,i,f){var o=i.has_wrapped_attrs,a={text:p.text,type:p.type};if(C.set_space_before_token(p.newlines||p.whitespace_before!=="",!0),i.is_unformatted)C.add_raw_token(p);else if(i.tag_start_char==="{"&&p.type===h.TEXT)C.print_preserved_newlines(p)?(p.newlines=0,C.add_raw_token(p)):C.print_token(p);else{if(p.type===h.ATTRIBUTE?(C.set_space_before_token(!0),i.attr_count+=1):(p.type===h.EQUALS||p.type===h.VALUE&&p.previous.type===h.EQUALS)&&C.set_space_before_token(!1),p.type===h.ATTRIBUTE&&i.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(C.traverse_whitespace(p),o=o||p.newlines!==0),this._is_wrap_attributes_force)){var L=i.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&i.attr_count===1){var y=!0,l=0,F;do{if(F=f.peek(l),F.type===h.ATTRIBUTE){y=!1;break}l+=1}while(l<4&&F.type!==h.EOF&&F.type!==h.TAG_CLOSE);L=!y}L&&(C.print_newline(!1),o=!0)}C.print_token(p),o=o||C.previous_token_wrapped(),i.has_wrapped_attrs=o}return a},P.prototype._handle_text=function(C,p,i){var f={text:p.text,type:"TK_CONTENT"};return i.custom_beautifier_name?this._print_custom_beatifier_text(C,p,i):i.is_unformatted||i.is_content_unformatted?C.add_raw_token(p):(C.traverse_whitespace(p),C.print_token(p)),f},P.prototype._print_custom_beatifier_text=function(C,p,i){var f=this;if(p.text!==""){var o=p.text,a,L=1,y="",l="";i.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?a=this._js_beautify:i.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?a=this._css_beautify:i.custom_beautifier_name==="html"&&(a=function(de,ve){var he=new P(de,ve,f._js_beautify,f._css_beautify);return he.beautify()}),this._options.indent_scripts==="keep"?L=0:this._options.indent_scripts==="separate"&&(L=-C.indent_level);var F=C.get_full_indent(L);if(o=o.replace(/\n[ \t]*$/,""),i.custom_beautifier_name!=="html"&&o[0]==="<"&&o.match(/^(<!--|<!\[CDATA\[)/)){var j=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(o);if(!j){C.add_raw_token(p);return}y=F+j[1]+`
`,o=j[4],j[5]&&(l=F+j[5]),o=o.replace(/\n[ \t]*$/,""),(j[2]||j[3].indexOf(`
`)!==-1)&&(j=j[3].match(/[ \t]+$/),j&&(p.whitespace_before=j[0]))}if(o)if(a){var G=function(){this.eol=`
`};G.prototype=this._options.raw_options;var Y=new G;o=a(F+o,Y)}else{var te=p.whitespace_before;te&&(o=o.replace(new RegExp(`
(`+te+")?","g"),`
`)),o=F+o.replace(/\n/g,`
`+F)}y&&(o?o=y+o+`
`+l:o=y+l),C.print_newline(!1),o&&(p.text=o,p.whitespace_before="",p.newlines=0,C.add_raw_token(p),C.print_newline(!0))}},P.prototype._handle_tag_open=function(C,p,i,f){var o=this._get_tag_open_token(p);return(i.is_unformatted||i.is_content_unformatted)&&!i.is_empty_element&&p.type===h.TAG_OPEN&&p.text.indexOf("</")===0?(C.add_raw_token(p),o.start_tag_token=this._tag_stack.try_pop(o.tag_name)):(C.traverse_whitespace(p),this._set_tag_position(C,p,o,i,f),o.is_inline_element||C.set_wrap_point(),C.print_token(p)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(o.alignment_size=p.text.length+1),!o.tag_complete&&!o.is_unformatted&&(C.alignment_size=o.alignment_size),o};var T=function(C,p){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="",!p)this.tag_complete=!0;else{var i;this.tag_start_char=p.text[0],this.text=p.text,this.tag_start_char==="<"?(i=p.text.match(/^<([^\s>]*)/),this.tag_check=i?i[1]:""):(i=p.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=i?i[1]:"",(p.text.startsWith("{{#>")||p.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&p.next!==null?this.tag_check=p.next.text.split(" ")[0]:this.tag_check=p.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),p.type===h.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||p.closed&&p.closed.text==="/>";var f=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(f=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(f)))}};P.prototype._get_tag_open_token=function(C){var p=new T(this._tag_stack.get_parser_token(),C);return p.alignment_size=this._options.wrap_attributes_indent_size,p.is_end_tag=p.is_end_tag||I(p.tag_check,this._options.void_elements),p.is_empty_element=p.tag_complete||p.is_start_tag&&p.is_end_tag,p.is_unformatted=!p.tag_complete&&I(p.tag_check,this._options.unformatted),p.is_content_unformatted=!p.is_empty_element&&I(p.tag_check,this._options.content_unformatted),p.is_inline_element=I(p.tag_name,this._options.inline)||p.tag_name.includes("-")||p.tag_start_char==="{",p},P.prototype._set_tag_position=function(C,p,i,f,o){if(i.is_empty_element||(i.is_end_tag?i.start_tag_token=this._tag_stack.try_pop(i.tag_name):(this._do_optional_end_element(i)&&(i.is_inline_element||C.print_newline(!1)),this._tag_stack.record_tag(i),(i.tag_name==="script"||i.tag_name==="style")&&!(i.is_unformatted||i.is_content_unformatted)&&(i.custom_beautifier_name=w(i.tag_check,p)))),I(i.tag_check,this._options.extra_liners)&&(C.print_newline(!1),C._output.just_added_blankline()||C.print_newline(!0)),i.is_empty_element){if(i.tag_start_char==="{"&&i.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),i.indent_content=!0;var a=C.current_line_has_match(/{{#if/);a||C.print_newline(!1)}i.tag_name==="!--"&&o.type===h.TAG_CLOSE&&f.is_end_tag&&i.text.indexOf(`
`)===-1||(i.is_inline_element||i.is_unformatted||C.print_newline(!1),this._calcluate_parent_multiline(C,i))}else if(i.is_end_tag){var L=!1;L=i.start_tag_token&&i.start_tag_token.multiline_content,L=L||!i.is_inline_element&&!(f.is_inline_element||f.is_unformatted)&&!(o.type===h.TAG_CLOSE&&i.start_tag_token===f)&&o.type!=="TK_CONTENT",(i.is_content_unformatted||i.is_unformatted)&&(L=!1),L&&C.print_newline(!1)}else i.indent_content=!i.custom_beautifier_name,i.tag_start_char==="<"&&(i.tag_name==="html"?i.indent_content=this._options.indent_inner_html:i.tag_name==="head"?i.indent_content=this._options.indent_head_inner_html:i.tag_name==="body"&&(i.indent_content=this._options.indent_body_inner_html)),!(i.is_inline_element||i.is_unformatted)&&(o.type!=="TK_CONTENT"||i.is_content_unformatted)&&C.print_newline(!1),this._calcluate_parent_multiline(C,i)},P.prototype._calcluate_parent_multiline=function(C,p){p.parent&&C._output.just_added_newline()&&!((p.is_inline_element||p.is_unformatted)&&p.parent.is_inline_element)&&(p.parent.multiline_content=!0)};var A=["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"],b=["a","audio","del","ins","map","noscript","video"];P.prototype._do_optional_end_element=function(C){var p=null;if(C.is_empty_element||!C.is_start_tag||!C.parent)return;if(C.tag_name==="body")p=p||this._tag_stack.try_pop("head");else if(C.tag_name==="li")p=p||this._tag_stack.try_pop("li",["ol","ul"]);else if(C.tag_name==="dd"||C.tag_name==="dt")p=p||this._tag_stack.try_pop("dt",["dl"]),p=p||this._tag_stack.try_pop("dd",["dl"]);else if(C.parent.tag_name==="p"&&A.indexOf(C.tag_name)!==-1){var i=C.parent.parent;(!i||b.indexOf(i.tag_name)===-1)&&(p=p||this._tag_stack.try_pop("p"))}else C.tag_name==="rp"||C.tag_name==="rt"?(p=p||this._tag_stack.try_pop("rt",["ruby","rtc"]),p=p||this._tag_stack.try_pop("rp",["ruby","rtc"])):C.tag_name==="optgroup"?p=p||this._tag_stack.try_pop("optgroup",["select"]):C.tag_name==="option"?p=p||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):C.tag_name==="colgroup"?p=p||this._tag_stack.try_pop("caption",["table"]):C.tag_name==="thead"?(p=p||this._tag_stack.try_pop("caption",["table"]),p=p||this._tag_stack.try_pop("colgroup",["table"])):C.tag_name==="tbody"||C.tag_name==="tfoot"?(p=p||this._tag_stack.try_pop("caption",["table"]),p=p||this._tag_stack.try_pop("colgroup",["table"]),p=p||this._tag_stack.try_pop("thead",["table"]),p=p||this._tag_stack.try_pop("tbody",["table"])):C.tag_name==="tr"?(p=p||this._tag_stack.try_pop("caption",["table"]),p=p||this._tag_stack.try_pop("colgroup",["table"]),p=p||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(C.tag_name==="th"||C.tag_name==="td")&&(p=p||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),p=p||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return C.parent=this._tag_stack.get_parser_token(),p},D.exports.Beautifier=P},function(D,N,d){var m=d(6).Options;function s(g){m.call(this,g,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}s.prototype=new m,D.exports.Options=s},function(D,N,d){var m=d(9).Tokenizer,s=d(9).TOKEN,g=d(13).Directives,h=d(14).TemplatablePattern,_=d(12).Pattern,r={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:s.START,RAW:s.RAW,EOF:s.EOF},v=new g(/<\!--/,/-->/),S=function(w,I){m.call(this,w,I),this._current_tag_name="";var E=new h(this._input).read_options(this._options),x=new _(this._input);if(this.__patterns={word:E.until(/[\n\r\t <]/),single_quote:E.until_after(/'/),double_quote:E.until_after(/"/),attribute:E.until(/[\n\r\t =>]|\/>/),element_name:E.until(/[\n\r\t >\/]/),handlebars_comment:x.starting_with(/{{!--/).until_after(/--}}/),handlebars:x.starting_with(/{{/).until_after(/}}/),handlebars_open:x.until(/[\n\r\t }]/),handlebars_raw_close:x.until(/}}/),comment:x.starting_with(/<!--/).until_after(/-->/),cdata:x.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:x.starting_with(/<!\[/).until_after(/]>/),processing:x.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 P=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=x.matching(P).until_after(P)}};S.prototype=new m,S.prototype._is_comment=function(w){return!1},S.prototype._is_opening=function(w){return w.type===r.TAG_OPEN},S.prototype._is_closing=function(w,I){return w.type===r.TAG_CLOSE&&I&&((w.text===">"||w.text==="/>")&&I.text[0]==="<"||w.text==="}}"&&I.text[0]==="{"&&I.text[1]==="{")},S.prototype._reset=function(){this._current_tag_name=""},S.prototype._get_next_token=function(w,I){var E=null;this._readWhitespace();var x=this._input.peek();return x===null?this._create_token(r.EOF,""):(E=E||this._read_open_handlebars(x,I),E=E||this._read_attribute(x,w,I),E=E||this._read_close(x,I),E=E||this._read_raw_content(x,w,I),E=E||this._read_content_word(x),E=E||this._read_comment_or_cdata(x),E=E||this._read_processing(x),E=E||this._read_open(x,I),E=E||this._create_token(r.UNKNOWN,this._input.next()),E)},S.prototype._read_comment_or_cdata=function(w){var I=null,E=null,x=null;if(w==="<"){var P=this._input.peek(1);P==="!"&&(E=this.__patterns.comment.read(),E?(x=v.get_directives(E),x&&x.ignore==="start"&&(E+=v.readIgnored(this._input))):E=this.__patterns.cdata.read()),E&&(I=this._create_token(r.COMMENT,E),I.directives=x)}return I},S.prototype._read_processing=function(w){var I=null,E=null,x=null;if(w==="<"){var P=this._input.peek(1);(P==="!"||P==="?")&&(E=this.__patterns.conditional_comment.read(),E=E||this.__patterns.processing.read()),E&&(I=this._create_token(r.COMMENT,E),I.directives=x)}return I},S.prototype._read_open=function(w,I){var E=null,x=null;return I||w==="<"&&(E=this._input.next(),this._input.peek()==="/"&&(E+=this._input.next()),E+=this.__patterns.element_name.read(),x=this._create_token(r.TAG_OPEN,E)),x},S.prototype._read_open_handlebars=function(w,I){var E=null,x=null;return I||this._options.indent_handlebars&&w==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(E=this.__patterns.handlebars_comment.read(),E=E||this.__patterns.handlebars.read(),x=this._create_token(r.COMMENT,E)):(E=this.__patterns.handlebars_open.read(),x=this._create_token(r.TAG_OPEN,E))),x},S.prototype._read_close=function(w,I){var E=null,x=null;return I&&(I.text[0]==="<"&&(w===">"||w==="/"&&this._input.peek(1)===">")?(E=this._input.next(),w==="/"&&(E+=this._input.next()),x=this._create_token(r.TAG_CLOSE,E)):I.text[0]==="{"&&w==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),x=this._create_token(r.TAG_CLOSE,"}}"))),x},S.prototype._read_attribute=function(w,I,E){var x=null,P="";if(E&&E.text[0]==="<")if(w==="=")x=this._create_token(r.EQUALS,this._input.next());else if(w==='"'||w==="'"){var T=this._input.next();w==='"'?T+=this.__patterns.double_quote.read():T+=this.__patterns.single_quote.read(),x=this._create_token(r.VALUE,T)}else P=this.__patterns.attribute.read(),P&&(I.type===r.EQUALS?x=this._create_token(r.VALUE,P):x=this._create_token(r.ATTRIBUTE,P));return x},S.prototype._is_content_unformatted=function(w){return this._options.void_elements.indexOf(w)===-1&&(this._options.content_unformatted.indexOf(w)!==-1||this._options.unformatted.indexOf(w)!==-1)},S.prototype._read_raw_content=function(w,I,E){var x="";if(E&&E.text[0]==="{")x=this.__patterns.handlebars_raw_close.read();else if(I.type===r.TAG_CLOSE&&I.opened.text[0]==="<"&&I.text[0]!=="/"){var P=I.opened.text.substr(1).toLowerCase();if(P==="script"||P==="style"){var T=this._read_comment_or_cdata(w);if(T)return T.type=r.TEXT,T;x=this._input.readUntil(new RegExp("</"+P+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(P)&&(x=this._input.readUntil(new RegExp("</"+P+"[\\n\\r\\t ]*?>","ig")))}return x?this._create_token(r.TEXT,x):null},S.prototype._read_content_word=function(w){var I="";if(this._options.unformatted_content_delimiter&&(w===this._options.unformatted_content_delimiter[0]&&(I=this.__patterns.unformatted_content_delimiter.read())),I||(I=this.__patterns.word.read()),I)return this._create_token(r.TEXT,I)},D.exports.Tokenizer=S,D.exports.TOKEN=r}],B={};function n(D){var N=B[D];if(N!==void 0)return N.exports;var d=B[D]={exports:{}};return R[D](d,d.exports,n),d.exports}var W=n(18);re=W})();var fe=re;if(!0)!(q=[M,M("6UM0"),M("TXwP")],ue=function(R){var B=M("6UM0"),n=M("TXwP");return{html_beautify:function(W,D){return fe(W,D,B.js_beautify,n.css_beautify)}}}.apply(ce,q),ue!==void 0&&(We.exports=ue));else var ae,z})()},rHrb:function(We,ce,M){"use strict";Object.defineProperty(ce,"__esModule",{value:!0}),ce.CopyToClipboard=void 0;var q=re(M("T/Jt")),ue=re(M("+QRC"));function re(r){return r&&r.__esModule?r:{default:r}}function fe(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?fe=function(S){return typeof S}:fe=function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},fe(r)}function ae(r,v){var S=Object.keys(r);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(r);v&&(w=w.filter(function(I){return Object.getOwnPropertyDescriptor(r,I).enumerable})),S.push.apply(S,w)}return S}function z(r){for(var v=1;v<arguments.length;v++){var S=arguments[v]!=null?arguments[v]:{};v%2?ae(S,!0).forEach(function(w){h(r,w,S[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(S)):ae(S).forEach(function(w){Object.defineProperty(r,w,Object.getOwnPropertyDescriptor(S,w))})}return r}function R(r,v){if(r==null)return{};var S=B(r,v),w,I;if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(r);for(I=0;I<E.length;I++){if(w=E[I],v.indexOf(w)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(r,w))continue;S[w]=r[w]}}return S}function B(r,v){if(r==null)return{};var S={},w=Object.keys(r),I,E;for(E=0;E<w.length;E++){if(I=w[E],v.indexOf(I)>=0)continue;S[I]=r[I]}return S}function n(r,v){if(!(r instanceof v))throw new TypeError("Cannot call a class as a function")}function W(r,v){for(var S=0;S<v.length;S++){var w=v[S];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(r,w.key,w)}}function D(r,v,S){return v&&W(r.prototype,v),S&&W(r,S),r}function N(r,v){return v&&(fe(v)==="object"||typeof v=="function")?v:m(r)}function d(r){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(S){return S.__proto__||Object.getPrototypeOf(S)},d(r)}function m(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function s(r,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(v&&v.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),v&&g(r,v)}function g(r,v){return g=Object.setPrototypeOf||function(w,I){return w.__proto__=I,w},g(r,v)}function h(r,v,S){return v in r?Object.defineProperty(r,v,{value:S,enumerable:!0,configurable:!0,writable:!0}):r[v]=S,r}var _=function(r){s(v,r);function v(){var S,w;n(this,v);for(var I=arguments.length,E=new Array(I),x=0;x<I;x++)E[x]=arguments[x];return w=N(this,(S=d(v)).call.apply(S,[this].concat(E))),h(m(w),"onClick",function(P){var T=w.props,A=T.text,b=T.onCopy,C=T.children,p=T.options,i=q.default.Children.only(C),f=(0,ue.default)(A,p);b&&b(A,f),i&&i.props&&typeof i.props.onClick=="function"&&i.props.onClick(P)}),w}return D(v,[{key:"render",value:function(){var w=this.props,I=w.text,E=w.onCopy,x=w.options,P=w.children,T=R(w,["text","onCopy","options","children"]),A=q.default.Children.only(P);return q.default.cloneElement(A,z({},T,{onClick:this.onClick}))}}]),v}(q.default.PureComponent);ce.CopyToClipboard=_,h(_,"defaultProps",{onCopy:void 0,options:void 0})},rSU8:function(We,ce,M){"use strict";function q(D){return typeof D=="object"&&D!=null&&D.nodeType===1}function ue(D,N){return(!N||D!=="hidden")&&D!=="visible"&&D!=="clip"}function re(D,N){if(D.clientHeight<D.scrollHeight||D.clientWidth<D.scrollWidth){var d=getComputedStyle(D,null);return ue(d.overflowY,N)||ue(d.overflowX,N)||function(m){var s=function(g){if(!g.ownerDocument||!g.ownerDocument.defaultView)return null;try{return g.ownerDocument.defaultView.frameElement}catch(h){return null}}(m);return!!s&&(s.clientHeight<m.scrollHeight||s.clientWidth<m.scrollWidth)}(D)}return!1}function fe(D,N,d,m,s,g,h,_){return g<D&&h>N||g>D&&h<N?0:g<=D&&_<=d||h>=N&&_>=d?g-D-m:h>N&&_<d||g<D&&_>d?h-N+s:0}var ae=function(D,N){var d=window,m=N.scrollMode,s=N.block,g=N.inline,h=N.boundary,_=N.skipOverflowHiddenElements,r=typeof h=="function"?h:function(ye){return ye!==h};if(!q(D))throw new TypeError("Invalid target");for(var v,S,w=document.scrollingElement||document.documentElement,I=[],E=D;q(E)&&r(E);){if((E=(S=(v=E).parentElement)==null?v.getRootNode().host||null:S)===w){I.push(E);break}E!=null&&E===document.body&&re(E)&&!re(document.documentElement)||E!=null&&re(E,_)&&I.push(E)}for(var x=d.visualViewport?d.visualViewport.width:innerWidth,P=d.visualViewport?d.visualViewport.height:innerHeight,T=window.scrollX||pageXOffset,A=window.scrollY||pageYOffset,b=D.getBoundingClientRect(),C=b.height,p=b.width,i=b.top,f=b.right,o=b.bottom,a=b.left,L=s==="start"||s==="nearest"?i:s==="end"?o:i+C/2,y=g==="center"?a+p/2:g==="end"?f:a,l=[],F=0;F<I.length;F++){var j=I[F],G=j.getBoundingClientRect(),Y=G.height,te=G.width,de=G.top,ve=G.right,he=G.bottom,Re=G.left;if(m==="if-needed"&&i>=0&&a>=0&&o<=P&&f<=x&&i>=de&&o<=he&&a>=Re&&f<=ve)return l;var we=getComputedStyle(j),ge=parseInt(we.borderLeftWidth,10),Ne=parseInt(we.borderTopWidth,10),ze=parseInt(we.borderRightWidth,10),nt=parseInt(we.borderBottomWidth,10),Ge=0,Xe=0,Be="offsetWidth"in j?j.offsetWidth-j.clientWidth-ge-ze:0,_e="offsetHeight"in j?j.offsetHeight-j.clientHeight-Ne-nt:0,Ze="offsetWidth"in j?j.offsetWidth===0?0:te/j.offsetWidth:0,be="offsetHeight"in j?j.offsetHeight===0?0:Y/j.offsetHeight:0;if(w===j)Ge=s==="start"?L:s==="end"?L-P:s==="nearest"?fe(A,A+P,P,Ne,nt,A+L,A+L+C,C):L-P/2,Xe=g==="start"?y:g==="center"?y-x/2:g==="end"?y-x:fe(T,T+x,x,ge,ze,T+y,T+y+p,p),Ge=Math.max(0,Ge+A),Xe=Math.max(0,Xe+T);else{Ge=s==="start"?L-de-Ne:s==="end"?L-he+nt+_e:s==="nearest"?fe(de,he,Y,Ne,nt+_e,L,L+C,C):L-(de+Y/2)+_e/2,Xe=g==="start"?y-Re-ge:g==="center"?y-(Re+te/2)+Be/2:g==="end"?y-ve+ze+Be:fe(Re,ve,te,ge,ze+Be,y,y+p,p);var Le=j.scrollLeft,le=j.scrollTop;L+=le-(Ge=Math.max(0,Math.min(le+Ge/be,j.scrollHeight-Y/be+_e))),y+=Le-(Xe=Math.max(0,Math.min(Le+Xe/Ze,j.scrollWidth-te/Ze+Be)))}l.push({el:j,top:Ge,left:Xe})}return l};function z(D){return D===Object(D)&&Object.keys(D).length!==0}function R(D,N){N===void 0&&(N="auto");var d="scrollBehavior"in document.body.style;D.forEach(function(m){var s=m.el,g=m.top,h=m.left;s.scroll&&d?s.scroll({top:g,left:h,behavior:N}):(s.scrollTop=g,s.scrollLeft=h)})}function B(D){return D===!1?{block:"end",inline:"nearest"}:z(D)?D:{block:"start",inline:"nearest"}}function n(D,N){var d=D.isConnected||D.ownerDocument.documentElement.contains(D);if(z(N)&&typeof N.behavior=="function")return N.behavior(d?ae(D,N):[]);if(!d)return;var m=B(N);return R(ae(D,m),m.behavior)}var W=ce.a=n},rd1n:function(We,ce,M){"use strict";var q=M("XjgL"),ue=M("36hc"),re=M("fNpE"),fe=M("T/Jt"),ae=M.n(fe),z=M("27eb"),R=M.n(z),B=M("8wWb"),n=M("sg8A"),W=fe.forwardRef(function(D,N){var d,m=D.prefixCls,s=m===void 0?"rc-switch":m,g=D.className,h=D.checked,_=D.defaultChecked,r=D.disabled,v=D.loadingIcon,S=D.checkedChildren,w=D.unCheckedChildren,I=D.onClick,E=D.onChange,x=D.onKeyDown,P=Object(re.a)(D,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),T=Object(B.a)(!1,{value:h,defaultValue:_}),A=Object(ue.a)(T,2),b=A[0],C=A[1];function p(a,L){var y=b;return r||(y=a,C(y),E==null||E(y,L)),y}function i(a){a.which===n.a.LEFT?p(!1,a):a.which===n.a.RIGHT&&p(!0,a),x==null||x(a)}function f(a){var L=p(!b,a);I==null||I(L,a)}var o=R()(s,g,(d={},Object(q.a)(d,"".concat(s,"-checked"),b),Object(q.a)(d,"".concat(s,"-disabled"),r),d));return fe.createElement("button",Object.assign({},P,{type:"button",role:"switch","aria-checked":b,disabled:r,className:o,ref:N,onKeyDown:i,onClick:f}),v,fe.createElement("span",{className:"".concat(s,"-inner")},b?S:w))});W.displayName="Switch",ce.a=W},rdUC:function(We,ce,M){var q=M("MFOe"),ue=q.Global;We.exports={name:"localStorage",read:fe,write:ae,each:z,remove:R,clearAll:B};function re(){return ue.localStorage}function fe(n){return re().getItem(n)}function ae(n,W){return re().setItem(n,W)}function z(n){for(var W=re().length-1;W>=0;W--){var D=re().key(W);n(fe(D),D)}}function R(n){return re().removeItem(n)}function B(){return re().clear()}},rePB:function(We,ce,M){"use strict";M.d(ce,"a",function(){return ue});var q=M("o46R");function ue(re,fe,ae){return fe=Object(q.a)(fe),fe in re?Object.defineProperty(re,fe,{value:ae,enumerable:!0,configurable:!0,writable:!0}):re[fe]=ae,re}},rgEC:function(We,ce,M){"use strict";M.d(ce,"f",function(){return N}),M.d(ce,"d",function(){return d}),M.d(ce,"c",function(){return s}),M.d(ce,"e",function(){return g}),M.d(ce,"a",function(){return _}),M.d(ce,"g",function(){return r}),M.d(ce,"b",function(){return v});var q=M("kxoy"),ue=M("aVTQ"),re=M("6ASS"),fe=M("fNpE"),ae=M("qoVz"),z=M("N7A4"),R=M("B/uU"),B=M("El5i"),n=["children"];function W(S,w){return"".concat(S,"-").concat(w)}function D(S){return S&&S.type&&S.type.isTreeNode}function N(S,w){return S!=null?S:w}function d(S){var w=S||{},I=w.title,E=w._title,x=w.key,P=w.children,T=I||"title";return{title:T,_title:E||[T],key:x||"key",children:P||"children"}}function m(S,w){var I=new Map;function E(x){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(x||[]).forEach(function(T){var A=T[w.key],b=T[w.children];Object(R.a)(A!=null,"Tree node must have a certain key: [".concat(P).concat(A,"]"));var C=String(A);Object(R.a)(!I.has(C)||A===null||A===void 0,"Same 'key' exist in the Tree: ".concat(C)),I.set(C,!0),E(b,"".concat(P).concat(C," > "))})}E(S)}function s(S){function w(I){var E=Object(ae.a)(I);return E.map(function(x){if(!D(x))return Object(R.a)(!x,"Tree/TreeNode can only accept TreeNode as children."),null;var P=x.key,T=x.props,A=T.children,b=Object(fe.a)(T,n),C=Object(re.a)({key:P},b),p=w(A);return p.length&&(C.children=p),C}).filter(function(x){return x})}return w(S)}function g(S,w,I){var E=d(I),x=E._title,P=E.key,T=E.children,A=new Set(w===!0?[]:w),b=[];function C(p){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return p.map(function(f,o){for(var a=W(i?i.pos:"0",o),L=N(f[P],a),y,l=0;l<x.length;l+=1){var F=x[l];if(f[F]!==void 0){y=f[F];break}}var j=Object(re.a)(Object(re.a)({},Object(z.a)(f,[].concat(Object(ue.a)(x),[P,T]))),{},{title:y,key:L,parent:i,pos:a,children:null,data:f,isStart:[].concat(Object(ue.a)(i?i.isStart:[]),[o===0]),isEnd:[].concat(Object(ue.a)(i?i.isEnd:[]),[o===p.length-1])});return b.push(j),w===!0||A.has(L)?j.children=C(f[T]||[],j):j.children=[],j})}return C(S),b}function h(S,w,I){var E={};Object(q.a)(I)==="object"?E=I:E={externalGetKey:I},E=E||{};var x=E,P=x.childrenPropName,T=x.externalGetKey,A=x.fieldNames,b=d(A),C=b.key,p=b.children,i=P||p,f;T?typeof T=="string"?f=function(L){return L[T]}:typeof T=="function"&&(f=function(L){return T(L)}):f=function(L,y){return N(L[C],y)};function o(a,L,y,l){var F=a?a[i]:S,j=a?W(y.pos,L):"0",G=a?[].concat(Object(ue.a)(l),[a]):[];if(a){var Y=f(a,j),te={node:a,index:L,pos:j,key:Y,parentPos:y.node?y.pos:null,level:y.level+1,nodes:G};w(te)}F&&F.forEach(function(de,ve){o(de,ve,{node:a,pos:j,level:y?y.level+1:-1},G)})}o(null)}function _(S){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=w.initWrapper,E=w.processEntity,x=w.onProcessFinished,P=w.externalGetKey,T=w.childrenPropName,A=w.fieldNames,b=arguments.length>2?arguments[2]:void 0,C=P||b,p={},i={},f={posEntities:p,keyEntities:i};return I&&(f=I(f)||f),h(S,function(o){var a=o.node,L=o.index,y=o.pos,l=o.key,F=o.parentPos,j=o.level,G=o.nodes,Y={node:a,nodes:G,index:L,key:l,pos:y,level:j},te=N(l,y);p[y]=Y,i[te]=Y,Y.parent=p[F],Y.parent&&(Y.parent.children=Y.parent.children||[],Y.parent.children.push(Y)),E&&E(Y,f)},{externalGetKey:C,childrenPropName:T,fieldNames:A}),x&&x(f),f}function r(S,w){var I=w.expandedKeys,E=w.selectedKeys,x=w.loadedKeys,P=w.loadingKeys,T=w.checkedKeys,A=w.halfCheckedKeys,b=w.dragOverNodeKey,C=w.dropPosition,p=w.keyEntities,i=Object(B.a)(p,S),f={eventKey:S,expanded:I.indexOf(S)!==-1,selected:E.indexOf(S)!==-1,loaded:x.indexOf(S)!==-1,loading:P.indexOf(S)!==-1,checked:T.indexOf(S)!==-1,halfChecked:A.indexOf(S)!==-1,pos:String(i?i.pos:""),dragOver:b===S&&C===0,dragOverGapTop:b===S&&C===-1,dragOverGapBottom:b===S&&C===1};return f}function v(S){var w=S.data,I=S.expanded,E=S.selected,x=S.checked,P=S.loaded,T=S.loading,A=S.halfChecked,b=S.dragOver,C=S.dragOverGapTop,p=S.dragOverGapBottom,i=S.pos,f=S.active,o=S.eventKey,a=Object(re.a)(Object(re.a)({},w),{},{expanded:I,selected:E,checked:x,loaded:P,loading:T,halfChecked:A,dragOver:b,dragOverGapTop:C,dragOverGapBottom:p,pos:i,active:f,key:o});return"props"in a||Object.defineProperty(a,"props",{get:function(){return Object(R.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),S}}),a}},"s8/Y":function(We,ce,M){We.exports=M.p+"static/jx.e464a4ed.svg"},"sB/4":function(We,ce,M){We.exports=M.p+"static/b.419f1a2b.svg"},sNtx:function(We,ce,M){},"sh+1":function(We,ce,M){"use strict";M.d(ce,"a",function(){return ue});var q=M("a247");function ue(re,fe){var ae;if(typeof Symbol=="undefined"||re[Symbol.iterator]==null){if(Array.isArray(re)||(ae=Object(q.a)(re))||fe&&re&&typeof re.length=="number"){ae&&(re=ae);var z=0,R=function(){};return{s:R,n:function(){return z>=re.length?{done:!0}:{done:!1,value:re[z++]}},e:function(N){throw N},f:R}}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 B=!0,n=!1,W;return{s:function(){ae=re[Symbol.iterator]()},n:function(){var N=ae.next();return B=N.done,N},e:function(N){n=!0,W=N},f:function(){try{!B&&ae.return!=null&&ae.return()}finally{if(n)throw W}}}}},"t/PP":function(We,ce,M){We.exports=M.p+"static/title.b0fa77f7.svg"},t9D7:function(We,ce,M){"use strict";M.d(ce,"b",function(){return R}),M.d(ce,"g",function(){return n}),M.d(ce,"d",function(){return W}),M.d(ce,"e",function(){return D}),M.d(ce,"a",function(){return N}),M.d(ce,"f",function(){return s}),M.d(ce,"c",function(){return g});var q=M("Vhoy"),ue=M("MI8n"),re=M("pmY6"),fe=M("Cg/j"),ae=M("ic2d"),z=M("nEHx");const R=Object(fe.c)("themeService");var B;(function(h){function _(r){return r&&typeof r=="object"&&typeof r.id=="string"}h.isThemeColor=_})(B||(B={}));function n(h){return{id:h}}var W;(function(h){function _(E){return E&&typeof E=="object"&&typeof E.id=="string"&&(typeof E.color=="undefined"||B.isThemeColor(E.color))}h.isThemeIcon=_;const r=new RegExp(`^\\$\\((${q.a.iconNameExpression}(?:${q.a.iconModifierExpression})?)\\)$`);function v(E){const x=r.exec(E);if(!x)return;let[,P]=x;return{id:P}}h.fromString=v;function S(E,x){let P=E.id;const T=P.lastIndexOf("~");return T!==-1&&(P=P.substring(0,T)),x&&(P=`${P}~${x}`),{id:P}}h.modify=S;function w(E,x){var P,T;return E.id===x.id&&((P=E.color)===null||P===void 0?void 0:P.id)===((T=x.color)===null||T===void 0?void 0:T.id)}h.isEqual=w;function I(E,x){return{id:E.id,color:x?n(x):void 0}}h.asThemeIcon=I,h.asClassNameArray=q.a.asClassNameArray,h.asClassName=q.a.asClassName,h.asCSSSelector=q.a.asCSSSelector})(W||(W={}));function D(h){switch(h){case z.a.DARK:return"vs-dark";case z.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const N={ThemingContribution:"base.contributions.theming"};class d{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new ue.b}onColorThemeChange(h){return this.themingParticipants.push(h),this.onThemingParticipantAddedEmitter.fire(h),Object(re.i)(()=>{const _=this.themingParticipants.indexOf(h);this.themingParticipants.splice(_,1)})}getThemingParticipants(){return this.themingParticipants}}let m=new d;ae.a.add(N.ThemingContribution,m);function s(h){return m.onColorThemeChange(h)}class g extends re.a{constructor(h){super();this.themeService=h,this.theme=h.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(_=>this.onThemeChange(_)))}onThemeChange(h){this.theme=h,this.updateStyles()}updateStyles(){}}},"tty/":function(We,ce,M){"use strict";M.d(ce,"a",function(){return D}),M.d(ce,"b",function(){return d});var q=/margin|padding|width|height|max|min|offset/,ue={left:!0,top:!0},re={cssFloat:1,styleFloat:1,float:1};function fe(m){return m.nodeType===1?m.ownerDocument.defaultView.getComputedStyle(m,null):{}}function ae(m,s,g){if(s=s.toLowerCase(),g==="auto"){if(s==="height")return m.offsetHeight;if(s==="width")return m.offsetWidth}return s in ue||(ue[s]=q.test(s)),ue[s]?parseFloat(g)||0:g}function z(m,s){var g=arguments.length,h=fe(m);return s=re[s]?"cssFloat"in m.style?"cssFloat":"styleFloat":s,g===1?h:ae(m,s,h[s]||m.style[s])}function R(m,s,g){var h=arguments.length;if(s=re[s]?"cssFloat"in m.style?"cssFloat":"styleFloat":s,h===3)return typeof g=="number"&&q.test(s)&&(g="".concat(g,"px")),m.style[s]=g,g;for(var _ in s)s.hasOwnProperty(_)&&R(m,_,s[_]);return fe(m)}function B(m){return m===document.body?document.documentElement.clientWidth:m.offsetWidth}function n(m){return m===document.body?window.innerHeight||document.documentElement.clientHeight:m.offsetHeight}function W(){var m=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),s=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:m,height:s}}function D(){var m=document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight;return{width:m,height:s}}function N(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function d(m){var s=m.getBoundingClientRect(),g=document.documentElement;return{left:s.left+(window.pageXOffset||g.scrollLeft)-(g.clientLeft||document.body.clientLeft||0),top:s.top+(window.pageYOffset||g.scrollTop)-(g.clientTop||document.body.clientTop||0)}}},twBr:function(We,ce,M){We.exports=M.p+"static/s.b06c61c8.svg"},uMZB:function(We,ce,M){We.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(We,ce,M){We.exports=q;function q(){return M("gaXo"),{}}},ulZh:function(We,ce,M){typeof window!="undefined"&&function(ue,re){We.exports=re()}(this,()=>(()=>{var q={"./src/config.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{enableStreamingMode:()=>f,hlsDefaultConfig:()=>C,mergeConfig:()=>i});var B=R("./src/controller/abr-controller.ts"),n=R("./src/controller/audio-stream-controller.ts"),W=R("./src/controller/audio-track-controller.ts"),D=R("./src/controller/subtitle-stream-controller.ts"),N=R("./src/controller/subtitle-track-controller.ts"),d=R("./src/controller/buffer-controller.ts"),m=R("./src/controller/timeline-controller.ts"),s=R("./src/controller/cap-level-controller.ts"),g=R("./src/controller/fps-controller.ts"),h=R("./src/controller/eme-controller.ts"),_=R("./src/controller/cmcd-controller.ts"),r=R("./src/utils/xhr-loader.ts"),v=R("./src/utils/fetch-loader.ts"),S=R("./src/utils/cues.ts"),w=R("./src/utils/mediakeys-helper.ts"),I=R("./src/utils/logger.ts");function E(){return E=Object.assign?Object.assign.bind():function(o){for(var a=1;a<arguments.length;a++){var L=arguments[a];for(var y in L)Object.prototype.hasOwnProperty.call(L,y)&&(o[y]=L[y])}return o},E.apply(this,arguments)}function x(o,a){var L=Object.keys(o);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(o);a&&(y=y.filter(function(l){return Object.getOwnPropertyDescriptor(o,l).enumerable})),L.push.apply(L,y)}return L}function P(o){for(var a=1;a<arguments.length;a++){var L=arguments[a]!=null?arguments[a]:{};a%2?x(Object(L),!0).forEach(function(y){T(o,y,L[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(L)):x(Object(L)).forEach(function(y){Object.defineProperty(o,y,Object.getOwnPropertyDescriptor(L,y))})}return o}function T(o,a,L){return a=A(a),a in o?Object.defineProperty(o,a,{value:L,enumerable:!0,configurable:!0,writable:!0}):o[a]=L,o}function A(o){var a=b(o,"string");return typeof a=="symbol"?a:String(a)}function b(o,a){if(typeof o!="object"||o===null)return o;var L=o[Symbol.toPrimitive];if(L!==void 0){var y=L.call(o,a||"default");if(typeof y!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(o)}var C=P(P({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!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:r.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:B.default,bufferController:d.default,capLevelController:s.default,fpsController:g.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,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:w.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0},p()),{},{subtitleStreamController:D.SubtitleStreamController,subtitleTrackController:N.default,timelineController:m.TimelineController,audioStreamController:n.default,audioTrackController:W.default,emeController:h.default,cmcdController:_.default});function p(){return{cueHandler:S.default,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function i(o,a){if((a.liveSyncDurationCount||a.liveMaxLatencyDurationCount)&&(a.liveSyncDuration||a.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(a.liveMaxLatencyDurationCount!==void 0&&(a.liveSyncDurationCount===void 0||a.liveMaxLatencyDurationCount<=a.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(a.liveMaxLatencyDuration!==void 0&&(a.liveSyncDuration===void 0||a.liveMaxLatencyDuration<=a.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return E({},o,a)}function f(o){var a=o.loader;if(a!==v.default&&a!==r.default)I.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),o.progressive=!1;else{var L=(0,v.fetchSupported)();L&&(o.loader=v.default,o.progressive=!0,o.enableSoftwareAES=!0,I.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>r});var B=R("./src/polyfills/number.ts"),n=R("./src/utils/ewma-bandwidth-estimator.ts"),W=R("./src/events.ts"),D=R("./src/errors.ts"),N=R("./src/types/loader.ts"),d=R("./src/utils/logger.ts");function m(v,S){for(var w=0;w<S.length;w++){var I=S[w];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(v,g(I.key),I)}}function s(v,S,w){return S&&m(v.prototype,S),w&&m(v,w),Object.defineProperty(v,"prototype",{writable:!1}),v}function g(v){var S=h(v,"string");return typeof S=="symbol"?S:String(S)}function h(v,S){if(typeof v!="object"||v===null)return v;var w=v[Symbol.toPrimitive];if(w!==void 0){var I=w.call(v,S||"default");if(typeof I!="object")return I;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(v)}var _=function(){function v(w){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=w;var I=w.config;this.bwEstimator=new n.default(I.abrEwmaSlowVoD,I.abrEwmaFastVoD,I.abrEwmaDefaultEstimate),this.registerListeners()}var S=v.prototype;return S.registerListeners=function(){var I=this.hls;I.on(W.Events.FRAG_LOADING,this.onFragLoading,this),I.on(W.Events.FRAG_LOADED,this.onFragLoaded,this),I.on(W.Events.FRAG_BUFFERED,this.onFragBuffered,this),I.on(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),I.on(W.Events.ERROR,this.onError,this)},S.unregisterListeners=function(){var I=this.hls;I.off(W.Events.FRAG_LOADING,this.onFragLoading,this),I.off(W.Events.FRAG_LOADED,this.onFragLoaded,this),I.off(W.Events.FRAG_BUFFERED,this.onFragBuffered,this),I.off(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),I.off(W.Events.ERROR,this.onError,this)},S.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},S.onFragLoading=function(I,E){var x=E.frag;if(x.type===N.PlaylistLevelType.MAIN&&!this.timer){var P;this.fragCurrent=x,this.partCurrent=(P=E.part)!=null?P:null,this.timer=self.setInterval(this.onCheck,100)}},S.onLevelLoaded=function(I,E){var x=this.hls.config;E.details.live?this.bwEstimator.update(x.abrEwmaSlowLive,x.abrEwmaFastLive):this.bwEstimator.update(x.abrEwmaSlowVoD,x.abrEwmaFastVoD)},S._abandonRulesCheck=function(){var I=this.fragCurrent,E=this.partCurrent,x=this.hls,P=x.autoLevelEnabled,T=x.media;if(!I||!T)return;var A=E?E.stats:I.stats,b=E?E.duration:I.duration;if(A.aborted||A.loaded&&A.loaded===A.total||I.level===0){this.clearTimer(),this._nextAutoLevel=-1;return}if(!P||T.paused||!T.playbackRate||!T.readyState)return;var C=x.mainForwardBufferInfo;if(C===null)return;var p=performance.now()-A.loading.start,i=Math.abs(T.playbackRate);if(p<=500*b/i)return;var f=A.loaded&&A.loading.first,o=this.bwEstimator.getEstimate(),a=x.levels,L=x.minAutoLevel,y=a[I.level],l=A.total||Math.max(A.loaded,Math.round(b*y.maxBitrate/8)),F=f?A.loaded*1e3/p:0,j=F?(l-A.loaded)/F:l*8/o,G=C.len/i;if(j<=G)return;var Y=Number.POSITIVE_INFINITY,te;for(te=I.level-1;te>L;te--){var de=a[te].maxBitrate;if(Y=F?b*de/(8*.8*F):b*de/o,Y<G)break}if(Y>=j)return;d.logger.warn("Fragment "+I.sn+(E?" part "+E.index:"")+" of level "+I.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+te+`
Current BW estimate: `+((0,B.isFiniteNumber)(o)?(o/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+j.toFixed(3)+` s
Estimated load time for the next fragment: `+Y.toFixed(3)+` s
Time to underbuffer: `+G.toFixed(3)+" s"),x.nextLoadLevel=te,f&&this.bwEstimator.sample(p,A.loaded),this.clearTimer(),(I.loader||I.keyLoader)&&(this.fragCurrent=this.partCurrent=null,I.abortRequests()),x.trigger(W.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:I,part:E,stats:A})},S.onFragLoaded=function(I,E){var x=E.frag,P=E.part;if(x.type===N.PlaylistLevelType.MAIN&&(0,B.isFiniteNumber)(x.sn)){var T=P?P.stats:x.stats,A=P?P.duration:x.duration;if(this.clearTimer(),this.lastLoadedFragLevel=x.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var b=this.hls.levels[x.level],C=(b.loaded?b.loaded.bytes:0)+T.loaded,p=(b.loaded?b.loaded.duration:0)+A;b.loaded={bytes:C,duration:p},b.realBitrate=Math.round(8*C/p)}if(x.bitrateTest){var i={stats:T,frag:x,part:P,id:x.type};this.onFragBuffered(W.Events.FRAG_BUFFERED,i)}}},S.onFragBuffered=function(I,E){var x=E.frag,P=E.part,T=P?P.stats:x.stats;if(T.aborted)return;if(x.type!==N.PlaylistLevelType.MAIN||x.sn==="initSegment")return;var A=T.parsing.end-T.loading.start;this.bwEstimator.sample(A,T.loaded),T.bwEstimate=this.bwEstimator.getEstimate(),x.bitrateTest?this.bitrateTestDelay=A/1e3:this.bitrateTestDelay=0},S.onError=function(I,E){var x;if(((x=E.frag)===null||x===void 0?void 0:x.type)===N.PlaylistLevelType.MAIN){if(E.type===D.ErrorTypes.KEY_SYSTEM_ERROR){this.clearTimer();return}switch(E.details){case D.ErrorDetails.FRAG_LOAD_ERROR:case D.ErrorDetails.FRAG_LOAD_TIMEOUT:case D.ErrorDetails.KEY_LOAD_ERROR:case D.ErrorDetails.KEY_LOAD_TIMEOUT:this.clearTimer();break;default:break}}},S.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},S.getNextABRAutoLevel=function(){var I=this.fragCurrent,E=this.partCurrent,x=this.hls,P=x.maxAutoLevel,T=x.config,A=x.minAutoLevel,b=x.media,C=E?E.duration:I?I.duration:0,p=b&&b.playbackRate!==0?Math.abs(b.playbackRate):1,i=this.bwEstimator?this.bwEstimator.getEstimate():T.abrEwmaDefaultEstimate,f=x.mainForwardBufferInfo,o=(f?f.len:0)/p,a=this.findBestLevel(i,A,P,o,T.abrBandWidthFactor,T.abrBandWidthUpFactor);if(a>=0)return a;d.logger.trace((o?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var L=C?Math.min(C,T.maxStarvationDelay):T.maxStarvationDelay,y=T.abrBandWidthFactor,l=T.abrBandWidthUpFactor;if(!o){var F=this.bitrateTestDelay;if(F){var j=C?Math.min(C,T.maxLoadingDelay):T.maxLoadingDelay;L=j-F,d.logger.trace("bitrate test took "+Math.round(1e3*F)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*L)+" ms"),y=l=1}}return a=this.findBestLevel(i,A,P,o+L,y,l),Math.max(a,0)},S.findBestLevel=function(I,E,x,P,T,A){for(var b,C=this.fragCurrent,p=this.partCurrent,i=this.lastLoadedFragLevel,f=this.hls.levels,o=f[i],a=!!(o!=null&&(b=o.details)!==null&&b!==void 0&&b.live),L=o==null?void 0:o.codecSet,y=p?p.duration:C?C.duration:0,l=x;l>=E;l--){var F=f[l];if(!F||L&&F.codecSet!==L)continue;var j=F.details,G=(p?j==null?void 0:j.partTarget:j==null?void 0:j.averagetargetduration)||y,Y=void 0;l<=i?Y=T*I:Y=A*I;var te=f[l].maxBitrate,de=te*G/Y;if(d.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+l+"/"+Math.round(Y)+"/"+te+"/"+G+"/"+P+"/"+de),Y>te&&(de===0||!(0,B.isFiniteNumber)(de)||a&&!this.bitrateTestDelay||de<P))return l}return-1},s(v,[{key:"nextAutoLevel",get:function(){var I=this._nextAutoLevel,E=this.bwEstimator;if(I!==-1&&!E.canEstimate())return I;var x=this.getNextABRAutoLevel();return I!==-1&&this.hls.levels[x].loadError?I:(I!==-1&&(x=Math.min(I,x)),x)},set:function(I){this._nextAutoLevel=I}}]),v}();const r=_},"./src/controller/audio-stream-controller.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>T});var B=R("./src/polyfills/number.ts"),n=R("./src/controller/base-stream-controller.ts"),W=R("./src/events.ts"),D=R("./src/utils/buffer-helper.ts"),N=R("./src/controller/fragment-tracker.ts"),d=R("./src/types/level.ts"),m=R("./src/types/loader.ts"),s=R("./src/loader/fragment.ts"),g=R("./src/demux/chunk-cache.ts"),h=R("./src/demux/transmuxer-interface.ts"),_=R("./src/types/transmuxer.ts"),r=R("./src/controller/fragment-finders.ts"),v=R("./src/utils/discontinuities.ts"),S=R("./src/errors.ts");function w(){return w=Object.assign?Object.assign.bind():function(A){for(var b=1;b<arguments.length;b++){var C=arguments[b];for(var p in C)Object.prototype.hasOwnProperty.call(C,p)&&(A[p]=C[p])}return A},w.apply(this,arguments)}function I(A,b){A.prototype=Object.create(b.prototype),A.prototype.constructor=A,E(A,b)}function E(A,b){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,i){return p.__proto__=i,p},E(A,b)}var x=100,P=function(A){I(b,A);function b(p,i,f){var o;return o=A.call(this,p,i,f,"[audio-stream-controller]")||this,o.videoBuffer=null,o.videoTrackCC=-1,o.waitingVideoCC=-1,o.audioSwitch=!1,o.trackId=-1,o.waitingData=null,o.mainDetails=null,o.bufferFlushed=!1,o.cachedTrackLoadedData=null,o._registerListeners(),o}var C=b.prototype;return C.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},C._registerListeners=function(){var i=this.hls;i.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.on(W.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),i.on(W.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),i.on(W.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.on(W.Events.ERROR,this.onError,this),i.on(W.Events.BUFFER_RESET,this.onBufferReset,this),i.on(W.Events.BUFFER_CREATED,this.onBufferCreated,this),i.on(W.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),i.on(W.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.on(W.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C._unregisterListeners=function(){var i=this.hls;i.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.off(W.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),i.off(W.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),i.off(W.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.off(W.Events.ERROR,this.onError,this),i.off(W.Events.BUFFER_RESET,this.onBufferReset,this),i.off(W.Events.BUFFER_CREATED,this.onBufferCreated,this),i.off(W.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),i.off(W.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.off(W.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C.onInitPtsFound=function(i,f){var o=f.frag,a=f.id,L=f.initPTS;if(a==="main"){var y=o.cc;this.initPTS[o.cc]=L,this.log("InitPTS for cc: "+y+" found from main: "+L),this.videoTrackCC=y,this.state===n.State.WAITING_INIT_PTS&&this.tick()}},C.startLoad=function(i){if(!this.levels){this.startPosition=i,this.state=n.State.STOPPED;return}var f=this.lastCurrentTime;this.stopLoad(),this.setInterval(x),this.fragLoadError=0,f>0&&i===-1?(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),i=f,this.state=n.State.IDLE):(this.loadedmetadata=!1,this.state=n.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=i,this.tick()},C.doTick=function(){switch(this.state){case n.State.IDLE:this.doTickIdle();break;case n.State.WAITING_TRACK:{var i,f=this.levels,o=this.trackId,a=f==null||((i=f[o])===null||i===void 0)?void 0:i.details;if(a){if(this.waitForCdnTuneIn(a))break;this.state=n.State.WAITING_INIT_PTS}break}case n.State.FRAG_LOADING_WAITING_RETRY:{var L,y=performance.now(),l=this.retryDate;(!l||y>=l||(L=this.media)!==null&&L!==void 0&&L.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.trackId),this.state=n.State.IDLE);break}case n.State.WAITING_INIT_PTS:{var F=this.waitingData;if(F){var j=F.frag,G=F.part,Y=F.cache,te=F.complete;if(this.initPTS[j.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=n.State.FRAG_LOADING;var de=Y.flush(),ve={frag:j,part:G,payload:de,networkDetails:null};this._handleFragmentLoadProgress(ve),te&&A.prototype._handleFragmentLoadComplete.call(this,ve)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log("Waiting fragment cc ("+j.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var he=this.getLoadPosition(),Re=D.BufferHelper.bufferInfo(this.mediaBuffer,he,this.config.maxBufferHole),we=(0,r.fragmentWithinToleranceTest)(Re.end,this.config.maxFragLookUpTolerance,j);we<0&&(this.log("Waiting fragment cc ("+j.cc+") @ "+j.start+" cancelled because another fragment at "+Re.end+" is needed"),this.clearWaitingFragment())}}else this.state=n.State.IDLE}}this.onTickEnd()},C.clearWaitingFragment=function(){var i=this.waitingData;i&&(this.fragmentTracker.removeFragment(i.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=n.State.IDLE)},C.resetLoadingState=function(){this.clearWaitingFragment(),A.prototype.resetLoadingState.call(this)},C.onTickEnd=function(){var i=this.media;if(!i||!i.readyState)return;this.lastCurrentTime=i.currentTime},C.doTickIdle=function(){var i=this.hls,f=this.levels,o=this.media,a=this.trackId,L=i.config;if(!f||!f[a])return;if(!o&&(this.startFragRequested||!L.startFragPrefetch))return;var y=f[a],l=y.details;if(!l||l.live&&this.levelLastLoaded!==a||this.waitForCdnTuneIn(l)){this.state=n.State.WAITING_TRACK;return}var F=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&F&&(this.bufferFlushed=!1,this.afterBufferFlushed(F,s.ElementaryStreamTypes.AUDIO,m.PlaylistLevelType.AUDIO));var j=this.getFwdBufferInfo(F,m.PlaylistLevelType.AUDIO);if(j===null)return;var G=this.audioSwitch;if(!G&&this._streamEnded(j,l)){i.trigger(W.Events.BUFFER_EOS,{type:"audio"}),this.state=n.State.ENDED;return}var Y=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,m.PlaylistLevelType.MAIN),te=j.len,de=this.getMaxBufferLength(Y==null?void 0:Y.len);if(te>=de&&!G)return;var ve=l.fragments,he=ve[0].start,Re=j.end;if(G&&o){var we=this.getLoadPosition();Re=we,l.PTSKnown&&we<he&&((j.end>he||j.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),o.currentTime=he+.05))}if(Y&&Re>Y.end+l.targetduration)return;if((!Y||!Y.len)&&j.len)return;var ge=this.getNextFragment(Re,l);if(!ge){this.bufferFlushed=!0;return}this.loadFragment(ge,l,Re)},C.getMaxBufferLength=function(i){var f=A.prototype.getMaxBufferLength.call(this);return i?Math.max(f,i):f},C.onMediaDetaching=function(){this.videoBuffer=null,A.prototype.onMediaDetaching.call(this)},C.onAudioTracksUpdated=function(i,f){var o=f.audioTracks;this.resetTransmuxer(),this.levels=o.map(function(a){return new d.Level(a)})},C.onAudioTrackSwitching=function(i,f){var o=!!f.url;this.trackId=f.id;var a=this.fragCurrent;a&&a.abortRequests(),this.fragCurrent=null,this.clearWaitingFragment(),o?this.setInterval(x):this.resetTransmuxer(),o?(this.audioSwitch=!0,this.state=n.State.IDLE):this.state=n.State.STOPPED,this.tick()},C.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},C.onLevelLoaded=function(i,f){this.mainDetails=f.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger(W.Events.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)},C.onAudioTrackLoaded=function(i,f){var o;if(this.mainDetails==null){this.cachedTrackLoadedData=f;return}var a=this.levels,L=f.details,y=f.id;if(!a){this.warn("Audio tracks were reset while loading level "+y);return}this.log("Track "+y+" loaded ["+L.startSN+","+L.endSN+"],duration:"+L.totalduration);var l=a[y],F=0;if(L.live||(o=l.details)!==null&&o!==void 0&&o.live){var j=this.mainDetails;if(L.fragments[0]||(L.deltaUpdateFailed=!0),L.deltaUpdateFailed||!j)return;!l.details&&L.hasProgramDateTime&&j.hasProgramDateTime?((0,v.alignMediaPlaylistByPDT)(L,j),F=L.fragments[0].start):F=this.alignPlaylists(L,l.details)}l.details=L,this.levelLastLoaded=y,!this.startFragRequested&&(this.mainDetails||!L.live)&&this.setStartPosition(l.details,F),this.state===n.State.WAITING_TRACK&&!this.waitForCdnTuneIn(L)&&(this.state=n.State.IDLE),this.tick()},C._handleFragmentLoadProgress=function(i){var f,o=i.frag,a=i.part,L=i.payload,y=this.config,l=this.trackId,F=this.levels;if(!F){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+o.sn+" of level "+o.level+" will not be buffered");return}var j=F[l];console.assert(j,"Audio track is defined on fragment load progress");var G=j.details;console.assert(G,"Audio track details are defined on fragment load progress");var Y=y.defaultAudioCodec||j.audioCodec||"mp4a.40.2",te=this.transmuxer;te||(te=this.transmuxer=new h.default(this.hls,m.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var de=this.initPTS[o.cc],ve=(f=o.initSegment)===null||f===void 0?void 0:f.data;if(de!==void 0){var he=!1,Re=a?a.index:-1,we=Re!==-1,ge=new _.ChunkMetadata(o.level,o.sn,o.stats.chunkCount,L.byteLength,Re,we);te.push(L,ve,Y,"",o,a,G.totalduration,he,ge,de)}else{this.log("Unknown video PTS for cc "+o.cc+", waiting for video PTS before demuxing audio frag "+o.sn+" of ["+G.startSN+" ,"+G.endSN+"],track "+l);var Ne=this.waitingData=this.waitingData||{frag:o,part:a,cache:new g.default,complete:!1},ze=Ne.cache;ze.push(new Uint8Array(L)),this.waitingVideoCC=this.videoTrackCC,this.state=n.State.WAITING_INIT_PTS}},C._handleFragmentLoadComplete=function(i){if(this.waitingData){this.waitingData.complete=!0;return}A.prototype._handleFragmentLoadComplete.call(this,i)},C.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},C.onBufferCreated=function(i,f){var o=f.tracks.audio;o&&(this.mediaBuffer=o.buffer||null),f.tracks.video&&(this.videoBuffer=f.tracks.video.buffer||null)},C.onFragBuffered=function(i,f){var o=f.frag,a=f.part;if(o.type!==m.PlaylistLevelType.AUDIO){if(!this.loadedmetadata&&o.type===m.PlaylistLevelType.MAIN){var L;(L=this.videoBuffer||this.media)!==null&&L!==void 0&&L.buffered.length&&(this.loadedmetadata=!0)}return}if(this.fragContextChanged(o)){this.warn("Fragment "+o.sn+(a?" p: "+a.index:"")+" of level "+o.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}o.sn!=="initSegment"&&(this.fragPrevious=o,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(W.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(o,a)},C.onError=function(i,f){if(f.type===S.ErrorTypes.KEY_SYSTEM_ERROR){this.onFragmentOrKeyLoadError(m.PlaylistLevelType.AUDIO,f);return}switch(f.details){case S.ErrorDetails.FRAG_LOAD_ERROR:case S.ErrorDetails.FRAG_LOAD_TIMEOUT:case S.ErrorDetails.FRAG_PARSING_ERROR:case S.ErrorDetails.KEY_LOAD_ERROR:case S.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(m.PlaylistLevelType.AUDIO,f);break;case S.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case S.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==n.State.ERROR&&this.state!==n.State.STOPPED&&(this.state=f.fatal?n.State.ERROR:n.State.IDLE,this.warn(f.details+" while loading frag, switching to "+this.state+" state"));break;case S.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="audio"&&(this.state===n.State.PARSING||this.state===n.State.PARSED)){var o=!0,a=this.getFwdBufferInfo(this.mediaBuffer,m.PlaylistLevelType.AUDIO);a&&a.len>.5&&(o=!this.reduceMaxBufferLength(a.len)),o&&(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}},C.onBufferFlushed=function(i,f){var o=f.type;o===s.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0,this.state===n.State.ENDED&&(this.state=n.State.IDLE))},C._handleTransmuxComplete=function(i){var f,o="audio",a=this.hls,L=i.remuxResult,y=i.chunkMeta,l=this.getCurrentContext(y);if(!l){this.warn("The loading context changed while buffering fragment "+y.sn+" of level "+y.level+". This chunk will not be buffered."),this.resetStartWhenNotLoaded(y.level);return}var F=l.frag,j=l.part,G=l.level.details,Y=L.audio,te=L.text,de=L.id3,ve=L.initSegment;if(this.fragContextChanged(F)||!G)return;if(this.state=n.State.PARSING,this.audioSwitch&&Y&&this.completeAudioSwitch(),ve!=null&&ve.tracks&&(this._bufferInitSegment(ve.tracks,F,y),a.trigger(W.Events.FRAG_PARSING_INIT_SEGMENT,{frag:F,id:o,tracks:ve.tracks})),Y){var he=Y.startPTS,Re=Y.endPTS,we=Y.startDTS,ge=Y.endDTS;j&&(j.elementaryStreams[s.ElementaryStreamTypes.AUDIO]={startPTS:he,endPTS:Re,startDTS:we,endDTS:ge}),F.setElementaryStreamInfo(s.ElementaryStreamTypes.AUDIO,he,Re,we,ge),this.bufferFragmentData(Y,F,j,y)}if(de!=null&&(f=de.samples)!==null&&f!==void 0&&f.length){var Ne=w({id:o,frag:F,details:G},de);a.trigger(W.Events.FRAG_PARSING_METADATA,Ne)}if(te){var ze=w({id:o,frag:F,details:G},te);a.trigger(W.Events.FRAG_PARSING_USERDATA,ze)}},C._bufferInitSegment=function(i,f,o){if(this.state!==n.State.PARSING)return;i.video&&delete i.video;var a=i.audio;if(!a)return;a.levelCodec=a.codec,a.id="audio",this.log("Init audio buffer, container:"+a.container+", codecs[parsed]=["+a.codec+"]"),this.hls.trigger(W.Events.BUFFER_CODECS,i);var L=a.initSegment;if(L!=null&&L.byteLength){var y={type:"audio",frag:f,part:null,chunkMeta:o,parent:f.type,data:L};this.hls.trigger(W.Events.BUFFER_APPENDING,y)}this.tick()},C.loadFragment=function(i,f,o){var a=this.fragmentTracker.getState(i);this.fragCurrent=i,(this.audioSwitch||a===N.FragmentState.NOT_LOADED||a===N.FragmentState.PARTIAL)&&(i.sn==="initSegment"?this._loadInitSegment(i,f):f.live&&!(0,B.isFiniteNumber)(this.initPTS[i.cc])?(this.log("Waiting for video PTS in continuity counter "+i.cc+" of live stream before loading audio fragment "+i.sn+" of level "+this.trackId),this.state=n.State.WAITING_INIT_PTS):(this.startFragRequested=!0,A.prototype.loadFragment.call(this,i,f,o)))},C.completeAudioSwitch=function(){var i=this.hls,f=this.media,o=this.trackId;f&&(this.log("Switching audio track : flushing all audio"),A.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,i.trigger(W.Events.AUDIO_TRACK_SWITCHED,{id:o})},b}(n.default);const T=P},"./src/controller/audio-track-controller.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>r});var B=R("./src/events.ts"),n=R("./src/errors.ts"),W=R("./src/controller/base-playlist-controller.ts"),D=R("./src/types/loader.ts");function N(v,S){for(var w=0;w<S.length;w++){var I=S[w];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(v,m(I.key),I)}}function d(v,S,w){return S&&N(v.prototype,S),w&&N(v,w),Object.defineProperty(v,"prototype",{writable:!1}),v}function m(v){var S=s(v,"string");return typeof S=="symbol"?S:String(S)}function s(v,S){if(typeof v!="object"||v===null)return v;var w=v[Symbol.toPrimitive];if(w!==void 0){var I=w.call(v,S||"default");if(typeof I!="object")return I;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(v)}function g(v,S){v.prototype=Object.create(S.prototype),v.prototype.constructor=v,h(v,S)}function h(v,S){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(I,E){return I.__proto__=E,I},h(v,S)}var _=function(v){g(S,v);function S(I){var E;return E=v.call(this,I,"[audio-track-controller]")||this,E.tracks=[],E.groupId=null,E.tracksInGroup=[],E.trackId=-1,E.trackName="",E.selectDefaultTrack=!0,E.registerListeners(),E}var w=S.prototype;return w.registerListeners=function(){var E=this.hls;E.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.on(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.on(B.Events.LEVEL_LOADING,this.onLevelLoading,this),E.on(B.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),E.on(B.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),E.on(B.Events.ERROR,this.onError,this)},w.unregisterListeners=function(){var E=this.hls;E.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.off(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.off(B.Events.LEVEL_LOADING,this.onLevelLoading,this),E.off(B.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),E.off(B.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),E.off(B.Events.ERROR,this.onError,this)},w.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,v.prototype.destroy.call(this)},w.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},w.onManifestParsed=function(E,x){this.tracks=x.audioTracks||[]},w.onAudioTrackLoaded=function(E,x){var P=x.id,T=x.details,A=this.tracksInGroup[P];if(!A){this.warn("Invalid audio track id "+P);return}var b=A.details;A.details=x.details,this.log("audioTrack "+P+" loaded ["+T.startSN+"-"+T.endSN+"]"),P===this.trackId&&(this.retryCount=0,this.playlistLoaded(P,x,b))},w.onLevelLoading=function(E,x){this.switchLevel(x.level)},w.onLevelSwitching=function(E,x){this.switchLevel(x.level)},w.switchLevel=function(E){var x=this.hls.levels[E];if(!(x!=null&&x.audioGroupIds))return;var P=x.audioGroupIds[x.urlId];if(this.groupId!==P){this.groupId=P;var T=this.tracks.filter(function(b){return!P||b.groupId===P});this.selectDefaultTrack&&!T.some(function(b){return b.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=T;var A={audioTracks:T};this.log("Updating audio tracks, "+T.length+' track(s) found in "'+P+'" group-id'),this.hls.trigger(B.Events.AUDIO_TRACKS_UPDATED,A),this.selectInitialTrack()}},w.onError=function(E,x){if(v.prototype.onError.call(this,E,x),x.fatal||!x.context)return;x.context.type===D.PlaylistContextType.AUDIO_TRACK&&x.context.id===this.trackId&&x.context.groupId===this.groupId&&this.retryLoadingOrFail(x)},w.setAudioTrack=function(E){var x=this.tracksInGroup;if(E<0||E>=x.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var P=x[this.trackId];this.log("Now switching to audio-track index "+E);var T=x[E],A=T.id,b=T.groupId,C=b===void 0?"":b,p=T.name,i=T.type,f=T.url;if(this.trackId=E,this.trackName=p,this.selectDefaultTrack=!1,this.hls.trigger(B.Events.AUDIO_TRACK_SWITCHING,{id:A,groupId:C,name:p,type:i,url:f}),T.details&&!T.details.live)return;var o=this.switchParams(T.url,P==null?void 0:P.details);this.loadPlaylist(o)},w.selectInitialTrack=function(){var E=this.tracksInGroup;console.assert(E.length,"Initial audio track should be selected when tracks are known");var x=this.trackName,P=this.findTrackId(x)||this.findTrackId();P!==-1?this.setAudioTrack(P):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(B.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},w.findTrackId=function(E){for(var x=this.tracksInGroup,P=0;P<x.length;P++){var T=x[P];if((!this.selectDefaultTrack||T.default)&&(!E||E===T.name))return T.id}return-1},w.loadPlaylist=function(E){v.prototype.loadPlaylist.call(this);var x=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(x)){var P=x.id,T=x.groupId,A=x.url;if(E)try{A=E.addDirectives(A)}catch(b){this.warn("Could not construct new URL with HLS Delivery Directives: "+b)}this.log("loading audio-track playlist for id: "+P),this.clearTimer(),this.hls.trigger(B.Events.AUDIO_TRACK_LOADING,{url:A,id:P,groupId:T,deliveryDirectives:E||null})}},d(S,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(E){this.selectDefaultTrack=!1,this.setAudioTrack(E)}}]),S}(W.default);const r=_},"./src/controller/base-playlist-controller.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>N});var B=R("./src/types/level.ts"),n=R("./src/controller/level-helper.ts"),W=R("./src/utils/logger.ts"),D=R("./src/errors.ts"),N=function(){function d(s,g){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=W.logger.log.bind(W.logger,g+":"),this.warn=W.logger.warn.bind(W.logger,g+":"),this.hls=s}var m=d.prototype;return m.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},m.onError=function(g,h){h.fatal&&(h.type===D.ErrorTypes.NETWORK_ERROR||h.type===D.ErrorTypes.KEY_SYSTEM_ERROR)&&this.stopLoad()},m.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},m.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.requestScheduled=-1,this.loadPlaylist()},m.stopLoad=function(){this.canLoad=!1,this.clearTimer()},m.switchParams=function(g,h){var _=h==null?void 0:h.renditionReports;if(_)for(var r=0;r<_.length;r++){var v=_[r],S=void 0;try{S=new self.URL(v.URI,h.url).href}catch(x){W.logger.warn("Could not construct new URL for Rendition Report: "+x),S=v.URI||""}if(S===g.slice(-S.length)){var w=parseInt(v["LAST-MSN"])||(h==null?void 0:h.lastPartSn),I=parseInt(v["LAST-PART"])||(h==null?void 0:h.lastPartIndex);if(this.hls.config.lowLatencyMode){var E=Math.min(h.age-h.partTarget,h.targetduration);I>=0&&E>h.partTarget&&(I+=1)}return new B.HlsUrlParameters(w,I>=0?I:void 0,B.HlsSkip.No)}}},m.loadPlaylist=function(g){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())},m.shouldLoadTrack=function(g){return this.canLoad&&g&&!!g.url&&(!g.details||g.details.live)},m.playlistLoaded=function(g,h,_){var r=this,v=h.details,S=h.stats,w=self.performance.now(),I=S.loading.first?Math.max(0,w-S.loading.first):0;if(v.advancedDateTime=Date.now()-I,v.live||_!=null&&_.live){if(v.reloaded(_),_&&this.log("live playlist "+g+" "+(v.advanced?"REFRESHED "+v.lastPartSn+"-"+v.lastPartIndex:"MISSED")),_&&v.fragments.length>0&&(0,n.mergeDetails)(_,v),!this.canLoad||!v.live)return;var E,x=void 0,P=void 0;if(v.canBlockReload&&v.endSN&&v.advanced){var T=this.hls.config.lowLatencyMode,A=v.lastPartSn,b=v.endSN,C=v.lastPartIndex,p=C!==-1,i=A===b,f=T?0:C;p?(x=i?b+1:A,P=i?f:C+1):x=b+1;var o=v.age,a=o+v.ageHeader,L=Math.min(a-v.partTarget,v.targetduration*1.5);if(L>0){if(_&&L>_.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+_.tuneInGoal+" to: "+L+" with playlist age: "+v.age),L=0;else{var y=Math.floor(L/v.targetduration);if(x+=y,P!==void 0){var l=Math.round(L%v.targetduration/v.partTarget);P+=l}this.log("CDN Tune-in age: "+v.ageHeader+"s last advanced "+o.toFixed(2)+"s goal: "+L+" skip sn "+y+" to part "+P)}v.tuneInGoal=L}if(E=this.getDeliveryDirectives(v,h.deliveryDirectives,x,P),T||!i){this.loadPlaylist(E);return}}else E=this.getDeliveryDirectives(v,h.deliveryDirectives,x,P);var F=this.hls.mainForwardBufferInfo,j=F?F.end-F.len:0,G=(v.edge-j)*1e3,Y=(0,n.computeReloadInterval)(v,G);v.updated?w>this.requestScheduled+Y&&(this.requestScheduled=S.loading.start):this.requestScheduled=-1,x!==void 0&&v.canBlockReload?this.requestScheduled=S.loading.first+Y-(v.partTarget*1e3||1e3):this.requestScheduled=(this.requestScheduled===-1?w:this.requestScheduled)+Y;var te=this.requestScheduled-w;te=Math.max(0,te),this.log("reload live playlist "+g+" in "+Math.round(te)+" ms"),this.timer=self.setTimeout(function(){return r.loadPlaylist(E)},te)}else this.clearTimer()},m.getDeliveryDirectives=function(g,h,_,r){var v=(0,B.getSkipValue)(g,_);return h!=null&&h.skip&&g.deltaUpdateFailed&&(_=h.msn,r=h.part,v=B.HlsSkip.No),new B.HlsUrlParameters(_,r,v)},m.retryLoadingOrFail=function(g){var h=this,_=this.hls.config,r=this.retryCount<_.levelLoadingMaxRetry;if(r){var v;if(this.requestScheduled=-1,this.retryCount++,g.details.indexOf("LoadTimeOut")>-1&&(v=g.context)!==null&&v!==void 0&&v.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+g.details+'"'),this.loadPlaylist();else{var S=Math.min(Math.pow(2,this.retryCount)*_.levelLoadingRetryDelay,_.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return h.loadPlaylist()},S),this.warn("retry playlist loading #"+this.retryCount+" in "+S+' ms after "'+g.details+'"')}}else this.warn('cannot recover from error "'+g.details+'"'),this.clearTimer(),g.fatal=!0;return r},d}()},"./src/controller/base-stream-controller.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{State:()=>p,default:()=>i});var B=R("./src/polyfills/number.ts"),n=R("./src/task-loop.ts"),W=R("./src/controller/fragment-tracker.ts"),D=R("./src/utils/buffer-helper.ts"),N=R("./src/utils/logger.ts"),d=R("./src/events.ts"),m=R("./src/errors.ts"),s=R("./src/types/transmuxer.ts"),g=R("./src/utils/mp4-tools.ts"),h=R("./src/utils/discontinuities.ts"),_=R("./src/controller/fragment-finders.ts"),r=R("./src/controller/level-helper.ts"),v=R("./src/loader/fragment-loader.ts"),S=R("./src/crypt/decrypter.ts"),w=R("./src/utils/time-ranges.ts"),I=R("./src/types/loader.ts");function E(f,o){for(var a=0;a<o.length;a++){var L=o[a];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(f,P(L.key),L)}}function x(f,o,a){return o&&E(f.prototype,o),a&&E(f,a),Object.defineProperty(f,"prototype",{writable:!1}),f}function P(f){var o=T(f,"string");return typeof o=="symbol"?o:String(o)}function T(f,o){if(typeof f!="object"||f===null)return f;var a=f[Symbol.toPrimitive];if(a!==void 0){var L=a.call(f,o||"default");if(typeof L!="object")return L;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(f)}function A(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}function b(f,o){f.prototype=Object.create(o.prototype),f.prototype.constructor=f,C(f,o)}function C(f,o){return C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(L,y){return L.__proto__=y,L},C(f,o)}var p={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",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},i=function(f){b(o,f);function o(L,y,l,F){var j;return j=f.call(this)||this,j.hls=void 0,j.fragPrevious=null,j.fragCurrent=null,j.fragmentTracker=void 0,j.transmuxer=null,j._state=p.STOPPED,j.media=null,j.mediaBuffer=null,j.config=void 0,j.bitrateTest=!1,j.lastCurrentTime=0,j.nextLoadPosition=0,j.startPosition=0,j.loadedmetadata=!1,j.fragLoadError=0,j.retryDate=0,j.levels=null,j.fragmentLoader=void 0,j.keyLoader=void 0,j.levelLastLoaded=null,j.startFragRequested=!1,j.decrypter=void 0,j.initPTS=[],j.onvseeking=null,j.onvended=null,j.logPrefix="",j.log=void 0,j.warn=void 0,j.logPrefix=F,j.log=N.logger.log.bind(N.logger,F+":"),j.warn=N.logger.warn.bind(N.logger,F+":"),j.hls=L,j.fragmentLoader=new v.default(L.config),j.keyLoader=l,j.fragmentTracker=y,j.config=L.config,j.decrypter=new S.default(L.config),L.on(d.Events.LEVEL_SWITCHING,j.onLevelSwitching,A(j)),j}var a=o.prototype;return a.doTick=function(){this.onTickEnd()},a.onTickEnd=function(){},a.startLoad=function(y){},a.stopLoad=function(){this.fragmentLoader.abort(),this.keyLoader.abort();var y=this.fragCurrent;y&&(y.abortRequests(),this.fragmentTracker.removeFragment(y)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=p.STOPPED},a._streamEnded=function(y,l){if(l.live||y.nextStart||!y.end||!this.media)return!1;var F=l.partList;if(F!=null&&F.length){var j=F[F.length-1],G=D.BufferHelper.isBuffered(this.media,j.start+j.duration/2);return G}var Y=l.fragments[l.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(Y)},a.getLevelDetails=function(){if(this.levels&&this.levelLastLoaded!==null){var y;return(y=this.levels[this.levelLastLoaded])===null||y===void 0?void 0:y.details}},a.onMediaAttached=function(y,l){var F=this.media=this.mediaBuffer=l.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),F.addEventListener("seeking",this.onvseeking),F.addEventListener("ended",this.onvended);var j=this.config;this.levels&&j.autoStartLoad&&this.state===p.STOPPED&&this.startLoad(j.startPosition)},a.onMediaDetaching=function(){var y=this.media;y!=null&&y.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),y&&this.onvseeking&&this.onvended&&(y.removeEventListener("seeking",this.onvseeking),y.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.keyLoader&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},a.onMediaSeeking=function(){var y=this.config,l=this.fragCurrent,F=this.media,j=this.mediaBuffer,G=this.state,Y=F?F.currentTime:0,te=D.BufferHelper.bufferInfo(j||F,Y,y.maxBufferHole);if(this.log("media seeking to "+((0,B.isFiniteNumber)(Y)?Y.toFixed(3):Y)+", state: "+G),this.state===p.ENDED)this.resetLoadingState();else if(l){var de=y.maxFragLookUpTolerance,ve=l.start-de,he=l.start+l.duration+de;if(!te.len||he<te.start||ve>te.end){var Re=Y>he;(Y<ve||Re)&&(Re&&l.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),l.abortRequests()),this.resetLoadingState())}}F&&(this.lastCurrentTime=Y),!this.loadedmetadata&&!te.len&&(this.nextLoadPosition=this.startPosition=Y),this.tickImmediate()},a.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},a.onLevelSwitching=function(y,l){this.fragLoadError=0},a.onHandlerDestroying=function(){this.stopLoad(),f.prototype.onHandlerDestroying.call(this)},a.onHandlerDestroyed=function(){this.state=p.STOPPED,this.hls.off(d.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,f.prototype.onHandlerDestroyed.call(this)},a.loadFragment=function(y,l,F){this._loadFragForPlayback(y,l,F)},a._loadFragForPlayback=function(y,l,F){var j=this,G=function(te){if(j.fragContextChanged(y)){j.warn("Fragment "+y.sn+(te.part?" p: "+te.part.index:"")+" of level "+y.level+" was dropped during download."),j.fragmentTracker.removeFragment(y);return}y.stats.chunkCount++,j._handleFragmentLoadProgress(te)};this._doFragLoad(y,l,F,G).then(function(Y){if(!Y)return;j.fragLoadError=0;var te=j.state;if(j.fragContextChanged(y)){(te===p.FRAG_LOADING||!j.fragCurrent&&te===p.PARSING)&&(j.fragmentTracker.removeFragment(y),j.state=p.IDLE);return}"payload"in Y&&(j.log("Loaded fragment "+y.sn+" of level "+y.level),j.hls.trigger(d.Events.FRAG_LOADED,Y)),j._handleFragmentLoadComplete(Y)}).catch(function(Y){if(j.state===p.STOPPED||j.state===p.ERROR)return;j.warn(Y),j.resetFragmentLoading(y)})},a.flushMainBuffer=function(y,l,F){if(F===void 0&&(F=null),!(y-l))return;var j={startOffset:y,endOffset:l,type:F};this.fragLoadError=0,this.hls.trigger(d.Events.BUFFER_FLUSHING,j)},a._loadInitSegment=function(y,l){var F=this;this._doFragLoad(y,l).then(function(j){if(!j||F.fragContextChanged(y)||!F.levels)throw new Error("init load aborted");return j}).then(function(j){var G=F.hls,Y=j.payload,te=y.decryptdata;if(Y&&Y.byteLength>0&&te&&te.key&&te.iv&&te.method==="AES-128"){var de=self.performance.now();return F.decrypter.decrypt(new Uint8Array(Y),te.key.buffer,te.iv.buffer).then(function(ve){var he=self.performance.now();return G.trigger(d.Events.FRAG_DECRYPTED,{frag:y,payload:ve,stats:{tstart:de,tdecrypt:he}}),j.payload=ve,j})}return j}).then(function(j){var G=F.fragCurrent,Y=F.hls,te=F.levels;if(!te)throw new Error("init load aborted, missing levels");var de=te[y.level].details;console.assert(de,"Level details are defined when init segment is loaded");var ve=y.stats;F.state=p.IDLE,F.fragLoadError=0,y.data=new Uint8Array(j.payload),ve.parsing.start=ve.buffering.start=self.performance.now(),ve.parsing.end=ve.buffering.end=self.performance.now(),j.frag===G&&Y.trigger(d.Events.FRAG_BUFFERED,{stats:ve,frag:G,part:null,id:y.type}),F.tick()}).catch(function(j){if(F.state===p.STOPPED||F.state===p.ERROR)return;F.warn(j),F.resetFragmentLoading(y)})},a.fragContextChanged=function(y){var l=this.fragCurrent;return!y||!l||y.level!==l.level||y.sn!==l.sn||y.urlId!==l.urlId},a.fragBufferedComplete=function(y,l){var F,j,G,Y,te=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log("Buffered "+y.type+" sn: "+y.sn+(l?" part: "+l.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level+" (frag:["+((F=y.startPTS)!=null?F:NaN).toFixed(3)+"-"+((j=y.endPTS)!=null?j:NaN).toFixed(3)+"] > buffer:"+(te?w.default.toString(D.BufferHelper.getBuffered(te)):"(detached)")+")"),this.state=p.IDLE,!te)return;!this.loadedmetadata&&y.type==I.PlaylistLevelType.MAIN&&te.buffered.length&&((G=this.fragCurrent)===null||G===void 0?void 0:G.sn)===((Y=this.fragPrevious)===null||Y===void 0?void 0:Y.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick()},a.seekToStartPos=function(){},a._handleFragmentLoadComplete=function(y){var l=this.transmuxer;if(!l)return;var F=y.frag,j=y.part,G=y.partsLoaded,Y=!G||G.length===0||G.some(function(de){return!de}),te=new s.ChunkMetadata(F.level,F.sn,F.stats.chunkCount+1,0,j?j.index:-1,!Y);l.flush(te)},a._handleFragmentLoadProgress=function(y){},a._doFragLoad=function(y,l,F,j){var G,Y=this;if(F===void 0&&(F=null),!this.levels)throw new Error("frag load aborted, missing levels");var te=null;if(y.encrypted&&!((G=y.decryptdata)!==null&&G!==void 0&&G.key)?(this.log("Loading key for "+y.sn+" of ["+l.startSN+"-"+l.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level),this.state=p.KEY_LOADING,this.fragCurrent=y,te=this.keyLoader.load(y).then(function(we){if(!Y.fragContextChanged(we.frag))return Y.hls.trigger(d.Events.KEY_LOADED,we),Y.state===p.KEY_LOADING&&(Y.state=p.IDLE),we}),this.hls.trigger(d.Events.KEY_LOADING,{frag:y}),this.throwIfFragContextChanged("KEY_LOADING")):!y.encrypted&&l.encryptedFragments.length&&this.keyLoader.loadClear(y,l.encryptedFragments),F=Math.max(y.start,F||0),this.config.lowLatencyMode&&l){var de=l.partList;if(de&&j){F>y.end&&l.fragmentHint&&(y=l.fragmentHint);var ve=this.getNextPart(de,y,F);if(ve>-1){var he=de[ve];return this.log("Loading part sn: "+y.sn+" p: "+he.index+" cc: "+y.cc+" of playlist ["+l.startSN+"-"+l.endSN+"] parts [0-"+ve+"-"+(de.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(F.toFixed(3))),this.nextLoadPosition=he.start+he.duration,this.state=p.FRAG_LOADING,this.hls.trigger(d.Events.FRAG_LOADING,{frag:y,part:de[ve],targetBufferTime:F}),this.throwIfFragContextChanged("FRAG_LOADING parts"),te?te.then(function(we){return!we||Y.fragContextChanged(we.frag)?null:Y.doFragPartsLoad(y,de,ve,j)}).catch(function(we){return Y.handleFragLoadError(we)}):this.doFragPartsLoad(y,de,ve,j).catch(function(we){return Y.handleFragLoadError(we)})}else if(!y.url||this.loadedEndOfParts(de,F))return Promise.resolve(null)}}this.log("Loading fragment "+y.sn+" cc: "+y.cc+" "+(l?"of ["+l.startSN+"-"+l.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(F.toFixed(3))),(0,B.isFiniteNumber)(y.sn)&&!this.bitrateTest&&(this.nextLoadPosition=y.start+y.duration),this.state=p.FRAG_LOADING,this.hls.trigger(d.Events.FRAG_LOADING,{frag:y,targetBufferTime:F}),this.throwIfFragContextChanged("FRAG_LOADING");var Re=this.config.progressive;return Re&&te?te.then(function(we){return!we||Y.fragContextChanged(we==null?void 0:we.frag)?null:Y.fragmentLoader.load(y,j)}).catch(function(we){return Y.handleFragLoadError(we)}):Promise.all([this.fragmentLoader.load(y,Re?j:void 0),te]).then(function(we){var ge=we[0];return!Re&&ge&&j&&j(ge),ge}).catch(function(we){return Y.handleFragLoadError(we)})},a.throwIfFragContextChanged=function(y){if(this.fragCurrent===null)throw new Error("frag load aborted, context changed in "+y)},a.doFragPartsLoad=function(y,l,F,j){var G=this;return new Promise(function(Y,te){var de=[],ve=function he(Re){var we=l[Re];G.fragmentLoader.loadPart(y,we,j).then(function(ge){de[we.index]=ge;var Ne=ge.part;G.hls.trigger(d.Events.FRAG_LOADED,ge);var ze=l[Re+1];if(ze&&ze.fragment===y)he(Re+1);else return Y({frag:y,part:Ne,partsLoaded:de})}).catch(te)};ve(F)})},a.handleFragLoadError=function(y){if("data"in y){var l=y.data;y.data&&l.details===m.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(l.frag,l.part):this.hls.trigger(d.Events.ERROR,l)}else this.hls.trigger(d.Events.ERROR,{type:m.ErrorTypes.OTHER_ERROR,details:m.ErrorDetails.INTERNAL_EXCEPTION,err:y,fatal:!0});return null},a._handleTransmuxerFlush=function(y){var l=this.getCurrentContext(y);if(!l||this.state!==p.PARSING){!this.fragCurrent&&this.state!==p.STOPPED&&this.state!==p.ERROR&&(this.state=p.IDLE);return}var F=l.frag,j=l.part,G=l.level,Y=self.performance.now();F.stats.parsing.end=Y,j&&(j.stats.parsing.end=Y),this.updateLevelTiming(F,j,G,y.partial)},a.getCurrentContext=function(y){var l=this.levels,F=y.level,j=y.sn,G=y.part;if(!l||!l[F])return this.warn("Levels object was unset while buffering fragment "+j+" of level "+F+". The current chunk will not be buffered."),null;var Y=l[F],te=G>-1?(0,r.getPartWith)(Y,j,G):null,de=te?te.fragment:(0,r.getFragmentWithSN)(Y,j,this.fragCurrent);return de?{frag:de,part:te,level:Y}:null},a.bufferFragmentData=function(y,l,F,j){if(!y||this.state!==p.PARSING)return;var G=y.data1,Y=y.data2,te=G;if(G&&Y&&(te=(0,g.appendUint8Array)(G,Y)),!te||!te.length)return;var de={type:y.type,frag:l,part:F,chunkMeta:j,parent:l.type,data:te};this.hls.trigger(d.Events.BUFFER_APPENDING,de),y.dropped&&y.independent&&!F&&this.flushBufferGap(l)},a.flushBufferGap=function(y){var l=this.media;if(!l)return;if(!D.BufferHelper.isBuffered(l,l.currentTime)){this.flushMainBuffer(0,y.start);return}var F=l.currentTime,j=D.BufferHelper.bufferInfo(l,F,0),G=y.duration,Y=Math.min(this.config.maxFragLookUpTolerance*2,G*.25),te=Math.max(Math.min(y.start-Y,j.end-Y),F+Y);y.start-te>Y&&this.flushMainBuffer(te,y.start)},a.getFwdBufferInfo=function(y,l){var F=this.config,j=this.getLoadPosition();if(!(0,B.isFiniteNumber)(j))return null;var G=D.BufferHelper.bufferInfo(y,j,F.maxBufferHole);if(G.len===0&&G.nextStart!==void 0){var Y=this.fragmentTracker.getBufferedFrag(j,l);if(Y&&G.nextStart<Y.end)return D.BufferHelper.bufferInfo(y,j,Math.max(G.nextStart,F.maxBufferHole))}return G},a.getMaxBufferLength=function(y){var l=this.config,F;return y?F=Math.max(8*l.maxBufferSize/y,l.maxBufferLength):F=l.maxBufferLength,Math.min(F,l.maxMaxBufferLength)},a.reduceMaxBufferLength=function(y){var l=this.config,F=y||l.maxBufferLength;return l.maxMaxBufferLength>=F?(l.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+l.maxMaxBufferLength+"s"),!0):!1},a.getNextFragment=function(y,l){var F=l.fragments,j=F.length;if(!j)return null;var G=this.config,Y=F[0].start,te;if(l.live){var de=G.initialLiveManifestSize;if(j<de)return this.warn("Not enough fragments to start playback (have: "+j+", need: "+de+")"),null;!l.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(te=this.getInitialLiveFragment(l,F),this.startPosition=te?this.hls.liveSyncPosition||te.start:y)}else y<=Y&&(te=F[0]);if(!te){var ve=G.lowLatencyMode?l.partEnd:l.fragmentEnd;te=this.getFragmentAtPosition(y,ve,l)}return this.mapToInitFragWhenRequired(te)},a.mapToInitFragWhenRequired=function(y){return y!=null&&y.initSegment&&!(y!=null&&y.initSegment.data)&&!this.bitrateTest?y.initSegment:y},a.getNextPart=function(y,l,F){for(var j=-1,G=!1,Y=!0,te=0,de=y.length;te<de;te++){var ve=y[te];if(Y=Y&&!ve.independent,j>-1&&F<ve.start)break;var he=ve.loaded;he?j=-1:(G||ve.independent||Y)&&ve.fragment===l&&(j=te),G=he}return j},a.loadedEndOfParts=function(y,l){var F=y[y.length-1];return F&&l>F.start&&F.loaded},a.getInitialLiveFragment=function(y,l){var F=this.fragPrevious,j=null;if(F){if(y.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+F.programDateTime),j=(0,_.findFragmentByPDT)(l,F.endProgramDateTime,this.config.maxFragLookUpTolerance)),!j){var G=F.sn+1;if(G>=y.startSN&&G<=y.endSN){var Y=l[G-y.startSN];F.cc===Y.cc&&(j=Y,this.log("Live playlist, switching playlist, load frag with next SN: "+j.sn))}j||(j=(0,_.findFragWithCC)(l,F.cc),j&&this.log("Live playlist, switching playlist, load frag with same CC: "+j.sn))}}else{var te=this.hls.liveSyncPosition;te!==null&&(j=this.getFragmentAtPosition(te,this.bitrateTest?y.fragmentEnd:y.edge,y))}return j},a.getFragmentAtPosition=function(y,l,F){var j=this.config,G=this.fragPrevious,Y=F.fragments,te=F.endSN,de=F.fragmentHint,ve=j.maxFragLookUpTolerance,he=!!(j.lowLatencyMode&&F.partList&&de);he&&de&&!this.bitrateTest&&(Y=Y.concat(de),te=de.sn);var Re;if(y<l){var we=y>l-ve?0:ve;Re=(0,_.findFragmentByPTS)(G,Y,y,we)}else Re=Y[Y.length-1];if(Re){var ge=Re.sn-F.startSN;if(this.fragmentTracker.getState(Re)===W.FragmentState.OK&&(G=Re),G&&Re.sn===G.sn&&!he){var Ne=G&&Re.level===G.level;if(Ne){var ze=Y[ge+1];Re.sn<te&&this.fragmentTracker.getState(ze)!==W.FragmentState.OK?(this.log("SN "+Re.sn+" just loaded, load next one: "+ze.sn),Re=ze):Re=null}}}return Re},a.synchronizeToLiveEdge=function(y){var l=this.config,F=this.media;if(!F)return;var j=this.hls.liveSyncPosition,G=F.currentTime,Y=y.fragments[0].start,te=y.edge,de=G>=Y-l.maxFragLookUpTolerance&&G<=te;if(j!==null&&F.duration>j&&(G<j||!de)){var ve=l.liveMaxLatencyDuration!==void 0?l.liveMaxLatencyDuration:l.liveMaxLatencyDurationCount*y.targetduration;(!de&&F.readyState<4||G<te-ve)&&(this.loadedmetadata||(this.nextLoadPosition=j),F.readyState&&(this.warn("Playback: "+G.toFixed(3)+" is located too far from the end of live sliding playlist: "+te+", reset currentTime to : "+j.toFixed(3)),F.currentTime=j))}},a.alignPlaylists=function(y,l){var F=this.levels,j=this.levelLastLoaded,G=this.fragPrevious,Y=j!==null?F[j]:null,te=y.fragments.length;if(!te)return this.warn("No fragments in live playlist"),0;var de=y.fragments[0].start,ve=!l,he=y.alignedSliding&&(0,B.isFiniteNumber)(de);if(ve||!he&&!de){(0,h.alignStream)(G,Y,y);var Re=y.fragments[0].start;return this.log("Live playlist sliding: "+Re.toFixed(2)+" start-sn: "+(l?l.startSN:"na")+"->"+y.startSN+" prev-sn: "+(G?G.sn:"na")+" fragments: "+te),Re}return de},a.waitForCdnTuneIn=function(y){var l=3;return y.live&&y.canBlockReload&&y.partTarget&&y.tuneInGoal>Math.max(y.partHoldBack,y.partTarget*l)},a.setStartPosition=function(y,l){var F=this.startPosition;if(F<l&&(F=-1),F===-1||this.lastCurrentTime===-1){var j=y.startTimeOffset;(0,B.isFiniteNumber)(j)?(F=l+j,j<0&&(F+=y.totalduration),F=Math.min(Math.max(l,F),l+y.totalduration),this.log("Start time offset "+j+" found in playlist, adjust startPosition to "+F),this.startPosition=F):y.live?F=this.hls.liveSyncPosition||l:this.startPosition=F=0,this.lastCurrentTime=F}this.nextLoadPosition=F},a.getLoadPosition=function(){var y=this.media,l=0;return this.loadedmetadata&&y?l=y.currentTime:this.nextLoadPosition&&(l=this.nextLoadPosition),l},a.handleFragLoadAborted=function(y,l){this.transmuxer&&y.sn!=="initSegment"&&y.stats.aborted&&(this.warn("Fragment "+y.sn+(l?" part"+l.index:"")+" of level "+y.level+" was aborted"),this.resetFragmentLoading(y))},a.resetFragmentLoading=function(y){(!this.fragCurrent||!this.fragContextChanged(y)&&this.state!==p.FRAG_LOADING_WAITING_RETRY)&&(this.state=p.IDLE)},a.onFragmentOrKeyLoadError=function(y,l){if(l.fatal){this.stopLoad(),this.state=p.ERROR;return}var F=this.config;if(l.chunkMeta){var j=this.getCurrentContext(l.chunkMeta);j&&(l.frag=j.frag,l.levelRetry=!0,this.fragLoadError=F.fragLoadingMaxRetry)}var G=l.frag;if(!G||G.type!==y)return;var Y=this.fragCurrent;if(console.assert(Y&&G.sn===Y.sn&&G.level===Y.level&&G.urlId===Y.urlId,"Frag load error must match current frag to retry"),this.fragLoadError+1<=F.fragLoadingMaxRetry){this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition);var te=Math.min(Math.pow(2,this.fragLoadError)*F.fragLoadingRetryDelay,F.fragLoadingMaxRetryTimeout);this.warn("Fragment "+G.sn+" of "+y+" "+G.level+" failed to load, retrying in "+te+"ms"),this.retryDate=self.performance.now()+te,this.fragLoadError++,this.state=p.FRAG_LOADING_WAITING_RETRY}else l.levelRetry?(y===I.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=p.IDLE):(N.logger.error(l.details+" reaches max retry, redispatch as fatal ..."),l.fatal=!0,this.hls.stopLoad(),this.state=p.ERROR)},a.afterBufferFlushed=function(y,l,F){if(!y)return;var j=D.BufferHelper.getBuffered(y);this.fragmentTracker.detectEvictedFragments(l,j,F),this.state===p.ENDED&&this.resetLoadingState()},a.resetLoadingState=function(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=p.IDLE},a.resetStartWhenNotLoaded=function(y){if(!this.loadedmetadata){this.startFragRequested=!1;var l=this.levels?this.levels[y].details:null;l!=null&&l.live?(this.startPosition=-1,this.setStartPosition(l,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}},a.updateLevelTiming=function(y,l,F,j){var G=this,Y=F.details;console.assert(!!Y,"level.details must be defined");var te=Object.keys(y.elementaryStreams).reduce(function(de,ve){var he=y.elementaryStreams[ve];if(he){var Re=he.endPTS-he.startPTS;if(Re<=0)return G.warn("Could not parse fragment "+y.sn+" "+ve+" duration reliably ("+Re+")"),de||!1;var we=j?0:(0,r.updateFragPTSDTS)(Y,y,he.startPTS,he.endPTS,he.startDTS,he.endDTS);return G.hls.trigger(d.Events.LEVEL_PTS_UPDATED,{details:Y,level:F,drift:we,type:ve,frag:y,start:he.startPTS,end:he.endPTS}),!0}return de},!1);te||(this.warn("Found no media in fragment "+y.sn+" of level "+F.id+" resetting transmuxer to fallback to playlist timing"),this.resetTransmuxer()),this.state=p.PARSED,this.hls.trigger(d.Events.FRAG_PARSED,{frag:y,part:l})},a.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},x(o,[{key:"state",get:function(){return this._state},set:function(y){var l=this._state;l!==y&&(this._state=y,this.log(l+"->"+y))}}]),o}(n.default)},"./src/controller/buffer-controller.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>_});var B=R("./src/polyfills/number.ts"),n=R("./src/events.ts"),W=R("./src/utils/logger.ts"),D=R("./src/errors.ts"),N=R("./src/utils/buffer-helper.ts"),d=R("./src/utils/mediasource-helper.ts"),m=R("./src/loader/fragment.ts"),s=R("./src/controller/buffer-operation-queue.ts"),g=(0,d.getMediaSource)(),h=/([ha]vc.)(?:\.[^.,]+)+/,_=function(){function r(S){var w=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.lastMpegAudioChunk=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var I=w.media,E=w.mediaSource;W.logger.log("[buffer-controller]: Media source opened"),I&&(I.removeEventListener("emptied",w._onMediaEmptied),w.updateMediaElementDuration(),w.hls.trigger(n.Events.MEDIA_ATTACHED,{media:I})),E&&E.removeEventListener("sourceopen",w._onMediaSourceOpen),w.checkPendingTracks()},this._onMediaSourceClose=function(){W.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){W.logger.log("[buffer-controller]: Media source ended")},this._onMediaEmptied=function(){var I=w.media,E=w._objectUrl;I&&I.src!==E&&W.logger.error("Media element src was set while attaching MediaSource ("+E+" > "+I.src+")")},this.hls=S,this._initSourceBuffer(),this.registerListeners()}var v=r.prototype;return v.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},v.destroy=function(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null},v.registerListeners=function(){var w=this.hls;w.on(n.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),w.on(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.on(n.Events.MANIFEST_PARSED,this.onManifestParsed,this),w.on(n.Events.BUFFER_RESET,this.onBufferReset,this),w.on(n.Events.BUFFER_APPENDING,this.onBufferAppending,this),w.on(n.Events.BUFFER_CODECS,this.onBufferCodecs,this),w.on(n.Events.BUFFER_EOS,this.onBufferEos,this),w.on(n.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),w.on(n.Events.LEVEL_UPDATED,this.onLevelUpdated,this),w.on(n.Events.FRAG_PARSED,this.onFragParsed,this),w.on(n.Events.FRAG_CHANGED,this.onFragChanged,this)},v.unregisterListeners=function(){var w=this.hls;w.off(n.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),w.off(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.off(n.Events.MANIFEST_PARSED,this.onManifestParsed,this),w.off(n.Events.BUFFER_RESET,this.onBufferReset,this),w.off(n.Events.BUFFER_APPENDING,this.onBufferAppending,this),w.off(n.Events.BUFFER_CODECS,this.onBufferCodecs,this),w.off(n.Events.BUFFER_EOS,this.onBufferEos,this),w.off(n.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),w.off(n.Events.LEVEL_UPDATED,this.onLevelUpdated,this),w.off(n.Events.FRAG_PARSED,this.onFragParsed,this),w.off(n.Events.FRAG_CHANGED,this.onFragChanged,this)},v._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new s.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.lastMpegAudioChunk=null},v.onManifestParsed=function(w,I){var E=2;(I.audio&&!I.video||!I.altAudio)&&(E=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=E,this.details=null,W.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},v.onMediaAttaching=function(w,I){var E=this.media=I.media;if(E&&g){var x=this.mediaSource=new g;x.addEventListener("sourceopen",this._onMediaSourceOpen),x.addEventListener("sourceended",this._onMediaSourceEnded),x.addEventListener("sourceclose",this._onMediaSourceClose),E.src=self.URL.createObjectURL(x),this._objectUrl=E.src,E.addEventListener("emptied",this._onMediaEmptied)}},v.onMediaDetaching=function(){var w=this.media,I=this.mediaSource,E=this._objectUrl;if(I){if(W.logger.log("[buffer-controller]: media source detaching"),I.readyState==="open")try{I.endOfStream()}catch(x){W.logger.warn("[buffer-controller]: onMediaDetaching: "+x.message+" while calling endOfStream")}this.onBufferReset(),I.removeEventListener("sourceopen",this._onMediaSourceOpen),I.removeEventListener("sourceended",this._onMediaSourceEnded),I.removeEventListener("sourceclose",this._onMediaSourceClose),w&&(w.removeEventListener("emptied",this._onMediaEmptied),E&&self.URL.revokeObjectURL(E),w.src===E?(w.removeAttribute("src"),w.load()):W.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(n.Events.MEDIA_DETACHED,void 0)},v.onBufferReset=function(){var w=this;this.getSourceBufferTypes().forEach(function(I){var E=w.sourceBuffer[I];try{E&&(w.removeBufferListeners(I),w.mediaSource&&w.mediaSource.removeSourceBuffer(E),w.sourceBuffer[I]=void 0)}catch(x){W.logger.warn("[buffer-controller]: Failed to reset the "+I+" buffer",x)}}),this._initSourceBuffer()},v.onBufferCodecs=function(w,I){var E=this,x=this.getSourceBufferTypes().length;if(Object.keys(I).forEach(function(P){if(x){var T=E.tracks[P];if(T&&typeof T.buffer.changeType=="function"){var A=I[P],b=A.id,C=A.codec,p=A.levelCodec,i=A.container,f=A.metadata,o=(T.levelCodec||T.codec).replace(h,"$1"),a=(p||C).replace(h,"$1");if(o!==a){var L=i+";codecs="+(p||C);E.appendChangeType(P,L),W.logger.log("[buffer-controller]: switching codec "+o+" to "+a),E.tracks[P]={buffer:T.buffer,codec:C,container:i,levelCodec:p,metadata:f,id:b}}}}else E.pendingTracks[P]=I[P]}),x)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},v.appendChangeType=function(w,I){var E=this,x=this.operationQueue,P={execute:function(){var A=E.sourceBuffer[w];A&&(W.logger.log("[buffer-controller]: changing "+w+" sourceBuffer type to "+I),A.changeType(I)),x.shiftAndExecuteNext(w)},onStart:function(){},onComplete:function(){},onError:function(A){W.logger.warn("[buffer-controller]: Failed to change "+w+" SourceBuffer type",A)}};x.append(P,w)},v.onBufferAppending=function(w,I){var E=this,x=this.hls,P=this.operationQueue,T=this.tracks,A=I.data,b=I.type,C=I.frag,p=I.part,i=I.chunkMeta,f=i.buffering[b],o=self.performance.now();f.start=o;var a=C.stats.buffering,L=p?p.stats.buffering:null;a.start===0&&(a.start=o),L&&L.start===0&&(L.start=o);var y=T.audio,l=!1;b==="audio"&&(y==null?void 0:y.container)==="audio/mpeg"&&(l=!this.lastMpegAudioChunk||i.id===1||this.lastMpegAudioChunk.sn!==i.sn,this.lastMpegAudioChunk=i);var F=C.start,j={execute:function(){if(f.executeStart=self.performance.now(),l){var Y=E.sourceBuffer[b];if(Y){var te=F-Y.timestampOffset;Math.abs(te)>=.1&&(W.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+F+" (delta: "+te+") sn: "+C.sn+")"),Y.timestampOffset=F)}}E.appendExecutor(A,b)},onStart:function(){},onComplete:function(){var Y=self.performance.now();f.executeEnd=f.end=Y,a.first===0&&(a.first=Y),L&&L.first===0&&(L.first=Y);var te=E.sourceBuffer,de={};for(var ve in te)de[ve]=N.BufferHelper.getBuffered(te[ve]);E.appendError=0,E.hls.trigger(n.Events.BUFFER_APPENDED,{type:b,frag:C,part:p,chunkMeta:i,parent:C.type,timeRanges:de})},onError:function(Y){W.logger.error("[buffer-controller]: Error encountered while trying to append to the "+b+" SourceBuffer",Y);var te={type:D.ErrorTypes.MEDIA_ERROR,parent:C.type,details:D.ErrorDetails.BUFFER_APPEND_ERROR,err:Y,fatal:!1};Y.code===DOMException.QUOTA_EXCEEDED_ERR?te.details=D.ErrorDetails.BUFFER_FULL_ERROR:(E.appendError++,te.details=D.ErrorDetails.BUFFER_APPEND_ERROR,E.appendError>x.config.appendErrorMaxRetry&&(W.logger.error("[buffer-controller]: Failed "+x.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),te.fatal=!0,x.stopLoad())),x.trigger(n.Events.ERROR,te)}};P.append(j,b)},v.onBufferFlushing=function(w,I){var E=this,x=this.operationQueue,P=function(A){return{execute:E.removeExecutor.bind(E,A,I.startOffset,I.endOffset),onStart:function(){},onComplete:function(){E.hls.trigger(n.Events.BUFFER_FLUSHED,{type:A})},onError:function(C){W.logger.warn("[buffer-controller]: Failed to remove from "+A+" SourceBuffer",C)}}};I.type?x.append(P(I.type),I.type):this.getSourceBufferTypes().forEach(function(T){x.append(P(T),T)})},v.onFragParsed=function(w,I){var E=this,x=I.frag,P=I.part,T=[],A=P?P.elementaryStreams:x.elementaryStreams;A[m.ElementaryStreamTypes.AUDIOVIDEO]?T.push("audiovideo"):(A[m.ElementaryStreamTypes.AUDIO]&&T.push("audio"),A[m.ElementaryStreamTypes.VIDEO]&&T.push("video"));var b=function(){var p=self.performance.now();x.stats.buffering.end=p,P&&(P.stats.buffering.end=p);var i=P?P.stats:x.stats;E.hls.trigger(n.Events.FRAG_BUFFERED,{frag:x,part:P,stats:i,id:x.type})};T.length===0&&W.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+x.type+" level: "+x.level+" sn: "+x.sn),this.blockBuffers(b,T)},v.onFragChanged=function(w,I){this.flushBackBuffer()},v.onBufferEos=function(w,I){var E=this,x=this.getSourceBufferTypes().reduce(function(P,T){var A=E.sourceBuffer[T];return A&&(!I.type||I.type===T)&&(A.ending=!0,A.ended||(A.ended=!0,W.logger.log("[buffer-controller]: "+T+" sourceBuffer now EOS"))),P&&!!(!A||A.ended)},!0);x&&(W.logger.log("[buffer-controller]: Queueing mediaSource.endOfStream()"),this.blockBuffers(function(){E.getSourceBufferTypes().forEach(function(T){var A=E.sourceBuffer[T];A&&(A.ending=!1)});var P=E.mediaSource;if(!P||P.readyState!=="open"){P&&W.logger.info("[buffer-controller]: Could not call mediaSource.endOfStream(). mediaSource.readyState: "+P.readyState);return}W.logger.log("[buffer-controller]: Calling mediaSource.endOfStream()"),P.endOfStream()}))},v.onLevelUpdated=function(w,I){var E=I.details;if(!E.fragments.length)return;this.details=E,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},v.flushBackBuffer=function(){var w=this.hls,I=this.details,E=this.media,x=this.sourceBuffer;if(!E||I===null)return;var P=this.getSourceBufferTypes();if(!P.length)return;var T=I.live&&w.config.liveBackBufferLength!==null?w.config.liveBackBufferLength:w.config.backBufferLength;if(!(0,B.isFiniteNumber)(T)||T<0)return;var A=E.currentTime,b=I.levelTargetDuration,C=Math.max(T,b),p=Math.floor(A/b)*b-C;P.forEach(function(i){var f=x[i];if(f){var o=N.BufferHelper.getBuffered(f);if(o.length>0&&p>o.start(0)){if(w.trigger(n.Events.BACK_BUFFER_REACHED,{bufferEnd:p}),I.live)w.trigger(n.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:p});else if(f.ended&&o.end(o.length-1)-A<b*2){W.logger.info("[buffer-controller]: Cannot flush "+i+" back buffer while SourceBuffer is in ended state");return}w.trigger(n.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:p,type:i})}}})},v.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var w=this.details,I=this.hls,E=this.media,x=this.mediaSource,P=w.fragments[0].start+w.totalduration,T=E.duration,A=(0,B.isFiniteNumber)(x.duration)?x.duration:0;w.live&&I.config.liveDurationInfinity?(W.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),x.duration=Infinity,this.updateSeekableRange(w)):(P>A&&P>T||!(0,B.isFiniteNumber)(T))&&(W.logger.log("[buffer-controller]: Updating Media Source duration to "+P.toFixed(3)),x.duration=P)},v.updateSeekableRange=function(w){var I=this.mediaSource,E=w.fragments,x=E.length;if(x&&w.live&&I!==null&&I!==void 0&&I.setLiveSeekableRange){var P=Math.max(0,E[0].start),T=Math.max(P,P+w.totalduration);I.setLiveSeekableRange(P,T)}},v.checkPendingTracks=function(){var w=this.bufferCodecEventsExpected,I=this.operationQueue,E=this.pendingTracks,x=Object.keys(E).length;if(x&&!w||x===2){this.createSourceBuffers(E),this.pendingTracks={};var P=this.getSourceBufferTypes();if(P.length===0){this.hls.trigger(n.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}P.forEach(function(T){I.executeNext(T)})}},v.createSourceBuffers=function(w){var I=this.sourceBuffer,E=this.mediaSource;if(!E)throw Error("createSourceBuffers called when mediaSource was null");var x=0;for(var P in w)if(!I[P]){var T=w[P];if(!T)throw Error("source buffer exists for track "+P+", however track does not");var A=T.levelCodec||T.codec,b=T.container+";codecs="+A;W.logger.log("[buffer-controller]: creating sourceBuffer("+b+")");try{var C=I[P]=E.addSourceBuffer(b),p=P;this.addBufferListener(p,"updatestart",this._onSBUpdateStart),this.addBufferListener(p,"updateend",this._onSBUpdateEnd),this.addBufferListener(p,"error",this._onSBUpdateError),this.tracks[P]={buffer:C,codec:A,container:T.container,levelCodec:T.levelCodec,metadata:T.metadata,id:T.id},x++}catch(i){W.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+i.message),this.hls.trigger(n.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:i,mimeType:b})}}x&&this.hls.trigger(n.Events.BUFFER_CREATED,{tracks:this.tracks})},v._onSBUpdateStart=function(w){var I=this.operationQueue,E=I.current(w);E.onStart()},v._onSBUpdateEnd=function(w){var I=this.operationQueue,E=I.current(w);E.onComplete(),I.shiftAndExecuteNext(w)},v._onSBUpdateError=function(w,I){W.logger.error("[buffer-controller]: "+w+" SourceBuffer error",I),this.hls.trigger(n.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var E=this.operationQueue.current(w);E&&E.onError(I)},v.removeExecutor=function(w,I,E){var x=this.media,P=this.mediaSource,T=this.operationQueue,A=this.sourceBuffer,b=A[w];if(!x||!P||!b){W.logger.warn("[buffer-controller]: Attempting to remove from the "+w+" SourceBuffer, but it does not exist"),T.shiftAndExecuteNext(w);return}var C=(0,B.isFiniteNumber)(x.duration)?x.duration:Infinity,p=(0,B.isFiniteNumber)(P.duration)?P.duration:Infinity,i=Math.max(0,I),f=Math.min(E,C,p);f>i&&!b.ending?(b.ended=!1,W.logger.log("[buffer-controller]: Removing ["+i+","+f+"] from the "+w+" SourceBuffer"),console.assert(!b.updating,w+" sourceBuffer must not be updating"),b.remove(i,f)):T.shiftAndExecuteNext(w)},v.appendExecutor=function(w,I){var E=this.operationQueue,x=this.sourceBuffer,P=x[I];if(!P){W.logger.warn("[buffer-controller]: Attempting to append to the "+I+" SourceBuffer, but it does not exist"),E.shiftAndExecuteNext(I);return}P.ended=!1,console.assert(!P.updating,I+" sourceBuffer must not be updating"),P.appendBuffer(w)},v.blockBuffers=function(w,I){var E=this;if(I===void 0&&(I=this.getSourceBufferTypes()),!I.length){W.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(w);return}var x=this.operationQueue,P=I.map(function(T){return x.appendBlocker(T)});Promise.all(P).then(function(){w(),I.forEach(function(T){var A=E.sourceBuffer[T];(!A||!A.updating)&&x.shiftAndExecuteNext(T)})})},v.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},v.addBufferListener=function(w,I,E){var x=this.sourceBuffer[w];if(!x)return;var P=E.bind(this,w);this.listeners[w].push({event:I,listener:P}),x.addEventListener(I,P)},v.removeBufferListeners=function(w){var I=this.sourceBuffer[w];if(!I)return;this.listeners[w].forEach(function(E){I.removeEventListener(E.event,E.listener)})},r}()},"./src/controller/buffer-operation-queue.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>n});var B=R("./src/utils/logger.ts"),n=function(){function W(N){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=N}var D=W.prototype;return D.append=function(d,m){var s=this.queues[m];s.push(d),s.length===1&&this.buffers[m]&&this.executeNext(m)},D.insertAbort=function(d,m){var s=this.queues[m];s.unshift(d),this.executeNext(m)},D.appendBlocker=function(d){var m,s=new Promise(function(h){m=h}),g={execute:m,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(g,d),s},D.executeNext=function(d){var m=this.buffers,s=this.queues,g=m[d],h=s[d];if(h.length){var _=h[0];try{_.execute()}catch(r){B.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),_.onError(r),(!g||!g.updating)&&(h.shift(),this.executeNext(d))}}},D.shiftAndExecuteNext=function(d){this.queues[d].shift(),this.executeNext(d)},D.current=function(d){return this.queues[d][0]},W}()},"./src/controller/cap-level-controller.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>m});var B=R("./src/events.ts");function n(s,g){for(var h=0;h<g.length;h++){var _=g[h];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(s,D(_.key),_)}}function W(s,g,h){return g&&n(s.prototype,g),h&&n(s,h),Object.defineProperty(s,"prototype",{writable:!1}),s}function D(s){var g=N(s,"string");return typeof g=="symbol"?g:String(g)}function N(s,g){if(typeof s!="object"||s===null)return s;var h=s[Symbol.toPrimitive];if(h!==void 0){var _=h.call(s,g||"default");if(typeof _!="object")return _;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(s)}var d=function(){function s(h){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=h,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var g=s.prototype;return g.setStreamController=function(_){this.streamController=_},g.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},g.registerListeners=function(){var _=this.hls;_.on(B.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),_.on(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),_.on(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.on(B.Events.BUFFER_CODECS,this.onBufferCodecs,this),_.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},g.unregisterListener=function(){var _=this.hls;_.off(B.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),_.off(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),_.off(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.off(B.Events.BUFFER_CODECS,this.onBufferCodecs,this),_.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},g.onFpsDropLevelCapping=function(_,r){s.isLevelAllowed(r.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(r.droppedLevel)},g.onMediaAttaching=function(_,r){this.media=r.media instanceof HTMLVideoElement?r.media:null,this.clientRect=null},g.onManifestParsed=function(_,r){var v=this.hls;this.restrictedLevels=[],this.firstLevel=r.firstLevel,v.config.capLevelToPlayerSize&&r.video&&this.startCapping()},g.onBufferCodecs=function(_,r){var v=this.hls;v.config.capLevelToPlayerSize&&r.video&&this.startCapping()},g.onMediaDetaching=function(){this.stopCapping()},g.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var _=this.hls.levels;if(_.length){var r=this.hls;r.autoLevelCapping=this.getMaxLevel(_.length-1),r.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=r.autoLevelCapping}}},g.getMaxLevel=function(_){var r=this,v=this.hls.levels;if(!v.length)return-1;var S=v.filter(function(w,I){return s.isLevelAllowed(I,r.restrictedLevels)&&I<=_});return this.clientRect=null,s.getMaxLevelByMediaSize(S,this.mediaWidth,this.mediaHeight)},g.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()},g.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},g.getDimensions=function(){if(this.clientRect)return this.clientRect;var _=this.media,r={width:0,height:0};if(_){var v=_.getBoundingClientRect();r.width=v.width,r.height=v.height,!r.width&&!r.height&&(r.width=v.right-v.left||_.width||0,r.height=v.bottom-v.top||_.height||0)}return this.clientRect=r,r},s.isLevelAllowed=function(_,r){return r===void 0&&(r=[]),r.indexOf(_)===-1},s.getMaxLevelByMediaSize=function(_,r,v){if(!_||!_.length)return-1;for(var S=function(P,T){return T?P.width!==T.width||P.height!==T.height:!0},w=_.length-1,I=0;I<_.length;I+=1){var E=_[I];if((E.width>=r||E.height>=v)&&S(E,_[I+1])){w=I;break}}return w},W(s,[{key:"mediaWidth",get:function(){return this.getDimensions().width*this.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*this.contentScaleFactor}},{key:"contentScaleFactor",get:function(){var _=1;if(!this.hls.config.ignoreDevicePixelRatio)try{_=self.devicePixelRatio}catch(r){}return _}}]),s}();const m=d},"./src/controller/cmcd-controller.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>v});var B=R("./src/events.ts"),n=R("./src/types/cmcd.ts"),W=R("./src/utils/buffer-helper.ts"),D=R("./src/utils/logger.ts");function N(S,w){for(var I=0;I<w.length;I++){var E=w[I];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(S,m(E.key),E)}}function d(S,w,I){return w&&N(S.prototype,w),I&&N(S,I),Object.defineProperty(S,"prototype",{writable:!1}),S}function m(S){var w=s(S,"string");return typeof w=="symbol"?w:String(w)}function s(S,w){if(typeof S!="object"||S===null)return S;var I=S[Symbol.toPrimitive];if(I!==void 0){var E=I.call(S,w||"default");if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(S)}function g(S,w){var I=typeof Symbol!="undefined"&&S[Symbol.iterator]||S["@@iterator"];if(I)return(I=I.call(S)).next.bind(I);if(Array.isArray(S)||(I=h(S))||w&&S&&typeof S.length=="number"){I&&(S=I);var E=0;return function(){return E>=S.length?{done:!0}:{done:!1,value:S[E++]}}}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 h(S,w){if(!S)return;if(typeof S=="string")return _(S,w);var I=Object.prototype.toString.call(S).slice(8,-1);if(I==="Object"&&S.constructor&&(I=S.constructor.name),I==="Map"||I==="Set")return Array.from(S);if(I==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(I))return _(S,w)}function _(S,w){(w==null||w>S.length)&&(w=S.length);for(var I=0,E=new Array(w);I<w;I++)E[I]=S[I];return E}function r(){return r=Object.assign?Object.assign.bind():function(S){for(var w=1;w<arguments.length;w++){var I=arguments[w];for(var E in I)Object.prototype.hasOwnProperty.call(I,E)&&(S[E]=I[E])}return S},r.apply(this,arguments)}var v=function(){function S(I){var E=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(){E.initialized&&(E.starved=!0),E.buffering=!0},this.onPlaying=function(){E.initialized||(E.initialized=!0),E.buffering=!1},this.applyPlaylistData=function(T){try{E.apply(T,{ot:n.CMCDObjectType.MANIFEST,su:!E.initialized})}catch(A){D.logger.warn("Could not generate manifest CMCD data.",A)}},this.applyFragmentData=function(T){try{var A=T.frag,b=E.hls.levels[A.level],C=E.getObjectType(A),p={d:A.duration*1e3,ot:C};(C===n.CMCDObjectType.VIDEO||C===n.CMCDObjectType.AUDIO||C==n.CMCDObjectType.MUXED)&&(p.br=b.bitrate/1e3,p.tb=E.getTopBandwidth(C)/1e3,p.bl=E.getBufferLength(C)),E.apply(T,p)}catch(i){D.logger.warn("Could not generate segment CMCD data.",i)}},this.hls=I;var x=this.config=I.config,P=x.cmcd;P!=null&&(x.pLoader=this.createPlaylistLoader(),x.fLoader=this.createFragmentLoader(),this.sid=P.sessionId||S.uuid(),this.cid=P.contentId,this.useHeaders=P.useHeaders===!0,this.registerListeners())}var w=S.prototype;return w.registerListeners=function(){var E=this.hls;E.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.on(B.Events.MEDIA_DETACHED,this.onMediaDetached,this),E.on(B.Events.BUFFER_CREATED,this.onBufferCreated,this)},w.unregisterListeners=function(){var E=this.hls;E.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.off(B.Events.MEDIA_DETACHED,this.onMediaDetached,this),E.off(B.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},w.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},w.onMediaAttached=function(E,x){this.media=x.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},w.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},w.onBufferCreated=function(E,x){var P,T;this.audioBuffer=(P=x.tracks.audio)===null||P===void 0?void 0:P.buffer,this.videoBuffer=(T=x.tracks.video)===null||T===void 0?void 0:T.buffer},w.createData=function(){var E;return{v:n.CMCDVersion,sf:n.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(E=this.media)===null||E===void 0?void 0:E.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},w.apply=function(E,x){x===void 0&&(x={}),r(x,this.createData());var P=x.ot===n.CMCDObjectType.INIT||x.ot===n.CMCDObjectType.VIDEO||x.ot===n.CMCDObjectType.MUXED;if(this.starved&&P&&(x.bs=!0,x.su=!0,this.starved=!1),x.su==null&&(x.su=this.buffering),this.useHeaders){var T=S.toHeaders(x);if(!Object.keys(T).length)return;E.headers||(E.headers={}),r(E.headers,T)}else{var A=S.toQuery(x);if(!A)return;E.url=S.appendQueryToUri(E.url,A)}},w.getObjectType=function(E){var x=E.type;return x==="subtitle"?n.CMCDObjectType.TIMED_TEXT:E.sn==="initSegment"?n.CMCDObjectType.INIT:x==="audio"?n.CMCDObjectType.AUDIO:x==="main"?this.hls.audioTracks.length?n.CMCDObjectType.VIDEO:n.CMCDObjectType.MUXED:void 0},w.getTopBandwidth=function(E){var x=0,P,T=this.hls;if(E===n.CMCDObjectType.AUDIO)P=T.audioTracks;else{var A=T.maxAutoLevel,b=A>-1?A+1:T.levels.length;P=T.levels.slice(0,b)}for(var C=g(P),p;!(p=C()).done;){var i=p.value;i.bitrate>x&&(x=i.bitrate)}return x>0?x:NaN},w.getBufferLength=function(E){var x=this.hls.media,P=E===n.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!P||!x)return NaN;var T=W.BufferHelper.bufferInfo(P,x.currentTime,this.config.maxBufferHole);return T.len*1e3},w.createPlaylistLoader=function(){var E=this.config.pLoader,x=this.applyPlaylistData,P=E||this.config.loader;return function(){function T(b){this.loader=void 0,this.loader=new P(b)}var A=T.prototype;return A.destroy=function(){this.loader.destroy()},A.abort=function(){this.loader.abort()},A.load=function(C,p,i){x(C),this.loader.load(C,p,i)},d(T,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),T}()},w.createFragmentLoader=function(){var E=this.config.fLoader,x=this.applyFragmentData,P=E||this.config.loader;return function(){function T(b){this.loader=void 0,this.loader=new P(b)}var A=T.prototype;return A.destroy=function(){this.loader.destroy()},A.abort=function(){this.loader.abort()},A.load=function(C,p,i){x(C),this.loader.load(C,p,i)},d(T,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),T}()},S.uuid=function(){var E=URL.createObjectURL(new Blob),x=E.toString();return URL.revokeObjectURL(E),x.slice(x.lastIndexOf("/")+1)},S.serialize=function(E){for(var x=[],P=function(j){return!Number.isNaN(j)&&j!=null&&j!==""&&j!==!1},T=function(j){return Math.round(j)},A=function(j){return T(j/100)*100},b=function(j){return encodeURIComponent(j)},C={br:T,d:T,bl:A,dl:A,mtp:A,nor:b,rtp:A,tb:T},p=Object.keys(E||{}).sort(),i=g(p),f;!(f=i()).done;){var o=f.value,a=E[o];if(!P(a))continue;if(o==="v"&&a===1)continue;if(o=="pr"&&a===1)continue;var L=C[o];L&&(a=L(a));var y=typeof a,l=void 0;o==="ot"||o==="sf"||o==="st"?l=o+"="+a:y==="boolean"?l=o:y==="number"?l=o+"="+a:l=o+"="+JSON.stringify(a),x.push(l)}return x.join(",")},S.toHeaders=function(E){for(var x=Object.keys(E),P={},T=["Object","Request","Session","Status"],A=[{},{},{},{}],b={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},C=0,p=x;C<p.length;C++){var i=p[C],f=b[i]!=null?b[i]:1;A[f][i]=E[i]}for(var o=0;o<A.length;o++){var a=S.serialize(A[o]);a&&(P["CMCD-"+T[o]]=a)}return P},S.toQuery=function(E){return"CMCD="+encodeURIComponent(S.serialize(E))},S.appendQueryToUri=function(E,x){if(!x)return E;var P=E.includes("?")?"&":"?";return""+E+P+x},S}()},"./src/controller/eme-controller.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>C});var B=R("./src/events.ts"),n=R("./src/errors.ts"),W=R("./src/utils/logger.ts"),D=R("./src/utils/mediakeys-helper.ts"),N=R("./src/utils/keysystem-util.ts"),d=R("./src/utils/numeric-encoding-utils.ts"),m=R("./src/loader/level-key.ts"),s=R("./src/utils/hex.ts"),g=R("./src/utils/mp4-tools.ts"),h=R("./node_modules/eventemitter3/index.js"),_=R.n(h);function r(p,i){p.prototype=Object.create(i.prototype),p.prototype.constructor=p,E(p,i)}function v(p){var i=typeof Map=="function"?new Map:void 0;return v=function(o){if(o===null||!I(o))return o;if(typeof o!="function")throw new TypeError("Super expression must either be null or a function");if(typeof i!="undefined"){if(i.has(o))return i.get(o);i.set(o,a)}function a(){return S(o,arguments,x(this).constructor)}return a.prototype=Object.create(o.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),E(a,o)},v(p)}function S(p,i,f){return w()?S=Reflect.construct.bind():S=function(a,L,y){var l=[null];l.push.apply(l,L);var F=Function.bind.apply(a,l),j=new F;return y&&E(j,y.prototype),j},S.apply(null,arguments)}function w(){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(p){return!1}}function I(p){return Function.toString.call(p).indexOf("[native code]")!==-1}function E(p,i){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,a){return o.__proto__=a,o},E(p,i)}function x(p){return x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(f){return f.__proto__||Object.getPrototypeOf(f)},x(p)}var P=3,T="[eme]",A=function(){function p(f){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=p.CDMCleanupPromise?[p.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=W.logger.debug.bind(W.logger,T),this.log=W.logger.log.bind(W.logger,T),this.warn=W.logger.warn.bind(W.logger,T),this.error=W.logger.error.bind(W.logger,T),this.hls=f,this.config=f.config,this.registerListeners()}var i=p.prototype;return i.destroy=function(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null},i.registerListeners=function(){this.hls.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(B.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this)},i.unregisterListeners=function(){this.hls.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(B.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this)},i.getLicenseServerUrl=function(o){var a=this.config,L=a.drmSystems,y=a.widevineLicenseUrl,l=L[o];if(l)return l.licenseUrl;if(o===D.KeySystems.WIDEVINE&&y)return y;throw new Error('no license server URL configured for key-system "'+o+'"')},i.getServerCertificateUrl=function(o){var a=this.config.drmSystems,L=a[o];if(L)return L.serverCertificateUrl;this.log('No Server Certificate in config.drmSystems["'+o+'"]')},i.attemptKeySystemAccess=function(o){var a=this,L=this.hls.levels,y=function(G,Y,te){return!!G&&te.indexOf(G)===Y},l=L.map(function(j){return j.audioCodec}).filter(y),F=L.map(function(j){return j.videoCodec}).filter(y);return l.length+F.length===0&&F.push("avc1.42e01e"),new Promise(function(j,G){var Y=function te(de){var ve=de.shift();a.getMediaKeysPromise(ve,l,F).then(function(he){return j({keySystem:ve,mediaKeys:he})}).catch(function(he){de.length?te(de):he instanceof b?G(he):G(new b({type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_NO_ACCESS,error:he,fatal:!0},he.message))})};Y(o)})},i.requestMediaKeySystemAccess=function(o,a){var L=this.config.requestMediaKeySystemAccessFunc;if(!(typeof L=="function")){var y="Configured requestMediaKeySystemAccess is not a function "+L;return D.requestMediaKeySystemAccess===null&&self.location.protocol==="http:"&&(y="navigator.requestMediaKeySystemAccess is not available over insecure protocol "+location.protocol),Promise.reject(new Error(y))}return L(o,a)},i.getMediaKeysPromise=function(o,a,L){var y=this,l=(0,D.getSupportedMediaKeySystemConfigurations)(o,a,L,this.config.drmSystemOptions),F=this.keySystemAccessPromises[o],j=F==null?void 0:F.keySystemAccess;if(!j){this.log('Requesting encrypted media "'+o+'" key-system access with config: '+JSON.stringify(l)),j=this.requestMediaKeySystemAccess(o,l);var G=this.keySystemAccessPromises[o]={keySystemAccess:j};return j.catch(function(Y){y.log('Failed to obtain access to key-system "'+o+'": '+Y)}),j.then(function(Y){y.log('Access for key-system "'+Y.keySystem+'" obtained');var te=y.fetchServerCertificate(o);return y.log('Create media-keys for "'+o+'"'),G.mediaKeys=Y.createMediaKeys().then(function(de){return y.log('Media-keys created for "'+o+'"'),te.then(function(ve){return ve?y.setMediaKeysServerCertificate(de,o,ve):de})}),G.mediaKeys.catch(function(de){y.error('Failed to create media-keys for "'+o+'"}: '+de)}),G.mediaKeys})}return j.then(function(){return F.mediaKeys})},i.createMediaKeySessionContext=function(o){var a=o.decryptdata,L=o.keySystem,y=o.mediaKeys;console.assert(!!y,"mediaKeys is defined"),this.log('Creating key-system session "'+L+'" keyId: '+s.default.hexDump(a.keyId||[]));var l=y.createSession(),F={decryptdata:a,keySystem:L,mediaKeys:y,mediaKeysSession:l,keyStatus:"status-pending"};return this.mediaKeySessions.push(F),F},i.renewKeySession=function(o){var a=o.decryptdata;if(a.pssh){var L=this.createMediaKeySessionContext(o),y=this.getKeyIdString(a),l="cenc";this.keyIdToKeySessionPromise[y]=this.generateRequestWithPreferredKeySession(L,l,a.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(o)},i.getKeyIdString=function(o){if(!o)throw new Error("Could not read keyId of undefined decryptdata");if(o.keyId===null)throw new Error("keyId is null");return s.default.hexDump(o.keyId)},i.updateKeySession=function(o,a){var L,y=o.mediaKeysSession;return this.log('Updating key-session "'+y.sessionId+'" for keyID '+s.default.hexDump(((L=o.decryptdata)===null||L===void 0?void 0:L.keyId)||[])+`
} (data length: `+(a&&a.byteLength)+")"),y.update(a)},i.selectKeySystemFormat=function(o){var a=Object.keys(o.levelkeys||{});return this.keyFormatPromise||(this.log("Selecting key-system from fragment (sn: "+o.sn+" "+o.type+": "+o.level+") key formats "+a.join(", ")),this.keyFormatPromise=this.getKeyFormatPromise(a)),this.keyFormatPromise},i.getKeyFormatPromise=function(o){var a=this;return new Promise(function(L,y){var l=(0,D.getKeySystemsForConfig)(a.config),F=o.map(D.keySystemFormatToKeySystemDomain).filter(function(j){return!!j&&l.indexOf(j)!==-1});return a.getKeySystemSelectionPromise(F).then(function(j){var G=j.keySystem,Y=(0,D.keySystemDomainToKeySystemFormat)(G);Y?L(Y):y(new Error('Unable to find format for key-system "'+G+'"'))}).catch(y)})},i.loadKey=function(o){var a=this,L=o.keyInfo.decryptdata,y=this.getKeyIdString(L),l="(keyId: "+y+' format: "'+L.keyFormat+'" method: '+L.method+" uri: "+L.uri+")";this.log("Starting session for key "+l);var F=this.keyIdToKeySessionPromise[y];return F||(F=this.keyIdToKeySessionPromise[y]=this.getKeySystemForKeyPromise(L).then(function(j){var G=j.keySystem,Y=j.mediaKeys;return a.throwIfDestroyed(),a.log("Handle encrypted media sn: "+o.frag.sn+" "+o.frag.type+": "+o.frag.level+" using key "+l),a.attemptSetMediaKeys(G,Y).then(function(){a.throwIfDestroyed();var te=a.createMediaKeySessionContext({keySystem:G,mediaKeys:Y,decryptdata:L}),de="cenc";return a.generateRequestWithPreferredKeySession(te,de,L.pssh,"playlist-key")})}),F.catch(function(j){return a.handleError(j)})),F},i.throwIfDestroyed=function(o){if(o===void 0&&(o="Invalid state"),!this.hls)throw new Error("invalid state")},i.handleError=function(o){if(!this.hls)return;this.error(o.message),o instanceof b?this.hls.trigger(B.Events.ERROR,o.data):this.hls.trigger(B.Events.ERROR,{type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_NO_KEYS,error:o,fatal:!0})},i.getKeySystemForKeyPromise=function(o){var a=this.getKeyIdString(o),L=this.keyIdToKeySessionPromise[a];if(!L){var y=(0,D.keySystemFormatToKeySystemDomain)(o.keyFormat),l=y?[y]:(0,D.getKeySystemsForConfig)(this.config);return this.attemptKeySystemAccess(l)}return L},i.getKeySystemSelectionPromise=function(o){if(o.length||(o=(0,D.getKeySystemsForConfig)(this.config)),o.length===0)throw new b({type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},"Missing key-system license configuration options "+JSON.stringify({drmSystems:this.config.drmSystems}));return this.attemptKeySystemAccess(o)},i._onMediaEncrypted=function(o){var a=this,L=o.initDataType,y=o.initData;if(this.debug('"'+o.type+'" event: init data type: "'+L+'"'),y===null)return;var l,F;if(L==="sinf"&&this.config.drmSystems[D.KeySystems.FAIRPLAY]){var j=(0,g.bin2str)(new Uint8Array(y));try{var G=(0,d.base64Decode)(JSON.parse(j).sinf),Y=(0,g.parseSinf)(new Uint8Array(G));if(!Y)return;l=Y.subarray(8,24),F=D.KeySystems.FAIRPLAY}catch(ze){this.warn('Failed to parse sinf "encrypted" event message initData');return}}else{var te=(0,g.parsePssh)(y);if(te===null)return;te.version===0&&te.systemId===D.KeySystemIds.WIDEVINE&&te.data&&(l=te.data.subarray(8,24)),F=(0,D.keySystemIdToKeySystemDomain)(te.systemId)}if(!F||!l)return;for(var de=s.default.hexDump(l),ve=this.keyIdToKeySessionPromise,he=this.mediaKeySessions,Re=ve[de],we=function(nt){var Ge=he[nt],Xe=Ge.decryptdata;if(Xe.pssh||!Xe.keyId)return"continue";var Be=s.default.hexDump(Xe.keyId);if(de===Be||Xe.uri.replace(/-/g,"").indexOf(de)!==-1)return Re=ve[Be],delete ve[Be],Xe.pssh=new Uint8Array(y),Xe.keyId=l,Re=ve[de]=Re.then(function(){return a.generateRequestWithPreferredKeySession(Ge,L,y,"encrypted-event-key-match")}),"break"},ge=0;ge<he.length;ge++){var Ne=we(ge);if(Ne==="continue")continue;if(Ne==="break")break}Re||(Re=ve[de]=this.getKeySystemSelectionPromise([F]).then(function(ze){var nt,Ge=ze.keySystem,Xe=ze.mediaKeys;a.throwIfDestroyed();var Be=new m.LevelKey("ISO-23001-7",de,(nt=(0,D.keySystemDomainToKeySystemFormat)(Ge))!=null?nt:"");return Be.pssh=new Uint8Array(y),Be.keyId=l,a.attemptSetMediaKeys(Ge,Xe).then(function(){a.throwIfDestroyed();var _e=a.createMediaKeySessionContext({decryptdata:Be,keySystem:Ge,mediaKeys:Xe});return a.generateRequestWithPreferredKeySession(_e,L,y,"encrypted-event-no-match")})})),Re.catch(function(ze){return a.handleError(ze)})},i._onWaitingForKey=function(o){this.log('"'+o.type+'" event')},i.attemptSetMediaKeys=function(o,a){var L=this,y=this.setMediaKeysQueue.slice();this.log('Setting media-keys for "'+o+'"');var l=Promise.all(y).then(function(){if(!L.media)throw new Error("Attempted to set mediaKeys without media element attached");return L.media.setMediaKeys(a)});return this.setMediaKeysQueue.push(l),l.then(function(){L.log('Media-keys set for "'+o+'"'),y.push(l),L.setMediaKeysQueue=L.setMediaKeysQueue.filter(function(F){return y.indexOf(F)===-1})})},i.generateRequestWithPreferredKeySession=function(o,a,L,y){var l,F,j=this,G=(l=this.config.drmSystems)===null||l===void 0||((F=l[o.keySystem])===null||F===void 0)?void 0:F.generateRequest;if(G)try{var Y=G.call(this.hls,a,L,o);if(!Y)throw new Error("Invalid response from configured generateRequest filter");a=Y.initDataType,L=o.decryptdata.pssh=Y.initData?new Uint8Array(Y.initData):null}catch(Re){var te;if(this.warn(Re.message),(te=this.hls)!==null&&te!==void 0&&te.config.debug)throw Re}if(L===null)return this.log('Skipping key-session request for "'+y+'" (no initData)'),Promise.resolve(o);var de=this.getKeyIdString(o.decryptdata);this.log('Generating key-session request for "'+y+'": '+de+" (init data type: "+a+" length: "+(L?L.byteLength:null)+")");var ve=new(_());o.mediaKeysSession.onmessage=function(Re){var we=o.mediaKeysSession;if(!we){ve.emit("error",new Error("invalid state"));return}var ge=Re.messageType,Ne=Re.message;j.log('"'+ge+'" message event for session "'+we.sessionId+'" message size: '+Ne.byteLength),ge==="license-request"||ge==="license-renewal"?j.renewLicense(o,Ne).catch(function(ze){j.handleError(ze),ve.emit("error",ze)}):ge==="license-release"?o.keySystem===D.KeySystems.FAIRPLAY&&(j.updateKeySession(o,(0,N.strToUtf8array)("acknowledged")),j.removeSession(o)):j.warn('unhandled media key message type "'+ge+'"')},o.mediaKeysSession.onkeystatuseschange=function(Re){var we=o.mediaKeysSession;if(!we){ve.emit("error",new Error("invalid state"));return}j.onKeyStatusChange(o);var ge=o.keyStatus;ve.emit("keyStatus",ge),ge==="expired"&&(j.warn(o.keySystem+" expired for key "+de),j.renewKeySession(o))};var he=new Promise(function(Re,we){ve.on("error",we),ve.on("keyStatus",function(ge){ge.startsWith("usable")?Re():ge==="output-restricted"?we(new b({type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):ge==="internal-error"?we(new b({type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},'key status changed to "'+ge+'"')):ge==="expired"?we(new Error("key expired while generating request")):j.warn('unhandled key status change "'+ge+'"')})});return o.mediaKeysSession.generateRequest(a,L).then(function(){var Re;j.log('Request generated for key-session "'+((Re=o.mediaKeysSession)===null||Re===void 0?void 0:Re.sessionId)+'" keyId: '+de)}).catch(function(Re){throw new b({type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_NO_SESSION,error:Re,fatal:!1},"Error generating key-session request: "+Re)}).then(function(){return he}).catch(function(Re){throw ve.removeAllListeners(),j.removeSession(o),Re}).then(function(){return ve.removeAllListeners(),o})},i.onKeyStatusChange=function(o){var a=this;o.mediaKeysSession.keyStatuses.forEach(function(L,y){a.log('key status change "'+L+'" for keyStatuses keyId: '+s.default.hexDump("buffer"in y?new Uint8Array(y.buffer,y.byteOffset,y.byteLength):new Uint8Array(y))+" session keyId: "+s.default.hexDump(new Uint8Array(o.decryptdata.keyId||[]))+" uri: "+o.decryptdata.uri),o.keyStatus=L})},i.fetchServerCertificate=function(o){var a=this;return new Promise(function(L,y){var l=a.getServerCertificateUrl(o);if(!l)return L();a.log('Fetching serverCertificate for "'+o+'"');var F=new XMLHttpRequest;F.open("GET",l,!0),F.responseType="arraybuffer",F.onreadystatechange=function(){F.readyState===XMLHttpRequest.DONE&&(F.status===200?L(F.response):y(new b({type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:F},'"'+o+'" certificate request XHR failed ('+l+"). Status: "+F.status+" ("+F.statusText+")")))},F.send()})},i.setMediaKeysServerCertificate=function(o,a,L){var y=this;return new Promise(function(l,F){o.setServerCertificate(L).then(function(j){y.log("setServerCertificate "+(j?"success":"not supported by CDM")+" ("+(L==null?void 0:L.byteLength)+') on "'+a+'"'),l(o)}).catch(function(j){F(new b({type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:j,fatal:!0},j.message))})})},i.renewLicense=function(o,a){var L=this;return this.requestLicense(o,new Uint8Array(a)).then(function(y){return L.updateKeySession(o,new Uint8Array(y)).catch(function(l){throw new b({type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:l,fatal:!0},l.message)})})},i.setupLicenseXHR=function(o,a,L,y){var l=this,F=this.config.licenseXhrSetup;return F?Promise.resolve().then(function(){if(!L.decryptdata)throw new Error("Key removed");return F.call(l.hls,o,a,L,y)}).catch(function(j){if(!L.decryptdata)throw j;return o.open("POST",a,!0),F.call(l.hls,o,a,L,y)}).then(function(j){o.readyState||o.open("POST",a,!0);var G=j||y;return{xhr:o,licenseChallenge:G}}):(o.open("POST",a,!0),Promise.resolve({xhr:o,licenseChallenge:y}))},i.requestLicense=function(o,a){var L=this;return new Promise(function(y,l){var F=L.getLicenseServerUrl(o.keySystem);L.log("Sending license request to URL: "+F);var j=new XMLHttpRequest;j.responseType="arraybuffer",j.onreadystatechange=function(){if(!L.hls||!o.mediaKeysSession)return l(new Error("invalid state"));if(j.readyState===4)if(j.status===200){L._requestLicenseFailureCount=0;var G=j.response;L.log("License received "+(G instanceof ArrayBuffer?G.byteLength:G));var Y=L.config.licenseResponseCallback;if(Y)try{G=Y.call(L.hls,j,F,o)}catch(de){L.error(de)}y(G)}else if(L._requestLicenseFailureCount++,L._requestLicenseFailureCount>P||j.status>=400&&j.status<500)l(new b({type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:j},"License Request XHR failed ("+F+"). Status: "+j.status+" ("+j.statusText+")"));else{var te=P-L._requestLicenseFailureCount+1;L.warn("Retrying license request, "+te+" attempts left"),L.requestLicense(o,a).then(y,l)}},o.licenseXhr&&o.licenseXhr.readyState!==XMLHttpRequest.DONE&&o.licenseXhr.abort(),o.licenseXhr=j,L.setupLicenseXHR(j,F,o,a).then(function(G){var Y=G.xhr,te=G.licenseChallenge;Y.send(te)})})},i.onMediaAttached=function(o,a){if(!this.config.emeEnabled)return;var L=a.media;this.media=L,L.addEventListener("encrypted",this.onMediaEncrypted),L.addEventListener("waitingforkey",this.onWaitingForKey)},i.onMediaDetached=function(){var o=this,a=this.media,L=this.mediaKeySessions;a&&(a.removeEventListener("encrypted",this.onMediaEncrypted),a.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},m.LevelKey.clearKeyUriToKeyIdMap();var y=L.length;p.CDMCleanupPromise=Promise.all(L.map(function(l){return o.removeSession(l)}).concat(a==null?void 0:a.setMediaKeys(null).catch(function(l){o.log("Could not clear media keys: "+l+". media.src: "+(a==null?void 0:a.src))}))).then(function(){y&&(o.log("finished closing key sessions and clearing media keys"),L.length=0)}).catch(function(l){o.log("Could not close sessions and clear media keys: "+l+". media.src: "+(a==null?void 0:a.src))})},i.onManifestLoaded=function(o,a){var L=a.sessionKeys;if(!L||!this.config.emeEnabled)return;if(!this.keyFormatPromise){var y=L.reduce(function(l,F){return l.indexOf(F.keyFormat)===-1&&l.push(F.keyFormat),l},[]);this.log("Selecting key-system from session-keys "+y.join(", ")),this.keyFormatPromise=this.getKeyFormatPromise(y)}},i.removeSession=function(o){var a=this,L=o.mediaKeysSession,y=o.licenseXhr;if(L){this.log("Remove licenses and keys and close session "+L.sessionId),L.onmessage=null,L.onkeystatuseschange=null,y&&y.readyState!==XMLHttpRequest.DONE&&y.abort(),o.mediaKeysSession=o.decryptdata=o.licenseXhr=void 0;var l=this.mediaKeySessions.indexOf(o);return l>-1&&this.mediaKeySessions.splice(l,1),L.remove().catch(function(F){a.log("Could not remove session: "+F)}).then(function(){return L.close()}).catch(function(F){a.log("Could not close session: "+F)})}},p}();A.CDMCleanupPromise=void 0;var b=function(p){r(i,p);function i(f,o){var a;return a=p.call(this,o)||this,a.data=void 0,a.data=f,f.err=f.error,a}return i}(v(Error));const C=A},"./src/controller/fps-controller.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>D});var B=R("./src/events.ts"),n=R("./src/utils/logger.ts"),W=function(){function N(m){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=m,this.registerListeners()}var d=N.prototype;return d.setStreamController=function(s){this.streamController=s},d.registerListeners=function(){this.hls.on(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},d.unregisterListeners=function(){this.hls.off(B.Events.MEDIA_ATTACHING,this.onMediaAttaching)},d.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},d.onMediaAttaching=function(s,g){var h=this.hls.config;if(h.capLevelOnFPSDrop){var _=g.media instanceof self.HTMLVideoElement?g.media:null;this.media=_,_&&typeof _.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),h.fpsDroppedMonitoringPeriod)}},d.checkFPS=function(s,g,h){var _=performance.now();if(g){if(this.lastTime){var r=_-this.lastTime,v=h-this.lastDroppedFrames,S=g-this.lastDecodedFrames,w=1e3*v/r,I=this.hls;if(I.trigger(B.Events.FPS_DROP,{currentDropped:v,currentDecoded:S,totalDroppedFrames:h}),w>0&&v>I.config.fpsDroppedMonitoringThreshold*S){var E=I.currentLevel;n.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+E),E>0&&(I.autoLevelCapping===-1||I.autoLevelCapping>=E)&&(E=E-1,I.trigger(B.Events.FPS_DROP_LEVEL_CAPPING,{level:E,droppedLevel:I.currentLevel}),I.autoLevelCapping=E,this.streamController.nextLevelSwitch())}}this.lastTime=_,this.lastDroppedFrames=h,this.lastDecodedFrames=g}},d.checkFPSInterval=function(){var s=this.media;if(s)if(this.isVideoPlaybackQualityAvailable){var g=s.getVideoPlaybackQuality();this.checkFPS(s,g.totalVideoFrames,g.droppedVideoFrames)}else this.checkFPS(s,s.webkitDecodedFrameCount,s.webkitDroppedFrameCount)},N}();const D=W},"./src/controller/fragment-finders.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{findFragWithCC:()=>m,findFragmentByPDT:()=>W,findFragmentByPTS:()=>D,fragmentWithinToleranceTest:()=>N,pdtWithinToleranceTest:()=>d});var B=R("./src/polyfills/number.ts"),n=R("./src/utils/binary-search.ts");function W(s,g,h){if(g===null||!Array.isArray(s)||!s.length||!(0,B.isFiniteNumber)(g))return null;var _=s[0].programDateTime;if(g<(_||0))return null;var r=s[s.length-1].endProgramDateTime;if(g>=(r||0))return null;h=h||0;for(var v=0;v<s.length;++v){var S=s[v];if(d(g,h,S))return S}return null}function D(s,g,h,_){h===void 0&&(h=0),_===void 0&&(_=0);var r=null;if(s?r=g[s.sn-g[0].sn+1]||null:h===0&&g[0].start===0&&(r=g[0]),r&&N(h,_,r)===0)return r;var v=n.default.search(g,N.bind(null,h,_));return v&&(v!==s||!r)?v:r}function N(s,g,h){if(s===void 0&&(s=0),g===void 0&&(g=0),h.start<=s&&h.start+h.duration>s)return 0;var _=Math.min(g,h.duration+(h.deltaPTS?h.deltaPTS:0));return h.start+h.duration-_<=s?1:h.start-_>s&&h.start?-1:0}function d(s,g,h){var _=Math.min(g,h.duration+(h.deltaPTS?h.deltaPTS:0))*1e3,r=h.endProgramDateTime||0;return r-_>s}function m(s,g){return n.default.search(s,function(h){return h.cc<g?1:h.cc>g?-1:0})}},"./src/controller/fragment-tracker.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{FragmentState:()=>W,FragmentTracker:()=>D});var B=R("./src/events.ts"),n=R("./src/types/loader.ts"),W;(function(m){m.NOT_LOADED="NOT_LOADED",m.APPENDING="APPENDING",m.PARTIAL="PARTIAL",m.OK="OK"})(W||(W={}));var D=function(){function m(g){this.activeFragment=null,this.activeParts=null,this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=g,this._registerListeners()}var s=m.prototype;return s._registerListeners=function(){var h=this.hls;h.on(B.Events.BUFFER_APPENDED,this.onBufferAppended,this),h.on(B.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.on(B.Events.FRAG_LOADED,this.onFragLoaded,this)},s._unregisterListeners=function(){var h=this.hls;h.off(B.Events.BUFFER_APPENDED,this.onBufferAppended,this),h.off(B.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.off(B.Events.FRAG_LOADED,this.onFragLoaded,this)},s.destroy=function(){this._unregisterListeners(),this.fragments=this.endListFragments=this.timeRanges=this.activeFragment=this.activeParts=null},s.getAppendedFrag=function(h,_){if(_===n.PlaylistLevelType.MAIN){var r=this.activeFragment,v=this.activeParts;if(!r)return null;if(v)for(var S=v.length;S--;){var w=v[S],I=w?w.end:r.appendedPTS;if(w.start<=h&&I!==void 0&&h<=I)return S>9&&(this.activeParts=v.slice(S-9)),w}else if(r.start<=h&&r.appendedPTS!==void 0&&h<=r.appendedPTS)return r}return this.getBufferedFrag(h,_)},s.getBufferedFrag=function(h,_){for(var r=this.fragments,v=Object.keys(r),S=v.length;S--;){var w=r[v[S]];if((w==null?void 0:w.body.type)===_&&w.buffered){var I=w.body;if(I.start<=h&&h<=I.end)return I}}return null},s.detectEvictedFragments=function(h,_,r){var v=this;this.timeRanges&&(this.timeRanges[h]=_),Object.keys(this.fragments).forEach(function(S){var w=v.fragments[S];if(!w)return;if(!w.buffered&&!w.loaded){w.body.type===r&&v.removeFragment(w.body);return}var I=w.range[h];if(!I)return;I.time.some(function(E){var x=!v.isTimeBuffered(E.startPTS,E.endPTS,_);return x&&v.removeFragment(w.body),x})})},s.detectPartialFragments=function(h){var _=this,r=this.timeRanges,v=h.frag,S=h.part;if(!r||v.sn==="initSegment")return;var w=d(v),I=this.fragments[w];if(!I)return;Object.keys(r).forEach(function(E){var x=v.elementaryStreams[E];if(!x)return;var P=r[E],T=S!==null||x.partial===!0;I.range[E]=_.getBufferedTimes(v,S,T,P)}),I.loaded=null,Object.keys(I.range).length?(I.buffered=!0,I.body.endList&&(this.endListFragments[I.body.type]=I)):this.removeFragment(I.body)},s.fragBuffered=function(h){var _=d(h),r=this.fragments[_];r&&(r.loaded=null,r.buffered=!0)},s.getBufferedTimes=function(h,_,r,v){for(var S={time:[],partial:r},w=_?_.start:h.start,I=_?_.end:h.end,E=h.minEndPTS||I,x=h.maxStartPTS||w,P=0;P<v.length;P++){var T=v.start(P)-this.bufferPadding,A=v.end(P)+this.bufferPadding;if(x>=T&&E<=A){S.time.push({startPTS:Math.max(w,v.start(P)),endPTS:Math.min(I,v.end(P))});break}else if(w<A&&I>T)S.partial=!0,S.time.push({startPTS:Math.max(w,v.start(P)),endPTS:Math.min(I,v.end(P))});else if(I<=T)break}return S},s.getPartialFragment=function(h){var _=null,r,v,S,w=0,I=this.bufferPadding,E=this.fragments;return Object.keys(E).forEach(function(x){var P=E[x];if(!P)return;N(P)&&(v=P.body.start-I,S=P.body.end+I,h>=v&&h<=S&&(r=Math.min(h-v,S-h),w<=r&&(_=P.body,w=r)))}),_},s.isEndListAppended=function(h){var _=this.endListFragments[h];return _!==void 0&&(_.buffered||N(_))},s.getState=function(h){var _=d(h),r=this.fragments[_];return r?r.buffered?N(r)?W.PARTIAL:W.OK:W.APPENDING:W.NOT_LOADED},s.isTimeBuffered=function(h,_,r){for(var v,S,w=0;w<r.length;w++){if(v=r.start(w)-this.bufferPadding,S=r.end(w)+this.bufferPadding,h>=v&&_<=S)return!0;if(_<=v)return!1}return!1},s.onFragLoaded=function(h,_){var r=_.frag,v=_.part;if(r.sn==="initSegment"||r.bitrateTest||v)return;var S=d(r);this.fragments[S]={body:r,loaded:_,buffered:!1,range:Object.create(null)}},s.onBufferAppended=function(h,_){var r=this,v=_.frag,S=_.part,w=_.timeRanges;if(v.type===n.PlaylistLevelType.MAIN)if(this.activeFragment!==v&&(this.activeFragment=v,v.appendedPTS=void 0),S){var I=this.activeParts;I||(this.activeParts=I=[]),I.push(S)}else this.activeParts=null;this.timeRanges=w,Object.keys(w).forEach(function(E){var x=w[E];if(r.detectEvictedFragments(E,x),!S&&v.type===n.PlaylistLevelType.MAIN){var P=v.elementaryStreams[E];if(!P)return;for(var T=0;T<x.length;T++){var A=x.end(T);A<=P.endPTS&&A>P.startPTS?v.appendedPTS=Math.max(A,v.appendedPTS||0):v.appendedPTS=P.endPTS}}})},s.onFragBuffered=function(h,_){this.detectPartialFragments(_)},s.hasFragment=function(h){var _=d(h);return!!this.fragments[_]},s.removeFragmentsInRange=function(h,_,r){var v=this;Object.keys(this.fragments).forEach(function(S){var w=v.fragments[S];if(!w)return;if(w.buffered){var I=w.body;I.type===r&&I.start<_&&I.end>h&&v.removeFragment(I)}})},s.removeFragment=function(h){var _=d(h);h.stats.loaded=0,h.clearElementaryStreamInfo(),h.appendedPTS=void 0,delete this.fragments[_],h.endList&&delete this.endListFragments[h.type]},s.removeAllFragments=function(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activeFragment=null,this.activeParts=null},m}();function N(m){var s,g;return m.buffered&&(((s=m.range.video)===null||s===void 0?void 0:s.partial)||((g=m.range.audio)===null||g===void 0?void 0:g.partial))}function d(m){return m.type+"_"+m.level+"_"+m.urlId+"_"+m.sn}},"./src/controller/gap-controller.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{MAX_START_GAP_JUMP:()=>d,SKIP_BUFFER_HOLE_STEP_SECONDS:()=>m,SKIP_BUFFER_RANGE_START:()=>s,STALL_MINIMUM_DURATION_MS:()=>N,default:()=>g});var B=R("./src/utils/buffer-helper.ts"),n=R("./src/errors.ts"),W=R("./src/events.ts"),D=R("./src/utils/logger.ts"),N=250,d=2,m=.1,s=.05,g=function(){function h(r,v,S,w){this.config=void 0,this.media=null,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=r,this.media=v,this.fragmentTracker=S,this.hls=w}var _=h.prototype;return _.destroy=function(){this.media=null,this.hls=this.fragmentTracker=null},_.poll=function(v,S){var w=this.config,I=this.media,E=this.stalled;if(I===null)return;var x=I.currentTime,P=I.seeking,T=this.seeking&&!P,A=!this.seeking&&P;if(this.seeking=P,x!==v){if(this.moved=!0,E!==null){if(this.stallReported){var b=self.performance.now()-E;D.logger.warn("playback not stuck anymore @"+x+", after "+Math.round(b)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((A||T)&&(this.stalled=null),I.paused&&!P||I.ended||I.playbackRate===0||!B.BufferHelper.getBuffered(I).length)return;var C=B.BufferHelper.bufferInfo(I,x,0),p=C.len>0,i=C.nextStart||0;if(!p&&!i)return;if(P){var f=C.len>d,o=!i||S&&S.start<=x||i-x>d&&!this.fragmentTracker.getPartialFragment(x);if(f||o)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var a,L=Math.max(i,C.start||0)-x,y=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,l=y==null||((a=y.details)===null||a===void 0)?void 0:a.live,F=l?y.details.targetduration*2:d;if(L>0&&L<=F){this._trySkipBufferHole(null);return}}var j=self.performance.now();if(E===null){this.stalled=j;return}var G=j-E;if(!P&&G>=N&&(this._reportStall(C),!this.media))return;var Y=B.BufferHelper.bufferInfo(I,x,w.maxBufferHole);this._tryFixBufferStall(Y,G)},_._tryFixBufferStall=function(v,S){var w=this.config,I=this.fragmentTracker,E=this.media;if(E===null)return;var x=E.currentTime,P=I.getPartialFragment(x);if(P){var T=this._trySkipBufferHole(P);if(T||!this.media)return}v.len>w.maxBufferHole&&S>w.highBufferWatchdogPeriod*1e3&&(D.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},_._reportStall=function(v){var S=this.hls,w=this.media,I=this.stallReported;!I&&w&&(this.stallReported=!0,D.logger.warn("Playback stalling at @"+w.currentTime+" due to low buffer ("+JSON.stringify(v)+")"),S.trigger(W.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:v.len}))},_._trySkipBufferHole=function(v){var S=this.config,w=this.hls,I=this.media;if(I===null)return 0;for(var E=I.currentTime,x=0,P=B.BufferHelper.getBuffered(I),T=0;T<P.length;T++){var A=P.start(T);if(E+S.maxBufferHole>=x&&E<A){var b=Math.max(A+s,I.currentTime+m);return D.logger.warn("skipping hole, adjusting currentTime from "+E+" to "+b),this.moved=!0,this.stalled=null,I.currentTime=b,v&&w.trigger(W.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+E+" to "+b,frag:v}),b}x=P.end(T)}return 0},_._tryNudgeBuffer=function(){var v=this.config,S=this.hls,w=this.media,I=this.nudgeRetry;if(w===null)return;var E=w.currentTime;if(this.nudgeRetry++,I<v.nudgeMaxRetry){var x=E+(I+1)*v.nudgeOffset;D.logger.warn("Nudging 'currentTime' from "+E+" to "+x),w.currentTime=x,S.trigger(W.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else D.logger.error("Playhead still not moving while enough data buffered @"+E+" after "+v.nudgeMaxRetry+" nudges"),S.trigger(W.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},h}()},"./src/controller/id3-track-controller.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>v});var B=R("./src/polyfills/number.ts"),n=R("./src/events.ts"),W=R("./src/utils/texttrack-utils.ts"),D=R("./src/demux/id3.ts"),N=R("./src/loader/date-range.ts"),d=R("./src/types/demuxer.ts"),m=.25;function s(){return self.WebKitDataCue||self.VTTCue||self.TextTrackCue}var g=function(){var S=s();try{new S(0,Number.POSITIVE_INFINITY,"")}catch(w){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY}();function h(S,w){return S.getTime()/1e3-w}function _(S){return Uint8Array.from(S.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}var r=function(){function S(I){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=I,this._registerListeners()}var w=S.prototype;return w.destroy=function(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null},w._registerListeners=function(){var E=this.hls;E.on(n.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.on(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.on(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.on(n.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),E.on(n.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),E.on(n.Events.LEVEL_UPDATED,this.onLevelUpdated,this)},w._unregisterListeners=function(){var E=this.hls;E.off(n.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.off(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.off(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.off(n.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),E.off(n.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),E.off(n.Events.LEVEL_UPDATED,this.onLevelUpdated,this)},w.onMediaAttached=function(E,x){this.media=x.media},w.onMediaDetaching=function(){if(!this.id3Track)return;(0,W.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={}},w.onManifestLoading=function(){this.dateRangeCuesAppended={}},w.createTrack=function(E){var x=this.getID3Track(E.textTracks);return x.mode="hidden",x},w.getID3Track=function(E){if(!this.media)return;for(var x=0;x<E.length;x++){var P=E[x];if(P.kind==="metadata"&&P.label==="id3")return(0,W.sendAddTrackEvent)(P,this.media),P}return this.media.addTextTrack("metadata","id3")},w.onFragParsingMetadata=function(E,x){if(!this.media)return;var P=this.hls.config,T=P.enableEmsgMetadataCues,A=P.enableID3MetadataCues;if(!T&&!A)return;var b=x.samples;this.id3Track||(this.id3Track=this.createTrack(this.media));for(var C=s(),p=0;p<b.length;p++){var i=b[p].type;if(i===d.MetadataSchema.emsg&&!T||!A)continue;var f=D.getID3Frames(b[p].data);if(f){var o=b[p].pts,a=o+b[p].duration;a>g&&(a=g);var L=a-o;L<=0&&(a=o+m);for(var y=0;y<f.length;y++){var l=f[y];if(!D.isTimeStampFrame(l)){this.updateId3CueEnds(o);var F=new C(o,a,"");F.value=l,i&&(F.type=i),this.id3Track.addCue(F)}}}}},w.updateId3CueEnds=function(E){var x,P=(x=this.id3Track)===null||x===void 0?void 0:x.cues;if(P)for(var T=P.length;T--;){var A=P[T];A.startTime<E&&A.endTime===g&&(A.endTime=E)}},w.onBufferFlushing=function(E,x){var P=x.startOffset,T=x.endOffset,A=x.type,b=this.id3Track,C=this.hls;if(!C)return;var p=C.config,i=p.enableEmsgMetadataCues,f=p.enableID3MetadataCues;if(b&&(i||f)){var o;A==="audio"?o=function(L){return L.type===d.MetadataSchema.audioId3&&f}:A==="video"?o=function(L){return L.type===d.MetadataSchema.emsg&&i}:o=function(L){return L.type===d.MetadataSchema.audioId3&&f||L.type===d.MetadataSchema.emsg&&i},(0,W.removeCuesInRange)(b,P,T,o)}},w.onLevelUpdated=function(E,x){var P=this,T=x.details;if(!this.media||!T.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;var A=this.dateRangeCuesAppended,b=this.id3Track,C=T.dateRanges,p=Object.keys(C);if(b)for(var i=Object.keys(A).filter(function(j){return!p.includes(j)}),f=function(G){var Y=i[G];Object.keys(A[Y].cues).forEach(function(te){b.removeCue(A[Y].cues[te])}),delete A[Y]},o=i.length;o--;)f(o);var a=T.fragments[T.fragments.length-1];if(p.length===0||!(0,B.isFiniteNumber)(a==null?void 0:a.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));for(var L=a.programDateTime/1e3-a.start,y=s(),l=function(G){var Y=p[G],te=C[Y],de=A[Y],ve=(de==null?void 0:de.cues)||{},he=(de==null?void 0:de.durationKnown)||!1,Re=h(te.startDate,L),we=g,ge=te.endDate;if(ge)we=h(ge,L),he=!0;else if(te.endOnNext&&!he){var Ne=p.reduce(function(_e,Ze){var be=C[Ze];return be.class===te.class&&be.id!==Ze&&be.startDate>te.startDate&&_e.push(be),_e},[]).sort(function(_e,Ze){return _e.startDate.getTime()-Ze.startDate.getTime()})[0];Ne&&(we=h(Ne.startDate,L),he=!0)}for(var ze=Object.keys(te.attr),nt=0;nt<ze.length;nt++){var Ge=ze[nt];if(Ge===N.DateRangeAttribute.ID||Ge===N.DateRangeAttribute.CLASS||Ge===N.DateRangeAttribute.START_DATE||Ge===N.DateRangeAttribute.DURATION||Ge===N.DateRangeAttribute.END_DATE||Ge===N.DateRangeAttribute.END_ON_NEXT)continue;var Xe=ve[Ge];if(Xe)he&&!de.durationKnown&&(Xe.endTime=we);else{var Be=te.attr[Ge];Xe=new y(Re,we,""),(Ge===N.DateRangeAttribute.SCTE35_OUT||Ge===N.DateRangeAttribute.SCTE35_IN)&&(Be=_(Be)),Xe.value={key:Ge,data:Be},Xe.type=d.MetadataSchema.dateRange,P.id3Track.addCue(Xe),ve[Ge]=Xe}}A[Y]={cues:ve,dateRange:te,durationKnown:he}},F=0;F<p.length;F++)l(F)},S}();const v=r},"./src/controller/latency-controller.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>s});var B=R("./src/errors.ts"),n=R("./src/events.ts"),W=R("./src/utils/logger.ts");function D(g,h){for(var _=0;_<h.length;_++){var r=h[_];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(g,d(r.key),r)}}function N(g,h,_){return h&&D(g.prototype,h),_&&D(g,_),Object.defineProperty(g,"prototype",{writable:!1}),g}function d(g){var h=m(g,"string");return typeof h=="symbol"?h:String(h)}function m(g,h){if(typeof g!="object"||g===null)return g;var _=g[Symbol.toPrimitive];if(_!==void 0){var r=_.call(g,h||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(g)}var s=function(){function g(_){var r=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 r.timeupdate()},this.hls=_,this.config=_.config,this.registerListeners()}var h=g.prototype;return h.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},h.registerListeners=function(){this.hls.on(n.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(n.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(n.Events.ERROR,this.onError,this)},h.unregisterListeners=function(){this.hls.off(n.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(n.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(n.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(n.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(n.Events.ERROR,this.onError)},h.onMediaAttached=function(r,v){this.media=v.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},h.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},h.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},h.onLevelUpdated=function(r,v){var S=v.details;this.levelDetails=S,S.advanced&&this.timeupdate(),!S.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},h.onError=function(r,v){if(v.details!==B.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,W.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},h.timeupdate=function(){var r=this.media,v=this.levelDetails;if(!r||!v)return;this.currentTime=r.currentTime;var S=this.computeLatency();if(S===null)return;this._latency=S;var w=this.config,I=w.lowLatencyMode,E=w.maxLiveSyncPlaybackRate;if(!I||E===1)return;var x=this.targetLatency;if(x===null)return;var P=S-x,T=Math.min(this.maxLatency,x+v.targetduration),A=P<T;if(v.live&&A&&P>.05&&this.forwardBufferLength>1){var b=Math.min(2,Math.max(1,E)),C=Math.round(2/(1+Math.exp(-.75*P-this.edgeStalled))*20)/20;r.playbackRate=Math.min(b,Math.max(1,C))}else r.playbackRate!==1&&r.playbackRate!==0&&(r.playbackRate=1)},h.estimateLiveEdge=function(){var r=this.levelDetails;return r===null?null:r.edge+r.age},h.computeLatency=function(){var r=this.estimateLiveEdge();return r===null?null:r-this.currentTime},N(g,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var r=this.config,v=this.levelDetails;return r.liveMaxLatencyDuration!==void 0?r.liveMaxLatencyDuration:v?r.liveMaxLatencyDurationCount*v.targetduration:0}},{key:"targetLatency",get:function(){var r=this.levelDetails;if(r===null)return null;var v=r.holdBack,S=r.partHoldBack,w=r.targetduration,I=this.config,E=I.liveSyncDuration,x=I.liveSyncDurationCount,P=I.lowLatencyMode,T=this.hls.userConfig,A=P&&S||v;(T.liveSyncDuration||T.liveSyncDurationCount||A===0)&&(A=E!==void 0?E:x*w);var b=w,C=1;return A+Math.min(this.stallCount*C,b)}},{key:"liveSyncPosition",get:function(){var r=this.estimateLiveEdge(),v=this.targetLatency,S=this.levelDetails;if(r===null||v===null||S===null)return null;var w=S.edge,I=r-v-this.edgeStalled,E=w-S.totalduration,x=w-(this.config.lowLatencyMode&&S.partTarget||S.targetduration);return Math.min(Math.max(E,I),x)}},{key:"drift",get:function(){var r=this.levelDetails;return r===null?1:r.drift}},{key:"edgeStalled",get:function(){var r=this.levelDetails;if(r===null)return 0;var v=(this.config.lowLatencyMode&&r.partTarget||r.targetduration)*3;return Math.max(r.age-v,0)}},{key:"forwardBufferLength",get:function(){var r=this.media,v=this.levelDetails;if(!r||!v)return 0;var S=r.buffered.length;return(S?r.buffered.end(S-1):v.edge)-this.currentTime}}]),g}()},"./src/controller/level-controller.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>I});var B=R("./src/types/level.ts"),n=R("./src/events.ts"),W=R("./src/errors.ts"),D=R("./src/utils/codecs.ts"),N=R("./src/controller/level-helper.ts"),d=R("./src/controller/base-playlist-controller.ts"),m=R("./src/types/loader.ts");function s(){return s=Object.assign?Object.assign.bind():function(E){for(var x=1;x<arguments.length;x++){var P=arguments[x];for(var T in P)Object.prototype.hasOwnProperty.call(P,T)&&(E[T]=P[T])}return E},s.apply(this,arguments)}function g(E,x){for(var P=0;P<x.length;P++){var T=x[P];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(E,_(T.key),T)}}function h(E,x,P){return x&&g(E.prototype,x),P&&g(E,P),Object.defineProperty(E,"prototype",{writable:!1}),E}function _(E){var x=r(E,"string");return typeof x=="symbol"?x:String(x)}function r(E,x){if(typeof E!="object"||E===null)return E;var P=E[Symbol.toPrimitive];if(P!==void 0){var T=P.call(E,x||"default");if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(x==="string"?String:Number)(E)}function v(E,x){E.prototype=Object.create(x.prototype),E.prototype.constructor=E,S(E,x)}function S(E,x){return S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(T,A){return T.__proto__=A,T},S(E,x)}var w=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),I=function(E){v(x,E);function x(T){var A;return A=E.call(this,T,"[level-controller]")||this,A._levels=[],A._firstLevel=-1,A._startLevel=void 0,A.currentLevelIndex=-1,A.manualLevelIndex=-1,A.onParsedComplete=void 0,A._registerListeners(),A}var P=x.prototype;return P._registerListeners=function(){var A=this.hls;A.on(n.Events.MANIFEST_LOADED,this.onManifestLoaded,this),A.on(n.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.on(n.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),A.on(n.Events.FRAG_LOADED,this.onFragLoaded,this),A.on(n.Events.ERROR,this.onError,this)},P._unregisterListeners=function(){var A=this.hls;A.off(n.Events.MANIFEST_LOADED,this.onManifestLoaded,this),A.off(n.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.off(n.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),A.off(n.Events.FRAG_LOADED,this.onFragLoaded,this),A.off(n.Events.ERROR,this.onError,this)},P.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,E.prototype.destroy.call(this)},P.startLoad=function(){var A=this._levels;A.forEach(function(b){b.loadError=0}),E.prototype.startLoad.call(this)},P.onManifestLoaded=function(A,b){var C=[],p=[],i=[],f,o={},a,L=!1,y=!1,l=!1;if(b.levels.forEach(function(Y){var te=Y.attrs;L=L||!!(Y.width&&Y.height),y=y||!!Y.videoCodec,l=l||!!Y.audioCodec,w&&Y.audioCodec&&Y.audioCodec.indexOf("mp4a.40.34")!==-1&&(Y.audioCodec=void 0);var de=Y.bitrate+"-"+Y.attrs.RESOLUTION+"-"+Y.attrs.CODECS;a=o[de],a?a.url.push(Y.url):(a=new B.Level(Y),o[de]=a,C.push(a)),te&&(te.AUDIO&&(0,N.addGroupId)(a,"audio",te.AUDIO),te.SUBTITLES&&(0,N.addGroupId)(a,"text",te.SUBTITLES))}),(L||y)&&l&&(C=C.filter(function(Y){var te=Y.videoCodec,de=Y.width,ve=Y.height;return!!te||!!(de&&ve)})),C=C.filter(function(Y){var te=Y.audioCodec,de=Y.videoCodec;return(!te||(0,D.isCodecSupportedInMp4)(te,"audio"))&&(!de||(0,D.isCodecSupportedInMp4)(de,"video"))}),b.audioTracks&&(p=b.audioTracks.filter(function(Y){return!Y.audioCodec||(0,D.isCodecSupportedInMp4)(Y.audioCodec,"audio")}),(0,N.assignTrackIdsByGroup)(p)),b.subtitles&&(i=b.subtitles,(0,N.assignTrackIdsByGroup)(i)),C.length>0){f=C[0].bitrate,C.sort(function(Y,te){return Y.attrs["HDCP-LEVEL"]!==te.attrs["HDCP-LEVEL"]?(Y.attrs["HDCP-LEVEL"]||"")>(te.attrs["HDCP-LEVEL"]||"")?1:-1:Y.bitrate!==te.bitrate?Y.bitrate-te.bitrate:Y.attrs.SCORE!==te.attrs.SCORE?Y.attrs.decimalFloatingPoint("SCORE")-te.attrs.decimalFloatingPoint("SCORE"):L&&Y.height!==te.height?Y.height-te.height:0}),this._levels=C;for(var F=0;F<C.length;F++)if(C[F].bitrate===f){this._firstLevel=F,this.log("manifest loaded, "+C.length+" level(s) found, first bitrate: "+f);break}var j=l&&!y,G={levels:C,audioTracks:p,subtitleTracks:i,sessionData:b.sessionData,sessionKeys:b.sessionKeys,firstLevel:this._firstLevel,stats:b.stats,audio:l,video:y,altAudio:!j&&p.some(function(Y){return!!Y.url})};this.hls.trigger(n.Events.MANIFEST_PARSED,G),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(n.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:b.url,reason:"no level with compatible codecs found in manifest"})},P.onError=function(A,b){var C,p;if(E.prototype.onError.call(this,A,b),b.fatal)return;var i=b.context,f=this._levels[this.currentLevelIndex];if(i&&(i.type===m.PlaylistContextType.AUDIO_TRACK&&f.audioGroupIds&&i.groupId===f.audioGroupIds[f.urlId]||i.type===m.PlaylistContextType.SUBTITLE_TRACK&&f.textGroupIds&&i.groupId===f.textGroupIds[f.urlId])){this.redundantFailover(this.currentLevelIndex);return}var o=!1,a=!0,L;switch(b.details){case W.ErrorDetails.FRAG_LOAD_ERROR:case W.ErrorDetails.FRAG_LOAD_TIMEOUT:case W.ErrorDetails.KEY_LOAD_ERROR:case W.ErrorDetails.KEY_LOAD_TIMEOUT:if(b.frag){var y=b.frag.type===m.PlaylistLevelType.MAIN?b.frag.level:this.currentLevelIndex,l=this._levels[y];l?(l.fragmentError++,l.fragmentError>this.hls.config.fragLoadingMaxRetry&&(L=y)):L=y}break;case W.ErrorDetails.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{var F=f.attrs["HDCP-LEVEL"];F&&(this.hls.maxHdcpLevel=B.HdcpLevels[B.HdcpLevels.indexOf(F)-1],this.warn('Restricting playback to HDCP-LEVEL of "'+this.hls.maxHdcpLevel+'" or lower'))}case W.ErrorDetails.FRAG_PARSING_ERROR:case W.ErrorDetails.KEY_SYSTEM_NO_SESSION:L=((C=b.frag)===null||C===void 0?void 0:C.type)===m.PlaylistLevelType.MAIN?b.frag.level:this.currentLevelIndex,b.levelRetry=!1;break;case W.ErrorDetails.LEVEL_LOAD_ERROR:case W.ErrorDetails.LEVEL_LOAD_TIMEOUT:i&&(i.deliveryDirectives&&(a=!1),L=i.level),o=!0;break;case W.ErrorDetails.REMUX_ALLOC_ERROR:L=(p=b.level)!=null?p:this.currentLevelIndex,o=!0;break}L!==void 0&&this.recoverLevel(b,L,o,a)},P.recoverLevel=function(A,b,C,p){var i=A.details,f=this._levels[b];if(f.loadError++,C){var o=this.retryLoadingOrFail(A);if(o)A.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(p){var a=f.url.length;if(a>1&&f.loadError<a)A.levelRetry=!0,this.redundantFailover(b);else if(this.manualLevelIndex===-1){for(var L=-1,y=this._levels,l=y.length;l--;){var F=(l+this.currentLevelIndex)%y.length;if(F!==this.currentLevelIndex&&y[F].loadError===0){L=F;break}}L>-1&&this.currentLevelIndex!==L?(this.warn(i+": switch to "+L),A.levelRetry=!0,this.hls.nextAutoLevel=L):A.levelRetry===!1&&(A.fatal=!0)}}},P.redundantFailover=function(A){var b=this._levels[A],C=b.url.length;if(C>1){var p=(b.urlId+1)%C;this.warn("Switching to redundant URL-id "+p),this._levels.forEach(function(i){i.urlId=p}),this.level=A}},P.onFragLoaded=function(A,b){var C=b.frag;if(C!==void 0&&C.type===m.PlaylistLevelType.MAIN){var p=this._levels[C.level];p!==void 0&&(p.fragmentError=0,p.loadError=0)}},P.onLevelLoaded=function(A,b){var C,p=b.level,i=b.details,f=this._levels[p];if(!f){var o;this.warn("Invalid level index "+p),(o=b.deliveryDirectives)!==null&&o!==void 0&&o.skip&&(i.deltaUpdateFailed=!0);return}p===this.currentLevelIndex?(f.fragmentError===0&&(f.loadError=0,this.retryCount=0),this.playlistLoaded(p,b,f.details)):(C=b.deliveryDirectives)!==null&&C!==void 0&&C.skip&&(i.deltaUpdateFailed=!0)},P.onAudioTrackSwitched=function(A,b){var C=this.hls.levels[this.currentLevelIndex];if(!C)return;if(C.audioGroupIds){for(var p=-1,i=this.hls.audioTracks[b.id].groupId,f=0;f<C.audioGroupIds.length;f++)if(C.audioGroupIds[f]===i){p=f;break}p!==C.urlId&&(C.urlId=p,this.startLoad())}},P.loadPlaylist=function(A){E.prototype.loadPlaylist.call(this);var b=this.currentLevelIndex,C=this._levels[b];if(this.canLoad&&C&&C.url.length>0){var p=C.urlId,i=C.url[p];if(A)try{i=A.addDirectives(i)}catch(f){this.warn("Could not construct new URL with HLS Delivery Directives: "+f)}this.log("Attempt loading level index "+b+((A==null?void 0:A.msn)!==void 0?" at sn "+A.msn+" part "+A.part:"")+" with URL-id "+p+" "+i),this.clearTimer(),this.hls.trigger(n.Events.LEVEL_LOADING,{url:i,level:b,id:p,deliveryDirectives:A||null})}},P.removeLevel=function(A,b){var C=function(f,o){return o!==b},p=this._levels.filter(function(i,f){return f!==A?!0:i.url.length>1&&b!==void 0?(i.url=i.url.filter(C),i.audioGroupIds&&(i.audioGroupIds=i.audioGroupIds.filter(C)),i.textGroupIds&&(i.textGroupIds=i.textGroupIds.filter(C)),i.urlId=0,!0):!1}).map(function(i,f){var o=i.details;return o!=null&&o.fragments&&o.fragments.forEach(function(a){a.level=f}),i});this._levels=p,this.hls.trigger(n.Events.LEVELS_UPDATED,{levels:p})},h(x,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(A){var b,C=this._levels;if(C.length===0)return;if(this.currentLevelIndex===A&&(b=C[A])!==null&&b!==void 0&&b.details)return;if(A<0||A>=C.length){var p=A<0;if(this.hls.trigger(n.Events.ERROR,{type:W.ErrorTypes.OTHER_ERROR,details:W.ErrorDetails.LEVEL_SWITCH_ERROR,level:A,fatal:p,reason:"invalid level idx"}),p)return;A=Math.min(A,C.length-1)}this.clearTimer();var i=this.currentLevelIndex,f=C[i],o=C[A];this.log("switching to level "+A+" from "+i),this.currentLevelIndex=A;var a=s({},o,{level:A,maxBitrate:o.maxBitrate,uri:o.uri,urlId:o.urlId});delete a._urlId,this.hls.trigger(n.Events.LEVEL_SWITCHING,a);var L=o.details;if(!L||L.live){var y=this.switchParams(o.uri,f==null?void 0:f.details);this.loadPlaylist(y)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(A){this.manualLevelIndex=A,this._startLevel===void 0&&(this._startLevel=A),A!==-1&&(this.level=A)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(A){this._firstLevel=A}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var A=this.hls.config.startLevel;return A!==void 0?A:this._firstLevel}else return this._startLevel},set:function(A){this._startLevel=A}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(A){this.level=A,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=A)}}]),x}(d.default)},"./src/controller/level-helper.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{addGroupId:()=>N,addSliding:()=>w,adjustSliding:()=>S,assignTrackIdsByGroup:()=>d,computeReloadInterval:()=>I,getFragmentWithSN:()=>E,getPartWith:()=>x,mapFragmentIntersection:()=>v,mapPartIntersection:()=>r,mergeDetails:()=>h,updateFragPTSDTS:()=>g,updatePTS:()=>m});var B=R("./src/polyfills/number.ts"),n=R("./src/utils/logger.ts"),W=R("./src/loader/date-range.ts");function D(){return D=Object.assign?Object.assign.bind():function(P){for(var T=1;T<arguments.length;T++){var A=arguments[T];for(var b in A)Object.prototype.hasOwnProperty.call(A,b)&&(P[b]=A[b])}return P},D.apply(this,arguments)}function N(P,T,A){switch(T){case"audio":P.audioGroupIds||(P.audioGroupIds=[]),P.audioGroupIds.push(A);break;case"text":P.textGroupIds||(P.textGroupIds=[]),P.textGroupIds.push(A);break}}function d(P){var T={};P.forEach(function(A){var b=A.groupId||"";A.id=T[b]=T[b]||0,T[b]++})}function m(P,T,A){var b=P[T],C=P[A];s(b,C)}function s(P,T){var A=T.startPTS;if((0,B.isFiniteNumber)(A)){var b=0,C;T.sn>P.sn?(b=A-P.start,C=P):(b=P.start-A,C=T),C.duration!==b&&(C.duration=b)}else if(T.sn>P.sn){var p=P.cc===T.cc;p&&P.minEndPTS?T.start=P.start+(P.minEndPTS-P.start):T.start=P.start+P.duration}else T.start=Math.max(P.start-T.duration,0)}function g(P,T,A,b,C,p){var i=b-A;i<=0&&(n.logger.warn("Fragment should have a positive duration",T),b=A+T.duration,p=C+T.duration);var f=A,o=b,a=T.startPTS,L=T.endPTS;if((0,B.isFiniteNumber)(a)){var y=Math.abs(a-A);(0,B.isFiniteNumber)(T.deltaPTS)?T.deltaPTS=Math.max(y,T.deltaPTS):T.deltaPTS=y,f=Math.max(A,a),A=Math.min(A,a),C=Math.min(C,T.startDTS),o=Math.min(b,L),b=Math.max(b,L),p=Math.max(p,T.endDTS)}T.duration=b-A;var l=A-T.start;T.start=T.startPTS=A,T.maxStartPTS=f,T.startDTS=C,T.endPTS=b,T.minEndPTS=o,T.endDTS=p;var F=T.sn;if(!P||F<P.startSN||F>P.endSN)return 0;var j,G=F-P.startSN,Y=P.fragments;for(Y[G]=T,j=G;j>0;j--)s(Y[j],Y[j-1]);for(j=G;j<Y.length-1;j++)s(Y[j],Y[j+1]);return P.fragmentHint&&s(Y[Y.length-1],P.fragmentHint),P.PTSKnown=P.alignedSliding=!0,l}function h(P,T){for(var A=null,b=P.fragments,C=b.length-1;C>=0;C--){var p=b[C].initSegment;if(p){A=p;break}}P.fragmentHint&&delete P.fragmentHint.endPTS;var i=0,f;if(v(P,T,function(j,G){j.relurl&&(i=j.cc-G.cc),(0,B.isFiniteNumber)(j.startPTS)&&(0,B.isFiniteNumber)(j.endPTS)&&(G.start=G.startPTS=j.startPTS,G.startDTS=j.startDTS,G.appendedPTS=j.appendedPTS,G.maxStartPTS=j.maxStartPTS,G.endPTS=j.endPTS,G.endDTS=j.endDTS,G.minEndPTS=j.minEndPTS,G.duration=j.endPTS-j.startPTS,G.duration&&(f=G),T.PTSKnown=T.alignedSliding=!0),G.elementaryStreams=j.elementaryStreams,G.loader=j.loader,G.stats=j.stats,G.urlId=j.urlId,j.initSegment&&(G.initSegment=j.initSegment,A=j.initSegment)}),A){var o=T.fragmentHint?T.fragments.concat(T.fragmentHint):T.fragments;o.forEach(function(j){var G;(!j.initSegment||j.initSegment.relurl===((G=A)===null||G===void 0?void 0:G.relurl))&&(j.initSegment=A)})}if(T.skippedSegments)if(T.deltaUpdateFailed=T.fragments.some(function(j){return!j}),T.deltaUpdateFailed){n.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var a=T.skippedSegments;a--;)T.fragments.shift();T.startSN=T.fragments[0].sn,T.startCC=T.fragments[0].cc}else T.canSkipDateRanges&&(T.dateRanges=_(P.dateRanges,T.dateRanges,T.recentlyRemovedDateranges));var L=T.fragments;if(i){n.logger.warn("discontinuity sliding from playlist, take drift into account");for(var y=0;y<L.length;y++)L[y].cc+=i}T.skippedSegments&&(T.startCC=T.fragments[0].cc),r(P.partList,T.partList,function(j,G){G.elementaryStreams=j.elementaryStreams,G.stats=j.stats}),f?g(T,f,f.startPTS,f.endPTS,f.startDTS,f.endDTS):S(P,T),L.length&&(T.totalduration=T.edge-L[0].start),T.driftStartTime=P.driftStartTime,T.driftStart=P.driftStart;var l=T.advancedDateTime;if(T.advanced&&l){var F=T.edge;T.driftStart||(T.driftStartTime=l,T.driftStart=F),T.driftEndTime=l,T.driftEnd=F}else T.driftEndTime=P.driftEndTime,T.driftEnd=P.driftEnd,T.advancedDateTime=P.advancedDateTime}function _(P,T,A){var b=D({},P);return A&&A.forEach(function(C){delete b[C]}),Object.keys(T).forEach(function(C){var p=new W.DateRange(T[C].attr,b[C]);p.isValid?b[C]=p:n.logger.warn('Ignoring invalid Playlist Delta Update DATERANGE tag: "'+JSON.stringify(T[C].attr)+'"')}),b}function r(P,T,A){if(P&&T)for(var b=0,C=0,p=P.length;C<=p;C++){var i=P[C],f=T[C+b];i&&f&&i.index===f.index&&i.fragment.sn===f.fragment.sn?A(i,f):b--}}function v(P,T,A){for(var b=T.skippedSegments,C=Math.max(P.startSN,T.startSN)-T.startSN,p=(P.fragmentHint?1:0)+(b?T.endSN:Math.min(P.endSN,T.endSN))-T.startSN,i=T.startSN-P.startSN,f=T.fragmentHint?T.fragments.concat(T.fragmentHint):T.fragments,o=P.fragmentHint?P.fragments.concat(P.fragmentHint):P.fragments,a=C;a<=p;a++){var L=o[i+a],y=f[a];b&&!y&&a<b&&(y=T.fragments[a]=L),L&&y&&A(L,y)}}function S(P,T){var A=T.startSN+T.skippedSegments-P.startSN,b=P.fragments;if(A<0||A>=b.length)return;w(T,b[A].start)}function w(P,T){if(T){for(var A=P.fragments,b=P.skippedSegments;b<A.length;b++)A[b].start+=T;P.fragmentHint&&(P.fragmentHint.start+=T)}}function I(P,T){T===void 0&&(T=Infinity);var A=1e3*P.targetduration;if(P.updated){var b=P.fragments,C=4;if(b.length&&A*C>T){var p=b[b.length-1].duration*1e3;p<A&&(A=p)}}else A/=2;return Math.round(A)}function E(P,T,A){if(!P||!P.details)return null;var b=P.details,C=b.fragments[T-b.startSN];return C||(C=b.fragmentHint,C&&C.sn===T?C:T<b.startSN&&A&&A.sn===T?A:null)}function x(P,T,A){if(!P||!P.details)return null;var b=P.details.partList;if(b)for(var C=b.length;C--;){var p=b[C];if(p.index===A&&p.fragment.sn===T)return p}return null}},"./src/controller/stream-controller.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>T});var B=R("./src/polyfills/number.ts"),n=R("./src/controller/base-stream-controller.ts"),W=R("./src/is-supported.ts"),D=R("./src/events.ts"),N=R("./src/utils/buffer-helper.ts"),d=R("./src/controller/fragment-tracker.ts"),m=R("./src/types/loader.ts"),s=R("./src/loader/fragment.ts"),g=R("./src/demux/transmuxer-interface.ts"),h=R("./src/types/transmuxer.ts"),_=R("./src/controller/gap-controller.ts"),r=R("./src/errors.ts");function v(A,b){for(var C=0;C<b.length;C++){var p=b[C];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(A,w(p.key),p)}}function S(A,b,C){return b&&v(A.prototype,b),C&&v(A,C),Object.defineProperty(A,"prototype",{writable:!1}),A}function w(A){var b=I(A,"string");return typeof b=="symbol"?b:String(b)}function I(A,b){if(typeof A!="object"||A===null)return A;var C=A[Symbol.toPrimitive];if(C!==void 0){var p=C.call(A,b||"default");if(typeof p!="object")return p;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(A)}function E(A,b){A.prototype=Object.create(b.prototype),A.prototype.constructor=A,x(A,b)}function x(A,b){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,i){return p.__proto__=i,p},x(A,b)}var P=100,T=function(A){E(b,A);function b(p,i,f){var o;return o=A.call(this,p,i,f,"[stream-controller]")||this,o.audioCodecSwap=!1,o.gapController=null,o.level=-1,o._forceStartLoad=!1,o.altAudio=!1,o.audioOnly=!1,o.fragPlaying=null,o.onvplaying=null,o.onvseeked=null,o.fragLastKbps=0,o.couldBacktrack=!1,o.backtrackFragment=null,o.audioCodecSwitch=!1,o.videoBuffer=null,o._registerListeners(),o}var C=b.prototype;return C._registerListeners=function(){var i=this.hls;i.on(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(D.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.on(D.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),i.on(D.Events.ERROR,this.onError,this),i.on(D.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),i.on(D.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),i.on(D.Events.BUFFER_CREATED,this.onBufferCreated,this),i.on(D.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),i.on(D.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),i.on(D.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C._unregisterListeners=function(){var i=this.hls;i.off(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.off(D.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),i.off(D.Events.ERROR,this.onError,this),i.off(D.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),i.off(D.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),i.off(D.Events.BUFFER_CREATED,this.onBufferCreated,this),i.off(D.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),i.off(D.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),i.off(D.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},C.startLoad=function(i){if(this.levels){var f=this.lastCurrentTime,o=this.hls;if(this.stopLoad(),this.setInterval(P),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var a=o.startLevel;a===-1&&(o.config.testBandwidth&&this.levels.length>1?(a=0,this.bitrateTest=!0):a=o.nextAutoLevel),this.level=o.nextLoadLevel=a,this.loadedmetadata=!1}f>0&&i===-1&&(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),i=f),this.state=n.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=i,this.tick()}else this._forceStartLoad=!0,this.state=n.State.STOPPED},C.stopLoad=function(){this._forceStartLoad=!1,A.prototype.stopLoad.call(this)},C.doTick=function(){switch(this.state){case n.State.IDLE:this.doTickIdle();break;case n.State.WAITING_LEVEL:{var i,f=this.levels,o=this.level,a=f==null||((i=f[o])===null||i===void 0)?void 0:i.details;if(a&&(!a.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(a))break;this.state=n.State.IDLE;break}break}case n.State.FRAG_LOADING_WAITING_RETRY:{var L,y=self.performance.now(),l=this.retryDate;(!l||y>=l||(L=this.media)!==null&&L!==void 0&&L.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.level),this.state=n.State.IDLE)}break;default:break}this.onTickEnd()},C.onTickEnd=function(){A.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},C.doTickIdle=function(){var i=this.hls,f=this.levelLastLoaded,o=this.levels,a=this.media,L=i.config,y=i.nextLoadLevel;if(f===null||!a&&(this.startFragRequested||!L.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!o||!o[y])return;var l=o[y],F=this.getMainFwdBufferInfo();if(F===null)return;var j=this.getLevelDetails();if(j&&this._streamEnded(F,j)){var G={};this.altAudio&&(G.type="video"),this.hls.trigger(D.Events.BUFFER_EOS,G),this.state=n.State.ENDED;return}this.level=i.nextLoadLevel=y;var Y=l.details;if(!Y||this.state===n.State.WAITING_LEVEL||Y.live&&this.levelLastLoaded!==y){this.level=y,this.state=n.State.WAITING_LEVEL;return}var te=F.len,de=this.getMaxBufferLength(l.maxBitrate);if(te>=de)return;this.backtrackFragment&&this.backtrackFragment.start>F.end&&(this.backtrackFragment=null);var ve=this.backtrackFragment?this.backtrackFragment.start:F.end,he=this.getNextFragment(ve,Y);if(this.couldBacktrack&&!this.fragPrevious&&he&&he.sn!=="initSegment"&&this.fragmentTracker.getState(he)!==d.FragmentState.OK){var Re,we=((Re=this.backtrackFragment)!=null?Re:he).sn,ge=we-Y.startSN,Ne=Y.fragments[ge-1];Ne&&he.cc===Ne.cc&&(he=Ne,this.fragmentTracker.removeFragment(Ne))}else this.backtrackFragment&&F.len&&(this.backtrackFragment=null);if(he&&this.fragmentTracker.getState(he)===d.FragmentState.OK&&this.nextLoadPosition>ve){var ze=this.audioOnly&&!this.altAudio?s.ElementaryStreamTypes.AUDIO:s.ElementaryStreamTypes.VIDEO,nt=(ze===s.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;nt&&this.afterBufferFlushed(nt,ze,m.PlaylistLevelType.MAIN),he=this.getNextFragment(this.nextLoadPosition,Y)}if(!he)return;he.initSegment&&!he.initSegment.data&&!this.bitrateTest&&(he=he.initSegment),this.loadFragment(he,Y,ve)},C.loadFragment=function(i,f,o){var a,L=this.fragmentTracker.getState(i);this.fragCurrent=i,L===d.FragmentState.NOT_LOADED?i.sn==="initSegment"?this._loadInitSegment(i,f):this.bitrateTest?(this.log("Fragment "+i.sn+" of level "+i.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(i,f)):(this.startFragRequested=!0,A.prototype.loadFragment.call(this,i,f,o)):L===d.FragmentState.APPENDING?this.reduceMaxBufferLength(i.duration)&&this.fragmentTracker.removeFragment(i):((a=this.media)===null||a===void 0?void 0:a.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},C.getAppendedFrag=function(i){var f=this.fragmentTracker.getAppendedFrag(i,m.PlaylistLevelType.MAIN);return f&&"fragment"in f?f.fragment:f},C.getBufferedFrag=function(i){return this.fragmentTracker.getBufferedFrag(i,m.PlaylistLevelType.MAIN)},C.followingBufferedFrag=function(i){return i?this.getBufferedFrag(i.end+.5):null},C.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},C.nextLevelSwitch=function(){var i=this.levels,f=this.media;if(f!=null&&f.readyState){var o,a=this.getAppendedFrag(f.currentTime);if(a&&a.start>1&&this.flushMainBuffer(0,a.start-1),!f.paused&&i){var L=this.hls.nextLoadLevel,y=i[L],l=this.fragLastKbps;l&&this.fragCurrent?o=this.fragCurrent.duration*y.maxBitrate/(1e3*l)+1:o=0}else o=0;var F=this.getBufferedFrag(f.currentTime+o);if(F){var j=this.followingBufferedFrag(F);if(j){this.abortCurrentFrag();var G=j.maxStartPTS?j.maxStartPTS:j.start,Y=j.duration,te=Math.max(F.end,G+Math.min(Math.max(Y-this.config.maxFragLookUpTolerance,Y*.5),Y*.75));this.flushMainBuffer(te,Number.POSITIVE_INFINITY)}}}},C.abortCurrentFrag=function(){var i=this.fragCurrent;this.fragCurrent=null,this.backtrackFragment=null,i&&i.abortRequests();switch(this.state){case n.State.KEY_LOADING:case n.State.FRAG_LOADING:case n.State.FRAG_LOADING_WAITING_RETRY:case n.State.PARSING:case n.State.PARSED:this.state=n.State.IDLE;break}this.nextLoadPosition=this.getLoadPosition()},C.flushMainBuffer=function(i,f){A.prototype.flushMainBuffer.call(this,i,f,this.altAudio?"video":null)},C.onMediaAttached=function(i,f){A.prototype.onMediaAttached.call(this,i,f);var o=f.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),o.addEventListener("playing",this.onvplaying),o.addEventListener("seeked",this.onvseeked),this.gapController=new _.default(this.config,o,this.fragmentTracker,this.hls)},C.onMediaDetaching=function(){var i=this.media;i&&this.onvplaying&&this.onvseeked&&(i.removeEventListener("playing",this.onvplaying),i.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),A.prototype.onMediaDetaching.call(this)},C.onMediaPlaying=function(){this.tick()},C.onMediaSeeked=function(){var i=this.media,f=i?i.currentTime:null;(0,B.isFiniteNumber)(f)&&this.log("Media seeked to "+f.toFixed(3)),this.tick()},C.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(D.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null,this.backtrackFragment=null},C.onManifestParsed=function(i,f){var o=!1,a=!1,L;f.levels.forEach(function(y){L=y.audioCodec,L&&(L.indexOf("mp4a.40.2")!==-1&&(o=!0),L.indexOf("mp4a.40.5")!==-1&&(a=!0))}),this.audioCodecSwitch=o&&a&&!(0,W.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=f.levels,this.startFragRequested=!1},C.onLevelLoading=function(i,f){var o=this.levels;if(!o||this.state!==n.State.IDLE)return;var a=o[f.level];(!a.details||a.details.live&&this.levelLastLoaded!==f.level||this.waitForCdnTuneIn(a.details))&&(this.state=n.State.WAITING_LEVEL)},C.onLevelLoaded=function(i,f){var o,a=this.levels,L=f.level,y=f.details,l=y.totalduration;if(!a){this.warn("Levels were reset while loading level "+L);return}this.log("Level "+L+" loaded ["+y.startSN+","+y.endSN+"], cc ["+y.startCC+", "+y.endCC+"] duration:"+l);var F=this.fragCurrent;F&&(this.state===n.State.FRAG_LOADING||this.state===n.State.FRAG_LOADING_WAITING_RETRY)&&(F.level!==f.level&&F.loader&&(this.state=n.State.IDLE,this.backtrackFragment=null,F.abortRequests()));var j=a[L],G=0;if(y.live||(o=j.details)!==null&&o!==void 0&&o.live){if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed)return;G=this.alignPlaylists(y,j.details)}if(j.details=y,this.levelLastLoaded=L,this.hls.trigger(D.Events.LEVEL_UPDATED,{details:y,level:L}),this.state===n.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(y))return;this.state=n.State.IDLE}this.startFragRequested?y.live&&this.synchronizeToLiveEdge(y):this.setStartPosition(y,G),this.tick()},C._handleFragmentLoadProgress=function(i){var f,o=i.frag,a=i.part,L=i.payload,y=this.levels;if(!y){this.warn("Levels were reset while fragment load was in progress. Fragment "+o.sn+" of level "+o.level+" will not be buffered");return}var l=y[o.level],F=l.details;if(!F){this.warn("Dropping fragment "+o.sn+" of level "+o.level+" after level details were reset");return}var j=l.videoCodec,G=F.PTSKnown||!F.live,Y=(f=o.initSegment)===null||f===void 0?void 0:f.data,te=this._getAudioCodec(l),de=this.transmuxer=this.transmuxer||new g.default(this.hls,m.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ve=a?a.index:-1,he=ve!==-1,Re=new h.ChunkMetadata(o.level,o.sn,o.stats.chunkCount,L.byteLength,ve,he),we=this.initPTS[o.cc];de.push(L,Y,te,j,o,a,F.totalduration,G,Re,we)},C.onAudioTrackSwitching=function(i,f){var o=this.altAudio,a=!!f.url,L=f.id;if(!a){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var y=this.fragCurrent;y&&(this.log("Switching to main audio track, cancel main fragment load"),y.abortRequests()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var l=this.hls;o&&l.trigger(D.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),l.trigger(D.Events.AUDIO_TRACK_SWITCHED,{id:L})}},C.onAudioTrackSwitched=function(i,f){var o=f.id,a=!!this.hls.audioTracks[o].url;if(a){var L=this.videoBuffer;L&&this.mediaBuffer!==L&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=L)}this.altAudio=a,this.tick()},C.onBufferCreated=function(i,f){var o=f.tracks,a,L,y=!1;for(var l in o){var F=o[l];if(F.id==="main"){if(L=l,a=F,l==="video"){var j=o[l];j&&(this.videoBuffer=j.buffer)}}else y=!0}y&&a?(this.log("Alternate track found, use "+L+".buffered to schedule main fragment loading"),this.mediaBuffer=a.buffer):this.mediaBuffer=this.media},C.onFragBuffered=function(i,f){var o=f.frag,a=f.part;if(o&&o.type!==m.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(o)){this.warn("Fragment "+o.sn+(a?" p: "+a.index:"")+" of level "+o.level+" finished buffering, but was aborted. state: "+this.state),this.state===n.State.PARSED&&(this.state=n.State.IDLE);return}var L=a?a.stats:o.stats;this.fragLastKbps=Math.round(8*L.total/(L.buffering.end-L.loading.first)),o.sn!=="initSegment"&&(this.fragPrevious=o),this.fragBufferedComplete(o,a)},C.onError=function(i,f){if(f.type===r.ErrorTypes.KEY_SYSTEM_ERROR){this.onFragmentOrKeyLoadError(m.PlaylistLevelType.MAIN,f);return}switch(f.details){case r.ErrorDetails.FRAG_LOAD_ERROR:case r.ErrorDetails.FRAG_LOAD_TIMEOUT:case r.ErrorDetails.FRAG_PARSING_ERROR:case r.ErrorDetails.KEY_LOAD_ERROR:case r.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(m.PlaylistLevelType.MAIN,f);break;case r.ErrorDetails.LEVEL_LOAD_ERROR:case r.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==n.State.ERROR&&(f.fatal?(this.warn(""+f.details),this.state=n.State.ERROR):!f.levelRetry&&this.state===n.State.WAITING_LEVEL&&(this.state=n.State.IDLE));break;case r.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="main"&&(this.state===n.State.PARSING||this.state===n.State.PARSED)){var o=!0,a=this.getFwdBufferInfo(this.media,m.PlaylistLevelType.MAIN);a&&a.len>.5&&(o=!this.reduceMaxBufferLength(a.len)),o&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},C.checkBuffer=function(){var i=this.media,f=this.gapController;if(!i||!f||!i.readyState)return;if(this.loadedmetadata||!N.BufferHelper.getBuffered(i).length){var o=this.state!==n.State.IDLE?this.fragCurrent:null;f.poll(this.lastCurrentTime,o)}this.lastCurrentTime=i.currentTime},C.onFragLoadEmergencyAborted=function(){this.state=n.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},C.onBufferFlushed=function(i,f){var o=f.type;if(o!==s.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var a=(o===s.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(a,o,m.PlaylistLevelType.MAIN)}},C.onLevelsUpdated=function(i,f){this.levels=f.levels},C.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},C.seekToStartPos=function(){var i=this.media;if(!i)return;var f=i.currentTime,o=this.startPosition;if(o>=0&&f<o){if(i.seeking){this.log("could not seek to "+o+", already seeking at "+f);return}var a=N.BufferHelper.getBuffered(i),L=a.length?a.start(0):0,y=L-o;y>0&&(y<this.config.maxBufferHole||y<this.config.maxFragLookUpTolerance)&&(this.log("adjusting start position by "+y+" to match buffer start"),o+=y,this.startPosition=o),this.log("seek to target start position "+o+" from current time "+f),i.currentTime=o}},C._getAudioCodec=function(i){var f=this.config.defaultAudioCodec||i.audioCodec;return this.audioCodecSwap&&f&&(this.log("Swapping audio codec"),f.indexOf("mp4a.40.5")!==-1?f="mp4a.40.2":f="mp4a.40.5"),f},C._loadBitrateTestFrag=function(i,f){var o=this;i.bitrateTest=!0,this._doFragLoad(i,f).then(function(a){var L=o.hls;if(!a||o.fragContextChanged(i))return;o.fragLoadError=0,o.state=n.State.IDLE,o.startFragRequested=!1,o.bitrateTest=!1;var y=i.stats;y.parsing.start=y.parsing.end=y.buffering.start=y.buffering.end=self.performance.now(),L.trigger(D.Events.FRAG_LOADED,a),i.bitrateTest=!1})},C._handleTransmuxComplete=function(i){var f,o="main",a=this.hls,L=i.remuxResult,y=i.chunkMeta,l=this.getCurrentContext(y);if(!l){this.warn("The loading context changed while buffering fragment "+y.sn+" of level "+y.level+". This chunk will not be buffered."),this.resetStartWhenNotLoaded(y.level);return}var F=l.frag,j=l.part,G=l.level,Y=L.video,te=L.text,de=L.id3,ve=L.initSegment,he=G.details,Re=this.altAudio?void 0:L.audio;if(this.fragContextChanged(F))return;if(this.state=n.State.PARSING,ve){ve.tracks&&(this._bufferInitSegment(G,ve.tracks,F,y),a.trigger(D.Events.FRAG_PARSING_INIT_SEGMENT,{frag:F,id:o,tracks:ve.tracks}));var we=ve.initPTS,ge=ve.timescale;(0,B.isFiniteNumber)(we)&&(this.initPTS[F.cc]=we,a.trigger(D.Events.INIT_PTS_FOUND,{frag:F,id:o,initPTS:we,timescale:ge}))}if(Y&&L.independent!==!1){if(he){var Ne=Y.startPTS,ze=Y.endPTS,nt=Y.startDTS,Ge=Y.endDTS;if(j)j.elementaryStreams[Y.type]={startPTS:Ne,endPTS:ze,startDTS:nt,endDTS:Ge};else if(Y.firstKeyFrame&&Y.independent&&y.id===1&&(this.couldBacktrack=!0),Y.dropped&&Y.independent){var Xe=this.getMainFwdBufferInfo(),Be=(Xe?Xe.end:this.getLoadPosition())+this.config.maxBufferHole,_e=Y.firstKeyFramePTS?Y.firstKeyFramePTS:Ne;if(Be<_e-this.config.maxBufferHole){this.backtrack(F);return}F.setElementaryStreamInfo(Y.type,F.start,ze,F.start,Ge,!0)}F.setElementaryStreamInfo(Y.type,Ne,ze,nt,Ge),this.backtrackFragment&&(this.backtrackFragment=F),this.bufferFragmentData(Y,F,j,y)}}else if(L.independent===!1){this.backtrack(F);return}if(Re){var Ze=Re.startPTS,be=Re.endPTS,Le=Re.startDTS,le=Re.endDTS;j&&(j.elementaryStreams[s.ElementaryStreamTypes.AUDIO]={startPTS:Ze,endPTS:be,startDTS:Le,endDTS:le}),F.setElementaryStreamInfo(s.ElementaryStreamTypes.AUDIO,Ze,be,Le,le),this.bufferFragmentData(Re,F,j,y)}if(he&&de!==null&&de!==void 0&&(f=de.samples)!==null&&f!==void 0&&f.length){var ye={id:o,frag:F,details:he,samples:de.samples};a.trigger(D.Events.FRAG_PARSING_METADATA,ye)}if(he&&te){var Te={id:o,frag:F,details:he,samples:te.samples};a.trigger(D.Events.FRAG_PARSING_USERDATA,Te)}},C._bufferInitSegment=function(i,f,o,a){var L=this;if(this.state!==n.State.PARSING)return;this.audioOnly=!!f.audio&&!f.video,this.altAudio&&!this.audioOnly&&delete f.audio;var y=f.audio,l=f.video,F=f.audiovideo;if(y){var j=i.audioCodec,G=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(j&&(j.indexOf("mp4a.40.5")!==-1?j="mp4a.40.2":j="mp4a.40.5"),y.metadata.channelCount!==1&&G.indexOf("firefox")===-1&&(j="mp4a.40.5")),G.indexOf("android")!==-1&&y.container!=="audio/mpeg"&&(j="mp4a.40.2",this.log("Android: force audio codec to "+j)),i.audioCodec&&i.audioCodec!==j&&this.log('Swapping manifest audio codec "'+i.audioCodec+'" for "'+j+'"'),y.levelCodec=j,y.id="main",this.log("Init audio buffer, container:"+y.container+", codecs[selected/level/parsed]=["+(j||"")+"/"+(i.audioCodec||"")+"/"+y.codec+"]")}l&&(l.levelCodec=i.videoCodec,l.id="main",this.log("Init video buffer, container:"+l.container+", codecs[level/parsed]=["+(i.videoCodec||"")+"/"+l.codec+"]")),F&&this.log("Init audiovideo buffer, container:"+F.container+", codecs[level/parsed]=["+(i.attrs.CODECS||"")+"/"+F.codec+"]"),this.hls.trigger(D.Events.BUFFER_CODECS,f),Object.keys(f).forEach(function(Y){var te=f[Y],de=te.initSegment;de!=null&&de.byteLength&&L.hls.trigger(D.Events.BUFFER_APPENDING,{type:Y,data:de,frag:o,part:null,chunkMeta:a,parent:o.type})}),this.tick()},C.getMainFwdBufferInfo=function(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,m.PlaylistLevelType.MAIN)},C.backtrack=function(i){this.couldBacktrack=!0,this.backtrackFragment=i,this.resetTransmuxer(),this.flushBufferGap(i),this.fragmentTracker.removeFragment(i),this.fragPrevious=null,this.nextLoadPosition=i.start,this.state=n.State.IDLE},C.checkFragmentChanged=function(){var i=this.media,f=null;if(i&&i.readyState>1&&i.seeking===!1){var o=i.currentTime;if(N.BufferHelper.isBuffered(i,o)?f=this.getAppendedFrag(o):N.BufferHelper.isBuffered(i,o+.1)&&(f=this.getAppendedFrag(o+.1)),f){this.backtrackFragment=null;var a=this.fragPlaying,L=f.level;(!a||f.sn!==a.sn||a.level!==L||f.urlId!==a.urlId)&&(this.fragPlaying=f,this.hls.trigger(D.Events.FRAG_CHANGED,{frag:f}),(!a||a.level!==L)&&this.hls.trigger(D.Events.LEVEL_SWITCHED,{level:L}))}}},S(b,[{key:"nextLevel",get:function(){var i=this.nextBufferedFrag;return i?i.level:-1}},{key:"currentFrag",get:function(){var i=this.media;return i?this.fragPlaying||this.getAppendedFrag(i.currentTime):null}},{key:"currentProgramDateTime",get:function(){var i=this.media;if(i){var f=i.currentTime,o=this.currentFrag;if(o&&(0,B.isFiniteNumber)(f)&&(0,B.isFiniteNumber)(o.programDateTime)){var a=o.programDateTime+(f-o.start)*1e3;return new Date(a)}}return null}},{key:"currentLevel",get:function(){var i=this.currentFrag;return i?i.level:-1}},{key:"nextBufferedFrag",get:function(){var i=this.currentFrag;return i?this.followingBufferedFrag(i):null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),b}(n.default)},"./src/controller/subtitle-stream-controller.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{SubtitleStreamController:()=>E});var B=R("./src/events.ts"),n=R("./src/utils/buffer-helper.ts"),W=R("./src/controller/fragment-finders.ts"),D=R("./src/utils/discontinuities.ts"),N=R("./src/controller/level-helper.ts"),d=R("./src/controller/fragment-tracker.ts"),m=R("./src/controller/base-stream-controller.ts"),s=R("./src/types/loader.ts"),g=R("./src/types/level.ts");function h(P,T){for(var A=0;A<T.length;A++){var b=T[A];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(P,r(b.key),b)}}function _(P,T,A){return T&&h(P.prototype,T),A&&h(P,A),Object.defineProperty(P,"prototype",{writable:!1}),P}function r(P){var T=v(P,"string");return typeof T=="symbol"?T:String(T)}function v(P,T){if(typeof P!="object"||P===null)return P;var A=P[Symbol.toPrimitive];if(A!==void 0){var b=A.call(P,T||"default");if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(P)}function S(P,T){P.prototype=Object.create(T.prototype),P.prototype.constructor=P,w(P,T)}function w(P,T){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(b,C){return b.__proto__=C,b},w(P,T)}var I=500,E=function(P){S(T,P);function T(b,C,p){var i;return i=P.call(this,b,C,p,"[subtitle-stream-controller]")||this,i.levels=[],i.currentTrackId=-1,i.tracksBuffered=[],i.mainDetails=null,i._registerListeners(),i}var A=T.prototype;return A.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},A._registerListeners=function(){var C=this.hls;C.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.on(B.Events.ERROR,this.onError,this),C.on(B.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),C.on(B.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),C.on(B.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),C.on(B.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),C.on(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),C.on(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A._unregisterListeners=function(){var C=this.hls;C.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.off(B.Events.ERROR,this.onError,this),C.off(B.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),C.off(B.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),C.off(B.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),C.off(B.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),C.off(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),C.off(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A.startLoad=function(C){this.stopLoad(),this.state=m.State.IDLE,this.setInterval(I),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=C,this.tick()},A.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},A.onLevelLoaded=function(C,p){this.mainDetails=p.details},A.onSubtitleFragProcessed=function(C,p){var i=p.frag,f=p.success;if(this.fragPrevious=i,this.state=m.State.IDLE,!f)return;var o=this.tracksBuffered[this.currentTrackId];if(!o)return;for(var a,L=i.start,y=0;y<o.length;y++)if(L>=o[y].start&&L<=o[y].end){a=o[y];break}var l=i.start+i.duration;a?a.end=l:(a={start:L,end:l},o.push(a)),this.fragmentTracker.fragBuffered(i)},A.onBufferFlushing=function(C,p){var i=p.startOffset,f=p.endOffset;if(i===0&&f!==Number.POSITIVE_INFINITY){var o=this.currentTrackId,a=this.levels;if(!a.length||!a[o]||!a[o].details)return;var L=a[o].details,y=L.targetduration,l=f-y;if(l<=0)return;p.endOffsetSubtitles=Math.max(0,l),this.tracksBuffered.forEach(function(F){for(var j=0;j<F.length;){if(F[j].end<=l){F.shift();continue}else if(F[j].start<l)F[j].start=l;else break;j++}}),this.fragmentTracker.removeFragmentsInRange(i,l,s.PlaylistLevelType.SUBTITLE)}},A.onFragBuffered=function(C,p){if(!this.loadedmetadata&&p.frag.type===s.PlaylistLevelType.MAIN){var i;(i=this.media)!==null&&i!==void 0&&i.buffered.length&&(this.loadedmetadata=!0)}},A.onError=function(C,p){var i=p.frag;if(!i||i.type!==s.PlaylistLevelType.SUBTITLE)return;this.fragCurrent&&this.fragCurrent.abortRequests(),this.state=m.State.IDLE},A.onSubtitleTracksUpdated=function(C,p){var i=this,f=p.subtitleTracks;this.tracksBuffered=[],this.levels=f.map(function(o){return new g.Level(o)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(o){i.tracksBuffered[o.id]=[]}),this.mediaBuffer=null},A.onSubtitleTrackSwitch=function(C,p){if(this.currentTrackId=p.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var i=this.levels[this.currentTrackId];i!=null&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.setInterval(I)},A.onSubtitleTrackLoaded=function(C,p){var i,f=p.details,o=p.id,a=this.currentTrackId,L=this.levels;if(!L.length)return;var y=L[a];if(o>=L.length||o!==a||!y)return;this.mediaBuffer=this.mediaBufferTimeRanges;var l=0;if(f.live||(i=y.details)!==null&&i!==void 0&&i.live){var F=this.mainDetails;if(f.deltaUpdateFailed||!F)return;var j=F.fragments[0];y.details?(l=this.alignPlaylists(f,y.details),l===0&&j&&(l=j.start,(0,N.addSliding)(f,l))):f.hasProgramDateTime&&F.hasProgramDateTime?((0,D.alignMediaPlaylistByPDT)(f,F),l=f.fragments[0].start):j&&(l=j.start,(0,N.addSliding)(f,l))}if(y.details=f,this.levelLastLoaded=o,!this.startFragRequested&&(this.mainDetails||!f.live)&&this.setStartPosition(y.details,l),this.tick(),f.live&&!this.fragCurrent&&this.media&&this.state===m.State.IDLE){var G=(0,W.findFragmentByPTS)(null,f.fragments,this.media.currentTime,0);G||(this.warn("Subtitle playlist not aligned with playback"),y.details=void 0)}},A._handleFragmentLoadComplete=function(C){var p=this,i=C.frag,f=C.payload,o=i.decryptdata,a=this.hls;if(this.fragContextChanged(i))return;if(f&&f.byteLength>0&&o&&o.key&&o.iv&&o.method==="AES-128"){var L=performance.now();this.decrypter.decrypt(new Uint8Array(f),o.key.buffer,o.iv.buffer).then(function(y){var l=performance.now();a.trigger(B.Events.FRAG_DECRYPTED,{frag:i,payload:y,stats:{tstart:L,tdecrypt:l}})}).catch(function(y){p.warn(y.name+": "+y.message),p.state=m.State.IDLE})}},A.doTick=function(){if(!this.media){this.state=m.State.IDLE;return}if(this.state===m.State.IDLE){var C=this.currentTrackId,p=this.levels;if(!p.length||!p[C]||!p[C].details)return;var i=p[C].details,f=i.targetduration,o=this.config,a=this.getLoadPosition(),L=n.BufferHelper.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],a-f,o.maxBufferHole),y=L.end,l=L.len,F=this.getFwdBufferInfo(this.media,s.PlaylistLevelType.MAIN),j=this.getMaxBufferLength(F==null?void 0:F.len)+f;if(l>j)return;console.assert(i,"Subtitle track details are defined on idle subtitle stream controller tick");var G=i.fragments,Y=G.length,te=i.edge,de=null,ve=this.fragPrevious;if(y<te){var he=o.maxFragLookUpTolerance;de=(0,W.findFragmentByPTS)(ve,G,Math.max(G[0].start,y),he),!de&&ve&&ve.start<G[0].start&&(de=G[0])}else de=G[Y-1];if(!de)return;de=this.mapToInitFragWhenRequired(de),this.fragmentTracker.getState(de)===d.FragmentState.NOT_LOADED&&this.loadFragment(de,i,y)}},A.getMaxBufferLength=function(C){var p=P.prototype.getMaxBufferLength.call(this);return C?Math.max(p,C):p},A.loadFragment=function(C,p,i){this.fragCurrent=C,C.sn==="initSegment"?this._loadInitSegment(C,p):(this.startFragRequested=!0,P.prototype.loadFragment.call(this,C,p,i))},_(T,[{key:"mediaBufferTimeRanges",get:function(){return new x(this.tracksBuffered[this.currentTrackId]||[])}}]),T}(m.default),x=function(T){this.buffered=void 0;var A=function(C,p,i){if(p=p>>>0,p>i-1)throw new DOMException("Failed to execute '"+C+"' on 'TimeRanges': The index provided ("+p+") is greater than the maximum bound ("+i+")");return T[p][C]};this.buffered={get length(){return T.length},end:function(C){return A("end",C,T.length)},start:function(C){return A("start",C,T.length)}}}},"./src/controller/subtitle-track-controller.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>v});var B=R("./src/events.ts"),n=R("./src/utils/texttrack-utils.ts"),W=R("./src/controller/base-playlist-controller.ts"),D=R("./src/types/loader.ts");function N(S,w){for(var I=0;I<w.length;I++){var E=w[I];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(S,m(E.key),E)}}function d(S,w,I){return w&&N(S.prototype,w),I&&N(S,I),Object.defineProperty(S,"prototype",{writable:!1}),S}function m(S){var w=s(S,"string");return typeof w=="symbol"?w:String(w)}function s(S,w){if(typeof S!="object"||S===null)return S;var I=S[Symbol.toPrimitive];if(I!==void 0){var E=I.call(S,w||"default");if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(S)}function g(S,w){S.prototype=Object.create(w.prototype),S.prototype.constructor=S,h(S,w)}function h(S,w){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,x){return E.__proto__=x,E},h(S,w)}var _=function(S){g(w,S);function w(E){var x;return x=S.call(this,E,"[subtitle-track-controller]")||this,x.media=null,x.tracks=[],x.groupId=null,x.tracksInGroup=[],x.trackId=-1,x.selectDefaultTrack=!0,x.queuedDefaultTrack=-1,x.trackChangeListener=function(){return x.onTextTracksChanged()},x.asyncPollTrackChange=function(){return x.pollTrackChange(0)},x.useTextTrackPolling=!1,x.subtitlePollingInterval=-1,x._subtitleDisplay=!0,x.registerListeners(),x}var I=w.prototype;return I.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,S.prototype.destroy.call(this)},I.registerListeners=function(){var x=this.hls;x.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.on(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),x.on(B.Events.LEVEL_LOADING,this.onLevelLoading,this),x.on(B.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),x.on(B.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),x.on(B.Events.ERROR,this.onError,this)},I.unregisterListeners=function(){var x=this.hls;x.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.off(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),x.off(B.Events.LEVEL_LOADING,this.onLevelLoading,this),x.off(B.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),x.off(B.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),x.off(B.Events.ERROR,this.onError,this)},I.onMediaAttached=function(x,P){if(this.media=P.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)},I.pollTrackChange=function(x){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,x)},I.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 x=r(this.media.textTracks);x.forEach(function(P){(0,n.clearCurrentCues)(P)}),this.subtitleTrack=-1,this.media=null},I.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},I.onManifestParsed=function(x,P){this.tracks=P.subtitleTracks},I.onSubtitleTrackLoaded=function(x,P){var T=P.id,A=P.details,b=this.trackId,C=this.tracksInGroup[b];if(!C){this.warn("Invalid subtitle track id "+T);return}var p=C.details;C.details=P.details,this.log("subtitle track "+T+" loaded ["+A.startSN+"-"+A.endSN+"]"),T===this.trackId&&(this.retryCount=0,this.playlistLoaded(T,P,p))},I.onLevelLoading=function(x,P){this.switchLevel(P.level)},I.onLevelSwitching=function(x,P){this.switchLevel(P.level)},I.switchLevel=function(x){var P=this.hls.levels[x];if(!(P!=null&&P.textGroupIds))return;var T=P.textGroupIds[P.urlId];if(this.groupId!==T){var A=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,b=this.tracks.filter(function(i){return!T||i.groupId===T});this.tracksInGroup=b;var C=this.findTrackId(A==null?void 0:A.name)||this.findTrackId();this.groupId=T;var p={subtitleTracks:b};this.log("Updating subtitle tracks, "+b.length+' track(s) found in "'+T+'" group-id'),this.hls.trigger(B.Events.SUBTITLE_TRACKS_UPDATED,p),C!==-1&&this.setSubtitleTrack(C,A)}},I.findTrackId=function(x){for(var P=this.tracksInGroup,T=0;T<P.length;T++){var A=P[T];if((!this.selectDefaultTrack||A.default)&&(!x||x===A.name))return A.id}return-1},I.onError=function(x,P){if(S.prototype.onError.call(this,x,P),P.fatal||!P.context)return;P.context.type===D.PlaylistContextType.SUBTITLE_TRACK&&P.context.id===this.trackId&&P.context.groupId===this.groupId&&this.retryLoadingOrFail(P)},I.loadPlaylist=function(x){S.prototype.loadPlaylist.call(this);var P=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(P)){var T=P.id,A=P.groupId,b=P.url;if(x)try{b=x.addDirectives(b)}catch(C){this.warn("Could not construct new URL with HLS Delivery Directives: "+C)}this.log("Loading subtitle playlist for id "+T),this.hls.trigger(B.Events.SUBTITLE_TRACK_LOADING,{url:b,id:T,groupId:A,deliveryDirectives:x||null})}},I.toggleTrackModes=function(x){var P=this,T=this.media,A=this.trackId;if(!T)return;var b=r(T.textTracks),C=b.filter(function(f){return f.groupId===P.groupId});if(x===-1)[].slice.call(b).forEach(function(f){f.mode="disabled"});else{var p=C[A];p&&(p.mode="disabled")}var i=C[x];i&&(i.mode=this.subtitleDisplay?"showing":"hidden")},I.setSubtitleTrack=function(x,P){var T,A=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=x;return}if(this.trackId!==x&&this.toggleTrackModes(x),this.trackId===x&&(x===-1||(T=A[x])!==null&&T!==void 0&&T.details)||x<-1||x>=A.length)return;this.clearTimer();var b=A[x];if(this.log("Switching to subtitle track "+x),this.trackId=x,b){var C=b.id,p=b.groupId,i=p===void 0?"":p,f=b.name,o=b.type,a=b.url;this.hls.trigger(B.Events.SUBTITLE_TRACK_SWITCH,{id:C,groupId:i,name:f,type:o,url:a});var L=this.switchParams(b.url,P==null?void 0:P.details);this.loadPlaylist(L)}else this.hls.trigger(B.Events.SUBTITLE_TRACK_SWITCH,{id:x})},I.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var x=-1,P=r(this.media.textTracks),T=0;T<P.length;T++)if(P[T].mode==="hidden")x=T;else if(P[T].mode==="showing"){x=T;break}this.subtitleTrack!==x&&(this.subtitleTrack=x)},d(w,[{key:"subtitleDisplay",get:function(){return this._subtitleDisplay},set:function(x){this._subtitleDisplay=x,this.trackId>-1&&this.toggleTrackModes(this.trackId)}},{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(x){this.selectDefaultTrack=!1;var P=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(x,P)}}]),w}(W.default);function r(S){for(var w=[],I=0;I<S.length;I++){var E=S[I];(E.kind==="subtitles"||E.kind==="captions")&&E.label&&w.push(S[I])}return w}const v=_},"./src/controller/timeline-controller.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{TimelineController:()=>_});var B=R("./src/polyfills/number.ts"),n=R("./src/events.ts"),W=R("./src/utils/cea-608-parser.ts"),D=R("./src/utils/output-filter.ts"),N=R("./src/utils/webvtt-parser.ts"),d=R("./src/utils/texttrack-utils.ts"),m=R("./src/utils/imsc1-ttml-parser.ts"),s=R("./src/utils/mp4-tools.ts"),g=R("./src/types/loader.ts"),h=R("./src/utils/logger.ts"),_=function(){function w(E){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=S(),this.captionsProperties=void 0,this.hls=E,this.config=E.config,this.Cues=E.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 x=new D.default(this,"textTrack1"),P=new D.default(this,"textTrack2"),T=new D.default(this,"textTrack3"),A=new D.default(this,"textTrack4");this.cea608Parser1=new W.default(1,x,P),this.cea608Parser2=new W.default(3,T,A)}E.on(n.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),E.on(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.on(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.on(n.Events.MANIFEST_LOADED,this.onManifestLoaded,this),E.on(n.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),E.on(n.Events.FRAG_LOADING,this.onFragLoading,this),E.on(n.Events.FRAG_LOADED,this.onFragLoaded,this),E.on(n.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),E.on(n.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),E.on(n.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),E.on(n.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),E.on(n.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var I=w.prototype;return I.destroy=function(){var x=this.hls;x.off(n.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),x.off(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.off(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.off(n.Events.MANIFEST_LOADED,this.onManifestLoaded,this),x.off(n.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),x.off(n.Events.FRAG_LOADING,this.onFragLoading,this),x.off(n.Events.FRAG_LOADED,this.onFragLoaded,this),x.off(n.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),x.off(n.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),x.off(n.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),x.off(n.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),x.off(n.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},I.addCues=function(x,P,T,A,b){for(var C=!1,p=b.length;p--;){var i=b[p],f=v(i[0],i[1],P,T);if(f>=0&&(i[0]=Math.min(i[0],P),i[1]=Math.max(i[1],T),C=!0,f/(T-P)>.5))return}if(C||b.push([P,T]),this.config.renderTextTracksNatively){var o=this.captionsTracks[x];this.Cues.newCue(o,P,T,A)}else{var a=this.Cues.newCue(null,P,T,A);this.hls.trigger(n.Events.CUES_PARSED,{type:"captions",cues:a,track:x})}},I.onInitPtsFound=function(x,P){var T=this,A=P.frag,b=P.id,C=P.initPTS,p=P.timescale,i=this.unparsedVttFrags;b==="main"&&(this.initPTS[A.cc]=C,this.timescale[A.cc]=p),i.length&&(this.unparsedVttFrags=[],i.forEach(function(f){T.onFragLoaded(n.Events.FRAG_LOADED,f)}))},I.getExistingTrack=function(x){var P=this.media;if(P)for(var T=0;T<P.textTracks.length;T++){var A=P.textTracks[T];if(A[x])return A}return null},I.createCaptionsTrack=function(x){this.config.renderTextTracksNatively?this.createNativeTrack(x):this.createNonNativeTrack(x)},I.createNativeTrack=function(x){if(this.captionsTracks[x])return;var P=this.captionsProperties,T=this.captionsTracks,A=this.media,b=P[x],C=b.label,p=b.languageCode,i=this.getExistingTrack(x);if(i)T[x]=i,(0,d.clearCurrentCues)(T[x]),(0,d.sendAddTrackEvent)(T[x],A);else{var f=this.createTextTrack("captions",C,p);f&&(f[x]=!0,T[x]=f)}},I.createNonNativeTrack=function(x){if(this.nonNativeCaptionsTracks[x])return;var P=this.captionsProperties[x];if(!P)return;var T=P.label,A={_id:x,label:T,kind:"captions",default:P.media?!!P.media.default:!1,closedCaptions:P.media};this.nonNativeCaptionsTracks[x]=A,this.hls.trigger(n.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[A]})},I.createTextTrack=function(x,P,T){var A=this.media;return A?A.addTextTrack(x,P,T):void 0},I.onMediaAttaching=function(x,P){this.media=P.media,this._cleanTracks()},I.onMediaDetaching=function(){var x=this.captionsTracks;Object.keys(x).forEach(function(P){(0,d.clearCurrentCues)(x[P]),delete x[P]}),this.nonNativeCaptionsTracks={}},I.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=S(),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())},I._cleanTracks=function(){var x=this.media;if(!x)return;var P=x.textTracks;if(P)for(var T=0;T<P.length;T++)(0,d.clearCurrentCues)(P[T])},I.onSubtitleTracksUpdated=function(x,P){var T=this;this.textTracks=[];var A=P.subtitleTracks||[],b=A.some(function(f){return f.textCodec===m.IMSC1_CODEC});if(this.config.enableWebVTT||b&&this.config.enableIMSC1){var C=this.tracks&&A&&this.tracks.length===A.length;if(this.tracks=A||[],this.config.renderTextTracksNatively){var p=this.media?this.media.textTracks:[];this.tracks.forEach(function(f,o){var a;if(o<p.length){for(var L=null,y=0;y<p.length;y++)if(r(p[y],f)){L=p[y];break}L&&(a=L)}if(a)(0,d.clearCurrentCues)(a);else{var l=T._captionsOrSubtitlesFromCharacteristics(f);a=T.createTextTrack(l,f.name,f.lang),a&&(a.mode="disabled")}a&&(a.groupId=f.groupId,T.textTracks.push(a))})}else if(!C&&this.tracks&&this.tracks.length){var i=this.tracks.map(function(f){return{label:f.name,kind:f.type.toLowerCase(),default:f.default,subtitleTrack:f}});this.hls.trigger(n.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:i})}}},I._captionsOrSubtitlesFromCharacteristics=function(x){var P;if((P=x.attrs)!==null&&P!==void 0&&P.CHARACTERISTICS){var T=/transcribes-spoken-dialog/gi.test(x.attrs.CHARACTERISTICS),A=/describes-music-and-sound/gi.test(x.attrs.CHARACTERISTICS);if(T&&A)return"captions"}return"subtitles"},I.onManifestLoaded=function(x,P){var T=this;this.config.enableCEA708Captions&&P.captions&&P.captions.forEach(function(A){var b=/(?:CC|SERVICE)([1-4])/.exec(A.instreamId);if(!b)return;var C="textTrack"+b[1],p=T.captionsProperties[C];if(!p)return;p.label=A.name,A.lang&&(p.languageCode=A.lang),p.media=A})},I.closedCaptionsForLevel=function(x){var P=this.hls.levels[x.level];return P==null?void 0:P.attrs["CLOSED-CAPTIONS"]},I.onFragLoading=function(x,P){var T=this.cea608Parser1,A=this.cea608Parser2,b=this.lastSn,C=this.lastPartIndex;if(!this.enabled||!(T&&A))return;if(P.frag.type===g.PlaylistLevelType.MAIN){var p,i,f=P.frag.sn,o=(p=P==null||((i=P.part)===null||i===void 0)?void 0:i.index)!=null?p:-1;f===b+1||f===b&&o===C+1||(T.reset(),A.reset()),this.lastSn=f,this.lastPartIndex=o}},I.onFragLoaded=function(x,P){var T=P.frag,A=P.payload,b=this.initPTS,C=this.unparsedVttFrags;if(T.type===g.PlaylistLevelType.SUBTITLE)if(A.byteLength){if(!(0,B.isFiniteNumber)(b[T.cc])){C.push(P),b.length&&this.hls.trigger(n.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:T,error:new Error("Missing initial subtitle PTS")});return}var p=T.decryptdata,i="stats"in P;if(p==null||!p.encrypted||i){var f=this.tracks[T.level],o=this.vttCCs;o[T.cc]||(o[T.cc]={start:T.start,prevCC:this.prevCC,new:!0},this.prevCC=T.cc),f&&f.textCodec===m.IMSC1_CODEC?this._parseIMSC1(T,A):this._parseVTTs(T,A,o)}}else this.hls.trigger(n.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:T,error:new Error("Empty subtitle payload")})},I._parseIMSC1=function(x,P){var T=this,A=this.hls;(0,m.parseIMSC1)(P,this.initPTS[x.cc],this.timescale[x.cc],function(b){T._appendCues(b,x.level),A.trigger(n.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:x})},function(b){h.logger.log("Failed to parse IMSC1: "+b),A.trigger(n.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:x,error:b})})},I._parseVTTs=function(x,P,T){var A,b=this,C=this.hls,p=(A=x.initSegment)!==null&&A!==void 0&&A.data?(0,s.appendUint8Array)(x.initSegment.data,new Uint8Array(P)):P;(0,N.parseWebVTT)(p,this.initPTS[x.cc],this.timescale[x.cc],T,x.cc,x.start,function(i){b._appendCues(i,x.level),C.trigger(n.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:x})},function(i){b._fallbackToIMSC1(x,P),h.logger.log("Failed to parse VTT cue: "+i),C.trigger(n.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:x,error:i})})},I._fallbackToIMSC1=function(x,P){var T=this,A=this.tracks[x.level];A.textCodec||(0,m.parseIMSC1)(P,this.initPTS[x.cc],this.timescale[x.cc],function(){A.textCodec=m.IMSC1_CODEC,T._parseIMSC1(x,P)},function(){A.textCodec="wvtt"})},I._appendCues=function(x,P){var T=this.hls;if(this.config.renderTextTracksNatively){var A=this.textTracks[P];if(!A||A.mode==="disabled")return;x.forEach(function(p){return(0,d.addCueToTrack)(A,p)})}else{var b=this.tracks[P];if(!b)return;var C=b.default?"default":"subtitles"+P;T.trigger(n.Events.CUES_PARSED,{type:"subtitles",cues:x,track:C})}},I.onFragDecrypted=function(x,P){var T=P.frag;if(T.type===g.PlaylistLevelType.SUBTITLE){if(!(0,B.isFiniteNumber)(this.initPTS[T.cc])){this.unparsedVttFrags.push(P);return}this.onFragLoaded(n.Events.FRAG_LOADED,P)}},I.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},I.onFragParsingUserdata=function(x,P){var T=this.cea608Parser1,A=this.cea608Parser2;if(!this.enabled||!(T&&A))return;var b=P.frag,C=P.samples;if(b.type===g.PlaylistLevelType.MAIN&&this.closedCaptionsForLevel(b)==="NONE")return;for(var p=0;p<C.length;p++){var i=C[p].bytes;if(i){var f=this.extractCea608Data(i);T.addData(C[p].pts,f[0]),A.addData(C[p].pts,f[1])}}},I.onBufferFlushing=function(x,P){var T=P.startOffset,A=P.endOffset,b=P.endOffsetSubtitles,C=P.type,p=this.media;if(!p||p.currentTime<A)return;if(!C||C==="video"){var i=this.captionsTracks;Object.keys(i).forEach(function(o){return(0,d.removeCuesInRange)(i[o],T,A)})}if(this.config.renderTextTracksNatively&&(T===0&&b!==void 0)){var f=this.textTracks;Object.keys(f).forEach(function(o){return(0,d.removeCuesInRange)(f[o],T,b)})}},I.extractCea608Data=function(x){for(var P=[[],[]],T=x[0]&31,A=2,b=0;b<T;b++){var C=x[A++],p=127&x[A++],i=127&x[A++];if(p===0&&i===0)continue;var f=(4&C)!==0;if(f){var o=3&C;(o===0||o===1)&&(P[o].push(p),P[o].push(i))}}return P},w}();function r(w,I){return w&&w.label===I.name&&!(w.textTrack1||w.textTrack2)}function v(w,I,E,x){return Math.min(I,x)-Math.max(w,E)}function S(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}},"./src/crypt/aes-crypto.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>B});var B=function(){function n(D,N){this.subtle=void 0,this.aesIV=void 0,this.subtle=D,this.aesIV=N}var W=n.prototype;return W.decrypt=function(N,d){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},d,N)},n}()},"./src/crypt/aes-decryptor.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>W,removePadding:()=>n});var B=R("./src/utils/typed-array.ts");function n(D){var N=D.byteLength,d=N&&new DataView(D.buffer).getUint8(N-1);return d?(0,B.sliceUint8)(D,0,N-d):D}var W=function(){function D(){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=D.prototype;return N.uint8ArrayToUint32Array_=function(m){for(var s=new DataView(m),g=new Uint32Array(4),h=0;h<4;h++)g[h]=s.getUint32(h*4);return g},N.initTable=function(){var m=this.sBox,s=this.invSBox,g=this.subMix,h=g[0],_=g[1],r=g[2],v=g[3],S=this.invSubMix,w=S[0],I=S[1],E=S[2],x=S[3],P=new Uint32Array(256),T=0,A=0,b=0;for(b=0;b<256;b++)b<128?P[b]=b<<1:P[b]=b<<1^283;for(b=0;b<256;b++){var C=A^A<<1^A<<2^A<<3^A<<4;C=C>>>8^C&255^99,m[T]=C,s[C]=T;var p=P[T],i=P[p],f=P[i],o=P[C]*257^C*16843008;h[T]=o<<24|o>>>8,_[T]=o<<16|o>>>16,r[T]=o<<8|o>>>24,v[T]=o,o=f*16843009^i*65537^p*257^T*16843008,w[C]=o<<24|o>>>8,I[C]=o<<16|o>>>16,E[C]=o<<8|o>>>24,x[C]=o,T?(T=p^P[P[P[f^p]]],A^=P[P[A]]):T=A=1}},N.expandKey=function(m){for(var s=this.uint8ArrayToUint32Array_(m),g=!0,h=0;h<s.length&&g;)g=s[h]===this.key[h],h++;if(g)return;this.key=s;var _=this.keySize=s.length;if(_!==4&&_!==6&&_!==8)throw new Error("Invalid aes key size="+_);var r=this.ksRows=(_+6+1)*4,v,S,w=this.keySchedule=new Uint32Array(r),I=this.invKeySchedule=new Uint32Array(r),E=this.sBox,x=this.rcon,P=this.invSubMix,T=P[0],A=P[1],b=P[2],C=P[3],p,i;for(v=0;v<r;v++){if(v<_){p=w[v]=s[v];continue}i=p,v%_===0?(i=i<<8|i>>>24,i=E[i>>>24]<<24|E[i>>>16&255]<<16|E[i>>>8&255]<<8|E[i&255],i^=x[v/_|0]<<24):_>6&&v%_===4&&(i=E[i>>>24]<<24|E[i>>>16&255]<<16|E[i>>>8&255]<<8|E[i&255]),w[v]=p=(w[v-_]^i)>>>0}for(S=0;S<r;S++)v=r-S,S&3?i=w[v]:i=w[v-4],S<4||v<=4?I[S]=i:I[S]=T[E[i>>>24]]^A[E[i>>>16&255]]^b[E[i>>>8&255]]^C[E[i&255]],I[S]=I[S]>>>0},N.networkToHostOrderSwap=function(m){return m<<24|(m&65280)<<8|(m&16711680)>>8|m>>>24},N.decrypt=function(m,s,g){for(var h=this.keySize+6,_=this.invKeySchedule,r=this.invSBox,v=this.invSubMix,S=v[0],w=v[1],I=v[2],E=v[3],x=this.uint8ArrayToUint32Array_(g),P=x[0],T=x[1],A=x[2],b=x[3],C=new Int32Array(m),p=new Int32Array(C.length),i,f,o,a,L,y,l,F,j,G,Y,te,de,ve,he=this.networkToHostOrderSwap;s<C.length;){for(j=he(C[s]),G=he(C[s+1]),Y=he(C[s+2]),te=he(C[s+3]),L=j^_[0],y=te^_[1],l=Y^_[2],F=G^_[3],de=4,ve=1;ve<h;ve++)i=S[L>>>24]^w[y>>16&255]^I[l>>8&255]^E[F&255]^_[de],f=S[y>>>24]^w[l>>16&255]^I[F>>8&255]^E[L&255]^_[de+1],o=S[l>>>24]^w[F>>16&255]^I[L>>8&255]^E[y&255]^_[de+2],a=S[F>>>24]^w[L>>16&255]^I[y>>8&255]^E[l&255]^_[de+3],L=i,y=f,l=o,F=a,de=de+4;i=r[L>>>24]<<24^r[y>>16&255]<<16^r[l>>8&255]<<8^r[F&255]^_[de],f=r[y>>>24]<<24^r[l>>16&255]<<16^r[F>>8&255]<<8^r[L&255]^_[de+1],o=r[l>>>24]<<24^r[F>>16&255]<<16^r[L>>8&255]<<8^r[y&255]^_[de+2],a=r[F>>>24]<<24^r[L>>16&255]<<16^r[y>>8&255]<<8^r[l&255]^_[de+3],p[s]=he(i^P),p[s+1]=he(a^T),p[s+2]=he(o^A),p[s+3]=he(f^b),P=j,T=G,A=Y,b=te,s=s+4}return p.buffer},D}()},"./src/crypt/decrypter.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>s});var B=R("./src/crypt/aes-crypto.ts"),n=R("./src/crypt/fast-aes-key.ts"),W=R("./src/crypt/aes-decryptor.ts"),D=R("./src/utils/logger.ts"),N=R("./src/utils/mp4-tools.ts"),d=R("./src/utils/typed-array.ts"),m=16,s=function(){function g(_,r){var v=r===void 0?{}:r,S=v.removePKCS7Padding,w=S===void 0?!0:S;if(this.logEnabled=!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.useSoftware=void 0,this.useSoftware=_.enableSoftwareAES,this.removePKCS7Padding=w,w)try{var I=self.crypto;I&&(this.subtle=I.subtle||I.webkitSubtle)}catch(E){}this.subtle===null&&(this.useSoftware=!0)}var h=g.prototype;return h.destroy=function(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null},h.isSync=function(){return this.useSoftware},h.flush=function(){var r=this.currentResult,v=this.remainderData;if(!r||v)return this.reset(),null;var S=new Uint8Array(r);return this.reset(),this.removePKCS7Padding?(0,W.removePadding)(S):S},h.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},h.decrypt=function(r,v,S){var w=this;return this.useSoftware?new Promise(function(I,E){w.softwareDecrypt(new Uint8Array(r),v,S);var x=w.flush();x?I(x.buffer):E(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(r),v,S)},h.softwareDecrypt=function(r,v,S){var w=this.currentIV,I=this.currentResult,E=this.remainderData;this.logOnce("JS AES decrypt"),E&&(r=(0,N.appendUint8Array)(E,r),this.remainderData=null);var x=this.getValidChunk(r);if(!x.length)return null;w&&(S=w);var P=this.softwareDecrypter;P||(P=this.softwareDecrypter=new W.default),P.expandKey(v);var T=I;return this.currentResult=P.decrypt(x.buffer,0,S),this.currentIV=(0,d.sliceUint8)(x,-16).buffer,T||null},h.webCryptoDecrypt=function(r,v,S){var w=this,I=this.subtle;return(this.key!==v||!this.fastAesKey)&&(this.key=v,this.fastAesKey=new n.default(I,v)),this.fastAesKey.expandKey().then(function(E){if(!I)return Promise.reject(new Error("web crypto not initialized"));w.logOnce("WebCrypto AES decrypt");var x=new B.default(I,new Uint8Array(S));return x.decrypt(r.buffer,E)}).catch(function(E){return D.logger.warn("[decrypter]: WebCrypto Error, disable WebCrypto API, "+E.name+": "+E.message),w.onWebCryptoError(r,v,S)})},h.onWebCryptoError=function(r,v,S){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(r,v,S);var w=this.flush();if(w)return w.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")},h.getValidChunk=function(r){var v=r,S=r.length-r.length%m;return S!==r.length&&(v=(0,d.sliceUint8)(r,0,S),this.remainderData=(0,d.sliceUint8)(r,S)),v},h.logOnce=function(r){if(!this.logEnabled)return;D.logger.log("[decrypter]: "+r),this.logEnabled=!1},g}()},"./src/crypt/fast-aes-key.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>B});var B=function(){function n(D,N){this.subtle=void 0,this.key=void 0,this.subtle=D,this.key=N}var W=n.prototype;return W.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},n}()},"./src/demux/aacdemuxer.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>s});var B=R("./src/demux/base-audio-demuxer.ts"),n=R("./src/demux/adts.ts"),W=R("./src/utils/logger.ts"),D=R("./src/demux/id3.ts");function N(g,h){g.prototype=Object.create(h.prototype),g.prototype.constructor=g,d(g,h)}function d(g,h){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,v){return r.__proto__=v,r},d(g,h)}var m=function(g){N(h,g);function h(r,v){var S;return S=g.call(this)||this,S.observer=void 0,S.config=void 0,S.observer=r,S.config=v,S}var _=h.prototype;return _.resetInitSegment=function(v,S,w,I){g.prototype.resetInitSegment.call(this,v,S,w,I),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:S,duration:I,inputTimeScale:9e4,dropped:0}},h.probe=function(v){if(!v)return!1;for(var S=D.getID3Data(v,0)||[],w=S.length,I=v.length;w<I;w++)if(n.probe(v,w))return W.logger.log("ADTS sync word found !"),!0;return!1},_.canParse=function(v,S){return n.canParse(v,S)},_.appendFrame=function(v,S,w){n.initTrackConfig(v,this.observer,S,w,v.manifestCodec);var I=n.appendFrame(v,S,w,this.basePTS,this.frameIndex);if(I&&I.missing===0)return I},h}(B.default);const s=m},"./src/demux/adts.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{appendFrame:()=>w,canGetFrameLength:()=>s,canParse:()=>h,getAudioConfig:()=>D,getFrameDuration:()=>v,getFullFrameLength:()=>m,getHeaderLength:()=>d,initTrackConfig:()=>r,isHeader:()=>g,isHeaderPattern:()=>N,parseFrameHeader:()=>S,probe:()=>_});var B=R("./src/utils/logger.ts"),n=R("./src/errors.ts"),W=R("./src/events.ts");function D(I,E,x,P){var T,A,b,C,p=navigator.userAgent.toLowerCase(),i=P,f=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];T=((E[x+2]&192)>>>6)+1;var o=(E[x+2]&60)>>>2;if(o>f.length-1){I.trigger(W.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+o});return}return b=(E[x+2]&1)<<2,b|=(E[x+3]&192)>>>6,B.logger.log("manifest codec:"+P+", ADTS type:"+T+", samplingIndex:"+o),/firefox/i.test(p)?o>=6?(T=5,C=new Array(4),A=o-3):(T=2,C=new Array(2),A=o):p.indexOf("android")!==-1?(T=2,C=new Array(2),A=o):(T=5,C=new Array(4),P&&(P.indexOf("mp4a.40.29")!==-1||P.indexOf("mp4a.40.5")!==-1)||!P&&o>=6?A=o-3:((P&&P.indexOf("mp4a.40.2")!==-1&&(o>=6&&b===1||/vivaldi/i.test(p))||!P&&b===1)&&(T=2,C=new Array(2)),A=o)),C[0]=T<<3,C[0]|=(o&14)>>1,C[1]|=(o&1)<<7,C[1]|=b<<3,T===5&&(C[1]|=(A&14)>>1,C[2]=(A&1)<<7,C[2]|=2<<2,C[3]=0),{config:C,samplerate:f[o],channelCount:b,codec:"mp4a.40."+T,manifestCodec:i}}function N(I,E){return I[E]===255&&(I[E+1]&246)===240}function d(I,E){return I[E+1]&1?7:9}function m(I,E){return(I[E+3]&3)<<11|I[E+4]<<3|(I[E+5]&224)>>>5}function s(I,E){return E+5<I.length}function g(I,E){return E+1<I.length&&N(I,E)}function h(I,E){return s(I,E)&&N(I,E)&&m(I,E)<=I.length-E}function _(I,E){if(g(I,E)){var x=d(I,E);if(E+x>=I.length)return!1;var P=m(I,E);if(P<=x)return!1;var T=E+P;return T===I.length||g(I,T)}return!1}function r(I,E,x,P,T){if(!I.samplerate){var A=D(E,x,P,T);if(!A)return;I.config=A.config,I.samplerate=A.samplerate,I.channelCount=A.channelCount,I.codec=A.codec,I.manifestCodec=A.manifestCodec,B.logger.log("parsed codec:"+I.codec+", rate:"+A.samplerate+", channels:"+A.channelCount)}}function v(I){return 1024*9e4/I}function S(I,E){var x=d(I,E);if(E+x<=I.length){var P=m(I,E)-x;if(P>0)return{headerLength:x,frameLength:P}}}function w(I,E,x,P,T){var A=v(I.samplerate),b=P+T*A,C=S(E,x),p;if(C){var i=C.frameLength,f=C.headerLength,o=f+i,a=Math.max(0,x+o-E.length);a?(p=new Uint8Array(o-f),p.set(E.subarray(x+f,E.length),0)):p=E.subarray(x+f,x+o);var L={unit:p,pts:b};return a||I.samples.push(L),{sample:L,length:o,missing:a}}var y=E.length-x;p=new Uint8Array(y),p.set(E.subarray(x,E.length),0);var l={unit:p,pts:b};return{sample:l,length:y,missing:-1}}},"./src/demux/base-audio-demuxer.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>g,initPTSFn:()=>s});var B=R("./src/polyfills/number.ts"),n=R("./src/demux/id3.ts"),W=R("./src/types/demuxer.ts"),D=R("./src/demux/dummy-demuxed-track.ts"),N=R("./src/utils/mp4-tools.ts"),d=R("./src/utils/typed-array.ts"),m=function(){function h(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}var _=h.prototype;return _.resetInitSegment=function(v,S,w,I){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},_.resetTimeStamp=function(v){this.initPTS=v,this.resetContiguity()},_.resetContiguity=function(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0},_.canParse=function(v,S){return!1},_.appendFrame=function(v,S,w){},_.demux=function(v,S){this.cachedData&&(v=(0,N.appendUint8Array)(this.cachedData,v),this.cachedData=null);var w=n.getID3Data(v,0),I=w?w.length:0,E,x=this._audioTrack,P=this._id3Track,T=w?n.getTimeStamp(w):void 0,A=v.length;for((this.basePTS===null||this.frameIndex===0&&(0,B.isFiniteNumber)(T))&&(this.basePTS=s(T,S,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),w&&w.length>0&&P.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:w,type:W.MetadataSchema.audioId3,duration:Number.POSITIVE_INFINITY});I<A;){if(this.canParse(v,I)){var b=this.appendFrame(x,v,I);b?(this.frameIndex++,this.lastPTS=b.sample.pts,I+=b.length,E=I):I=A}else n.canParse(v,I)?(w=n.getID3Data(v,I),P.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:w,type:W.MetadataSchema.audioId3,duration:Number.POSITIVE_INFINITY}),I+=w.length,E=I):I++;if(I===A&&E!==A){var C=(0,d.sliceUint8)(v,E);this.cachedData?this.cachedData=(0,N.appendUint8Array)(this.cachedData,C):this.cachedData=C}}return{audioTrack:x,videoTrack:(0,D.dummyTrack)(),id3Track:P,textTrack:(0,D.dummyTrack)()}},_.demuxSampleAes=function(v,S,w){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},_.flush=function(v){var S=this.cachedData;return S&&(this.cachedData=null,this.demux(S,0)),{audioTrack:this._audioTrack,videoTrack:(0,D.dummyTrack)(),id3Track:this._id3Track,textTrack:(0,D.dummyTrack)()}},_.destroy=function(){},h}(),s=function(_,r,v){return(0,B.isFiniteNumber)(_)?_*90:r*9e4+(v||0)};const g=m},"./src/demux/chunk-cache.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>B});var B=function(){function W(){this.chunks=[],this.dataLength=0}var D=W.prototype;return D.push=function(d){this.chunks.push(d),this.dataLength+=d.length},D.flush=function(){var d=this.chunks,m=this.dataLength,s;if(d.length)d.length===1?s=d[0]:s=n(d,m);else return new Uint8Array(0);return this.reset(),s},D.reset=function(){this.chunks.length=0,this.dataLength=0},W}();function n(W,D){for(var N=new Uint8Array(D),d=0,m=0;m<W.length;m++){var s=W[m];N.set(s,d),d+=s.length}return N}},"./src/demux/dummy-demuxed-track.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{dummyTrack:()=>B});function B(n,W){return n===void 0&&(n=""),W===void 0&&(W=9e4),{type:n,id:-1,pid:-1,inputTimeScale:W,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>W});var B=R("./src/utils/logger.ts"),n=function(){function D(d){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=d,this.bytesAvailable=d.byteLength,this.word=0,this.bitsAvailable=0}var N=D.prototype;return N.loadWord=function(){var m=this.data,s=this.bytesAvailable,g=m.byteLength-s,h=new Uint8Array(4),_=Math.min(4,s);if(_===0)throw new Error("no bytes available");h.set(m.subarray(g,g+_)),this.word=new DataView(h.buffer).getUint32(0),this.bitsAvailable=_*8,this.bytesAvailable-=_},N.skipBits=function(m){var s;m=Math.min(m,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>m?(this.word<<=m,this.bitsAvailable-=m):(m-=this.bitsAvailable,s=m>>3,m-=s<<3,this.bytesAvailable-=s,this.loadWord(),this.word<<=m,this.bitsAvailable-=m)},N.readBits=function(m){var s=Math.min(this.bitsAvailable,m),g=this.word>>>32-s;if(m>32&&B.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=s,this.bitsAvailable>0)this.word<<=s;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return s=m-s,s>0&&this.bitsAvailable?g<<s|this.readBits(s):g},N.skipLZ=function(){var m;for(m=0;m<this.bitsAvailable;++m)if((this.word&2147483648>>>m)!==0)return this.word<<=m,this.bitsAvailable-=m,m;return this.loadWord(),m+this.skipLZ()},N.skipUEG=function(){this.skipBits(1+this.skipLZ())},N.skipEG=function(){this.skipBits(1+this.skipLZ())},N.readUEG=function(){var m=this.skipLZ();return this.readBits(m+1)-1},N.readEG=function(){var m=this.readUEG();return 1&m?1+m>>>1:-1*(m>>>1)},N.readBoolean=function(){return this.readBits(1)===1},N.readUByte=function(){return this.readBits(8)},N.readUShort=function(){return this.readBits(16)},N.readUInt=function(){return this.readBits(32)},N.skipScalingList=function(m){for(var s=8,g=8,h,_=0;_<m;_++)g!==0&&(h=this.readEG(),g=(s+h+256)%256),s=g===0?s:g},N.readSPS=function(){var m=0,s=0,g=0,h=0,_,r,v,S=this.readUByte.bind(this),w=this.readBits.bind(this),I=this.readUEG.bind(this),E=this.readBoolean.bind(this),x=this.skipBits.bind(this),P=this.skipEG.bind(this),T=this.skipUEG.bind(this),A=this.skipScalingList.bind(this);S();var b=S();if(w(5),x(3),S(),T(),b===100||b===110||b===122||b===244||b===44||b===83||b===86||b===118||b===128){var C=I();if(C===3&&x(1),T(),T(),x(1),E())for(r=C!==3?8:12,v=0;v<r;v++)E()&&(v<6?A(16):A(64))}T();var p=I();if(p===0)I();else if(p===1)for(x(1),P(),P(),_=I(),v=0;v<_;v++)P();T(),x(1);var i=I(),f=I(),o=w(1);o===0&&x(1),x(1),E()&&(m=I(),s=I(),g=I(),h=I());var a=[1,1];if(E()&&E()){var L=S();switch(L){case 1:a=[1,1];break;case 2:a=[12,11];break;case 3:a=[10,11];break;case 4:a=[16,11];break;case 5:a=[40,33];break;case 6:a=[24,11];break;case 7:a=[20,11];break;case 8:a=[32,11];break;case 9:a=[80,33];break;case 10:a=[18,11];break;case 11:a=[15,11];break;case 12:a=[64,33];break;case 13:a=[160,99];break;case 14:a=[4,3];break;case 15:a=[3,2];break;case 16:a=[2,1];break;case 255:{a=[S()<<8|S(),S()<<8|S()];break}}}return{width:Math.ceil((i+1)*16-m*2-s*2),height:(2-o)*(f+1)*16-(o?2:4)*(g+h),pixelRatio:a}},N.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},D}();const W=n},"./src/demux/id3.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{canParse:()=>N,decodeFrame:()=>h,getID3Data:()=>W,getID3Frames:()=>g,getTimeStamp:()=>d,isFooter:()=>n,isHeader:()=>B,isTimeStampFrame:()=>m,testables:()=>I,utf8ArrayToStr:()=>w});var B=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)))},n=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)))},W=function(T,A){for(var b=A,C=0;B(T,A);){C+=10;var p=D(T,A+6);C+=p,n(T,A+10)&&(C+=10),A+=C}return C>0?T.subarray(b,b+C):void 0},D=function(T,A){var b=0;return b=(T[A]&127)<<21,b|=(T[A+1]&127)<<14,b|=(T[A+2]&127)<<7,b|=T[A+3]&127,b},N=function(T,A){return B(T,A)&&D(T,A+6)+10<=T.length-A},d=function(T){for(var A=g(T),b=0;b<A.length;b++){var C=A[b];if(m(C))return S(C)}return},m=function(T){return T&&T.key==="PRIV"&&T.info==="com.apple.streaming.transportStreamTimestamp"},s=function(T){var A=String.fromCharCode(T[0],T[1],T[2],T[3]),b=D(T,4),C=10;return{type:A,size:b,data:T.subarray(C,C+b)}},g=function(T){for(var A=0,b=[];B(T,A);){var C=D(T,A+6);A+=10;for(var p=A+C;A+8<p;){var i=s(T.subarray(A)),f=h(i);f&&b.push(f),A+=i.size+10}n(T,A)&&(A+=10)}return b},h=function(T){return T.type==="PRIV"?_(T):T.type[0]==="W"?v(T):r(T)},_=function(T){if(T.size<2)return;var A=w(T.data,!0),b=new Uint8Array(T.data.subarray(A.length+1));return{key:T.type,info:A,data:b.buffer}},r=function(T){if(T.size<2)return;if(T.type==="TXXX"){var A=1,b=w(T.data.subarray(A),!0);A+=b.length+1;var C=w(T.data.subarray(A));return{key:T.type,info:b,data:C}}var p=w(T.data.subarray(1));return{key:T.type,data:p}},v=function(T){if(T.type==="WXXX"){if(T.size<2)return;var A=1,b=w(T.data.subarray(A),!0);A+=b.length+1;var C=w(T.data.subarray(A));return{key:T.type,info:b,data:C}}var p=w(T.data);return{key:T.type,data:p}},S=function(T){if(T.data.byteLength===8){var A=new Uint8Array(T.data),b=A[3]&1,C=(A[4]<<23)+(A[5]<<15)+(A[6]<<7)+A[7];return C/=45,b&&(C+=4772185884e-2),Math.round(C)}return},w=function(T,A){A===void 0&&(A=!1);var b=x();if(b){var C=b.decode(T);if(A){var p=C.indexOf("\0");return p!==-1?C.substring(0,p):C}return C.replace(/\0/g,"")}for(var i=T.length,f,o,a,L="",y=0;y<i;){if(f=T[y++],f===0&&A)return L;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:L+=String.fromCharCode(f);break;case 12:case 13:o=T[y++],L+=String.fromCharCode((f&31)<<6|o&63);break;case 14:o=T[y++],a=T[y++],L+=String.fromCharCode((f&15)<<12|(o&63)<<6|(a&63)<<0);break;default:}}return L},I={decodeTextFrame:r},E;function x(){return!E&&typeof self.TextDecoder!="undefined"&&(E=new self.TextDecoder("utf-8")),E}},"./src/demux/mp3demuxer.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>s});var B=R("./src/demux/base-audio-demuxer.ts"),n=R("./src/demux/id3.ts"),W=R("./src/utils/logger.ts"),D=R("./src/demux/mpegaudio.ts");function N(g,h){g.prototype=Object.create(h.prototype),g.prototype.constructor=g,d(g,h)}function d(g,h){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,v){return r.__proto__=v,r},d(g,h)}var m=function(g){N(h,g);function h(){return g.apply(this,arguments)||this}var _=h.prototype;return _.resetInitSegment=function(v,S,w,I){g.prototype.resetInitSegment.call(this,v,S,w,I),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:S,duration:I,inputTimeScale:9e4,dropped:0}},h.probe=function(v){if(!v)return!1;for(var S=n.getID3Data(v,0)||[],w=S.length,I=v.length;w<I;w++)if(D.probe(v,w))return W.logger.log("MPEG Audio sync word found !"),!0;return!1},_.canParse=function(v,S){return D.canParse(v,S)},_.appendFrame=function(v,S,w){return this.basePTS===null?void 0:D.appendFrame(v,S,w,this.basePTS,this.frameIndex)},h}(B.default);const s=m},"./src/demux/mp4demuxer.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>m});var B=R("./src/polyfills/number.ts"),n=R("./src/types/demuxer.ts"),W=R("./src/utils/mp4-tools.ts"),D=R("./src/demux/dummy-demuxed-track.ts"),N=/\/emsg[-/]ID3/i,d=function(){function s(h,_){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=_}var g=s.prototype;return g.resetTimeStamp=function(){},g.resetInitSegment=function(_,r,v,S){var w=this.videoTrack=(0,D.dummyTrack)("video",1),I=this.audioTrack=(0,D.dummyTrack)("audio",1),E=this.txtTrack=(0,D.dummyTrack)("text",1);if(this.id3Track=(0,D.dummyTrack)("id3",1),this.timeOffset=0,!_||!_.byteLength)return;var x=(0,W.parseInitSegment)(_);if(x.video){var P=x.video,T=P.id,A=P.timescale,b=P.codec;w.id=T,w.timescale=E.timescale=A,w.codec=b}if(x.audio){var C=x.audio,p=C.id,i=C.timescale,f=C.codec;I.id=p,I.timescale=i,I.codec=f}E.id=W.RemuxerTrackIdConfig.text,w.sampleDuration=0,w.duration=I.duration=S},g.resetContiguity=function(){},s.probe=function(_){return _=_.length>16384?_.subarray(0,16384):_,(0,W.findBox)(_,["moof"]).length>0},g.demux=function(_,r){this.timeOffset=r;var v=_,S=this.videoTrack,w=this.txtTrack;if(this.config.progressive){this.remainderData&&(v=(0,W.appendUint8Array)(this.remainderData,_));var I=(0,W.segmentValidRange)(v);this.remainderData=I.remainder,S.samples=I.valid||new Uint8Array}else S.samples=v;var E=this.extractID3Track(S,r);return w.samples=(0,W.parseSamples)(r,S),{videoTrack:S,audioTrack:this.audioTrack,id3Track:E,textTrack:this.txtTrack}},g.flush=function(){var _=this.timeOffset,r=this.videoTrack,v=this.txtTrack;r.samples=this.remainderData||new Uint8Array,this.remainderData=null;var S=this.extractID3Track(r,this.timeOffset);return v.samples=(0,W.parseSamples)(_,r),{videoTrack:r,audioTrack:(0,D.dummyTrack)(),id3Track:S,textTrack:(0,D.dummyTrack)()}},g.extractID3Track=function(_,r){var v=this.id3Track;if(_.samples.length){var S=(0,W.findBox)(_.samples,["emsg"]);S&&S.forEach(function(w){var I=(0,W.parseEmsg)(w);if(N.test(I.schemeIdUri)){var E=(0,B.isFiniteNumber)(I.presentationTime)?I.presentationTime/I.timeScale:r+I.presentationTimeDelta/I.timeScale,x=I.eventDuration===4294967295?Number.POSITIVE_INFINITY:I.eventDuration/I.timeScale;x<=.001&&(x=Number.POSITIVE_INFINITY);var P=I.payload;v.samples.push({data:P,len:P.byteLength,dts:E,pts:E,type:n.MetadataSchema.emsg,duration:x})}})}return v},g.demuxSampleAes=function(_,r,v){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},g.destroy=function(){},s}();const m=d},"./src/demux/mpegaudio.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{appendFrame:()=>d,canParse:()=>h,isHeader:()=>g,isHeaderPattern:()=>s,parseHeader:()=>m,probe:()=>_});var B=null,n=[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],W=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],D=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],N=[0,1,1,4];function d(r,v,S,w,I){if(S+24>v.length)return;var E=m(v,S);if(E&&S+E.frameLength<=v.length){var x=E.samplesPerFrame*9e4/E.sampleRate,P=w+I*x,T={unit:v.subarray(S,S+E.frameLength),pts:P,dts:P};return r.config=[],r.channelCount=E.channelCount,r.samplerate=E.sampleRate,r.samples.push(T),{sample:T,length:E.frameLength,missing:0}}}function m(r,v){var S=r[v+1]>>3&3,w=r[v+1]>>1&3,I=r[v+2]>>4&15,E=r[v+2]>>2&3;if(S!==1&&I!==0&&I!==15&&E!==3){var x=r[v+2]>>1&1,P=r[v+3]>>6,T=S===3?3-w:w===3?3:4,A=n[T*14+I-1]*1e3,b=S===3?0:S===2?1:2,C=W[b*3+E],p=P===3?1:2,i=D[S][w],f=N[w],o=i*8*f,a=Math.floor(i*A/C+x)*f;if(B===null){var L=navigator.userAgent||"",y=L.match(/Chrome\/(\d+)/i);B=y?parseInt(y[1]):0}var l=!!B&&B<=87;return l&&w===2&&A>=224e3&&P===0&&(r[v+3]=r[v+3]|128),{sampleRate:C,channelCount:p,frameLength:a,samplesPerFrame:o}}}function s(r,v){return r[v]===255&&(r[v+1]&224)===224&&(r[v+1]&6)!==0}function g(r,v){return v+1<r.length&&s(r,v)}function h(r,v){var S=4;return s(r,v)&&S<=r.length-v}function _(r,v){if(v+1<r.length&&s(r,v)){var S=4,w=m(r,v),I=S;w!=null&&w.frameLength&&(I=w.frameLength);var E=v+I;return E===r.length||g(r,E)}return!1}},"./src/demux/sample-aes.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>D});var B=R("./src/crypt/decrypter.ts"),n=R("./src/utils/mp4-tools.ts"),W=function(){function N(m,s,g){this.keyData=void 0,this.decrypter=void 0,this.keyData=g,this.decrypter=new B.default(s,{removePKCS7Padding:!1})}var d=N.prototype;return d.decryptBuffer=function(s){return this.decrypter.decrypt(s,this.keyData.key.buffer,this.keyData.iv.buffer)},d.decryptAacSample=function(s,g,h){var _=this,r=s[g].unit;if(r.length<=16)return;var v=r.subarray(16,r.length-r.length%16),S=v.buffer.slice(v.byteOffset,v.byteOffset+v.length);this.decryptBuffer(S).then(function(w){var I=new Uint8Array(w);r.set(I,16),_.decrypter.isSync()||_.decryptAacSamples(s,g+1,h)})},d.decryptAacSamples=function(s,g,h){for(;;g++){if(g>=s.length){h();return}if(s[g].unit.length<32)continue;if(this.decryptAacSample(s,g,h),!this.decrypter.isSync())return}},d.getAvcEncryptedData=function(s){for(var g=Math.floor((s.length-48)/160)*16+16,h=new Int8Array(g),_=0,r=32;r<s.length-16;r+=160,_+=16)h.set(s.subarray(r,r+16),_);return h},d.getAvcDecryptedUnit=function(s,g){for(var h=new Uint8Array(g),_=0,r=32;r<s.length-16;r+=160,_+=16)s.set(h.subarray(_,_+16),r);return s},d.decryptAvcSample=function(s,g,h,_,r){var v=this,S=(0,n.discardEPB)(r.data),w=this.getAvcEncryptedData(S);this.decryptBuffer(w.buffer).then(function(I){r.data=v.getAvcDecryptedUnit(S,I),v.decrypter.isSync()||v.decryptAvcSamples(s,g,h+1,_)})},d.decryptAvcSamples=function(s,g,h,_){if(s instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;g++,h=0){if(g>=s.length){_();return}for(var r=s[g].units;!(h>=r.length);h++){var v=r[h];if(v.data.length<=48||v.type!==1&&v.type!==5)continue;if(this.decryptAvcSample(s,g,h,_,v),!this.decrypter.isSync())return}}},N}();const D=W},"./src/demux/transmuxer-interface.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>h});var B=R("./src/demux/webworkify-webpack.js"),n=R("./src/events.ts"),W=R("./src/demux/transmuxer.ts"),D=R("./src/utils/logger.ts"),N=R("./src/errors.ts"),d=R("./src/utils/mediasource-helper.ts"),m=R("./node_modules/eventemitter3/index.js"),s=R.n(m),g=(0,d.getMediaSource)()||{isTypeSupported:function(){return!1}},h=function(){function _(v,S,w,I){var E=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;var x=v.config;this.hls=v,this.id=S,this.useWorker=!!x.enableWorker,this.onTransmuxComplete=w,this.onFlush=I;var P=function(p,i){i=i||{},i.frag=E.frag,i.id=E.id,E.hls.trigger(p,i)};this.observer=new m.EventEmitter,this.observer.on(n.Events.FRAG_DECRYPTED,P),this.observer.on(n.Events.ERROR,P);var T={mp4:g.isTypeSupported("video/mp4"),mpeg:g.isTypeSupported("audio/mpeg"),mp3:g.isTypeSupported('audio/mp4; codecs="mp3"')},A=navigator.vendor;if(this.useWorker&&typeof Worker!="undefined"){D.logger.log("demuxing in webworker");var b;try{b=this.worker=(0,B.default)("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),b.addEventListener("message",this.onwmsg),b.onerror=function(C){E.useWorker=!1,D.logger.warn("Exception in webworker, fallback to inline"),E.hls.trigger(n.Events.ERROR,{type:N.ErrorTypes.OTHER_ERROR,details:N.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:new Error(C.message+" ("+C.filename+":"+C.lineno+")")})},b.postMessage({cmd:"init",typeSupported:T,vendor:A,id:S,config:JSON.stringify(x)})}catch(C){D.logger.warn("Error in worker:",C),D.logger.error("Error while initializing DemuxerWorker, fallback to inline"),b&&self.URL.revokeObjectURL(b.objectURL),this.transmuxer=new W.default(this.observer,T,x,A,S),this.worker=null}}else this.transmuxer=new W.default(this.observer,T,x,A,S)}var r=_.prototype;return r.destroy=function(){var S=this.worker;if(S)S.removeEventListener("message",this.onwmsg),S.terminate(),this.worker=null,this.onwmsg=void 0;else{var w=this.transmuxer;w&&(w.destroy(),this.transmuxer=null)}var I=this.observer;I&&I.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null},r.push=function(S,w,I,E,x,P,T,A,b,C){var p,i,f=this;b.transmuxing.start=self.performance.now();var o=this.transmuxer,a=this.worker,L=P?P.start:x.start,y=x.decryptdata,l=this.frag,F=!(l&&x.cc===l.cc),j=!(l&&b.level===l.level),G=l?b.sn-l.sn:-1,Y=this.part?b.part-this.part.index:-1,te=G===0&&b.id>1&&b.id===(l==null?void 0:l.stats.chunkCount),de=!j&&(G===1||G===0&&(Y===1||te&&Y<=0)),ve=self.performance.now();(j||G||x.stats.parsing.start===0)&&(x.stats.parsing.start=ve),P&&(Y||!de)&&(P.stats.parsing.start=ve);var he=!(l&&((p=x.initSegment)===null||p===void 0?void 0:p.url)===((i=l.initSegment)===null||i===void 0?void 0:i.url)),Re=new W.TransmuxState(F,de,A,j,L,he);if(!de||F||he){D.logger.log("[transmuxer-interface, "+x.type+"]: Starting new transmux session for sn: "+b.sn+" p: "+b.part+" level: "+b.level+" id: "+b.id+`
discontinuity: `+F+`
trackSwitch: `+j+`
contiguous: `+de+`
accurateTimeOffset: `+A+`
timeOffset: `+L+`
initSegmentChange: `+he);var we=new W.TransmuxConfig(I,E,w,T,C);this.configureTransmuxer(we)}if(this.frag=x,this.part=P,a)a.postMessage({cmd:"demux",data:S,decryptdata:y,chunkMeta:b,state:Re},S instanceof ArrayBuffer?[S]:[]);else if(o){var ge=o.push(S,y,b,Re);(0,W.isPromise)(ge)?(o.async=!0,ge.then(function(Ne){f.handleTransmuxComplete(Ne)}).catch(function(Ne){f.transmuxerError(Ne,b,"transmuxer-interface push error")})):(o.async=!1,this.handleTransmuxComplete(ge))}},r.flush=function(S){var w=this;S.transmuxing.start=self.performance.now();var I=this.transmuxer,E=this.worker;if(E)E.postMessage({cmd:"flush",chunkMeta:S});else if(I){var x=I.flush(S),P=(0,W.isPromise)(x);P||I.async?((0,W.isPromise)(x)||(x=Promise.resolve(x)),x.then(function(T){w.handleFlushResult(T,S)}).catch(function(T){w.transmuxerError(T,S,"transmuxer-interface flush error")})):this.handleFlushResult(x,S)}},r.transmuxerError=function(S,w,I){if(!this.hls)return;this.hls.trigger(n.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.FRAG_PARSING_ERROR,chunkMeta:w,fatal:!1,error:S,err:S,reason:I})},r.handleFlushResult=function(S,w){var I=this;S.forEach(function(E){I.handleTransmuxComplete(E)}),this.onFlush(w)},r.onWorkerMessage=function(S){var w=S.data,I=this.hls;switch(w.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(w.data);break}case"flush":{this.onFlush(w.data);break}case"workerLog":D.logger[w.data.logType]&&D.logger[w.data.logType](w.data.message);break;default:{w.data=w.data||{},w.data.frag=this.frag,w.data.id=this.id,I.trigger(w.event,w.data);break}}},r.configureTransmuxer=function(S){var w=this.worker,I=this.transmuxer;w?w.postMessage({cmd:"configure",config:S}):I&&I.configure(S)},r.handleTransmuxComplete=function(S){S.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(S)},_}()},"./src/demux/transmuxer-worker.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>m});var B=R("./src/demux/transmuxer.ts"),n=R("./src/events.ts"),W=R("./src/utils/logger.ts"),D=R("./node_modules/eventemitter3/index.js"),N=R.n(D),d=R("./src/errors.ts");function m(r){var v=new D.EventEmitter,S=function(E,x){r.postMessage({event:E,data:x})};v.on(n.Events.FRAG_DECRYPTED,S),v.on(n.Events.ERROR,S);var w=function(){var E=function(T){var A=function(C){S("workerLog",{logType:T,message:C})};W.logger[T]=A};for(var x in W.logger)E(x)};r.addEventListener("message",function(I){var E=I.data;switch(E.cmd){case"init":{var x=JSON.parse(E.config);r.transmuxer=new B.default(v,E.typeSupported,x,E.vendor,E.id),(0,W.enableLogs)(x.debug,E.id),w(),S("init",null);break}case"configure":{r.transmuxer.configure(E.config);break}case"demux":{var P=r.transmuxer.push(E.data,E.decryptdata,E.chunkMeta,E.state);(0,B.isPromise)(P)?(r.transmuxer.async=!0,P.then(function(C){s(r,C)}).catch(function(C){S(n.Events.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.FRAG_PARSING_ERROR,chunkMeta:E.chunkMeta,fatal:!1,error:C,err:C,reason:"transmuxer-worker push error"})})):(r.transmuxer.async=!1,s(r,P));break}case"flush":{var T=E.chunkMeta,A=r.transmuxer.flush(T),b=(0,B.isPromise)(A);b||r.transmuxer.async?((0,B.isPromise)(A)||(A=Promise.resolve(A)),A.then(function(C){h(r,C,T)}).catch(function(C){S(n.Events.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.FRAG_PARSING_ERROR,chunkMeta:E.chunkMeta,fatal:!1,error:C,err:C,reason:"transmuxer-worker flush error"})})):h(r,A,T);break}default:break}})}function s(r,v){if(_(v.remuxResult))return!1;var S=[],w=v.remuxResult,I=w.audio,E=w.video;return I&&g(S,I),E&&g(S,E),r.postMessage({event:"transmuxComplete",data:v},S),!0}function g(r,v){v.data1&&r.push(v.data1.buffer),v.data2&&r.push(v.data2.buffer)}function h(r,v,S){var w=v.reduce(function(I,E){return s(r,E)||I},!1);w||r.postMessage({event:"transmuxComplete",data:v[0]}),r.postMessage({event:"flush",data:S})}function _(r){return!r.audio&&!r.video&&!r.text&&!r.id3&&!r.initSegment}},"./src/demux/transmuxer.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{TransmuxConfig:()=>E,TransmuxState:()=>x,default:()=>v,isPromise:()=>I});var B=R("./src/events.ts"),n=R("./src/errors.ts"),W=R("./src/crypt/decrypter.ts"),D=R("./src/demux/aacdemuxer.ts"),N=R("./src/demux/mp4demuxer.ts"),d=R("./src/demux/tsdemuxer.ts"),m=R("./src/demux/mp3demuxer.ts"),s=R("./src/remux/mp4-remuxer.ts"),g=R("./src/remux/passthrough-remuxer.ts"),h=R("./src/utils/logger.ts"),_;try{_=self.performance.now.bind(self.performance)}catch(P){h.logger.debug("Unable to use Performance API on this environment"),_=self.Date.now}var r=[{demux:N.default,remux:g.default},{demux:d.default,remux:s.default},{demux:D.default,remux:s.default},{demux:m.default,remux:s.default}],v=function(){function P(A,b,C,p,i){this.async=!1,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.observer=A,this.typeSupported=b,this.config=C,this.vendor=p,this.id=i}var T=P.prototype;return T.configure=function(b){this.transmuxConfig=b,this.decrypter&&this.decrypter.reset()},T.push=function(b,C,p,i){var f=this,o=p.transmuxing;o.executeStart=_();var a=new Uint8Array(b),L=this.currentTransmuxState,y=this.transmuxConfig;i&&(this.currentTransmuxState=i);var l=i||L,F=l.contiguous,j=l.discontinuity,G=l.trackSwitch,Y=l.accurateTimeOffset,te=l.timeOffset,de=l.initSegmentChange,ve=y.audioCodec,he=y.videoCodec,Re=y.defaultInitPts,we=y.duration,ge=y.initSegmentData,Ne=S(a,C);if(Ne&&Ne.method==="AES-128"){var ze=this.getDecrypter();if(ze.isSync()){var nt=ze.softwareDecrypt(a,Ne.key.buffer,Ne.iv.buffer),Ge=p.part>-1;if(Ge&&(nt=ze.flush()),!nt)return o.executeEnd=_(),w(p);a=new Uint8Array(nt)}else return this.decryptionPromise=ze.webCryptoDecrypt(a,Ne.key.buffer,Ne.iv.buffer).then(function(Ze){var be=f.push(Ze,null,p);return f.decryptionPromise=null,be}),this.decryptionPromise}var Xe=this.needsProbing(j,G);Xe&&this.configureTransmuxer(a),(j||G||de||Xe)&&this.resetInitSegment(ge,ve,he,we,C),(j||de||Xe)&&this.resetInitialTimestamp(Re),F||this.resetContiguity();var Be=this.transmux(a,Ne,te,Y,p),_e=this.currentTransmuxState;return _e.contiguous=!0,_e.discontinuity=!1,_e.trackSwitch=!1,o.executeEnd=_(),Be},T.flush=function(b){var C=this,p=b.transmuxing;p.executeStart=_();var i=this.decrypter,f=this.currentTransmuxState,o=this.decryptionPromise;if(o)return o.then(function(){return C.flush(b)});var a=[],L=f.timeOffset;if(i){var y=i.flush();y&&a.push(this.push(y,null,b))}var l=this.demuxer,F=this.remuxer;if(!l||!F)return this.observer.emit(B.Events.ERROR,B.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),p.executeEnd=_(),[w(b)];var j=l.flush(L);return I(j)?j.then(function(G){return C.flushRemux(a,G,b),a}):(this.flushRemux(a,j,b),a)},T.flushRemux=function(b,C,p){var i=C.audioTrack,f=C.videoTrack,o=C.id3Track,a=C.textTrack,L=this.currentTransmuxState,y=L.accurateTimeOffset,l=L.timeOffset;h.logger.log("[transmuxer.ts]: Flushed fragment "+p.sn+(p.part>-1?" p: "+p.part:"")+" of level "+p.level);var F=this.remuxer.remux(i,f,o,a,l,y,!0,this.id);b.push({remuxResult:F,chunkMeta:p}),p.transmuxing.executeEnd=_()},T.resetInitialTimestamp=function(b){var C=this.demuxer,p=this.remuxer;if(!C||!p)return;C.resetTimeStamp(b),p.resetTimeStamp(b)},T.resetContiguity=function(){var b=this.demuxer,C=this.remuxer;if(!b||!C)return;b.resetContiguity(),C.resetNextTimestamp()},T.resetInitSegment=function(b,C,p,i,f){var o=this.demuxer,a=this.remuxer;if(!o||!a)return;o.resetInitSegment(b,C,p,i),a.resetInitSegment(b,C,p,f)},T.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},T.transmux=function(b,C,p,i,f){var o;return C&&C.method==="SAMPLE-AES"?o=this.transmuxSampleAes(b,C,p,i,f):o=this.transmuxUnencrypted(b,p,i,f),o},T.transmuxUnencrypted=function(b,C,p,i){var f=this.demuxer.demux(b,C,!1,!this.config.progressive),o=f.audioTrack,a=f.videoTrack,L=f.id3Track,y=f.textTrack,l=this.remuxer.remux(o,a,L,y,C,p,!1,this.id);return{remuxResult:l,chunkMeta:i}},T.transmuxSampleAes=function(b,C,p,i,f){var o=this;return this.demuxer.demuxSampleAes(b,C,p).then(function(a){var L=o.remuxer.remux(a.audioTrack,a.videoTrack,a.id3Track,a.textTrack,p,i,!1,o.id);return{remuxResult:L,chunkMeta:f}})},T.configureTransmuxer=function(b){for(var C=this.config,p=this.observer,i=this.typeSupported,f=this.vendor,o,a=0,L=r.length;a<L;a++)if(r[a].demux.probe(b)){o=r[a];break}o||(h.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),o={demux:N.default,remux:g.default});var y=this.demuxer,l=this.remuxer,F=o.remux,j=o.demux;(!l||!(l instanceof F))&&(this.remuxer=new F(p,C,i,f)),(!y||!(y instanceof j))&&(this.demuxer=new j(p,C,i),this.probe=j.probe)},T.needsProbing=function(b,C){return!this.demuxer||!this.remuxer||b||C},T.getDecrypter=function(){var b=this.decrypter;return b||(b=this.decrypter=new W.default(this.config)),b},P}();function S(P,T){var A=null;return P.byteLength>0&&T!=null&&T.key!=null&&T.iv!==null&&T.method!=null&&(A=T),A}var w=function(T){return{remuxResult:{},chunkMeta:T}};function I(P){return"then"in P&&P.then instanceof Function}var E=function(T,A,b,C,p){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=T,this.videoCodec=A,this.initSegmentData=b,this.duration=C,this.defaultInitPts=p},x=function(T,A,b,C,p,i){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=T,this.contiguous=A,this.accurateTimeOffset=b,this.trackSwitch=C,this.timeOffset=p,this.initSegmentChange=i}},"./src/demux/tsdemuxer.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>P});var B=R("./src/demux/adts.ts"),n=R("./src/demux/mpegaudio.ts"),W=R("./src/demux/exp-golomb.ts"),D=R("./src/demux/sample-aes.ts"),N=R("./src/events.ts"),d=R("./src/utils/mp4-tools.ts"),m=R("./src/utils/logger.ts"),s=R("./src/errors.ts"),g=R("./src/types/demuxer.ts");function h(){return h=Object.assign?Object.assign.bind():function(T){for(var A=1;A<arguments.length;A++){var b=arguments[A];for(var C in b)Object.prototype.hasOwnProperty.call(b,C)&&(T[C]=b[C])}return T},h.apply(this,arguments)}var _=188,r=function(){function T(b,C,p){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._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=b,this.config=C,this.typeSupported=p}T.probe=function(C){var p=T.syncOffset(C);return p>0&&m.logger.warn("MPEG2-TS detected but first sync word found @ offset "+p),p!==-1},T.syncOffset=function(C){for(var p=C.length,i=Math.min(_*5,C.length-_)+1,f=0;f<i;){for(var o=!1,a=f;a<p&&C[a]===71;a+=_)if(!o&&S(C,a)===0&&(o=!0),o&&a+_>i)return f;f++}return-1},T.createTrack=function(C,p){return{container:C==="video"||C==="audio"?"video/mp2t":void 0,type:C,id:d.RemuxerTrackIdConfig[C],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:C==="audio"?p:void 0}};var A=T.prototype;return A.resetInitSegment=function(C,p,i,f){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=T.createTrack("video"),this._audioTrack=T.createTrack("audio",f),this._id3Track=T.createTrack("id3"),this._txtTrack=T.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=p,this.videoCodec=i,this._duration=f},A.resetTimeStamp=function(){},A.resetContiguity=function(){var C=this._audioTrack,p=this._avcTrack,i=this._id3Track;C&&(C.pesData=null),p&&(p.pesData=null),i&&(i.pesData=null),this.aacOverFlow=null,this.avcSample=null,this.remainderData=null},A.demux=function(C,p,i,f){i===void 0&&(i=!1),f===void 0&&(f=!1),i||(this.sampleAes=null);var o,a=this._avcTrack,L=this._audioTrack,y=this._id3Track,l=this._txtTrack,F=a.pid,j=a.pesData,G=L.pid,Y=y.pid,te=L.pesData,de=y.pesData,ve=null,he=this.pmtParsed,Re=this._pmtId,we=C.length;if(this.remainderData&&(C=(0,d.appendUint8Array)(this.remainderData,C),we=C.length,this.remainderData=null),we<_&&!f)return this.remainderData=C,{audioTrack:L,videoTrack:a,id3Track:y,textTrack:l};var ge=Math.max(0,T.syncOffset(C));we-=(we-ge)%_,we<C.byteLength&&!f&&(this.remainderData=new Uint8Array(C.buffer,we,C.buffer.byteLength-we));for(var Ne=0,ze=ge;ze<we;ze+=_)if(C[ze]===71){var nt=!!(C[ze+1]&64),Ge=S(C,ze),Xe=(C[ze+3]&48)>>4,Be=void 0;if(Xe>1){if(Be=ze+5+C[ze+4],Be===ze+_)continue}else Be=ze+4;switch(Ge){case F:nt&&(j&&(o=E(j))&&this.parseAVCPES(a,l,o,!1),j={data:[],size:0}),j&&(j.data.push(C.subarray(Be,ze+_)),j.size+=ze+_-Be);break;case G:if(nt){if(te&&(o=E(te)))switch(L.segmentCodec){case"aac":this.parseAACPES(L,o);break;case"mp3":this.parseMPEGPES(L,o);break}te={data:[],size:0}}te&&(te.data.push(C.subarray(Be,ze+_)),te.size+=ze+_-Be);break;case Y:nt&&(de&&(o=E(de))&&this.parseID3PES(y,o),de={data:[],size:0}),de&&(de.data.push(C.subarray(Be,ze+_)),de.size+=ze+_-Be);break;case 0:nt&&(Be+=C[Be]+1),Re=this._pmtId=w(C,Be);break;case Re:{nt&&(Be+=C[Be]+1);var _e=I(C,Be,this.typeSupported,i);F=_e.avc,F>0&&(a.pid=F),G=_e.audio,G>0&&(L.pid=G,L.segmentCodec=_e.segmentCodec),Y=_e.id3,Y>0&&(y.pid=Y),ve!==null&&!he&&(m.logger.warn("MPEG-TS PMT found at "+ze+" after unknown PID '"+ve+"'. Backtracking to sync byte @"+ge+" to parse all TS packets."),ve=null,ze=ge-188),he=this.pmtParsed=!0;break}case 17:case 8191:break;default:ve=Ge;break}}else Ne++;Ne>0&&this.observer.emit(N.Events.ERROR,N.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"Found "+Ne+" TS packet/s that do not start with 0x47"}),a.pesData=j,L.pesData=te,y.pesData=de;var Ze={audioTrack:L,videoTrack:a,id3Track:y,textTrack:l};return f&&this.extractRemainingSamples(Ze),Ze},A.flush=function(){var C=this.remainderData;this.remainderData=null;var p;return C?p=this.demux(C,-1,!1,!0):p={videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(p),this.sampleAes?this.decrypt(p,this.sampleAes):p},A.extractRemainingSamples=function(C){var p=C.audioTrack,i=C.videoTrack,f=C.id3Track,o=C.textTrack,a=i.pesData,L=p.pesData,y=f.pesData,l;if(a&&(l=E(a))?(this.parseAVCPES(i,o,l,!0),i.pesData=null):i.pesData=a,L&&(l=E(L))){switch(p.segmentCodec){case"aac":this.parseAACPES(p,l);break;case"mp3":this.parseMPEGPES(p,l);break}p.pesData=null}else L!=null&&L.size&&m.logger.log("last AAC PES packet truncated,might overlap between fragments"),p.pesData=L;y&&(l=E(y))?(this.parseID3PES(f,l),f.pesData=null):f.pesData=y},A.demuxSampleAes=function(C,p,i){var f=this.demux(C,i,!0,!this.config.progressive),o=this.sampleAes=new D.default(this.observer,this.config,p);return this.decrypt(f,o)},A.decrypt=function(C,p){return new Promise(function(i){var f=C.audioTrack,o=C.videoTrack;f.samples&&f.segmentCodec==="aac"?p.decryptAacSamples(f.samples,0,function(){o.samples?p.decryptAvcSamples(o.samples,0,0,function(){i(C)}):i(C)}):o.samples&&p.decryptAvcSamples(o.samples,0,0,function(){i(C)})})},A.destroy=function(){this._duration=0},A.parseAVCPES=function(C,p,i,f){var o=this,a=this.parseAVCNALu(C,i.data),L=!1,y=this.avcSample,l,F=!1;i.data=null,y&&a.length&&!C.audFound&&(x(y,C),y=this.avcSample=v(!1,i.pts,i.dts,"")),a.forEach(function(j){switch(j.type){case 1:{l=!0,y||(y=o.avcSample=v(!0,i.pts,i.dts,"")),L&&(y.debug+="NDR "),y.frame=!0;var G=j.data;if(F&&G.length>4){var Y=new W.default(G).readSliceType();(Y===2||Y===4||Y===7||Y===9)&&(y.key=!0)}break}case 5:l=!0,y||(y=o.avcSample=v(!0,i.pts,i.dts,"")),L&&(y.debug+="IDR "),y.key=!0,y.frame=!0;break;case 6:{l=!0,L&&y&&(y.debug+="SEI "),(0,d.parseSEIMessageFromNALu)(j.data,1,i.pts,p.samples);break}case 7:if(l=!0,F=!0,L&&y&&(y.debug+="SPS "),!C.sps){var te=new W.default(j.data),de=te.readSPS();C.width=de.width,C.height=de.height,C.pixelRatio=de.pixelRatio,C.sps=[j.data],C.duration=o._duration;for(var ve=j.data.subarray(1,4),he="avc1.",Re=0;Re<3;Re++){var we=ve[Re].toString(16);we.length<2&&(we="0"+we),he+=we}C.codec=he}break;case 8:l=!0,L&&y&&(y.debug+="PPS "),C.pps||(C.pps=[j.data]);break;case 9:l=!1,C.audFound=!0,y&&x(y,C),y=o.avcSample=v(!1,i.pts,i.dts,L?"AUD ":"");break;case 12:l=!0;break;default:l=!1,y&&(y.debug+="unknown NAL "+j.type+" ");break}if(y&&l){var ge=y.units;ge.push(j)}}),f&&y&&(x(y,C),this.avcSample=null)},A.getLastNalUnit=function(C){var p,i=this.avcSample,f;if((!i||i.units.length===0)&&(i=C[C.length-1]),(p=i)!==null&&p!==void 0&&p.units){var o=i.units;f=o[o.length-1]}return f},A.parseAVCNALu=function(C,p){var i=p.byteLength,f=C.naluState||0,o=f,a=[],L=0,y,l,F,j=-1,G=0;for(f===-1&&(j=0,G=p[0]&31,f=0,L=1);L<i;){if(y=p[L++],!f){f=y?0:1;continue}if(f===1){f=y?0:2;continue}if(!y)f=3;else if(y===1){if(j>=0){var Y={data:p.subarray(j,L-f-1),type:G};a.push(Y)}else{var te=this.getLastNalUnit(C.samples);if(te&&(o&&L<=4-o&&(te.state&&(te.data=te.data.subarray(0,te.data.byteLength-o))),l=L-f-1,l>0)){var de=new Uint8Array(te.data.byteLength+l);de.set(te.data,0),de.set(p.subarray(0,l),te.data.byteLength),te.data=de,te.state=0}}L<i?(F=p[L]&31,j=L,G=F,f=0):f=-1}else f=0}if(j>=0&&f>=0){var ve={data:p.subarray(j,i),type:G,state:f};a.push(ve)}if(a.length===0){var he=this.getLastNalUnit(C.samples);if(he){var Re=new Uint8Array(he.data.byteLength+p.byteLength);Re.set(he.data,0),Re.set(p,he.data.byteLength),he.data=Re}}return C.naluState=f,a},A.parseAACPES=function(C,p){var i=0,f=this.aacOverFlow,o=p.data;if(f){this.aacOverFlow=null;var a=f.missing,L=f.sample.unit.byteLength;if(a===-1){var y=new Uint8Array(L+o.byteLength);y.set(f.sample.unit,0),y.set(o,L),o=y}else{var l=L-a;f.sample.unit.set(o.subarray(0,a),l),C.samples.push(f.sample),i=f.missing}}var F,j;for(F=i,j=o.length;F<j-1&&!B.isHeader(o,F);F++);if(F!==i){var G,Y;if(F<j-1?(G="AAC PES did not start with ADTS header,offset:"+F,Y=!1):(G="no ADTS header found in AAC PES",Y=!0),m.logger.warn("parsing error:"+G),this.observer.emit(N.Events.ERROR,N.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.FRAG_PARSING_ERROR,fatal:Y,reason:G}),Y)return}B.initTrackConfig(C,this.observer,o,F,this.audioCodec);var te;if(p.pts!==void 0)te=p.pts;else if(f){var de=B.getFrameDuration(C.samplerate);te=f.sample.pts+de}else{m.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var ve=0,he;F<j;)if(he=B.appendFrame(C,o,F,te,ve),F+=he.length,he.missing){this.aacOverFlow=he;break}else for(ve++;F<j-1&&!B.isHeader(o,F);F++);},A.parseMPEGPES=function(C,p){var i=p.data,f=i.length,o=0,a=0,L=p.pts;if(L===void 0){m.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;a<f;)if(n.isHeader(i,a)){var y=n.appendFrame(C,i,a,L,o);if(y)a+=y.length,o++;else break}else a++},A.parseID3PES=function(C,p){if(p.pts===void 0){m.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}var i=h({},p,{type:this._avcTrack?g.MetadataSchema.emsg:g.MetadataSchema.audioId3,duration:Number.POSITIVE_INFINITY});C.samples.push(i)},T}();function v(T,A,b,C){return{key:T,frame:!1,pts:A,dts:b,units:[],debug:C,length:0}}function S(T,A){return((T[A+1]&31)<<8)+T[A+2]}function w(T,A){return(T[A+10]&31)<<8|T[A+11]}function I(T,A,b,C){var p={audio:-1,avc:-1,id3:-1,segmentCodec:"aac"},i=(T[A+1]&15)<<8|T[A+2],f=A+3+i-4,o=(T[A+10]&15)<<8|T[A+11];for(A+=12+o;A<f;){var a=S(T,A);switch(T[A]){case 207:if(!C){m.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:p.audio===-1&&(p.audio=a);break;case 21:p.id3===-1&&(p.id3=a);break;case 219:if(!C){m.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:p.avc===-1&&(p.avc=a);break;case 3:case 4:b.mpeg!==!0&&b.mp3!==!0?m.logger.log("MPEG audio found, not supported in this browser"):p.audio===-1&&(p.audio=a,p.segmentCodec="mp3");break;case 36:m.logger.warn("Unsupported HEVC stream type found");break;default:break}A+=((T[A+3]&15)<<8|T[A+4])+5}return p}function E(T){var A=0,b,C,p,i,f,o=T.data;if(!T||T.size===0)return null;for(;o[0].length<19&&o.length>1;){var a=new Uint8Array(o[0].length+o[1].length);a.set(o[0]),a.set(o[1],o[0].length),o[0]=a,o.splice(1,1)}b=o[0];var L=(b[0]<<16)+(b[1]<<8)+b[2];if(L===1){if(C=(b[4]<<8)+b[5],C&&C>T.size-6)return null;var y=b[7];y&192&&(i=(b[9]&14)*536870912+(b[10]&255)*4194304+(b[11]&254)*16384+(b[12]&255)*128+(b[13]&254)/2,y&64?(f=(b[14]&14)*536870912+(b[15]&255)*4194304+(b[16]&254)*16384+(b[17]&255)*128+(b[18]&254)/2,i-f>60*9e4&&(m.logger.warn(Math.round((i-f)/9e4)+"s delta between PTS and DTS, align them"),i=f)):f=i),p=b[8];var l=p+9;if(T.size<=l)return null;T.size-=l;for(var F=new Uint8Array(T.size),j=0,G=o.length;j<G;j++){b=o[j];var Y=b.byteLength;if(l)if(l>Y){l-=Y;continue}else b=b.subarray(l),Y-=l,l=0;F.set(b,A),A+=Y}return C&&(C-=p+3),{data:F,pts:i,dts:f,len:C}}return null}function x(T,A){if(T.units.length&&T.frame){if(T.pts===void 0){var b=A.samples,C=b.length;if(C){var p=b[C-1];T.pts=p.pts,T.dts=p.dts}else{A.dropped++;return}}A.samples.push(T)}T.debug.length&&m.logger.log(T.pts+"/"+T.dts+":"+T.debug)}const P=r},"./src/demux/webworkify-webpack.js":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>_});var B=function(){var v=ENTRY_MODULE,S={},w=function E(x){var P=S[x];if(P!==void 0)return P.exports;var T=S[x]={exports:{}};return v[x].call(T.exports,T,T.exports,E),T.exports};w.m=v,function(){w.n=function(E){var x=E&&E.__esModule?function(){return E.default}:function(){return E};return w.d(x,{a:x}),x}}(),function(){w.d=function(E,x){for(var P in x)w.o(x,P)&&!w.o(E,P)&&Object.defineProperty(E,P,{enumerable:!0,get:x[P]})}}(),function(){w.o=function(E,x){return Object.prototype.hasOwnProperty.call(E,x)}}(),function(){w.r=function(E){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(E,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(E,"__esModule",{value:!0})}}();var I=w(ENTRY_MODULE);return I.default||I},n=B.toString().split("ENTRY_MODULE"),W="[\\.|\\-|\\+|\\w|/|@]+",D="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+W+").*?\\)";function N(r){return(r+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function d(r){return!isNaN(1*r)}function m(r,v,S){var w={};w[S]=[];var I=v.toString().replace(/^"[^"]+"/,"function"),E=I.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/)||I.match(/^\(\w+,\s*\w+,\s*(\w+)\)\s?\=\s?\>/);if(!E)return w;for(var x=E[1],P=new RegExp("(\\\\n|\\W)"+N(x)+D,"g"),T;T=P.exec(I);){if(T[3]==="dll-reference")continue;w[S].push(T[3])}for(P=new RegExp("\\("+N(x)+'\\("(dll-reference\\s('+W+'))"\\)\\)'+D,"g");T=P.exec(I);)r[T[2]]||(w[S].push(T[1]),r[T[2]]=R(T[1]).m),w[T[2]]=w[T[2]]||[],w[T[2]].push(T[4]);for(var A=Object.keys(w),b=0;b<A.length;b++)for(var C=0;C<w[A[b]].length;C++)d(w[A[b]][C])&&(w[A[b]][C]=1*w[A[b]][C]);return w}function s(r){var v=Object.keys(r);return v.reduce(function(S,w){return S||r[w].length>0},!1)}function g(r,v){for(var S={main:[v]},w={main:[]},I={main:{}};s(S);)for(var E=Object.keys(S),x=0;x<E.length;x++){var P=E[x],T=S[P],A=T.pop();if(I[P]=I[P]||{},I[P][A]||!r[P][A])continue;I[P][A]=!0,w[P]=w[P]||[],w[P].push(A);for(var b=m(r,r[P][A],P),C=Object.keys(b),p=0;p<C.length;p++)S[C[p]]=S[C[p]]||[],S[C[p]]=S[C[p]].concat(b[C[p]])}return w}function h(r,v,S,w){var I=r[w].map(function(E){return'"'+E+'": '+v[w][E].toString().replace(/^"[^"]+"/,"function")}).join(",");return n[0]+"{"+I+"}"+n[1]+'"'+S+'"'+n[2]}function _(r,v){v=v||{};var S={main:R.m},w=v.all?{main:Object.keys(S.main)}:g(S,r),I="";Object.keys(w).filter(function(A){return A!=="main"}).forEach(function(A){for(var b=0;w[A][b];)b++;w[A].push(b),S[A][b]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",I=I+("var "+A+" = ("+h(w,S,b,modules)+`)();
`)}),I=I+("new (("+h(w,S,r,"main")+")())(self);");var E=new window.Blob([I],{type:"text/javascript"}),x=window.URL||window.webkitURL||window.mozURL||window.msURL,P=x.createObjectURL(E),T=new window.Worker(P);return T.objectURL=P,T}},"./src/errors.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{ErrorDetails:()=>n,ErrorTypes:()=>B});var B;(function(W){W.NETWORK_ERROR="networkError",W.MEDIA_ERROR="mediaError",W.KEY_SYSTEM_ERROR="keySystemError",W.MUX_ERROR="muxError",W.OTHER_ERROR="otherError"})(B||(B={}));var n;(function(W){W.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",W.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",W.KEY_SYSTEM_NO_SESSION="keySystemNoSession",W.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",W.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",W.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",W.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",W.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",W.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",W.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",W.MANIFEST_LOAD_ERROR="manifestLoadError",W.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",W.MANIFEST_PARSING_ERROR="manifestParsingError",W.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",W.LEVEL_EMPTY_ERROR="levelEmptyError",W.LEVEL_LOAD_ERROR="levelLoadError",W.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",W.LEVEL_SWITCH_ERROR="levelSwitchError",W.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",W.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",W.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",W.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",W.FRAG_LOAD_ERROR="fragLoadError",W.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",W.FRAG_DECRYPT_ERROR="fragDecryptError",W.FRAG_PARSING_ERROR="fragParsingError",W.REMUX_ALLOC_ERROR="remuxAllocError",W.KEY_LOAD_ERROR="keyLoadError",W.KEY_LOAD_TIMEOUT="keyLoadTimeOut",W.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",W.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",W.BUFFER_APPEND_ERROR="bufferAppendError",W.BUFFER_APPENDING_ERROR="bufferAppendingError",W.BUFFER_STALLED_ERROR="bufferStalledError",W.BUFFER_FULL_ERROR="bufferFullError",W.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",W.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",W.INTERNAL_EXCEPTION="internalException",W.INTERNAL_ABORTED="aborted",W.UNKNOWN="unknown"})(n||(n={}))},"./src/events.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{Events:()=>B});var B;(function(n){n.MEDIA_ATTACHING="hlsMediaAttaching",n.MEDIA_ATTACHED="hlsMediaAttached",n.MEDIA_DETACHING="hlsMediaDetaching",n.MEDIA_DETACHED="hlsMediaDetached",n.BUFFER_RESET="hlsBufferReset",n.BUFFER_CODECS="hlsBufferCodecs",n.BUFFER_CREATED="hlsBufferCreated",n.BUFFER_APPENDING="hlsBufferAppending",n.BUFFER_APPENDED="hlsBufferAppended",n.BUFFER_EOS="hlsBufferEos",n.BUFFER_FLUSHING="hlsBufferFlushing",n.BUFFER_FLUSHED="hlsBufferFlushed",n.MANIFEST_LOADING="hlsManifestLoading",n.MANIFEST_LOADED="hlsManifestLoaded",n.MANIFEST_PARSED="hlsManifestParsed",n.LEVEL_SWITCHING="hlsLevelSwitching",n.LEVEL_SWITCHED="hlsLevelSwitched",n.LEVEL_LOADING="hlsLevelLoading",n.LEVEL_LOADED="hlsLevelLoaded",n.LEVEL_UPDATED="hlsLevelUpdated",n.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",n.LEVELS_UPDATED="hlsLevelsUpdated",n.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",n.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",n.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",n.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",n.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",n.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",n.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",n.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",n.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",n.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",n.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",n.CUES_PARSED="hlsCuesParsed",n.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",n.INIT_PTS_FOUND="hlsInitPtsFound",n.FRAG_LOADING="hlsFragLoading",n.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",n.FRAG_LOADED="hlsFragLoaded",n.FRAG_DECRYPTED="hlsFragDecrypted",n.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",n.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",n.FRAG_PARSING_METADATA="hlsFragParsingMetadata",n.FRAG_PARSED="hlsFragParsed",n.FRAG_BUFFERED="hlsFragBuffered",n.FRAG_CHANGED="hlsFragChanged",n.FPS_DROP="hlsFpsDrop",n.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",n.ERROR="hlsError",n.DESTROYING="hlsDestroying",n.KEY_LOADING="hlsKeyLoading",n.KEY_LOADED="hlsKeyLoaded",n.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",n.BACK_BUFFER_REACHED="hlsBackBufferReached"})(B||(B={}))},"./src/hls.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>b});var B=R("./node_modules/url-toolkit/src/url-toolkit.js"),n=R.n(B),W=R("./src/loader/playlist-loader.ts"),D=R("./src/controller/id3-track-controller.ts"),N=R("./src/controller/latency-controller.ts"),d=R("./src/controller/level-controller.ts"),m=R("./src/controller/fragment-tracker.ts"),s=R("./src/loader/key-loader.ts"),g=R("./src/controller/stream-controller.ts"),h=R("./src/is-supported.ts"),_=R("./src/utils/logger.ts"),r=R("./src/config.ts"),v=R("./node_modules/eventemitter3/index.js"),S=R.n(v),w=R("./src/events.ts"),I=R("./src/errors.ts"),E=R("./src/types/level.ts");function x(C,p){for(var i=0;i<p.length;i++){var f=p[i];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(C,T(f.key),f)}}function P(C,p,i){return p&&x(C.prototype,p),i&&x(C,i),Object.defineProperty(C,"prototype",{writable:!1}),C}function T(C){var p=A(C,"string");return typeof p=="symbol"?p:String(p)}function A(C,p){if(typeof C!="object"||C===null)return C;var i=C[Symbol.toPrimitive];if(i!==void 0){var f=i.call(C,p||"default");if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(C)}var b=function(){C.isSupported=function(){return(0,h.isSupported)()};function C(i){i===void 0&&(i={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new v.EventEmitter,this._autoLevelCapping=void 0,this._maxHdcpLevel=null,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 f=this.config=(0,r.mergeConfig)(C.DefaultConfig,i);this.userConfig=i,(0,_.enableLogs)(f.debug,"Hls instance"),this._autoLevelCapping=-1,f.progressive&&(0,r.enableStreamingMode)(f);var o=f.abrController,a=f.bufferController,L=f.capLevelController,y=f.fpsController,l=this.abrController=new o(this),F=this.bufferController=new a(this),j=this.capLevelController=new L(this),G=new y(this),Y=new W.default(this),te=new D.default(this),de=this.levelController=new d.default(this),ve=new m.FragmentTracker(this),he=new s.default(this.config),Re=this.streamController=new g.default(this,ve,he);j.setStreamController(Re),G.setStreamController(Re);var we=[Y,de,Re];this.networkControllers=we;var ge=[l,F,j,G,te,ve];this.audioTrackController=this.createController(f.audioTrackController,we);var Ne=f.audioStreamController;Ne&&we.push(new Ne(this,ve,he)),this.subtitleTrackController=this.createController(f.subtitleTrackController,we);var ze=f.subtitleStreamController;ze&&we.push(new ze(this,ve,he)),this.createController(f.timelineController,ge),he.emeController=this.emeController=this.createController(f.emeController,ge),this.cmcdController=this.createController(f.cmcdController,ge),this.latencyController=this.createController(N.default,ge),this.coreComponents=ge}var p=C.prototype;return p.createController=function(f,o){if(f){var a=new f(this);return o&&o.push(a),a}return null},p.on=function(f,o,a){a===void 0&&(a=this),this._emitter.on(f,o,a)},p.once=function(f,o,a){a===void 0&&(a=this),this._emitter.once(f,o,a)},p.removeAllListeners=function(f){this._emitter.removeAllListeners(f)},p.off=function(f,o,a,L){a===void 0&&(a=this),this._emitter.off(f,o,a,L)},p.listeners=function(f){return this._emitter.listeners(f)},p.emit=function(f,o,a){return this._emitter.emit(f,o,a)},p.trigger=function(f,o){if(this.config.debug)return this.emit(f,f,o);try{return this.emit(f,f,o)}catch(a){_.logger.error("An internal error happened while handling event "+f+'. Error message: "'+a.message+'". Here is a stacktrace:',a),this.trigger(w.Events.ERROR,{type:I.ErrorTypes.OTHER_ERROR,details:I.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:f,error:a})}return!1},p.listenerCount=function(f){return this._emitter.listenerCount(f)},p.destroy=function(){_.logger.log("destroy"),this.trigger(w.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(f){return f.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(f){return f.destroy()}),this.coreComponents.length=0},p.attachMedia=function(f){_.logger.log("attachMedia"),this._media=f,this.trigger(w.Events.MEDIA_ATTACHING,{media:f})},p.detachMedia=function(){_.logger.log("detachMedia"),this.trigger(w.Events.MEDIA_DETACHING,void 0),this._media=null},p.loadSource=function(f){this.stopLoad();var o=this.media,a=this.url,L=this.url=B.buildAbsoluteURL(self.location.href,f,{alwaysNormalize:!0});_.logger.log("loadSource:"+L),o&&a&&a!==L&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(o)),this.trigger(w.Events.MANIFEST_LOADING,{url:f})},p.startLoad=function(f){f===void 0&&(f=-1),_.logger.log("startLoad("+f+")"),this.networkControllers.forEach(function(o){o.startLoad(f)})},p.stopLoad=function(){_.logger.log("stopLoad"),this.networkControllers.forEach(function(f){f.stopLoad()})},p.swapAudioCodec=function(){_.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},p.recoverMediaError=function(){_.logger.log("recoverMediaError");var f=this._media;this.detachMedia(),f&&this.attachMedia(f)},p.removeLevel=function(f,o){o===void 0&&(o=0),this.levelController.removeLevel(f,o)},P(C,[{key:"levels",get:function(){var f=this.levelController.levels;return f||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(f){_.logger.log("set currentLevel:"+f),this.loadLevel=f,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(f){_.logger.log("set nextLevel:"+f),this.levelController.manualLevel=f,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(f){_.logger.log("set loadLevel:"+f),this.levelController.manualLevel=f}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(f){this.levelController.nextLoadLevel=f}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(f){_.logger.log("set firstLevel:"+f),this.levelController.firstLevel=f}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(f){_.logger.log("set startLevel:"+f),f!==-1&&(f=Math.max(f,this.minAutoLevel)),this.levelController.startLevel=f}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(f){var o=!!f;o!==this.config.capLevelToPlayerSize&&(o?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=o)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(f){this._autoLevelCapping!==f&&(_.logger.log("set autoLevelCapping:"+f),this._autoLevelCapping=f)}},{key:"bandwidthEstimate",get:function(){var f=this.abrController.bwEstimator;return f?f.getEstimate():NaN}},{key:"maxHdcpLevel",get:function(){return this._maxHdcpLevel},set:function(f){E.HdcpLevels.indexOf(f)>-1&&(this._maxHdcpLevel=f)}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var f=this.levels,o=this.config.minAutoBitrate;if(!f)return 0;for(var a=f.length,L=0;L<a;L++)if(f[L].maxBitrate>=o)return L;return 0}},{key:"maxAutoLevel",get:function(){var f=this.levels,o=this.autoLevelCapping,a=this.maxHdcpLevel,L;if(o===-1&&f&&f.length?L=f.length-1:L=o,a)for(var y=L;y--;){var l=f[y].attrs["HDCP-LEVEL"];if(l&&l<=a)return y}return L}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(f){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,f)}},{key:"playingDate",get:function(){return this.streamController.currentProgramDateTime}},{key:"mainForwardBufferInfo",get:function(){return this.streamController.getMainFwdBufferInfo()}},{key:"audioTracks",get:function(){var f=this.audioTrackController;return f?f.audioTracks:[]}},{key:"audioTrack",get:function(){var f=this.audioTrackController;return f?f.audioTrack:-1},set:function(f){var o=this.audioTrackController;o&&(o.audioTrack=f)}},{key:"subtitleTracks",get:function(){var f=this.subtitleTrackController;return f?f.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var f=this.subtitleTrackController;return f?f.subtitleTrack:-1},set:function(f){var o=this.subtitleTrackController;o&&(o.subtitleTrack=f)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var f=this.subtitleTrackController;return f?f.subtitleDisplay:!1},set:function(f){var o=this.subtitleTrackController;o&&(o.subtitleDisplay=f)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(f){this.config.lowLatencyMode=f}},{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.3.5"}},{key:"Events",get:function(){return w.Events}},{key:"ErrorTypes",get:function(){return I.ErrorTypes}},{key:"ErrorDetails",get:function(){return I.ErrorDetails}},{key:"DefaultConfig",get:function(){return C.defaultConfig?C.defaultConfig:r.hlsDefaultConfig},set:function(f){C.defaultConfig=f}}]),C}();b.defaultConfig=void 0},"./src/is-supported.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{changeTypeSupported:()=>D,isSupported:()=>W});var B=R("./src/utils/mediasource-helper.ts");function n(){return self.SourceBuffer||self.WebKitSourceBuffer}function W(){var N=(0,B.getMediaSource)();if(!N)return!1;var d=n(),m=N&&typeof N.isTypeSupported=="function"&&N.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),s=!d||d.prototype&&typeof d.prototype.appendBuffer=="function"&&typeof d.prototype.remove=="function";return!!m&&!!s}function D(){var N,d=n();return typeof(d==null||((N=d.prototype)===null||N===void 0)?void 0:N.changeType)=="function"}},"./src/loader/date-range.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{DateRange:()=>h,DateRangeAttribute:()=>g});var B=R("./src/polyfills/number.ts"),n=R("./src/utils/attr-list.ts"),W=R("./src/utils/logger.ts");function D(){return D=Object.assign?Object.assign.bind():function(_){for(var r=1;r<arguments.length;r++){var v=arguments[r];for(var S in v)Object.prototype.hasOwnProperty.call(v,S)&&(_[S]=v[S])}return _},D.apply(this,arguments)}function N(_,r){for(var v=0;v<r.length;v++){var S=r[v];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(_,m(S.key),S)}}function d(_,r,v){return r&&N(_.prototype,r),v&&N(_,v),Object.defineProperty(_,"prototype",{writable:!1}),_}function m(_){var r=s(_,"string");return typeof r=="symbol"?r:String(r)}function s(_,r){if(typeof _!="object"||_===null)return _;var v=_[Symbol.toPrimitive];if(v!==void 0){var S=v.call(_,r||"default");if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(_)}var g;(function(_){_.ID="ID",_.CLASS="CLASS",_.START_DATE="START-DATE",_.DURATION="DURATION",_.END_DATE="END-DATE",_.END_ON_NEXT="END-ON-NEXT",_.PLANNED_DURATION="PLANNED-DURATION",_.SCTE35_OUT="SCTE35-OUT",_.SCTE35_IN="SCTE35-IN"})(g||(g={}));var h=function(){function _(r,v){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,v){var S=v.attr;for(var w in S)if(Object.prototype.hasOwnProperty.call(r,w)&&r[w]!==S[w]){W.logger.warn('DATERANGE tag attribute: "'+w+'" does not match for tags with ID: "'+r.ID+'"'),this._badValueForSameId=w;break}r=D(new n.AttrList({}),S,r)}if(this.attr=r,this._startDate=new Date(r[g.START_DATE]),g.END_DATE in this.attr){var I=new Date(this.attr[g.END_DATE]);(0,B.isFiniteNumber)(I.getTime())&&(this._endDate=I)}}return d(_,[{key:"id",get:function(){return this.attr.ID}},{key:"class",get:function(){return this.attr.CLASS}},{key:"startDate",get:function(){return this._startDate}},{key:"endDate",get:function(){if(this._endDate)return this._endDate;var v=this.duration;return v!==null?new Date(this._startDate.getTime()+v*1e3):null}},{key:"duration",get:function(){if(g.DURATION in this.attr){var v=this.attr.decimalFloatingPoint(g.DURATION);if((0,B.isFiniteNumber)(v))return v}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}},{key:"plannedDuration",get:function(){return g.PLANNED_DURATION in this.attr?this.attr.decimalFloatingPoint(g.PLANNED_DURATION):null}},{key:"endOnNext",get:function(){return this.attr.bool(g.END_ON_NEXT)}},{key:"isValid",get:function(){return!!this.id&&!this._badValueForSameId&&(0,B.isFiniteNumber)(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}]),_}()},"./src/loader/fragment-loader.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{LoadError:()=>v,default:()=>_});var B=R("./src/polyfills/number.ts"),n=R("./src/errors.ts");function W(S,w){S.prototype=Object.create(w.prototype),S.prototype.constructor=S,s(S,w)}function D(S){var w=typeof Map=="function"?new Map:void 0;return D=function(E){if(E===null||!m(E))return E;if(typeof E!="function")throw new TypeError("Super expression must either be null or a function");if(typeof w!="undefined"){if(w.has(E))return w.get(E);w.set(E,x)}function x(){return N(E,arguments,g(this).constructor)}return x.prototype=Object.create(E.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),s(x,E)},D(S)}function N(S,w,I){return d()?N=Reflect.construct.bind():N=function(x,P,T){var A=[null];A.push.apply(A,P);var b=Function.bind.apply(x,A),C=new b;return T&&s(C,T.prototype),C},N.apply(null,arguments)}function d(){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 m(S){return Function.toString.call(S).indexOf("[native code]")!==-1}function s(S,w){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,x){return E.__proto__=x,E},s(S,w)}function g(S){return g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(I){return I.__proto__||Object.getPrototypeOf(I)},g(S)}var h=Math.pow(2,17),_=function(){function S(I){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=I}var w=S.prototype;return w.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},w.abort=function(){this.loader&&this.loader.abort()},w.load=function(E,x){var P=this,T=E.url;if(!T)return Promise.reject(new v({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:E,networkDetails:null},"Fragment does not have a "+(T?"part list":"url")));this.abort();var A=this.config,b=A.fLoader,C=A.loader;return new Promise(function(p,i){P.loader&&P.loader.destroy();var f=P.loader=E.loader=b?new b(A):new C(A),o=r(E),a={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:E.sn==="initSegment"?Infinity:h};E.stats=f.stats,f.load(o,a,{onSuccess:function(y,l,F,j){P.resetLoader(E,f);var G=y.data;F.resetIV&&E.decryptdata&&(E.decryptdata.iv=new Uint8Array(G.slice(0,16)),G=G.slice(16)),p({frag:E,part:null,payload:G,networkDetails:j})},onError:function(y,l,F){P.resetLoader(E,f),i(new v({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:E,response:y,networkDetails:F}))},onAbort:function(y,l,F){P.resetLoader(E,f),i(new v({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:E,networkDetails:F}))},onTimeout:function(y,l,F){P.resetLoader(E,f),i(new v({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:E,networkDetails:F}))},onProgress:function(y,l,F,j){x&&x({frag:E,part:null,payload:F,networkDetails:j})}})})},w.loadPart=function(E,x,P){var T=this;this.abort();var A=this.config,b=A.fLoader,C=A.loader;return new Promise(function(p,i){T.loader&&T.loader.destroy();var f=T.loader=E.loader=b?new b(A):new C(A),o=r(E,x),a={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:h};x.stats=f.stats,f.load(o,a,{onSuccess:function(y,l,F,j){T.resetLoader(E,f),T.updateStatsFromPart(E,x);var G={frag:E,part:x,payload:y.data,networkDetails:j};P(G),p(G)},onError:function(y,l,F){T.resetLoader(E,f),i(new v({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:E,part:x,response:y,networkDetails:F}))},onAbort:function(y,l,F){E.stats.aborted=x.stats.aborted,T.resetLoader(E,f),i(new v({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:E,part:x,networkDetails:F}))},onTimeout:function(y,l,F){T.resetLoader(E,f),i(new v({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:E,part:x,networkDetails:F}))}})})},w.updateStatsFromPart=function(E,x){var P=E.stats,T=x.stats,A=T.total;if(P.loaded+=T.loaded,A){var b=Math.round(E.duration/x.duration),C=Math.min(Math.round(P.loaded/A),b),p=b-C,i=p*Math.round(P.loaded/C);P.total=P.loaded+i}else P.total=Math.max(P.loaded,P.total);var f=P.loading,o=T.loading;f.start?f.first+=o.first-o.start:(f.start=o.start,f.first=o.first),f.end=o.end},w.resetLoader=function(E,x){E.loader=null,this.loader===x&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),x.destroy()},S}();function r(S,w){w===void 0&&(w=null);var I=w||S,E={frag:S,part:w,responseType:"arraybuffer",url:I.url,headers:{},rangeStart:0,rangeEnd:0},x=I.byteRangeStartOffset,P=I.byteRangeEndOffset;if((0,B.isFiniteNumber)(x)&&(0,B.isFiniteNumber)(P)){var T,A=x,b=P;if(S.sn==="initSegment"&&((T=S.decryptdata)===null||T===void 0?void 0:T.method)==="AES-128"){var C=P-x;C%16&&(b=P+(16-C%16)),x!==0&&(E.resetIV=!0,A=x-16)}E.rangeStart=A,E.rangeEnd=b}return E}var v=function(S){W(w,S);function w(I){for(var E,x=arguments.length,P=new Array(x>1?x-1:0),T=1;T<x;T++)P[T-1]=arguments[T];return E=S.call.apply(S,[this].concat(P))||this,E.data=void 0,E.data=I,E}return w}(D(Error))},"./src/loader/fragment.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{BaseSegment:()=>r,ElementaryStreamTypes:()=>_,Fragment:()=>v,Part:()=>S});var B=R("./src/polyfills/number.ts"),n=R("./node_modules/url-toolkit/src/url-toolkit.js"),W=R.n(n),D=R("./src/loader/load-stats.ts");function N(w,I){w.prototype=Object.create(I.prototype),w.prototype.constructor=w,d(w,I)}function d(w,I){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,P){return x.__proto__=P,x},d(w,I)}function m(w,I){for(var E=0;E<I.length;E++){var x=I[E];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(w,g(x.key),x)}}function s(w,I,E){return I&&m(w.prototype,I),E&&m(w,E),Object.defineProperty(w,"prototype",{writable:!1}),w}function g(w){var I=h(w,"string");return typeof I=="symbol"?I:String(I)}function h(w,I){if(typeof w!="object"||w===null)return w;var E=w[Symbol.toPrimitive];if(E!==void 0){var x=E.call(w,I||"default");if(typeof x!="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return(I==="string"?String:Number)(w)}var _;(function(w){w.AUDIO="audio",w.VIDEO="video",w.AUDIOVIDEO="audiovideo"})(_||(_={}));var r=function(){function w(E){var x;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(x={},x[_.AUDIO]=null,x[_.VIDEO]=null,x[_.AUDIOVIDEO]=null,x),this.baseurl=E}var I=w.prototype;return I.setByteRange=function(x,P){var T=x.split("@",2),A=[];T.length===1?A[0]=P?P.byteRangeEndOffset:0:A[0]=parseInt(T[1]),A[1]=parseInt(T[0])+A[0],this._byteRange=A},s(w,[{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=(0,n.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(x){this._url=x}}]),w}(),v=function(w){N(I,w);function I(x,P){var T;return T=w.call(this,P)||this,T._decryptdata=null,T.rawProgramDateTime=null,T.programDateTime=null,T.tagList=[],T.duration=0,T.sn=0,T.levelkeys=void 0,T.type=void 0,T.loader=null,T.keyLoader=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 D.LoadStats,T.urlId=0,T.data=void 0,T.bitrateTest=!1,T.title=null,T.initSegment=null,T.endList=void 0,T.type=x,T}var E=I.prototype;return E.setKeyFormat=function(P){if(this.levelkeys){var T=this.levelkeys[P];T&&!this._decryptdata&&(this._decryptdata=T.getDecryptData(this.sn))}},E.abortRequests=function(){var P,T;(P=this.loader)===null||P===void 0||P.abort(),(T=this.keyLoader)===null||T===void 0||T.abort()},E.setElementaryStreamInfo=function(P,T,A,b,C,p){p===void 0&&(p=!1);var i=this.elementaryStreams,f=i[P];if(!f){i[P]={startPTS:T,endPTS:A,startDTS:b,endDTS:C,partial:p};return}f.startPTS=Math.min(f.startPTS,T),f.endPTS=Math.max(f.endPTS,A),f.startDTS=Math.min(f.startDTS,b),f.endDTS=Math.max(f.endDTS,C)},E.clearElementaryStreamInfo=function(){var P=this.elementaryStreams;P[_.AUDIO]=null,P[_.VIDEO]=null,P[_.AUDIOVIDEO]=null},s(I,[{key:"decryptdata",get:function(){var P=this.levelkeys;if(!P&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){var T=this.levelkeys.identity;if(T)this._decryptdata=T.getDecryptData(this.sn);else{var A=Object.keys(this.levelkeys);if(A.length===1)return this._decryptdata=this.levelkeys[A[0]].getDecryptData(this.sn)}}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!(0,B.isFiniteNumber)(this.programDateTime))return null;var P=(0,B.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+P*1e3}},{key:"encrypted",get:function(){var P;if((P=this._decryptdata)!==null&&P!==void 0&&P.encrypted)return!0;if(this.levelkeys){var T=Object.keys(this.levelkeys),A=T.length;if(A>1||A===1&&this.levelkeys[T[0]].encrypted)return!0}return!1}}]),I}(r),S=function(w){N(I,w);function I(E,x,P,T,A){var b;b=w.call(this,P)||this,b.fragOffset=0,b.duration=0,b.gap=!1,b.independent=!1,b.relurl=void 0,b.fragment=void 0,b.index=void 0,b.stats=new D.LoadStats,b.duration=E.decimalFloatingPoint("DURATION"),b.gap=E.bool("GAP"),b.independent=E.bool("INDEPENDENT"),b.relurl=E.enumeratedString("URI"),b.fragment=x,b.index=T;var C=E.enumeratedString("BYTERANGE");return C&&b.setByteRange(C,A),A&&(b.fragOffset=A.fragOffset+A.duration),b}return s(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 x=this.elementaryStreams;return!!(x.audio||x.video||x.audiovideo)}}]),I}(r)},"./src/loader/key-loader.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>W});var B=R("./src/errors.ts"),n=R("./src/loader/fragment-loader.ts"),W=function(){function D(d){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=d}var N=D.prototype;return N.abort=function(){for(var m in this.keyUriToKeyInfo){var s=this.keyUriToKeyInfo[m].loader;s&&s.abort()}},N.detach=function(){for(var m in this.keyUriToKeyInfo){var s=this.keyUriToKeyInfo[m];(s.mediaKeySessionContext||s.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[m]}},N.destroy=function(){this.detach();for(var m in this.keyUriToKeyInfo){var s=this.keyUriToKeyInfo[m].loader;s&&s.destroy()}this.keyUriToKeyInfo={}},N.createKeyLoadError=function(m,s,g,h){return s===void 0&&(s=B.ErrorDetails.KEY_LOAD_ERROR),new n.LoadError({type:B.ErrorTypes.NETWORK_ERROR,details:s,fatal:!1,frag:m,networkDetails:g})},N.loadClear=function(m,s){var g=this;if(this.emeController&&this.config.emeEnabled)for(var h=m.sn,_=m.cc,r=function(I){var E=s[I];if(_<=E.cc&&(h==="initSegment"||h<E.sn))return g.emeController.selectKeySystemFormat(E).then(function(x){E.setKeyFormat(x)}),"break"},v=0;v<s.length;v++){var S=r(v);if(S==="break")break}},N.load=function(m){var s=this;return!m.decryptdata&&m.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(m).then(function(g){return s.loadInternal(m,g)}):this.loadInternal(m)},N.loadInternal=function(m,s){var g,h;s&&m.setKeyFormat(s);var _=m.decryptdata;if(!_){var r=s?"Expected frag.decryptdata to be defined after setting format "+s:"Missing decryption data on fragment in onKeyLoading";return Promise.reject(this.createKeyLoadError(m,B.ErrorDetails.KEY_LOAD_ERROR,null,r))}var v=_.uri;if(!v)return Promise.reject(this.createKeyLoadError(m,B.ErrorDetails.KEY_LOAD_ERROR,null,'Invalid key URI: "'+v+'"'));var S=this.keyUriToKeyInfo[v];if((g=S)!==null&&g!==void 0&&g.decryptdata.key)return _.key=S.decryptdata.key,Promise.resolve({frag:m,keyInfo:S});if((h=S)!==null&&h!==void 0&&h.keyLoadPromise){var w;switch((w=S.mediaKeySessionContext)===null||w===void 0?void 0:w.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return S.keyLoadPromise.then(function(I){return _.key=I.keyInfo.decryptdata.key,{frag:m,keyInfo:S}})}}S=this.keyUriToKeyInfo[v]={decryptdata:_,keyLoadPromise:null,loader:null,mediaKeySessionContext:null};switch(_.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return _.keyFormat==="identity"?this.loadKeyHTTP(S,m):this.loadKeyEME(S,m);case"AES-128":return this.loadKeyHTTP(S,m);default:return Promise.reject(this.createKeyLoadError(m,B.ErrorDetails.KEY_LOAD_ERROR,null,'Key supplied with unsupported METHOD: "'+_.method+'"'))}},N.loadKeyEME=function(m,s){var g={frag:s,keyInfo:m};if(this.emeController&&this.config.emeEnabled){var h=this.emeController.loadKey(g);if(h)return(m.keyLoadPromise=h.then(function(_){return m.mediaKeySessionContext=_,g})).catch(function(_){throw m.keyLoadPromise=null,_})}return Promise.resolve(g)},N.loadKeyHTTP=function(m,s){var g=this,h=this.config,_=h.loader,r=new _(h);return s.keyLoader=m.loader=r,m.keyLoadPromise=new Promise(function(v,S){var w={keyInfo:m,frag:s,responseType:"arraybuffer",url:m.decryptdata.uri},I={timeout:h.fragLoadingTimeOut,maxRetry:0,retryDelay:h.fragLoadingRetryDelay,maxRetryDelay:h.fragLoadingMaxRetryTimeout,highWaterMark:0},E={onSuccess:function(P,T,A,b){var C=A.frag,p=A.keyInfo,i=A.url;if(!C.decryptdata||p!==g.keyUriToKeyInfo[i])return S(g.createKeyLoadError(C,B.ErrorDetails.KEY_LOAD_ERROR,b,"after key load, decryptdata unset or changed"));p.decryptdata.key=C.decryptdata.key=new Uint8Array(P.data),C.keyLoader=null,p.loader=null,v({frag:C,keyInfo:p})},onError:function(P,T,A){g.resetLoader(T),S(g.createKeyLoadError(s,B.ErrorDetails.KEY_LOAD_ERROR,A))},onTimeout:function(P,T,A){g.resetLoader(T),S(g.createKeyLoadError(s,B.ErrorDetails.KEY_LOAD_TIMEOUT,A))},onAbort:function(P,T,A){g.resetLoader(T),S(g.createKeyLoadError(s,B.ErrorDetails.INTERNAL_ABORTED,A))}};r.load(w,I,E)})},N.resetLoader=function(m){var s=m.frag,g=m.keyInfo,h=m.url,_=g.loader;s.keyLoader===_&&(s.keyLoader=null,g.loader=null),delete this.keyUriToKeyInfo[h],_&&_.destroy()},D}()},"./src/loader/level-details.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{LevelDetails:()=>m});var B=R("./src/polyfills/number.ts");function n(s,g){for(var h=0;h<g.length;h++){var _=g[h];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(s,D(_.key),_)}}function W(s,g,h){return g&&n(s.prototype,g),h&&n(s,h),Object.defineProperty(s,"prototype",{writable:!1}),s}function D(s){var g=N(s,"string");return typeof g=="symbol"?g:String(g)}function N(s,g){if(typeof s!="object"||s===null)return s;var h=s[Symbol.toPrimitive];if(h!==void 0){var _=h.call(s,g||"default");if(typeof _!="object")return _;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(s)}var d=10,m=function(){function s(h){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.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,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.encryptedFragments=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=h}var g=s.prototype;return g.reloaded=function(_){if(!_){this.advanced=!0,this.updated=!0;return}var r=this.lastPartSn-_.lastPartSn,v=this.lastPartIndex-_.lastPartIndex;this.updated=this.endSN!==_.endSN||!!v||!!r,this.advanced=this.endSN>_.endSN||r>0||r===0&&v>0,this.updated||this.advanced?this.misses=Math.floor(_.misses*.6):this.misses=_.misses+1,this.availabilityDelay=_.availabilityDelay},W(s,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?(0,B.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||d}},{key:"drift",get:function(){var _=this.driftEndTime-this.driftStartTime;if(_>0){var r=this.driftEnd-this.driftStart;return r*1e3/_}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var _;return(_=this.partList)!==null&&_!==void 0&&_.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var _;return(_=this.fragments)!==null&&_!==void 0&&_.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 _;return(_=this.partList)!==null&&_!==void 0&&_.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var _;return(_=this.partList)!==null&&_!==void 0&&_.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),s}()},"./src/loader/level-key.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{LevelKey:()=>m});var B=R("./src/utils/keysystem-util.ts"),n=R("./src/utils/mediakeys-helper.ts"),W=R("./src/utils/mp4-tools.ts"),D=R("./src/utils/logger.ts"),N=R("./src/utils/numeric-encoding-utils.ts"),d={},m=function(){g.clearKeyUriToKeyIdMap=function(){d={}};function g(_,r,v,S,w){S===void 0&&(S=[1]),w===void 0&&(w=null),this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=_,this.uri=r,this.keyFormat=v,this.keyFormatVersions=S,this.iv=w,this.encrypted=_?_!=="NONE":!1,this.isCommonEncryption=this.encrypted&&_!=="AES-128"}var h=g.prototype;return h.isSupported=function(){if(this.method){if(this.method==="AES-128"||this.method==="NONE")return!0;switch(this.keyFormat){case"identity":return this.method==="SAMPLE-AES";case n.KeySystemFormats.FAIRPLAY:case n.KeySystemFormats.WIDEVINE:case n.KeySystemFormats.PLAYREADY:case n.KeySystemFormats.CLEARKEY:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1},h.getDecryptData=function(r){if(!this.encrypted||!this.uri)return null;if(this.method==="AES-128"&&this.uri&&!this.iv){typeof r!="number"&&(this.method==="AES-128"&&!this.iv&&D.logger.warn('missing IV for initialization segment with method="'+this.method+'" - compliance issue'),r=0);var v=s(r),S=new g(this.method,this.uri,"identity",this.keyFormatVersions,v);return S}var w=(0,B.convertDataUriToArrayBytes)(this.uri);if(w)switch(this.keyFormat){case n.KeySystemFormats.WIDEVINE:this.pssh=w,w.length>=22&&(this.keyId=w.subarray(w.length-22,w.length-6));break;case n.KeySystemFormats.PLAYREADY:{var I=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=(0,W.mp4pssh)(I,null,w);var E=new Uint16Array(w.buffer,w.byteOffset,w.byteLength/2),x=String.fromCharCode.apply(null,Array.from(E)),P=x.substring(x.indexOf("<"),x.length),T=new DOMParser,A=T.parseFromString(P,"text/xml"),b=A.getElementsByTagName("KID")[0];if(b){var C=b.childNodes[0]?b.childNodes[0].nodeValue:b.getAttribute("VALUE");if(C){var p=(0,N.base64Decode)(C).subarray(0,16);(0,B.changeEndianness)(p),this.keyId=p}}break}default:{var i=w.subarray(0,16);if(i.length!==16){var f=new Uint8Array(16);f.set(i,16-i.length),i=f}this.keyId=i;break}}if(!this.keyId||this.keyId.byteLength!==16){var o=d[this.uri];if(!o){var a=Object.keys(d).length%Number.MAX_SAFE_INTEGER;o=new Uint8Array(16);var L=new DataView(o.buffer,12,4);L.setUint32(0,a),d[this.uri]=o}this.keyId=o}return this},g}();function s(g){for(var h=new Uint8Array(16),_=12;_<16;_++)h[_]=g>>8*(15-_)&255;return h}},"./src/loader/load-stats.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{LoadStats:()=>B});var B=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":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>I});var B=R("./src/polyfills/number.ts"),n=R("./node_modules/url-toolkit/src/url-toolkit.js"),W=R.n(n),D=R("./src/loader/date-range.ts"),N=R("./src/loader/fragment.ts"),d=R("./src/loader/level-details.ts"),m=R("./src/loader/level-key.ts"),s=R("./src/utils/attr-list.ts"),g=R("./src/utils/logger.ts"),h=R("./src/utils/codecs.ts");function _(){return _=Object.assign?Object.assign.bind():function(p){for(var i=1;i<arguments.length;i++){var f=arguments[i];for(var o in f)Object.prototype.hasOwnProperty.call(f,o)&&(p[o]=f[o])}return p},_.apply(this,arguments)}var r=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+|#EXT-X-SESSION-KEY:([^\n\r]*)[\r\n]+/g,v=/#EXT-X-MEDIA:(.*)/g,S=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),w=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),I=function(){function p(){}return p.findGroup=function(f,o){for(var a=0;a<f.length;a++){var L=f[a];if(L.id===o)return L}},p.convertAVC1ToAVCOTI=function(f){var o=f.split(".");if(o.length>2){var a=o.shift()+".";return a+=parseInt(o.shift()).toString(16),a+=("000"+parseInt(o.shift()).toString(16)).slice(-4),a}return f},p.resolve=function(f,o){return(0,n.buildAbsoluteURL)(o,f,{alwaysNormalize:!0})},p.parseMasterPlaylist=function(f,o){var a=[],L=[],y={},l=[],F=!1;r.lastIndex=0;for(var j;(j=r.exec(f))!=null;)if(j[1]){var G,Y=new s.AttrList(j[1]),te={attrs:Y,bitrate:Y.decimalInteger("AVERAGE-BANDWIDTH")||Y.decimalInteger("BANDWIDTH"),name:Y.NAME,url:p.resolve(j[2],o)},de=Y.decimalResolution("RESOLUTION");de&&(te.width=de.width,te.height=de.height),x((Y.CODECS||"").split(/[ ,]+/).filter(function(ge){return ge}),te),te.videoCodec&&te.videoCodec.indexOf("avc1")!==-1&&(te.videoCodec=p.convertAVC1ToAVCOTI(te.videoCodec)),(G=te.unknownCodecs)!==null&&G!==void 0&&G.length||L.push(te),a.push(te)}else if(j[3]){var ve=new s.AttrList(j[3]);ve["DATA-ID"]&&(F=!0,y[ve["DATA-ID"]]=ve)}else if(j[4]){var he=j[4],Re=E(he,o);Re.encrypted&&Re.isSupported()?l.push(Re):g.logger.warn('[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "'+he+'"')}var we=L.length>0&&L.length<a.length;return{levels:we?L:a,sessionData:F?y:null,sessionKeys:l.length?l:null}},p.parseMasterPlaylistMedia=function(f,o,a,L){L===void 0&&(L=[]);var y,l=[],F=0;for(v.lastIndex=0;(y=v.exec(f))!==null;){var j=new s.AttrList(y[1]);if(j.TYPE===a){var G={attrs:j,bitrate:0,id:F++,groupId:j["GROUP-ID"],instreamId:j["INSTREAM-ID"],name:j.NAME||j.LANGUAGE||"",type:a,default:j.bool("DEFAULT"),autoselect:j.bool("AUTOSELECT"),forced:j.bool("FORCED"),lang:j.LANGUAGE,url:j.URI?p.resolve(j.URI,o):""};if(L.length){var Y=p.findGroup(L,G.groupId)||L[0];P(G,Y,"audioCodec"),P(G,Y,"textCodec")}l.push(G)}}return l},p.parseLevelPlaylist=function(f,o,a,L,y){var l=new d.LevelDetails(o),F=l.fragments,j=null,G=0,Y=0,te=0,de=0,ve=null,he=new N.Fragment(L,o),Re,we,ge,Ne=-1,ze=!1;for(S.lastIndex=0,l.m3u8=f;(Re=S.exec(f))!==null;){ze&&(ze=!1,he=new N.Fragment(L,o),he.start=te,he.sn=G,he.cc=de,he.level=a,j&&(he.initSegment=j,he.rawProgramDateTime=j.rawProgramDateTime,j.rawProgramDateTime=null));var nt=Re[1];if(nt){he.duration=parseFloat(nt);var Ge=(" "+Re[2]).slice(1);he.title=Ge||null,he.tagList.push(Ge?["INF",nt,Ge]:["INF",nt])}else if(Re[3])(0,B.isFiniteNumber)(he.duration)&&(he.start=te,ge&&C(he,ge,l),he.sn=G,he.level=a,he.cc=de,he.urlId=y,F.push(he),he.relurl=(" "+Re[3]).slice(1),A(he,ve),ve=he,te+=he.duration,G++,Y=0,ze=!0);else if(Re[4]){var Xe=(" "+Re[4]).slice(1);ve?he.setByteRange(Xe,ve):he.setByteRange(Xe)}else if(Re[5])he.rawProgramDateTime=(" "+Re[5]).slice(1),he.tagList.push(["PROGRAM-DATE-TIME",he.rawProgramDateTime]),Ne===-1&&(Ne=F.length);else{if(Re=Re[0].match(w),!Re){g.logger.warn("No matches on slow regex match for level playlist!");continue}for(we=1;we<Re.length&&!(typeof Re[we]!="undefined");we++);var Be=(" "+Re[we]).slice(1),_e=(" "+Re[we+1]).slice(1),Ze=Re[we+2]?(" "+Re[we+2]).slice(1):"";switch(Be){case"PLAYLIST-TYPE":l.type=_e.toUpperCase();break;case"MEDIA-SEQUENCE":G=l.startSN=parseInt(_e);break;case"SKIP":{var be=new s.AttrList(_e),Le=be.decimalInteger("SKIPPED-SEGMENTS");if((0,B.isFiniteNumber)(Le)){l.skippedSegments=Le;for(var le=Le;le--;)F.unshift(null);G+=Le}var ye=be.enumeratedString("RECENTLY-REMOVED-DATERANGES");ye&&(l.recentlyRemovedDateranges=ye.split(" "));break}case"TARGETDURATION":l.targetduration=parseFloat(_e);break;case"VERSION":l.version=parseInt(_e);break;case"EXTM3U":break;case"ENDLIST":l.live=!1;break;case"#":(_e||Ze)&&he.tagList.push(Ze?[_e,Ze]:[_e]);break;case"DISCONTINUITY":de++,he.tagList.push(["DIS"]);break;case"GAP":he.tagList.push([Be]);break;case"BITRATE":he.tagList.push([Be,_e]);break;case"DATERANGE":{var Te=new s.AttrList(_e),Pe=new D.DateRange(Te,l.dateRanges[Te.ID]);Pe.isValid||l.skippedSegments?l.dateRanges[Pe.id]=Pe:g.logger.warn('Ignoring invalid DATERANGE tag: "'+_e+'"'),he.tagList.push(["EXT-X-DATERANGE",_e]);break}case"DISCONTINUITY-SEQUENCE":de=parseInt(_e);break;case"KEY":{var He=E(_e,o);if(He.isSupported()){if(He.method==="NONE"){ge=void 0;break}ge||(ge={}),ge[He.keyFormat]&&(ge=_({},ge)),ge[He.keyFormat]=He}else g.logger.warn('[Keys] Ignoring invalid EXT-X-KEY tag: "'+_e+'"');break}case"START":{var Ye=new s.AttrList(_e),ct=Ye.decimalFloatingPoint("TIME-OFFSET");(0,B.isFiniteNumber)(ct)&&(l.startTimeOffset=ct);break}case"MAP":{var st=new s.AttrList(_e);if(he.duration){var vt=new N.Fragment(L,o);b(vt,st,a,ge),j=vt,he.initSegment=j,j.rawProgramDateTime&&!he.rawProgramDateTime&&(he.rawProgramDateTime=j.rawProgramDateTime)}else b(he,st,a,ge),j=he,ze=!0;break}case"SERVER-CONTROL":{var qe=new s.AttrList(_e);l.canBlockReload=qe.bool("CAN-BLOCK-RELOAD"),l.canSkipUntil=qe.optionalFloat("CAN-SKIP-UNTIL",0),l.canSkipDateRanges=l.canSkipUntil>0&&qe.bool("CAN-SKIP-DATERANGES"),l.partHoldBack=qe.optionalFloat("PART-HOLD-BACK",0),l.holdBack=qe.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var mt=new s.AttrList(_e);l.partTarget=mt.decimalFloatingPoint("PART-TARGET");break}case"PART":{var yt=l.partList;yt||(yt=l.partList=[]);var Je=Y>0?yt[yt.length-1]:void 0,et=Y++,De=new N.Part(new s.AttrList(_e),he,o,et,Je);yt.push(De),he.duration+=De.duration;break}case"PRELOAD-HINT":{var ke=new s.AttrList(_e);l.preloadHint=ke;break}case"RENDITION-REPORT":{var Me=new s.AttrList(_e);l.renditionReports=l.renditionReports||[],l.renditionReports.push(Me);break}default:g.logger.warn("line parsed but not handled: "+Re);break}}}ve&&!ve.relurl?(F.pop(),te-=ve.duration,l.partList&&(l.fragmentHint=ve)):l.partList&&(A(he,ve),he.cc=de,l.fragmentHint=he,ge&&C(he,ge,l));var me=F.length,Ce=F[0],Oe=F[me-1];if(te+=l.skippedSegments*l.targetduration,te>0&&me&&Oe){l.averagetargetduration=te/me;var Se=Oe.sn;l.endSN=Se!=="initSegment"?Se:0,l.live||(Oe.endList=!0),Ce&&(l.startCC=Ce.cc)}else l.endSN=0,l.startCC=0;return l.fragmentHint&&(te+=l.fragmentHint.duration),l.totalduration=te,l.endCC=de,Ne>0&&T(F,Ne),l},p}();function E(p,i){var f,o,a=new s.AttrList(p),L=(f=a.enumeratedString("METHOD"))!=null?f:"",y=a.URI,l=a.hexadecimalInteger("IV"),F=a.enumeratedString("KEYFORMATVERSIONS"),j=(o=a.enumeratedString("KEYFORMAT"))!=null?o:"identity";y&&a.IV&&!l&&g.logger.error("Invalid IV: "+a.IV);var G=y?I.resolve(y,i):"",Y=(F||"1").split("/").map(Number).filter(Number.isFinite);return new m.LevelKey(L,G,j,Y,l)}function x(p,i){["video","audio","text"].forEach(function(f){var o=p.filter(function(L){return(0,h.isCodecType)(L,f)});if(o.length){var a=o.filter(function(L){return L.lastIndexOf("avc1",0)===0||L.lastIndexOf("mp4a",0)===0});i[f+"Codec"]=a.length>0?a[0]:o[0],p=p.filter(function(L){return o.indexOf(L)===-1})}}),i.unknownCodecs=p}function P(p,i,f){var o=i[f];o&&(p[f]=o)}function T(p,i){for(var f=p[i],o=i;o--;){var a=p[o];if(!a)return;a.programDateTime=f.programDateTime-a.duration*1e3,f=a}}function A(p,i){p.rawProgramDateTime?p.programDateTime=Date.parse(p.rawProgramDateTime):i!=null&&i.programDateTime&&(p.programDateTime=i.endProgramDateTime),(0,B.isFiniteNumber)(p.programDateTime)||(p.programDateTime=null,p.rawProgramDateTime=null)}function b(p,i,f,o){p.relurl=i.URI,i.BYTERANGE&&p.setByteRange(i.BYTERANGE),p.level=f,p.sn="initSegment",o&&(p.levelkeys=o),p.initSegment=null}function C(p,i,f){p.levelkeys=i;var o=f.encryptedFragments;(!o.length||o[o.length-1].levelkeys!==i)&&Object.keys(i).some(function(a){return i[a].isCommonEncryption})&&o.push(p)}},"./src/loader/playlist-loader.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>_});var B=R("./src/polyfills/number.ts"),n=R("./src/events.ts"),W=R("./src/errors.ts"),D=R("./src/utils/logger.ts"),N=R("./src/loader/m3u8-parser.ts"),d=R("./src/types/loader.ts"),m=R("./src/utils/attr-list.ts");function s(r){var v=r.type;switch(v){case d.PlaylistContextType.AUDIO_TRACK:return d.PlaylistLevelType.AUDIO;case d.PlaylistContextType.SUBTITLE_TRACK:return d.PlaylistLevelType.SUBTITLE;default:return d.PlaylistLevelType.MAIN}}function g(r,v){var S=r.url;return(S===void 0||S.indexOf("data:")===0)&&(S=v.url),S}var h=function(){function r(S){this.hls=void 0,this.loaders=Object.create(null),this.hls=S,this.registerListeners()}var v=r.prototype;return v.startLoad=function(w){},v.stopLoad=function(){this.destroyInternalLoaders()},v.registerListeners=function(){var w=this.hls;w.on(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.on(n.Events.LEVEL_LOADING,this.onLevelLoading,this),w.on(n.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),w.on(n.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},v.unregisterListeners=function(){var w=this.hls;w.off(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.off(n.Events.LEVEL_LOADING,this.onLevelLoading,this),w.off(n.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),w.off(n.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},v.createInternalLoader=function(w){var I=this.hls.config,E=I.pLoader,x=I.loader,P=E||x,T=new P(I);return w.loader=T,this.loaders[w.type]=T,T},v.getInternalLoader=function(w){return this.loaders[w.type]},v.resetInternalLoader=function(w){this.loaders[w]&&delete this.loaders[w]},v.destroyInternalLoaders=function(){for(var w in this.loaders){var I=this.loaders[w];I&&I.destroy(),this.resetInternalLoader(w)}},v.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},v.onManifestLoading=function(w,I){var E=I.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:d.PlaylistContextType.MANIFEST,url:E,deliveryDirectives:null})},v.onLevelLoading=function(w,I){var E=I.id,x=I.level,P=I.url,T=I.deliveryDirectives;this.load({id:E,groupId:null,level:x,responseType:"text",type:d.PlaylistContextType.LEVEL,url:P,deliveryDirectives:T})},v.onAudioTrackLoading=function(w,I){var E=I.id,x=I.groupId,P=I.url,T=I.deliveryDirectives;this.load({id:E,groupId:x,level:null,responseType:"text",type:d.PlaylistContextType.AUDIO_TRACK,url:P,deliveryDirectives:T})},v.onSubtitleTrackLoading=function(w,I){var E=I.id,x=I.groupId,P=I.url,T=I.deliveryDirectives;this.load({id:E,groupId:x,level:null,responseType:"text",type:d.PlaylistContextType.SUBTITLE_TRACK,url:P,deliveryDirectives:T})},v.load=function(w){var I,E=this.hls.config,x=this.getInternalLoader(w);if(x){var P=x.context;if(P&&P.url===w.url){D.logger.trace("[playlist-loader]: playlist request ongoing");return}D.logger.log("[playlist-loader]: aborting previous loader for type: "+w.type),x.abort()}var T,A,b,C;switch(w.type){case d.PlaylistContextType.MANIFEST:T=E.manifestLoadingMaxRetry,A=E.manifestLoadingTimeOut,b=E.manifestLoadingRetryDelay,C=E.manifestLoadingMaxRetryTimeout;break;case d.PlaylistContextType.LEVEL:case d.PlaylistContextType.AUDIO_TRACK:case d.PlaylistContextType.SUBTITLE_TRACK:T=0,A=E.levelLoadingTimeOut;break;default:T=E.levelLoadingMaxRetry,A=E.levelLoadingTimeOut,b=E.levelLoadingRetryDelay,C=E.levelLoadingMaxRetryTimeout;break}if(x=this.createInternalLoader(w),(I=w.deliveryDirectives)!==null&&I!==void 0&&I.part){var p;if(w.type===d.PlaylistContextType.LEVEL&&w.level!==null?p=this.hls.levels[w.level].details:w.type===d.PlaylistContextType.AUDIO_TRACK&&w.id!==null?p=this.hls.audioTracks[w.id].details:w.type===d.PlaylistContextType.SUBTITLE_TRACK&&w.id!==null&&(p=this.hls.subtitleTracks[w.id].details),p){var i=p.partTarget,f=p.targetduration;i&&f&&(A=Math.min(Math.max(i*3,f*.8)*1e3,A))}}var o={timeout:A,maxRetry:T,retryDelay:b,maxRetryDelay:C,highWaterMark:0},a={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};x.load(w,o,a)},v.loadsuccess=function(w,I,E,x){x===void 0&&(x=null),this.resetInternalLoader(E.type);var P=w.data;if(P.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(w,E,"no EXTM3U delimiter",x);return}I.parsing.start=performance.now(),P.indexOf("#EXTINF:")>0||P.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(w,I,E,x):this.handleMasterPlaylist(w,I,E,x)},v.loaderror=function(w,I,E){E===void 0&&(E=null),this.handleNetworkError(I,E,!1,w)},v.loadtimeout=function(w,I,E){E===void 0&&(E=null),this.handleNetworkError(I,E,!0)},v.handleMasterPlaylist=function(w,I,E,x){var P=this.hls,T=w.data,A=g(w,E),b=N.default.parseMasterPlaylist(T,A),C=b.levels,p=b.sessionData,i=b.sessionKeys;if(!C.length){this.handleManifestParsingError(w,E,"no level found in manifest",x);return}var f=C.map(function(F){return{id:F.attrs.AUDIO,audioCodec:F.audioCodec}}),o=C.map(function(F){return{id:F.attrs.SUBTITLES,textCodec:F.textCodec}}),a=N.default.parseMasterPlaylistMedia(T,A,"AUDIO",f),L=N.default.parseMasterPlaylistMedia(T,A,"SUBTITLES",o),y=N.default.parseMasterPlaylistMedia(T,A,"CLOSED-CAPTIONS");if(a.length){var l=a.some(function(F){return!F.url});!l&&C[0].audioCodec&&!C[0].attrs.AUDIO&&(D.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),a.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new m.AttrList({}),bitrate:0,url:""}))}P.trigger(n.Events.MANIFEST_LOADED,{levels:C,audioTracks:a,subtitles:L,captions:y,url:A,stats:I,networkDetails:x,sessionData:p,sessionKeys:i})},v.handleTrackOrLevelPlaylist=function(w,I,E,x){var P=this.hls,T=E.id,A=E.level,b=E.type,C=g(w,E),p=(0,B.isFiniteNumber)(T)?T:0,i=(0,B.isFiniteNumber)(A)?A:p,f=s(E),o=N.default.parseLevelPlaylist(w.data,C,i,f,p);if(!o.fragments.length){P.trigger(n.Events.ERROR,{type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:C,reason:"no fragments found in level",level:typeof E.level=="number"?E.level:void 0});return}if(b===d.PlaylistContextType.MANIFEST){var a={attrs:new m.AttrList({}),bitrate:0,details:o,name:"",url:C};P.trigger(n.Events.MANIFEST_LOADED,{levels:[a],audioTracks:[],url:C,stats:I,networkDetails:x,sessionData:null,sessionKeys:null})}I.parsing.end=performance.now(),E.levelDetails=o,this.handlePlaylistLoaded(w,I,E,x)},v.handleManifestParsingError=function(w,I,E,x){this.hls.trigger(n.Events.ERROR,{type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:I.type===d.PlaylistContextType.MANIFEST,url:w.url,reason:E,response:w,context:I,networkDetails:x})},v.handleNetworkError=function(w,I,E,x){E===void 0&&(E=!1),D.logger.warn("[playlist-loader]: A network "+(E?"timeout":"error")+" occurred while loading "+w.type+" level: "+w.level+" id: "+w.id+' group-id: "'+w.groupId+'"');var P=W.ErrorDetails.UNKNOWN,T=!1,A=this.getInternalLoader(w);switch(w.type){case d.PlaylistContextType.MANIFEST:P=E?W.ErrorDetails.MANIFEST_LOAD_TIMEOUT:W.ErrorDetails.MANIFEST_LOAD_ERROR,T=!0;break;case d.PlaylistContextType.LEVEL:P=E?W.ErrorDetails.LEVEL_LOAD_TIMEOUT:W.ErrorDetails.LEVEL_LOAD_ERROR,T=!1;break;case d.PlaylistContextType.AUDIO_TRACK:P=E?W.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:W.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,T=!1;break;case d.PlaylistContextType.SUBTITLE_TRACK:P=E?W.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:W.ErrorDetails.SUBTITLE_LOAD_ERROR,T=!1;break}A&&this.resetInternalLoader(w.type);var b={type:W.ErrorTypes.NETWORK_ERROR,details:P,fatal:T,url:w.url,loader:A,context:w,networkDetails:I};x&&(b.response=x),this.hls.trigger(n.Events.ERROR,b)},v.handlePlaylistLoaded=function(w,I,E,x){var P=E.type,T=E.level,A=E.id,b=E.groupId,C=E.loader,p=E.levelDetails,i=E.deliveryDirectives;if(!(p!=null&&p.targetduration)){this.handleManifestParsingError(w,E,"invalid target duration",x);return}if(!C)return;p.live&&(C.getCacheAge&&(p.ageHeader=C.getCacheAge()||0),(!C.getCacheAge||isNaN(p.ageHeader))&&(p.ageHeader=0));switch(P){case d.PlaylistContextType.MANIFEST:case d.PlaylistContextType.LEVEL:this.hls.trigger(n.Events.LEVEL_LOADED,{details:p,level:T||0,id:A||0,stats:I,networkDetails:x,deliveryDirectives:i});break;case d.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(n.Events.AUDIO_TRACK_LOADED,{details:p,id:A||0,groupId:b||"",stats:I,networkDetails:x,deliveryDirectives:i});break;case d.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(n.Events.SUBTITLE_TRACK_LOADED,{details:p,id:A||0,groupId:b||"",stats:I,networkDetails:x,deliveryDirectives:i});break}},r}();const _=h},"./src/polyfills/number.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{MAX_SAFE_INTEGER:()=>n,isFiniteNumber:()=>B});var B=Number.isFinite||function(W){return typeof W=="number"&&isFinite(W)},n=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>n});var B=function(){function W(){}return W.getSilentFrame=function(N,d){switch(N){case"mp4a.40.2":if(d===1)return new Uint8Array([0,200,0,128,35,128]);if(d===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(d===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(d===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(d===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(d===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(d===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(d===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(d===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},W}();const n=B},"./src/remux/mp4-generator.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>W});var B=Math.pow(2,32)-1,n=function(){function D(){}return D.init=function(){D.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 d;for(d in D.types)D.types.hasOwnProperty(d)&&(D.types[d]=[d.charCodeAt(0),d.charCodeAt(1),d.charCodeAt(2),d.charCodeAt(3)]);var m=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]),s=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]);D.HDLR_TYPES={video:m,audio:s};var g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),h=new Uint8Array([0,0,0,0,0,0,0,0]);D.STTS=D.STSC=D.STCO=h,D.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),D.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),D.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),D.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var _=new Uint8Array([105,115,111,109]),r=new Uint8Array([97,118,99,49]),v=new Uint8Array([0,0,0,1]);D.FTYP=D.box(D.types.ftyp,_,v,_,r),D.DINF=D.box(D.types.dinf,D.box(D.types.dref,g))},D.box=function(d){for(var m=8,s=arguments.length,g=new Array(s>1?s-1:0),h=1;h<s;h++)g[h-1]=arguments[h];for(var _=g.length,r=_;_--;)m+=g[_].byteLength;var v=new Uint8Array(m);for(v[0]=m>>24&255,v[1]=m>>16&255,v[2]=m>>8&255,v[3]=m&255,v.set(d,4),_=0,m=8;_<r;_++)v.set(g[_],m),m+=g[_].byteLength;return v},D.hdlr=function(d){return D.box(D.types.hdlr,D.HDLR_TYPES[d])},D.mdat=function(d){return D.box(D.types.mdat,d)},D.mdhd=function(d,m){m*=d;var s=Math.floor(m/(B+1)),g=Math.floor(m%(B+1));return D.box(D.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,d>>24&255,d>>16&255,d>>8&255,d&255,s>>24,s>>16&255,s>>8&255,s&255,g>>24,g>>16&255,g>>8&255,g&255,85,196,0,0]))},D.mdia=function(d){return D.box(D.types.mdia,D.mdhd(d.timescale,d.duration),D.hdlr(d.type),D.minf(d))},D.mfhd=function(d){return D.box(D.types.mfhd,new Uint8Array([0,0,0,0,d>>24,d>>16&255,d>>8&255,d&255]))},D.minf=function(d){return d.type==="audio"?D.box(D.types.minf,D.box(D.types.smhd,D.SMHD),D.DINF,D.stbl(d)):D.box(D.types.minf,D.box(D.types.vmhd,D.VMHD),D.DINF,D.stbl(d))},D.moof=function(d,m,s){return D.box(D.types.moof,D.mfhd(d),D.traf(s,m))},D.moov=function(d){for(var m=d.length,s=[];m--;)s[m]=D.trak(d[m]);return D.box.apply(null,[D.types.moov,D.mvhd(d[0].timescale,d[0].duration)].concat(s).concat(D.mvex(d)))},D.mvex=function(d){for(var m=d.length,s=[];m--;)s[m]=D.trex(d[m]);return D.box.apply(null,[D.types.mvex].concat(s))},D.mvhd=function(d,m){m*=d;var s=Math.floor(m/(B+1)),g=Math.floor(m%(B+1)),h=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,d>>24&255,d>>16&255,d>>8&255,d&255,s>>24,s>>16&255,s>>8&255,s&255,g>>24,g>>16&255,g>>8&255,g&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return D.box(D.types.mvhd,h)},D.sdtp=function(d){var m=d.samples||[],s=new Uint8Array(4+m.length),g,h;for(g=0;g<m.length;g++)h=m[g].flags,s[g+4]=h.dependsOn<<4|h.isDependedOn<<2|h.hasRedundancy;return D.box(D.types.sdtp,s)},D.stbl=function(d){return D.box(D.types.stbl,D.stsd(d),D.box(D.types.stts,D.STTS),D.box(D.types.stsc,D.STSC),D.box(D.types.stsz,D.STSZ),D.box(D.types.stco,D.STCO))},D.avc1=function(d){var m=[],s=[],g,h,_;for(g=0;g<d.sps.length;g++)h=d.sps[g],_=h.byteLength,m.push(_>>>8&255),m.push(_&255),m=m.concat(Array.prototype.slice.call(h));for(g=0;g<d.pps.length;g++)h=d.pps[g],_=h.byteLength,s.push(_>>>8&255),s.push(_&255),s=s.concat(Array.prototype.slice.call(h));var r=D.box(D.types.avcC,new Uint8Array([1,m[3],m[4],m[5],252|3,224|d.sps.length].concat(m).concat([d.pps.length]).concat(s))),v=d.width,S=d.height,w=d.pixelRatio[0],I=d.pixelRatio[1];return D.box(D.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,v>>8&255,v&255,S>>8&255,S&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]),r,D.box(D.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),D.box(D.types.pasp,new Uint8Array([w>>24,w>>16&255,w>>8&255,w&255,I>>24,I>>16&255,I>>8&255,I&255])))},D.esds=function(d){var m=d.config.length;return new Uint8Array([0,0,0,0,3,23+m,0,1,0,4,15+m,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([m]).concat(d.config).concat([6,1,2]))},D.mp4a=function(d){var m=d.samplerate;return D.box(D.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,d.channelCount,0,16,0,0,0,0,m>>8&255,m&255,0,0]),D.box(D.types.esds,D.esds(d)))},D.mp3=function(d){var m=d.samplerate;return D.box(D.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,d.channelCount,0,16,0,0,0,0,m>>8&255,m&255,0,0]))},D.stsd=function(d){return d.type==="audio"?d.segmentCodec==="mp3"&&d.codec==="mp3"?D.box(D.types.stsd,D.STSD,D.mp3(d)):D.box(D.types.stsd,D.STSD,D.mp4a(d)):D.box(D.types.stsd,D.STSD,D.avc1(d))},D.tkhd=function(d){var m=d.id,s=d.duration*d.timescale,g=d.width,h=d.height,_=Math.floor(s/(B+1)),r=Math.floor(s%(B+1));return D.box(D.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,m>>24&255,m>>16&255,m>>8&255,m&255,0,0,0,0,_>>24,_>>16&255,_>>8&255,_&255,r>>24,r>>16&255,r>>8&255,r&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,g>>8&255,g&255,0,0,h>>8&255,h&255,0,0]))},D.traf=function(d,m){var s=D.sdtp(d),g=d.id,h=Math.floor(m/(B+1)),_=Math.floor(m%(B+1));return D.box(D.types.traf,D.box(D.types.tfhd,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255])),D.box(D.types.tfdt,new Uint8Array([1,0,0,0,h>>24,h>>16&255,h>>8&255,h&255,_>>24,_>>16&255,_>>8&255,_&255])),D.trun(d,s.length+16+20+8+16+8+8),s)},D.trak=function(d){return d.duration=d.duration||4294967295,D.box(D.types.trak,D.tkhd(d),D.mdia(d))},D.trex=function(d){var m=d.id;return D.box(D.types.trex,new Uint8Array([0,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},D.trun=function(d,m){var s=d.samples||[],g=s.length,h=12+16*g,_=new Uint8Array(h),r,v,S,w,I,E;for(m+=8+h,_.set([d.type==="video"?1:0,0,15,1,g>>>24&255,g>>>16&255,g>>>8&255,g&255,m>>>24&255,m>>>16&255,m>>>8&255,m&255],0),r=0;r<g;r++)v=s[r],S=v.duration,w=v.size,I=v.flags,E=v.cts,_.set([S>>>24&255,S>>>16&255,S>>>8&255,S&255,w>>>24&255,w>>>16&255,w>>>8&255,w&255,I.isLeading<<2|I.dependsOn,I.isDependedOn<<6|I.hasRedundancy<<4|I.paddingValue<<1|I.isNonSync,I.degradPrio&240<<8,I.degradPrio&15,E>>>24&255,E>>>16&255,E>>>8&255,E&255],12+16*r);return D.box(D.types.trun,_)},D.initSegment=function(d){D.types||D.init();var m=D.moov(d),s=new Uint8Array(D.FTYP.byteLength+m.byteLength);return s.set(D.FTYP),s.set(m,D.FTYP.byteLength),s},D}();n.types=void 0,n.HDLR_TYPES=void 0,n.STTS=void 0,n.STSC=void 0,n.STCO=void 0,n.STSZ=void 0,n.VMHD=void 0,n.SMHD=void 0,n.STSD=void 0,n.FTYP=void 0,n.DINF=void 0;const W=n},"./src/remux/mp4-remuxer.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>w,flushTextTrackMetadataCueSamples:()=>x,flushTextTrackUserdataCueSamples:()=>P,normalizePts:()=>I});var B=R("./src/polyfills/number.ts"),n=R("./src/remux/aac-helper.ts"),W=R("./src/remux/mp4-generator.ts"),D=R("./src/events.ts"),N=R("./src/errors.ts"),d=R("./src/utils/logger.ts"),m=R("./src/types/loader.ts"),s=R("./src/utils/timescale-conversion.ts");function g(){return g=Object.assign?Object.assign.bind():function(b){for(var C=1;C<arguments.length;C++){var p=arguments[C];for(var i in p)Object.prototype.hasOwnProperty.call(p,i)&&(b[i]=p[i])}return b},g.apply(this,arguments)}var h=10*1e3,_=1024,r=1152,v=null,S=null,w=function(){function b(p,i,f,o){if(o===void 0&&(o=""),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.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=p,this.config=i,this.typeSupported=f,this.ISGenerated=!1,v===null){var a=navigator.userAgent||"",L=a.match(/Chrome\/(\d+)/i);v=L?parseInt(L[1]):0}if(S===null){var y=navigator.userAgent.match(/Safari\/(\d+)/i);S=y?parseInt(y[1]):0}}var C=b.prototype;return C.destroy=function(){},C.resetTimeStamp=function(i){d.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=i},C.resetNextTimestamp=function(){d.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},C.resetInitSegment=function(){d.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},C.getVideoStartPts=function(i){var f=!1,o=i.reduce(function(a,L){var y=L.pts-a;return y<-4294967296?(f=!0,I(a,L.pts)):y>0?a:L.pts},i[0].pts);return f&&d.logger.debug("PTS rollover detected"),o},C.remux=function(i,f,o,a,L,y,l,F){var j,G,Y,te,de,ve,he=L,Re=L,we=i.pid>-1,ge=f.pid>-1,Ne=f.samples.length,ze=i.samples.length>0,nt=l&&Ne>0||Ne>1,Ge=(!we||ze)&&(!ge||nt)||this.ISGenerated||l;if(Ge){this.ISGenerated||(Y=this.generateIS(i,f,L));var Xe=this.isVideoContiguous,Be=-1,_e;if(nt&&(Be=E(f.samples),!Xe&&this.config.forceKeyFrameOnDiscontinuity))if(ve=!0,Be>0){d.logger.warn("[mp4-remuxer]: Dropped "+Be+" out of "+Ne+" video samples due to a missing keyframe");var Ze=this.getVideoStartPts(f.samples);f.samples=f.samples.slice(Be),f.dropped+=Be,Re+=(f.samples[0].pts-Ze)/f.inputTimeScale,_e=Re}else Be===-1&&(d.logger.warn("[mp4-remuxer]: No keyframe found out of "+Ne+" video samples"),ve=!1);if(this.ISGenerated){if(ze&&nt){var be=this.getVideoStartPts(f.samples),Le=I(i.samples[0].pts,be)-be,le=Le/f.inputTimeScale;he+=Math.max(0,le),Re+=Math.max(0,-le)}if(ze){if(i.samplerate||(d.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),Y=this.generateIS(i,f,L)),G=this.remuxAudio(i,he,this.isAudioContiguous,y,ge||nt||F===m.PlaylistLevelType.AUDIO?Re:void 0),nt){var ye=G?G.endPTS-G.startPTS:0;f.inputTimeScale||(d.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),Y=this.generateIS(i,f,L)),j=this.remuxVideo(f,Re,Xe,ye)}}else nt&&(j=this.remuxVideo(f,Re,Xe,0));j&&(j.firstKeyFrame=Be,j.independent=Be!==-1,j.firstKeyFramePTS=_e)}}return this.ISGenerated&&(o.samples.length&&(de=x(o,L,this._initPTS,this._initDTS)),a.samples.length&&(te=P(a,L,this._initPTS))),{audio:G,video:j,initSegment:Y,independent:ve,text:te,id3:de}},C.generateIS=function(i,f,o){var a=i.samples,L=f.samples,y=this.typeSupported,l={},F=!(0,B.isFiniteNumber)(this._initPTS),j="audio/mp4",G,Y,te;if(F&&(G=Y=Infinity),i.config&&a.length){i.timescale=i.samplerate;switch(i.segmentCodec){case"mp3":y.mpeg?(j="audio/mpeg",i.codec=""):y.mp3&&(i.codec="mp3");break}l.audio={id:"audio",container:j,codec:i.codec,initSegment:i.segmentCodec==="mp3"&&y.mpeg?new Uint8Array(0):W.default.initSegment([i]),metadata:{channelCount:i.channelCount}},F&&(te=i.inputTimeScale,G=Y=a[0].pts-Math.round(te*o))}if(f.sps&&f.pps&&L.length&&(f.timescale=f.inputTimeScale,l.video={id:"main",container:"video/mp4",codec:f.codec,initSegment:W.default.initSegment([f]),metadata:{width:f.width,height:f.height}},F)){te=f.inputTimeScale;var de=this.getVideoStartPts(L),ve=Math.round(te*o);Y=Math.min(Y,I(L[0].dts,de)-ve),G=Math.min(G,de-ve)}if(Object.keys(l).length)return this.ISGenerated=!0,F&&(this._initPTS=G,this._initDTS=Y),{tracks:l,initPTS:G,timescale:te}},C.remuxVideo=function(i,f,o,a){var L=i.inputTimeScale,y=i.samples,l=[],F=y.length,j=this._initPTS,G=this.nextAvcDts,Y=8,te=this.videoSampleDuration,de,ve,he=Number.POSITIVE_INFINITY,Re=Number.NEGATIVE_INFINITY,we=!1;if(!o||G===null){var ge=f*L,Ne=y[0].pts-I(y[0].dts,y[0].pts);G=ge-Ne}for(var ze=0;ze<F;ze++){var nt=y[ze];nt.pts=I(nt.pts-j,G),nt.dts=I(nt.dts-j,G),nt.dts<y[ze>0?ze-1:ze].dts&&(we=!0)}we&&y.sort(function(jt,on){var Ee=jt.dts-on.dts,se=jt.pts-on.pts;return Ee||se}),de=y[0].dts,ve=y[y.length-1].dts;var Ge=ve-de,Xe=Ge?Math.round(Ge/(F-1)):te||i.inputTimeScale/30;if(o){var Be=de-G,_e=Be>Xe,Ze=Be<-1;if((_e||Ze)&&(_e?d.logger.warn("AVC: "+(0,s.toMsFromMpegTsClock)(Be,!0)+" ms ("+Be+"dts) hole between fragments detected, filling it"):d.logger.warn("AVC: "+(0,s.toMsFromMpegTsClock)(-Be,!0)+" ms ("+Be+"dts) overlapping between fragments detected"),!Ze||G>y[0].pts)){de=G;var be=y[0].pts-Be;y[0].dts=de,y[0].pts=be,d.logger.log("Video: First PTS/DTS adjusted: "+(0,s.toMsFromMpegTsClock)(be,!0)+"/"+(0,s.toMsFromMpegTsClock)(de,!0)+", delta: "+(0,s.toMsFromMpegTsClock)(Be,!0)+" ms")}}de=Math.max(0,de);for(var Le=0,le=0,ye=0;ye<F;ye++){for(var Te=y[ye],Pe=Te.units,He=Pe.length,Ye=0,ct=0;ct<He;ct++)Ye+=Pe[ct].data.length;le+=Ye,Le+=He,Te.length=Ye,Te.dts=Math.max(Te.dts,de),he=Math.min(Te.pts,he),Re=Math.max(Te.pts,Re)}ve=y[F-1].dts;var st=le+4*Le+8,vt;try{vt=new Uint8Array(st)}catch(jt){this.observer.emit(D.Events.ERROR,D.Events.ERROR,{type:N.ErrorTypes.MUX_ERROR,details:N.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:st,reason:"fail allocating video mdat "+st});return}var qe=new DataView(vt.buffer);qe.setUint32(0,st),vt.set(W.default.types.mdat,4);for(var mt=!1,yt=Number.POSITIVE_INFINITY,Je=Number.POSITIVE_INFINITY,et=Number.NEGATIVE_INFINITY,De=Number.NEGATIVE_INFINITY,ke=0;ke<F;ke++){for(var Me=y[ke],me=Me.units,Ce=0,Oe=0,Se=me.length;Oe<Se;Oe++){var Fe=me[Oe],it=Fe.data,Ie=Fe.data.byteLength;qe.setUint32(Y,Ie),Y+=4,vt.set(it,Y),Y+=Ie,Ce+=4+Ie}var Qe=void 0;if(ke<F-1)te=y[ke+1].dts-Me.dts,Qe=y[ke+1].pts-Me.pts;else{var rt=this.config,ft=ke>0?Me.dts-y[ke-1].dts:Xe;if(Qe=ke>0?Me.pts-y[ke-1].pts:Xe,rt.stretchShortVideoTrack&&this.nextAudioPts!==null){var It=Math.floor(rt.maxBufferHole*L),Tt=(a?he+a*L:this.nextAudioPts)-Me.pts;Tt>It?(te=Tt-ft,te<0?te=ft:mt=!0,d.logger.log("[mp4-remuxer]: It is approximately "+Tt/90+" ms to the next segment; using duration "+te/90+" ms for the last video frame.")):te=ft}else te=ft}var Et=Math.round(Me.pts-Me.dts);yt=Math.min(yt,te),et=Math.max(et,te),Je=Math.min(Je,Qe),De=Math.max(De,Qe),l.push(new T(Me.key,te,Ce,Et))}if(l.length){if(v){if(v<70){var Ct=l[0].flags;Ct.dependsOn=2,Ct.isNonSync=0}}else if(S&&(De-Je<et-yt&&Xe/et<.025&&l[0].cts===0)){d.logger.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");for(var dt=de,Nt=0,Xt=l.length;Nt<Xt;Nt++){var Dt=dt+l[Nt].duration,an=dt+l[Nt].cts;if(Nt<Xt-1){var nn=Dt+l[Nt+1].cts;l[Nt].duration=nn-an}else l[Nt].duration=Nt?l[Nt-1].duration:Xe;l[Nt].cts=0,dt=Dt}}}console.assert(te!==null,"mp4SampleDuration must be computed"),te=mt||!te?Xe:te,this.nextAvcDts=G=ve+te,this.videoSampleDuration=te,this.isVideoContiguous=!0;var An=W.default.moof(i.sequenceNumber++,de,g({},i,{samples:l})),_n="video",At={data1:An,data2:vt,startPTS:he/L,endPTS:(Re+te)/L,startDTS:de/L,endDTS:G/L,type:_n,hasAudio:!1,hasVideo:!0,nb:l.length,dropped:i.dropped};return i.samples=[],i.dropped=0,console.assert(vt.length,"MDAT length must not be zero"),At},C.remuxAudio=function(i,f,o,a,L){var y=i.inputTimeScale,l=i.samplerate?i.samplerate:y,F=y/l,j=i.segmentCodec==="aac"?_:r,G=j*F,Y=this._initPTS,te=i.segmentCodec==="mp3"&&this.typeSupported.mpeg,de=[],ve=L!==void 0,he=i.samples,Re=te?0:8,we=this.nextAudioPts||-1,ge=f*y;if(this.isAudioContiguous=o=o||he.length&&we>0&&(a&&Math.abs(ge-we)<9e3||Math.abs(I(he[0].pts-Y,ge)-we)<20*G),he.forEach(function(Fe){Fe.pts=I(Fe.pts-Y,ge)}),!o||we<0){if(he=he.filter(function(Fe){return Fe.pts>=0}),!he.length)return;L===0?we=0:a&&!ve?we=Math.max(0,ge):we=he[0].pts}if(i.segmentCodec==="aac")for(var Ne=this.config.maxAudioFramesDrift,ze=0,nt=we;ze<he.length;ze++){var Ge=he[ze],Xe=Ge.pts,Be=Xe-nt,_e=Math.abs(1e3*Be/y);if(Be<=-Ne*G&&ve)ze===0&&(d.logger.warn("Audio frame @ "+(Xe/y).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Be/y)+" ms."),this.nextAudioPts=we=nt=Xe);else if(Be>=Ne*G&&_e<h&&ve){var Ze=Math.round(Be/G);nt=Xe-Ze*G,nt<0&&(Ze--,nt+=G),ze===0&&(this.nextAudioPts=we=nt),d.logger.warn("[mp4-remuxer]: Injecting "+Ze+" audio frame @ "+(nt/y).toFixed(3)+"s due to "+Math.round(1e3*Be/y)+" ms gap.");for(var be=0;be<Ze;be++){var Le=Math.max(nt,0),le=n.default.getSilentFrame(i.manifestCodec||i.codec,i.channelCount);le||(d.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),le=Ge.unit.subarray()),he.splice(ze,0,{unit:le,pts:Le}),nt+=G,ze++}}Ge.pts=nt,nt+=G}for(var ye=null,Te=null,Pe,He=0,Ye=he.length;Ye--;)He+=he[Ye].unit.byteLength;for(var ct=0,st=he.length;ct<st;ct++){var vt=he[ct],qe=vt.unit,mt=vt.pts;if(Te!==null){var yt=de[ct-1];yt.duration=Math.round((mt-Te)/F)}else if(o&&i.segmentCodec==="aac"&&(mt=we),ye=mt,He>0){He+=Re;try{Pe=new Uint8Array(He)}catch(Fe){this.observer.emit(D.Events.ERROR,D.Events.ERROR,{type:N.ErrorTypes.MUX_ERROR,details:N.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:He,reason:"fail allocating audio mdat "+He});return}if(!te){var Je=new DataView(Pe.buffer);Je.setUint32(0,He),Pe.set(W.default.types.mdat,4)}}else return;Pe.set(qe,Re);var et=qe.byteLength;Re+=et,de.push(new T(!0,j,et,0)),Te=mt}var De=de.length;if(!De)return;var ke=de[de.length-1];this.nextAudioPts=we=Te+F*ke.duration;var Me=te?new Uint8Array(0):W.default.moof(i.sequenceNumber++,ye/F,g({},i,{samples:de}));i.samples=[];var me=ye/y,Ce=we/y,Oe="audio",Se={data1:Me,data2:Pe,startPTS:me,endPTS:Ce,startDTS:me,endDTS:Ce,type:Oe,hasAudio:!0,hasVideo:!1,nb:De};return this.isAudioContiguous=!0,console.assert(Pe.length,"MDAT length must not be zero"),Se},C.remuxEmptyAudio=function(i,f,o,a){var L=i.inputTimeScale,y=i.samplerate?i.samplerate:L,l=L/y,F=this.nextAudioPts,j=(F!==null?F:a.startDTS*L)+this._initDTS,G=a.endDTS*L+this._initDTS,Y=l*_,te=Math.ceil((G-j)/Y),de=n.default.getSilentFrame(i.manifestCodec||i.codec,i.channelCount);if(d.logger.warn("[mp4-remuxer]: remux empty Audio"),!de){d.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ve=[],he=0;he<te;he++){var Re=j+he*Y;ve.push({unit:de,pts:Re,dts:Re})}return i.samples=ve,this.remuxAudio(i,f,o,!1)},b}();function I(b,C){var p;if(C===null)return b;for(C<b?p=-8589934592:p=8589934592;Math.abs(b-C)>4294967296;)b+=p;return b}function E(b){for(var C=0;C<b.length;C++)if(b[C].key)return C;return-1}function x(b,C,p,i){var f=b.samples.length;if(!f)return;for(var o=b.inputTimeScale,a=0;a<f;a++){var L=b.samples[a];L.pts=I(L.pts-p,C*o)/o,L.dts=I(L.dts-i,C*o)/o}var y=b.samples;return b.samples=[],{samples:y}}function P(b,C,p){var i=b.samples.length;if(!i)return;for(var f=b.inputTimeScale,o=0;o<i;o++){var a=b.samples[o];a.pts=I(a.pts-p,C*f)/f}b.samples.sort(function(y,l){return y.pts-l.pts});var L=b.samples;return b.samples=[],{samples:L}}var T=function(C,p,i,f){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=p,this.size=i,this.cts=f,this.flags=new A(C)},A=function(C){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=C?2:1,this.isNonSync=C?0:1}},"./src/remux/passthrough-remuxer.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>s});var B=R("./src/polyfills/number.ts"),n=R("./src/remux/mp4-remuxer.ts"),W=R("./src/utils/mp4-tools.ts"),D=R("./src/loader/fragment.ts"),N=R("./src/utils/logger.ts"),d=function(){function g(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndTime=null}var h=g.prototype;return h.destroy=function(){},h.resetTimeStamp=function(r){this.initPTS=r,this.lastEndTime=null},h.resetNextTimestamp=function(){this.lastEndTime=null},h.resetInitSegment=function(r,v,S,w){this.audioCodec=v,this.videoCodec=S,this.generateInitSegment((0,W.patchEncyptionData)(r,w)),this.emitInitSegment=!0},h.generateInitSegment=function(r){var v=this.audioCodec,S=this.videoCodec;if(!r||!r.byteLength){this.initTracks=void 0,this.initData=void 0;return}var w=this.initData=(0,W.parseInitSegment)(r);v||(v=m(w.audio,D.ElementaryStreamTypes.AUDIO)),S||(S=m(w.video,D.ElementaryStreamTypes.VIDEO));var I={};w.audio&&w.video?I.audiovideo={container:"video/mp4",codec:v+","+S,initSegment:r,id:"main"}:w.audio?I.audio={container:"audio/mp4",codec:v,initSegment:r,id:"audio"}:w.video?I.video={container:"video/mp4",codec:S,initSegment:r,id:"main"}:N.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=I},h.remux=function(r,v,S,w,I){var E,x=this.initPTS,P=this.lastEndTime,T={audio:void 0,video:void 0,text:w,id3:S,initSegment:void 0};(0,B.isFiniteNumber)(P)||(P=this.lastEndTime=I||0);var A=v.samples;if(!A||!A.length)return T;var b={initPTS:void 0,timescale:1},C=this.initData;if((!C||!C.length)&&(this.generateInitSegment(A),C=this.initData),!C||!C.length)return N.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),T;this.emitInitSegment&&(b.tracks=this.initTracks,this.emitInitSegment=!1);var p=(0,W.getStartDTS)(C,A);(0,B.isFiniteNumber)(x)||(this.initPTS=b.initPTS=x=p-I);var i=(0,W.getDuration)(A,C),f=r?p-x:P,o=f+i;(0,W.offsetStartDTS)(C,A,x),i>0?this.lastEndTime=o:(N.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var a=!!C.audio,L=!!C.video,y="";a&&(y+="audio"),L&&(y+="video");var l={data1:A,startPTS:f,startDTS:f,endPTS:o,endDTS:o,type:y,hasAudio:a,hasVideo:L,nb:1,dropped:0};T.audio=l.type==="audio"?l:void 0,T.video=l.type!=="audio"?l:void 0,T.initSegment=b;var F=(E=this.initPTS)!=null?E:0;return T.id3=(0,n.flushTextTrackMetadataCueSamples)(S,I,F,F),w.samples.length&&(T.text=(0,n.flushTextTrackUserdataCueSamples)(w,I,F)),T},g}();function m(g,h){var _=g==null?void 0:g.codec;return _&&_.length>4?_:_==="hvc1"||_==="hev1"?"hvc1.1.c.L120.90":_==="av01"?"av01.0.04M.08":_==="avc1"||h===D.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}const s=d},"./src/task-loop.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>B});var B=function(){function n(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var W=n.prototype;return W.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},W.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},W.onHandlerDestroyed=function(){},W.hasInterval=function(){return!!this._tickInterval},W.hasNextTick=function(){return!!this._tickTimer},W.setInterval=function(N){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,N),!0)},W.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},W.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},W.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},W.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},W.doTick=function(){},n}()},"./src/types/cmcd.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{CMCDObjectType:()=>n,CMCDStreamType:()=>D,CMCDStreamingFormat:()=>W,CMCDVersion:()=>B});var B=1,n;(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"})(n||(n={}));var W;(function(N){N.DASH="d",N.HLS="h",N.SMOOTH="s",N.OTHER="o"})(W||(W={}));var D;(function(N){N.VOD="v",N.LIVE="l"})(D||(D={}))},"./src/types/demuxer.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{MetadataSchema:()=>B});var B;(function(n){n.audioId3="org.id3",n.dateRange="com.apple.quicktime.HLS",n.emsg="https://aomedia.org/emsg/ID3"})(B||(B={}))},"./src/types/level.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{HdcpLevels:()=>N,HlsSkip:()=>d,HlsUrlParameters:()=>s,Level:()=>g,getSkipValue:()=>m});function B(h,_){for(var r=0;r<_.length;r++){var v=_[r];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(h,W(v.key),v)}}function n(h,_,r){return _&&B(h.prototype,_),r&&B(h,r),Object.defineProperty(h,"prototype",{writable:!1}),h}function W(h){var _=D(h,"string");return typeof _=="symbol"?_:String(_)}function D(h,_){if(typeof h!="object"||h===null)return h;var r=h[Symbol.toPrimitive];if(r!==void 0){var v=r.call(h,_||"default");if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_==="string"?String:Number)(h)}var N=["NONE","TYPE-0","TYPE-1","TYPE-2",null],d;(function(h){h.No="",h.Yes="YES",h.v2="v2"})(d||(d={}));function m(h,_){var r=h.canSkipUntil,v=h.canSkipDateRanges,S=h.endSN,w=_!==void 0?_-S:0;return r&&w<r?v?d.v2:d.Yes:d.No}var s=function(){function h(r,v,S){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=r,this.part=v,this.skip=S}var _=h.prototype;return _.addDirectives=function(v){var S=new self.URL(v);return this.msn!==void 0&&S.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&S.searchParams.set("_HLS_part",this.part.toString()),this.skip&&S.searchParams.set("_HLS_skip",this.skip),S.href},h}(),g=function(){function h(_){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=[_.url],this.attrs=_.attrs,this.bitrate=_.bitrate,_.details&&(this.details=_.details),this.id=_.id||0,this.name=_.name,this.width=_.width||0,this.height=_.height||0,this.audioCodec=_.audioCodec,this.videoCodec=_.videoCodec,this.unknownCodecs=_.unknownCodecs,this.codecSet=[_.videoCodec,_.audioCodec].filter(function(r){return r}).join(",").replace(/\.[^.,]+/g,"")}return n(h,[{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(r){var v=r%this.url.length;this._urlId!==v&&(this.details=void 0,this._urlId=v)}}]),h}()},"./src/types/loader.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{PlaylistContextType:()=>B,PlaylistLevelType:()=>n});var B;(function(W){W.MANIFEST="manifest",W.LEVEL="level",W.AUDIO_TRACK="audioTrack",W.SUBTITLE_TRACK="subtitleTrack"})(B||(B={}));var n;(function(W){W.MAIN="main",W.AUDIO="audio",W.SUBTITLE="subtitle"})(n||(n={}))},"./src/types/transmuxer.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{ChunkMetadata:()=>B});var B=function(D,N,d,m,s,g){m===void 0&&(m=0),s===void 0&&(s=-1),g===void 0&&(g=!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=n(),this.buffering={audio:n(),video:n(),audiovideo:n()},this.level=D,this.sn=N,this.id=d,this.size=m,this.part=s,this.partial=g};function n(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{AttrList:()=>W});var B=/^(\d+)x(\d+)$/,n=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,W=function(){function D(d){typeof d=="string"&&(d=D.parseAttrList(d));for(var m in d)d.hasOwnProperty(m)&&(this[m]=d[m])}var N=D.prototype;return N.decimalInteger=function(m){var s=parseInt(this[m],10);return s>Number.MAX_SAFE_INTEGER?Infinity:s},N.hexadecimalInteger=function(m){if(this[m]){var s=(this[m]||"0x").slice(2);s=(s.length&1?"0":"")+s;for(var g=new Uint8Array(s.length/2),h=0;h<s.length/2;h++)g[h]=parseInt(s.slice(h*2,h*2+2),16);return g}else return null},N.hexadecimalIntegerAsNumber=function(m){var s=parseInt(this[m],16);return s>Number.MAX_SAFE_INTEGER?Infinity:s},N.decimalFloatingPoint=function(m){return parseFloat(this[m])},N.optionalFloat=function(m,s){var g=this[m];return g?parseFloat(g):s},N.enumeratedString=function(m){return this[m]},N.bool=function(m){return this[m]==="YES"},N.decimalResolution=function(m){var s=B.exec(this[m]);return s===null?void 0:{width:parseInt(s[1],10),height:parseInt(s[2],10)}},D.parseAttrList=function(m){var s,g={},h='"';for(n.lastIndex=0;(s=n.exec(m))!==null;){var _=s[2];_.indexOf(h)===0&&_.lastIndexOf(h)===_.length-1&&(_=_.slice(1,-1)),g[s[1]]=_}return g},D}()},"./src/utils/binary-search.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>n});var B={search:function(D,N){for(var d=0,m=D.length-1,s=null,g=null;d<=m;){s=(d+m)/2|0,g=D[s];var h=N(g);if(h>0)d=s+1;else if(h<0)m=s-1;else return g}return null}};const n=B},"./src/utils/buffer-helper.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{BufferHelper:()=>W});var B=R("./src/utils/logger.ts"),n={length:0,start:function(){return 0},end:function(){return 0}},W=function(){function D(){}return D.isBuffered=function(d,m){try{if(d){for(var s=D.getBuffered(d),g=0;g<s.length;g++)if(m>=s.start(g)&&m<=s.end(g))return!0}}catch(h){}return!1},D.bufferInfo=function(d,m,s){try{if(d){var g=D.getBuffered(d),h=[],_;for(_=0;_<g.length;_++)h.push({start:g.start(_),end:g.end(_)});return this.bufferedInfo(h,m,s)}}catch(r){}return{len:0,start:m,end:m,nextStart:void 0}},D.bufferedInfo=function(d,m,s){m=Math.max(0,m),d.sort(function(T,A){var b=T.start-A.start;return b||A.end-T.end});var g=[];if(s)for(var h=0;h<d.length;h++){var _=g.length;if(_){var r=g[_-1].end;d[h].start-r<s?d[h].end>r&&(g[_-1].end=d[h].end):g.push(d[h])}else g.push(d[h])}else g=d;for(var v=0,S,w=m,I=m,E=0;E<g.length;E++){var x=g[E].start,P=g[E].end;if(m+s>=x&&m<P)w=x,I=P,v=I-m;else if(m+s<x){S=x;break}}return{len:v,start:w||0,end:I||0,nextStart:S}},D.getBuffered=function(d){try{return d.buffered}catch(m){return B.logger.log("failed to get media.buffered",m),n}},D}()},"./src/utils/cea-608-parser.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{CaptionScreen:()=>E,Row:()=>I,default:()=>C});var B=R("./src/utils/logger.ts"),n={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},W=function(i){var f=i;return n.hasOwnProperty(i)&&(f=n[i]),String.fromCharCode(f)},D=15,N=100,d={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},m={17:2,18:4,21:6,22:8,23:10,19:13,20:15},s={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},g={25:2,26:4,29:6,30:8,31:10,27:13,28:15},h=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],_;(function(p){p[p.ERROR=0]="ERROR",p[p.TEXT=1]="TEXT",p[p.WARNING=2]="WARNING",p[p.INFO=2]="INFO",p[p.DEBUG=3]="DEBUG",p[p.DATA=3]="DATA"})(_||(_={}));var r=function(){function p(){this.time=null,this.verboseLevel=_.ERROR}var i=p.prototype;return i.log=function(o,a){if(this.verboseLevel>=o){var L=typeof a=="function"?a():a;B.logger.log(this.time+" ["+o+"] "+L)}},p}(),v=function(i){for(var f=[],o=0;o<i.length;o++)f.push(i[o].toString(16));return f},S=function(){function p(f,o,a,L,y){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=f||"white",this.underline=o||!1,this.italics=a||!1,this.background=L||"black",this.flash=y||!1}var i=p.prototype;return i.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},i.setStyles=function(o){for(var a=["foreground","underline","italics","background","flash"],L=0;L<a.length;L++){var y=a[L];o.hasOwnProperty(y)&&(this[y]=o[y])}},i.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},i.equals=function(o){return this.foreground===o.foreground&&this.underline===o.underline&&this.italics===o.italics&&this.background===o.background&&this.flash===o.flash},i.copy=function(o){this.foreground=o.foreground,this.underline=o.underline,this.italics=o.italics,this.background=o.background,this.flash=o.flash},i.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},p}(),w=function(){function p(f,o,a,L,y,l){this.uchar=void 0,this.penState=void 0,this.uchar=f||" ",this.penState=new S(o,a,L,y,l)}var i=p.prototype;return i.reset=function(){this.uchar=" ",this.penState.reset()},i.setChar=function(o,a){this.uchar=o,this.penState.copy(a)},i.setPenState=function(o){this.penState.copy(o)},i.equals=function(o){return this.uchar===o.uchar&&this.penState.equals(o.penState)},i.copy=function(o){this.uchar=o.uchar,this.penState.copy(o.penState)},i.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},p}(),I=function(){function p(f){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var o=0;o<N;o++)this.chars.push(new w);this.logger=f,this.pos=0,this.currPenState=new S}var i=p.prototype;return i.equals=function(o){for(var a=!0,L=0;L<N;L++)if(!this.chars[L].equals(o.chars[L])){a=!1;break}return a},i.copy=function(o){for(var a=0;a<N;a++)this.chars[a].copy(o.chars[a])},i.isEmpty=function(){for(var o=!0,a=0;a<N;a++)if(!this.chars[a].isEmpty()){o=!1;break}return o},i.setCursor=function(o){this.pos!==o&&(this.pos=o),this.pos<0?(this.logger.log(_.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>N&&(this.logger.log(_.DEBUG,"Too large cursor position "+this.pos),this.pos=N)},i.moveCursor=function(o){var a=this.pos+o;if(o>1)for(var L=this.pos+1;L<a+1;L++)this.chars[L].setPenState(this.currPenState);this.setCursor(a)},i.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},i.insertChar=function(o){var a=this;o>=144&&this.backSpace();var L=W(o);if(this.pos>=N){this.logger.log(_.ERROR,function(){return"Cannot insert "+o.toString(16)+" ("+L+") at position "+a.pos+". Skipping it!"});return}this.chars[this.pos].setChar(L,this.currPenState),this.moveCursor(1)},i.clearFromPos=function(o){var a;for(a=o;a<N;a++)this.chars[a].reset()},i.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},i.clearToEndOfRow=function(){this.clearFromPos(this.pos)},i.getTextString=function(){for(var o=[],a=!0,L=0;L<N;L++){var y=this.chars[L].uchar;y!==" "&&(a=!1),o.push(y)}return a?"":o.join("")},i.setPenStyles=function(o){this.currPenState.setStyles(o);var a=this.chars[this.pos];a.setPenState(this.currPenState)},p}(),E=function(){function p(f){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var o=0;o<D;o++)this.rows.push(new I(f));this.logger=f,this.currRow=D-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var i=p.prototype;return i.reset=function(){for(var o=0;o<D;o++)this.rows[o].clear();this.currRow=D-1},i.equals=function(o){for(var a=!0,L=0;L<D;L++)if(!this.rows[L].equals(o.rows[L])){a=!1;break}return a},i.copy=function(o){for(var a=0;a<D;a++)this.rows[a].copy(o.rows[a])},i.isEmpty=function(){for(var o=!0,a=0;a<D;a++)if(!this.rows[a].isEmpty()){o=!1;break}return o},i.backSpace=function(){var o=this.rows[this.currRow];o.backSpace()},i.clearToEndOfRow=function(){var o=this.rows[this.currRow];o.clearToEndOfRow()},i.insertChar=function(o){var a=this.rows[this.currRow];a.insertChar(o)},i.setPen=function(o){var a=this.rows[this.currRow];a.setPenStyles(o)},i.moveCursor=function(o){var a=this.rows[this.currRow];a.moveCursor(o)},i.setCursor=function(o){this.logger.log(_.INFO,"setCursor: "+o);var a=this.rows[this.currRow];a.setCursor(o)},i.setPAC=function(o){this.logger.log(_.INFO,function(){return"pacData = "+JSON.stringify(o)});var a=o.row-1;if(this.nrRollUpRows&&a<this.nrRollUpRows-1&&(a=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==a){for(var L=0;L<D;L++)this.rows[L].clear();var y=this.currRow+1-this.nrRollUpRows,l=this.lastOutputScreen;if(l){var F=l.rows[y].cueStartTime,j=this.logger.time;if(F&&j!==null&&F<j)for(var G=0;G<this.nrRollUpRows;G++)this.rows[a-this.nrRollUpRows+G+1].copy(l.rows[y+G])}}this.currRow=a;var Y=this.rows[this.currRow];if(o.indent!==null){var te=o.indent,de=Math.max(te-1,0);Y.setCursor(o.indent),o.color=Y.chars[de].penState.foreground}var ve={foreground:o.color,underline:o.underline,italics:o.italics,background:"black",flash:!1};this.setPen(ve)},i.setBkgData=function(o){this.logger.log(_.INFO,function(){return"bkgData = "+JSON.stringify(o)}),this.backSpace(),this.setPen(o),this.insertChar(32)},i.setRollUpRows=function(o){this.nrRollUpRows=o},i.rollUp=function(){var o=this;if(this.nrRollUpRows===null){this.logger.log(_.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(_.TEXT,function(){return o.getDisplayText()});var a=this.currRow+1-this.nrRollUpRows,L=this.rows.splice(a,1)[0];L.clear(),this.rows.splice(this.currRow,0,L),this.logger.log(_.INFO,"Rolling up")},i.getDisplayText=function(o){o=o||!1;for(var a=[],L="",y=-1,l=0;l<D;l++){var F=this.rows[l].getTextString();F&&(y=l+1,o?a.push("Row "+y+": '"+F+"'"):a.push(F.trim()))}return a.length>0&&(o?L="["+a.join(" | ")+"]":L=a.join(`
`)),L},i.getTextAndFormat=function(){return this.rows},p}(),x=function(){function p(f,o,a){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=f,this.outputFilter=o,this.mode=null,this.verbose=0,this.displayedMemory=new E(a),this.nonDisplayedMemory=new E(a),this.lastOutputScreen=new E(a),this.currRollUpRow=this.displayedMemory.rows[D-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=a}var i=p.prototype;return i.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[D-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},i.getHandler=function(){return this.outputFilter},i.setHandler=function(o){this.outputFilter=o},i.setPAC=function(o){this.writeScreen.setPAC(o)},i.setBkgData=function(o){this.writeScreen.setBkgData(o)},i.setMode=function(o){if(o===this.mode)return;this.mode=o,this.logger.log(_.INFO,function(){return"MODE="+o}),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=o},i.insertChars=function(o){for(var a=this,L=0;L<o.length;L++)this.writeScreen.insertChar(o[L]);var y=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(_.INFO,function(){return y+": "+a.writeScreen.getDisplayText(!0)}),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(_.TEXT,function(){return"DISPLAYED: "+a.displayedMemory.getDisplayText(!0)}),this.outputDataUpdate())},i.ccRCL=function(){this.logger.log(_.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},i.ccBS=function(){if(this.logger.log(_.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},i.ccAOF=function(){},i.ccAON=function(){},i.ccDER=function(){this.logger.log(_.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},i.ccRU=function(o){this.logger.log(_.INFO,"RU("+o+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(o)},i.ccFON=function(){this.logger.log(_.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},i.ccRDC=function(){this.logger.log(_.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},i.ccTR=function(){this.logger.log(_.INFO,"TR"),this.setMode("MODE_TEXT")},i.ccRTD=function(){this.logger.log(_.INFO,"RTD"),this.setMode("MODE_TEXT")},i.ccEDM=function(){this.logger.log(_.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},i.ccCR=function(){this.logger.log(_.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},i.ccENM=function(){this.logger.log(_.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},i.ccEOC=function(){var o=this;if(this.logger.log(_.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var a=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=a,this.writeScreen=this.nonDisplayedMemory,this.logger.log(_.TEXT,function(){return"DISP: "+o.displayedMemory.getDisplayText()})}this.outputDataUpdate(!0)},i.ccTO=function(o){this.logger.log(_.INFO,"TO("+o+") - Tab Offset"),this.writeScreen.moveCursor(o)},i.ccMIDROW=function(o){var a={flash:!1};if(a.underline=o%2===1,a.italics=o>=46,a.italics)a.foreground="white";else{var L=Math.floor(o/2)-16,y=["white","green","blue","cyan","red","yellow","magenta"];a.foreground=y[L]}this.logger.log(_.INFO,"MIDROW: "+JSON.stringify(a)),this.writeScreen.setPen(a)},i.outputDataUpdate=function(o){o===void 0&&(o=!1);var a=this.logger.time;if(a===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=a:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,a,this.lastOutputScreen),o&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:a),this.lastOutputScreen.copy(this.displayedMemory))},i.cueSplitAtTime=function(o){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,o,this.displayedMemory),this.cueStartTime=o))},p}(),P=function(){function p(f,o,a){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var L=new r;this.channels=[null,new x(f,o,L),new x(f+1,a,L)],this.cmdHistory=b(),this.logger=L}var i=p.prototype;return i.getHandler=function(o){return this.channels[o].getHandler()},i.setHandler=function(o,a){this.channels[o].setHandler(a)},i.addData=function(o,a){var L,y,l,F=!1;this.logger.time=o;for(var j=0;j<a.length;j+=2){if(y=a[j]&127,l=a[j+1]&127,y===0&&l===0)continue;if(this.logger.log(_.DATA,"["+v([a[j],a[j+1]])+"] -> ("+v([y,l])+")"),L=this.parseCmd(y,l),L||(L=this.parseMidrow(y,l)),L||(L=this.parsePAC(y,l)),L||(L=this.parseBackgroundAttributes(y,l)),!L&&(F=this.parseChars(y,l),F)){var G=this.currentChannel;if(G&&G>0){var Y=this.channels[G];Y.insertChars(F)}else this.logger.log(_.WARNING,"No channel found yet. TEXT-MODE?")}!L&&!F&&this.logger.log(_.WARNING,"Couldn't parse cleaned data "+v([y,l])+" orig: "+v([a[j],a[j+1]]))}},i.parseCmd=function(o,a){var L=this.cmdHistory,y=(o===20||o===28||o===21||o===29)&&a>=32&&a<=47,l=(o===23||o===31)&&a>=33&&a<=35;if(!(y||l))return!1;if(A(o,a,L))return T(null,null,L),this.logger.log(_.DEBUG,"Repeated command ("+v([o,a])+") is dropped"),!0;var F=o===20||o===21||o===23?1:2,j=this.channels[F];return o===20||o===21||o===28||o===29?a===32?j.ccRCL():a===33?j.ccBS():a===34?j.ccAOF():a===35?j.ccAON():a===36?j.ccDER():a===37?j.ccRU(2):a===38?j.ccRU(3):a===39?j.ccRU(4):a===40?j.ccFON():a===41?j.ccRDC():a===42?j.ccTR():a===43?j.ccRTD():a===44?j.ccEDM():a===45?j.ccCR():a===46?j.ccENM():a===47&&j.ccEOC():j.ccTO(a-32),T(o,a,L),this.currentChannel=F,!0},i.parseMidrow=function(o,a){var L=0;if((o===17||o===25)&&a>=32&&a<=47){if(o===17?L=1:L=2,L!==this.currentChannel)return this.logger.log(_.ERROR,"Mismatch channel in midrow parsing"),!1;var y=this.channels[L];return y?(y.ccMIDROW(a),this.logger.log(_.DEBUG,"MIDROW ("+v([o,a])+")"),!0):!1}return!1},i.parsePAC=function(o,a){var L,y=this.cmdHistory,l=(o>=17&&o<=23||o>=25&&o<=31)&&a>=64&&a<=127,F=(o===16||o===24)&&a>=64&&a<=95;if(!(l||F))return!1;if(A(o,a,y))return T(null,null,y),!0;var j=o<=23?1:2;a>=64&&a<=95?L=j===1?d[o]:s[o]:L=j===1?m[o]:g[o];var G=this.channels[j];return G?(G.setPAC(this.interpretPAC(L,a)),T(o,a,y),this.currentChannel=j,!0):!1},i.interpretPAC=function(o,a){var L,y={color:null,italics:!1,indent:null,underline:!1,row:o};return a>95?L=a-96:L=a-64,y.underline=(L&1)===1,L<=13?y.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(L/2)]:L<=15?(y.italics=!0,y.color="white"):y.indent=Math.floor((L-16)/2)*4,y},i.parseChars=function(o,a){var L,y=null,l=null;if(o>=25?(L=2,l=o-8):(L=1,l=o),l>=17&&l<=19){var F;l===17?F=a+80:l===18?F=a+112:F=a+144,this.logger.log(_.INFO,"Special char '"+W(F)+"' in channel "+L),y=[F]}else o>=32&&o<=127&&(y=a===0?[o]:[o,a]);if(y){var j=v(y);this.logger.log(_.DEBUG,"Char codes = "+j.join(",")),T(o,a,this.cmdHistory)}return y},i.parseBackgroundAttributes=function(o,a){var L=(o===16||o===24)&&a>=32&&a<=47,y=(o===23||o===31)&&a>=45&&a<=47;if(!(L||y))return!1;var l,F={};o===16||o===24?(l=Math.floor((a-32)/2),F.background=h[l],a%2===1&&(F.background=F.background+"_semi")):a===45?F.background="transparent":(F.foreground="black",a===47&&(F.underline=!0));var j=o<=23?1:2,G=this.channels[j];return G.setBkgData(F),T(o,a,this.cmdHistory),!0},i.reset=function(){for(var o=0;o<Object.keys(this.channels).length;o++){var a=this.channels[o];a&&a.reset()}this.cmdHistory=b()},i.cueSplitAtTime=function(o){for(var a=0;a<this.channels.length;a++){var L=this.channels[a];L&&L.cueSplitAtTime(o)}},p}();function T(p,i,f){f.a=p,f.b=i}function A(p,i,f){return f.a===p&&f.b===i}function b(){return{a:null,b:null}}const C=P},"./src/utils/codecs.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{isCodecSupportedInMp4:()=>W,isCodecType:()=>n});var B={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,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,dva1:!0,dvav:!0,dvh1:!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 n(D,N){var d=B[N];return!!d&&d[D.slice(0,4)]===!0}function W(D,N){return MediaSource.isTypeSupported((N||"video")+'/mp4;codecs="'+D+'"')}},"./src/utils/cues.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>d});var B=R("./src/utils/vttparser.ts"),n=R("./src/utils/webvtt-parser.ts"),W=R("./src/utils/texttrack-utils.ts"),D=/\s/,N={newCue:function(s,g,h,_){for(var r=[],v,S,w,I,E,x=self.VTTCue||self.TextTrackCue,P=0;P<_.rows.length;P++)if(v=_.rows[P],w=!0,I=0,E="",!v.isEmpty()){for(var T=0;T<v.chars.length;T++)D.test(v.chars[T].uchar)&&w?I++:(E+=v.chars[T].uchar,w=!1);v.cueStartTime=g,g===h&&(h+=1e-4),I>=16?I--:I++;var A=(0,B.fixLineBreaks)(E.trim()),b=(0,n.generateCueId)(g,h,A);(!s||!s.cues||!s.cues.getCueById(b))&&(S=new x(g,h,A),S.id=b,S.line=P+1,S.align="left",S.position=10+Math.min(80,Math.floor(I*8/32)*10),r.push(S))}return s&&r.length&&(r.sort(function(C,p){return C.line==="auto"||p.line==="auto"?0:C.line>8&&p.line>8?p.line-C.line:C.line-p.line}),r.forEach(function(C){return(0,W.addCueToTrack)(s,C)})),r}};const d=N},"./src/utils/discontinuities.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{adjustSlidingStart:()=>s,alignMediaPlaylistByPDT:()=>r,alignPDT:()=>_,alignStream:()=>g,findDiscontinuousReferenceFrag:()=>d,findFirstFragWithCC:()=>D,shouldAlignOnDiscontinuities:()=>N});var B=R("./src/polyfills/number.ts"),n=R("./src/utils/logger.ts"),W=R("./src/controller/level-helper.ts");function D(v,S){for(var w=null,I=0,E=v.length;I<E;I++){var x=v[I];if(x&&x.cc===S){w=x;break}}return w}function N(v,S,w){return!!(S.details&&(w.endCC>w.startCC||v&&v.cc<w.startCC))}function d(v,S,w){w===void 0&&(w=0);var I=v.fragments,E=S.fragments;if(!E.length||!I.length){n.logger.log("No fragments to align");return}var x=D(I,E[0].cc);if(!x||x&&!x.startPTS){n.logger.log("No frag in previous level to align on");return}return x}function m(v,S){if(v){var w=v.start+S;v.start=v.startPTS=w,v.endPTS=w+v.duration}}function s(v,S){for(var w=S.fragments,I=0,E=w.length;I<E;I++)m(w[I],v);S.fragmentHint&&m(S.fragmentHint,v),S.alignedSliding=!0}function g(v,S,w){if(!S)return;h(v,w,S),!w.alignedSliding&&S.details&&_(w,S.details),!w.alignedSliding&&S.details&&!w.skippedSegments&&(0,W.adjustSliding)(S.details,w)}function h(v,S,w){if(N(v,w,S)){var I=d(w.details,S);I&&(0,B.isFiniteNumber)(I.start)&&(n.logger.log("Adjusting PTS using last level due to CC increase within current level "+S.url),s(I.start,S))}}function _(v,S){if(!S.fragments.length||!v.hasProgramDateTime||!S.hasProgramDateTime)return;var w=S.fragments[0].programDateTime,I=v.fragments[0].programDateTime,E=(I-w)/1e3+S.fragments[0].start;E&&(0,B.isFiniteNumber)(E)&&(n.logger.log("Adjusting PTS using programDateTime delta "+(I-w)+"ms, sliding:"+E.toFixed(3)+" "+v.url+" "),s(E,v))}function r(v,S){if(!v.hasProgramDateTime||!S.hasProgramDateTime)return;var w=v.fragments,I=S.fragments;if(!w.length||!I.length)return;var E=Math.round(I.length/2)-1,x=I[E],P=D(w,x.cc)||w[Math.round(w.length/2)-1],T=x.programDateTime,A=P.programDateTime;if(T===null||A===null)return;var b=(A-T)/1e3-(P.start-x.start);s(b,v)}},"./src/utils/ewma-bandwidth-estimator.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>W});var B=R("./src/utils/ewma.ts"),n=function(){function D(d,m,s){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=s,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new B.default(d),this.fast_=new B.default(m)}var N=D.prototype;return N.update=function(m,s){var g=this.slow_,h=this.fast_;this.slow_.halfLife!==m&&(this.slow_=new B.default(m,g.getEstimate(),g.getTotalWeight())),this.fast_.halfLife!==s&&(this.fast_=new B.default(s,h.getEstimate(),h.getTotalWeight()))},N.sample=function(m,s){m=Math.max(m,this.minDelayMs_);var g=8*s,h=m/1e3,_=g/h;this.fast_.sample(h,_),this.slow_.sample(h,_)},N.canEstimate=function(){var m=this.fast_;return m&&m.getTotalWeight()>=this.minWeight_},N.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},N.destroy=function(){},D}();const W=n},"./src/utils/ewma.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>n});var B=function(){function W(N,d,m){d===void 0&&(d=0),m===void 0&&(m=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=N,this.alpha_=N?Math.exp(Math.log(.5)/N):0,this.estimate_=d,this.totalWeight_=m}var D=W.prototype;return D.sample=function(d,m){var s=Math.pow(this.alpha_,d);this.estimate_=m*(1-s)+s*this.estimate_,this.totalWeight_+=d},D.getTotalWeight=function(){return this.totalWeight_},D.getEstimate=function(){if(this.alpha_){var d=1-Math.pow(this.alpha_,this.totalWeight_);if(d)return this.estimate_/d}return this.estimate_},W}();const n=B},"./src/utils/fetch-loader.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>E,fetchSupported:()=>r});var B=R("./src/polyfills/number.ts"),n=R("./src/loader/load-stats.ts"),W=R("./src/demux/chunk-cache.ts");function D(x,P){x.prototype=Object.create(P.prototype),x.prototype.constructor=x,g(x,P)}function N(x){var P=typeof Map=="function"?new Map:void 0;return N=function(A){if(A===null||!s(A))return A;if(typeof A!="function")throw new TypeError("Super expression must either be null or a function");if(typeof P!="undefined"){if(P.has(A))return P.get(A);P.set(A,b)}function b(){return d(A,arguments,h(this).constructor)}return b.prototype=Object.create(A.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),g(b,A)},N(x)}function d(x,P,T){return m()?d=Reflect.construct.bind():d=function(b,C,p){var i=[null];i.push.apply(i,C);var f=Function.bind.apply(b,i),o=new f;return p&&g(o,p.prototype),o},d.apply(null,arguments)}function m(){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(x){return!1}}function s(x){return Function.toString.call(x).indexOf("[native code]")!==-1}function g(x,P){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,b){return A.__proto__=b,A},g(x,P)}function h(x){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(T){return T.__proto__||Object.getPrototypeOf(T)},h(x)}function _(){return _=Object.assign?Object.assign.bind():function(x){for(var P=1;P<arguments.length;P++){var T=arguments[P];for(var A in T)Object.prototype.hasOwnProperty.call(T,A)&&(x[A]=T[A])}return x},_.apply(this,arguments)}function r(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(x){}return!1}var v=function(){function x(T){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=T.fetchSetup||w,this.controller=new self.AbortController,this.stats=new n.LoadStats}var P=x.prototype;return P.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},P.abortInternal=function(){var A=this.response;(!A||!A.ok)&&(this.stats.aborted=!0,this.controller.abort())},P.abort=function(){var A;this.abortInternal(),(A=this.callbacks)!==null&&A!==void 0&&A.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},P.load=function(A,b,C){var p=this,i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();var f=S(A,this.controller.signal),o=C.onProgress,a=A.responseType==="arraybuffer",L=a?"byteLength":"length";this.context=A,this.config=b,this.callbacks=C,this.request=this.fetchSetup(A,f),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){p.abortInternal(),C.onTimeout(i,A,p.response)},b.timeout),self.fetch(this.request).then(function(y){if(p.response=p.loader=y,!y.ok){var l=y.status,F=y.statusText;throw new I(F||"fetch, bad network response",l,y)}return i.loading.first=Math.max(self.performance.now(),i.loading.start),i.total=parseInt(y.headers.get("Content-Length")||"0"),o&&(0,B.isFiniteNumber)(b.highWaterMark)?p.loadProgressively(y,i,A,b.highWaterMark,o):a?y.arrayBuffer():y.text()}).then(function(y){var l=p.response;self.clearTimeout(p.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);var F=y[L];F&&(i.loaded=i.total=F);var j={url:l.url,data:y};o&&!(0,B.isFiniteNumber)(b.highWaterMark)&&o(i,A,y,l),C.onSuccess(j,i,A,l)}).catch(function(y){if(self.clearTimeout(p.requestTimeout),i.aborted)return;var l=y&&y.code||0,F=y?y.message:null;C.onError({code:l,text:F},A,y?y.details:null)})},P.getCacheAge=function(){var A=null;if(this.response){var b=this.response.headers.get("age");A=b?parseFloat(b):null}return A},P.loadProgressively=function(A,b,C,p,i){p===void 0&&(p=0);var f=new W.default,o=A.body.getReader(),a=function L(){return o.read().then(function(y){if(y.done)return f.dataLength&&i(b,C,f.flush(),A),Promise.resolve(new ArrayBuffer(0));var l=y.value,F=l.length;return b.loaded+=F,F<p||f.dataLength?(f.push(l),f.dataLength>=p&&i(b,C,f.flush(),A)):i(b,C,l,A),L()}).catch(function(){return Promise.reject()})};return a()},x}();function S(x,P){var T={method:"GET",mode:"cors",credentials:"same-origin",signal:P,headers:new self.Headers(_({},x.headers))};return x.rangeEnd&&T.headers.set("Range","bytes="+x.rangeStart+"-"+String(x.rangeEnd-1)),T}function w(x,P){return new self.Request(x.url,P)}var I=function(x){D(P,x);function P(T,A,b){var C;return C=x.call(this,T)||this,C.code=void 0,C.details=void 0,C.code=A,C.details=b,C}return P}(N(Error));const E=v},"./src/utils/hex.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>n});var B={hexDump:function(D){for(var N="",d=0;d<D.length;d++){var m=D[d].toString(16);m.length<2&&(m="0"+m),N+=m}return N}};const n=B},"./src/utils/imsc1-ttml-parser.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{IMSC1_CODEC:()=>s,parseIMSC1:()=>r});var B=R("./src/utils/mp4-tools.ts"),n=R("./src/utils/vttparser.ts"),W=R("./src/utils/vttcue.ts"),D=R("./src/demux/id3.ts"),N=R("./src/utils/timescale-conversion.ts"),d=R("./src/utils/webvtt-parser.ts");function m(){return m=Object.assign?Object.assign.bind():function(C){for(var p=1;p<arguments.length;p++){var i=arguments[p];for(var f in i)Object.prototype.hasOwnProperty.call(i,f)&&(C[f]=i[f])}return C},m.apply(this,arguments)}var s="stpp.ttml.im1t",g=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,h=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,_={left:"start",center:"center",right:"end",start:"start",end:"end"};function r(C,p,i,f,o){var a=(0,B.findBox)(new Uint8Array(C),["mdat"]);if(a.length===0){o(new Error("Could not parse IMSC1 mdat"));return}var L=a.map(function(l){return(0,D.utf8ArrayToStr)(l)}),y=(0,N.toTimescaleFromScale)(p,1,i);try{L.forEach(function(l){return f(v(l,y))})}catch(l){o(l)}}function v(C,p){var i=new DOMParser,f=i.parseFromString(C,"text/xml"),o=f.getElementsByTagName("tt")[0];if(!o)throw new Error("Invalid ttml");var a={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},L=Object.keys(a).reduce(function(G,Y){return G[Y]=o.getAttribute("ttp:"+Y)||a[Y],G},{}),y=o.getAttribute("xml:space")!=="preserve",l=w(S(o,"styling","style")),F=w(S(o,"layout","region")),j=S(o,"body","[begin]");return[].map.call(j,function(G){var Y=I(G,y);if(!Y||!G.hasAttribute("begin"))return null;var te=T(G.getAttribute("begin"),L),de=T(G.getAttribute("dur"),L),ve=T(G.getAttribute("end"),L);if(te===null)throw P(G);if(ve===null){if(de===null)throw P(G);ve=te+de}var he=new W.default(te-p,ve-p,Y);he.id=(0,d.generateCueId)(he.startTime,he.endTime,he.text);var Re=F[G.getAttribute("region")],we=l[G.getAttribute("style")],ge=E(Re,we,l),Ne=ge.textAlign;if(Ne){var ze=_[Ne];ze&&(he.lineAlign=ze),he.align=Ne}return m(he,ge),he}).filter(function(G){return G!==null})}function S(C,p,i){var f=C.getElementsByTagName(p)[0];return f?[].slice.call(f.querySelectorAll(i)):[]}function w(C){return C.reduce(function(p,i){var f=i.getAttribute("xml:id");return f&&(p[f]=i),p},{})}function I(C,p){return[].slice.call(C.childNodes).reduce(function(i,f,o){var a;return f.nodeName==="br"&&o?i+`
`:(a=f.childNodes)!==null&&a!==void 0&&a.length?I(f,p):p?i+f.textContent.trim().replace(/\s+/g," "):i+f.textContent},"")}function E(C,p,i){var f="http://www.w3.org/ns/ttml#styling",o=null,a=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],L=C!=null&&C.hasAttribute("style")?C.getAttribute("style"):null;return L&&i.hasOwnProperty(L)&&(o=i[L]),a.reduce(function(y,l){var F=x(p,f,l)||x(C,f,l)||x(o,f,l);return F&&(y[l]=F),y},{})}function x(C,p,i){return C&&C.hasAttributeNS(p,i)?C.getAttributeNS(p,i):null}function P(C){return new Error("Could not parse ttml timestamp "+C)}function T(C,p){if(!C)return null;var i=(0,n.parseTimeStamp)(C);return i===null&&(g.test(C)?i=A(C,p):h.test(C)&&(i=b(C,p))),i}function A(C,p){var i=g.exec(C),f=(i[4]|0)+(i[5]|0)/p.subFrameRate;return(i[1]|0)*3600+(i[2]|0)*60+(i[3]|0)+f/p.frameRate}function b(C,p){var i=h.exec(C),f=Number(i[1]),o=i[2];switch(o){case"h":return f*3600;case"m":return f*60;case"ms":return f*1e3;case"f":return f/p.frameRate;case"t":return f/p.tickRate}return f}},"./src/utils/keysystem-util.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{changeEndianness:()=>W,convertDataUriToArrayBytes:()=>D,strToUtf8array:()=>N});var B=R("./src/utils/numeric-encoding-utils.ts");function n(d){var m=N(d).subarray(0,16),s=new Uint8Array(16);return s.set(m,16-m.length),s}function W(d){var m=function(g,h,_){var r=g[h];g[h]=g[_],g[_]=r};m(d,0,3),m(d,1,2),m(d,4,5),m(d,6,7)}function D(d){var m=d.split(":"),s=null;if(m[0]==="data"&&m.length===2){var g=m[1].split(";"),h=g[g.length-1].split(",");if(h.length===2){var _=h[0]==="base64",r=h[1];_?(g.splice(-1,1),s=(0,B.base64Decode)(r)):s=n(r)}}return s}function N(d){return Uint8Array.from(unescape(encodeURIComponent(d)),function(m){return m.charCodeAt(0)})}},"./src/utils/logger.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{enableLogs:()=>d,logger:()=>m});var B=function(){},n={trace:B,debug:B,log:B,warn:B,info:B,error:B},W=n;function D(s){var g=self.console[s];return g?g.bind(self.console,"["+s+"] >"):B}function N(s){for(var g=arguments.length,h=new Array(g>1?g-1:0),_=1;_<g;_++)h[_-1]=arguments[_];h.forEach(function(r){W[r]=s[r]?s[r].bind(s):D(r)})}function d(s,g){if(self.console&&s===!0||typeof s=="object"){N(s,"debug","log","info","warn","error");try{W.log('Debug logs enabled for "'+g+'"')}catch(h){W=n}}else W=n}var m=W},"./src/utils/mediakeys-helper.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{KeySystemFormats:()=>n,KeySystemIds:()=>D,KeySystems:()=>B,getKeySystemsForConfig:()=>m,getSupportedMediaKeySystemConfigurations:()=>g,keySystemDomainToKeySystemFormat:()=>d,keySystemFormatToKeySystemDomain:()=>W,keySystemIdToKeySystemDomain:()=>N,requestMediaKeySystemAccess:()=>s});var B;(function(_){_.CLEARKEY="org.w3.clearkey",_.FAIRPLAY="com.apple.fps",_.PLAYREADY="com.microsoft.playready",_.WIDEVINE="com.widevine.alpha"})(B||(B={}));var n;(function(_){_.CLEARKEY="org.w3.clearkey",_.FAIRPLAY="com.apple.streamingkeydelivery",_.PLAYREADY="com.microsoft.playready",_.WIDEVINE="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"})(n||(n={}));function W(_){switch(_){case n.FAIRPLAY:return B.FAIRPLAY;case n.PLAYREADY:return B.PLAYREADY;case n.WIDEVINE:return B.WIDEVINE;case n.CLEARKEY:return B.CLEARKEY}}var D;(function(_){_.WIDEVINE="edef8ba979d64acea3c827dcd51d21ed"})(D||(D={}));function N(_){if(_===D.WIDEVINE)return B.WIDEVINE}function d(_){switch(_){case B.FAIRPLAY:return n.FAIRPLAY;case B.PLAYREADY:return n.PLAYREADY;case B.WIDEVINE:return n.WIDEVINE;case B.CLEARKEY:return n.CLEARKEY}}function m(_){var r=_.drmSystems,v=_.widevineLicenseUrl,S=r?[B.FAIRPLAY,B.WIDEVINE,B.PLAYREADY,B.CLEARKEY].filter(function(w){return!!r[w]}):[];return!S[B.WIDEVINE]&&v&&S.push(B.WIDEVINE),S}var s=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function g(_,r,v,S){var w;switch(_){case B.FAIRPLAY:w=["cenc","sinf"];break;case B.WIDEVINE:case B.PLAYREADY:w=["cenc"];break;case B.CLEARKEY:w=["cenc","keyids"];break;default:throw new Error("Unknown key-system: "+_)}return h(w,r,v,S)}function h(_,r,v,S){var w={initDataTypes:_,persistentState:S.persistentState||"not-allowed",distinctiveIdentifier:S.distinctiveIdentifier||"not-allowed",sessionTypes:S.sessionTypes||[S.sessionType||"temporary"],audioCapabilities:r.map(function(I){return{contentType:'audio/mp4; codecs="'+I+'"',robustness:S.audioRobustness||"",encryptionScheme:S.audioEncryptionScheme||null}}),videoCapabilities:v.map(function(I){return{contentType:'video/mp4; codecs="'+I+'"',robustness:S.videoRobustness||"",encryptionScheme:S.videoEncryptionScheme||null}})};return[w]}},"./src/utils/mediasource-helper.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{getMediaSource:()=>B});function B(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{RemuxerTrackIdConfig:()=>s,appendUint8Array:()=>p,bin2str:()=>g,computeRawDurationFromSamples:()=>A,discardEPB:()=>L,findBox:()=>S,getDuration:()=>T,getStartDTS:()=>P,mp4Box:()=>l,mp4pssh:()=>F,offsetStartDTS:()=>b,parseEmsg:()=>y,parseInitSegment:()=>I,parsePssh:()=>j,parseSEIMessageFromNALu:()=>a,parseSamples:()=>i,parseSegmentIndex:()=>w,parseSinf:()=>x,patchEncyptionData:()=>E,readSint32:()=>r,readUint16:()=>h,readUint32:()=>_,segmentValidRange:()=>C,writeUint32:()=>v});var B=R("./src/loader/fragment.ts"),n=R("./src/utils/typed-array.ts"),W=R("./src/demux/id3.ts"),D=R("./src/utils/logger.ts"),N=R("./src/utils/hex.ts"),d=Math.pow(2,32)-1,m=[].push,s={video:1,audio:2,id3:3,text:4};function g(G){return String.fromCharCode.apply(null,G)}function h(G,Y){var te=G[Y]<<8|G[Y+1];return te<0?65536+te:te}function _(G,Y){var te=r(G,Y);return te<0?4294967296+te:te}function r(G,Y){return G[Y]<<24|G[Y+1]<<16|G[Y+2]<<8|G[Y+3]}function v(G,Y,te){G[Y]=te>>24,G[Y+1]=te>>16&255,G[Y+2]=te>>8&255,G[Y+3]=te&255}function S(G,Y){var te=[];if(!Y.length)return te;for(var de=G.byteLength,ve=0;ve<de;){var he=_(G,ve),Re=g(G.subarray(ve+4,ve+8)),we=he>1?ve+he:de;if(Re===Y[0])if(Y.length===1)te.push(G.subarray(ve+8,we));else{var ge=S(G.subarray(ve+8,we),Y.slice(1));ge.length&&m.apply(te,ge)}ve=we}return te}function w(G){var Y=[],te=G[0],de=8,ve=_(G,de);de+=4;var he=0,Re=0;te===0?de+=8:de+=16,de+=2;var we=G.length+Re,ge=h(G,de);de+=2;for(var Ne=0;Ne<ge;Ne++){var ze=de,nt=_(G,ze);ze+=4;var Ge=nt&2147483647,Xe=(nt&2147483648)>>>31;if(Xe===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Be=_(G,ze);ze+=4,Y.push({referenceSize:Ge,subsegmentDuration:Be,info:{duration:Be/ve,start:we,end:we+Ge-1}}),we+=Ge,ze+=4,de=ze}return{earliestPresentationTime:he,timescale:ve,version:te,referencesCount:ge,references:Y}}function I(G){for(var Y=[],te=S(G,["moov","trak"]),de=0;de<te.length;de++){var ve=te[de],he=S(ve,["tkhd"])[0];if(he){var Re=he[0],we=Re===0?12:20,ge=_(he,we),Ne=S(ve,["mdia","mdhd"])[0];if(Ne){Re=Ne[0],we=Re===0?12:20;var ze=_(Ne,we),nt=S(ve,["mdia","hdlr"])[0];if(nt){var Ge=g(nt.subarray(8,12)),Xe={soun:B.ElementaryStreamTypes.AUDIO,vide:B.ElementaryStreamTypes.VIDEO}[Ge];if(Xe){var Be=S(ve,["mdia","minf","stbl","stsd"])[0],_e=void 0;Be&&(_e=g(Be.subarray(12,16))),Y[ge]={timescale:ze,type:Xe},Y[Xe]={timescale:ze,id:ge,codec:_e}}}}}}var Ze=S(G,["moov","mvex","trex"]);return Ze.forEach(function(be){var Le=_(be,4),le=Y[Le];le&&(le.default={duration:_(be,12),flags:_(be,20)})}),Y}function E(G,Y){if(!G||!Y)return G;var te=Y.keyId;if(te&&Y.isCommonEncryption){var de=S(G,["moov","trak"]);de.forEach(function(ve){var he=S(ve,["mdia","minf","stbl","stsd"])[0],Re=he.subarray(8),we=S(Re,["enca"]),ge=we.length>0;ge||(we=S(Re,["encv"])),we.forEach(function(Ne){var ze=ge?Ne.subarray(28):Ne.subarray(78),nt=S(ze,["sinf"]);nt.forEach(function(Ge){var Xe=x(Ge);if(Xe){var Be=Xe.subarray(8,24);Be.some(function(_e){return _e!==0})||(D.logger.log("[eme] Patching keyId in 'enc"+(ge?"a":"v")+">sinf>>tenc' box: "+N.default.hexDump(Be)+" -> "+N.default.hexDump(te)),Xe.set(te,8))}})})})}return G}function x(G){var Y=S(G,["schm"])[0];if(Y){var te=g(Y.subarray(4,8));if(te==="cbcs"||te==="cenc")return S(G,["schi","tenc"])[0]}return D.logger.error("[eme] missing 'schm' box"),null}function P(G,Y){return S(Y,["moof","traf"]).reduce(function(te,de){var ve=S(de,["tfdt"])[0],he=ve[0],Re=S(de,["tfhd"]).reduce(function(we,ge){var Ne=_(ge,4),ze=G[Ne];if(ze){var nt=_(ve,4);he===1&&(nt*=Math.pow(2,32),nt+=_(ve,8));var Ge=ze.timescale||9e4,Xe=nt/Ge;if(isFinite(Xe)&&(we===null||Xe<we))return Xe}return we},null);return Re!==null&&isFinite(Re)&&(te===null||Re<te)?Re:te},null)||0}function T(G,Y){for(var te=0,de=0,ve=0,he=S(G,["moof","traf"]),Re=0;Re<he.length;Re++){var we=he[Re],ge=S(we,["tfhd"])[0],Ne=_(ge,4),ze=Y[Ne];if(!ze)continue;var nt=ze.default,Ge=_(ge,0)|(nt==null?void 0:nt.flags),Xe=nt==null?void 0:nt.duration;Ge&8&&(Ge&2?Xe=_(ge,12):Xe=_(ge,8));for(var Be=ze.timescale||9e4,_e=S(we,["trun"]),Ze=0;Ze<_e.length;Ze++){if(te=A(_e[Ze]),!te&&Xe){var be=_(_e[Ze],4);te=Xe*be}ze.type===B.ElementaryStreamTypes.VIDEO?de+=te/Be:ze.type===B.ElementaryStreamTypes.AUDIO&&(ve+=te/Be)}}if(de===0&&ve===0){for(var Le=0,le=S(G,["sidx"]),ye=0;ye<le.length;ye++){var Te=w(le[ye]);Te!=null&&Te.references&&(Le+=Te.references.reduce(function(Pe,He){return Pe+He.info.duration||0},0))}return Le}return de||ve}function A(G){var Y=_(G,0),te=8;Y&1&&(te+=4),Y&4&&(te+=4);for(var de=0,ve=_(G,4),he=0;he<ve;he++){if(Y&256){var Re=_(G,te);de+=Re,te+=4}Y&512&&(te+=4),Y&1024&&(te+=4),Y&2048&&(te+=4)}return de}function b(G,Y,te){S(Y,["moof","traf"]).forEach(function(de){S(de,["tfhd"]).forEach(function(ve){var he=_(ve,4),Re=G[he];if(!Re)return;var we=Re.timescale||9e4;S(de,["tfdt"]).forEach(function(ge){var Ne=ge[0],ze=_(ge,4);if(Ne===0)ze-=te*we,ze=Math.max(ze,0),v(ge,4,ze);else{ze*=Math.pow(2,32),ze+=_(ge,8),ze-=te*we,ze=Math.max(ze,0);var nt=Math.floor(ze/(d+1)),Ge=Math.floor(ze%(d+1));v(ge,4,nt),v(ge,8,Ge)}})})})}function C(G){var Y={valid:null,remainder:null},te=S(G,["moof"]);if(te){if(te.length<2)return Y.remainder=G,Y}else return Y;var de=te[te.length-1];return Y.valid=(0,n.sliceUint8)(G,0,de.byteOffset-8),Y.remainder=(0,n.sliceUint8)(G,de.byteOffset-8),Y}function p(G,Y){var te=new Uint8Array(G.length+Y.length);return te.set(G),te.set(Y,G.length),te}function i(G,Y){var te=[],de=Y.samples,ve=Y.timescale,he=Y.id,Re=!1,we=S(de,["moof"]);return we.map(function(ge){var Ne=ge.byteOffset-8,ze=S(ge,["traf"]);ze.map(function(nt){var Ge=S(nt,["tfdt"]).map(function(Xe){var Be=Xe[0],_e=_(Xe,4);return Be===1&&(_e*=Math.pow(2,32),_e+=_(Xe,8)),_e/ve})[0];return Ge!==void 0&&(G=Ge),S(nt,["tfhd"]).map(function(Xe){var Be=_(Xe,4),_e=_(Xe,0)&16777215,Ze=(_e&1)!==0,be=(_e&2)!==0,Le=(_e&8)!==0,le=0,ye=(_e&16)!==0,Te=0,Pe=(_e&32)!==0,He=8;Be===he&&(Ze&&(He+=8),be&&(He+=4),Le&&(le=_(Xe,He),He+=4),ye&&(Te=_(Xe,He),He+=4),Pe&&(He+=4),Y.type==="video"&&(Re=f(Y.codec)),S(nt,["trun"]).map(function(Ye){var ct=Ye[0],st=_(Ye,0)&16777215,vt=(st&1)!==0,qe=0,mt=(st&4)!==0,yt=(st&256)!==0,Je=0,et=(st&512)!==0,De=0,ke=(st&1024)!==0,Me=(st&2048)!==0,me=0,Ce=_(Ye,4),Oe=8;vt&&(qe=_(Ye,Oe),Oe+=4),mt&&(Oe+=4);for(var Se=qe+Ne,Fe=0;Fe<Ce;Fe++){if(yt?(Je=_(Ye,Oe),Oe+=4):Je=le,et?(De=_(Ye,Oe),Oe+=4):De=Te,ke&&(Oe+=4),Me&&(ct===0?me=_(Ye,Oe):me=r(Ye,Oe),Oe+=4),Y.type===B.ElementaryStreamTypes.VIDEO)for(var it=0;it<De;){var Ie=_(de,Se);if(Se+=4,o(Re,de[Se])){var Qe=de.subarray(Se,Se+Ie);a(Qe,Re?2:1,G+me/ve,te)}Se+=Ie,it+=Ie+4}G+=Je/ve}}))})})}),te}function f(G){if(!G)return!1;var Y=G.indexOf("."),te=Y<0?G:G.substring(0,Y);return te==="hvc1"||te==="hev1"||te==="dvh1"||te==="dvhe"}function o(G,Y){if(G){var te=Y>>1&63;return te===39||te===40}else{var de=Y&31;return de===6}}function a(G,Y,te,de){var ve=L(G),he=0;he+=Y;for(var Re=0,we=0,ge=!1,Ne=0;he<ve.length;){Re=0;do{if(he>=ve.length)break;Ne=ve[he++],Re+=Ne}while(Ne===255);we=0;do{if(he>=ve.length)break;Ne=ve[he++],we+=Ne}while(Ne===255);var ze=ve.length-he;if(!ge&&Re===4&&he<ve.length){ge=!0;var nt=ve[he++];if(nt===181){var Ge=h(ve,he);if(he+=2,Ge===49){var Xe=_(ve,he);if(he+=4,Xe===1195456820){var Be=ve[he++];if(Be===3){var _e=ve[he++],Ze=31&_e,be=64&_e,Le=be?2+Ze*3:0,le=new Uint8Array(Le);if(be){le[0]=_e;for(var ye=1;ye<Le;ye++)le[ye]=ve[he++]}de.push({type:Be,payloadType:Re,pts:te,bytes:le})}}}}}else if(Re===5&&we<ze){if(ge=!0,we>16){for(var Te=[],Pe=0;Pe<16;Pe++){var He=ve[he++].toString(16);Te.push(He.length==1?"0"+He:He),(Pe===3||Pe===5||Pe===7||Pe===9)&&Te.push("-")}for(var Ye=we-16,ct=new Uint8Array(Ye),st=0;st<Ye;st++)ct[st]=ve[he++];de.push({payloadType:Re,pts:te,uuid:Te.join(""),userData:(0,W.utf8ArrayToStr)(ct),userDataBytes:ct})}}else if(we<ze)he+=we;else if(we>ze)break}}function L(G){for(var Y=G.byteLength,te=[],de=1;de<Y-2;)G[de]===0&&G[de+1]===0&&G[de+2]===3?(te.push(de+2),de+=2):de++;if(te.length===0)return G;var ve=Y-te.length,he=new Uint8Array(ve),Re=0;for(de=0;de<ve;Re++,de++)Re===te[0]&&(Re++,te.shift()),he[de]=G[Re];return he}function y(G){var Y=G[0],te="",de="",ve=0,he=0,Re=0,we=0,ge=0,Ne=0;if(Y===0){for(;g(G.subarray(Ne,Ne+1))!=="\0";)te+=g(G.subarray(Ne,Ne+1)),Ne+=1;for(te+=g(G.subarray(Ne,Ne+1)),Ne+=1;g(G.subarray(Ne,Ne+1))!=="\0";)de+=g(G.subarray(Ne,Ne+1)),Ne+=1;de+=g(G.subarray(Ne,Ne+1)),Ne+=1,ve=_(G,12),he=_(G,16),we=_(G,20),ge=_(G,24),Ne=28}else if(Y===1){Ne+=4,ve=_(G,Ne),Ne+=4;var ze=_(G,Ne);Ne+=4;var nt=_(G,Ne);for(Ne+=4,Re=Math.pow(2,32)*ze+nt,Number.isSafeInteger(Re)||(Re=Number.MAX_SAFE_INTEGER,console.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),we=_(G,Ne),Ne+=4,ge=_(G,Ne),Ne+=4;g(G.subarray(Ne,Ne+1))!=="\0";)te+=g(G.subarray(Ne,Ne+1)),Ne+=1;for(te+=g(G.subarray(Ne,Ne+1)),Ne+=1;g(G.subarray(Ne,Ne+1))!=="\0";)de+=g(G.subarray(Ne,Ne+1)),Ne+=1;de+=g(G.subarray(Ne,Ne+1)),Ne+=1}var Ge=G.subarray(Ne,G.byteLength);return{schemeIdUri:te,value:de,timeScale:ve,presentationTime:Re,presentationTimeDelta:he,eventDuration:we,id:ge,payload:Ge}}function l(G){for(var Y=arguments.length,te=new Array(Y>1?Y-1:0),de=1;de<Y;de++)te[de-1]=arguments[de];for(var ve=te.length,he=8,Re=ve;Re--;)he+=te[Re].byteLength;var we=new Uint8Array(he);for(we[0]=he>>24&255,we[1]=he>>16&255,we[2]=he>>8&255,we[3]=he&255,we.set(G,4),Re=0,he=8;Re<ve;Re++)we.set(te[Re],he),he+=te[Re].byteLength;return we}function F(G,Y,te){if(G.byteLength!==16)throw new RangeError("Invalid system id");var de,ve;if(Y){de=1,ve=new Uint8Array(Y.length*16);for(var he=0;he<Y.length;he++){var Re=Y[he];if(Re.byteLength!==16)throw new RangeError("Invalid key");ve.set(Re,he*16)}}else de=0,ve=new Uint8Array;var we;de>0?(we=new Uint8Array(4),Y.length>0&&new DataView(we.buffer).setUint32(0,Y.length,!1)):we=new Uint8Array;var ge=new Uint8Array(4);return te&&te.byteLength>0&&new DataView(ge.buffer).setUint32(0,te.byteLength,!1),l([112,115,115,104],new Uint8Array([de,0,0,0]),G,we,ve,ge,te||new Uint8Array)}function j(G){if(!(G instanceof ArrayBuffer)||G.byteLength<32)return null;var Y={version:0,systemId:"",kids:null,data:null},te=new DataView(G),de=te.getUint32(0);if(G.byteLength!==de&&de>44)return null;var ve=te.getUint32(4);if(ve!==1886614376)return null;if(Y.version=te.getUint32(8)>>>24,Y.version>1)return null;Y.systemId=N.default.hexDump(new Uint8Array(G,12,16));var he=te.getUint32(28);if(Y.version===0){if(de-32<he)return null;Y.data=new Uint8Array(G,32,he)}else if(Y.version===1){Y.kids=[];for(var Re=0;Re<he;Re++)Y.kids.push(new Uint8Array(G,32+Re*16,16))}return Y}},"./src/utils/numeric-encoding-utils.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{base64Decode:()=>d,base64DecodeToStr:()=>W,base64Encode:()=>D,base64ToBase64Url:()=>B,base64UrlEncode:()=>N,strToBase64Encode:()=>n});function B(m){return m.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function n(m){return btoa(m)}function W(m){return atob(m)}function D(m){return btoa(String.fromCharCode.apply(String,m))}function N(m){return B(D(m))}function d(m){return Uint8Array.from(atob(m),function(s){return s.charCodeAt(0)})}},"./src/utils/output-filter.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>B});var B=function(){function n(D,N){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=D,this.trackName=N}var W=n.prototype;return W.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},W.newCue=function(N,d,m){(this.startTime===null||this.startTime>N)&&(this.startTime=N),this.endTime=d,this.screen=m,this.timelineController.createCaptionsTrack(this.trackName)},W.reset=function(){this.cueRanges=[],this.startTime=null},n}()},"./src/utils/texttrack-utils.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{addCueToTrack:()=>W,clearCurrentCues:()=>D,getCuesInRange:()=>m,removeCuesInRange:()=>N,sendAddTrackEvent:()=>n});var B=R("./src/utils/logger.ts");function n(s,g){var h;try{h=new Event("addtrack")}catch(_){h=document.createEvent("Event"),h.initEvent("addtrack",!1,!1)}h.track=s,g.dispatchEvent(h)}function W(s,g){var h=s.mode;if(h==="disabled"&&(s.mode="hidden"),s.cues&&!s.cues.getCueById(g.id))try{if(s.addCue(g),!s.cues.getCueById(g.id))throw new Error("addCue is failed for: "+g)}catch(r){B.logger.debug("[texttrack-utils]: "+r);var _=new self.TextTrackCue(g.startTime,g.endTime,g.text);_.id=g.id,s.addCue(_)}h==="disabled"&&(s.mode=h)}function D(s){var g=s.mode;if(g==="disabled"&&(s.mode="hidden"),s.cues)for(var h=s.cues.length;h--;)s.removeCue(s.cues[h]);g==="disabled"&&(s.mode=g)}function N(s,g,h,_){var r=s.mode;if(r==="disabled"&&(s.mode="hidden"),s.cues&&s.cues.length>0)for(var v=m(s.cues,g,h),S=0;S<v.length;S++)(!_||_(v[S]))&&s.removeCue(v[S]);r==="disabled"&&(s.mode=r)}function d(s,g){if(g<s[0].startTime)return 0;var h=s.length-1;if(g>s[h].endTime)return-1;for(var _=0,r=h;_<=r;){var v=Math.floor((r+_)/2);if(g<s[v].startTime)r=v-1;else if(g>s[v].startTime&&_<h)_=v+1;else return v}return s[_].startTime-g<g-s[r].startTime?_:r}function m(s,g,h){var _=[],r=d(s,g);if(r>-1)for(var v=r,S=s.length;v<S;v++){var w=s[v];if(w.startTime>=g&&w.endTime<=h)_.push(w);else if(w.startTime>h)return _}return _}},"./src/utils/time-ranges.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>n});var B={toString:function(D){for(var N="",d=D.length,m=0;m<d;m++)N+="["+D.start(m).toFixed(3)+"-"+D.end(m).toFixed(3)+"]";return N}};const n=B},"./src/utils/timescale-conversion.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{toMpegTsClockFromTimescale:()=>N,toMsFromMpegTsClock:()=>D,toTimescaleFromBase:()=>n,toTimescaleFromScale:()=>W});var B=9e4;function n(d,m,s,g){s===void 0&&(s=1),g===void 0&&(g=!1);var h=d*m*s;return g?Math.round(h):h}function W(d,m,s,g){return s===void 0&&(s=1),g===void 0&&(g=!1),n(d,m,1/s,g)}function D(d,m){return m===void 0&&(m=!1),n(d,1e3,1/B,m)}function N(d,m){return m===void 0&&(m=1),n(d,B,1/m)}},"./src/utils/typed-array.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{sliceUint8:()=>B});function B(n,W,D){return Uint8Array.prototype.slice?n.slice(W,D):new Uint8Array(Array.prototype.slice.call(n,W,D))}},"./src/utils/vttcue.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>B});const B=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var n=["","lr","rl"],W=["start","middle","end","left","right"];function D(g,h){if(typeof h!="string")return!1;if(!Array.isArray(g))return!1;var _=h.toLowerCase();return~g.indexOf(_)?_:!1}function N(g){return D(n,g)}function d(g){return D(W,g)}function m(g){for(var h=arguments.length,_=new Array(h>1?h-1:0),r=1;r<h;r++)_[r-1]=arguments[r];for(var v=1;v<arguments.length;v++){var S=arguments[v];for(var w in S)g[w]=S[w]}return g}function s(g,h,_){var r=this,v={enumerable:!0};r.hasBeenReset=!1;var S="",w=!1,I=g,E=h,x=_,P=null,T="",A=!0,b="auto",C="start",p=50,i="middle",f=50,o="middle";Object.defineProperty(r,"id",m({},v,{get:function(){return S},set:function(L){S=""+L}})),Object.defineProperty(r,"pauseOnExit",m({},v,{get:function(){return w},set:function(L){w=!!L}})),Object.defineProperty(r,"startTime",m({},v,{get:function(){return I},set:function(L){if(typeof L!="number")throw new TypeError("Start time must be set to a number.");I=L,this.hasBeenReset=!0}})),Object.defineProperty(r,"endTime",m({},v,{get:function(){return E},set:function(L){if(typeof L!="number")throw new TypeError("End time must be set to a number.");E=L,this.hasBeenReset=!0}})),Object.defineProperty(r,"text",m({},v,{get:function(){return x},set:function(L){x=""+L,this.hasBeenReset=!0}})),Object.defineProperty(r,"region",m({},v,{get:function(){return P},set:function(L){P=L,this.hasBeenReset=!0}})),Object.defineProperty(r,"vertical",m({},v,{get:function(){return T},set:function(L){var y=N(L);if(y===!1)throw new SyntaxError("An invalid or illegal string was specified.");T=y,this.hasBeenReset=!0}})),Object.defineProperty(r,"snapToLines",m({},v,{get:function(){return A},set:function(L){A=!!L,this.hasBeenReset=!0}})),Object.defineProperty(r,"line",m({},v,{get:function(){return b},set:function(L){if(typeof L!="number"&&L!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");b=L,this.hasBeenReset=!0}})),Object.defineProperty(r,"lineAlign",m({},v,{get:function(){return C},set:function(L){var y=d(L);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");C=y,this.hasBeenReset=!0}})),Object.defineProperty(r,"position",m({},v,{get:function(){return p},set:function(L){if(L<0||L>100)throw new Error("Position must be between 0 and 100.");p=L,this.hasBeenReset=!0}})),Object.defineProperty(r,"positionAlign",m({},v,{get:function(){return i},set:function(L){var y=d(L);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");i=y,this.hasBeenReset=!0}})),Object.defineProperty(r,"size",m({},v,{get:function(){return f},set:function(L){if(L<0||L>100)throw new Error("Size must be between 0 and 100.");f=L,this.hasBeenReset=!0}})),Object.defineProperty(r,"align",m({},v,{get:function(){return o},set:function(L){var y=d(L);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");o=y,this.hasBeenReset=!0}})),r.displayState=void 0}return s.prototype.getCueAsHTML=function(){var g=self.WebVTT;return g.convertCueToDOMTree(self,this.text)},s}()},"./src/utils/vttparser.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{VTTParser:()=>h,fixLineBreaks:()=>g,parseTimeStamp:()=>W});var B=R("./src/utils/vttcue.ts"),n=function(){function _(){}var r=_.prototype;return r.decode=function(S,w){if(!S)return"";if(typeof S!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(S))},_}();function W(_){function r(S,w,I,E){return(S|0)*3600+(w|0)*60+(I|0)+parseFloat(E||0)}var v=_.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return v?parseFloat(v[2])>59?r(v[2],v[3],0,v[4]):r(v[1],v[2],v[3],v[4]):null}var D=function(){function _(){this.values=Object.create(null)}var r=_.prototype;return r.set=function(S,w){!this.get(S)&&w!==""&&(this.values[S]=w)},r.get=function(S,w,I){return I?this.has(S)?this.values[S]:w[I]:this.has(S)?this.values[S]:w},r.has=function(S){return S in this.values},r.alt=function(S,w,I){for(var E=0;E<I.length;++E)if(w===I[E]){this.set(S,w);break}},r.integer=function(S,w){/^-?\d+$/.test(w)&&this.set(S,parseInt(w,10))},r.percent=function(S,w){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(w)){var I=parseFloat(w);if(I>=0&&I<=100)return this.set(S,I),!0}return!1},_}();function N(_,r,v,S){var w=S?_.split(S):[_];for(var I in w){if(typeof w[I]!="string")continue;var E=w[I].split(v);if(E.length!==2)continue;var x=E[0],P=E[1];r(x,P)}}var d=new B.default(0,0,""),m=d.align==="middle"?"middle":"center";function s(_,r,v){var S=_;function w(){var x=W(_);if(x===null)throw new Error("Malformed timestamp: "+S);return _=_.replace(/^[^\sa-zA-Z-]+/,""),x}function I(x,P){var T=new D;N(x,function(C,p){var i;switch(C){case"region":for(var f=v.length-1;f>=0;f--)if(v[f].id===p){T.set(C,v[f].region);break}break;case"vertical":T.alt(C,p,["rl","lr"]);break;case"line":i=p.split(","),T.integer(C,i[0]),T.percent(C,i[0])&&T.set("snapToLines",!1),T.alt(C,i[0],["auto"]),i.length===2&&T.alt("lineAlign",i[1],["start",m,"end"]);break;case"position":i=p.split(","),T.percent(C,i[0]),i.length===2&&T.alt("positionAlign",i[1],["start",m,"end","line-left","line-right","auto"]);break;case"size":T.percent(C,p);break;case"align":T.alt(C,p,["start",m,"end","left","right"]);break}},/:/,/\s/),P.region=T.get("region",null),P.vertical=T.get("vertical","");var A=T.get("line","auto");A==="auto"&&d.line===-1&&(A=-1),P.line=A,P.lineAlign=T.get("lineAlign","start"),P.snapToLines=T.get("snapToLines",!0),P.size=T.get("size",100),P.align=T.get("align",m);var b=T.get("position","auto");b==="auto"&&d.position===50&&(b=P.align==="start"||P.align==="left"?0:P.align==="end"||P.align==="right"?100:50),P.position=b}function E(){_=_.replace(/^\s+/,"")}if(E(),r.startTime=w(),E(),_.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+S);_=_.slice(3),E(),r.endTime=w(),E(),I(_,r)}function g(_){return _.replace(/<br(?: \/)?>/gi,`
`)}var h=function(){function _(){this.state="INITIAL",this.buffer="",this.decoder=new n,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var r=_.prototype;return r.parse=function(S){var w=this;S&&(w.buffer+=w.decoder.decode(S,{stream:!0}));function I(){var b=w.buffer,C=0;for(b=g(b);C<b.length&&b[C]!=="\r"&&b[C]!==`
`;)++C;var p=b.slice(0,C);return b[C]==="\r"&&++C,b[C]===`
`&&++C,w.buffer=b.slice(C),p}function E(b){N(b,function(C,p){},/:/)}try{var x="";if(w.state==="INITIAL"){if(!/\r\n|\n/.test(w.buffer))return this;x=I();var P=x.match(/^()?WEBVTT([ \t].*)?$/);if(!P||!P[0])throw new Error("Malformed WebVTT signature.");w.state="HEADER"}for(var T=!1;w.buffer;){if(!/\r\n|\n/.test(w.buffer))return this;T?T=!1:x=I();switch(w.state){case"HEADER":/:/.test(x)?E(x):x||(w.state="ID");continue;case"NOTE":x||(w.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(x)){w.state="NOTE";break}if(!x)continue;if(w.cue=new B.default(0,0,""),w.state="CUE",x.indexOf("-->")===-1){w.cue.id=x;continue}case"CUE":if(!w.cue){w.state="BADCUE";continue}try{s(x,w.cue,w.regionList)}catch(b){w.cue=null,w.state="BADCUE";continue}w.state="CUETEXT";continue;case"CUETEXT":{var A=x.indexOf("-->")!==-1;if(!x||A&&(T=!0)){w.oncue&&w.cue&&w.oncue(w.cue),w.cue=null,w.state="ID";continue}if(w.cue===null)continue;w.cue.text&&(w.cue.text+=`
`),w.cue.text+=x}continue;case"BADCUE":x||(w.state="ID")}}}catch(b){w.state==="CUETEXT"&&w.cue&&w.oncue&&w.oncue(w.cue),w.cue=null,w.state=w.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},r.flush=function(){var S=this;try{if((S.cue||S.state==="HEADER")&&(S.buffer+=`
`,S.parse()),S.state==="INITIAL"||S.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(w){S.onparsingerror&&S.onparsingerror(w)}return S.onflush&&S.onflush(),this},_}()},"./src/utils/webvtt-parser.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{generateCueId:()=>h,parseWebVTT:()=>r});var B=R("./src/polyfills/number.ts"),n=R("./src/utils/vttparser.ts"),W=R("./src/demux/id3.ts"),D=R("./src/utils/timescale-conversion.ts"),N=R("./src/remux/mp4-remuxer.ts"),d=/\r\n|\n\r|\n|\r/g,m=function(S,w,I){return I===void 0&&(I=0),S.slice(I,I+w.length)===w},s=function(S){var w=parseInt(S.slice(-3)),I=parseInt(S.slice(-6,-4)),E=parseInt(S.slice(-9,-7)),x=S.length>9?parseInt(S.substring(0,S.indexOf(":"))):0;if(!(0,B.isFiniteNumber)(w)||!(0,B.isFiniteNumber)(I)||!(0,B.isFiniteNumber)(E)||!(0,B.isFiniteNumber)(x))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+S);return w+=1e3*I,w+=60*1e3*E,w+=60*60*1e3*x,w},g=function(S){for(var w=5381,I=S.length;I;)w=w*33^S.charCodeAt(--I);return(w>>>0).toString()};function h(v,S,w){return g(v.toString())+g(S.toString())+g(w)}var _=function(S,w,I){var E=S[w],x=S[E.prevCC];if(!x||!x.new&&E.new){S.ccOffset=S.presentationOffset=E.start,E.new=!1;return}for(;(P=x)!==null&&P!==void 0&&P.new;){var P;S.ccOffset+=E.start-x.start,E.new=!1,E=x,x=S[E.prevCC]}S.presentationOffset=I};function r(v,S,w,I,E,x,P,T){var A=new n.VTTParser,b=(0,W.utf8ArrayToStr)(new Uint8Array(v)).trim().replace(d,`
`).split(`
`),C=[],p=(0,D.toMpegTsClockFromTimescale)(S,w),i="00:00.000",f=0,o=0,a,L=!0;A.oncue=function(y){var l=I[E],F=I.ccOffset,j=(f-p)/9e4;l!=null&&l.new&&(o!==void 0?F=I.ccOffset=l.start:_(I,E,j)),j&&(F=j-I.presentationOffset);var G=y.endTime-y.startTime,Y=(0,N.normalizePts)((y.startTime+F-o)*9e4,x*9e4)/9e4;y.startTime=Math.max(Y,0),y.endTime=Math.max(Y+G,0);var te=y.text.trim();y.text=decodeURIComponent(encodeURIComponent(te)),y.id||(y.id=h(y.startTime,y.endTime,te)),y.endTime>0&&C.push(y)},A.onparsingerror=function(y){a=y},A.onflush=function(){if(a){T(a);return}P(C)},b.forEach(function(y){if(L)if(m(y,"X-TIMESTAMP-MAP=")){L=!1,y.slice(16).split(",").forEach(function(l){m(l,"LOCAL:")?i=l.slice(6):m(l,"MPEGTS:")&&(f=parseInt(l.slice(7)))});try{o=s(i)/1e3}catch(l){a=l}return}else y===""&&(L=!1);A.parse(y+`
`)}),A.flush()}},"./src/utils/xhr-loader.ts":(ae,z,R)=>{"use strict";R.r(z),R.d(z,{default:()=>N});var B=R("./src/utils/logger.ts"),n=R("./src/loader/load-stats.ts"),W=/^age:\s*[\d.]+\s*$/m,D=function(){function d(s){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=s?s.xhrSetup:null,this.stats=new n.LoadStats,this.retryDelay=0}var m=d.prototype;return m.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},m.abortInternal=function(){var g=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),g&&(g.onreadystatechange=null,g.onprogress=null,g.readyState!==4&&(this.stats.aborted=!0,g.abort()))},m.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},m.load=function(g,h,_){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=g,this.config=h,this.callbacks=_,this.retryDelay=h.retryDelay,this.loadInternal()},m.loadInternal=function(){var g=this.config,h=this.context;if(!g)return;var _=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0;var v=this.xhrSetup;try{if(v)try{v(_,h.url)}catch(I){_.open("GET",h.url,!0),v(_,h.url)}_.readyState||_.open("GET",h.url,!0);var S=this.context.headers;if(S)for(var w in S)_.setRequestHeader(w,S[w])}catch(I){this.callbacks.onError({code:_.status,text:I.message},h,_);return}h.rangeEnd&&_.setRequestHeader("Range","bytes="+h.rangeStart+"-"+(h.rangeEnd-1)),_.onreadystatechange=this.readystatechange.bind(this),_.onprogress=this.loadprogress.bind(this),_.responseType=h.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),g.timeout),_.send()},m.readystatechange=function(){var g=this.context,h=this.loader,_=this.stats;if(!g||!h)return;var r=h.readyState,v=this.config;if(_.aborted)return;if(r>=2)if(self.clearTimeout(this.requestTimeout),_.loading.first===0&&(_.loading.first=Math.max(self.performance.now(),_.loading.start)),r===4){h.onreadystatechange=null,h.onprogress=null;var S=h.status,w=h.responseType==="arraybuffer";if(S>=200&&S<300&&(w&&h.response||h.responseText!==null)){_.loading.end=Math.max(self.performance.now(),_.loading.first);var I,E;if(w?(I=h.response,E=I.byteLength):(I=h.responseText,E=I.length),_.loaded=_.total=E,!this.callbacks)return;var x=this.callbacks.onProgress;if(x&&x(_,g,I,h),!this.callbacks)return;var P={url:h.responseURL,data:I};this.callbacks.onSuccess(P,_,g,h)}else _.retry>=v.maxRetry||S>=400&&S<499?(B.logger.error(S+" while loading "+g.url),this.callbacks.onError({code:S,text:h.statusText},g,h)):(B.logger.warn(S+" while loading "+g.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,v.maxRetryDelay),_.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),v.timeout)},m.loadtimeout=function(){B.logger.warn("timeout while loading "+this.context.url);var g=this.callbacks;g&&(this.abortInternal(),g.onTimeout(this.stats,this.context,this.loader))},m.loadprogress=function(g){var h=this.stats;h.loaded=g.loaded,g.lengthComputable&&(h.total=g.total)},m.getCacheAge=function(){var g=null;if(this.loader&&W.test(this.loader.getAllResponseHeaders())){var h=this.loader.getResponseHeader("age");g=h?parseFloat(h):null}return g},d}();const N=D},"./node_modules/eventemitter3/index.js":ae=>{"use strict";var z=Object.prototype.hasOwnProperty,R="~";function B(){}Object.create&&(B.prototype=Object.create(null),new B().__proto__||(R=!1));function n(d,m,s){this.fn=d,this.context=m,this.once=s||!1}function W(d,m,s,g,h){if(typeof s!="function")throw new TypeError("The listener must be a function");var _=new n(s,g||d,h),r=R?R+m:m;return d._events[r]?d._events[r].fn?d._events[r]=[d._events[r],_]:d._events[r].push(_):(d._events[r]=_,d._eventsCount++),d}function D(d,m){--d._eventsCount===0?d._events=new B:delete d._events[m]}function N(){this._events=new B,this._eventsCount=0}N.prototype.eventNames=function(){var m=[],s,g;if(this._eventsCount===0)return m;for(g in s=this._events)z.call(s,g)&&m.push(R?g.slice(1):g);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(s)):m},N.prototype.listeners=function(m){var s=R?R+m:m,g=this._events[s];if(!g)return[];if(g.fn)return[g.fn];for(var h=0,_=g.length,r=new Array(_);h<_;h++)r[h]=g[h].fn;return r},N.prototype.listenerCount=function(m){var s=R?R+m:m,g=this._events[s];return g?g.fn?1:g.length:0},N.prototype.emit=function(m,s,g,h,_,r){var v=R?R+m:m;if(!this._events[v])return!1;var S=this._events[v],w=arguments.length,I,E;if(S.fn){S.once&&this.removeListener(m,S.fn,void 0,!0);switch(w){case 1:return S.fn.call(S.context),!0;case 2:return S.fn.call(S.context,s),!0;case 3:return S.fn.call(S.context,s,g),!0;case 4:return S.fn.call(S.context,s,g,h),!0;case 5:return S.fn.call(S.context,s,g,h,_),!0;case 6:return S.fn.call(S.context,s,g,h,_,r),!0}for(E=1,I=new Array(w-1);E<w;E++)I[E-1]=arguments[E];S.fn.apply(S.context,I)}else{var x=S.length,P;for(E=0;E<x;E++){S[E].once&&this.removeListener(m,S[E].fn,void 0,!0);switch(w){case 1:S[E].fn.call(S[E].context);break;case 2:S[E].fn.call(S[E].context,s);break;case 3:S[E].fn.call(S[E].context,s,g);break;case 4:S[E].fn.call(S[E].context,s,g,h);break;default:if(!I)for(P=1,I=new Array(w-1);P<w;P++)I[P-1]=arguments[P];S[E].fn.apply(S[E].context,I)}}}return!0},N.prototype.on=function(m,s,g){return W(this,m,s,g,!1)},N.prototype.once=function(m,s,g){return W(this,m,s,g,!0)},N.prototype.removeListener=function(m,s,g,h){var _=R?R+m:m;if(!this._events[_])return this;if(!s)return D(this,_),this;var r=this._events[_];if(r.fn)r.fn===s&&(!h||r.once)&&(!g||r.context===g)&&D(this,_);else{for(var v=0,S=[],w=r.length;v<w;v++)(r[v].fn!==s||h&&!r[v].once||g&&r[v].context!==g)&&S.push(r[v]);S.length?this._events[_]=S.length===1?S[0]:S:D(this,_)}return this},N.prototype.removeAllListeners=function(m){var s;return m?(s=R?R+m:m,this._events[s]&&D(this,s)):(this._events=new B,this._eventsCount=0),this},N.prototype.off=N.prototype.removeListener,N.prototype.addListener=N.prototype.on,N.prefixed=R,N.EventEmitter=N,ae.exports=N},"./node_modules/url-toolkit/src/url-toolkit.js":function(ae){(function(z){var R=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,B=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,W=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,D={buildAbsoluteURL:function(N,d,m){if(m=m||{},N=N.trim(),d=d.trim(),!d){if(!m.alwaysNormalize)return N;var s=D.parseURL(N);if(!s)throw new Error("Error trying to parse base URL.");return s.path=D.normalizePath(s.path),D.buildURLFromParts(s)}var g=D.parseURL(d);if(!g)throw new Error("Error trying to parse relative URL.");if(g.scheme)return m.alwaysNormalize?(g.path=D.normalizePath(g.path),D.buildURLFromParts(g)):d;var h=D.parseURL(N);if(!h)throw new Error("Error trying to parse base URL.");if(!h.netLoc&&h.path&&h.path[0]!=="/"){var _=B.exec(h.path);h.netLoc=_[1],h.path=_[2]}h.netLoc&&!h.path&&(h.path="/");var r={scheme:h.scheme,netLoc:g.netLoc,path:null,params:g.params,query:g.query,fragment:g.fragment};if(!g.netLoc&&(r.netLoc=h.netLoc,g.path[0]!=="/"))if(!g.path)r.path=h.path,g.params||(r.params=h.params,g.query||(r.query=h.query));else{var v=h.path,S=v.substring(0,v.lastIndexOf("/")+1)+g.path;r.path=D.normalizePath(S)}return r.path===null&&(r.path=m.alwaysNormalize?D.normalizePath(g.path):g.path),D.buildURLFromParts(r)},parseURL:function(N){var d=R.exec(N);return d?{scheme:d[1]||"",netLoc:d[2]||"",path:d[3]||"",params:d[4]||"",query:d[5]||"",fragment:d[6]||""}:null},normalizePath:function(N){for(N=N.split("").reverse().join("").replace(n,"");N.length!==(N=N.replace(W,"")).length;);return N.split("").reverse().join("")},buildURLFromParts:function(N){return N.scheme+N.netLoc+N.path+N.params+N.query+N.fragment}};ae.exports=D})(this)}},ue={};function re(ae){var z=ue[ae];if(z!==void 0)return z.exports;var R=ue[ae]={exports:{}};return q[ae].call(R.exports,R,R.exports,re),R.exports}re.m=q,(()=>{re.n=ae=>{var z=ae&&ae.__esModule?()=>ae.default:()=>ae;return re.d(z,{a:z}),z}})(),(()=>{re.d=(ae,z)=>{for(var R in z)re.o(z,R)&&!re.o(ae,R)&&Object.defineProperty(ae,R,{enumerable:!0,get:z[R]})}})(),(()=>{re.o=(ae,z)=>Object.prototype.hasOwnProperty.call(ae,z)})(),(()=>{re.r=ae=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(ae,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(ae,"__esModule",{value:!0})}})();var fe=re("./src/hls.ts");return fe=fe.default,fe})())},vHTk:function(We,ce,M){We.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vef1:function(We,ce,M){We.exports={upload:"upload___3GNI5"}},vqdp:function(We,ce,M){"use strict";M.d(ce,"a",function(){return R});var q=M("B/uU"),ue=M("El5i");function re(B,n){var W=new Set;return B.forEach(function(D){n.has(D)||W.add(D)}),W}function fe(B){var n=B||{},W=n.disabled,D=n.disableCheckbox,N=n.checkable;return!!(W||D)||N===!1}function ae(B,n,W,D){for(var N=new Set(B),d=new Set,m=0;m<=W;m+=1){var s=n.get(m)||new Set;s.forEach(function(r){var v=r.key,S=r.node,w=r.children,I=w===void 0?[]:w;N.has(v)&&!D(S)&&I.filter(function(E){return!D(E.node)}).forEach(function(E){N.add(E.key)})})}for(var g=new Set,h=W;h>=0;h-=1){var _=n.get(h)||new Set;_.forEach(function(r){var v=r.parent,S=r.node;if(D(S)||!r.parent||g.has(r.parent.key))return;if(D(r.parent.node)){g.add(v.key);return}var w=!0,I=!1;(v.children||[]).filter(function(E){return!D(E.node)}).forEach(function(E){var x=E.key,P=N.has(x);w&&!P&&(w=!1),!I&&(P||d.has(x))&&(I=!0)}),w&&N.add(v.key),I&&d.add(v.key),g.add(v.key)})}return{checkedKeys:Array.from(N),halfCheckedKeys:Array.from(re(d,N))}}function z(B,n,W,D,N){for(var d=new Set(B),m=new Set(n),s=0;s<=D;s+=1){var g=W.get(s)||new Set;g.forEach(function(v){var S=v.key,w=v.node,I=v.children,E=I===void 0?[]:I;!d.has(S)&&!m.has(S)&&!N(w)&&E.filter(function(x){return!N(x.node)}).forEach(function(x){d.delete(x.key)})})}m=new Set;for(var h=new Set,_=D;_>=0;_-=1){var r=W.get(_)||new Set;r.forEach(function(v){var S=v.parent,w=v.node;if(N(w)||!v.parent||h.has(v.parent.key))return;if(N(v.parent.node)){h.add(S.key);return}var I=!0,E=!1;(S.children||[]).filter(function(x){return!N(x.node)}).forEach(function(x){var P=x.key,T=d.has(P);I&&!T&&(I=!1),!E&&(T||m.has(P))&&(E=!0)}),I||d.delete(S.key),E&&m.add(S.key),h.add(S.key)})}return{checkedKeys:Array.from(d),halfCheckedKeys:Array.from(re(m,d))}}function R(B,n,W,D){var N=[],d;D?d=D:d=fe;var m=new Set(B.filter(function(_){var r=!!Object(ue.a)(W,_);return r||N.push(_),r})),s=new Map,g=0;Object.keys(W).forEach(function(_){var r=W[_],v=r.level,S=s.get(v);S||(S=new Set,s.set(v,S)),S.add(r),g=Math.max(g,v)}),Object(q.a)(!N.length,"Tree missing follow keys: ".concat(N.slice(0,100).map(function(_){return"'".concat(_,"'")}).join(", ")));var h;return n===!0?h=ae(m,s,g,d):h=z(m,n.halfCheckedKeys,s,g,d),h}},wW8i:function(We,ce,M){We.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"}},wx14:function(We,ce,M){"use strict";M.d(ce,"a",function(){return q});function q(){return q=Object.assign?Object.assign.bind():function(ue){for(var re=1;re<arguments.length;re++){var fe=arguments[re];for(var ae in fe)Object.prototype.hasOwnProperty.call(fe,ae)&&(ue[ae]=fe[ae])}return ue},q.apply(this,arguments)}},"x/L2":function(We,ce,M){"use strict";var q=M("yuO0"),ue=M("XjgL"),re=M("6ASS"),fe=M("fNpE"),ae=M("36hc"),z=M("kxoy"),R=M("T/Jt"),B=M.n(R),n=M("27eb"),W=M.n(n),D=M("1HCi"),N=M.n(D),d=M("Eiay"),m=M("5Und"),s=M("MRIS"),g=M("QOAJ"),h=M("ynYK"),_=M("B/uU"),r=M("VbWF"),v=M("U+Vu"),S=["colSpan","rowSpan","style","className"];function w(p,i,f,o){var a=p+i-1;return p<=o&&a>=f}function I(p){return p&&Object(z.a)(p)==="object"&&!Array.isArray(p)&&!R.isValidElement(p)}function E(p){return typeof p=="string"?!0:Object(d.c)(p)}var x=function(i){var f=i.ellipsis,o=i.rowType,a=i.children,L,y=f===!0?{showTitle:!0}:f;return y&&(y.showTitle||o==="header")&&(typeof a=="string"||typeof a=="number"?L=a.toString():R.isValidElement(a)&&typeof a.props.children=="string"&&(L=a.props.children)),L};function P(p,i){var f,o,a,L=p.prefixCls,y=p.className,l=p.record,F=p.index,j=p.renderIndex,G=p.dataIndex,Y=p.render,te=p.children,de=p.component,ve=de===void 0?"td":de,he=p.colSpan,Re=p.rowSpan,we=p.fixLeft,ge=p.fixRight,Ne=p.firstFixLeft,ze=p.lastFixLeft,nt=p.firstFixRight,Ge=p.lastFixRight,Xe=p.appendNode,Be=p.additionalProps,_e=Be===void 0?{}:Be,Ze=p.ellipsis,be=p.align,Le=p.rowType,le=p.isSticky,ye=p.hovering,Te=p.onHover,Pe="".concat(L,"-cell"),He=R.useContext(r.a),Ye=R.useContext(s.a),ct=R.useContext(h.a),st=ct.allColumnsFixedLeft,vt=R.useMemo(function(){if(Object(m.c)(te))return[te];var Et=Object(m.b)(l,G),Ct=Et,dt=void 0;if(Y){var Nt=Y(Et,l,j);I(Nt)?(Ct=Nt.children,dt=Nt.props,He.renderWithProps=!0):Ct=Nt}return[Ct,dt]},[He.renderWithProps?Math.random():0,te,G,He,l,Y,j]),qe=Object(ae.a)(vt,2),mt=qe[0],yt=qe[1],Je=mt;Object(z.a)(Je)==="object"&&!Array.isArray(Je)&&!R.isValidElement(Je)&&(Je=null),Ze&&(ze||nt)&&(Je=R.createElement("span",{className:"".concat(Pe,"-content")},Je));var et=yt||{},De=et.colSpan,ke=et.rowSpan,Me=et.style,me=et.className,Ce=Object(fe.a)(et,S),Oe=(f=De!==void 0?De:he)!==null&&f!==void 0?f:1,Se=(o=ke!==void 0?ke:Re)!==null&&o!==void 0?o:1;if(Oe===0||Se===0)return null;var Fe={},it=typeof we=="number"&&Ye,Ie=typeof ge=="number"&&Ye;it&&(Fe.position="sticky",Fe.left=we),Ie&&(Fe.position="sticky",Fe.right=ge);var Qe={};be&&(Qe.textAlign=be);var rt=function(Ct){var dt;l&&Te(F,F+Se-1),_e==null||((dt=_e.onMouseEnter)===null||dt===void 0)||dt.call(_e,Ct)},ft=function(Ct){var dt;l&&Te(-1,-1),_e==null||((dt=_e.onMouseLeave)===null||dt===void 0)||dt.call(_e,Ct)},It=x({rowType:Le,ellipsis:Ze,children:mt}),Tt=Object(re.a)(Object(re.a)(Object(re.a)({title:It},Ce),_e),{},{colSpan:Oe!==1?Oe:null,rowSpan:Se!==1?Se:null,className:W()(Pe,y,(a={},Object(ue.a)(a,"".concat(Pe,"-fix-left"),it&&Ye),Object(ue.a)(a,"".concat(Pe,"-fix-left-first"),Ne&&Ye),Object(ue.a)(a,"".concat(Pe,"-fix-left-last"),ze&&Ye),Object(ue.a)(a,"".concat(Pe,"-fix-left-all"),ze&&st&&Ye),Object(ue.a)(a,"".concat(Pe,"-fix-right"),Ie&&Ye),Object(ue.a)(a,"".concat(Pe,"-fix-right-first"),nt&&Ye),Object(ue.a)(a,"".concat(Pe,"-fix-right-last"),Ge&&Ye),Object(ue.a)(a,"".concat(Pe,"-ellipsis"),Ze),Object(ue.a)(a,"".concat(Pe,"-with-append"),Xe),Object(ue.a)(a,"".concat(Pe,"-fix-sticky"),(it||Ie)&&le&&Ye),Object(ue.a)(a,"".concat(Pe,"-row-hover"),!yt&&ye),a),_e.className,me),style:Object(re.a)(Object(re.a)(Object(re.a)(Object(re.a)({},_e.style),Qe),Fe),Me),onMouseEnter:rt,onMouseLeave:ft,ref:E(ve)?i:null});return R.createElement(ve,Tt,Xe,Je)}var T=R.forwardRef(P);T.displayName="Cell";var A=["expanded","className","hovering"],b=R.memo(T,function(p,i){return i.shouldCellUpdate?A.every(function(f){return p[f]===i[f]})&&!i.shouldCellUpdate(i.record,p.record):N()(p,i)}),C=R.forwardRef(function(p,i){var f=p.index,o=p.additionalProps,a=o===void 0?{}:o,L=p.colSpan,y=p.rowSpan,l=a.colSpan,F=a.rowSpan,j=L!=null?L:l,G=y!=null?y:F,Y=Object(v.b)(g.a,function(ve){var he=w(f,G||1,ve==null?void 0:ve.startRow,ve==null?void 0:ve.endRow);return{onHover:ve==null?void 0:ve.onHover,hovering:he}}),te=Y.onHover,de=Y.hovering;return R.createElement(b,Object(q.a)({},p,{colSpan:j,rowSpan:G,hovering:de,ref:i,onHover:te}))});C.displayName="WrappedCell",ce.a=C},xB1R:function(We,ce,M){"use strict";var q=M("6ASS"),ue=M("36hc"),re=M("T/Jt"),fe=M("QMfX"),ae=M("s7W6"),z=M("XjgL"),R=M("yuO0"),B=M("27eb"),n=M.n(B),W=M("J5No"),D=M("sg8A"),N=M("E0BR"),d=re.createContext(null),m=d,s=function(b){var C=b.prefixCls,p=b.className,i=b.style,f=b.children,o=b.containerRef,a=b.id,L=b.onMouseEnter,y=b.onMouseOver,l=b.onMouseLeave,F=b.onClick,j=b.onKeyDown,G=b.onKeyUp,Y={onMouseEnter:L,onMouseOver:y,onMouseLeave:l,onClick:F,onKeyDown:j,onKeyUp:G};return re.createElement(re.Fragment,null,re.createElement("div",Object(R.a)({id:a,className:n()("".concat(C,"-content"),p),style:Object(q.a)({},i),"aria-modal":"true",role:"dialog",ref:o},Y),f))},g=s,h=M("B/uU"),_=M("Zfln");function r(A){return typeof A=="string"&&String(Number(A))===A?(Object(h.a)(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(A)):A}function v(A){Object(h.a)(!("wrapperClassName"in A),"'wrapperClassName' is removed. Please use 'rootClassName' instead."),Object(h.a)(Object(_.a)()||!A.open,"Drawer with 'open' in SSR is not work since no place to createPortal. Please move to 'useEffect' instead.")}var S={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function w(A,b){var C,p,i,f,o=A.prefixCls,a=A.open,L=A.placement,y=A.inline,l=A.push,F=A.forceRender,j=A.autoFocus,G=A.keyboard,Y=A.rootClassName,te=A.rootStyle,de=A.zIndex,ve=A.className,he=A.id,Re=A.style,we=A.motion,ge=A.width,Ne=A.height,ze=A.children,nt=A.contentWrapperStyle,Ge=A.mask,Xe=A.maskClosable,Be=A.maskMotion,_e=A.maskClassName,Ze=A.maskStyle,be=A.afterOpenChange,Le=A.onClose,le=A.onMouseEnter,ye=A.onMouseOver,Te=A.onMouseLeave,Pe=A.onClick,He=A.onKeyDown,Ye=A.onKeyUp,ct=re.useRef(),st=re.useRef(),vt=re.useRef();re.useImperativeHandle(b,function(){return ct.current});var qe=function(rt){var ft=rt.keyCode,It=rt.shiftKey;switch(ft){case D.a.TAB:{if(ft===D.a.TAB){if(!It&&document.activeElement===vt.current){var Tt;(Tt=st.current)===null||Tt===void 0||Tt.focus({preventScroll:!0})}else if(It&&document.activeElement===st.current){var Et;(Et=vt.current)===null||Et===void 0||Et.focus({preventScroll:!0})}}break}case D.a.ESC:{Le&&G&&(rt.stopPropagation(),Le(rt));break}}};re.useEffect(function(){if(a&&j){var Qe;(Qe=ct.current)===null||Qe===void 0||Qe.focus({preventScroll:!0})}},[a]);var mt=re.useState(!1),yt=Object(ue.a)(mt,2),Je=yt[0],et=yt[1],De=re.useContext(m),ke;l===!1?ke={distance:0}:l===!0?ke={}:ke=l||{};var Me=(C=(p=(i=ke)===null||i===void 0?void 0:i.distance)!==null&&p!==void 0?p:De==null?void 0:De.pushDistance)!==null&&C!==void 0?C:180,me=re.useMemo(function(){return{pushDistance:Me,push:function(){et(!0)},pull:function(){et(!1)}}},[Me]);re.useEffect(function(){if(a){var Qe;De==null||((Qe=De.push)===null||Qe===void 0)||Qe.call(De)}else{var rt;De==null||((rt=De.pull)===null||rt===void 0)||rt.call(De)}},[a]),re.useEffect(function(){return function(){var Qe;De==null||((Qe=De.pull)===null||Qe===void 0)||Qe.call(De)}},[]);var Ce=Ge&&re.createElement(W.default,Object(R.a)({key:"mask"},Be,{visible:a}),function(Qe,rt){var ft=Qe.className,It=Qe.style;return re.createElement("div",{className:n()("".concat(o,"-mask"),ft,_e),style:Object(q.a)(Object(q.a)({},It),Ze),onClick:Xe&&a?Le:void 0,ref:rt})}),Oe=typeof we=="function"?we(L):we,Se={};if(Je&&Me)switch(L){case"top":Se.transform="translateY(".concat(Me,"px)");break;case"bottom":Se.transform="translateY(".concat(-Me,"px)");break;case"left":Se.transform="translateX(".concat(Me,"px)");break;default:Se.transform="translateX(".concat(-Me,"px)");break}L==="left"||L==="right"?Se.width=r(ge):Se.height=r(Ne);var Fe={onMouseEnter:le,onMouseOver:ye,onMouseLeave:Te,onClick:Pe,onKeyDown:He,onKeyUp:Ye},it=re.createElement(W.default,Object(R.a)({key:"panel"},Oe,{visible:a,forceRender:F,onVisibleChanged:function(rt){be==null||be(rt)},removeOnLeave:!1,leavedClassName:"".concat(o,"-content-wrapper-hidden")}),function(Qe,rt){var ft=Qe.className,It=Qe.style;return re.createElement("div",Object(R.a)({className:n()("".concat(o,"-content-wrapper"),ft),style:Object(q.a)(Object(q.a)(Object(q.a)({},Se),It),nt)},Object(N.a)(A,{data:!0})),re.createElement(g,Object(R.a)({id:he,containerRef:rt,prefixCls:o,className:ve,style:Re},Fe),ze))}),Ie=Object(q.a)({},te);return de&&(Ie.zIndex=de),re.createElement(m.Provider,{value:me},re.createElement("div",{className:n()(o,"".concat(o,"-").concat(L),Y,(f={},Object(z.a)(f,"".concat(o,"-open"),a),Object(z.a)(f,"".concat(o,"-inline"),y),f)),style:Ie,tabIndex:-1,ref:ct,onKeyDown:qe},Ce,re.createElement("div",{tabIndex:0,ref:st,style:S,"aria-hidden":"true","data-sentinel":"start"}),it,re.createElement("div",{tabIndex:0,ref:vt,style:S,"aria-hidden":"true","data-sentinel":"end"})))}var I=re.forwardRef(w),E=I,x=function(b){var C=b.open,p=C===void 0?!1:C,i=b.prefixCls,f=i===void 0?"rc-drawer":i,o=b.placement,a=o===void 0?"right":o,L=b.autoFocus,y=L===void 0?!0:L,l=b.keyboard,F=l===void 0?!0:l,j=b.width,G=j===void 0?378:j,Y=b.mask,te=Y===void 0?!0:Y,de=b.maskClosable,ve=de===void 0?!0:de,he=b.getContainer,Re=b.forceRender,we=b.afterOpenChange,ge=b.destroyOnClose,Ne=b.onMouseEnter,ze=b.onMouseOver,nt=b.onMouseLeave,Ge=b.onClick,Xe=b.onKeyDown,Be=b.onKeyUp,_e=re.useState(!1),Ze=Object(ue.a)(_e,2),be=Ze[0],Le=Ze[1],le=re.useState(!1),ye=Object(ue.a)(le,2),Te=ye[0],Pe=ye[1];Object(ae.a)(function(){Pe(!0)},[]);var He=Te?p:!1,Ye=re.useRef(),ct=re.useRef();Object(ae.a)(function(){He&&(ct.current=document.activeElement)},[He]);var st=function(yt){var Je;if(Le(yt),we==null||we(yt),!yt&&ct.current&&!((Je=Ye.current)===null||Je===void 0?void 0:Je.contains(ct.current))){var et;(et=ct.current)===null||et===void 0||et.focus({preventScroll:!0})}};if(!Re&&!be&&!He&&ge)return null;var vt={onMouseEnter:Ne,onMouseOver:ze,onMouseLeave:nt,onClick:Ge,onKeyDown:Xe,onKeyUp:Be},qe=Object(q.a)(Object(q.a)({},b),{},{open:He,prefixCls:f,placement:a,autoFocus:y,keyboard:F,width:G,mask:te,maskClosable:ve,inline:he===!1,afterOpenChange:st,ref:Ye},vt);return re.createElement(fe.a,{open:He||Re||be,autoDestroy:!1,getContainer:he,autoLock:te&&(He||be)},re.createElement(E,qe))},P=x,T=ce.a=P},xYGA:function(We,ce,M){"use strict";M.r(ce),M.d(ce,"ResizableTextArea",function(){return b});var q=M("yuO0"),ue=M("eA01"),re=M("fXDJ"),fe=M("BPTR"),ae=M("udol"),z=M("T/Jt"),R=M("XjgL"),B=M("6ASS"),n=M("kxoy"),W=M("36hc"),D=M("fNpE"),N=M("s3yx"),d=M("s7W6"),m=M("IRwA"),s=M("8wWb"),g=M("27eb"),h=M.n(g),_=`
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;
pointer-events: none !important;
`,r=["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"],v={},S;function w(i){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o=i.getAttribute("id")||i.getAttribute("data-reactid")||i.getAttribute("name");if(f&&v[o])return v[o];var a=window.getComputedStyle(i),L=a.getPropertyValue("box-sizing")||a.getPropertyValue("-moz-box-sizing")||a.getPropertyValue("-webkit-box-sizing"),y=parseFloat(a.getPropertyValue("padding-bottom"))+parseFloat(a.getPropertyValue("padding-top")),l=parseFloat(a.getPropertyValue("border-bottom-width"))+parseFloat(a.getPropertyValue("border-top-width")),F=r.map(function(G){return"".concat(G,":").concat(a.getPropertyValue(G))}).join(";"),j={sizingStyle:F,paddingSize:y,borderSize:l,boxSizing:L};return f&&o&&(v[o]=j),j}function I(i){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;S||(S=document.createElement("textarea"),S.setAttribute("tab-index","-1"),S.setAttribute("aria-hidden","true"),document.body.appendChild(S)),i.getAttribute("wrap")?S.setAttribute("wrap",i.getAttribute("wrap")):S.removeAttribute("wrap");var L=w(i,f),y=L.paddingSize,l=L.borderSize,F=L.boxSizing,j=L.sizingStyle;S.setAttribute("style","".concat(j,";").concat(_)),S.value=i.value||i.placeholder||"";var G=void 0,Y=void 0,te,de=S.scrollHeight;if(F==="border-box"?de+=l:F==="content-box"&&(de-=y),o!==null||a!==null){S.value=" ";var ve=S.scrollHeight-y;o!==null&&(G=ve*o,F==="border-box"&&(G=G+y+l),de=Math.max(G,de)),a!==null&&(Y=ve*a,F==="border-box"&&(Y=Y+y+l),te=de>Y?"":"hidden",de=Math.min(Y,de))}var he={height:de,overflowY:te,resize:"none"};return G&&(he.minHeight=G),Y&&(he.maxHeight=Y),he}var E=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],x=0,P=1,T=2,A=z.forwardRef(function(i,f){var o=i.prefixCls,a=o===void 0?"rc-textarea":o,L=i.onPressEnter,y=i.defaultValue,l=i.value,F=i.autoSize,j=i.onResize,G=i.className,Y=i.style,te=i.disabled,de=i.onChange,ve=i.onInternalAutoSize,he=Object(D.a)(i,E),Re=Object(s.a)(y,{value:l,postState:function(De){return De!=null?De:""}}),we=Object(W.a)(Re,2),ge=we[0],Ne=we[1],ze=function(De){Ne(De.target.value),de==null||de(De)},nt=z.useRef();z.useImperativeHandle(f,function(){return{textArea:nt.current}});var Ge=z.useMemo(function(){return F&&Object(n.a)(F)==="object"?[F.minRows,F.maxRows]:[]},[F]),Xe=Object(W.a)(Ge,2),Be=Xe[0],_e=Xe[1],Ze=!!F,be=function(){try{if(document.activeElement===nt.current){var De=nt.current,ke=De.selectionStart,Me=De.selectionEnd,me=De.scrollTop;nt.current.setSelectionRange(ke,Me),nt.current.scrollTop=me}}catch(Ce){}},Le=z.useState(T),le=Object(W.a)(Le,2),ye=le[0],Te=le[1],Pe=z.useState(),He=Object(W.a)(Pe,2),Ye=He[0],ct=He[1],st=function(){Te(x)};Object(d.a)(function(){Ze&&st()},[l,Be,_e,Ze]),Object(d.a)(function(){if(ye===x)Te(P);else if(ye===P){var et=I(nt.current,!1,Be,_e);Te(T),ct(et)}else be()},[ye]);var vt=z.useRef(),qe=function(){m.a.cancel(vt.current)},mt=function(De){ye===T&&(j==null||j(De),F&&(qe(),vt.current=Object(m.a)(function(){st()})))};z.useEffect(function(){return qe},[]);var yt=Ze?Ye:null,Je=Object(B.a)(Object(B.a)({},Y),yt);return(ye===x||ye===P)&&(Je.overflowY="hidden",Je.overflowX="hidden"),z.createElement(N.a,{onResize:mt,disabled:!(F||j)},z.createElement("textarea",Object(q.a)({},he,{ref:nt,style:Je,className:h()(a,G,Object(R.a)({},"".concat(a,"-disabled"),te)),disabled:te,value:ge,onChange:ze})))}),b=A,C=function(i){Object(fe.a)(o,i);var f=Object(ae.a)(o);function o(a){var L;Object(ue.a)(this,o),L=f.call(this,a),L.resizableTextArea=void 0,L.focus=function(){L.resizableTextArea.textArea.focus()},L.saveTextArea=function(l){L.resizableTextArea=l},L.handleChange=function(l){var F=L.props.onChange;L.setValue(l.target.value),F&&F(l)},L.handleKeyDown=function(l){var F=L.props,j=F.onPressEnter,G=F.onKeyDown;l.keyCode===13&&j&&j(l),G&&G(l)};var y=typeof a.value=="undefined"||a.value===null?a.defaultValue:a.value;return L.state={value:y},L}return Object(re.a)(o,[{key:"setValue",value:function(L,y){"value"in this.props||this.setState({value:L},y)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return z.createElement(b,Object(q.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(L){return"value"in L?{value:L.value}:null}}]),o}(z.Component),p=ce.default=C},"yg+E":function(We,ce,M){"use strict";M.r(ce),M.d(ce,"BaseInput",function(){return d});var q=M("XjgL"),ue=M("kxoy"),re=M("T/Jt"),fe=M.n(re),ae=M("27eb"),z=M.n(ae);function R(E){return!!(E.addonBefore||E.addonAfter)}function B(E){return!!(E.prefix||E.suffix||E.allowClear)}function n(E,x,P,T){if(!P)return;var A=x;if(x.type==="click"){var b=E.cloneNode(!0);A=Object.create(x,{target:{value:b},currentTarget:{value:b}}),b.value="",P(A);return}if(T!==void 0){A=Object.create(x,{target:{value:E},currentTarget:{value:E}}),E.value=T,P(A);return}P(A)}function W(E,x){if(!E)return;E.focus(x);var P=x||{},T=P.cursor;if(T){var A=E.value.length;switch(T){case"start":E.setSelectionRange(0,0);break;case"end":E.setSelectionRange(A,A);break;default:E.setSelectionRange(0,A)}}}function D(E){return typeof E=="undefined"||E===null?"":String(E)}var N=function(x){var P=x.inputElement,T=x.prefixCls,A=x.prefix,b=x.suffix,C=x.addonBefore,p=x.addonAfter,i=x.className,f=x.style,o=x.affixWrapperClassName,a=x.groupClassName,L=x.wrapperClassName,y=x.disabled,l=x.readOnly,F=x.focused,j=x.triggerFocus,G=x.allowClear,Y=x.value,te=x.handleReset,de=x.hidden,ve=Object(re.useRef)(null),he=function(be){var Le;(Le=ve.current)!==null&&Le!==void 0&&Le.contains(be.target)&&(j==null||j())},Re=function(){var be;if(!G)return null;var Le=!y&&!l&&Y,le="".concat(T,"-clear-icon"),ye=Object(ue.a)(G)==="object"&&G!==null&&G!==void 0&&G.clearIcon?G.clearIcon:"\u2716";return fe.a.createElement("span",{onClick:te,onMouseDown:function(Pe){return Pe.preventDefault()},className:z()(le,(be={},Object(q.a)(be,"".concat(le,"-hidden"),!Le),Object(q.a)(be,"".concat(le,"-has-suffix"),!!b),be)),role:"button",tabIndex:-1},ye)},we=Object(re.cloneElement)(P,{value:Y,hidden:de});if(B(x)){var ge,Ne="".concat(T,"-affix-wrapper"),ze=z()(Ne,(ge={},Object(q.a)(ge,"".concat(Ne,"-disabled"),y),Object(q.a)(ge,"".concat(Ne,"-focused"),F),Object(q.a)(ge,"".concat(Ne,"-readonly"),l),Object(q.a)(ge,"".concat(Ne,"-input-with-clear-btn"),b&&G&&Y),ge),!R(x)&&i,o),nt=(b||G)&&fe.a.createElement("span",{className:"".concat(T,"-suffix")},Re(),b);we=fe.a.createElement("span",{className:ze,style:f,hidden:!R(x)&&de,onClick:he,ref:ve},A&&fe.a.createElement("span",{className:"".concat(T,"-prefix")},A),Object(re.cloneElement)(P,{style:null,value:Y,hidden:null}),nt)}if(R(x)){var Ge="".concat(T,"-group"),Xe="".concat(Ge,"-addon"),Be=z()("".concat(T,"-wrapper"),Ge,L),_e=z()("".concat(T,"-group-wrapper"),i,a);return fe.a.createElement("span",{className:_e,style:f,hidden:de},fe.a.createElement("span",{className:Be},C&&fe.a.createElement("span",{className:Xe},C),Object(re.cloneElement)(we,{style:null,hidden:null}),p&&fe.a.createElement("span",{className:Xe},p)))}return we},d=N,m=M("aVTQ"),s=M("yuO0"),g=M("36hc"),h=M("fNpE"),_=M("N7A4"),r=M("8wWb"),v=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","inputClassName"],S=Object(re.forwardRef)(function(E,x){var P=E.autoComplete,T=E.onChange,A=E.onFocus,b=E.onBlur,C=E.onPressEnter,p=E.onKeyDown,i=E.prefixCls,f=i===void 0?"rc-input":i,o=E.disabled,a=E.htmlSize,L=E.className,y=E.maxLength,l=E.suffix,F=E.showCount,j=E.type,G=j===void 0?"text":j,Y=E.inputClassName,te=Object(h.a)(E,v),de=Object(r.a)(E.defaultValue,{value:E.value}),ve=Object(g.a)(de,2),he=ve[0],Re=ve[1],we=Object(re.useState)(!1),ge=Object(g.a)(we,2),Ne=ge[0],ze=ge[1],nt=Object(re.useRef)(null),Ge=function(Te){nt.current&&W(nt.current,Te)};Object(re.useImperativeHandle)(x,function(){return{focus:Ge,blur:function(){var Te;(Te=nt.current)===null||Te===void 0||Te.blur()},setSelectionRange:function(Te,Pe,He){var Ye;(Ye=nt.current)===null||Ye===void 0||Ye.setSelectionRange(Te,Pe,He)},select:function(){var Te;(Te=nt.current)===null||Te===void 0||Te.select()},input:nt.current}}),Object(re.useEffect)(function(){ze(function(ye){return ye&&o?!1:ye})},[o]);var Xe=function(Te){E.value===void 0&&Re(Te.target.value),nt.current&&n(nt.current,Te,T)},Be=function(Te){C&&Te.key==="Enter"&&C(Te),p==null||p(Te)},_e=function(Te){ze(!0),A==null||A(Te)},Ze=function(Te){ze(!1),b==null||b(Te)},be=function(Te){Re(""),Ge(),nt.current&&n(nt.current,Te,T)},Le=function(){var Te=Object(_.a)(E,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","affixWrapperClassName","groupClassName","inputClassName","wrapperClassName","htmlSize"]);return fe.a.createElement("input",Object(s.a)({autoComplete:P},Te,{onChange:Xe,onFocus:_e,onBlur:Ze,onKeyDown:Be,className:z()(f,Object(q.a)({},"".concat(f,"-disabled"),o),Y,!R(E)&&!B(E)&&L),ref:nt,size:a,type:G}))},le=function(){var Te=Number(y)>0;if(l||F){var Pe=D(he),He=Object(m.a)(Pe).length,Ye=Object(ue.a)(F)==="object"?F.formatter({value:Pe,count:He,maxLength:y}):"".concat(He).concat(Te?" / ".concat(y):"");return fe.a.createElement(fe.a.Fragment,null,!!F&&fe.a.createElement("span",{className:z()("".concat(f,"-show-count-suffix"),Object(q.a)({},"".concat(f,"-show-count-has-suffix"),!!l))},Ye),l)}return null};return fe.a.createElement(d,Object(s.a)({},te,{prefixCls:f,className:L,inputElement:Le(),handleReset:be,value:D(he),focused:Ne,triggerFocus:Ge,suffix:le(),disabled:o}))}),w=S,I=ce.default=w},ynYK:function(We,ce,M){"use strict";var q=M("T/Jt"),ue=M.n(q),re=q.createContext(null);ce.a=re},ynwM:function(We,ce,M){var q=M("MFOe"),ue=q.Global;We.exports={name:"oldFF-globalStorage",read:fe,write:ae,each:z,remove:R,clearAll:B};var re=ue.globalStorage;function fe(n){return re[n]}function ae(n,W){re[n]=W}function z(n){for(var W=re.length-1;W>=0;W--){var D=re.key(W);n(re[D],D)}}function R(n){return re.removeItem(n)}function B(){z(function(n,W){delete re[n]})}},zLVn:function(We,ce,M){"use strict";M.d(ce,"a",function(){return q});function q(ue,re){if(ue==null)return{};var fe={},ae=Object.keys(ue),z,R;for(R=0;R<ae.length;R++){if(z=ae[R],re.indexOf(z)>=0)continue;fe[z]=ue[z]}return fe}}}]);