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__Index.16b10542...

334 lines
897 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[193,5,7,8,10],{"+92d":function(ot,fe,U){ot.exports=U.p+"static/b1.8d46544a.svg"},"+RDj":function(ot,fe,U){ot.exports=U.p+"static/dau.0c862b4c.svg"},"+ua5":function(ot,fe,U){},"/cxE":function(ot,fe,U){"use strict";U.d(fe,"e",function(){return _}),U.d(fe,"f",function(){return k}),U.d(fe,"g",function(){return b}),U.d(fe,"d",function(){return j}),U.d(fe,"a",function(){return M}),U.d(fe,"b",function(){return O}),U.d(fe,"c",function(){return w});var Z=function(){function c(){this.listeners=[],this.unexpectedErrorHandler=function(y){setTimeout(function(){throw y.stack?new Error(y.message+`
`+y.stack):y},0)}}return c.prototype.emit=function(y){this.listeners.forEach(function(C){C(y)})},c.prototype.onUnexpectedError=function(y){this.unexpectedErrorHandler(y),this.emit(y)},c.prototype.onUnexpectedExternalError=function(y){this.unexpectedErrorHandler(y)},c}(),N=new Z;function _(c){j(c)||N.onUnexpectedError(c);return}function k(c){j(c)||N.onUnexpectedExternalError(c);return}function b(c){if(c instanceof Error){var y=c.name,C=c.message,m=c.stacktrace||c.stack;return{$isError:!0,name:y,message:C,stack:m}}return c}var S="Canceled";function j(c){return c instanceof Error&&c.name===S&&c.message===S}function M(){var c=new Error(S);return c.name=c.message,c}function O(c){return c?new Error("Illegal argument: "+c):new Error("Illegal argument")}function w(c){return c?new Error("Illegal state: "+c):new Error("Illegal state")}},"24hK":function(ot,fe,U){"use strict";U.d(fe,"a",function(){return _});var Z=U("JYp7"),N=function(){function k(b){this.element=b,this.next=k.Undefined,this.prev=k.Undefined}return k.Undefined=new k(void 0),k}(),_=function(){function k(){this._first=N.Undefined,this._last=N.Undefined,this._size=0}return Object.defineProperty(k.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),k.prototype.isEmpty=function(){return this._first===N.Undefined},k.prototype.clear=function(){this._first=N.Undefined,this._last=N.Undefined,this._size=0},k.prototype.unshift=function(b){return this._insert(b,!1)},k.prototype.push=function(b){return this._insert(b,!0)},k.prototype._insert=function(b,S){var j=this,M=new N(b);if(this._first===N.Undefined)this._first=M,this._last=M;else if(S){var O=this._last;this._last=M,M.prev=O,O.next=M}else{var w=this._first;this._first=M,M.next=w,w.prev=M}this._size+=1;var c=!1;return function(){c||(c=!0,j._remove(M))}},k.prototype.shift=function(){if(this._first===N.Undefined)return;var b=this._first.element;return this._remove(this._first),b},k.prototype.pop=function(){if(this._last===N.Undefined)return;var b=this._last.element;return this._remove(this._last),b},k.prototype._remove=function(b){if(b.prev!==N.Undefined&&b.next!==N.Undefined){var S=b.prev;S.next=b.next,b.next.prev=S}else b.prev===N.Undefined&&b.next===N.Undefined?(this._first=N.Undefined,this._last=N.Undefined):b.next===N.Undefined?(this._last=this._last.prev,this._last.next=N.Undefined):b.prev===N.Undefined&&(this._first=this._first.next,this._first.prev=N.Undefined);this._size-=1},k.prototype.iterator=function(){var b,S=this._first;return{next:function(){return S===N.Undefined?Z.c:(b?b.value=S.element:b={done:!1,value:S.element},S=S.next,b)}}},k.prototype.toArray=function(){for(var b=[],S=this._first;S!==N.Undefined;S=S.next)b.push(S.element);return b},k}()},"3SPk":function(ot,fe,U){ot.exports=U.p+"static/c.893027ce.svg"},"5A5F":function(ot,fe,U){ot.exports={flex_box_center:"flex_box_center___3fvo9",flex_space_between:"flex_space_between___2dIWe",flex_box_vertical_center:"flex_box_vertical_center___213Et",flex_box_center_end:"flex_box_center_end___1GXlY",flex_box_column:"flex_box_column___2XTWO",wrap:"wrap___1JbzU",bg:"bg___Dxa5l",btnWrap:"btnWrap___1CEeA",text:"text___ufYpy",btn:"btn___33IXa",content:"content___2Crhb",left:"left___12ObT",filterPoint:"filterPoint___1wSyY",btnWarp:"btnWarp___XLUgV",btnActive:"btnActive___2vIUq",action:"action___m_eZE",btnMask:"btnMask___epWeB",filterOrigin:"filterOrigin___OKol4",line:"line___psQHn",control:"control___1SAJX",table:"table___1Q9AI",tabWarp:"tabWarp___3884f",tabWarp2:"tabWarp2___1f1Zo",customTable:"customTable___6Ubut","btn-style-1":"btn-style-1___m4kGi","btn-style-2":"btn-style-2___2uJ8s","btn-style-3":"btn-style-3___3kuYl",right:"right___Ie2u1",title:"title___1uK2v",sort:"sort___1hyjY",titles:"titles___1i-V6",li:"li___3lR-W",titleWarp:"titleWarp___t0Zdh",hov:"hov___30B5q",hovBtn:"hovBtn___3ciGX",tag:"tag___hllWE",problemsclose:"problemsclose___1X9HB",imgsrc:"imgsrc___3koep"}},"6+eU":function(ot,fe,U){"use strict";U.d(fe,"a",function(){return u});var Z=U("wx14"),N=U("rePB"),_=U("VTBJ"),k=U("1OyB"),b=U("vuIU"),S=U("Ji7U"),j=U("LK+K"),M=U("q1tI"),O=U.n(M),w=U("TSYQ"),c=U.n(w),y=function(g){var s,o="".concat(g.rootPrefixCls,"-item"),r=c()(o,"".concat(o,"-").concat(g.page),(s={},Object(N.a)(s,"".concat(o,"-active"),g.active),Object(N.a)(s,g.className,!!g.className),Object(N.a)(s,"".concat(o,"-disabled"),!g.page),s)),t=function(){g.onClick(g.page)},T=function(A){g.onKeyPress(A,g.onClick,g.page)};return O.a.createElement("li",{title:g.showTitle?g.page:null,className:r,onClick:t,onKeyPress:T,tabIndex:"0"},g.itemRender(g.page,"page",O.a.createElement("a",{rel:"nofollow"},g.page)))},C=y,m={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},f=function(E){Object(S.a)(s,E);var g=Object(j.a)(s);function s(){var o;Object(k.a)(this,s);for(var r=arguments.length,t=new Array(r),T=0;T<r;T++)t[T]=arguments[T];return o=g.call.apply(g,[this].concat(t)),o.state={goInputText:""},o.buildOptionText=function(x){return"".concat(x," ").concat(o.props.locale.items_per_page)},o.changeSize=function(x){o.props.changeSize(Number(x))},o.handleChange=function(x){o.setState({goInputText:x.target.value})},o.handleBlur=function(x){var A=o.props,R=A.goButton,I=A.quickGo,B=A.rootPrefixCls,W=o.state.goInputText;if(R||W==="")return;if(x.relatedTarget&&(x.relatedTarget.className.indexOf("".concat(B,"-prev"))>=0||x.relatedTarget.className.indexOf("".concat(B,"-next"))>=0))return;o.setState({goInputText:""}),I(o.getValidValue())},o.go=function(x){var A=o.state.goInputText;if(A==="")return;(x.keyCode===m.ENTER||x.type==="click")&&(o.setState({goInputText:""}),o.props.quickGo(o.getValidValue()))},o}return Object(b.a)(s,[{key:"getValidValue",value:function(){var r=this.state,t=r.goInputText,T=r.current;return!t||isNaN(t)?T:Number(t)}},{key:"getPageSizeOptions",value:function(){var r=this.props,t=r.pageSize,T=r.pageSizeOptions;return T.some(function(x){return x.toString()===t.toString()})?T:T.concat([t.toString()]).sort(function(x,A){var R=isNaN(Number(x))?0:Number(x),I=isNaN(Number(A))?0:Number(A);return R-I})}},{key:"render",value:function(){var r=this,t=this.props,T=t.pageSize,x=t.locale,A=t.rootPrefixCls,R=t.changeSize,I=t.quickGo,B=t.goButton,W=t.selectComponentClass,$=t.buildOptionText,X=t.selectPrefixCls,V=t.disabled,se=this.state.goInputText,xe="".concat(A,"-options"),Ee=W,je=null,Ae=null,Oe=null;if(!R&&!I)return null;var Le=this.getPageSizeOptions();if(R&&Ee){var Pe=Le.map(function(he,Q){return O.a.createElement(Ee.Option,{key:Q,value:he.toString()},($||r.buildOptionText)(he))});je=O.a.createElement(Ee,{disabled:V,prefixCls:X,showSearch:!1,className:"".concat(xe,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(T||Le[0]).toString(),onChange:this.changeSize,getPopupContainer:function(Q){return Q.parentNode}},Pe)}return I&&(B&&(Oe=typeof B=="boolean"?O.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:V,className:"".concat(xe,"-quick-jumper-button")},x.jump_to_confirm):O.a.createElement("span",{onClick:this.go,onKeyUp:this.go},B)),Ae=O.a.createElement("div",{className:"".concat(xe,"-quick-jumper")},x.jump_to,O.a.createElement("input",{disabled:V,type:"text",value:se,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),x.page,Oe)),O.a.createElement("li",{className:"".concat(xe)},je,Ae)}}]),s}(O.a.Component);f.defaultProps={pageSizeOptions:["10","20","50","100"]};var v=f,a=U("N2Kk");function e(){}function n(E){return typeof E=="number"&&isFinite(E)&&Math.floor(E)===E}function i(E,g,s){return s}function h(E,g,s){var o=typeof E=="undefined"?g.pageSize:E;return Math.floor((s.total-1)/o)+1}var d=function(E){Object(S.a)(s,E);var g=Object(j.a)(s);function s(o){var r;Object(k.a)(this,s),r=g.call(this,o),r.getJumpPrevPage=function(){return Math.max(1,r.state.current-(r.props.showLessItems?3:5))},r.getJumpNextPage=function(){return Math.min(h(void 0,r.state,r.props),r.state.current+(r.props.showLessItems?3:5))},r.getItemIcon=function(R,I){var B=r.props.prefixCls,W=R||O.a.createElement("button",{type:"button","aria-label":I,className:"".concat(B,"-item-link")});return typeof R=="function"&&(W=O.a.createElement(R,Object(_.a)({},r.props))),W},r.savePaginationNode=function(R){r.paginationNode=R},r.isValid=function(R){return n(R)&&R!==r.state.current},r.shouldDisplayQuickJumper=function(){var R=r.props,I=R.showQuickJumper,B=R.pageSize,W=R.total;return W<=B?!1:I},r.handleKeyDown=function(R){(R.keyCode===m.ARROW_UP||R.keyCode===m.ARROW_DOWN)&&R.preventDefault()},r.handleKeyUp=function(R){var I=r.getValidValue(R),B=r.state.currentInputValue;I!==B&&r.setState({currentInputValue:I}),R.keyCode===m.ENTER?r.handleChange(I):R.keyCode===m.ARROW_UP?r.handleChange(I-1):R.keyCode===m.ARROW_DOWN&&r.handleChange(I+1)},r.changePageSize=function(R){var I=r.state.current,B=h(R,r.state,r.props);I=I>B?B:I,B===0&&(I=r.state.current),typeof R=="number"&&("pageSize"in r.props||r.setState({pageSize:R}),"current"in r.props||r.setState({current:I,currentInputValue:I})),r.props.onShowSizeChange(I,R),"onChange"in r.props&&r.props.onChange&&r.props.onChange(I,R)},r.handleChange=function(R){var I=r.props.disabled,B=R;if(r.isValid(B)&&!I){var W=h(void 0,r.state,r.props);B>W?B=W:B<1&&(B=1),"current"in r.props||r.setState({current:B,currentInputValue:B});var $=r.state.pageSize;return r.props.onChange(B,$),B}return r.state.current},r.prev=function(){r.hasPrev()&&r.handleChange(r.state.current-1)},r.next=function(){r.hasNext()&&r.handleChange(r.state.current+1)},r.jumpPrev=function(){r.handleChange(r.getJumpPrevPage())},r.jumpNext=function(){r.handleChange(r.getJumpNextPage())},r.hasPrev=function(){return r.state.current>1},r.hasNext=function(){return r.state.current<h(void 0,r.state,r.props)},r.runIfEnter=function(R,I){if(R.key==="Enter"||R.charCode===13){for(var B=arguments.length,W=new Array(B>2?B-2:0),$=2;$<B;$++)W[$-2]=arguments[$];I.apply(void 0,W)}},r.runIfEnterPrev=function(R){r.runIfEnter(R,r.prev)},r.runIfEnterNext=function(R){r.runIfEnter(R,r.next)},r.runIfEnterJumpPrev=function(R){r.runIfEnter(R,r.jumpPrev)},r.runIfEnterJumpNext=function(R){r.runIfEnter(R,r.jumpNext)},r.handleGoTO=function(R){(R.keyCode===m.ENTER||R.type==="click")&&r.handleChange(r.state.currentInputValue)};var t=o.onChange!==e,T="current"in o;T&&!t&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var x=o.defaultCurrent;"current"in o&&(x=o.current);var A=o.defaultPageSize;return"pageSize"in o&&(A=o.pageSize),x=Math.min(x,h(A,void 0,o)),r.state={current:x,currentInputValue:x,pageSize:A},r}return Object(b.a)(s,[{key:"componentDidUpdate",value:function(r,t){var T=this.props.prefixCls;if(t.current!==this.state.current&&this.paginationNode){var x=this.paginationNode.querySelector(".".concat(T,"-item-").concat(t.current));x&&document.activeElement===x&&x.blur()}}},{key:"getValidValue",value:function(r){var t=r.target.value,T=h(void 0,this.state,this.props),x=this.state.currentInputValue,A;return t===""?A=t:isNaN(Number(t))?A=x:t>=T?A=T:A=Number(t),A}},{key:"getShowSizeChanger",value:function(){var r=this.props,t=r.showSizeChanger,T=r.total,x=r.totalBoundaryShowSizeChanger;return typeof t!="undefined"?t:T>x}},{key:"renderPrev",value:function(r){var t=this.props,T=t.prevIcon,x=t.itemRender,A=x(r,"prev",this.getItemIcon(T,"prev page")),R=!this.hasPrev();return Object(M.isValidElement)(A)?Object(M.cloneElement)(A,{disabled:R}):A}},{key:"renderNext",value:function(r){var t=this.props,T=t.nextIcon,x=t.itemRender,A=x(r,"next",this.getItemIcon(T,"next page")),R=!this.hasNext();return Object(M.isValidElement)(A)?Object(M.cloneElement)(A,{disabled:R}):A}},{key:"render",value:function(){var r=this,t=this.props,T=t.prefixCls,x=t.className,A=t.style,R=t.disabled,I=t.hideOnSinglePage,B=t.total,W=t.locale,$=t.showQuickJumper,X=t.showLessItems,V=t.showTitle,se=t.showTotal,xe=t.simple,Ee=t.itemRender,je=t.showPrevNextJumpers,Ae=t.jumpPrevIcon,Oe=t.jumpNextIcon,Le=t.selectComponentClass,Pe=t.selectPrefixCls,he=t.pageSizeOptions,Q=this.state,Ke=Q.current,it=Q.pageSize,Qe=Q.currentInputValue;if(I===!0&&B<=it)return null;var Xe=h(void 0,this.state,this.props),ee=[],ie=null,be=null,Re=null,Ue=null,Ie=null,He=$&&$.goButton,Ge=X?1:2,ct=Ke-1>0?Ke-1:0,rt=Ke+1<Xe?Ke+1:Xe,st=Object.keys(this.props).reduce(function(z,G){return(G.substr(0,5)==="data-"||G.substr(0,5)==="aria-"||G==="role")&&(z[G]=r.props[G]),z},{});if(xe)return He&&(typeof He=="boolean"?Ie=O.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},W.jump_to_confirm):Ie=O.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},He),Ie=O.a.createElement("li",{title:V?"".concat(W.jump_to).concat(Ke,"/").concat(Xe):null,className:"".concat(T,"-simple-pager")},Ie)),O.a.createElement("ul",Object(Z.a)({className:c()(T,"".concat(T,"-simple"),Object(N.a)({},"".concat(T,"-disabled"),R),x),style:A,ref:this.savePaginationNode},st),O.a.createElement("li",{title:V?W.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:c()("".concat(T,"-prev"),Object(N.a)({},"".concat(T,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(ct)),O.a.createElement("li",{title:V?"".concat(Ke,"/").concat(Xe):null,className:"".concat(T,"-simple-pager")},O.a.createElement("input",{type:"text",value:Qe,disabled:R,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),O.a.createElement("span",{className:"".concat(T,"-slash")},"/"),Xe),O.a.createElement("li",{title:V?W.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:c()("".concat(T,"-next"),Object(N.a)({},"".concat(T,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(rt)),Ie);if(Xe<=3+Ge*2){var Ze={locale:W,rootPrefixCls:T,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:V,itemRender:Ee};Xe||ee.push(O.a.createElement(C,Object(Z.a)({},Ze,{key:"noPager",page:Xe,className:"".concat(T,"-disabled")})));for(var mt=1;mt<=Xe;mt+=1){var ht=Ke===mt;ee.push(O.a.createElement(C,Object(Z.a)({},Ze,{key:mt,page:mt,active:ht})))}}else{var me=X?W.prev_3:W.prev_5,Ce=X?W.next_3:W.next_5;je&&(ie=O.a.createElement("li",{title:V?me:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:c()("".concat(T,"-jump-prev"),Object(N.a)({},"".concat(T,"-jump-prev-custom-icon"),!!Ae))},Ee(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Ae,"prev page"))),be=O.a.createElement("li",{title:V?Ce:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:c()("".concat(T,"-jump-next"),Object(N.a)({},"".concat(T,"-jump-next-custom-icon"),!!Oe))},Ee(this.getJumpNextPage(),"jump-next",this.getItemIcon(Oe,"next page")))),Ue=O.a.createElement(C,{locale:W,last:!0,rootPrefixCls:T,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Xe,page:Xe,active:!1,showTitle:V,itemRender:Ee}),Re=O.a.createElement(C,{locale:W,rootPrefixCls:T,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:V,itemRender:Ee});var _e=Math.max(1,Ke-Ge),Fe=Math.min(Ke+Ge,Xe);Ke-1<=Ge&&(Fe=1+Ge*2),Xe-Ke<=Ge&&(_e=Xe-Ge*2);for(var Se=_e;Se<=Fe;Se+=1){var Me=Ke===Se;ee.push(O.a.createElement(C,{locale:W,rootPrefixCls:T,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Se,page:Se,active:Me,showTitle:V,itemRender:Ee}))}Ke-1>=Ge*2&&Ke!==1+2&&(ee[0]=Object(M.cloneElement)(ee[0],{className:"".concat(T,"-item-after-jump-prev")}),ee.unshift(ie)),Xe-Ke>=Ge*2&&Ke!==Xe-2&&(ee[ee.length-1]=Object(M.cloneElement)(ee[ee.length-1],{className:"".concat(T,"-item-before-jump-next")}),ee.push(be)),_e!==1&&ee.unshift(Re),Fe!==Xe&&ee.push(Ue)}var ue=null;se&&(ue=O.a.createElement("li",{className:"".concat(T,"-total-text")},se(B,[B===0?0:(Ke-1)*it+1,Ke*it>B?B:Ke*it])));var te=!this.hasPrev()||!Xe,re=!this.hasNext()||!Xe;return O.a.createElement("ul",Object(Z.a)({className:c()(T,x,Object(N.a)({},"".concat(T,"-disabled"),R)),style:A,unselectable:"unselectable",ref:this.savePaginationNode},st),ue,O.a.createElement("li",{title:V?W.prev_page:null,onClick:this.prev,tabIndex:te?null:0,onKeyPress:this.runIfEnterPrev,className:c()("".concat(T,"-prev"),Object(N.a)({},"".concat(T,"-disabled"),te)),"aria-disabled":te},this.renderPrev(ct)),ee,O.a.createElement("li",{title:V?W.next_page:null,onClick:this.next,tabIndex:re?null:0,onKeyPress:this.runIfEnterNext,className:c()("".concat(T,"-next"),Object(N.a)({},"".concat(T,"-disabled"),re)),"aria-disabled":re},this.renderNext(rt)),O.a.createElement(v,{disabled:R,locale:W,rootPrefixCls:T,selectComponentClass:Le,selectPrefixCls:Pe,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Ke,pageSize:it,pageSizeOptions:he,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:He}))}}],[{key:"getDerivedStateFromProps",value:function(r,t){var T={};if("current"in r&&(T.current=r.current,r.current!==t.current&&(T.currentInputValue=T.current)),"pageSize"in r&&r.pageSize!==t.pageSize){var x=t.current,A=h(r.pageSize,t,r);x=x>A?A:x,"current"in r||(T.current=x,T.currentInputValue=x),T.pageSize=r.pageSize}return T}}]),s}(O.a.Component);d.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:e,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:e,locale:a.a,style:{},itemRender:i,totalBoundaryShowSizeChanger:50};var u=d},"6RRn":function(ot,fe,U){"use strict";var Z=U("wCXF"),N=U("n6Qo");U.d(fe,"b",function(){return N.a});var _=U("IBYe"),k=U("6eGT"),b=U("hW8S");U.d(fe,"a",function(){return b.a}),fe.c=Z.b},"6eGT":function(ot,fe,U){"use strict";function Z(N){return null}fe.a=Z},"746U":function(ot,fe,U){"use strict";U.d(fe,"d",function(){return N}),U.d(fe,"j",function(){return _}),U.d(fe,"i",function(){return k}),U.d(fe,"h",function(){return b}),U.d(fe,"e",function(){return S}),U.d(fe,"k",function(){return j}),U.d(fe,"l",function(){return M}),U.d(fe,"a",function(){return O}),U.d(fe,"f",function(){return c}),U.d(fe,"g",function(){return y}),U.d(fe,"m",function(){return C}),U.d(fe,"c",function(){return v}),U.d(fe,"b",function(){return a}),U.d(fe,"n",function(){return e}),U.d(fe,"o",function(){return n});var Z={number:"number",string:"string",undefined:"undefined",object:"object",function:"function"};function N(i){return Array.isArray?Array.isArray(i):!!(i&&typeof i.length===Z.number&&i.constructor===Array)}function _(i){return typeof i===Z.string||i instanceof String}function k(i){return typeof i===Z.object&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function b(i){return(typeof i===Z.number||i instanceof Number)&&!isNaN(i)}function S(i){return i===!0||i===!1}function j(i){return typeof i===Z.undefined}function M(i){return j(i)||i===null}function O(i,h){if(!i)throw new Error(h?"Unexpected type, expected '"+h+"'":"Unexpected type")}var w=Object.prototype.hasOwnProperty;function c(i){if(!k(i))return!1;for(var h in i)if(w.call(i,h))return!1;return!0}function y(i){return typeof i===Z.function}function C(i,h){for(var d=Math.min(i.length,h.length),u=0;u<d;u++)m(i[u],h[u])}function m(i,h){if(_(h)){if(typeof i!==h)throw new Error("argument does not match constraint: typeof "+h)}else if(y(h)){try{if(i instanceof h)return}catch(d){}if(!M(i)&&i.constructor===h)return;if(h.length===1&&h.call(void 0,i)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function f(i){for(var h=[],d=Object.getPrototypeOf(i);Object.prototype!==d;)h=h.concat(Object.getOwnPropertyNames(d)),d=Object.getPrototypeOf(d);return h}function v(i){for(var h=[],d=0,u=f(i);d<u.length;d++){var E=u[d];typeof i[E]=="function"&&h.push(E)}return h}function a(i,h){for(var d=function(o){return function(){var r=Array.prototype.slice.call(arguments,0);return h(o,r)}},u={},E=0,g=i;E<g.length;E++){var s=g[E];u[s]=d(s)}return u}function e(i){return i===null?void 0:i}function n(i){return typeof i=="undefined"?null:i}},"815F":function(ot,fe,U){"use strict";U.d(fe,"e",function(){return j}),U.d(fe,"c",function(){return O}),U.d(fe,"d",function(){return w}),U.d(fe,"a",function(){return y}),U.d(fe,"f",function(){return C}),U.d(fe,"b",function(){return m});var Z=U("KQm4"),N=U("VTBJ"),_=U("Ff2n"),k=U("Zm9Q"),b=U("Kwbf"),S=U("OZM5");function j(f,v){return f!=null?f:v}function M(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],v=new Map;function a(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(e||[]).forEach(function(i){var h=i.key,d=i.children;Object(b.a)(h!=null,"Tree node must have a certain key: [".concat(n).concat(h,"]"));var u=String(h);Object(b.a)(!v.has(u)||h===null||h===void 0,"Same 'key' exist in the Tree: ".concat(u)),v.set(u,!0),a(d,"".concat(n).concat(u," > "))})}a(f)}function O(f){function v(a){var e=Object(k.a)(a);return e.map(function(n){if(!Object(S.i)(n))return Object(b.a)(!n,"Tree/TreeNode can only accept TreeNode as children."),null;var i=n.key,h=n.props,d=h.children,u=Object(_.a)(h,["children"]),E=Object(N.a)({key:i},u),g=v(d);return g.length&&(E.children=g),E}).filter(function(n){return n})}return v(f)}function w(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=new Set(v===!0?[]:v),e=[];function n(i){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return i.map(function(d,u){var E=Object(S.h)(h?h.pos:"0",u),g=j(d.key,E),s=Object(N.a)(Object(N.a)({},d),{},{parent:h,pos:E,children:null,data:d,isStart:[].concat(Object(Z.a)(h?h.isStart:[]),[u===0]),isEnd:[].concat(Object(Z.a)(h?h.isEnd:[]),[u===i.length-1])});return e.push(s),v===!0||a.has(g)?s.children=n(d.children||[],s):s.children=[],s})}return n(f),e}function c(f,v,a){var e;a?typeof a=="string"?e=function(h){return h[a]}:typeof a=="function"&&(e=function(h){return a(h)}):e=function(h,d){return j(h.key,d)};function n(i,h,d){var u=i?i.children:f,E=i?Object(S.h)(d.pos,h):"0";if(i){var g=e(i,E),s={node:i,index:h,pos:E,key:g,parentPos:d.node?d.pos:null,level:d.level+1};v(s)}u&&u.forEach(function(o,r){n(o,r,{node:i,pos:E,level:d?d.level+1:-1})})}n(null)}function y(f){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=v.initWrapper,e=v.processEntity,n=v.onProcessFinished,i=arguments.length>2?arguments[2]:void 0,h={},d={},u={posEntities:h,keyEntities:d};return a&&(u=a(u)||u),c(f,function(E){var g=E.node,s=E.index,o=E.pos,r=E.key,t=E.parentPos,T=E.level,x={node:g,index:s,key:r,pos:o,level:T},A=j(r,o);h[o]=x,d[A]=x,x.parent=h[t],x.parent&&(x.parent.children=x.parent.children||[],x.parent.children.push(x)),e&&e(x,u)},i),n&&n(u),u}function C(f,v){var a=v.expandedKeys,e=v.selectedKeys,n=v.loadedKeys,i=v.loadingKeys,h=v.checkedKeys,d=v.halfCheckedKeys,u=v.dragOverNodeKey,E=v.dropPosition,g=v.keyEntities,s=g[f],o={eventKey:f,expanded:a.indexOf(f)!==-1,selected:e.indexOf(f)!==-1,loaded:n.indexOf(f)!==-1,loading:i.indexOf(f)!==-1,checked:h.indexOf(f)!==-1,halfChecked:d.indexOf(f)!==-1,pos:String(s?s.pos:""),dragOver:u===f&&E===0,dragOverGapTop:u===f&&E===-1,dragOverGapBottom:u===f&&E===1};return o}function m(f){var v=f.data,a=f.expanded,e=f.selected,n=f.checked,i=f.loaded,h=f.loading,d=f.halfChecked,u=f.dragOver,E=f.dragOverGapTop,g=f.dragOverGapBottom,s=f.pos,o=f.active,r=Object(N.a)(Object(N.a)({},v),{},{expanded:a,selected:e,checked:n,loaded:i,loading:h,halfChecked:d,dragOver:u,dragOverGapTop:E,dragOverGapBottom:g,pos:s,active:o});return"props"in r||Object.defineProperty(r,"props",{get:function(){return Object(b.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),f}}),r}},"8HAY":function(ot,fe,U){"use strict";U.d(fe,"a",function(){return S}),U.d(fe,"b",function(){return j});var Z=U("pmY6"),N=U("MI8n"),_=function(){var M=function(O,w){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,y){c.__proto__=y}||function(c,y){for(var C in y)y.hasOwnProperty(C)&&(c[C]=y[C])},M(O,w)};return function(O,w){M(O,w);function c(){this.constructor=O}O.prototype=w===null?Object.create(w):(c.prototype=w.prototype,new c)}}(),k=function(M,O,w,c){function y(C){return C instanceof w?C:new w(function(m){m(C)})}return new(w||(w=Promise))(function(C,m){function f(e){try{a(c.next(e))}catch(n){m(n)}}function v(e){try{a(c.throw(e))}catch(n){m(n)}}function a(e){e.done?C(e.value):y(e.value).then(f,v)}a((c=c.apply(M,O||[])).next())})},b=function(M,O){var w={label:0,sent:function(){if(C[0]&1)throw C[1];return C[1]},trys:[],ops:[]},c,y,C,m;return m={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function f(a){return function(e){return v([a,e])}}function v(a){if(c)throw new TypeError("Generator is already executing.");for(;w;)try{if(c=1,y&&(C=a[0]&2?y.return:a[0]?y.throw||((C=y.return)&&C.call(y),0):y.next)&&!(C=C.call(y,a[1])).done)return C;(y=0,C)&&(a=[a[0]&2,C.value]);switch(a[0]){case 0:case 1:C=a;break;case 4:return w.label++,{value:a[1],done:!1};case 5:w.label++,y=a[1],a=[0];continue;case 7:a=w.ops.pop(),w.trys.pop();continue;default:if(!(C=w.trys,C=C.length>0&&C[C.length-1])&&(a[0]===6||a[0]===2)){w=0;continue}if(a[0]===3&&(!C||a[1]>C[0]&&a[1]<C[3])){w.label=a[1];break}if(a[0]===6&&w.label<C[1]){w.label=C[1],C=a;break}if(C&&w.label<C[2]){w.label=C[2],w.ops.push(a);break}C[2]&&w.ops.pop(),w.trys.pop();continue}a=O.call(M,w)}catch(e){a=[6,e],y=0}finally{c=C=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},S=function(M){_(O,M);function O(w,c,y,C,m){c===void 0&&(c=""),y===void 0&&(y=""),C===void 0&&(C=!0);var f=M.call(this)||this;return f._onDidChange=f._register(new N.a),f.onDidChange=f._onDidChange.event,f._enabled=!0,f._checked=!1,f._id=w,f._label=c,f._cssClass=y,f._enabled=C,f._actionCallback=m,f}return Object.defineProperty(O.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(O.prototype,"label",{get:function(){return this._label},set:function(w){this._setLabel(w)},enumerable:!0,configurable:!0}),O.prototype._setLabel=function(w){this._label!==w&&(this._label=w,this._onDidChange.fire({label:w}))},Object.defineProperty(O.prototype,"tooltip",{get:function(){return this._tooltip||""},set:function(w){this._setTooltip(w)},enumerable:!0,configurable:!0}),O.prototype._setTooltip=function(w){this._tooltip!==w&&(this._tooltip=w,this._onDidChange.fire({tooltip:w}))},Object.defineProperty(O.prototype,"class",{get:function(){return this._cssClass},set:function(w){this._setClass(w)},enumerable:!0,configurable:!0}),O.prototype._setClass=function(w){this._cssClass!==w&&(this._cssClass=w,this._onDidChange.fire({class:w}))},Object.defineProperty(O.prototype,"enabled",{get:function(){return this._enabled},set:function(w){this._setEnabled(w)},enumerable:!0,configurable:!0}),O.prototype._setEnabled=function(w){this._enabled!==w&&(this._enabled=w,this._onDidChange.fire({enabled:w}))},Object.defineProperty(O.prototype,"checked",{get:function(){return this._checked},set:function(w){this._setChecked(w)},enumerable:!0,configurable:!0}),O.prototype._setChecked=function(w){this._checked!==w&&(this._checked=w,this._onDidChange.fire({checked:w}))},O.prototype.run=function(w,c){return this._actionCallback?this._actionCallback(w):Promise.resolve(!0)},O}(Z.a),j=function(M){_(O,M);function O(){var w=M!==null&&M.apply(this,arguments)||this;return w._onDidBeforeRun=w._register(new N.a),w.onDidBeforeRun=w._onDidBeforeRun.event,w._onDidRun=w._register(new N.a),w.onDidRun=w._onDidRun.event,w}return O.prototype.run=function(w,c){return k(this,void 0,void 0,function(){var y,C;return b(this,function(m){switch(m.label){case 0:if(!w.enabled)return[2,Promise.resolve(null)];this._onDidBeforeRun.fire({action:w}),m.label=1;case 1:return m.trys.push([1,3,,4]),[4,this.runAction(w,c)];case 2:return y=m.sent(),this._onDidRun.fire({action:w,result:y}),[3,4];case 3:return C=m.sent(),this._onDidRun.fire({action:w,error:C}),[3,4];case 4:return[2]}})})},O.prototype.runAction=function(w,c){var y=c?w.run(c):w.run();return Promise.resolve(y)},O}(Z.a)},"8hTe":function(ot,fe,U){ot.exports={button:"button___1wy9m"}},"9Bee":function(ot,fe,U){"use strict";var Z=U("DYRE"),N=U("zeV3"),_=U("+L6B"),k=U("2/Rp"),b=U("k1fw"),S=U("9og8"),j=U("tJVT"),M=U("WmNS"),O=U.n(M),w=U("q1tI"),c=U.n(w),y=U("vg9a"),C=U("DlQD"),m=U.n(C),f=U("rUJ1");function v(L,l){var p=L.match(/^(\s+)(?:```)/);if(p===null)return l;var D=p[1];return l.split(`
`).map(function(F){var P=F.match(/^\s+/);if(P===null)return F;var de=Object(j.a)(P,1),We=de[0];return We.length>=D.length?F.slice(D.length):F}).join(`
`)}var a=[],e=["<ul>"],n=new m.a.Renderer,i=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function h(){a.length=0,e=["<ul>"]}var d={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function u(L,l,p,D){if(l>=L.length||L[l].level<=p)return l;var F=L[l];D.push("<li><a href='#"+F.anchor+"'>"+F.text+"</a>"),l++;var P=[];return l=u(L,l,F.level,P),P.length>0&&(D.push("<ul>"),P.forEach(function(de){D.push(de)}),D.push("</ul>")),D.push("</li>"),l=u(L,l,p,D),l}function E(){return u(a,0,0,e),e.push("</ul>"),e.join("")}var g={heading:function(l){var p=i.exec(l);if(p)return{type:"heading",raw:p[0],depth:p[1].length,text:p[2]}},fences:function(l){var p=this.rules.block.fences.exec(l);if(p){var D=p[0],F=v(D,p[3]||""),P=p[2]?p[2].trim():p[2];if(["latex","katex","math"].indexOf(P)>=0){var de=r(),We=F;F=de,t[de]={type:"block",expression:We}}return{type:"code",raw:D,lang:P,text:F}}}},s=/(?:\${2})([^\n`]+?)(?:\${2})/gi,o=0,r=function(){return"__special_katext_id_".concat(o++,"__")},t={};function T(){return t}function x(){o=0,t={}}function A(L){return L=L.replace(s,function(l,p){var D=r();return t[D]={type:"inline",expression:p},D}),L}var R=n.listitem;n.listitem=function(L){return R(A(L))};var I=n.paragraph;n.paragraph=function(L){return I(A(L))};var B=n.tablecell;n.tablecell=function(L,l){return B(A(L),l)},n.code=function(L,l,p){var D=(l||"").match(/\S*/)[0];return D?["latex","katex","math"].indexOf(D)>=0?"<p class='editormd-tex'>".concat(L,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(l,'">').concat(p?L:Object(f.escape)(L,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(p?L:Object(f.escape)(L,!0))+"</code></pre>"},n.heading=function(L,l,p){var D=this.options.headerPrefix+p.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return a.push({anchor:D,level:l,text:L}),"<h"+l+' id="'+D+'">'+L+"</h"+l+">"},m.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),m.a.use({tokenizer:g,renderer:n});var W=m.a,$=U("SJMd"),X=U("ulZh"),V=U.n(X),se=U("m3rI"),xe=U("Oy/b"),Ee=U("p5ED"),je=U("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 Ae=function(L,l){return(Ae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,D){p.__proto__=D}||function(p,D){for(var F in D)Object.prototype.hasOwnProperty.call(D,F)&&(p[F]=D[F])})(L,l)};function Oe(L,l){function p(){this.constructor=L}Ae(L,l),L.prototype=l===null?Object.create(l):(p.prototype=l.prototype,new p)}function Le(L,l,p,D){return new(p||(p=Promise))(function(F,P){function de(yt){try{at(D.next(yt))}catch(Ve){P(Ve)}}function We(yt){try{at(D.throw(yt))}catch(Ve){P(Ve)}}function at(yt){var Ve;yt.done?F(yt.value):(Ve=yt.value,Ve instanceof p?Ve:new p(function(St){St(Ve)})).then(de,We)}at((D=D.apply(L,l||[])).next())})}function Pe(L,l){var p,D,F,P,de={label:0,sent:function(){if(1&F[0])throw F[1];return F[1]},trys:[],ops:[]};return P={next:We(0),throw:We(1),return:We(2)},typeof Symbol=="function"&&(P[Symbol.iterator]=function(){return this}),P;function We(at){return function(yt){return function(Ve){if(p)throw new TypeError("Generator is already executing.");for(;de;)try{if(p=1,D&&(F=2&Ve[0]?D.return:Ve[0]?D.throw||((F=D.return)&&F.call(D),0):D.next)&&!(F=F.call(D,Ve[1])).done)return F;switch(D=0,F&&(Ve=[2&Ve[0],F.value]),Ve[0]){case 0:case 1:F=Ve;break;case 4:return de.label++,{value:Ve[1],done:!1};case 5:de.label++,D=Ve[1],Ve=[0];continue;case 7:Ve=de.ops.pop(),de.trys.pop();continue;default:if(!(F=de.trys,(F=F.length>0&&F[F.length-1])||Ve[0]!==6&&Ve[0]!==2)){de=0;continue}if(Ve[0]===3&&(!F||Ve[1]>F[0]&&Ve[1]<F[3])){de.label=Ve[1];break}if(Ve[0]===6&&de.label<F[1]){de.label=F[1],F=Ve;break}if(F&&de.label<F[2]){de.label=F[2],de.ops.push(Ve);break}F[2]&&de.ops.pop(),de.trys.pop();continue}Ve=l.call(L,de)}catch(St){Ve=[6,St],D=0}finally{p=F=0}if(5&Ve[0])throw Ve[1];return{value:Ve[0]?Ve[1]:void 0,done:!0}}([at,yt])}}}function he(){for(var L=0,l=0,p=arguments.length;l<p;l++)L+=arguments[l].length;var D=Array(L),F=0;for(l=0;l<p;l++)for(var P=arguments[l],de=0,We=P.length;de<We;de++,F++)D[F]=P[de];return D}var Q=function(){function L(){}return L.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},L.setAttributes=function(l,p){for(var D=0,F=p;D<F.length;D++){var P=F[D],de=P[0],We=P[1];l.setAttribute(de,We)}},L.createRect=function(l,p,D){var F=document.createElementNS("http://www.w3.org/2000/svg","rect");return F.setAttribute("width",l.toString()),F.setAttribute("height",p.toString()),D&&L.setAttributes(F,D),F},L.createLine=function(l,p,D,F,P){var de=document.createElementNS("http://www.w3.org/2000/svg","line");return de.setAttribute("x1",l.toString()),de.setAttribute("y1",p.toString()),de.setAttribute("x2",D.toString()),de.setAttribute("y2",F.toString()),P&&L.setAttributes(de,P),de},L.createPolygon=function(l,p){var D=document.createElementNS("http://www.w3.org/2000/svg","polygon");return D.setAttribute("points",l),p&&L.setAttributes(D,p),D},L.createCircle=function(l,p){var D=document.createElementNS("http://www.w3.org/2000/svg","circle");return D.setAttribute("cx",(l/2).toString()),D.setAttribute("cy",(l/2).toString()),D.setAttribute("r",l.toString()),p&&L.setAttributes(D,p),D},L.createEllipse=function(l,p,D){var F=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return F.setAttribute("cx",(l/2).toString()),F.setAttribute("cy",(p/2).toString()),F.setAttribute("rx",(l/2).toString()),F.setAttribute("ry",(p/2).toString()),D&&L.setAttributes(F,D),F},L.createGroup=function(l){var p=document.createElementNS("http://www.w3.org/2000/svg","g");return l&&L.setAttributes(p,l),p},L.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},L.createMarker=function(l,p,D,F,P,de,We){var at=document.createElementNS("http://www.w3.org/2000/svg","marker");return L.setAttributes(at,[["id",l],["orient",p],["markerWidth",D.toString()],["markerHeight",F.toString()],["refX",P.toString()],["refY",de.toString()]]),at.appendChild(We),at},L.createText=function(l){var p=document.createElementNS("http://www.w3.org/2000/svg","text");return p.setAttribute("x","0"),p.setAttribute("y","0"),l&&L.setAttributes(p,l),p},L.createTSpan=function(l,p){var D=document.createElementNS("http://www.w3.org/2000/svg","tspan");return D.textContent=l,p&&L.setAttributes(D,p),D},L.createImage=function(l){var p=document.createElementNS("http://www.w3.org/2000/svg","image");return l&&L.setAttributes(p,l),p},L.createPoint=function(l,p){var D=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return D.x=l,D.y=p,D},L.createPath=function(l,p){var D=document.createElementNS("http://www.w3.org/2000/svg","path");return D.setAttribute("d",l),p&&L.setAttributes(D,p),D},L}(),Ke=function(){function L(){}return L.addKey=function(l){L.key=l},Object.defineProperty(L,"isLicensed",{get:function(){return!!L.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(L.key)},enumerable:!1,configurable:!0}),L}(),it=function(){function L(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return L.prototype.rasterize=function(l,p,D){var F=this;return new Promise(function(P){var de=D!==void 0?D:document.createElement("canvas");l===null&&(F.markersOnly=!0,F.naturalSize=!1);var We=document.createElementNS("http://www.w3.org/2000/svg","svg");We.setAttribute("xmlns","http://www.w3.org/2000/svg"),We.setAttribute("width",p.width.baseVal.valueAsString),We.setAttribute("height",p.height.baseVal.valueAsString),We.setAttribute("viewBox","0 0 "+p.viewBox.baseVal.width.toString()+" "+p.viewBox.baseVal.height.toString()),We.innerHTML=p.innerHTML,F.naturalSize===!0?(We.width.baseVal.value=l.naturalWidth,We.height.baseVal.value=l.naturalHeight):F.width!==void 0&&F.height!==void 0&&(We.width.baseVal.value=F.width,We.height.baseVal.value=F.height),de.width=We.width.baseVal.value,de.height=We.height.baseVal.value;var at=We.outerHTML,yt=de.getContext("2d");F.markersOnly!==!0&&yt.drawImage(l,0,0,de.width,de.height);var Ve=window.URL,St=new Image(de.width,de.height);St.setAttribute("crossOrigin","anonymous");var At=new Blob([at],{type:"image/svg+xml"}),nr=Ve.createObjectURL(At);St.onload=function(){yt.drawImage(St,0,0),Ve.revokeObjectURL(nr);var ke=de.toDataURL(F.imageType,F.imageQuality);P(ke)},St.src=nr})},L}(),Qe=function(){},Xe=function(){function L(l){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+l+"_"}return Object.defineProperty(L.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(L.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(L.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),L.prototype.addClass=function(l){return this.styleSheet===void 0&&this.addStyleSheet(),l.name=""+this.classNamePrefix+l.localName,this.classes.push(l),this.styleSheet.sheet.insertRule("."+l.name+" {"+l.style+"}",this.styleSheet.sheet.cssRules.length),l},L.prototype.addRule=function(l){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(l),this.styleSheet.sheet.insertRule(l.selector+" {"+l.style+"}",this.styleSheet.sheet.cssRules.length)},L.prototype.addStyleSheet=function(){var l;this.styleSheet=document.createElement("style"),((l=this.styleSheetRoot)!==null&&l!==void 0?l:document.head).appendChild(this.styleSheet),this.addRule(new ee("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ee("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new ee("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new ie("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new ie("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},L.prototype.removeStyleSheet=function(){var l;this.styleSheet&&(((l=this.styleSheetRoot)!==null&&l!==void 0?l:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},L}(),ee=function(L,l){this.selector=L,this.style=l},ie=function(L,l){this.localName=L,this.style=l},be=function(){function L(l,p,D,F,P){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=l,this.displayMode=p,this.markerItems=D,this.uiStyleSettings=F,this.styles=P,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return L.prototype.show=function(l){var p=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=l,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var D=document.createElement("div");D.className=this.toolbarBlockStyleClass.name,D.style.whiteSpace="nowrap",this.uiContainer.appendChild(D),this.addActionButton(D,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(D,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(D,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(D,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(D,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(D,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(D,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(D,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(P){var de=document.createElement("div");de.className=""+p.toolbarButtonStyleClass.name,de.setAttribute("data-type-name",P.typeName),de.innerHTML=P.icon,de.addEventListener("click",function(){p.markerToolbarButtonClicked(de,P)}),p.buttons.push(de),p.markerButtons.push(de)}),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 F=document.createElement("div");F.className=this.toolbarBlockStyleClass.name,F.style.whiteSpace="nowrap",F.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(F),this.addActionButton(F,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(F,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},L.prototype.addButtonClickListener=function(l){this.buttonClickListeners.push(l)},L.prototype.removeButtonClickListener=function(l){this.buttonClickListeners.indexOf(l)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(l),1)},L.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},L.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var l=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var p=0;p<this.markerButtons.length;p++)p<l||p===l&&this.markerButtons.length-1===l?this.markerButtonBlock.appendChild(this.markerButtons[p]):(p===l&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[p]))}},L.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")},L.prototype.resetButtonStyles=function(){var l=this;this.buttons.forEach(function(p){p.className=p.className.replace(l.uiStyleSettings.toolbarButtonStyleColorsClassName?l.uiStyleSettings.toolbarButtonStyleColorsClassName:l.toolbarButtonStyleColorsClass.name,"").trim(),p.className=p.className.replace(l.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?l.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:l.toolbarActiveButtonStyleColorsClass.name,"").trim(),p.className+=" "+(l.uiStyleSettings.toolbarButtonStyleColorsClassName?l.uiStyleSettings.toolbarButtonStyleColorsClassName:l.toolbarButtonStyleColorsClass.name)})},L.prototype.addActionButton=function(l,p,D){var F=this,P=document.createElement("div");switch(P.className=""+this.toolbarButtonStyleClass.name,P.innerHTML=p,P.setAttribute("data-action",D),P.addEventListener("click",function(){F.actionToolbarButtonClicked(P,D)}),D){case"select":P.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":P.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":P.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":P.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":P.style.fill=this.uiStyleSettings.closeButtonColor}l.appendChild(P),this.buttons.push(P)},L.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ie("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 ie("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ie("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ie("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 ie("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var l=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ie("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*l)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*l)+`px;
padding: `+l+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ie("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ie("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new ee("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new ee("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},L.prototype.markerToolbarButtonClicked=function(l,p){this.setActiveButton(l),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(D){return D("marker",p)}),this.markerButtonOverflowBlock.style.display="none"},L.prototype.actionToolbarButtonClicked=function(l,p){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(D){return D("action",p)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},L.prototype.setActiveButton=function(l){this.resetButtonStyles(),l.className=l.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),l.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},L.prototype.setActiveMarkerButton=function(l){var p=this.markerButtons.find(function(D){return D.getAttribute("data-type-name")===l});p&&this.setActiveButton(p)},L.prototype.setCurrentMarker=function(l){var p=this;this.currentMarker=l,this.buttons.filter(function(D){return/delete|notes/.test(D.getAttribute("data-action"))}).forEach(function(D){p.currentMarker===void 0?(D.style.fillOpacity="0.4",D.style.pointerEvents="none"):(D.style.fillOpacity="1",D.style.pointerEvents="all")})},L}(),Re=function(){function L(l,p,D,F){this.panels=[],this.panelButtons=[],this.markerjsContainer=l,this.displayMode=p,this.uiStyleSettings=D,this.styles=F,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return L.prototype.addStyles=function(){var l;this.toolboxStyleClass=this.styles.addClass(new ie("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 ie("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var p=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ie("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ie("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ie("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 ie("toolbox-panel-row_colors",`
background-color: `+((l=this.uiStyleSettings.toolboxBackgroundColor)!==null&&l!==void 0?l:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ie("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*p)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*p)+`px;
padding: `+p+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ie("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ie("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new ee("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new ee("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},L.prototype.show=function(l){var p;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=l,this.uiContainer.className=this.toolboxStyleClass.name+" "+((p=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&p!==void 0?p:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},L.prototype.setPanelButtons=function(l){var p,D,F=this;this.panels=l,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((p=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&p!==void 0?p:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((D=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&D!==void 0?D:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(P){var de;P.uiStyleSettings=F.uiStyleSettings;var We=document.createElement("div");We.className=F.toolboxButtonStyleClass.name+" "+((de=F.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&de!==void 0?de:F.toolboxButtonStyleColorsClass.name),We.innerHTML=P.icon,We.title=P.title,We.addEventListener("click",function(){F.panelButtonClick(P)}),F.panelButtons.push(We),F.buttonRow.appendChild(We)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},L.prototype.panelButtonClick=function(l){var p=this,D=-1;if(l!==this.activePanel){D=this.panels.indexOf(l),this.panelRow.innerHTML="";var F=l.getUi();F.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(F),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=l}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){p.displayMode==="inline"?p.panelRow.style.display="none":p.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(P,de){var We,at;P.className=p.toolboxButtonStyleClass.name+" "+(de===D?""+((We=p.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&We!==void 0?We:p.toolboxActiveButtonStyleColorsClass.name):""+((at=p.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&at!==void 0?at:p.toolboxButtonStyleColorsClass.name))})},L}(),Ue=function(L,l){this.title=L,this.icon=l},Ie=function(L){function l(p,D,F,P){var de=L.call(this,p,P||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return de.colors=[],de.addTransparent=!1,de.colorBoxes=[],de.colors=D,de.currentColor=F,de.setCurrentColor=de.setCurrentColor.bind(de),de.getColorBox=de.getColorBox.bind(de),de}return Oe(l,L),l.prototype.getUi=function(){var p=this,D=document.createElement("div");return D.style.overflow="hidden",D.style.whiteSpace="nowrap",this.colors.forEach(function(F){var P=p.getColorBox(F);D.appendChild(P),p.colorBoxes.push(P)}),D},l.prototype.getColorBox=function(p){var D=this,F=this.uiStyleSettings.toolbarHeight/4,P=this.uiStyleSettings.toolbarHeight-F,de=document.createElement("div");de.style.display="inline-block",de.style.boxSizing="content-box",de.style.width=P-2+"px",de.style.height=P-2+"px",de.style.padding="1px",de.style.marginRight="2px",de.style.marginBottom="2px",de.style.borderWidth="2px",de.style.borderStyle="solid",de.style.borderRadius=(P+2)/2+"px",de.style.borderColor=p===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",de.addEventListener("click",function(){D.setCurrentColor(p,de)});var We=document.createElement("div");return We.style.display="inline-block",We.style.width=P-2+"px",We.style.height=P-2+"px",We.style.backgroundColor=p,We.style.borderRadius=P/2+"px",p==="transparent"&&(We.style.fill=this.uiStyleSettings.toolboxAccentColor,We.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>`),de.appendChild(We),de},l.prototype.setCurrentColor=function(p,D){var F=this;this.currentColor=p,this.colorBoxes.forEach(function(P){P.style.borderColor=P===D?F.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(p)},l}(Ue),He=function(){function L(l,p,D){this._state="new",this._isSelected=!1,this._container=l,this._overlayContainer=p,this.globalSettings=D,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(L.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),L.prototype.ownsTarget=function(l){return!1},Object.defineProperty(L.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),L.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},L.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},L.prototype.pointerDown=function(l,p){},L.prototype.dblClick=function(l,p){},L.prototype.manipulate=function(l){},L.prototype.pointerUp=function(l){this.stateChanged()},L.prototype.dispose=function(){},L.prototype.addMarkerVisualToContainer=function(l){this.container.childNodes.length>0?this.container.insertBefore(l,this.container.childNodes[0]):this.container.appendChild(l)},L.prototype.getState=function(){return{typeName:L.typeName,state:this.state,notes:this.notes}},L.prototype.restoreState=function(l){this._state=l.state,this.notes=l.notes},L.prototype.scale=function(l,p){},L.prototype.colorChanged=function(l){this.onColorChanged&&this.onColorChanged(l),this.stateChanged()},L.prototype.fillColorChanged=function(l){this.onFillColorChanged&&this.onFillColorChanged(l),this.stateChanged()},L.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var l=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),l.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(l)&&this.onStateChanged(this)}},L.typeName="MarkerBase",L}(),Ge=function(){function L(){this.findGripByVisual=this.findGripByVisual.bind(this)}return L.prototype.findGripByVisual=function(l){return this.topLeft.ownsTarget(l)?this.topLeft:this.topCenter.ownsTarget(l)?this.topCenter:this.topRight.ownsTarget(l)?this.topRight:this.centerLeft.ownsTarget(l)?this.centerLeft:this.centerRight.ownsTarget(l)?this.centerRight:this.bottomLeft.ownsTarget(l)?this.bottomLeft:this.bottomCenter.ownsTarget(l)?this.bottomCenter:this.bottomRight.ownsTarget(l)?this.bottomRight:void 0},L}(),ct=function(){function L(){this.GRIP_SIZE=10,this.visual=Q.createGroup(),this.visual.appendChild(Q.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Q.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return L.prototype.ownsTarget=function(l){return l===this.visual||l===this.visual.childNodes[0]||l===this.visual.childNodes[1]},L}(),rt=function(){function L(){}return L.toITransformMatrix=function(l){return{a:l.a,b:l.b,c:l.c,d:l.d,e:l.e,f:l.f}},L.toSVGMatrix=function(l,p){return l.a=p.a,l.b=p.b,l.c=p.c,l.d=p.d,l.e=p.e,l.f=p.f,l},L}(),st=function(L){function l(p,D,F){var P=L.call(this,p,D,F)||this;return P.left=0,P.top=0,P.width=0,P.height=0,P.defaultSize={x:50,y:20},P.offsetX=0,P.offsetY=0,P.rotationAngle=0,P.CB_DISTANCE=10,P._suppressMarkerCreateEvent=!1,P.container.transform.baseVal.appendItem(Q.createTransform()),P.setupControlBox(),P}return Oe(l,L),Object.defineProperty(l.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"visual",{get:function(){return this._visual},set:function(p){this._visual=p;var D=Q.createTransform();this._visual.transform.baseVal.appendItem(D)},enumerable:!1,configurable:!0}),l.prototype.ownsTarget=function(p){return!!L.prototype.ownsTarget.call(this,p)||!!(this.controlGrips.findGripByVisual(p)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(p))},l.prototype.pointerDown=function(p,D){L.prototype.pointerDown.call(this,p,D),this.state==="new"&&(this.left=p.x,this.top=p.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var F=this.unrotatePoint(p);if(this.manipulationStartX=F.x,this.manipulationStartY=F.y,this.offsetX=F.x-this.left,this.offsetY=F.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(D),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(D)){this.activeGrip=this.rotatorGrip;var P=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=P.x-this.width/2,this.top=P.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var de=this.container.transform.baseVal.getItem(0);de.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(de,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},l.prototype.pointerUp=function(p){var D=this.state;L.prototype.pointerUp.call(this,p),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(p),this._state="select",D==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},l.prototype.moveVisual=function(p){this.visual.style.transform="translate("+p.x+"px, "+p.y+"px)"},l.prototype.manipulate=function(p){var D=this.unrotatePoint(p);this.state==="creating"?this.resize(p):this.state==="move"?(this.left=this.manipulationStartLeft+(D.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(D.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(D):this.state==="rotate"&&this.rotate(p)},l.prototype.resize=function(p){var D=this.manipulationStartLeft,F=this.manipulationStartWidth,P=this.manipulationStartTop,de=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:D=this.manipulationStartLeft+p.x-this.manipulationStartX,F=this.manipulationStartWidth+this.manipulationStartLeft-D;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:F=this.manipulationStartWidth+p.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:P=this.manipulationStartTop+p.y-this.manipulationStartY,de=this.manipulationStartHeight+this.manipulationStartTop-P;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:de=this.manipulationStartHeight+p.y-this.manipulationStartY}F>=0?(this.left=D,this.width=F):(this.left=D+F,this.width=-F),de>=0?(this.top=P,this.height=de):(this.top=P+de,this.height=-de),this.setSize()},l.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},l.prototype.rotate=function(p){if(Math.abs(p.x-this.centerX)>.1){var D=Math.sign(p.x-this.centerX);this.rotationAngle=180*Math.atan((p.y-this.centerY)/(p.x-this.centerX))/Math.PI+90*D,this.applyRotation()}},l.prototype.applyRotation=function(){var p=this.container.transform.baseVal.getItem(0);p.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(p,0)},l.prototype.rotatePoint=function(p){if(this.rotationAngle===0)return p;var D=this.container.getCTM(),F=Q.createPoint(p.x,p.y);return{x:(F=F.matrixTransform(D)).x,y:F.y}},l.prototype.unrotatePoint=function(p){if(this.rotationAngle===0)return p;var D=this.container.getCTM();D=D.inverse();var F=Q.createPoint(p.x,p.y);return{x:(F=F.matrixTransform(D)).x,y:F.y}},l.prototype.select=function(){L.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},l.prototype.deselect=function(){L.prototype.deselect.call(this),this.controlBox.style.display="none"},l.prototype.setupControlBox=function(){this.controlBox=Q.createGroup();var p=Q.createTransform();p.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(p),this.container.appendChild(this.controlBox),this.controlRect=Q.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=Q.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 Ge,this.addControlGrips(),this.controlBox.style.display="none"},l.prototype.adjustControlBox=function(){var p=this.controlBox.transform.baseVal.getItem(0);p.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(p,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()},l.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()},l.prototype.createGrip=function(){var p=new ct;return p.visual.transform.baseVal.appendItem(Q.createTransform()),this.controlBox.appendChild(p.visual),p},l.prototype.positionGrips=function(){var p=this.controlGrips.topLeft.GRIP_SIZE,D=-p/2,F=D,P=(this.width+this.CB_DISTANCE)/2-p/2,de=(this.height+this.CB_DISTANCE)/2-p/2,We=this.height+this.CB_DISTANCE-p/2,at=this.width+this.CB_DISTANCE-p/2;this.positionGrip(this.controlGrips.topLeft.visual,D,F),this.positionGrip(this.controlGrips.topCenter.visual,P,F),this.positionGrip(this.controlGrips.topRight.visual,at,F),this.positionGrip(this.controlGrips.centerLeft.visual,D,de),this.positionGrip(this.controlGrips.centerRight.visual,at,de),this.positionGrip(this.controlGrips.bottomLeft.visual,D,We),this.positionGrip(this.controlGrips.bottomCenter.visual,P,We),this.positionGrip(this.controlGrips.bottomRight.visual,at,We),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,P,F-3*this.CB_DISTANCE)},l.prototype.positionGrip=function(p,D,F){var P=p.transform.baseVal.getItem(0);P.setTranslate(D,F),p.transform.baseVal.replaceItem(P,0)},l.prototype.hideControlBox=function(){this.controlBox.style.display="none"},l.prototype.showControlBox=function(){this.controlBox.style.display=""},l.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:rt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:rt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},L.prototype.getState.call(this))},l.prototype.restoreState=function(p){L.prototype.restoreState.call(this,p);var D=p;this.left=D.left,this.top=D.top,this.width=D.width,this.height=D.height,this.rotationAngle=D.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(rt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,D.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(rt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,D.containerTransformMatrix))},l.prototype.scale=function(p,D){L.prototype.scale.call(this,p,D);var F=this.rotatePoint({x:this.left,y:this.top}),P=this.unrotatePoint({x:F.x*p,y:F.y*D});this.left=P.x,this.top=P.y,this.width=this.width*p,this.height=this.height*D,this.adjustControlBox()},l}(He),Ze=function(L){function l(p,D,F){var P=L.call(this,p,D,F)||this;return P.fillColor="transparent",P.strokeColor="transparent",P.strokeWidth=0,P.strokeDasharray="",P.opacity=1,P.setStrokeColor=P.setStrokeColor.bind(P),P.setFillColor=P.setFillColor.bind(P),P.setStrokeWidth=P.setStrokeWidth.bind(P),P.setStrokeDasharray=P.setStrokeDasharray.bind(P),P.createVisual=P.createVisual.bind(P),P}return Oe(l,L),l.prototype.ownsTarget=function(p){return!(!L.prototype.ownsTarget.call(this,p)&&p!==this.visual)},l.prototype.createVisual=function(){this.visual=Q.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)},l.prototype.pointerDown=function(p,D){L.prototype.pointerDown.call(this,p,D),this.state==="new"&&(this.createVisual(),this.moveVisual(p),this._state="creating")},l.prototype.manipulate=function(p){L.prototype.manipulate.call(this,p)},l.prototype.resize=function(p){L.prototype.resize.call(this,p),this.setSize()},l.prototype.setSize=function(){L.prototype.setSize.call(this),Q.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},l.prototype.pointerUp=function(p){L.prototype.pointerUp.call(this,p),this.setSize()},l.prototype.setStrokeColor=function(p){this.strokeColor=p,this.visual&&Q.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(p),this.stateChanged()},l.prototype.setFillColor=function(p){this.fillColor=p,this.visual&&Q.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},l.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.visual&&Q.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},l.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.visual&&Q.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},l.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},L.prototype.getState.call(this))},l.prototype.restoreState=function(p){var D=p;this.fillColor=D.fillColor,this.strokeColor=D.strokeColor,this.strokeWidth=D.strokeWidth,this.strokeDasharray=D.strokeDasharray,this.opacity=D.opacity,this.createVisual(),L.prototype.restoreState.call(this,p),this.setSize()},l.prototype.scale=function(p,D){L.prototype.scale.call(this,p,D),this.setSize()},l.title="Rectangle marker",l}(st),mt=function(L){function l(p,D,F,P){var de=L.call(this,p,P||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return de.widths=[],de.widthBoxes=[],de.widths=D,de.currentWidth=F,de.setCurrentWidth=de.setCurrentWidth.bind(de),de}return Oe(l,L),l.prototype.getUi=function(){var p=this,D=document.createElement("div");return D.style.display="flex",D.style.overflow="hidden",D.style.flexGrow="2",this.widths.forEach(function(F){var P=document.createElement("div");P.style.display="flex",P.style.flexGrow="2",P.style.alignItems="center",P.style.justifyContent="space-between",P.style.padding="5px",P.style.borderWidth="2px",P.style.borderStyle="solid",P.style.borderColor=F===p.currentWidth?p.uiStyleSettings.toolboxAccentColor:"transparent",P.addEventListener("click",function(){p.setCurrentWidth(F,P)}),D.appendChild(P);var de=document.createElement("div");de.innerText=F.toString(),de.style.marginRight="5px",P.appendChild(de);var We=document.createElement("div");We.style.minHeight="20px",We.style.flexGrow="2",We.style.display="flex",We.style.alignItems="center";var at=document.createElement("hr");at.style.minWidth="20px",at.style.border="0px",at.style.borderTop=F+"px solid "+p.uiStyleSettings.toolboxColor,at.style.flexGrow="2",We.appendChild(at),P.appendChild(We),p.widthBoxes.push(P)}),D},l.prototype.setCurrentWidth=function(p,D){var F=this;this.currentWidth=p,this.widthBoxes.forEach(function(P){P.style.borderColor=P===D?F.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},l}(Ue),ht=function(L){function l(p,D,F,P){var de=L.call(this,p,P||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return de.styles=[],de.styleBoxes=[],de.styles=D,de.currentStyle=F,de.setCurrentStyle=de.setCurrentStyle.bind(de),de}return Oe(l,L),l.prototype.getUi=function(){var p=this,D=document.createElement("div");return D.style.display="flex",D.style.overflow="hidden",D.style.flexGrow="2",this.styles.forEach(function(F){var P=document.createElement("div");P.style.display="flex",P.style.alignItems="center",P.style.justifyContent="space-between",P.style.padding="5px",P.style.borderWidth="2px",P.style.borderStyle="solid",P.style.overflow="hidden",P.style.maxWidth=100/p.styles.length-5+"%",P.style.borderColor=F===p.currentStyle?p.uiStyleSettings.toolboxAccentColor:"transparent",P.addEventListener("click",function(){p.setCurrentStyle(F,P)}),D.appendChild(P);var de=document.createElement("div");de.style.minHeight="20px",de.style.flexGrow="2",de.style.overflow="hidden";var We=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+p.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(F!==""?'stroke-dasharray="'+F+'"':"")+` />
</svg>`;de.innerHTML=We,P.appendChild(de),p.styleBoxes.push(P)}),D},l.prototype.setCurrentStyle=function(p,D){var F=this;this.currentStyle=p,this.styleBoxes.forEach(function(P){P.style.borderColor=P===D?F.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},l}(Ue),me=function(L){function l(p,D,F){var P=L.call(this,p,D,F)||this;return P.strokeColor=F.defaultColor,P.strokeWidth=F.defaultStrokeWidth,P.strokeDasharray=F.defaultStrokeDasharray,P.strokePanel=new Ie("Line color",F.defaultColorSet,F.defaultColor),P.strokePanel.onColorChanged=P.setStrokeColor,P.strokeWidthPanel=new mt("Line width",F.defaultStrokeWidths,F.defaultStrokeWidth),P.strokeWidthPanel.onWidthChanged=P.setStrokeWidth,P.strokeStylePanel=new ht("Line style",F.defaultStrokeDasharrays,F.defaultStrokeDasharray),P.strokeStylePanel.onStyleChanged=P.setStrokeDasharray,P}return Oe(l,L),Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=L.prototype.getState.call(this);return p.typeName=l.typeName,p},l.typeName="FrameMarker",l.title="Frame marker",l.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',l}(Ze),Ce=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},_e=function(L){function l(p,D,F){var P=L.call(this,p,D,F)||this;return P.x1=0,P.y1=0,P.x2=0,P.y2=0,P.defaultLength=50,P.manipulationStartX=0,P.manipulationStartY=0,P.manipulationStartX1=0,P.manipulationStartY1=0,P.manipulationStartX2=0,P.manipulationStartY2=0,P.setupControlBox(),P}return Oe(l,L),l.prototype.ownsTarget=function(p){return!!L.prototype.ownsTarget.call(this,p)||!(!this.grip1.ownsTarget(p)&&!this.grip2.ownsTarget(p))},l.prototype.pointerDown=function(p,D){L.prototype.pointerDown.call(this,p,D),this.manipulationStartX=p.x,this.manipulationStartY=p.y,this.state==="new"&&(this.x1=p.x,this.y1=p.y,this.x2=p.x,this.y2=p.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(D)?this.activeGrip=this.grip1:this.grip2.ownsTarget(D)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},l.prototype.pointerUp=function(p){var D=this.state;L.prototype.pointerUp.call(this,p),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(p),this._state="select",D==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},l.prototype.adjustVisual=function(){},l.prototype.manipulate=function(p){this.state==="creating"?this.resize(p):this.state==="move"?(this.x1=this.manipulationStartX1+p.x-this.manipulationStartX,this.y1=this.manipulationStartY1+p.y-this.manipulationStartY,this.x2=this.manipulationStartX2+p.x-this.manipulationStartX,this.y2=this.manipulationStartY2+p.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(p)},l.prototype.resize=function(p){switch(this.activeGrip){case this.grip1:this.x1=p.x,this.y1=p.y;break;case this.grip2:case void 0:this.x2=p.x,this.y2=p.y}this.adjustVisual(),this.adjustControlBox()},l.prototype.select=function(){L.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},l.prototype.deselect=function(){L.prototype.deselect.call(this),this.controlBox.style.display="none"},l.prototype.setupControlBox=function(){this.controlBox=Q.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},l.prototype.adjustControlBox=function(){this.positionGrips()},l.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},l.prototype.createGrip=function(){var p=new ct;return p.visual.transform.baseVal.appendItem(Q.createTransform()),this.controlBox.appendChild(p.visual),p},l.prototype.positionGrips=function(){var p=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-p/2,this.y1-p/2),this.positionGrip(this.grip2.visual,this.x2-p/2,this.y2-p/2)},l.prototype.positionGrip=function(p,D,F){var P=p.transform.baseVal.getItem(0);P.setTranslate(D,F),p.transform.baseVal.replaceItem(P,0)},l.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},L.prototype.getState.call(this))},l.prototype.restoreState=function(p){L.prototype.restoreState.call(this,p);var D=p;this.x1=D.x1,this.y1=D.y1,this.x2=D.x2,this.y2=D.y2},l.prototype.scale=function(p,D){L.prototype.scale.call(this,p,D),this.x1=this.x1*p,this.y1=this.y1*D,this.x2=this.x2*p,this.y2=this.y2*D,this.adjustVisual(),this.adjustControlBox()},l}(He),Fe=function(L){function l(p,D,F){var P=L.call(this,p,D,F)||this;return P.strokeColor="transparent",P.strokeWidth=0,P.strokeDasharray="",P.setStrokeColor=P.setStrokeColor.bind(P),P.setStrokeWidth=P.setStrokeWidth.bind(P),P.setStrokeDasharray=P.setStrokeDasharray.bind(P),P.strokeColor=F.defaultColor,P.strokeWidth=F.defaultStrokeWidth,P.strokeDasharray=F.defaultStrokeDasharray,P.strokePanel=new Ie("Line color",F.defaultColorSet,F.defaultColor),P.strokePanel.onColorChanged=P.setStrokeColor,P.strokeWidthPanel=new mt("Line width",F.defaultStrokeWidths,F.defaultStrokeWidth),P.strokeWidthPanel.onWidthChanged=P.setStrokeWidth,P.strokeStylePanel=new ht("Line style",F.defaultStrokeDasharrays,F.defaultStrokeDasharray),P.strokeStylePanel.onStyleChanged=P.setStrokeDasharray,P}return Oe(l,L),l.prototype.ownsTarget=function(p){return!(!L.prototype.ownsTarget.call(this,p)&&p!==this.visual&&p!==this.selectorLine&&p!==this.visibleLine)},l.prototype.createVisual=function(){this.visual=Q.createGroup(),this.selectorLine=Q.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=Q.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)},l.prototype.pointerDown=function(p,D){L.prototype.pointerDown.call(this,p,D),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},l.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()),Q.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),Q.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),Q.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},l.prototype.setStrokeColor=function(p){this.strokeColor=p,this.adjustVisual(),this.colorChanged(p)},l.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.adjustVisual()},l.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.adjustVisual(),this.stateChanged()},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},L.prototype.getState.call(this));return p.typeName=l.typeName,p},l.prototype.restoreState=function(p){L.prototype.restoreState.call(this,p);var D=p;this.strokeColor=D.strokeColor,this.strokeWidth=D.strokeWidth,this.strokeDasharray=D.strokeDasharray,this.createVisual(),this.adjustVisual()},l.typeName="LineMarker",l.title="Line marker",l.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',l}(_e),Se=function(L){function l(p,D,F,P){var de=L.call(this,p,P||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return de.fonts=[],de.fontBoxes=[],de.fonts=D,de.currentFont=F,de.setCurrentFont=de.setCurrentFont.bind(de),de}return Oe(l,L),l.prototype.getUi=function(){var p=this,D=document.createElement("div");return D.style.overflow="hidden",D.style.flexGrow="2",this.fonts.forEach(function(F){var P=document.createElement("div");P.style.display="inline-block",P.style.alignItems="center",P.style.justifyContent="space-between",P.style.padding="5px",P.style.borderWidth="2px",P.style.borderStyle="solid",P.style.overflow="hidden",P.style.maxWidth=100/p.fonts.length-5+"%",P.style.borderColor=F===p.currentFont?p.uiStyleSettings.toolboxAccentColor:"transparent",P.addEventListener("click",function(){p.setCurrentFont(F,P)}),D.appendChild(P);var de=document.createElement("div");de.style.display="flex",de.style.minHeight="20px",de.style.flexGrow="2",de.style.fontFamily=F,de.style.overflow="hidden";var We=document.createElement("div");We.style.whiteSpace="nowrap",We.style.overflow="hidden",We.style.textOverflow="ellipsis",We.innerHTML="The quick brown fox jumps over the lazy dog",de.appendChild(We),P.appendChild(de),p.fontBoxes.push(P)}),D},l.prototype.setCurrentFont=function(p,D){var F=this;this.currentFont=p,this.fontBoxes.forEach(function(P){P.style.borderColor=P===D?F.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},l}(Ue),Me=function(L){function l(p,D,F){var P=L.call(this,p,D,F)||this;return P.color="transparent",P.padding=5,P.DEFAULT_TEXT="your text here",P.text=P.DEFAULT_TEXT,P.isMoved=!1,P.color=F.defaultColor,P.fontFamily=F.defaultFontFamily,P.defaultSize={x:100,y:30},P.setColor=P.setColor.bind(P),P.setFont=P.setFont.bind(P),P.renderText=P.renderText.bind(P),P.sizeText=P.sizeText.bind(P),P.textEditDivClicked=P.textEditDivClicked.bind(P),P.showTextEditor=P.showTextEditor.bind(P),P.setSize=P.setSize.bind(P),P.positionTextEditor=P.positionTextEditor.bind(P),P.colorPanel=new Ie("Color",F.defaultColorSet,F.defaultColor),P.colorPanel.onColorChanged=P.setColor,P.fontFamilyPanel=new Se("Font",F.defaultFontFamilies,F.defaultFontFamily),P.fontFamilyPanel.onFontChanged=P.setFont,P}return Oe(l,L),l.prototype.ownsTarget=function(p){if(L.prototype.ownsTarget.call(this,p)||p===this.visual||p===this.textElement||p===this.bgRectangle)return!0;var D=!1;return this.textElement.childNodes.forEach(function(F){F===p&&(D=!0)}),D},l.prototype.createVisual=function(){this.visual=Q.createGroup(),this.bgRectangle=Q.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=Q.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(Q.createTransform()),this.textElement.transform.baseVal.appendItem(Q.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},l.prototype.pointerDown=function(p,D){L.prototype.pointerDown.call(this,p,D),this.isMoved=!1,this.pointerDownPoint=p,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(p),this._state="creating")},l.prototype.renderText=function(){var p=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(D){p.textElement.appendChild(Q.createTSpan(D.trim()===""?" ":D.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},l.prototype.getTextScale=function(){var p=this.textElement.getBBox(),D=1;if(p.width>0&&p.height>0){var F=(1*this.width-this.width*this.padding*2/100)/p.width,P=(1*this.height-this.height*this.padding*2/100)/p.height;D=Math.min(F,P)}return D},l.prototype.getTextPosition=function(p){var D=this.textElement.getBBox(),F=0,P=0;return D.width>0&&D.height>0&&(F=(this.width-D.width*p)/2,P=this.height/2-D.height*p/2),{x:F,y:P}},l.prototype.sizeText=function(){var p=this.textElement.getBBox(),D=this.getTextScale(),F=this.getTextPosition(D);F.y-=p.y*D,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+F.x+"px, "+F.y+"px) scale("+D+", "+D+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(F.x,F.y),this.textElement.transform.baseVal.getItem(1).setScale(D,D))},l.prototype.manipulate=function(p){L.prototype.manipulate.call(this,p),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(p.x-this.pointerDownPoint.x)>5||Math.abs(p.y-this.pointerDownPoint.y)>5)},l.prototype.resize=function(p){L.prototype.resize.call(this,p),this.isMoved=!0,this.setSize(),this.sizeText()},l.prototype.setSize=function(){L.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(Q.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Q.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},l.prototype.pointerUp=function(p){var D=this.state;D==="creating"&&(this._suppressMarkerCreateEvent=!0),L.prototype.pointerUp.call(this,p),this.setSize(),(D==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},l.prototype.showTextEditor=function(){var p=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(D){D.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var D=Number.parseFloat(p.textEditor.style.fontSize);p.textEditor.clientWidth>=Number.parseInt(p.textEditor.style.maxWidth)&&D>.9;)D-=.1,p.textEditor.style.fontSize=Math.max(D,.9)+"em"}),this.textEditor.addEventListener("keyup",function(D){D.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(D){if(D.clipboardData){var F=D.clipboardData.getData("text"),P=window.getSelection();if(!P.rangeCount)return!1;P.deleteFromDocument(),P.getRangeAt(0).insertNode(document.createTextNode(F)),D.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){p.textEditDivClicked(p.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},l.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var p=this.getTextScale(),D=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),F=this.textElement.getBBox(),P={x:F.width*p,y:F.height*p};D.x-=P.x/2,D.y-=P.y/2,this.textEditor.style.top=D.y+"px",this.textEditor.style.left=D.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-D.x+"px",this.textEditor.style.fontSize=Math.max(16*p,12)+"px",this.textElement.style.display="none"}},l.prototype.textEditDivClicked=function(p){this.text=p.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},l.prototype.select=function(){L.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},l.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),L.prototype.deselect.call(this)},l.prototype.dblClick=function(p,D){L.prototype.dblClick.call(this,p,D),this.showTextEditor()},l.prototype.setColor=function(p){this.textElement&&Q.setAttributes(this.textElement,[["fill",p]]),this.color=p,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(p)},l.prototype.setFont=function(p){this.textElement&&Q.setAttributes(this.textElement,[["font-family",p]]),this.fontFamily=p,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},l.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},l.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},L.prototype.getState.call(this));return p.typeName=l.typeName,p},l.prototype.restoreState=function(p){var D=p;this.color=D.color,this.fontFamily=D.fontFamily,this.padding=D.padding,this.text=D.text,this.createVisual(),L.prototype.restoreState.call(this,p),this.setSize()},l.prototype.scale=function(p,D){L.prototype.scale.call(this,p,D),this.setSize(),this.sizeText(),this.positionTextEditor()},l.typeName="TextMarker",l.title="Text marker",l.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>',l}(st),ue=function(L){function l(p,D,F){var P=L.call(this,p,D,F)||this;return P.color="transparent",P.lineWidth=3,P.drawing=!1,P.pixelRatio=1,P.color=F.defaultColor,P.lineWidth=F.defaultStrokeWidth,P.pixelRatio=F.freehandPixelRatio,P.setColor=P.setColor.bind(P),P.addCanvas=P.addCanvas.bind(P),P.finishCreation=P.finishCreation.bind(P),P.setLineWidth=P.setLineWidth.bind(P),P.colorPanel=new Ie("Color",F.defaultColorSet,F.defaultColor),P.colorPanel.onColorChanged=P.setColor,P.lineWidthPanel=new mt("Line width",F.defaultStrokeWidths,F.defaultStrokeWidth),P.lineWidthPanel.onWidthChanged=P.setLineWidth,P}return Oe(l,L),l.prototype.ownsTarget=function(p){return!(!L.prototype.ownsTarget.call(this,p)&&p!==this.visual&&p!==this.drawingImage)},l.prototype.createVisual=function(){this.visual=Q.createGroup(),this.drawingImage=Q.createImage(),this.visual.appendChild(this.drawingImage);var p=Q.createTransform();this.visual.transform.baseVal.appendItem(p),this.addMarkerVisualToContainer(this.visual)},l.prototype.pointerDown=function(p,D){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(p.x,p.y),this.drawing=!0):L.prototype.pointerDown.call(this,p,D)},l.prototype.manipulate=function(p){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(p.x,p.y),this.canvasContext.stroke()):L.prototype.manipulate.call(this,p)},l.prototype.resize=function(p){L.prototype.resize.call(this,p),Q.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Q.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},l.prototype.pointerUp=function(p){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):L.prototype.pointerUp.call(this,p)},l.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)},l.prototype.select=function(){this.state==="creating"&&this.finishCreation(),L.prototype.select.call(this)},l.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),L.prototype.deselect.call(this)},l.prototype.finishCreation=function(){for(var p=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),D=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],F=D[0],P=D[1],de=D[2],We=D[3],at=!1,yt=0;yt<this.canvasElement.height;yt++)for(var Ve=0;Ve<this.canvasElement.width;Ve++)p.data[yt*this.canvasElement.width*4+4*Ve+3]>0&&(at=!0,yt<P&&(P=yt),Ve<F&&(F=Ve),yt>We&&(We=yt),Ve>de&&(de=Ve));if(at){this.left=F/this.pixelRatio,this.top=P/this.pixelRatio,this.width=(de-F)/this.pixelRatio,this.height=(We-P)/this.pixelRatio;var St=document.createElement("canvas");St.width=de-F,St.height=We-P,St.getContext("2d").putImageData(this.canvasContext.getImageData(F,P,de-F,We-P),0,0),this.drawingImgUrl=St.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},l.prototype.setDrawingImage=function(){Q.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),Q.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},l.prototype.setColor=function(p){this.color=p,this.colorChanged(p)},l.prototype.setLineWidth=function(p){this.lineWidth=p},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=Object.assign({drawingImgUrl:this.drawingImgUrl},L.prototype.getState.call(this));return p.typeName=l.typeName,p},l.prototype.restoreState=function(p){this.createVisual(),L.prototype.restoreState.call(this,p),this.drawingImgUrl=p.drawingImgUrl,this.setDrawingImage()},l.prototype.scale=function(p,D){L.prototype.scale.call(this,p,D),this.setDrawingImage()},l.typeName="FreehandMarker",l.title="Freehand marker",l.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>',l}(st),te=function(L){function l(p,D,F){var P=L.call(this,p,F||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return P.typeBoxes=[],P.currentType=D,P.setCurrentType=P.setCurrentType.bind(P),P}return Oe(l,L),l.prototype.getUi=function(){var p=this,D=document.createElement("div");D.style.display="flex",D.style.overflow="hidden",D.style.flexGrow="2";for(var F=function(We){var at="both";switch(We){case 0:at="both";break;case 1:at="start";break;case 2:at="end";break;case 3:at="none"}var yt=document.createElement("div");if(yt.style.display="flex",yt.style.flexGrow="2",yt.style.alignItems="center",yt.style.justifyContent="space-between",yt.style.padding="5px",yt.style.borderWidth="2px",yt.style.borderStyle="solid",yt.style.borderColor=at===P.currentType?P.uiStyleSettings.toolboxAccentColor:"transparent",yt.addEventListener("click",function(){p.setCurrentType(at,yt)}),D.appendChild(yt),at==="both"||at==="start"){var Ve=document.createElement("div");Ve.style.display="flex",Ve.style.alignItems="center",Ve.style.minHeight="20px",Ve.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="`+(P.uiStyleSettings!==void 0?P.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Ve.style.marginLeft="5px",yt.appendChild(Ve)}var St=document.createElement("div");St.style.display="flex",St.style.alignItems="center",St.style.minHeight="20px",St.style.flexGrow="2";var At=document.createElement("hr");if(At.style.minWidth="20px",At.style.border="0px",At.style.borderTop="3px solid "+(P.uiStyleSettings!==void 0?P.uiStyleSettings.toolboxColor:"#eeeeee"),At.style.flexGrow="2",St.appendChild(At),yt.appendChild(St),at==="both"||at==="end"){var nr=document.createElement("div");nr.style.display="flex",nr.style.alignItems="center",nr.style.minHeight="20px",nr.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="`+(P.uiStyleSettings!==void 0?P.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,nr.style.marginRight="5px",yt.appendChild(nr)}P.typeBoxes.push(yt)},P=this,de=0;de<4;de++)F(de);return D},l.prototype.setCurrentType=function(p,D){var F=this;this.currentType=p,this.typeBoxes.forEach(function(P){P.style.borderColor=P===D?F.uiStyleSettings!==void 0?F.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},l}(Ue),re=function(L){function l(p,D,F){var P=L.call(this,p,D,F)||this;return P.arrowType="end",P.arrowBaseHeight=10,P.arrowBaseWidth=10,P.getArrowPoints=P.getArrowPoints.bind(P),P.setArrowType=P.setArrowType.bind(P),P.arrowTypePanel=new te("Arrow type","end"),P.arrowTypePanel.onArrowTypeChanged=P.setArrowType,P}return Oe(l,L),l.prototype.ownsTarget=function(p){return!(!L.prototype.ownsTarget.call(this,p)&&p!==this.arrow1&&p!==this.arrow2)},l.prototype.getArrowPoints=function(p,D){var F=this.arrowBaseWidth+2*this.strokeWidth,P=this.arrowBaseHeight+2*this.strokeWidth;return p-F/2+","+(D+P/2)+" "+p+","+(D-P/2)+" "+(p+F/2)+","+(D+P/2)},l.prototype.createTips=function(){this.arrow1=Q.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(Q.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=Q.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(Q.createTransform()),this.visual.appendChild(this.arrow2)},l.prototype.pointerDown=function(p,D){L.prototype.pointerDown.call(this,p,D),this.state==="creating"&&this.createTips()},l.prototype.adjustVisual=function(){if(L.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",Q.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),Q.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var p=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),D=this.arrow1.transform.baseVal.getItem(0);D.setRotate(p,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(D,0);var F=this.arrow2.transform.baseVal.getItem(0);F.setRotate(p+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(F,0)}},l.prototype.setArrowType=function(p){this.arrowType=p,this.adjustVisual(),this.stateChanged()},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=Object.assign({arrowType:this.arrowType},L.prototype.getState.call(this));return p.typeName=l.typeName,p},l.prototype.restoreState=function(p){L.prototype.restoreState.call(this,p);var D=p;this.arrowType=D.arrowType,this.createTips(),this.adjustVisual()},l.typeName="ArrowMarker",l.title="Arrow marker",l.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',l}(Fe),z=function(L){function l(p,D,F){var P=L.call(this,p,D,F)||this;return P.fillColor=F.defaultFillColor,P.strokeWidth=0,P.fillPanel=new Ie("Color",F.defaultColorSet,F.defaultFillColor),P.fillPanel.onColorChanged=P.setFillColor,P}return Oe(l,L),Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=L.prototype.getState.call(this);return p.typeName=l.typeName,p},l.typeName="CoverMarker",l.title="Cover marker",l.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',l}(Ze),G=function(L){function l(p,D,F,P){var de=L.call(this,p,P||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return de.opacities=[],de.opacityBoxes=[],de.opacities=D,de.currentOpacity=F,de.setCurrentOpacity=de.setCurrentOpacity.bind(de),de}return Oe(l,L),l.prototype.getUi=function(){var p=this,D=document.createElement("div");return D.style.display="flex",D.style.overflow="hidden",D.style.flexGrow="2",D.style.justifyContent="space-between",this.opacities.forEach(function(F){var P=document.createElement("div");P.style.display="flex",P.style.alignItems="center",P.style.justifyContent="center",P.style.padding="5px",P.style.borderWidth="2px",P.style.borderStyle="solid",P.style.borderColor=F===p.currentOpacity?p.uiStyleSettings.toolboxAccentColor:"transparent",P.addEventListener("click",function(){p.setCurrentOpacity(F,P)}),D.appendChild(P);var de=document.createElement("div");de.innerText=100*F+"%",P.appendChild(de),p.opacityBoxes.push(P)}),D},l.prototype.setCurrentOpacity=function(p,D){var F=this;this.currentOpacity=p,this.opacityBoxes.forEach(function(P){P.style.borderColor=P===D?F.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},l}(Ue),J=function(L){function l(p,D,F){var P=L.call(this,p,D,F)||this;return P.setOpacity=P.setOpacity.bind(P),P.fillColor=F.defaultHighlightColor,P.strokeWidth=0,P.opacity=F.defaultHighlightOpacity,P.fillPanel=new Ie("Color",F.defaultColorSet,P.fillColor),P.fillPanel.onColorChanged=P.setFillColor,P.opacityPanel=new G("Opacity",F.defaultOpacitySteps,P.opacity),P.opacityPanel.onOpacityChanged=P.setOpacity,P}return Oe(l,L),l.prototype.setOpacity=function(p){this.opacity=p,this.visual&&Q.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=L.prototype.getState.call(this);return p.typeName=l.typeName,p},l.typeName="HighlightMarker",l.title="Highlight marker",l.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>',l}(z),ne='<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>',ve=function(L){function l(p,D,F){var P=L.call(this,p,D,F)||this;return P.bgColor="transparent",P.tipPosition={x:0,y:0},P.tipBase1Position={x:0,y:0},P.tipBase2Position={x:0,y:0},P.tipMoving=!1,P.color=F.defaultStrokeColor,P.bgColor=F.defaultFillColor,P.fontFamily=F.defaultFontFamily,P.defaultSize={x:100,y:30},P.setBgColor=P.setBgColor.bind(P),P.getTipPoints=P.getTipPoints.bind(P),P.positionTip=P.positionTip.bind(P),P.setTipPoints=P.setTipPoints.bind(P),P.colorPanel=new Ie("Text color",F.defaultColorSet,P.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),P.colorPanel.onColorChanged=P.setColor,P.bgColorPanel=new Ie("Fill color",F.defaultColorSet,P.bgColor,ne),P.bgColorPanel.onColorChanged=P.setBgColor,P.fontFamilyPanel=new Se("Font",F.defaultFontFamilies,F.defaultFontFamily),P.fontFamilyPanel.onFontChanged=P.setFont,P.tipGrip=new ct,P.tipGrip.visual.transform.baseVal.appendItem(Q.createTransform()),P.controlBox.appendChild(P.tipGrip.visual),P}return Oe(l,L),l.prototype.ownsTarget=function(p){return L.prototype.ownsTarget.call(this,p)||this.tipGrip.ownsTarget(p)||this.tip===p},l.prototype.createTip=function(){Q.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=Q.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},l.prototype.pointerDown=function(p,D){this.state==="new"&&L.prototype.pointerDown.call(this,p,D),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(D)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):L.prototype.pointerDown.call(this,p,D)},l.prototype.pointerUp=function(p){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,L.prototype.pointerUp.call(this,p);else{var D=this.state==="creating";L.prototype.pointerUp.call(this,p),this.setTipPoints(D),this.positionTip()}},l.prototype.manipulate=function(p){if(this.tipMoving){var D=this.unrotatePoint(p);this.tipPosition={x:D.x-this.manipulationStartLeft,y:D.y-this.manipulationStartTop},this.positionTip()}else L.prototype.manipulate.call(this,p)},l.prototype.setBgColor=function(p){this.bgRectangle&&this.tip&&(Q.setAttributes(this.bgRectangle,[["fill",p]]),Q.setAttributes(this.tip,[["fill",p]])),this.bgColor=p,this.fillColorChanged(p)},l.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},l.prototype.setTipPoints=function(p){p===void 0&&(p=!1);var D=Math.min(this.height/2,15),F=this.height/5;p&&(this.tipPosition={x:D+F/2,y:this.height+20});var P=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?P<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(F=this.width/5,D=Math.min(this.width/2,15),this.tipBase1Position={x:D,y:0},this.tipBase2Position={x:D+F,y:0}):(this.tipBase1Position={x:0,y:D},this.tipBase2Position={x:0,y:D+F}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?P<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(F=this.width/5,D=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-D-F,y:0},this.tipBase2Position={x:this.width-D,y:0}):(this.tipBase1Position={x:this.width,y:D},this.tipBase2Position={x:this.width,y:D+F}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?P<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(F=this.width/5,D=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-D-F,y:this.height},this.tipBase2Position={x:this.width-D,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-D-F},this.tipBase2Position={x:this.width,y:this.height-D}):P<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(F=this.width/5,D=Math.min(this.width/2,15),this.tipBase1Position={x:D,y:this.height},this.tipBase2Position={x:D+F,y:this.height}):(this.tipBase1Position={x:0,y:this.height-D},this.tipBase2Position={x:0,y:this.height-D-F})},l.prototype.resize=function(p){L.prototype.resize.call(this,p),this.positionTip()},l.prototype.positionTip=function(){Q.setAttributes(this.tip,[["points",this.getTipPoints()]]);var p=this.tipGrip.visual.transform.baseVal.getItem(0);p.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(p,0)},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),l.prototype.select=function(){this.positionTip(),L.prototype.select.call(this)},l.prototype.getState=function(){var p=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},L.prototype.getState.call(this));return p.typeName=l.typeName,p},l.prototype.restoreState=function(p){var D=p;this.bgColor=D.bgColor,this.tipPosition=D.tipPosition,L.prototype.restoreState.call(this,p),this.createTip(),this.setTipPoints()},l.prototype.scale=function(p,D){L.prototype.scale.call(this,p,D),this.tipPosition={x:this.tipPosition.x*p,y:this.tipPosition.y*D},this.positionTip()},l.typeName="CalloutMarker",l.title="Callout marker",l.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>',l}(Me),we=function(L){function l(p,D,F){var P=L.call(this,p,D,F)||this;return P.fillColor="transparent",P.strokeColor="transparent",P.strokeWidth=0,P.strokeDasharray="",P.opacity=1,P.strokeColor=F.defaultColor,P.strokeWidth=F.defaultStrokeWidth,P.strokeDasharray=F.defaultStrokeDasharray,P.fillColor=F.defaultFillColor,P.setStrokeColor=P.setStrokeColor.bind(P),P.setFillColor=P.setFillColor.bind(P),P.setStrokeWidth=P.setStrokeWidth.bind(P),P.setStrokeDasharray=P.setStrokeDasharray.bind(P),P.setOpacity=P.setOpacity.bind(P),P.createVisual=P.createVisual.bind(P),P.strokePanel=new Ie("Line color",he(F.defaultColorSet,["transparent"]),F.defaultColor),P.strokePanel.onColorChanged=P.setStrokeColor,P.fillPanel=new Ie("Fill color",he(F.defaultColorSet,["transparent"]),P.fillColor,ne),P.fillPanel.onColorChanged=P.setFillColor,P.strokeWidthPanel=new mt("Line width",F.defaultStrokeWidths,F.defaultStrokeWidth),P.strokeWidthPanel.onWidthChanged=P.setStrokeWidth,P.strokeStylePanel=new ht("Line style",F.defaultStrokeDasharrays,F.defaultStrokeDasharray),P.strokeStylePanel.onStyleChanged=P.setStrokeDasharray,P.opacityPanel=new G("Opacity",F.defaultOpacitySteps,P.opacity),P.opacityPanel.onOpacityChanged=P.setOpacity,P}return Oe(l,L),l.prototype.ownsTarget=function(p){return!(!L.prototype.ownsTarget.call(this,p)&&p!==this.visual)},l.prototype.createVisual=function(){this.visual=Q.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)},l.prototype.pointerDown=function(p,D){L.prototype.pointerDown.call(this,p,D),this.state==="new"&&(this.createVisual(),this.moveVisual(p),this._state="creating")},l.prototype.manipulate=function(p){L.prototype.manipulate.call(this,p)},l.prototype.resize=function(p){L.prototype.resize.call(this,p),this.setSize()},l.prototype.setSize=function(){L.prototype.setSize.call(this),Q.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},l.prototype.pointerUp=function(p){L.prototype.pointerUp.call(this,p),this.setSize()},l.prototype.setStrokeColor=function(p){this.strokeColor=p,this.visual&&Q.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(p),this.stateChanged()},l.prototype.setFillColor=function(p){this.fillColor=p,this.visual&&Q.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(p),this.stateChanged()},l.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.visual&&Q.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},l.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.visual&&Q.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},l.prototype.setOpacity=function(p){this.opacity=p,this.visual&&Q.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},L.prototype.getState.call(this));return p.typeName=l.typeName,p},l.prototype.restoreState=function(p){var D=p;this.fillColor=D.fillColor,this.strokeColor=D.strokeColor,this.strokeWidth=D.strokeWidth,this.strokeDasharray=D.strokeDasharray,this.opacity=D.opacity,this.createVisual(),L.prototype.restoreState.call(this,p),this.setSize()},l.prototype.scale=function(p,D){L.prototype.scale.call(this,p,D),this.setSize()},l.typeName="EllipseMarker",l.title="Ellipse marker",l.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>',l}(st),ze=function(L){function l(p,D,F){return L.call(this,p,D,F)||this}return Oe(l,L),Object.defineProperty(l.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),l.prototype.ownsTarget=function(p){return!(!L.prototype.ownsTarget.call(this,p)&&p!==this.tip1&&p!==this.tip2)},l.prototype.createTips=function(){this.tip1=Q.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(Q.createTransform()),this.visual.appendChild(this.tip1),this.tip2=Q.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(Q.createTransform()),this.visual.appendChild(this.tip2)},l.prototype.pointerDown=function(p,D){L.prototype.pointerDown.call(this,p,D),this.state==="creating"&&this.createTips()},l.prototype.adjustVisual=function(){if(L.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(Q.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()]]),Q.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 p=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),D=this.tip1.transform.baseVal.getItem(0);D.setRotate(p,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(D,0);var F=this.tip2.transform.baseVal.getItem(0);F.setRotate(p+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(F,0)}},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=L.prototype.getState.call(this);return p.typeName=l.typeName,p},l.prototype.restoreState=function(p){L.prototype.restoreState.call(this,p),this.createTips(),this.adjustVisual()},l.typeName="MeasurementMarker",l.title="Measurement marker",l.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>',l}(Fe),nt=function(L){function l(p,D,F){var P=L.call(this,p,D,F)||this;return P.strokePanel.colors=F.defaultColorSet,P.fillColor="transparent",P}return Oe(l,L),Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=L.prototype.getState.call(this);return p.typeName=l.typeName,p},l.typeName="EllipseFrameMarker",l.title="Ellipse frame marker",l.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>',l}(we),ft=function(){function L(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(L.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),L.prototype.addUndoStep=function(l){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(l)||(this.undoStack.push(l),JSON.stringify(this.lastRedoStep)!==JSON.stringify(l)&&this.redoStack.splice(0,this.redoStack.length))},L.prototype.replaceLastUndoStep=function(l){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=l)},L.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},L.prototype.undo=function(){if(this.undoStack.length>1){var l=this.undoStack.pop();return l!==void 0&&this.redoStack.push(l),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},L.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},L}(),tt=function(L){function l(p,D,F){var P=L.call(this,p,D,F)||this;return P.strokeColor="transparent",P.strokeWidth=0,P.strokeDasharray="",P.curveX=0,P.curveY=0,P.manipulationStartCurveX=0,P.manipulationStartCurveY=0,P.setStrokeColor=P.setStrokeColor.bind(P),P.setStrokeWidth=P.setStrokeWidth.bind(P),P.setStrokeDasharray=P.setStrokeDasharray.bind(P),P.positionGrips=P.positionGrips.bind(P),P.addControlGrips=P.addControlGrips.bind(P),P.adjustVisual=P.adjustVisual.bind(P),P.setupControlBox=P.setupControlBox.bind(P),P.resize=P.resize.bind(P),P.strokeColor=F.defaultColor,P.strokeWidth=F.defaultStrokeWidth,P.strokeDasharray=F.defaultStrokeDasharray,P.strokePanel=new Ie("Line color",F.defaultColorSet,F.defaultColor),P.strokePanel.onColorChanged=P.setStrokeColor,P.strokeWidthPanel=new mt("Line width",F.defaultStrokeWidths,F.defaultStrokeWidth),P.strokeWidthPanel.onWidthChanged=P.setStrokeWidth,P.strokeStylePanel=new ht("Line style",F.defaultStrokeDasharrays,F.defaultStrokeDasharray),P.strokeStylePanel.onStyleChanged=P.setStrokeDasharray,P}return Oe(l,L),l.prototype.ownsTarget=function(p){return!(!L.prototype.ownsTarget.call(this,p)&&p!==this.visual&&p!==this.selectorCurve&&p!==this.visibleCurve&&!this.curveGrip.ownsTarget(p))},l.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},l.prototype.createVisual=function(){this.visual=Q.createGroup(),this.selectorCurve=Q.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=Q.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)},l.prototype.pointerDown=function(p,D){L.prototype.pointerDown.call(this,p,D),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=p.x,this.curveY=p.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(D)&&(this.activeGrip=this.curveGrip,this._state="resize")},l.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),Q.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),Q.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),Q.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},l.prototype.setupControlBox=function(){L.prototype.setupControlBox.call(this),this.curveControlLine1=Q.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=Q.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)},l.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,L.prototype.addControlGrips.call(this)},l.prototype.positionGrips=function(){L.prototype.positionGrips.call(this);var p=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-p/2,this.curveY-p/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()))},l.prototype.manipulate=function(p){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+p.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+p.y-this.manipulationStartY),L.prototype.manipulate.call(this,p)},l.prototype.resize=function(p){this.activeGrip===this.curveGrip&&(this.curveX=p.x,this.curveY=p.y),L.prototype.resize.call(this,p),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},l.prototype.setStrokeColor=function(p){this.strokeColor=p,this.adjustVisual(),this.colorChanged(p)},l.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.adjustVisual()},l.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.adjustVisual()},l.prototype.scale=function(p,D){this.curveX=this.curveX*p,this.curveY=this.curveY*D,L.prototype.scale.call(this,p,D)},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},L.prototype.getState.call(this));return p.typeName=l.typeName,p},l.prototype.restoreState=function(p){L.prototype.restoreState.call(this,p);var D=p;this.strokeColor=D.strokeColor,this.strokeWidth=D.strokeWidth,this.strokeDasharray=D.strokeDasharray,this.curveX=D.curveX,this.curveY=D.curveY,this.createVisual(),this.adjustVisual()},l.typeName="CurveMarker",l.title="Curve marker",l.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>',l}(_e),Ct=function(){function L(l,p){p===void 0&&(p=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=l,this.cancelable=p}return Object.defineProperty(L.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),L.prototype.preventDefault=function(){this._defaultPrevented=!0},L}(),_t=function(L){function l(p,D,F){var P=L.call(this,p,!1)||this;return P.dataUrl=D,P.state=F,P}return Oe(l,L),l}(Ct),dt=function(L){function l(p,D,F){F===void 0&&(F=!1);var P=L.call(this,p,F)||this;return P.marker=D,P}return Oe(l,L),l}(Ct),kt=function(){function L(){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 L.prototype.addEventListener=function(l,p){this[l].push(p)},L.prototype.removeEventListener=function(l,p){var D=this[l].indexOf(p);D>-1&&this[l].splice(D,1)},L}(),It=function(){function L(l){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ce,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 kt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=L.instanceCounter++,this.styles=new Xe(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=l,this.targetRoot=document.body,this.width=l.clientWidth,this.height=l.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(L.prototype,"ALL_MARKER_TYPES",{get:function(){return[me,ue,re,Me,nt,we,J,ve,ze,z,Fe,tt]},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[me,ue,re,Me,we,J,ve]},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"BASIC_MARKER_TYPES",{get:function(){return[me,ue,re,Me,J]},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(l){var p=this;this._availableMarkerTypes.splice(0),l.forEach(function(D){if(typeof D=="string"){var F=p.ALL_MARKER_TYPES.find(function(P){return P.typeName===D});F!==void 0&&p._availableMarkerTypes.push(F)}else p._availableMarkerTypes.push(D)})},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(l){this._zoomLevel=l,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(L.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),L.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Ke.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},L.prototype.show=function(){var l=this;this.styles.styleSheetRoot===void 0&&Qe.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Qe.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(p){return p(new Ct(l))})},L.prototype.render=function(){return Le(this,void 0,void 0,function(){var l;return Pe(this,function(p){switch(p.label){case 0:return this.setCurrentMarker(),(l=new it).naturalSize=this.renderAtNaturalSize,l.imageType=this.renderImageType,l.imageQuality=this.renderImageQuality,l.markersOnly=this.renderMarkersOnly,l.width=this.renderWidth,l.height=this.renderHeight,[4,l.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return p.sent(),[4,l.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,p.sent()]}})})},L.prototype.close=function(l){var p=this;if(l===void 0&&(l=!1),this.isOpen){var D=!1;l||this.eventListeners.beforeclose.forEach(function(F){var P=new Ct(p,!0);F(P),P.defaultPrevented&&(D=!0)}),D||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(F){return F(new Ct(p))}),this.detachEvents(),this._isOpen=!1)}},L.prototype.addMarkersToToolbar=function(){for(var l,p=[],D=0;D<arguments.length;D++)p[D]=arguments[D];(l=this._availableMarkerTypes).push.apply(l,p)},L.prototype.addRenderEventListener=function(l){this.addEventListener("render",function(p){l(p.dataUrl,p.state)})},L.prototype.removeRenderEventListener=function(l){},L.prototype.addCloseEventListener=function(l){this.addEventListener("close",function(){l()})},L.prototype.removeCloseEventListener=function(l){},L.prototype.setupResizeObserver=function(){var l=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){l.resize(l.target.clientWidth,l.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return l.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},L.prototype.onPopupTargetResize=function(){var l=1*this.target.clientWidth/this.target.clientHeight,p=this.editorCanvas.clientWidth/l>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*l:this.editorCanvas.clientWidth,D=p<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/l;this.resize(p,D)},L.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},L.prototype.resize=function(l,p){this._isResizing=!0;var D=l/this.imageWidth,F=p/this.imageHeight;this.imageWidth=Math.round(l),this.imageHeight=Math.round(p),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(D,F),this._isResizing=!1},L.prototype.scaleMarkers=function(l,p){var D,F=this;this._currentMarker&&this._currentMarker instanceof Me?this._currentMarker.scale(l,p):(D=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(P){P!==F._currentMarker&&P.scale(l,p)}),D!==void 0&&this.setCurrentMarker(D)},L.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"},L.prototype.setTopLeft=function(){var l=this.editingTarget.getBoundingClientRect(),p=this.editorCanvas.getBoundingClientRect();this.left=l.left-p.left,this.top=l.top-p.top},L.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)},L.prototype.addDefs=function(){for(var l,p=[],D=0;D<arguments.length;D++)p[D]=arguments[D];this.defs=Q.createDefs(),this.addDefsToImage(),(l=this.defs).append.apply(l,p)},L.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},L.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)},L.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},L.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},L.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)},L.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},L.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)},L.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 l=document.createElement("a");l.href="https://markerjs.com/",l.target="_blank",l.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>',l.title="Powered by marker.js",l.style.display="grid",l.style.alignItems="center",l.style.justifyItems="center",l.style.padding="3px",l.style.width="20px",l.style.height="20px",this.logoUI.appendChild(l),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},L.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")},L.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"},L.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},L.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var l=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=l+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new be(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Re(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},L.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},L.prototype.removeMarker=function(l){this.markerImage.removeChild(l.container),this.markers.indexOf(l)>-1&&this.markers.splice(this.markers.indexOf(l),1),l.dispose()},L.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())},L.prototype.toolbarButtonClicked=function(l,p){if(l==="marker"&&p!==void 0)this.createNewMarker(p);else if(l==="action")switch(p){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()}},L.prototype.deleteSelectedMarker=function(){var l=this;if(this._currentMarker!==void 0){var p=!1;if(this.eventListeners.markerbeforedelete.forEach(function(F){var P=new dt(l,l._currentMarker,!0);F(P),P.defaultPrevented&&(p=!0)}),!p){var D=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(F){return F(new dt(l,D))})}}},L.prototype.clear=function(){var l=this,p=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(de){var We=new dt(l,void 0,!0);de(We),We.defaultPrevented&&(p=!0)}),!p)){this.setCurrentMarker();for(var D=function(de){var We=F.markers[de];F.setCurrentMarker(F.markers[de]),F._currentMarker.dispose(),F.markerImage.removeChild(F._currentMarker.container),F.markers.splice(F.markers.indexOf(F._currentMarker),1),F.eventListeners.markerdelete.forEach(function(at){return at(new dt(l,We))})},F=this,P=this.markers.length-1;P>=0;P--)D(P);this.addUndoStep()}},Object.defineProperty(L.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),L.prototype.showNotesEditor=function(){var l;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=(l=this._currentMarker.notes)!==null&&l!==void 0?l:"",this.overlayContainer.appendChild(this.notesArea))},L.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)},L.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},L.prototype.addUndoStep=function(){var l=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var p=this.getState(),D=this.undoRedoManager.getLastUndoStep();if(!D||D.width===p.width&&D.height===p.height){var F=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(p),F<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(P){return P(new Ct(l))})}else this.undoRedoManager.replaceLastUndoStep(p),this.eventListeners.statechange.forEach(function(P){return P(new Ct(l))})}},L.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},L.prototype.undoStep=function(){var l=this,p=this.undoRedoManager.undo();p!==void 0&&(this.restoreState(p),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(D){return D(new Ct(l))}))},L.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},L.prototype.redoStep=function(){var l=this,p=this.undoRedoManager.redo();p!==void 0&&(this.restoreState(p),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(D){return D(new Ct(l))}))},L.prototype.stepZoom=function(){var l=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=l<this.zoomSteps.length-1?this.zoomSteps[l+1]:this.zoomSteps[0]},L.prototype.panTo=function(l){this.contentDiv.scrollBy({left:this.prevPanPoint.x-l.x,top:this.prevPanPoint.y-l.y}),this.prevPanPoint=l},L.prototype.startRenderAndClose=function(){return Le(this,void 0,void 0,function(){var l,p,D=this;return Pe(this,function(F){switch(F.label){case 0:return[4,this.render()];case 1:return l=F.sent(),p=this.getState(),this.eventListeners.render.forEach(function(P){return P(new _t(D,l,p))}),this.close(!0),[2]}})})},L.prototype.getState=function(l){l===!0&&this.setCurrentMarker();var p={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(D){return p.markers.push(D.getState())}),p},L.prototype.restoreState=function(l){var p=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);l.markers.forEach(function(D){var F=p._availableMarkerTypes.find(function(de){return de.typeName===D.typeName});if(F!==void 0){var P=p.addNewMarker(F);P.restoreState(D),p.markers.push(P)}}),l.width&&l.height&&(l.width!==this.imageWidth||l.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/l.width,this.imageHeight/l.height),this.eventListeners.restorestate.forEach(function(D){return D(new Ct(p))})},L.prototype.addNewMarker=function(l){var p=Q.createGroup();return this.markerImage.appendChild(p),new l(p,this.overlayContainer,this.settings)},L.prototype.createNewMarker=function(l){var p,D=this;(p=typeof l=="string"?this._availableMarkerTypes.find(function(F){return F.typeName===l}):l)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(p),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(p.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(F){return F(new dt(D,D._currentMarker))}))},L.prototype.markerCreated=function(l){var p=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(l),this.setCurrentMarker(l),l instanceof ue&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(ue):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(D){return D(new dt(p,p._currentMarker))})},L.prototype.colorChanged=function(l){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=l,this.settings.defaultStrokeColor=l)},L.prototype.fillColorChanged=function(l){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=l)},L.prototype.markerStateChanged=function(l){var p=this;this.eventListeners.markerchange.forEach(function(D){return D(new dt(p,l))})},L.prototype.setCurrentMarker=function(l){var p=this;this._currentMarker!==l&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(D){return D(new dt(p,p._currentMarker))})),this._currentMarker=l,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(D){return D(new dt(p,p._currentMarker))}))},L.prototype.onPointerDown=function(l){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||l.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var p=this.markers.find(function(D){return D.ownsTarget(l.target)});p!==void 0?(this.setCurrentMarker(p),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(l.clientX,l.clientY),l.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:l.clientX,y:l.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(l.clientX,l.clientY))},L.prototype.onDblClick=function(l){if(this._isFocused||this.focus(),this.mode==="select"){var p=this.markers.find(function(D){return D.ownsTarget(l.target)});p!==void 0&&p!==this._currentMarker&&this.setCurrentMarker(p),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(l.clientX,l.clientY),l.target):this.setCurrentMarker()}},L.prototype.onPointerMove=function(l){this.touchPoints!==1&&l.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||l.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(l.clientX,l.clientY)):this.zoomLevel>1&&this.panTo({x:l.clientX,y:l.clientY}))},L.prototype.onPointerUp=function(l){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(l.clientX,l.clientY)),this.isDragging=!1,this.addUndoStep()},L.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},L.prototype.onKeyUp=function(l){this._currentMarker===void 0||this.notesArea!==void 0||l.key!=="Delete"&&l.key!=="Backspace"||this.deleteSelectedMarker()},L.prototype.clientToLocalCoordinates=function(l,p){var D=this.markerImage.getBoundingClientRect();return{x:(l-D.left)/this.zoomLevel,y:(p-D.top)/this.zoomLevel}},L.prototype.onWindowResize=function(){this.positionUI()},L.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var l=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=l+"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()},L.prototype.addLicenseKey=function(l){Ke.addKey(l)},L.prototype.addEventListener=function(l,p){this.eventListeners.addEventListener(l,p)},L.prototype.removeEventListener=function(l,p){this.eventListeners.removeEventListener(l,p)},L.prototype.renderState=function(l){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(l),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(L.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),L.prototype.focus=function(){var l=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(p){return p(new Ct(l))}))},L.prototype.blur=function(){var l=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(p){return p(new Ct(l))}))},L.instanceCounter=0,L}();/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Dt=function(L,l){return(Dt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,D){p.__proto__=D}||function(p,D){for(var F in D)Object.prototype.hasOwnProperty.call(D,F)&&(p[F]=D[F])})(L,l)};function zt(L,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function p(){this.constructor=L}Dt(L,l),L.prototype=l===null?Object.create(l):(p.prototype=l.prototype,new p)}function xt(L,l,p,D){return new(p||(p=Promise))(function(F,P){function de(yt){try{at(D.next(yt))}catch(Ve){P(Ve)}}function We(yt){try{at(D.throw(yt))}catch(Ve){P(Ve)}}function at(yt){var Ve;yt.done?F(yt.value):(Ve=yt.value,Ve instanceof p?Ve:new p(function(St){St(Ve)})).then(de,We)}at((D=D.apply(L,l||[])).next())})}function Bt(L,l){var p,D,F,P,de={label:0,sent:function(){if(1&F[0])throw F[1];return F[1]},trys:[],ops:[]};return P={next:We(0),throw:We(1),return:We(2)},typeof Symbol=="function"&&(P[Symbol.iterator]=function(){return this}),P;function We(at){return function(yt){return function(Ve){if(p)throw new TypeError("Generator is already executing.");for(;de;)try{if(p=1,D&&(F=2&Ve[0]?D.return:Ve[0]?D.throw||((F=D.return)&&F.call(D),0):D.next)&&!(F=F.call(D,Ve[1])).done)return F;switch(D=0,F&&(Ve=[2&Ve[0],F.value]),Ve[0]){case 0:case 1:F=Ve;break;case 4:return de.label++,{value:Ve[1],done:!1};case 5:de.label++,D=Ve[1],Ve=[0];continue;case 7:Ve=de.ops.pop(),de.trys.pop();continue;default:if(!(F=de.trys,(F=F.length>0&&F[F.length-1])||Ve[0]!==6&&Ve[0]!==2)){de=0;continue}if(Ve[0]===3&&(!F||Ve[1]>F[0]&&Ve[1]<F[3])){de.label=Ve[1];break}if(Ve[0]===6&&de.label<F[1]){de.label=F[1],F=Ve;break}if(F&&de.label<F[2]){de.label=F[2],de.ops.push(Ve);break}F[2]&&de.ops.pop(),de.trys.pop();continue}Ve=l.call(L,de)}catch(St){Ve=[6,St],D=0}finally{p=F=0}if(5&Ve[0])throw Ve[1];return{value:Ve[0]?Ve[1]:void 0,done:!0}}([at,yt])}}}var Nt=function(){function L(){}return L.addKey=function(l){L.key=l},Object.defineProperty(L,"isLicensed",{get:function(){return!!L.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(L.key)},enumerable:!1,configurable:!0}),L}(),qe=function(){function L(){}return L.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},L.setAttributes=function(l,p){for(var D=0,F=p;D<F.length;D++){var P=F[D],de=P[0],We=P[1];l.setAttribute(de,We)}},L.createRect=function(l,p,D){var F=document.createElementNS("http://www.w3.org/2000/svg","rect");return F.setAttribute("width",l.toString()),F.setAttribute("height",p.toString()),D&&L.setAttributes(F,D),F},L.createLine=function(l,p,D,F,P){var de=document.createElementNS("http://www.w3.org/2000/svg","line");return de.setAttribute("x1",l.toString()),de.setAttribute("y1",p.toString()),de.setAttribute("x2",D.toString()),de.setAttribute("y2",F.toString()),P&&L.setAttributes(de,P),de},L.createPolygon=function(l,p){var D=document.createElementNS("http://www.w3.org/2000/svg","polygon");return D.setAttribute("points",l),p&&L.setAttributes(D,p),D},L.createCircle=function(l,p){var D=document.createElementNS("http://www.w3.org/2000/svg","circle");return D.setAttribute("cx",(l/2).toString()),D.setAttribute("cy",(l/2).toString()),D.setAttribute("r",l.toString()),p&&L.setAttributes(D,p),D},L.createEllipse=function(l,p,D){var F=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return F.setAttribute("cx",(l/2).toString()),F.setAttribute("cy",(p/2).toString()),F.setAttribute("rx",(l/2).toString()),F.setAttribute("ry",(p/2).toString()),D&&L.setAttributes(F,D),F},L.createGroup=function(l){var p=document.createElementNS("http://www.w3.org/2000/svg","g");return l&&L.setAttributes(p,l),p},L.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},L.createMarker=function(l,p,D,F,P,de,We){var at=document.createElementNS("http://www.w3.org/2000/svg","marker");return L.setAttributes(at,[["id",l],["orient",p],["markerWidth",D.toString()],["markerHeight",F.toString()],["refX",P.toString()],["refY",de.toString()]]),at.appendChild(We),at},L.createText=function(l){var p=document.createElementNS("http://www.w3.org/2000/svg","text");return p.setAttribute("x","0"),p.setAttribute("y","0"),l&&L.setAttributes(p,l),p},L.createTSpan=function(l,p){var D=document.createElementNS("http://www.w3.org/2000/svg","tspan");return D.textContent=l,p&&L.setAttributes(D,p),D},L.createImage=function(l){var p=document.createElementNS("http://www.w3.org/2000/svg","image");return l&&L.setAttributes(p,l),p},L.createPoint=function(l,p){var D=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return D.x=l,D.y=p,D},L.createPath=function(l,p){var D=document.createElementNS("http://www.w3.org/2000/svg","path");return D.setAttribute("d",l),p&&L.setAttributes(D,p),D},L.createElement=function(l,p){var D=document.createElementNS("http://www.w3.org/2000/svg",l);return p&&L.setAttributes(D,p),D},L.getHollowRectanglePath=function(l,p,D,F,P,de,We,at){return"M"+l+","+p+"V"+(p+F)+"H"+(l+D)+"V"+p+"H"+P+"V"+de+"H"+(P+We)+"V"+(de+at)+"H"+P+"V"+p+"Z"},L}(),pt=function(){function L(l){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+l+"_"}return Object.defineProperty(L.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(L.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(L.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),L.prototype.addClass=function(l){return this.styleSheet===void 0&&this.addStyleSheet(),l.name=""+this.classNamePrefix+l.localName,this.classes.push(l),this.styleSheet.sheet.insertRule("."+l.name+" {"+l.style+"}",this.styleSheet.sheet.cssRules.length),l},L.prototype.addRule=function(l){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(l),this.styleSheet.sheet.insertRule(l.selector+" {"+l.style+"}",this.styleSheet.sheet.cssRules.length)},L.prototype.addStyleSheet=function(){var l;this.styleSheet=document.createElement("style"),((l=this.styleSheetRoot)!==null&&l!==void 0?l:document.head).appendChild(this.styleSheet),this.addRule(new lt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new lt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new lt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new vt("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new vt("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},L.prototype.removeStyleSheet=function(){var l;this.styleSheet&&(((l=this.styleSheetRoot)!==null&&l!==void 0?l:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},L}(),lt=function(L,l){this.selector=L,this.style=l},vt=function(L,l){this.localName=L,this.style=l},Lt=function(){function L(){this.blocks=[],this.display=""}return L.prototype.addButtonBlock=function(l){l.className=this.blockClassName,l.buttonClassName=this.buttonClassName,l.buttonColorsClassName=this.buttonColorsClassName,l.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(l)},L.prototype.addElementBlock=function(l){l.className===void 0&&(l.className=this.blockClassName),this.blocks.push(l)},L.prototype.getUI=function(){var l=document.createElement("div");return l.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,l.style.display=this.display,this.blocks.forEach(function(p){return l.appendChild(p.getUI())}),l},L}(),fr=function(){function L(){}return L.prototype.getUI=function(){var l=document.createElement("div");if(l.className=this.className,this.minWidth!==void 0&&(l.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":l.style.justifyContent="flex-start";break;case"center":l.style.justifyContent="center";break;case"end":l.style.justifyContent="flex-end"}return l.style.whiteSpace="nowrap",l},L}(),ar=function(L){function l(){var p=L!==null&&L.apply(this,arguments)||this;return p.buttons=[],p}return zt(l,L),l.prototype.addButton=function(p){p.className=this.buttonClassName,p.colorsClassName=this.buttonColorsClassName,p.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(p)},l.prototype.getUI=function(){var p=L.prototype.getUI.call(this);return this.buttons.forEach(function(D){return p.appendChild(D.getUI())}),p},l}(fr),dr=function(){function L(l,p){this._isActive=!1,this._isHidden=!1,this._icon=l,this.title=p,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(L.prototype,"icon",{get:function(){return this._icon},set:function(l){this._icon=l,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isActive",{get:function(){return this._isActive},set:function(l){this._isActive=l,this.adjustClassName()},enumerable:!1,configurable:!0}),L.prototype.getUI=function(){var l=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return l.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},L.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,"")))},L.prototype.hide=function(){this._isHidden=!0},L}(),yr=function(L){function l(){var p=L!==null&&L.apply(this,arguments)||this;return p.elements=[],p}return zt(l,L),l.prototype.addElement=function(p){this.elements.push(p)},l.prototype.getUI=function(){var p=L.prototype.getUI.call(this);return this.elements.forEach(function(D){return p.appendChild(D)}),p},l}(fr),Mr=function(){function L(l,p){this.horizontal=l,this.vertical=p}return Object.defineProperty(L.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),L.prototype.getVerticalLength=function(l){return l/this.ratio},L.prototype.getHorizontalLength=function(l){return l*this.ratio},L}(),Nr=function(){function L(){}return L.getIcon=function(l,p){if(l>0&&p>0){var D=new Mr(l,p),F=D.ratio>=1?20:D.getHorizontalLength(20),P=D.ratio<1?20:D.getVerticalLength(20),de=document.createElementNS("http://www.w3.org/2000/svg","svg");de.setAttribute("xmlns","http://www.w3.org/2000/svg"),de.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(de);var We=qe.createDefs();de.appendChild(We);var at=qe.createElement("clipPath",[["id","text-bg-clip"]]);We.appendChild(at);var yt=qe.createPath(qe.getHollowRectanglePath((24-F)/2,(24-P)/2,F,P,(24-F)/2+2,(24-P)/2+2,F-4,P-4));de.appendChild(yt);var Ve=qe.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ve.appendChild(qe.createTSpan(l+":"+p)),de.appendChild(Ve);var St=Ve.getBBox();qe.setAttributes(Ve,[["x",((24-St.width)/2).toString()],["y",((24-St.height)/2-St.y).toString()]]);var At=qe.createPath(qe.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(St.width))/2,(24-Math.ceil(St.height))/2,Math.ceil(St.width),Math.ceil(St.height)));return at.appendChild(At),qe.setAttributes(yt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(de),de.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>'},L}(),Hr=function(L){function l(p,D,F){var P=L.call(this,p,D)||this;return P.isDropdownOpen=!1,P.onClick=P.dropdownButtonClicked,P.dropdownButtons=F,P}return zt(l,L),l.prototype.setupDropdown=function(){var p=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(D){D.className=p.className,D.colorsClassName=p.colorsClassName,p.dropdownBlock.appendChild(D.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},l.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},l.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},l.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},l.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},l.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},l}(dr),Or=function(){function L(l,p){this.GRIP_SIZE=10,this.color=l,this.fillColor=p,this.visual=qe.createGroup(),this.visual.appendChild(qe.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(qe.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return L.prototype.ownsTarget=function(l){return l===this.visual||l===this.visual.childNodes[0]||l===this.visual.childNodes[1]},L.prototype.setCenter=function(l,p){this.visual.childNodes.forEach(function(D){return qe.setAttributes(D,[["cx",l.toString()],["cy",p.toString()]])})},L}(),_r=function(){function L(l,p,D,F){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=l,this.canvasHeight=p,this.margin=D,this.container=F,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(L.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(l){this._aspectRatio=l,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(l){this._isGridVisible=l,this.gridContainer&&qe.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(l){this._zoomFactor=l,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),L.prototype.open=function(){var l=this;this.cropShadeElement=qe.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=qe.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var p=0;p<this.numberOfGridLines;p++)this.horizontalGridLines.push(qe.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(qe.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(D){return l.gridContainer.appendChild(D)}),this.verticalGridLines.forEach(function(D){return l.gridContainer.appendChild(D)}),this.cropRectElement=qe.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Or(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Or(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Or(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Or(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},L.prototype.setCropRectangle=function(l){this.cropRect=l;var p=Object.assign({},this.cropRect);this.zoomFactor!==1&&(p.width=this.cropRect.width*this.zoomFactor,p.height=this.cropRect.height*this.zoomFactor,p.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-p.width/2,p.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-p.height/2),qe.setAttributes(this.cropRectElement,[["x",p.x.toString()],["y",p.y.toString()],["width",p.width.toString()],["height",p.height.toString()]]);var D=p.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(P,de){var We=p.y+D*(de+1);qe.setAttributes(P,[["x1",""+p.x],["y1",""+We],["x2",""+(p.x+p.width)],["y2",""+We]])});var F=p.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(P,de){var We=p.x+F*(de+1);qe.setAttributes(P,[["x1",""+We],["y1",""+p.y],["x2",""+We],["y2",""+(p.y+p.height)]])}),qe.setAttributes(this.cropShadeElement,[["d",qe.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,p.x,p.y,p.width,p.height)]]),this.topLeftGrip.setCenter(p.x,p.y),this.topRightGrip.setCenter(p.x+p.width,p.y),this.bottomLeftGrip.setCenter(p.x,p.y+p.height),this.bottomRightGrip.setCenter(p.x+p.width,p.y+p.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},L.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)},L.prototype.clientToLocalCoordinates=function(l,p){var D=this.container.getBoundingClientRect();return{x:l-D.left+this.margin,y:p-D.top+this.margin}},L.prototype.onPointerDown=function(l){this.container.setPointerCapture(l.pointerId),this.previousPoint=this.clientToLocalCoordinates(l.clientX,l.clientY),this.cropRectElement===l.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(l.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(l.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(l.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(l.target)&&(this.activeGrip=this.bottomRightGrip)},L.prototype.onPointerMove=function(l){if(this.isMoving)this.move(this.clientToLocalCoordinates(l.clientX,l.clientY));else if(this.activeGrip){var p=this.clientToLocalCoordinates(l.clientX,l.clientY);this.resize(p)}l.preventDefault()},L.prototype.onPointerUp=function(l){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(l.pointerId)},L.prototype.move=function(l){var p=l.x-this.previousPoint.x,D=l.y-this.previousPoint.y;this.zoomFactor!==1&&(p=-p/this.zoomFactor,D=-D/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+p),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+D),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=l},L.prototype.resize=function(l){var p=Object.assign({},this.cropRect),D=l.x-this.previousPoint.x,F=l.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:p.x+D<this.margin&&(D=this.margin-p.x),p.x+=D,p.width=this.cropRect.x+this.cropRect.width-p.x;break;case this.bottomRightGrip:case this.topRightGrip:p.width+D>this.canvasWidth*this.zoomFactor&&(D=this.canvasWidth*this.zoomFactor-p.width),p.width+=D}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(p.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(D),p.height=this.aspectRatio.getVerticalLength(p.width)):(p.y+=F,p.height=this.cropRect.y+this.cropRect.height-p.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?p.height=this.aspectRatio.getVerticalLength(p.width):p.height+=F}p.width<10&&(p.x=this.cropRect.x,p.width=10),p.height<10&&(p.y=this.cropRect.y,p.height=10),this.previousPoint=l,p.x>=this.margin&&p.y>=this.margin&&p.x-this.margin+p.width<=this.canvasWidth&&p.y-this.margin+p.height<=this.canvasHeight&&(this.cropRect=p,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},L.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var l=this.cropRect.x+this.cropRect.width/2,p=this.cropRect.y+this.cropRect.height/2,D=this.aspectRatio.getHorizontalLength(this.cropRect.height),F=this.aspectRatio.getVerticalLength(this.cropRect.width);D/this.canvasWidth<F/this.canvasHeight?this.cropRect.width=D:this.cropRect.height=F,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=l-this.cropRect.width/2,this.cropRect.y=p-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)}},L.prototype.getRescaledRect=function(l,p,D,F,P,de){var We=D/l,at=F/p;return{x:(P.x-de)*We+de,y:(P.y-de)*at+de,width:P.width*We,height:P.height*at}},L.prototype.scaleCanvas=function(l,p){var D=this.getRescaledRect(this.canvasWidth,this.canvasHeight,l,p,this.cropRect,this.margin);this.canvasWidth=l,this.canvasHeight=p,this.onCropChange&&this.onCropChange(D),this.setCropRectangle(D)},L}(),Xr=function(){function L(l){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=l,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(L.prototype,"angle",{get:function(){return this._angle},set:function(l){this._angle=l,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),L.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},L.prototype.onPointerDown=function(l){this.controlContainer.setPointerCapture(l.pointerId),this.isDragging=!0,this.previousPoint={x:l.clientX,y:l.clientY}},L.prototype.onPointerMove=function(l){this.isDragging&&(this.onAngleChange&&this.onAngleChange((l.clientX-this.previousPoint.x)/5),this.previousPoint.x=l.clientX)},L.prototype.onPointerUp=function(l){this.isDragging&&this.onAngleChange&&this.onAngleChange((l.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(l.pointerId)},L.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var l=this.angleLabelText.getBBox();qe.setAttributes(this.angleLabelElement,[["x",((this.width-l.width)/2).toString()],["y",(this.height/2).toString()]])}},L.prototype.positionScaleShape=function(){if(this.scaleShape){var l=this.scaleShape.transform.baseVal.getItem(0);l.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(l,0)}},L.prototype.getVisual=function(){var l=document.createElementNS("http://www.w3.org/2000/svg","svg");l.setAttribute("xmlns","http://www.w3.org/2000/svg"),l.setAttribute("width",this.width+"px"),l.setAttribute("height",this.height+"px"),l.setAttribute("viewBox","0 0 "+this.width+" "+this.height),l.style.flexShrink="0",document.body.appendChild(l);for(var p="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,D=1;D<=this.width/5+10;D++){var F=D%5==0?this.height/3:this.height/6;p+="h4v"+-F+"h1v"+F}p+="v1H0Z",this.scaleShape=qe.createPath(p);var P=qe.createTransform();this.scaleShape.transform.baseVal.appendItem(P),l.appendChild(this.scaleShape),this.angleLabelElement=qe.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=qe.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var de=qe.createTSpan("");return de.innerHTML="&deg;",this.angleLabelElement.appendChild(de),l.appendChild(this.angleLabelElement),document.body.removeChild(l),l},L}(),Ur=function(){function L(){this.naturalSize=!1,this.imageType="image/png"}return L.prototype.rasterize=function(l,p,D,F,P,de,We){var at=this;return new Promise(function(yt){var Ve=document.createElement("canvas");Ve.width=l.width.baseVal.value-2*F,Ve.height=l.height.baseVal.value-2*F;var St=1,At=1;at.naturalSize===!0?(St=p.naturalWidth/(l.width.baseVal.value-2*F)/de,At=p.naturalHeight/(l.height.baseVal.value-2*F)/We,Ve.width=p.naturalWidth/de,Ve.height=p.naturalHeight/We):at.width!==void 0&&at.height!==void 0&&(St=at.width/D.width,At=at.height/D.height,Ve.width*=St,Ve.height*=At);var nr=Ve.getContext("2d");nr.translate(Ve.width/2,Ve.height/2),nr.rotate(P*Math.PI/180),nr.scale(de,We),nr.translate(-Ve.width/2,-Ve.height/2),nr.drawImage(p,0,0,Ve.width,Ve.height);var ke=document.createElement("canvas");ke.width=D.width*St,ke.height=D.height*At,ke.getContext("2d").putImageData(nr.getImageData((D.x-F)*St,(D.y-F)*At,D.width*St,D.height*At),0,0),yt(ke.toDataURL(at.imageType,at.imageQuality))})},L}(),gt=function(){function L(l){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=L.instanceCounter++,this.styles=new pt(this.instanceNo),this.target=l,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(L.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(l){this._zoomToCropEnabled=l,l?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(l){this._isGridVisible=l,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"gridLines",{get:function(){return this._gridLines},set:function(l){this._gridLines=l,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(l){this._rotationAngle=l,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"aspectRatio",{get:function(){var l;return(l=this._aspectRatio)!==null&&l!==void 0?l:this.aspectRatios[0]},set:function(l){this._aspectRatio=l},enumerable:!1,configurable:!0}),L.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},L.prototype.show=function(){this.showUI(),this.open()},L.prototype.close=function(l){l===void 0&&(l=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),l||this.closeEventListeners.forEach(function(p){return p()}),this._isOpen=!1)},L.prototype.addRenderEventListener=function(l){this.renderEventListeners.push(l)},L.prototype.removeRenderEventListener=function(l){this.renderEventListeners.indexOf(l)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(l),1)},L.prototype.addCloseEventListener=function(l){this.closeEventListeners.push(l)},L.prototype.removeCloseEventListener=function(l){this.closeEventListeners.indexOf(l)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(l),1)},L.prototype.setupResizeObserver=function(){var l=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){l.resize(l.target.clientWidth,l.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))},L.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var l=1*this.target.clientWidth/this.target.clientHeight,p=this.contentDiv.clientWidth/l>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*l:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,D=p+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/l;this.resize(p,D)}},L.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},L.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",qe.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},L.prototype.resize=function(l,p){this.imageWidth=Math.round(l),this.imageHeight=Math.round(p),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()},L.prototype.setEditingTarget=function(){var l=document.createElement("canvas");l.width=this.target.naturalWidth,l.height=this.target.naturalHeight,l.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var p=l.toDataURL();qe.setAttributes(this.editingTarget,[["href",p]]),this.setEditingTargetSize()},L.prototype.setTopLeft=function(){var l=this.target.getBoundingClientRect(),p=this.editorCanvas.getBoundingClientRect();this.left=l.left-p.left-this.CANVAS_MARGIN,this.top=l.top-p.top-this.CANVAS_MARGIN},L.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=qe.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=qe.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=qe.createGroup(),this.editingTargetRotationScaleContainer=qe.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var l=qe.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(l);var p=qe.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(p),this.editingTargetContainer=qe.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)},L.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},L.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=qe.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new _r(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},L.prototype.zoomToCrop=function(){if(this.cropRect){var l=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,p=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=l+"px "+p+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-l+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-p+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},L.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)},L.prototype.cropRectChanged=function(l){this.cropRect=l,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},L.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},L.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"},L.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},L.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var l=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,p=this.target.offsetTop>l+this.CANVAS_MARGIN?this.target.offsetTop-(l+this.CANVAS_MARGIN):0;this.coverDiv.style.top=p+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},L.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},L.prototype.addTopToolbar=function(){var l=this;this.topToolbar=new Lt,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 p=new ar;p.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(p);var D=[];this.aspectRatios.forEach(function(At){var nr=new dr(Nr.getIcon(At.horizontal,At.vertical),At.horizontal===0&&At.vertical===0?"FREE":At.horizontal+":"+At.vertical);nr.onClick=function(){return l.ratioButtonClicked(At)},D.push(nr)}),this.aspectRatioButton=new Hr(Nr.getIcon(0,0),"Aspect ratio",D),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,p.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var F=new dr('<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");F.isActive=this.isGridVisible,F.onClick=function(){l.isGridVisible=!l.isGridVisible,F.isActive=l.isGridVisible},p.addButton(F);var P=new dr('<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(P.isActive=this.zoomToCropEnabled,P.onClick=function(){l.zoomToCropEnabled=!l.zoomToCropEnabled,P.isActive=l.zoomToCropEnabled},p.addButton(P),!Nt.isLicensed){var de=new yr;this.topToolbar.addElementBlock(de);var We=document.createElement("div");We.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var at=document.createElement("a");at.style.color="currentColor",at.href="https://markerjs.com/products/cropro",at.target="_blank",at.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>',We.appendChild(at),de.addElement(We)}var yt=new ar;yt.minWidth=3*this.toolbarHeight+"px",yt.contentAlign="end",this.topToolbar.addButtonBlock(yt);var Ve=new dr('<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");Ve.onClick=this.startRenderAndClose,yt.addButton(Ve),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ve.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var St=new dr('<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");St.onClick=this.close,yt.addButton(St),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(St.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},L.prototype.addBottomToolbar=function(){var l=this;this.bottomToolbar=new Lt,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 p=new ar;p.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(p);var D=new dr('<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");D.onClick=this.rotateLeftButtonClicked,p.addButton(D);var F=new dr('<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");F.onClick=this.rotateRightButtonClicked,p.addButton(F);var P=new yr;P.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(P),this.straightener=new Xr("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(yt){l.rotateBy(yt),l.straightener.angle=l.rotationAngle},P.addElement(this.straightener.getUI());var de=new ar;de.minWidth=2*this.toolbarHeight+"px",de.contentAlign="end",this.bottomToolbar.addButtonBlock(de);var We=new dr('<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");We.onClick=this.flipHorizontallyButtonClicked,de.addButton(We);var at=new dr('<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");at.onClick=this.flipVerticallyButtonClicked,de.addButton(at)},L.prototype.ratioButtonClicked=function(l){this.aspectRatio=l,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},L.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Nr.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},L.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Mr(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},L.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},L.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},L.prototype.restoreState=function(l){if(l){var p=this.cropLayer.getRescaledRect(l.width,l.height,this.imageWidth,this.imageHeight,l.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(p),this.cropRectChanged(p),this.flippedHorizontally=l.flippedHorizontally,this.flippedVertically=l.flippedVertically,this.applyFlip(),this.rotationAngle=l.rotationAngle,this.applyRotation()}},L.prototype.clientToLocalCoordinates=function(l,p){var D=this.cropImage.getBoundingClientRect();return{x:l-D.left,y:p-D.top}},L.prototype.onWindowResize=function(){this.positionUI()},L.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var l=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=l+"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()},L.prototype.rotateLeftButtonClicked=function(){var l=this.rotationAngle-90;this.rotationAngle%90!=0&&(l+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(l)},L.prototype.rotateRightButtonClicked=function(){var l=this.rotationAngle+90;this.rotationAngle%90!=0&&(l-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(l)},L.prototype.rotateTo=function(l){l=(l=l>180?l-360:l)<=-180?l+360:l,this.rotationAngle=l,this.applyRotation()},L.prototype.rotateBy=function(l){this.rotateTo((this.rotationAngle+l)%360)},L.prototype.applyRotation=function(){var l=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var p=this.editingTargetRotationContainer.transform.baseVal.getItem(0);p.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(p,0);var D=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/D.width,this.imageHeight/D.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=l},L.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},L.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},L.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},L.prototype.startRenderAndClose=function(){return xt(this,void 0,void 0,function(){var l,p;return Bt(this,function(D){switch(D.label){case 0:return[4,this.render()];case 1:return l=D.sent(),p=this.getState(),this.renderEventListeners.forEach(function(F){return F(l,p)}),this.close(!0),[2]}})})},L.prototype.render=function(){return xt(this,void 0,void 0,function(){var l;return Bt(this,function(p){switch(p.label){case 0:return(l=new Ur).naturalSize=this.renderAtNaturalSize,l.imageType=this.renderImageType,l.imageQuality=this.renderImageQuality,l.width=this.renderWidth,l.height=this.renderHeight,this.unzoomFromCrop(),qe.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,l.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 p.sent(),[4,l.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,p.sent()]}})})},L.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new vt("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 vt("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new vt("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var l=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new vt("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*l)+`px;
height: `+(this.toolbarHeight-2*l)+`px;
padding: `+l+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new vt("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new vt("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new lt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new lt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new vt("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 vt("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new vt("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 vt("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*l)+`px;
padding: `+l+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new vt("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},L.instanceCounter=0,L}(),Gt=U("8hTe"),Pt=U.n(Gt),Vt=/<pre[^>]*>/g;function Yt(L){var l=document.createElement("div");return l.innerHTML=L,l.childNodes.length===0?"":l.childNodes[0].nodeValue}var rr=fe.a=function(L){var l=L.value,p=l===void 0?"":l,D=L.edit,F=D===void 0?!1:D,P=L.className,de=L.showTextOnly,We=L.showLines,at=L.replaces,yt=L.zoomImg,Ve=L.hasMask,St=L.style,At=St===void 0?{}:St,nr=L.stylesPrev,ke=nr===void 0?{}:nr,Ar=String(p),mr=Object(w.useRef)(),jr=Object(w.useRef)(),Cn=Object(w.useState)(""),nn=Object(j.a)(Cn,2),zr=nn[0],Zr=nn[1],$r=Object(w.useState)("office"),an=Object(j.a)($r,2),Tn=an[0],hn=an[1],bn=function(){var Ft=new gt(jr.current);Ft.displayMode="popup",Ft.addRenderEventListener(function(){var vr=Object(S.a)(O.a.mark(function Xt(Tr){var or;return O.a.wrap(function(Sr){for(;;)switch(Sr.prev=Sr.next){case 0:return mr.current.style.display="none",Sr.next=3,Object(je.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Tr}});case 3:or=Sr.sent,or!=null&&or.id&&at(jr.current.getAttribute("src").replace(se.a.API_SERVER,""),"/api/attachments/".concat(or==null?void 0:or.id,"?type=").concat(or.content_type));case 5:case"end":return Sr.stop()}},Xt)}));return function(Xt){return vr.apply(this,arguments)}}()),Ft.show()},Mn=function(){var Ft=new It(jr.current);Ft.settings.displayMode="popup",Ft.addEventListener("render",function(){var vr=Object(S.a)(O.a.mark(function Xt(Tr){var or;return O.a.wrap(function(Sr){for(;;)switch(Sr.prev=Sr.next){case 0:if(mr.current.style.display="none",!jr.current){Sr.next=6;break}return Sr.next=4,Object(je.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Tr.dataUrl}});case 4:or=Sr.sent,or!=null&&or.id&&at(jr.current.getAttribute("src").replace(se.a.API_SERVER,""),"/api/attachments/".concat(or==null?void 0:or.id,"?type=").concat(or.content_type));case 6:case"end":return Sr.stop()}},Xt)}));return function(Xt){return vr.apply(this,arguments)}}()),Ft.show(),window.markerArea=Ft},on=Object(w.useMemo)(function(){try{var sr=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ft=/\"\/api\/attachments\/|\"\/attachments\/download\//g,vr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Ar=Ar.replace(sr,"("+se.a.API_SERVER+"/api/attachments/").replace(Ft,'"'+se.a.API_SERVER+"/api/attachments/").replace(vr,'"'+se.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,`
`),Ar=Ar.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
`)}catch(pn){}var Xt=W(Ar),Tr=T();if(Ar.match(/\[TOC\]/)&&(Xt=Xt.replace("<p>[TOC]</p>",E()),h()),Xt=Xt.replace(/(__special_katext_id_\d+__)/g,function(pn,Sr){var En=Tr[Sr],sn=En.type,mn=En.expression;return Object(xe.renderToString)(Yt(mn)||"",{displayMode:sn==="block",throwOnError:!1,output:"html"})}),Xt=Xt.replace(/▁/g,"\u2581\u2581\u2581"),x(),de){var or=document.createElement("div");return or.innerHTML=Xt,or.innerText}return setTimeout(function(){return Sn()},500),Xt},[Ar]),Rr=Object(w.useRef)();d.WebkitLineClamp=We,We&&(At=Object(b.a)(Object(b.a)({},At),d));function qr(sr){var Ft=sr.target;if(Ft.tagName.toUpperCase()==="IMG"){if(yt){var vr=Ft.getAttribute("src");Zr(vr),hn("image")}}else if(Ft.tagName.toUpperCase()==="A"){var Xt=Ft.getAttribute("href");if(Xt.indexOf("office")>-1)sr.preventDefault(),Zr(Xt),hn("office");else if(Xt.indexOf("application/pdf")>-1)sr.preventDefault(),Zr(Xt),hn("pdf");else if(Xt.indexOf("type=text")>-1)sr.preventDefault(),Zr(Xt),hn("html");else if(Xt.startsWith("#")){sr.preventDefault();var Tr=document.getElementById(Xt.replace("#",""));Tr&&Tr.scrollIntoView(!0)}}}var Sn=function(){var Ft,vr=(Ft=Rr.current)===null||Ft===void 0?void 0:Ft.querySelectorAll("video");vr==null||vr.forEach(function(Xt){if(Xt.oncontextmenu=function(){return!1},Xt.src.indexOf(".m3u8")>-1&&!Xt.canPlayType("application/vnd.apple.mpegurl")){if(V.a.isSupported()){var Tr=new V.a;Tr.loadSource(Xt.src),Tr.attachMedia(Xt)}}})};Object(w.useEffect)(function(){if(Rr.current&&on&&(on.match(Vt)&&window.PR.prettyPrint()),Rr.current)return Rr.current.addEventListener("click",qr),function(){Rr.current.removeEventListener("click",qr),x(),h()}},[on,Rr.current,qr]);var fn=function(Ft){if(!F)return;Ft.target.nodeName==="IMG"?(mr.current.style.display="flex",mr.current.style.width=Ft.target.clientWidth+"px",mr.current.style.height=Ft.target.clientHeight+"px",mr.current.style.top=Ft.target.offsetTop+"px",mr.current.style.left=Ft.target.offsetLeft+"px",jr.current.src=Ft.target.getAttribute("src")):mr.current.style.display="none"};return c.a.createElement("div",{style:{position:"relative"}},c.a.createElement("div",{ref:Rr,style:Object(b.a)({},At),className:"".concat(P||""," markdown-body ").concat(Pt.a.mdBody),onMouseOver:fn,dangerouslySetInnerHTML:{__html:on}}),c.a.createElement("div",{ref:mr,className:Pt.a.button},c.a.createElement(N.a,null,c.a.createElement(k.a,{onClick:function(){return bn()}},"\u88C1\u526A"),c.a.createElement(k.a,{onClick:function(){return Mn()}},"\u7F16\u8F91"))),c.a.createElement("img",{ref:jr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),c.a.createElement(Ee.a,{close:!0,data:zr,hasMask:Ve,type:zr!=null&&zr.length?Tn:"",style:Object(b.a)({},ke),onClose:function(){return Zr("")}}))}},BJfS:function(ot,fe){var U=function(Z){return Z.replace(/[A-Z]/g,function(N){return"-"+N.toLowerCase()}).toLowerCase()};ot.exports=U},BU3w:function(ot,fe,U){"use strict";U.d(fe,"a",function(){return S});var Z=U("MNnm"),N="rc-util-key";function _(j){if(j.attachTo)return j.attachTo;var M=document.querySelector("head");return M||document.body}function k(j){var M,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(Z.a)())return null;var w=document.createElement("style");if((M=O.csp)===null||M===void 0?void 0:M.nonce){var c;w.nonce=(c=O.csp)===null||c===void 0?void 0:c.nonce}w.innerHTML=j;var y=_(O),C=y.firstChild;return O.prepend&&y.prepend?y.prepend(w):O.prepend&&C?y.insertBefore(w,C):y.appendChild(w),w}var b=new Map;function S(j,M){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},w=_(O);if(!b.has(w)){var c=k("",O),y=c.parentNode;b.set(w,y),y.removeChild(c)}var C=Array.from(b.get(w).children).find(function(e){return e.tagName==="STYLE"&&e[N]===M});if(C){var m,f;if(((m=O.csp)===null||m===void 0?void 0:m.nonce)&&C.nonce!==((f=O.csp)===null||f===void 0?void 0:f.nonce)){var v;C.nonce=(v=O.csp)===null||v===void 0?void 0:v.nonce}return C.innerHTML!==j&&(C.innerHTML=j),C}var a=k(j,O);return a[N]=M,a}},"C/vA":function(ot,fe,U){"use strict";U.d(fe,"a",function(){return Z});function Z(N){var _=this,k=!1,b;return function(){return k||(k=!0,b=N.apply(_,arguments)),b}}},"Cg/j":function(ot,fe,U){"use strict";U.d(fe,"b",function(){return Z}),U.d(fe,"a",function(){return N}),U.d(fe,"c",function(){return k}),U.d(fe,"d",function(){return b});var Z;(function(S){S.serviceIds=new Map,S.DI_TARGET="$di$target",S.DI_DEPENDENCIES="$di$dependencies";function j(M){return M[S.DI_DEPENDENCIES]||[]}S.getServiceDependencies=j})(Z||(Z={}));var N=k("instantiationService");function _(S,j,M,O){j[Z.DI_TARGET]===j?j[Z.DI_DEPENDENCIES].push({id:S,index:M,optional:O}):(j[Z.DI_DEPENDENCIES]=[{id:S,index:M,optional:O}],j[Z.DI_TARGET]=j)}function k(S){if(Z.serviceIds.has(S))return Z.serviceIds.get(S);var j=function(M,O,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");_(j,M,w,!1)};return j.toString=function(){return S},Z.serviceIds.set(S,j),j}function b(S){return function(j,M,O){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");_(S,j,O,!0)}}},DlQD:function(ot,fe,U){(function(Z,N){ot.exports=N()})(this,function(){"use strict";function Z(ue,te){for(var re=0;re<te.length;re++){var z=te[re];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(ue,z.key,z)}}function N(ue,te,re){return te&&Z(ue.prototype,te),re&&Z(ue,re),ue}function _(ue,te){if(!ue)return;if(typeof ue=="string")return k(ue,te);var re=Object.prototype.toString.call(ue).slice(8,-1);if(re==="Object"&&ue.constructor&&(re=ue.constructor.name),re==="Map"||re==="Set")return Array.from(ue);if(re==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(re))return k(ue,te)}function k(ue,te){(te==null||te>ue.length)&&(te=ue.length);for(var re=0,z=new Array(te);re<te;re++)z[re]=ue[re];return z}function b(ue,te){var re;if(typeof Symbol=="undefined"||ue[Symbol.iterator]==null){if(Array.isArray(ue)||(re=_(ue))||te&&ue&&typeof ue.length=="number"){re&&(ue=re);var z=0;return function(){return z>=ue.length?{done:!0}:{done:!1,value:ue[z++]}}}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 re=ue[Symbol.iterator](),re.next.bind(re)}function S(ue,te){return te={exports:{}},ue(te,te.exports),te.exports}var j=S(function(ue){function te(){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 re(z){ue.exports.defaults=z}ue.exports={defaults:te(),getDefaults:te,changeDefaults:re}}),M=j.defaults,O=j.getDefaults,w=j.changeDefaults,c=/[&<>"']/,y=/[&<>"']/g,C=/[<>"']|&(?!#?\w+;)/,m=/[<>"']|&(?!#?\w+;)/g,f={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},v=function(te){return f[te]};function a(ue,te){if(te){if(c.test(ue))return ue.replace(y,v)}else if(C.test(ue))return ue.replace(m,v);return ue}var e=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function n(ue){return ue.replace(e,function(te,re){return re=re.toLowerCase(),re==="colon"?":":re.charAt(0)==="#"?re.charAt(1)==="x"?String.fromCharCode(parseInt(re.substring(2),16)):String.fromCharCode(+re.substring(1)):""})}var i=/(^|[^\[])\^/g;function h(ue,te){ue=ue.source||ue,te=te||"";var re={replace:function(G,J){return J=J.source||J,J=J.replace(i,"$1"),ue=ue.replace(G,J),re},getRegex:function(){return new RegExp(ue,te)}};return re}var d=/[^\w:]/g,u=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function E(ue,te,re){if(ue){var z;try{z=decodeURIComponent(n(re)).replace(d,"").toLowerCase()}catch(G){return null}if(z.indexOf("javascript:")===0||z.indexOf("vbscript:")===0||z.indexOf("data:")===0)return null}te&&!u.test(re)&&(re=t(te,re));try{re=encodeURI(re).replace(/%25/g,"%")}catch(G){return null}return re}var g={},s=/^[^:]+:\/*[^/]*$/,o=/^([^:]+:)[\s\S]*$/,r=/^([^:]+:\/*[^/]*)[\s\S]*$/;function t(ue,te){g[" "+ue]||(s.test(ue)?g[" "+ue]=ue+"/":g[" "+ue]=R(ue,"/",!0)),ue=g[" "+ue];var re=ue.indexOf(":")===-1;return te.substring(0,2)==="//"?re?te:ue.replace(o,"$1")+te:te.charAt(0)==="/"?re?te:ue.replace(r,"$1")+te:ue+te}var T={exec:function(){}};function x(ue){for(var te=1,re,z;te<arguments.length;te++){re=arguments[te];for(z in re)Object.prototype.hasOwnProperty.call(re,z)&&(ue[z]=re[z])}return ue}function A(ue,te){var re=ue.replace(/\|/g,function(J,ne,ve){for(var we=!1,ze=ne;--ze>=0&&ve[ze]==="\\";)we=!we;return we?"|":" |"}),z=re.split(/ \|/),G=0;if(z.length>te)z.splice(te);else for(;z.length<te;)z.push("");for(;G<z.length;G++)z[G]=z[G].trim().replace(/\\\|/g,"|");return z}function R(ue,te,re){var z=ue.length;if(z===0)return"";for(var G=0;G<z;){var J=ue.charAt(z-G-1);if(J===te&&!re)G++;else if(J!==te&&re)G++;else break}return ue.substr(0,z-G)}function I(ue,te){if(ue.indexOf(te[1])===-1)return-1;for(var re=ue.length,z=0,G=0;G<re;G++)if(ue[G]==="\\")G++;else if(ue[G]===te[0])z++;else if(ue[G]===te[1]&&(z--,z<0))return G;return-1}function B(ue){ue&&ue.sanitize&&!ue.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 W={escape:a,unescape:n,edit:h,cleanUrl:E,resolveUrl:t,noopTest:T,merge:x,splitCells:A,rtrim:R,findClosingBracket:I,checkSanitizeDeprecation:B},$=j.defaults,X=W.rtrim,V=W.splitCells,se=W.escape,xe=W.findClosingBracket;function Ee(ue,te,re){var z=te.href,G=te.title?se(te.title):null,J=ue[1].replace(/\\([\[\]])/g,"$1");return ue[0].charAt(0)!=="!"?{type:"link",raw:re,href:z,title:G,text:J}:{type:"image",raw:re,href:z,title:G,text:se(J)}}function je(ue,te){var re=ue.match(/^(\s+)(?:```)/);if(re===null)return te;var z=re[1];return te.split(`
`).map(function(G){var J=G.match(/^\s+/);if(J===null)return G;var ne=J[0];return ne.length>=z.length?G.slice(z.length):G}).join(`
`)}var Ae=function(){function ue(re){this.options=re||$}var te=ue.prototype;return te.space=function(z){var G=this.rules.block.newline.exec(z);if(G)return G[0].length>1?{type:"space",raw:G[0]}:{raw:`
`}},te.code=function(z,G){var J=this.rules.block.code.exec(z);if(J){var ne=G[G.length-1];if(ne&&ne.type==="paragraph")return{raw:J[0],text:J[0].trimRight()};var ve=J[0].replace(/^ {4}/gm,"");return{type:"code",raw:J[0],codeBlockStyle:"indented",text:this.options.pedantic?ve:X(ve,`
`)}}},te.fences=function(z){var G=this.rules.block.fences.exec(z);if(G){var J=G[0],ne=je(J,G[3]||"");return{type:"code",raw:J,lang:G[2]?G[2].trim():G[2],text:ne}}},te.heading=function(z){var G=this.rules.block.heading.exec(z);if(G)return{type:"heading",raw:G[0],depth:G[1].length,text:G[2]}},te.nptable=function(z){var G=this.rules.block.nptable.exec(z);if(G){var J={type:"table",header:V(G[1].replace(/^ *| *\| *$/g,"")),align:G[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:G[3]?G[3].replace(/\n$/,"").split(`
`):[],raw:G[0]};if(J.header.length===J.align.length){var ne=J.align.length,ve;for(ve=0;ve<ne;ve++)/^ *-+: *$/.test(J.align[ve])?J.align[ve]="right":/^ *:-+: *$/.test(J.align[ve])?J.align[ve]="center":/^ *:-+ *$/.test(J.align[ve])?J.align[ve]="left":J.align[ve]=null;for(ne=J.cells.length,ve=0;ve<ne;ve++)J.cells[ve]=V(J.cells[ve],J.header.length);return J}}},te.hr=function(z){var G=this.rules.block.hr.exec(z);if(G)return{type:"hr",raw:G[0]}},te.blockquote=function(z){var G=this.rules.block.blockquote.exec(z);if(G){var J=G[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:G[0],text:J}}},te.list=function(z){var G=this.rules.block.list.exec(z);if(G){for(var J=G[0],ne=G[2],ve=ne.length>1,we=ne[ne.length-1]===")",ze={type:"list",raw:J,ordered:ve,start:ve?+ne.slice(0,-1):"",loose:!1,items:[]},nt=G[0].match(this.rules.block.item),ft=!1,tt,Ct,_t,dt,kt,It,Dt,zt=nt.length,xt=0;xt<zt;xt++)tt=nt[xt],J=tt,Ct=tt.length,tt=tt.replace(/^ *([*+-]|\d+[.)]) */,""),~tt.indexOf(`
`)&&(Ct-=tt.length,tt=this.options.pedantic?tt.replace(/^ {1,4}/gm,""):tt.replace(new RegExp("^ {1,"+Ct+"}","gm"),"")),xt!==zt-1&&(_t=this.rules.block.bullet.exec(nt[xt+1])[0],(ve?_t.length===1||!we&&_t[_t.length-1]===")":_t.length>1||this.options.smartLists&&_t!==ne)&&(dt=nt.slice(xt+1).join(`
`),ze.raw=ze.raw.substring(0,ze.raw.length-dt.length),xt=zt-1)),kt=ft||/\n\n(?!\s*$)/.test(tt),xt!==zt-1&&(ft=tt.charAt(tt.length-1)===`
`,kt||(kt=ft)),kt&&(ze.loose=!0),It=/^\[[ xX]\] /.test(tt),Dt=void 0,It&&(Dt=tt[1]!==" ",tt=tt.replace(/^\[[ xX]\] +/,"")),ze.items.push({type:"list_item",raw:J,task:It,checked:Dt,loose:kt,text:tt});return ze}},te.html=function(z){var G=this.rules.block.html.exec(z);if(G)return{type:this.options.sanitize?"paragraph":"html",raw:G[0],pre:!this.options.sanitizer&&(G[1]==="pre"||G[1]==="script"||G[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(G[0]):se(G[0]):G[0]}},te.def=function(z){var G=this.rules.block.def.exec(z);if(G){G[3]&&(G[3]=G[3].substring(1,G[3].length-1));var J=G[1].toLowerCase().replace(/\s+/g," ");return{tag:J,raw:G[0],href:G[2],title:G[3]}}},te.table=function(z){var G=this.rules.block.table.exec(z);if(G){var J={type:"table",header:V(G[1].replace(/^ *| *\| *$/g,"")),align:G[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:G[3]?G[3].replace(/\n$/,"").split(`
`):[]};if(J.header.length===J.align.length){J.raw=G[0];var ne=J.align.length,ve;for(ve=0;ve<ne;ve++)/^ *-+: *$/.test(J.align[ve])?J.align[ve]="right":/^ *:-+: *$/.test(J.align[ve])?J.align[ve]="center":/^ *:-+ *$/.test(J.align[ve])?J.align[ve]="left":J.align[ve]=null;for(ne=J.cells.length,ve=0;ve<ne;ve++)J.cells[ve]=V(J.cells[ve].replace(/^ *\| *| *\| *$/g,""),J.header.length);return J}}},te.lheading=function(z){var G=this.rules.block.lheading.exec(z);if(G)return{type:"heading",raw:G[0],depth:G[2].charAt(0)==="="?1:2,text:G[1]}},te.paragraph=function(z){var G=this.rules.block.paragraph.exec(z);if(G)return{type:"paragraph",raw:G[0],text:G[1].charAt(G[1].length-1)===`
`?G[1].slice(0,-1):G[1]}},te.text=function(z,G){var J=this.rules.block.text.exec(z);if(J){var ne=G[G.length-1];return ne&&ne.type==="text"?{raw:J[0],text:J[0]}:{type:"text",raw:J[0],text:J[0]}}},te.escape=function(z){var G=this.rules.inline.escape.exec(z);if(G)return{type:"escape",raw:G[0],text:se(G[1])}},te.tag=function(z,G,J){var ne=this.rules.inline.tag.exec(z);if(ne)return!G&&/^<a /i.test(ne[0])?G=!0:G&&/^<\/a>/i.test(ne[0])&&(G=!1),!J&&/^<(pre|code|kbd|script)(\s|>)/i.test(ne[0])?J=!0:J&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ne[0])&&(J=!1),{type:this.options.sanitize?"text":"html",raw:ne[0],inLink:G,inRawBlock:J,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ne[0]):se(ne[0]):ne[0]}},te.link=function(z){var G=this.rules.inline.link.exec(z);if(G){var J=xe(G[2],"()");if(J>-1){var ne=G[0].indexOf("!")===0?5:4,ve=ne+G[1].length+J;G[2]=G[2].substring(0,J),G[0]=G[0].substring(0,ve).trim(),G[3]=""}var we=G[2],ze="";if(this.options.pedantic){var nt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(we);nt?(we=nt[1],ze=nt[3]):ze=""}else ze=G[3]?G[3].slice(1,-1):"";we=we.trim().replace(/^<([\s\S]*)>$/,"$1");var ft=Ee(G,{href:we&&we.replace(this.rules.inline._escapes,"$1"),title:ze&&ze.replace(this.rules.inline._escapes,"$1")},G[0]);return ft}},te.reflink=function(z,G){var J;if((J=this.rules.inline.reflink.exec(z))||(J=this.rules.inline.nolink.exec(z))){var ne=(J[2]||J[1]).replace(/\s+/g," ");if(ne=G[ne.toLowerCase()],!ne||!ne.href){var ve=J[0].charAt(0);return{type:"text",raw:ve,text:ve}}var we=Ee(J,ne,J[0]);return we}},te.strong=function(z,G,J){J===void 0&&(J="");var ne=this.rules.inline.strong.start.exec(z);if(ne&&(!ne[1]||ne[1]&&(J===""||this.rules.inline.punctuation.exec(J)))){G=G.slice(-1*z.length);var ve=ne[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ve.lastIndex=0;for(var we;(ne=ve.exec(G))!=null;)if(we=this.rules.inline.strong.middle.exec(G.slice(0,ne.index+3)),we)return{type:"strong",raw:z.slice(0,we[0].length),text:z.slice(2,we[0].length-2)}}},te.em=function(z,G,J){J===void 0&&(J="");var ne=this.rules.inline.em.start.exec(z);if(ne&&(!ne[1]||ne[1]&&(J===""||this.rules.inline.punctuation.exec(J)))){G=G.slice(-1*z.length);var ve=ne[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ve.lastIndex=0;for(var we;(ne=ve.exec(G))!=null;)if(we=this.rules.inline.em.middle.exec(G.slice(0,ne.index+2)),we)return{type:"em",raw:z.slice(0,we[0].length),text:z.slice(1,we[0].length-1)}}},te.codespan=function(z){var G=this.rules.inline.code.exec(z);if(G){var J=G[2].replace(/\n/g," "),ne=/[^ ]/.test(J),ve=J.startsWith(" ")&&J.endsWith(" ");return ne&&ve&&(J=J.substring(1,J.length-1)),J=se(J,!0),{type:"codespan",raw:G[0],text:J}}},te.br=function(z){var G=this.rules.inline.br.exec(z);if(G)return{type:"br",raw:G[0]}},te.del=function(z){var G=this.rules.inline.del.exec(z);if(G)return{type:"del",raw:G[0],text:G[1]}},te.autolink=function(z,G){var J=this.rules.inline.autolink.exec(z);if(J){var ne,ve;return J[2]==="@"?(ne=se(this.options.mangle?G(J[1]):J[1]),ve="mailto:"+ne):(ne=se(J[1]),ve=ne),{type:"link",raw:J[0],text:ne,href:ve,tokens:[{type:"text",raw:ne,text:ne}]}}},te.url=function(z,G){var J;if(J=this.rules.inline.url.exec(z)){var ne,ve;if(J[2]==="@")ne=se(this.options.mangle?G(J[0]):J[0]),ve="mailto:"+ne;else{var we;do we=J[0],J[0]=this.rules.inline._backpedal.exec(J[0])[0];while(we!==J[0]);ne=se(J[0]),J[1]==="www."?ve="http://"+ne:ve=ne}return{type:"link",raw:J[0],text:ne,href:ve,tokens:[{type:"text",raw:ne,text:ne}]}}},te.inlineText=function(z,G,J){var ne=this.rules.inline.text.exec(z);if(ne){var ve;return G?ve=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ne[0]):se(ne[0]):ne[0]:ve=se(this.options.smartypants?J(ne[0]):ne[0]),{type:"text",raw:ne[0],text:ve}}},ue}(),Oe=W.noopTest,Le=W.edit,Pe=W.merge,he={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:Oe,table:Oe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};he._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,he._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,he.def=Le(he.def).replace("label",he._label).replace("title",he._title).getRegex(),he.bullet=/(?:[*+-]|\d{1,9}[.)])/,he.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,he.item=Le(he.item,"gm").replace(/bull/g,he.bullet).getRegex(),he.list=Le(he.list).replace(/bull/g,he.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+he.def.source+")").getRegex(),he._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",he._comment=/<!--(?!-?>)[\s\S]*?-->/,he.html=Le(he.html,"i").replace("comment",he._comment).replace("tag",he._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),he.paragraph=Le(he._paragraph).replace("hr",he.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",he._tag).getRegex(),he.blockquote=Le(he.blockquote).replace("paragraph",he.paragraph).getRegex(),he.normal=Pe({},he),he.gfm=Pe({},he.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*|$)"}),he.gfm.nptable=Le(he.gfm.nptable).replace("hr",he.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",he._tag).getRegex(),he.gfm.table=Le(he.gfm.table).replace("hr",he.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",he._tag).getRegex(),he.pedantic=Pe({},he.normal,{html:Le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",he._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:Oe,paragraph:Le(he.normal._paragraph).replace("hr",he.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",he.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Q={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Oe,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:Oe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};Q._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Q.punctuation=Le(Q.punctuation).replace(/punctuation/g,Q._punctuation).getRegex(),Q._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",Q._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",Q.em.start=Le(Q.em.start).replace(/punctuation/g,Q._punctuation).getRegex(),Q.em.middle=Le(Q.em.middle).replace(/punctuation/g,Q._punctuation).replace(/overlapSkip/g,Q._overlapSkip).getRegex(),Q.em.endAst=Le(Q.em.endAst,"g").replace(/punctuation/g,Q._punctuation).getRegex(),Q.em.endUnd=Le(Q.em.endUnd,"g").replace(/punctuation/g,Q._punctuation).getRegex(),Q.strong.start=Le(Q.strong.start).replace(/punctuation/g,Q._punctuation).getRegex(),Q.strong.middle=Le(Q.strong.middle).replace(/punctuation/g,Q._punctuation).replace(/blockSkip/g,Q._blockSkip).getRegex(),Q.strong.endAst=Le(Q.strong.endAst,"g").replace(/punctuation/g,Q._punctuation).getRegex(),Q.strong.endUnd=Le(Q.strong.endUnd,"g").replace(/punctuation/g,Q._punctuation).getRegex(),Q.blockSkip=Le(Q._blockSkip,"g").getRegex(),Q.overlapSkip=Le(Q._overlapSkip,"g").getRegex(),Q._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Q._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Q._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])?)+(?![-_])/,Q.autolink=Le(Q.autolink).replace("scheme",Q._scheme).replace("email",Q._email).getRegex(),Q._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Q.tag=Le(Q.tag).replace("comment",he._comment).replace("attribute",Q._attribute).getRegex(),Q._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Q._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,Q._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Q.link=Le(Q.link).replace("label",Q._label).replace("href",Q._href).replace("title",Q._title).getRegex(),Q.reflink=Le(Q.reflink).replace("label",Q._label).getRegex(),Q.reflinkSearch=Le(Q.reflinkSearch,"g").replace("reflink",Q.reflink).replace("nolink",Q.nolink).getRegex(),Q.normal=Pe({},Q),Q.pedantic=Pe({},Q.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:Le(/^!?\[(label)\]\((.*?)\)/).replace("label",Q._label).getRegex(),reflink:Le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Q._label).getRegex()}),Q.gfm=Pe({},Q.normal,{escape:Le(Q.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),Q.gfm.url=Le(Q.gfm.url,"i").replace("email",Q.gfm._extended_email).getRegex(),Q.breaks=Pe({},Q.gfm,{br:Le(Q.br).replace("{2,}","*").getRegex(),text:Le(Q.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Ke={block:he,inline:Q},it=j.defaults,Qe=Ke.block,Xe=Ke.inline;function ee(ue){return ue.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 ie(ue){var te="",re,z,G=ue.length;for(re=0;re<G;re++)z=ue.charCodeAt(re),Math.random()>.5&&(z="x"+z.toString(16)),te+="&#"+z+";";return te}var be=function(){function ue(re){this.tokens=[],this.tokens.links=Object.create(null),this.options=re||it,this.options.tokenizer=this.options.tokenizer||new Ae,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var z={block:Qe.normal,inline:Xe.normal};this.options.pedantic?(z.block=Qe.pedantic,z.inline=Xe.pedantic):this.options.gfm&&(z.block=Qe.gfm,this.options.breaks?z.inline=Xe.breaks:z.inline=Xe.gfm),this.tokenizer.rules=z}ue.lex=function(z,G){var J=new ue(G);return J.lex(z)};var te=ue.prototype;return te.lex=function(z){return z=z.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(z,this.tokens,!0),this.inline(this.tokens),this.tokens},te.blockTokens=function(z,G,J){G===void 0&&(G=[]),J===void 0&&(J=!0),z=z.replace(/^ +$/gm,"");for(var ne,ve,we,ze;z;){if(ne=this.tokenizer.space(z)){z=z.substring(ne.raw.length),ne.type&&G.push(ne);continue}if(ne=this.tokenizer.code(z,G)){z=z.substring(ne.raw.length),ne.type?G.push(ne):(ze=G[G.length-1],ze.raw+=`
`+ne.raw,ze.text+=`
`+ne.text);continue}if(ne=this.tokenizer.fences(z)){z=z.substring(ne.raw.length),G.push(ne);continue}if(ne=this.tokenizer.heading(z)){z=z.substring(ne.raw.length),G.push(ne);continue}if(ne=this.tokenizer.nptable(z)){z=z.substring(ne.raw.length),G.push(ne);continue}if(ne=this.tokenizer.hr(z)){z=z.substring(ne.raw.length),G.push(ne);continue}if(ne=this.tokenizer.blockquote(z)){z=z.substring(ne.raw.length),ne.tokens=this.blockTokens(ne.text,[],J),G.push(ne);continue}if(ne=this.tokenizer.list(z)){for(z=z.substring(ne.raw.length),we=ne.items.length,ve=0;ve<we;ve++)ne.items[ve].tokens=this.blockTokens(ne.items[ve].text,[],!1);G.push(ne);continue}if(ne=this.tokenizer.html(z)){z=z.substring(ne.raw.length),G.push(ne);continue}if(J&&(ne=this.tokenizer.def(z))){z=z.substring(ne.raw.length),this.tokens.links[ne.tag]||(this.tokens.links[ne.tag]={href:ne.href,title:ne.title});continue}if(ne=this.tokenizer.table(z)){z=z.substring(ne.raw.length),G.push(ne);continue}if(ne=this.tokenizer.lheading(z)){z=z.substring(ne.raw.length),G.push(ne);continue}if(J&&(ne=this.tokenizer.paragraph(z))){z=z.substring(ne.raw.length),G.push(ne);continue}if(ne=this.tokenizer.text(z,G)){z=z.substring(ne.raw.length),ne.type?G.push(ne):(ze=G[G.length-1],ze.raw+=`
`+ne.raw,ze.text+=`
`+ne.text);continue}if(z){var nt="Infinite loop on byte: "+z.charCodeAt(0);if(this.options.silent){console.error(nt);break}else throw new Error(nt)}}return G},te.inline=function(z){var G,J,ne,ve,we,ze,nt=z.length;for(G=0;G<nt;G++){ze=z[G];switch(ze.type){case"paragraph":case"text":case"heading":{ze.tokens=[],this.inlineTokens(ze.text,ze.tokens);break}case"table":{for(ze.tokens={header:[],cells:[]},ve=ze.header.length,J=0;J<ve;J++)ze.tokens.header[J]=[],this.inlineTokens(ze.header[J],ze.tokens.header[J]);for(ve=ze.cells.length,J=0;J<ve;J++)for(we=ze.cells[J],ze.tokens.cells[J]=[],ne=0;ne<we.length;ne++)ze.tokens.cells[J][ne]=[],this.inlineTokens(we[ne],ze.tokens.cells[J][ne]);break}case"blockquote":{this.inline(ze.tokens);break}case"list":{for(ve=ze.items.length,J=0;J<ve;J++)this.inline(ze.items[J].tokens);break}}}return z},te.inlineTokens=function(z,G,J,ne,ve){G===void 0&&(G=[]),J===void 0&&(J=!1),ne===void 0&&(ne=!1),ve===void 0&&(ve="");var we,ze=z,nt;if(this.tokens.links){var ft=Object.keys(this.tokens.links);if(ft.length>0)for(;(nt=this.tokenizer.rules.inline.reflinkSearch.exec(ze))!=null;)ft.includes(nt[0].slice(nt[0].lastIndexOf("[")+1,-1))&&(ze=ze.slice(0,nt.index)+"["+"a".repeat(nt[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(nt=this.tokenizer.rules.inline.blockSkip.exec(ze))!=null;)ze=ze.slice(0,nt.index)+"["+"a".repeat(nt[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;z;){if(we=this.tokenizer.escape(z)){z=z.substring(we.raw.length),G.push(we);continue}if(we=this.tokenizer.tag(z,J,ne)){z=z.substring(we.raw.length),J=we.inLink,ne=we.inRawBlock,G.push(we);continue}if(we=this.tokenizer.link(z)){z=z.substring(we.raw.length),we.type==="link"&&(we.tokens=this.inlineTokens(we.text,[],!0,ne)),G.push(we);continue}if(we=this.tokenizer.reflink(z,this.tokens.links)){z=z.substring(we.raw.length),we.type==="link"&&(we.tokens=this.inlineTokens(we.text,[],!0,ne)),G.push(we);continue}if(we=this.tokenizer.strong(z,ze,ve)){z=z.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],J,ne),G.push(we);continue}if(we=this.tokenizer.em(z,ze,ve)){z=z.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],J,ne),G.push(we);continue}if(we=this.tokenizer.codespan(z)){z=z.substring(we.raw.length),G.push(we);continue}if(we=this.tokenizer.br(z)){z=z.substring(we.raw.length),G.push(we);continue}if(we=this.tokenizer.del(z)){z=z.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],J,ne),G.push(we);continue}if(we=this.tokenizer.autolink(z,ie)){z=z.substring(we.raw.length),G.push(we);continue}if(!J&&(we=this.tokenizer.url(z,ie))){z=z.substring(we.raw.length),G.push(we);continue}if(we=this.tokenizer.inlineText(z,ne,ee)){z=z.substring(we.raw.length),ve=we.raw.slice(-1),G.push(we);continue}if(z){var tt="Infinite loop on byte: "+z.charCodeAt(0);if(this.options.silent){console.error(tt);break}else throw new Error(tt)}}return G},N(ue,null,[{key:"rules",get:function(){return{block:Qe,inline:Xe}}}]),ue}(),Re=j.defaults,Ue=W.cleanUrl,Ie=W.escape,He=function(){function ue(re){this.options=re||Re}var te=ue.prototype;return te.code=function(z,G,J){var ne=(G||"").match(/\S*/)[0];if(this.options.highlight){var ve=this.options.highlight(z,ne);ve!=null&&ve!==z&&(J=!0,z=ve)}return ne?'<pre><code class="'+this.options.langPrefix+Ie(ne,!0)+'">'+(J?z:Ie(z,!0))+`</code></pre>
`:"<pre><code>"+(J?z:Ie(z,!0))+`</code></pre>
`},te.blockquote=function(z){return`<blockquote>
`+z+`</blockquote>
`},te.html=function(z){return z},te.heading=function(z,G,J,ne){return this.options.headerIds?"<h"+G+' id="'+this.options.headerPrefix+ne.slug(J)+'">'+z+"</h"+G+`>
`:"<h"+G+">"+z+"</h"+G+`>
`},te.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},te.list=function(z,G,J){var ne=G?"ol":"ul",ve=G&&J!==1?' start="'+J+'"':"";return"<"+ne+ve+`>
`+z+"</"+ne+`>
`},te.listitem=function(z){return"<li>"+z+`</li>
`},te.checkbox=function(z){return"<input "+(z?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},te.paragraph=function(z){return"<p>"+z+`</p>
`},te.table=function(z,G){return G&&(G="<tbody>"+G+"</tbody>"),`<table>
<thead>
`+z+`</thead>
`+G+`</table>
`},te.tablerow=function(z){return`<tr>
`+z+`</tr>
`},te.tablecell=function(z,G){var J=G.header?"th":"td",ne=G.align?"<"+J+' align="'+G.align+'">':"<"+J+">";return ne+z+"</"+J+`>
`},te.strong=function(z){return"<strong>"+z+"</strong>"},te.em=function(z){return"<em>"+z+"</em>"},te.codespan=function(z){return"<code>"+z+"</code>"},te.br=function(){return this.options.xhtml?"<br/>":"<br>"},te.del=function(z){return"<del>"+z+"</del>"},te.link=function(z,G,J){if(z=Ue(this.options.sanitize,this.options.baseUrl,z),z===null)return J;var ne='<a href="'+Ie(z)+'"';return G&&(ne+=' title="'+G+'"'),ne+=">"+J+"</a>",ne},te.image=function(z,G,J){if(z=Ue(this.options.sanitize,this.options.baseUrl,z),z===null)return J;var ne='<img src="'+z+'" alt="'+J+'"';return G&&(ne+=' title="'+G+'"'),ne+=this.options.xhtml?"/>":">",ne},te.text=function(z){return z},ue}(),Ge=function(){function ue(){}var te=ue.prototype;return te.strong=function(z){return z},te.em=function(z){return z},te.codespan=function(z){return z},te.del=function(z){return z},te.html=function(z){return z},te.text=function(z){return z},te.link=function(z,G,J){return""+J},te.image=function(z,G,J){return""+J},te.br=function(){return""},ue}(),ct=function(){function ue(){this.seen={}}var te=ue.prototype;return te.slug=function(z){var G=z.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(G)){var J=G;do this.seen[J]++,G=J+"-"+this.seen[J];while(this.seen.hasOwnProperty(G))}return this.seen[G]=0,G},ue}(),rt=j.defaults,st=W.unescape,Ze=function(){function ue(re){this.options=re||rt,this.options.renderer=this.options.renderer||new He,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ge,this.slugger=new ct}ue.parse=function(z,G){var J=new ue(G);return J.parse(z)};var te=ue.prototype;return te.parse=function(z,G){G===void 0&&(G=!0);var J="",ne,ve,we,ze,nt,ft,tt,Ct,_t,dt,kt,It,Dt,zt,xt,Bt,Nt,qe,pt=z.length;for(ne=0;ne<pt;ne++){dt=z[ne];switch(dt.type){case"space":continue;case"hr":{J+=this.renderer.hr();continue}case"heading":{J+=this.renderer.heading(this.parseInline(dt.tokens),dt.depth,st(this.parseInline(dt.tokens,this.textRenderer)),this.slugger);continue}case"code":{J+=this.renderer.code(dt.text,dt.lang,dt.escaped);continue}case"table":{for(Ct="",tt="",ze=dt.header.length,ve=0;ve<ze;ve++)tt+=this.renderer.tablecell(this.parseInline(dt.tokens.header[ve]),{header:!0,align:dt.align[ve]});for(Ct+=this.renderer.tablerow(tt),_t="",ze=dt.cells.length,ve=0;ve<ze;ve++){for(ft=dt.tokens.cells[ve],tt="",nt=ft.length,we=0;we<nt;we++)tt+=this.renderer.tablecell(this.parseInline(ft[we]),{header:!1,align:dt.align[we]});_t+=this.renderer.tablerow(tt)}J+=this.renderer.table(Ct,_t);continue}case"blockquote":{_t=this.parse(dt.tokens),J+=this.renderer.blockquote(_t);continue}case"list":{for(kt=dt.ordered,It=dt.start,Dt=dt.loose,ze=dt.items.length,_t="",ve=0;ve<ze;ve++)xt=dt.items[ve],Bt=xt.checked,Nt=xt.task,zt="",xt.task&&(qe=this.renderer.checkbox(Bt),Dt?xt.tokens.length>0&&xt.tokens[0].type==="text"?(xt.tokens[0].text=qe+" "+xt.tokens[0].text,xt.tokens[0].tokens&&xt.tokens[0].tokens.length>0&&xt.tokens[0].tokens[0].type==="text"&&(xt.tokens[0].tokens[0].text=qe+" "+xt.tokens[0].tokens[0].text)):xt.tokens.unshift({type:"text",text:qe}):zt+=qe),zt+=this.parse(xt.tokens,Dt),_t+=this.renderer.listitem(zt,Nt,Bt);J+=this.renderer.list(_t,kt,It);continue}case"html":{J+=this.renderer.html(dt.text);continue}case"paragraph":{J+=this.renderer.paragraph(this.parseInline(dt.tokens));continue}case"text":{for(_t=dt.tokens?this.parseInline(dt.tokens):dt.text;ne+1<pt&&z[ne+1].type==="text";)dt=z[++ne],_t+=`
`+(dt.tokens?this.parseInline(dt.tokens):dt.text);J+=G?this.renderer.paragraph(_t):_t;continue}default:{var lt='Token with "'+dt.type+'" type was not found.';if(this.options.silent){console.error(lt);return}else throw new Error(lt)}}}return J},te.parseInline=function(z,G){G=G||this.renderer;var J="",ne,ve,we=z.length;for(ne=0;ne<we;ne++){ve=z[ne];switch(ve.type){case"escape":{J+=G.text(ve.text);break}case"html":{J+=G.html(ve.text);break}case"link":{J+=G.link(ve.href,ve.title,this.parseInline(ve.tokens,G));break}case"image":{J+=G.image(ve.href,ve.title,ve.text);break}case"strong":{J+=G.strong(this.parseInline(ve.tokens,G));break}case"em":{J+=G.em(this.parseInline(ve.tokens,G));break}case"codespan":{J+=G.codespan(ve.text);break}case"br":{J+=G.br();break}case"del":{J+=G.del(this.parseInline(ve.tokens,G));break}case"text":{J+=G.text(ve.text);break}default:{var ze='Token with "'+ve.type+'" type was not found.';if(this.options.silent){console.error(ze);return}else throw new Error(ze)}}}return J},ue}(),mt=W.merge,ht=W.checkSanitizeDeprecation,me=W.escape,Ce=j.getDefaults,_e=j.changeDefaults,Fe=j.defaults;function Se(ue,te,re){if(typeof ue=="undefined"||ue===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ue!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ue)+", string expected");if(typeof te=="function"&&(re=te,te=null),te=mt({},Se.defaults,te||{}),ht(te),re){var z=te.highlight,G;try{G=be.lex(ue,te)}catch(we){return re(we)}var J=function(ze){var nt;if(!ze)try{nt=Ze.parse(G,te)}catch(ft){ze=ft}return te.highlight=z,ze?re(ze):re(null,nt)};if(!z||z.length<3)return J();if(delete te.highlight,!G.length)return J();var ne=0;Se.walkTokens(G,function(we){we.type==="code"&&(ne++,setTimeout(function(){z(we.text,we.lang,function(ze,nt){if(ze)return J(ze);nt!=null&&nt!==we.text&&(we.text=nt,we.escaped=!0),ne--,ne===0&&J()})},0))}),ne===0&&J();return}try{var ve=be.lex(ue,te);return te.walkTokens&&Se.walkTokens(ve,te.walkTokens),Ze.parse(ve,te)}catch(we){if(we.message+=`
Please report this to https://github.com/markedjs/marked.`,te.silent)return"<p>An error occurred:</p><pre>"+me(we.message+"",!0)+"</pre>";throw we}}Se.options=Se.setOptions=function(ue){return mt(Se.defaults,ue),_e(Se.defaults),Se},Se.getDefaults=Ce,Se.defaults=Fe,Se.use=function(ue){var te=mt({},ue);if(ue.renderer&&function(){var z=Se.defaults.renderer||new He,G=function(ve){var we=z[ve];z[ve]=function(){for(var ze=arguments.length,nt=new Array(ze),ft=0;ft<ze;ft++)nt[ft]=arguments[ft];var tt=ue.renderer[ve].apply(z,nt);return tt===!1&&(tt=we.apply(z,nt)),tt}};for(var J in ue.renderer)G(J);te.renderer=z}(),ue.tokenizer&&function(){var z=Se.defaults.tokenizer||new Ae,G=function(ve){var we=z[ve];z[ve]=function(){for(var ze=arguments.length,nt=new Array(ze),ft=0;ft<ze;ft++)nt[ft]=arguments[ft];var tt=ue.tokenizer[ve].apply(z,nt);return tt===!1&&(tt=we.apply(z,nt)),tt}};for(var J in ue.tokenizer)G(J);te.tokenizer=z}(),ue.walkTokens){var re=Se.defaults.walkTokens;te.walkTokens=function(z){ue.walkTokens(z),re&&re(z)}}Se.setOptions(te)},Se.walkTokens=function(ue,te){for(var re=b(ue),z;!(z=re()).done;){var G=z.value;te(G);switch(G.type){case"table":{for(var J=b(G.tokens.header),ne;!(ne=J()).done;){var ve=ne.value;Se.walkTokens(ve,te)}for(var we=b(G.tokens.cells),ze;!(ze=we()).done;)for(var nt=ze.value,ft=b(nt),tt;!(tt=ft()).done;){var Ct=tt.value;Se.walkTokens(Ct,te)}break}case"list":{Se.walkTokens(G.items,te);break}default:G.tokens&&Se.walkTokens(G.tokens,te)}}},Se.Parser=Ze,Se.parser=Ze.parse,Se.Renderer=He,Se.TextRenderer=Ge,Se.Lexer=be,Se.lexer=be.lex,Se.Tokenizer=Ae,Se.Slugger=ct,Se.parse=Se;var Me=Se;return Me})},IBYe:function(ot,fe,U){"use strict";function Z(N){return null}fe.a=Z},JYp7:function(ot,fe,U){"use strict";U.d(fe,"c",function(){return N}),U.d(fe,"d",function(){return _}),U.d(fe,"f",function(){return b}),U.d(fe,"a",function(){return S}),U.d(fe,"b",function(){return j}),U.d(fe,"e",function(){return M});var Z=function(){var O=function(w,c){return O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,C){y.__proto__=C}||function(y,C){for(var m in C)C.hasOwnProperty(m)&&(y[m]=C[m])},O(w,c)};return function(w,c){O(w,c);function y(){this.constructor=w}w.prototype=c===null?Object.create(c):(y.prototype=c.prototype,new y)}}(),N={done:!0,value:void 0},_;(function(O){var w={next:function(){return N}};function c(){return w}O.empty=c;function y(d){var u=!1;return{next:function(){return u?N:(u=!0,{done:!1,value:d})}}}O.single=y;function C(d,u,E){return u===void 0&&(u=0),E===void 0&&(E=d.length),{next:function(){return u>=E?N:{done:!1,value:d[u++]}}}}O.fromArray=C;function m(d){return{next:function(){var u=d.next();return u.done?N:{done:!1,value:u.value}}}}O.fromNativeIterator=m;function f(d){return d?Array.isArray(d)?O.fromArray(d):d:O.empty()}O.from=f;function v(d,u){return{next:function(){var E=d.next();return E.done?N:{done:!1,value:u(E.value)}}}}O.map=v;function a(d,u){return{next:function(){for(;;){var E=d.next();if(E.done)return N;if(u(E.value))return{done:!1,value:E.value}}}}}O.filter=a;function e(d,u){for(var E=d.next();!E.done;E=d.next())u(E.value)}O.forEach=e;function n(d,u){u===void 0&&(u=Number.POSITIVE_INFINITY);var E=[];if(u===0)return E;for(var g=0,s=d.next();!s.done&&!(E.push(s.value),++g>=u);s=d.next());return E}O.collect=n;function i(){for(var d=[],u=0;u<arguments.length;u++)d[u]=arguments[u];var E=0;return{next:function(){if(E>=d.length)return N;var g=d[E],s=g.next();return s.done?(E++,this.next()):s}}}O.concat=i;function h(d){return new k(d)}O.chain=h})(_||(_={}));var k=function(){function O(w){this.it=w}return O.prototype.next=function(){return this.it.next()},O}();function b(O){return Array.isArray(O)?_.fromArray(O):O||_.empty()}var S=function(){function O(w,c,y,C){c===void 0&&(c=0),y===void 0&&(y=w.length),C===void 0&&(C=c-1),this.items=w,this.start=c,this.end=y,this.index=C}return O.prototype.first=function(){return this.index=this.start,this.current()},O.prototype.next=function(){return this.index=Math.min(this.index+1,this.end),this.current()},O.prototype.current=function(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]},O}(),j=function(O){Z(w,O);function w(c,y,C,m){return y===void 0&&(y=0),C===void 0&&(C=c.length),m===void 0&&(m=y-1),O.call(this,c,y,C,m)||this}return w.prototype.current=function(){return O.prototype.current.call(this)},w.prototype.previous=function(){return this.index=Math.max(this.index-1,this.start-1),this.current()},w.prototype.first=function(){return this.index=this.start,this.current()},w.prototype.last=function(){return this.index=this.end-1,this.current()},w.prototype.parent=function(){return null},w}(S),M=function(){function O(w,c){this.iterator=w,this.fn=c}return O.prototype.next=function(){return this.fn(this.iterator.next())},O}()},LdHM:function(ot,fe,U){"use strict";U.d(fe,"b",function(){return i}),U.d(fe,"a",function(){return d});var Z=U("1OyB"),N=U("vuIU"),_=U("Ji7U"),k=U("LK+K"),b=U("q1tI"),S=U("rePB"),j=U("Ff2n"),M=U("ODXe"),O=U("4IlW"),w=U("bX4T"),c=U("YrtM"),y=U("TSYQ"),C=U.n(y),m=U("+nKL"),f=U("8OUc"),v=function(V,se){var xe=V.prefixCls,Ee=V.id,je=V.flattenOptions,Ae=V.childrenAsData,Oe=V.values,Le=V.searchValue,Pe=V.multiple,he=V.defaultActiveFirstOption,Q=V.height,Ke=V.itemHeight,it=V.notFoundContent,Qe=V.open,Xe=V.menuItemSelectedIcon,ee=V.virtual,ie=V.onSelect,be=V.onToggleOpen,Re=V.onActiveValue,Ue=V.onScroll,Ie=V.onMouseEnter,He="".concat(xe,"-item"),Ge=Object(c.a)(function(){return je},[Qe,je],function(Me,ue){return ue[0]&&Me[1]!==ue[1]}),ct=b.useRef(null),rt=function(ue){ue.preventDefault()},st=function(ue){ct.current&&ct.current.scrollTo({index:ue})},Ze=function(ue){for(var te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,re=Ge.length,z=0;z<re;z+=1){var G=(ue+z*te+re)%re,J=Ge[G],ne=J.group,ve=J.data;if(!ne&&!ve.disabled)return G}return-1},mt=b.useState(function(){return Ze(0)}),ht=Object(M.a)(mt,2),me=ht[0],Ce=ht[1],_e=function(ue){Ce(ue);var te=Ge[ue];if(!te){Re(null,-1);return}Re(te.data.value,ue)};b.useEffect(function(){_e(he!==!1?Ze(0):-1)},[Ge.length,Le]),b.useEffect(function(){var Me=setTimeout(function(){if(!Pe&&Qe&&Oe.size===1){var ue=Array.from(Oe)[0],te=Ge.findIndex(function(re){var z=re.data;return z.value===ue});_e(te),st(te)}});return function(){return clearTimeout(Me)}},[Qe]);var Fe=function(ue){ue!==void 0&&ie(ue,{selected:!Oe.has(ue)}),Pe||be(!1)};if(b.useImperativeHandle(se,function(){return{onKeyDown:function(ue){var te=ue.which;switch(te){case O.a.UP:case O.a.DOWN:{var re=0;if(te===O.a.UP?re=-1:te===O.a.DOWN&&(re=1),re!==0){var z=Ze(me+re,re);st(z),_e(z)}break}case O.a.ENTER:{var G=Ge[me];G&&!G.data.disabled?Fe(G.data.value):Fe(void 0),Qe&&ue.preventDefault();break}case O.a.ESC:be(!1)}},onKeyUp:function(){},scrollTo:function(ue){st(ue)}}}),Ge.length===0)return b.createElement("div",{role:"listbox",id:"".concat(Ee,"_list"),className:"".concat(He,"-empty"),onMouseDown:rt},it);function Se(Me){var ue=Ge[Me];if(!ue)return null;var te=ue.data||{},re=te.value,z=te.label,G=te.children,J=Object(w.a)(te,!0),ne=Ae?G:z;return ue?b.createElement("div",Object.assign({"aria-label":typeof ne=="string"?ne:null},J,{key:Me,role:"option",id:"".concat(Ee,"_list_").concat(Me),"aria-selected":Oe.has(re)}),re):null}return b.createElement(b.Fragment,null,b.createElement("div",{role:"listbox",id:"".concat(Ee,"_list"),style:{height:0,width:0,overflow:"hidden"}},Se(me-1),Se(me),Se(me+1)),b.createElement(m.a,{itemKey:"key",ref:ct,data:Ge,height:Q,itemHeight:Ke,fullHeight:!1,onMouseDown:rt,onScroll:Ue,virtual:ee,onMouseEnter:Ie},function(Me,ue){var te,re=Me.group,z=Me.groupOption,G=Me.data,J=G.label,ne=G.key;if(re)return b.createElement("div",{className:C()(He,"".concat(He,"-group"))},J!==void 0?J:ne);var ve=G.disabled,we=G.value,ze=G.title,nt=G.children,ft=G.style,tt=G.className,Ct=Object(j.a)(G,["disabled","value","title","children","style","className"]),_t=Oe.has(we),dt="".concat(He,"-option"),kt=C()(He,dt,tt,(te={},Object(S.a)(te,"".concat(dt,"-grouped"),z),Object(S.a)(te,"".concat(dt,"-active"),me===ue&&!ve),Object(S.a)(te,"".concat(dt,"-disabled"),ve),Object(S.a)(te,"".concat(dt,"-selected"),_t),te)),It=Ae?nt:J,Dt=!Xe||typeof Xe=="function"||_t;return b.createElement("div",Object.assign({},Ct,{"aria-selected":_t,className:kt,title:ze,onMouseMove:function(){if(me===ue||ve)return;_e(ue)},onClick:function(){ve||Fe(we)},style:ft}),b.createElement("div",{className:"".concat(dt,"-content")},It||we),b.isValidElement(Xe)||_t,Dt&&b.createElement(f.a,{className:"".concat(He,"-option-state"),customizeIcon:Xe,customizeIconProps:{isSelected:_t}},_t?"\u2713":null))}))},a=b.forwardRef(v);a.displayName="OptionList";var e=a,n=function(){return null};n.isSelectOption=!0;var i=n,h=function(){return null};h.isSelectOptGroup=!0;var d=h,u=U("VTBJ"),E=U("Zm9Q");function g(X){var V=X.key,se=X.props,xe=se.children,Ee=se.value,je=Object(j.a)(se,["children","value"]);return Object(u.a)({key:V,value:Ee!==void 0?Ee:V,children:xe},je)}function s(X){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(E.a)(X).map(function(se,xe){if(!b.isValidElement(se)||!se.type)return null;var Ee=se.type.isSelectOptGroup,je=se.key,Ae=se.props,Oe=Ae.children,Le=Object(j.a)(Ae,["children"]);return V||!Ee?g(se):Object(u.a)(Object(u.a)({key:"__RC_SELECT_GRP__".concat(je===null?xe:je,"__"),label:je},Le),{},{options:s(Oe)})}).filter(function(se){return se})}var o=U("2Qr1"),r=U("qNPg"),t=U("U8pU"),T=U("Kwbf"),x=U("WKfj");function A(X){var V=X.mode,se=X.options,xe=X.children,Ee=X.backfill,je=X.allowClear,Ae=X.placeholder,Oe=X.getInputElement,Le=X.showSearch,Pe=X.onSearch,he=X.defaultOpen,Q=X.autoFocus,Ke=X.labelInValue,it=X.value,Qe=X.inputValue,Xe=X.optionLabelProp,ee=V==="multiple"||V==="tags",ie=Le!==void 0?Le:ee||V==="combobox",be=se||s(xe);if(Object(T.a)(V!=="tags"||be.every(function(He){return!He.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),V==="tags"||V==="combobox"){var Re=be.some(function(He){return He.options?He.options.some(function(Ge){return typeof("value"in Ge?Ge.value:Ge.key)=="number"}):typeof("value"in He?He.value:He.key)=="number"});Object(T.a)(!Re,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(T.a)(V!=="combobox"||!Xe,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(T.a)(V==="combobox"||!Ee,"`backfill` only works with `combobox` mode."),Object(T.a)(V==="combobox"||!Oe,"`getInputElement` only work with `combobox` mode."),Object(T.b)(V!=="combobox"||!Oe||!je||!Ae,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Pe&&!ie&&V!=="combobox"&&V!=="tags"&&Object(T.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(T.b)(!he||Q,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),it!=null){var Ue=Object(x.d)(it);Object(T.a)(!Ke||Ue.every(function(He){return Object(t.a)(He)==="object"&&("key"in He||"value"in He)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(T.a)(!ee||Array.isArray(it),"`value` should be array when `mode` is `multiple` or `tags`")}if(xe){var Ie=null;Object(E.a)(xe).some(function(He){if(!b.isValidElement(He)||!He.type)return!1;var Ge=He.type;if(Ge.isSelectOption)return!1;if(Ge.isSelectOptGroup){var ct=Object(E.a)(He.props.children).every(function(rt){return!b.isValidElement(rt)||!He.type||rt.type.isSelectOption?!0:(Ie=rt.type,!1)});return!ct}return Ie=Ge,!0}),Ie&&Object(T.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ie.displayName||Ie.name||Ie,"`.")),Object(T.a)(Qe===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var R=A,I=Object(r.a)({prefixCls:"rc-select",components:{optionList:e},convertChildrenToData:s,flattenOptions:o.d,getLabeledValue:o.e,filterOptions:o.b,isValueDisabled:o.g,findValueOption:o.c,warningProps:R,fillOptionsWithMissingValue:o.a}),B=function(X){Object(_.a)(se,X);var V=Object(k.a)(se);function se(){var xe;return Object(Z.a)(this,se),xe=V.apply(this,arguments),xe.selectRef=b.createRef(),xe.focus=function(){xe.selectRef.current.focus()},xe.blur=function(){xe.selectRef.current.blur()},xe}return Object(N.a)(se,[{key:"render",value:function(){return b.createElement(I,Object.assign({ref:this.selectRef},this.props))}}]),se}(b.Component);B.Option=i,B.OptGroup=d;var W=B,$=fe.c=W},MI8n:function(ot,fe,U){"use strict";U.d(fe,"b",function(){return S}),U.d(fe,"a",function(){return O}),U.d(fe,"e",function(){return w}),U.d(fe,"d",function(){return c}),U.d(fe,"c",function(){return y}),U.d(fe,"f",function(){return C});var Z=U("/cxE"),N=U("C/vA"),_=U("pmY6"),k=U("24hK"),b=function(){var m=function(f,v){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,e){a.__proto__=e}||function(a,e){for(var n in e)e.hasOwnProperty(n)&&(a[n]=e[n])},m(f,v)};return function(f,v){m(f,v);function a(){this.constructor=f}f.prototype=v===null?Object.create(v):(a.prototype=v.prototype,new a)}}(),S;(function(m){m.None=function(){return _.a.None};function f(R){return function(I,B,W){B===void 0&&(B=null);var $=!1,X;return X=R(function(V){return $?void 0:(X?X.dispose():$=!0,I.call(B,V))},null,W),$&&X.dispose(),X}}m.once=f;function v(R,I){return d(function(B,W,$){return W===void 0&&(W=null),R(function(X){return B.call(W,I(X))},null,$)})}m.map=v;function a(R,I){return d(function(B,W,$){return W===void 0&&(W=null),R(function(X){I(X),B.call(W,X)},null,$)})}m.forEach=a;function e(R,I){return d(function(B,W,$){return W===void 0&&(W=null),R(function(X){return I(X)&&B.call(W,X)},null,$)})}m.filter=e;function n(R){return R}m.signal=n;function i(){for(var R=[],I=0;I<arguments.length;I++)R[I]=arguments[I];return function(B,W,$){return W===void 0&&(W=null),_.e.apply(void 0,R.map(function(X){return X(function(V){return B.call(W,V)},null,$)}))}}m.any=i;function h(R,I,B){var W=B;return v(R,function($){return W=I(W,$),W})}m.reduce=h;function d(R){var I,B=new O({onFirstListenerAdd:function(){I=R(B.fire,B)},onLastListenerRemove:function(){I.dispose()}});return B.event}m.snapshot=d;function u(R,I,B,W,$){B===void 0&&(B=100),W===void 0&&(W=!1);var X,V=void 0,se=void 0,xe=0,Ee=new O({leakWarningThreshold:$,onFirstListenerAdd:function(){X=R(function(je){xe++,V=I(V,je),W&&!se&&(Ee.fire(V),V=void 0),clearTimeout(se),se=setTimeout(function(){var Ae=V;V=void 0,se=void 0,(!W||xe>1)&&Ee.fire(Ae),xe=0},B)})},onLastListenerRemove:function(){X.dispose()}});return Ee.event}m.debounce=u;function E(R){var I=new Date().getTime();return v(f(R),function(B){return new Date().getTime()-I})}m.stopwatch=E;function g(R){var I=!0,B;return e(R,function(W){var $=I||W!==B;return I=!1,B=W,$})}m.latch=g;function s(R,I,B){I===void 0&&(I=!1),B===void 0&&(B=[]);var W=B.slice(),$=R(function(se){W?W.push(se):V.fire(se)}),X=function(){W&&W.forEach(function(se){return V.fire(se)}),W=null},V=new O({onFirstListenerAdd:function(){$||($=R(function(se){return V.fire(se)}))},onFirstListenerDidAdd:function(){W&&(I?setTimeout(X):X())},onLastListenerRemove:function(){$&&$.dispose(),$=null}});return V.event}m.buffer=s;var o=function(){function R(I){this.event=I}return R.prototype.map=function(I){return new R(v(this.event,I))},R.prototype.forEach=function(I){return new R(a(this.event,I))},R.prototype.filter=function(I){return new R(e(this.event,I))},R.prototype.reduce=function(I,B){return new R(h(this.event,I,B))},R.prototype.latch=function(){return new R(g(this.event))},R.prototype.debounce=function(I,B,W,$){return B===void 0&&(B=100),W===void 0&&(W=!1),new R(u(this.event,I,B,W,$))},R.prototype.on=function(I,B,W){return this.event(I,B,W)},R.prototype.once=function(I,B,W){return f(this.event)(I,B,W)},R}();function r(R){return new o(R)}m.chain=r;function t(R,I,B){B===void 0&&(B=function(se){return se});var W=function(){for(var se=[],xe=0;xe<arguments.length;xe++)se[xe]=arguments[xe];return V.fire(B.apply(void 0,se))},$=function(){return R.on(I,W)},X=function(){return R.removeListener(I,W)},V=new O({onFirstListenerAdd:$,onLastListenerRemove:X});return V.event}m.fromNodeEventEmitter=t;function T(R,I,B){B===void 0&&(B=function(se){return se});var W=function(){for(var se=[],xe=0;xe<arguments.length;xe++)se[xe]=arguments[xe];return V.fire(B.apply(void 0,se))},$=function(){return R.addEventListener(I,W)},X=function(){return R.removeEventListener(I,W)},V=new O({onFirstListenerAdd:$,onLastListenerRemove:X});return V.event}m.fromDOMEventEmitter=T;function x(R){var I=new O,B=!1;return R.then(void 0,function(){return null}).then(function(){B?I.fire(void 0):setTimeout(function(){return I.fire(void 0)},0)}),B=!0,I.event}m.fromPromise=x;function A(R){return new Promise(function(I){return f(R)(I)})}m.toPromise=A})(S||(S={}));var j=-1,M=function(){function m(f,v){v===void 0&&(v=Math.random().toString(18).slice(2,5)),this.customThreshold=f,this.name=v,this._warnCountdown=0}return m.prototype.dispose=function(){this._stacks&&this._stacks.clear()},m.prototype.check=function(f){var v=this,a=j;if(typeof this.customThreshold=="number"&&(a=this.customThreshold),a<=0||f<a)return;this._stacks||(this._stacks=new Map);var e=new Error().stack.split(`
`).slice(3).join(`
`),n=this._stacks.get(e)||0;if(this._stacks.set(e,n+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.5;var i,h=0;this._stacks.forEach(function(d,u){(!i||h<d)&&(i=u,h=d)}),console.warn("["+this.name+"] potential listener LEAK detected, having "+f+" listeners already. MOST frequent listener ("+h+"):"),console.warn(i)}return function(){var d=v._stacks.get(e)||0;v._stacks.set(e,d-1)}},m}(),O=function(){function m(f){this._disposed=!1,this._options=f,this._leakageMon=j>0?new M(this._options&&this._options.leakWarningThreshold):void 0}return Object.defineProperty(m.prototype,"event",{get:function(){var f=this;return this._event||(this._event=function(v,a,e){f._listeners||(f._listeners=new k.a);var n=f._listeners.isEmpty();n&&f._options&&f._options.onFirstListenerAdd&&f._options.onFirstListenerAdd(f);var i=f._listeners.push(a?[v,a]:v);n&&f._options&&f._options.onFirstListenerDidAdd&&f._options.onFirstListenerDidAdd(f),f._options&&f._options.onListenerDidAdd&&f._options.onListenerDidAdd(f,v,a);var h;f._leakageMon&&(h=f._leakageMon.check(f._listeners.size));var d;return d={dispose:function(){if(h&&h(),d.dispose=m._noop,!f._disposed&&(i(),f._options&&f._options.onLastListenerRemove)){var u=f._listeners&&!f._listeners.isEmpty();u||f._options.onLastListenerRemove(f)}}},e instanceof _.b?e.add(d):Array.isArray(e)&&e.push(d),d}),this._event},enumerable:!0,configurable:!0}),m.prototype.fire=function(f){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new k.a);for(var v=this._listeners.iterator(),a=v.next();!a.done;a=v.next())this._deliveryQueue.push([a.value,f]);for(;this._deliveryQueue.size>0;){var e=this._deliveryQueue.shift(),n=e[0],i=e[1];try{typeof n=="function"?n.call(void 0,i):n[0].call(n[1],i)}catch(h){Object(Z.e)(h)}}}},m.prototype.dispose=function(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0},m._noop=function(){},m}(),w=function(m){b(f,m);function f(v){var a=m.call(this,v)||this;return a._isPaused=0,a._eventQueue=new k.a,a._mergeFn=v&&v.merge,a}return f.prototype.pause=function(){this._isPaused++},f.prototype.resume=function(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){var v=this._eventQueue.toArray();this._eventQueue.clear(),m.prototype.fire.call(this,this._mergeFn(v))}else for(;!this._isPaused&&this._eventQueue.size!==0;)m.prototype.fire.call(this,this._eventQueue.shift())},f.prototype.fire=function(v){this._listeners&&(this._isPaused!==0?this._eventQueue.push(v):m.prototype.fire.call(this,v))},f}(O),c=function(){function m(){var f=this;this.hasListeners=!1,this.events=[],this.emitter=new O({onFirstListenerAdd:function(){return f.onFirstListenerAdd()},onLastListenerRemove:function(){return f.onLastListenerRemove()}})}return Object.defineProperty(m.prototype,"event",{get:function(){return this.emitter.event},enumerable:!0,configurable:!0}),m.prototype.add=function(f){var v=this,a={event:f,listener:null};this.events.push(a),this.hasListeners&&this.hook(a);var e=function(){v.hasListeners&&v.unhook(a);var n=v.events.indexOf(a);v.events.splice(n,1)};return Object(_.h)(Object(N.a)(e))},m.prototype.onFirstListenerAdd=function(){var f=this;this.hasListeners=!0,this.events.forEach(function(v){return f.hook(v)})},m.prototype.onLastListenerRemove=function(){var f=this;this.hasListeners=!1,this.events.forEach(function(v){return f.unhook(v)})},m.prototype.hook=function(f){var v=this;f.listener=f.event(function(a){return v.emitter.fire(a)})},m.prototype.unhook=function(f){f.listener&&f.listener.dispose(),f.listener=null},m.prototype.dispose=function(){this.emitter.dispose()},m}(),y=function(){function m(){this.buffers=[]}return m.prototype.wrapEvent=function(f){var v=this;return function(a,e,n){return f(function(i){var h=v.buffers[v.buffers.length-1];h?h.push(function(){return a.call(e,i)}):a.call(e,i)},void 0,n)}},m.prototype.bufferEvents=function(f){var v=[];this.buffers.push(v);var a=f();return this.buffers.pop(),v.forEach(function(e){return e()}),a},m}(),C=function(){function m(){var f=this;this.listening=!1,this.inputEvent=S.None,this.inputEventListener=_.a.None,this.emitter=new O({onFirstListenerDidAdd:function(){f.listening=!0,f.inputEventListener=f.inputEvent(f.emitter.fire,f.emitter)},onLastListenerRemove:function(){f.listening=!1,f.inputEventListener.dispose()}}),this.event=this.emitter.event}return Object.defineProperty(m.prototype,"input",{set:function(f){this.inputEvent=f,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=f(this.emitter.fire,this.emitter))},enumerable:!0,configurable:!0}),m.prototype.dispose=function(){this.inputEventListener.dispose(),this.emitter.dispose()},m}()},N0LK:function(ot,fe,U){"use strict";U.d(fe,"x",function(){return Z}),U.d(fe,"F",function(){return N}),U.d(fe,"r",function(){return k}),U.d(fe,"o",function(){return b}),U.d(fe,"p",function(){return S}),U.d(fe,"Q",function(){return j}),U.d(fe,"K",function(){return O}),U.d(fe,"k",function(){return w}),U.d(fe,"N",function(){return c}),U.d(fe,"m",function(){return y}),U.d(fe,"l",function(){return C}),U.d(fe,"I",function(){return m}),U.d(fe,"H",function(){return f}),U.d(fe,"q",function(){return v}),U.d(fe,"t",function(){return a}),U.d(fe,"D",function(){return e}),U.d(fe,"e",function(){return n}),U.d(fe,"f",function(){return i}),U.d(fe,"B",function(){return h}),U.d(fe,"C",function(){return d}),U.d(fe,"n",function(){return E}),U.d(fe,"O",function(){return s}),U.d(fe,"c",function(){return o}),U.d(fe,"d",function(){return r}),U.d(fe,"z",function(){return t}),U.d(fe,"A",function(){return T}),U.d(fe,"u",function(){return x}),U.d(fe,"E",function(){return R}),U.d(fe,"G",function(){return I}),U.d(fe,"i",function(){return W}),U.d(fe,"g",function(){return X}),U.d(fe,"v",function(){return se}),U.d(fe,"h",function(){return xe}),U.d(fe,"y",function(){return Ee}),U.d(fe,"w",function(){return je}),U.d(fe,"a",function(){return Ae}),U.d(fe,"P",function(){return Oe}),U.d(fe,"L",function(){return Le}),U.d(fe,"J",function(){return Pe}),U.d(fe,"j",function(){return he}),U.d(fe,"M",function(){return Q}),U.d(fe,"s",function(){return Ke}),U.d(fe,"b",function(){return it});function Z(ee){return!ee||typeof ee!="string"?!0:ee.trim().length===0}function N(ee,ie,be){be===void 0&&(be="0");for(var Re=""+ee,Ue=[Re],Ie=Re.length;Ie<ie;Ie++)Ue.push(be);return Ue.reverse().join("")}var _=/{(\d+)}/g;function k(ee){for(var ie=[],be=1;be<arguments.length;be++)ie[be-1]=arguments[be];return ie.length===0?ee:ee.replace(_,function(Re,Ue){var Ie=parseInt(Ue,10);return isNaN(Ie)||Ie<0||Ie>=ie.length?Re:ie[Ie]})}function b(ee){return ee.replace(/[<>&]/g,function(ie){switch(ie){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return ie}})}function S(ee){return ee.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function j(ee,ie){ie===void 0&&(ie=" ");var be=M(ee,ie);return O(be,ie)}function M(ee,ie){if(!ee||!ie)return ee;var be=ie.length;if(be===0||ee.length===0)return ee;for(var Re=0;ee.indexOf(ie,Re)===Re;)Re=Re+be;return ee.substring(Re)}function O(ee,ie){if(!ee||!ie)return ee;var be=ie.length,Re=ee.length;if(be===0||Re===0)return ee;for(var Ue=Re,Ie=-1;!(Ie=ee.lastIndexOf(ie,Ue-1),Ie===-1||Ie+be!==Ue);){if(Ie===0)return"";Ue=Ie}return ee.substring(0,Ue)}function w(ee){return ee.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function c(ee,ie){if(ee.length<ie.length)return!1;if(ee===ie)return!0;for(var be=0;be<ie.length;be++)if(ee[be]!==ie[be])return!1;return!0}function y(ee,ie){var be=ee.length-ie.length;return be>0?ee.indexOf(ie,be)===be:be===0?ee===ie:!1}function C(ee,ie,be){if(be===void 0&&(be={}),!ee)throw new Error("Cannot create regex from empty string");ie||(ee=S(ee)),be.wholeWord&&(/\B/.test(ee.charAt(0))||(ee="\\b"+ee),/\B/.test(ee.charAt(ee.length-1))||(ee=ee+"\\b"));var Re="";return be.global&&(Re+="g"),be.matchCase||(Re+="i"),be.multiline&&(Re+="m"),be.unicode&&(Re+="u"),new RegExp(ee,Re)}function m(ee){if(ee.source==="^"||ee.source==="^$"||ee.source==="$"||ee.source==="^\\s*$")return!1;var ie=ee.exec("");return!!(ie&&ee.lastIndex===0)}function f(ee){return(ee.global?"g":"")+(ee.ignoreCase?"i":"")+(ee.multiline?"m":"")+(ee.unicode?"u":"")}function v(ee){for(var ie=0,be=ee.length;ie<be;ie++){var Re=ee.charCodeAt(ie);if(Re!==32&&Re!==9)return ie}return-1}function a(ee,ie,be){ie===void 0&&(ie=0),be===void 0&&(be=ee.length);for(var Re=ie;Re<be;Re++){var Ue=ee.charCodeAt(Re);if(Ue!==32&&Ue!==9)return ee.substring(ie,Re)}return ee.substring(ie,be)}function e(ee,ie){ie===void 0&&(ie=ee.length-1);for(var be=ie;be>=0;be--){var Re=ee.charCodeAt(be);if(Re!==32&&Re!==9)return be}return-1}function n(ee,ie){return ee<ie?-1:ee>ie?1:0}function i(ee,ie){for(var be=Math.min(ee.length,ie.length),Re=0;Re<be;Re++){var Ue=ee.charCodeAt(Re),Ie=ie.charCodeAt(Re);if(Ue===Ie)continue;d(Ue)&&(Ue+=32),d(Ie)&&(Ie+=32);var He=Ue-Ie;if(He===0)continue;return h(Ue)&&h(Ie)?He:n(ee.toLowerCase(),ie.toLowerCase())}return ee.length<ie.length?-1:ee.length>ie.length?1:0}function h(ee){return ee>=97&&ee<=122}function d(ee){return ee>=65&&ee<=90}function u(ee){return h(ee)||d(ee)}function E(ee,ie){return ee.length===ie.length&&g(ee,ie)}function g(ee,ie,be){be===void 0&&(be=ee.length);for(var Re=0;Re<be;Re++){var Ue=ee.charCodeAt(Re),Ie=ie.charCodeAt(Re);if(Ue===Ie)continue;if(u(Ue)&&u(Ie)){var He=Math.abs(Ue-Ie);if(He!==0&&He!==32)return!1}else if(String.fromCharCode(Ue).toLowerCase()!==String.fromCharCode(Ie).toLowerCase())return!1}return!0}function s(ee,ie){var be=ie.length;return ie.length>ee.length?!1:g(ee,ie,be)}function o(ee,ie){var be,Re=Math.min(ee.length,ie.length);for(be=0;be<Re;be++)if(ee.charCodeAt(be)!==ie.charCodeAt(be))return be;return Re}function r(ee,ie){var be,Re=Math.min(ee.length,ie.length),Ue=ee.length-1,Ie=ie.length-1;for(be=0;be<Re;be++)if(ee.charCodeAt(Ue-be)!==ie.charCodeAt(Ie-be))return be;return Re}function t(ee){return 55296<=ee&&ee<=56319}function T(ee){return 56320<=ee&&ee<=57343}function x(ee,ie,be){var Re=ee.charCodeAt(be);if(t(Re)&&be+1<ie){var Ue=ee.charCodeAt(be+1);if(T(Ue))return(Re-55296<<10)+(Ue-56320)+65536}return Re}function A(ee,ie){var be=ee.charCodeAt(ie-1);if(T(be)&&ie>1){var Re=ee.charCodeAt(ie-2);if(t(Re))return(Re-55296<<10)+(be-56320)+65536}return be}function R(ee,ie){var be=Qe.getInstance(),Re=ie,Ue=ee.length,Ie=x(ee,Ue,ie);ie+=Ie>=65536?2:1;for(var He=be.getGraphemeBreakType(Ie);ie<Ue;){var Ge=x(ee,Ue,ie),ct=be.getGraphemeBreakType(Ge);if(it(He,ct))break;ie+=Ge>=65536?2:1,He=ct}return ie-Re}function I(ee,ie){var be=Qe.getInstance(),Re=ie,Ue=A(ee,ie);ie-=Ue>=65536?2:1;for(var Ie=be.getGraphemeBreakType(Ue);ie>0;){var He=A(ee,ie),Ge=be.getGraphemeBreakType(He);if(it(Ge,Ie))break;ie-=He>=65536?2:1,Ie=Ge}return Re-ie}var B=/(?:[\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 W(ee){return B.test(ee)}var $=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDE73\uDE78-\uDE82\uDE90-\uDE95])/;function X(ee){return $.test(ee)}var V=/^[\t\n\r\x20-\x7E]*$/;function se(ee){return V.test(ee)}function xe(ee){for(var ie=0,be=ee.length;ie<be;ie++)if(Ee(ee.charCodeAt(ie)))return!0;return!1}function Ee(ee){return ee=+ee,ee>=11904&&ee<=55215||ee>=63744&&ee<=64255||ee>=65281&&ee<=65374}function je(ee){return ee>=127462&&ee<=127487||ee>=9728&&ee<=10175||ee>=127744&&ee<=128591||ee>=128640&&ee<=128764||ee>=128992&&ee<=129003||ee>=129280&&ee<=129535||ee>=129648&&ee<=129651||ee>=129656&&ee<=129666||ee>=129680&&ee<=129685}var Ae=String.fromCharCode(65279);function Oe(ee){return!!(ee&&ee.length>0&&ee.charCodeAt(0)===65279)}function Le(ee){return btoa(encodeURIComponent(ee))}function Pe(ee,ie){for(var be="",Re=0;Re<ie;Re++)be+=ee;return be}function he(ee,ie){return ie===void 0&&(ie=!1),ee?(ie&&(ee=ee.replace(/\\./g,"")),ee.toLowerCase()!==ee):!1}function Q(ee){var ie=90-65+1;return ee=ee%(2*ie),ee<ie?String.fromCharCode(97+ee):String.fromCharCode(65+ee-ie)}function Ke(ee){var ie=Qe.getInstance();return ie.getGraphemeBreakType(ee)}function it(ee,ie){return ee===0?ie!==5&&ie!==7:ee===2&&ie===3?!1:ee===4||ee===2||ee===3||(ie===4||ie===2||ie===3)?!0:ee===8&&(ie===8||ie===9||ie===11||ie===12)||((ee===11||ee===9)&&(ie===9||ie===10)||((ee===12||ee===10)&&ie===10||(ie===5||ie===13||(ie===7||(ee===1||ee===13&&ie===14)))))?!1:!(ee===6&&ie===6)}var Qe=function(){function ee(){this._data=Xe()}return ee.getInstance=function(){return ee._INSTANCE||(ee._INSTANCE=new ee),ee._INSTANCE},ee.prototype.getGraphemeBreakType=function(ie){if(ie<32)return ie===10?3:ie===13?2:4;if(ie<127)return 0;for(var be=this._data,Re=be.length/3,Ue=1;Ue<=Re;)if(ie<be[3*Ue])Ue=2*Ue;else if(ie>be[3*Ue+1])Ue=2*Ue+1;else return be[3*Ue+2];return 0},ee._INSTANCE=null,ee}();function Xe(){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]")}},NvD2:function(ot,fe,U){"use strict";U.d(fe,"a",function(){return S});var Z=U("Kwbf");function N(j,M){var O=new Set;return j.forEach(function(w){M.has(w)||O.add(w)}),O}function _(j){var M=j||{},O=M.disabled,w=M.disableCheckbox,c=M.checkable;return!!(O||w)||c===!1}function k(j,M,O,w){for(var c=new Set(j),y=new Set,C=0;C<=O;C+=1){var m=M.get(C)||new Set;m.forEach(function(e){var n=e.key,i=e.node,h=e.children,d=h===void 0?[]:h;c.has(n)&&!w(i)&&d.filter(function(u){return!w(u.node)}).forEach(function(u){c.add(u.key)})})}for(var f=new Set,v=O;v>=0;v-=1){var a=M.get(v)||new Set;a.forEach(function(e){var n=e.parent,i=e.node;if(w(i)||!e.parent||f.has(e.parent.key))return;if(w(e.parent.node)){f.add(n.key);return}var h=!0,d=!1;(n.children||[]).filter(function(u){return!w(u.node)}).forEach(function(u){var E=u.key,g=c.has(E);h&&!g&&(h=!1),!d&&(g||y.has(E))&&(d=!0)}),h&&c.add(n.key),d&&y.add(n.key),f.add(n.key)})}return{checkedKeys:Array.from(c),halfCheckedKeys:Array.from(N(y,c))}}function b(j,M,O,w,c){for(var y=new Set(j),C=new Set(M),m=0;m<=w;m+=1){var f=O.get(m)||new Set;f.forEach(function(n){var i=n.key,h=n.node,d=n.children,u=d===void 0?[]:d;!y.has(i)&&!C.has(i)&&!c(h)&&u.filter(function(E){return!c(E.node)}).forEach(function(E){y.delete(E.key)})})}C=new Set;for(var v=new Set,a=w;a>=0;a-=1){var e=O.get(a)||new Set;e.forEach(function(n){var i=n.parent,h=n.node;if(c(h)||!n.parent||v.has(n.parent.key))return;if(c(n.parent.node)){v.add(i.key);return}var d=!0,u=!1;(i.children||[]).filter(function(E){return!c(E.node)}).forEach(function(E){var g=E.key,s=y.has(g);d&&!s&&(d=!1),!u&&(s||C.has(g))&&(u=!0)}),d||y.delete(i.key),u&&C.add(i.key),v.add(i.key)})}return{checkedKeys:Array.from(y),halfCheckedKeys:Array.from(N(C,y))}}function S(j,M,O,w){var c=[],y;w?y=w:y=_;var C=new Set(j.filter(function(a){var e=!!O[a];return e||c.push(a),e})),m=new Map,f=0;Object.keys(O).forEach(function(a){var e=O[a],n=e.level,i=m.get(n);i||(i=new Set,m.set(n,i)),i.add(e),f=Math.max(f,n)}),Object(Z.a)(!c.length,"Tree missing follow keys: ".concat(c.slice(0,100).map(function(a){return"'".concat(a,"'")}).join(", ")));var v;return M===!0?v=k(C,m,f,y):v=b(C,M.halfCheckedKeys,m,f,y),v}},OZM5:function(ot,fe,U){"use strict";U.d(fe,"b",function(){return w}),U.d(fe,"a",function(){return c}),U.d(fe,"k",function(){return y}),U.d(fe,"h",function(){return C}),U.d(fe,"i",function(){return m}),U.d(fe,"g",function(){return f}),U.d(fe,"c",function(){return v}),U.d(fe,"d",function(){return a}),U.d(fe,"j",function(){return i}),U.d(fe,"e",function(){return h}),U.d(fe,"f",function(){return d});var Z=U("KQm4"),N=U("U8pU"),_=U("Ff2n"),k=U("q1tI"),b=U.n(k),S=U("Kwbf"),j=U("WaYH"),M=.25,O=2;function w(u,E){var g=u.slice(),s=g.indexOf(E);return s>=0&&g.splice(s,1),g}function c(u,E){var g=u.slice();return g.indexOf(E)===-1&&g.push(E),g}function y(u){return u.split("-")}function C(u,E){return"".concat(u,"-").concat(E)}function m(u){return u&&u.type&&u.type.isTreeNode}function f(u,E){var g=[u],s=E[u];function o(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];r.forEach(function(t){var T=t.key,x=t.children;g.push(T),o(x)})}return o(s.children),g}function v(u,E){var g=u.clientY,s=E.selectHandle.getBoundingClientRect(),o=s.top,r=s.bottom,t=s.height,T=Math.max(t*M,O);return g<=o+T?-1:g>=r-T?1:0}function a(u,E){if(!u)return;var g=E.multiple;return g?u.slice():u.length?[u[0]]:u}var e=function(E){return E};function n(u,E){if(!u)return[];var g=E||{},s=g.processProps,o=s===void 0?e:s,r=Array.isArray(u)?u:[u];return r.map(function(t){var T=t.children,x=Object(_.a)(t,["children"]),A=n(T,E);return b.a.createElement(j.a,Object.assign({},o(x)),A)})}function i(u){if(!u)return null;var E;if(Array.isArray(u))E={checkedKeys:u,halfCheckedKeys:void 0};else if(Object(N.a)(u)==="object")E={checkedKeys:u.checked||void 0,halfCheckedKeys:u.halfChecked||void 0};else return Object(S.a)(!1,"`checkedKeys` is not an array or an object"),null;return E}function h(u,E){var g=new Set;function s(o){if(g.has(o))return;var r=E[o];if(!r)return;g.add(o);var t=r.parent,T=r.node;if(T.disabled)return;t&&s(t.key)}return(u||[]).forEach(function(o){s(o)}),Object(Z.a)(g)}function d(u){var E={};return Object.keys(u).forEach(function(g){(g.startsWith("data-")||g.startsWith("aria-"))&&(E[g]=u[g])}),E}},QDVR:function(ot,fe,U){"use strict";U.d(fe,"e",function(){return N}),U.d(fe,"d",function(){return _}),U.d(fe,"c",function(){return j}),U.d(fe,"b",function(){return M}),U.d(fe,"a",function(){return w});var Z=function(){var c=function(y,C){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,f){m.__proto__=f}||function(m,f){for(var v in f)f.hasOwnProperty(v)&&(m[v]=f[v])},c(y,C)};return function(y,C){c(y,C);function m(){this.constructor=y}y.prototype=C===null?Object.create(C):(m.prototype=C.prototype,new m)}}();function N(c){var y=[];return c.forEach(function(C){return y.push(C)}),y}function _(c){var y=[];return c.forEach(function(C,m){return y.push(m)}),y}var k=function(){function c(){this._value="",this._pos=0}return c.prototype.reset=function(y){return this._value=y,this._pos=0,this},c.prototype.next=function(){return this._pos+=1,this},c.prototype.hasNext=function(){return this._pos<this._value.length-1},c.prototype.cmp=function(y){var C=y.charCodeAt(0),m=this._value.charCodeAt(this._pos);return C-m},c.prototype.value=function(){return this._value[this._pos]},c}(),b=function(){function c(y){y===void 0&&(y=!0),this._splitOnBackslash=y}return c.prototype.reset=function(y){return this._value=y.replace(/\\$|\/$/,""),this._from=0,this._to=0,this.next()},c.prototype.hasNext=function(){return this._to<this._value.length},c.prototype.next=function(){this._from=this._to;for(var y=!0;this._to<this._value.length;this._to++){var C=this._value.charCodeAt(this._to);if(C===47||this._splitOnBackslash&&C===92)if(y)this._from++;else break;else y=!1}return this},c.prototype.cmp=function(y){for(var C=0,m=y.length,f=this._from;C<m&&f<this._to;){var v=y.charCodeAt(C)-this._value.charCodeAt(f);if(v!==0)return v;C+=1,f+=1}return m===this._to-this._from?0:C<m?-1:1},c.prototype.value=function(){return this._value.substring(this._from,this._to)},c}(),S=function(){function c(){}return c}(),j=function(){function c(y){this._iter=y}return c.forPaths=function(){return new c(new b)},c.forStrings=function(){return new c(new k)},c.prototype.clear=function(){this._root=void 0},c.prototype.set=function(y,C){var m=this._iter.reset(y),f;for(this._root||(this._root=new S,this._root.segment=m.value()),f=this._root;;){var v=m.cmp(f.segment);if(v>0)f.left||(f.left=new S,f.left.segment=m.value()),f=f.left;else if(v<0)f.right||(f.right=new S,f.right.segment=m.value()),f=f.right;else if(m.hasNext())m.next(),f.mid||(f.mid=new S,f.mid.segment=m.value()),f=f.mid;else break}var a=f.value;return f.value=C,f.key=y,a},c.prototype.get=function(y){for(var C=this._iter.reset(y),m=this._root;m;){var f=C.cmp(m.segment);if(f>0)m=m.left;else if(f<0)m=m.right;else if(C.hasNext())C.next(),m=m.mid;else break}return m?m.value:void 0},c.prototype.findSubstr=function(y){for(var C=this._iter.reset(y),m=this._root,f=void 0;m;){var v=C.cmp(m.segment);if(v>0)m=m.left;else if(v<0)m=m.right;else if(C.hasNext())C.next(),f=m.value||f,m=m.mid;else break}return m&&m.value||f},c.prototype.forEach=function(y){this._forEach(this._root,y)},c.prototype._forEach=function(y,C){y&&(this._forEach(y.left,C),y.value&&C(y.value,y.key),this._forEach(y.mid,C),this._forEach(y.right,C))},c}(),M=function(){function c(){this.map=new Map,this.ignoreCase=!1}return c.prototype.set=function(y,C){this.map.set(this.toKey(y),C)},c.prototype.get=function(y){return this.map.get(this.toKey(y))},c.prototype.toKey=function(y){var C=y.toString();return this.ignoreCase&&(C=C.toLowerCase()),C},c}(),O=function(){function c(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}return c.prototype.clear=function(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0},Object.defineProperty(c.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),c.prototype.get=function(y,C){C===void 0&&(C=0);var m=this._map.get(y);return m?(C!==0&&this.touch(m,C),m.value):void 0},c.prototype.set=function(y,C,m){m===void 0&&(m=0);var f=this._map.get(y);if(f)f.value=C,m!==0&&this.touch(f,m);else{f={key:y,value:C,next:void 0,previous:void 0};switch(m){case 0:this.addItemLast(f);break;case 1:this.addItemFirst(f);break;case 2:this.addItemLast(f);break;default:this.addItemLast(f);break}this._map.set(y,f),this._size++}},c.prototype.delete=function(y){return!!this.remove(y)},c.prototype.remove=function(y){var C=this._map.get(y);return C?(this._map.delete(y),this.removeItem(C),this._size--,C.value):void 0},c.prototype.forEach=function(y,C){for(var m=this._head;m;)C?y.bind(C)(m.value,m.key,this):y(m.value,m.key,this),m=m.next},c.prototype.trimOld=function(y){if(y>=this.size)return;if(y===0){this.clear();return}for(var C=this._head,m=this.size;C&&m>y;)this._map.delete(C.key),C=C.next,m--;this._head=C,this._size=m,C&&(C.previous=void 0)},c.prototype.addItemFirst=function(y){if(!this._head&&!this._tail)this._tail=y;else if(this._head)y.next=this._head,this._head.previous=y;else throw new Error("Invalid list");this._head=y},c.prototype.addItemLast=function(y){if(!this._head&&!this._tail)this._head=y;else if(this._tail)y.previous=this._tail,this._tail.next=y;else throw new Error("Invalid list");this._tail=y},c.prototype.removeItem=function(y){if(y===this._head&&y===this._tail)this._head=void 0,this._tail=void 0;else if(y===this._head){if(!y.next)throw new Error("Invalid list");y.next.previous=void 0,this._head=y.next}else if(y===this._tail){if(!y.previous)throw new Error("Invalid list");y.previous.next=void 0,this._tail=y.previous}else{var C=y.next,m=y.previous;if(!C||!m)throw new Error("Invalid list");C.previous=m,m.next=C}y.next=void 0,y.previous=void 0},c.prototype.touch=function(y,C){if(!this._head||!this._tail)throw new Error("Invalid list");if(C!==1&&C!==2)return;if(C===1){if(y===this._head)return;var m=y.next,f=y.previous;y===this._tail?(f.next=void 0,this._tail=f):(m.previous=f,f.next=m),y.previous=void 0,y.next=this._head,this._head.previous=y,this._head=y}else if(C===2){if(y===this._tail)return;var m=y.next,f=y.previous;y===this._head?(m.previous=void 0,this._head=m):(m.previous=f,f.next=m),y.next=void 0,y.previous=this._tail,this._tail.next=y,this._tail=y}},c.prototype.toJSON=function(){var y=[];return this.forEach(function(C,m){y.push([m,C])}),y},c}(),w=function(c){Z(y,c);function y(C,m){m===void 0&&(m=1);var f=c.call(this)||this;return f._limit=C,f._ratio=Math.min(Math.max(0,m),1),f}return y.prototype.get=function(C){return c.prototype.get.call(this,C,2)},y.prototype.peek=function(C){return c.prototype.get.call(this,C,0)},y.prototype.set=function(C,m){c.prototype.set.call(this,C,m,2),this.checkTrim()},y.prototype.checkTrim=function(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))},y}(O)},"SA+Z":function(ot,fe,U){var Z=U("wTVA"),N=U("EbDI"),_=U("ZhPi"),k=U("wkBT");function b(S){return Z(S)||N(S)||_(S)||k()}ot.exports=b,ot.exports.__esModule=!0,ot.exports.default=ot.exports},SJMd:function(ot,fe){/**
* @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 U,Z,N,_=!1,k,b;window.PR_SHOULD_USE_CONTINUATION=!0;var S,j;(function(){var M=window,O=["break,continue,do,else,for,if,return,while"],w=[O,"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"],c=[w,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],y=[c,"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"],C=[c,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],m=[c,"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"],f="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",v=[c,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],a="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",e=[O,"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"],n=[O,"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"],i=[O,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],h=[y,m,C,v,a,e,n,i],d=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,u="str",E="kwd",g="com",s="typ",o="lit",r="pun",t="pln",T="tag",x="dec",A="src",R="atn",I="atv",B="nocode",W="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function $(ie){for(var be=0,Re=!1,Ue=!1,Ie=0,He=ie.length;Ie<He;++Ie){var Ge=ie[Ie];if(Ge.ignoreCase)Ue=!0;else if(/[a-z]/i.test(Ge.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Re=!0,Ue=!1;break}}var ct={b:8,t:9,n:10,v:11,f:12,r:13};function rt(me){var Ce=me.charCodeAt(0);if(Ce!==92)return Ce;var _e=me.charAt(1);return Ce=ct[_e],Ce||("0"<=_e&&_e<="7"?parseInt(me.substring(1),8):_e==="u"||_e==="x"?parseInt(me.substring(2),16):me.charCodeAt(1))}function st(me){if(me<32)return(me<16?"\\x0":"\\x")+me.toString(16);var Ce=String.fromCharCode(me);return Ce==="\\"||Ce==="-"||Ce==="]"||Ce==="^"?"\\"+Ce:Ce}function Ze(me){var Ce=me.substring(1,me.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")),_e=[],Fe=Ce[0]==="^",Se=["["];Fe&&Se.push("^");for(var Me=Fe?1:0,ue=Ce.length;Me<ue;++Me){var te=Ce[Me];if(/\\[bdsw]/i.test(te))Se.push(te);else{var re=rt(te),z;Me+2<ue&&Ce[Me+1]==="-"?(z=rt(Ce[Me+2]),Me+=2):z=re,_e.push([re,z]),z<65||re>122||(z<65||re>90||_e.push([Math.max(65,re)|32,Math.min(z,90)|32]),z<97||re>122||_e.push([Math.max(97,re)&~32,Math.min(z,122)&~32]))}}_e.sort(function(ve,we){return ve[0]-we[0]||we[1]-ve[1]});for(var G=[],J=[],Me=0;Me<_e.length;++Me){var ne=_e[Me];ne[0]<=J[1]+1?J[1]=Math.max(J[1],ne[1]):G.push(J=ne)}for(var Me=0;Me<G.length;++Me){var ne=G[Me];Se.push(st(ne[0])),ne[1]>ne[0]&&(ne[1]+1>ne[0]&&Se.push("-"),Se.push(st(ne[1])))}return Se.push("]"),Se.join("")}function mt(me){for(var Ce=me.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")),_e=Ce.length,Fe=[],Se=0,Me=0;Se<_e;++Se){var ue=Ce[Se];if(ue==="(")++Me;else if(ue.charAt(0)==="\\"){var te=+ue.substring(1);te&&(te<=Me?Fe[te]=-1:Ce[Se]=st(te))}}for(var Se=1;Se<Fe.length;++Se)Fe[Se]===-1&&(Fe[Se]=++be);for(var Se=0,Me=0;Se<_e;++Se){var ue=Ce[Se];if(ue==="(")++Me,Fe[Me]||(Ce[Se]="(?:");else if(ue.charAt(0)==="\\"){var te=+ue.substring(1);te&&te<=Me&&(Ce[Se]="\\"+Fe[te])}}for(var Se=0;Se<_e;++Se)Ce[Se]==="^"&&Ce[Se+1]!=="^"&&(Ce[Se]="");if(me.ignoreCase&&Re)for(var Se=0;Se<_e;++Se){var ue=Ce[Se],re=ue.charAt(0);ue.length>=2&&re==="["?Ce[Se]=Ze(ue):re!=="\\"&&(Ce[Se]=ue.replace(/[a-zA-Z]/g,function(J){var ne=J.charCodeAt(0);return"["+String.fromCharCode(ne&~32,ne|32)+"]"}))}return Ce.join("")}for(var ht=[],Ie=0,He=ie.length;Ie<He;++Ie){var Ge=ie[Ie];if(Ge.global||Ge.multiline)throw new Error(""+Ge);ht.push("(?:"+mt(Ge)+")")}return new RegExp(ht.join("|"),Ue?"gi":"g")}function X(ie,be){var Re=/(?:^|\s)nocode(?:\s|$)/,Ue=[],Ie=0,He=[],Ge=0;function ct(rt){var st=rt.nodeType;if(st==1){if(Re.test(rt.className))return;for(var Ze=rt.firstChild;Ze;Ze=Ze.nextSibling)ct(Ze);var mt=rt.nodeName.toLowerCase();(mt==="br"||mt==="li")&&(Ue[Ge]=`
`,He[Ge<<1]=Ie++,He[Ge++<<1|1]=rt)}else if(st==3||st==4){var ht=rt.nodeValue;ht.length&&(be?ht=ht.replace(/\r\n?/g,`
`):ht=ht.replace(/[ \t\r\n]+/g," "),Ue[Ge]=ht,He[Ge<<1]=Ie,Ie+=ht.length,He[Ge++<<1|1]=rt)}}return ct(ie),{sourceCode:Ue.join("").replace(/\n$/,""),spans:He}}function V(ie,be,Re,Ue,Ie){if(!Re)return;var He={sourceNode:ie,pre:1,langExtension:null,numberLines:null,sourceCode:Re,spans:null,basePos:be,decorations:null};Ue(He),Ie.push.apply(Ie,He.decorations)}var se=/\S/;function xe(ie){for(var be=void 0,Re=ie.firstChild;Re;Re=Re.nextSibling){var Ue=Re.nodeType;be=Ue===1?be?ie:Re:Ue===3&&se.test(Re.nodeValue)?ie:be}return be===ie?void 0:be}function Ee(ie,be){var Re={},Ue;(function(){for(var Ge=ie.concat(be),ct=[],rt={},st=0,Ze=Ge.length;st<Ze;++st){var mt=Ge[st],ht=mt[3];if(ht)for(var me=ht.length;--me>=0;)Re[ht.charAt(me)]=mt;var Ce=mt[1],_e=""+Ce;rt.hasOwnProperty(_e)||(ct.push(Ce),rt[_e]=null)}ct.push(/[\0-\uffff]/),Ue=$(ct)})();var Ie=be.length,He=function(Ge){for(var ct=Ge.sourceCode,rt=Ge.basePos,st=Ge.sourceNode,Ze=[rt,t],mt=0,ht=ct.match(Ue)||[],me={},Ce=0,_e=ht.length;Ce<_e;++Ce){var Fe=ht[Ce],Se=me[Fe],Me=void 0,ue;if(typeof Se=="string")ue=!1;else{var te=Re[Fe.charAt(0)];if(te)Me=Fe.match(te[1]),Se=te[0];else{for(var re=0;re<Ie;++re)if(te=be[re],Me=Fe.match(te[1]),Me){Se=te[0];break}Me||(Se=t)}ue=Se.length>=5&&Se.substring(0,5)==="lang-",ue&&!(Me&&typeof Me[1]=="string")&&(ue=!1,Se=A),ue||(me[Fe]=Se)}var z=mt;if(mt+=Fe.length,!ue)Ze.push(rt+z,Se);else{var G=Me[1],J=Fe.indexOf(G),ne=J+G.length;Me[2]&&(ne=Fe.length-Me[2].length,J=ne-G.length);var ve=Se.substring(5);V(st,rt+z,Fe.substring(0,J),He,Ze),V(st,rt+z+J,G,Q(ve,G),Ze),V(st,rt+z+ne,Fe.substring(ne),He,Ze)}}Ge.decorations=Ze};return He}function je(ie){var be=[],Re=[];ie.tripleQuotedStrings?be.push([u,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ie.multiLineStrings?be.push([u,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):be.push([u,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ie.verbatimStrings&&Re.push([u,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ue=ie.hashComments;Ue&&(ie.cStyleComments?(Ue>1?be.push([g,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):be.push([g,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Re.push([u,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):be.push([g,/^#[^\r\n]*/,null,"#"])),ie.cStyleComments&&(Re.push([g,/^\/\/[^\r\n]*/,null]),Re.push([g,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ie=ie.regexLiterals;if(Ie){var He=Ie>1?"":`
\r`,Ge=He?".":"[\\S\\s]",ct="/(?=[^/*"+He+"])(?:[^/\\x5B\\x5C"+He+"]|\\x5C"+Ge+"|\\x5B(?:[^\\x5C\\x5D"+He+"]|\\x5C"+Ge+")*(?:\\x5D|$))+/";Re.push(["lang-regex",RegExp("^"+W+"("+ct+")")])}var rt=ie.types;rt&&Re.push([s,rt]);var st=(""+ie.keywords).replace(/^ | $/g,"");st.length&&Re.push([E,new RegExp("^(?:"+st.replace(/[\s,]+/g,"|")+")\\b"),null]),be.push([t,/^\s+/,null,` \r
\xA0`]);var Ze="^.[^\\s\\w.$@'\"`/\\\\]*";return ie.regexLiterals&&(Ze+="(?!s*/)"),Re.push([o,/^@[a-z_$][a-z_$@0-9]*/i,null],[s,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[t,/^[a-z_$][a-z_$@0-9]*/i,null],[o,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[t,/^\\[\s\S]?/,null],[r,new RegExp(Ze),null]),Ee(be,Re)}var Ae=je({keywords:h,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Oe(ie,be,Re){for(var Ue=/(?:^|\s)nocode(?:\s|$)/,Ie=/\r\n?|\n/,He=ie.ownerDocument,Ge=He.createElement("li");ie.firstChild;)Ge.appendChild(ie.firstChild);var ct=[Ge];function rt(Ce){var _e=Ce.nodeType;if(_e==1&&!Ue.test(Ce.className))if(Ce.nodeName==="br")st(Ce),Ce.parentNode&&Ce.parentNode.removeChild(Ce);else for(var Fe=Ce.firstChild;Fe;Fe=Fe.nextSibling)rt(Fe);else if((_e==3||_e==4)&&Re){var Se=Ce.nodeValue,Me=Se.match(Ie);if(Me){var ue=Se.substring(0,Me.index);Ce.nodeValue=ue;var te=Se.substring(Me.index+Me[0].length);if(te){var re=Ce.parentNode;re.insertBefore(He.createTextNode(te),Ce.nextSibling)}st(Ce),ue||Ce.parentNode.removeChild(Ce)}}}function st(Ce){for(;!Ce.nextSibling;)if(Ce=Ce.parentNode,!Ce)return;function _e(Me,ue){var te=ue?Me.cloneNode(!1):Me,re=Me.parentNode;if(re){var z=_e(re,1),G=Me.nextSibling;z.appendChild(te);for(var J=G;J;J=G)G=J.nextSibling,z.appendChild(J)}return te}for(var Fe=_e(Ce.nextSibling,0),Se;(Se=Fe.parentNode)&&Se.nodeType===1;)Fe=Se;ct.push(Fe)}for(var Ze=0;Ze<ct.length;++Ze)rt(ct[Ze]);be===(be|0)&&ct[0].setAttribute("value",be);var mt=He.createElement("ol");mt.className="linenums";for(var ht=Math.max(0,be-1|0)||0,Ze=0,me=ct.length;Ze<me;++Ze)Ge=ct[Ze],Ge.className="L"+(Ze+ht)%10,Ge.firstChild||Ge.appendChild(He.createTextNode("\xA0")),mt.appendChild(Ge);ie.appendChild(mt)}function Le(ie){var be=/\bMSIE\s(\d+)/.exec(navigator.userAgent);be=be&&+be[1]<=8;var Re=/\n/g,Ue=ie.sourceCode,Ie=Ue.length,He=0,Ge=ie.spans,ct=Ge.length,rt=0,st=ie.decorations,Ze=st.length,mt=0;st[Ze]=Ie;var ht,me;for(me=ht=0;me<Ze;)st[me]!==st[me+2]?(st[ht++]=st[me++],st[ht++]=st[me++]):me+=2;for(Ze=ht,me=ht=0;me<Ze;){for(var Ce=st[me],_e=st[me+1],Fe=me+2;Fe+2<=Ze&&st[Fe+1]===_e;)Fe+=2;st[ht++]=Ce,st[ht++]=_e,me=Fe}Ze=st.length=ht;var Se=ie.sourceNode,Me="";Se&&(Me=Se.style.display,Se.style.display="none");try{for(var ue=null;rt<ct;){var te=Ge[rt],re=Ge[rt+2]||Ie,z=st[mt+2]||Ie,Fe=Math.min(re,z),G=Ge[rt+1],J;if(G.nodeType!==1&&(J=Ue.substring(He,Fe))){be&&(J=J.replace(Re,"\r")),G.nodeValue=J;var ne=G.ownerDocument,ve=ne.createElement("span");ve.className=st[mt+1];var we=G.parentNode;we.replaceChild(ve,G),ve.appendChild(G),He<re&&(Ge[rt+1]=G=ne.createTextNode(Ue.substring(Fe,re)),we.insertBefore(G,ve.nextSibling))}He=Fe,He>=re&&(rt+=2),He>=z&&(mt+=2)}}finally{Se&&(Se.style.display=Me)}}var Pe={};function he(ie,be){for(var Re=be.length;--Re>=0;){var Ue=be[Re];Pe.hasOwnProperty(Ue)?M.console&&console.warn("cannot override language handler %s",Ue):Pe[Ue]=ie}}function Q(ie,be){return ie&&Pe.hasOwnProperty(ie)||(ie=/^\s*</.test(be)?"default-markup":"default-code"),Pe[ie]}he(Ae,["default-code"]),he(Ee([],[[t,/^[^<?]+/],[x,/^<!\w[^>]*(?:>|$)/],[g,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[r,/^(?:<[%?]|[%?]>)/],["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"]),he(Ee([[t,/^[\s]+/,null,` \r
`],[I,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[T,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[r,/^[=<>\/]+/],["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"]),he(Ee([],[[I,/^[\s\S]+/]]),["uq.val"]),he(je({keywords:y,hashComments:!0,cStyleComments:!0,types:d}),["c","cc","cpp","cxx","cyc","m"]),he(je({keywords:"null,true,false"}),["json"]),he(je({keywords:m,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:d}),["cs"]),he(je({keywords:C,cStyleComments:!0}),["java"]),he(je({keywords:i,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),he(je({keywords:e,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),he(je({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),he(je({keywords:n,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),he(je({keywords:v,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),he(je({keywords:f,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),he(Ee([],[[u,/^[\s\S]+/]]),["regex"]);function Ke(ie){var be=ie.langExtension;try{var Re=X(ie.sourceNode,ie.pre),Ue=Re.sourceCode;ie.sourceCode=Ue,ie.spans=Re.spans,ie.basePos=0,Q(be,Ue)(ie),Le(ie)}catch(Ie){M.console&&console.log(Ie&&Ie.stack||Ie)}}function it(ie,be,Re){var Ue=Re||!1,Ie=be||null,He=document.createElement("div");He.innerHTML="<pre>"+ie+"</pre>",He=He.firstChild,Ue&&Oe(He,Ue,!0);var Ge={langExtension:Ie,numberLines:Ue,sourceNode:He,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Ke(Ge),He.innerHTML}function Qe(ie,be){var Re=be||document.body,Ue=Re.ownerDocument||document;function Ie(te){return Re.getElementsByTagName(te)}for(var He=[Ie("pre"),Ie("code"),Ie("xmp")],Ge=[],ct=0;ct<He.length;++ct)for(var rt=0,st=He[ct].length;rt<st;++rt)Ge.push(He[ct][rt]);He=null;var Ze=Date;Ze.now||(Ze={now:function(){return+new Date}});var mt=0,ht=/\blang(?:uage)?-([\w.]+)(?!\S)/,me=/\bprettyprint\b/,Ce=/\bprettyprinted\b/,_e=/pre|xmp/i,Fe=/^code$/i,Se=/^(?:pre|code|xmp)$/i,Me={};function ue(){for(var te=M.PR_SHOULD_USE_CONTINUATION?Ze.now()+250:Infinity;mt<Ge.length&&Ze.now()<te;mt++){for(var re=Ge[mt],z=Me,G=re;G=G.previousSibling;){var J=G.nodeType,ne=(J===7||J===8)&&G.nodeValue;if(ne?!/^\??prettify\b/.test(ne):J!==3||/\S/.test(G.nodeValue))break;if(ne){z={},ne.replace(/\b(\w+)=([\w:.%+-]+)/g,function(zt,xt,Bt){z[xt]=Bt});break}}var ve=re.className;if((z!==Me||me.test(ve))&&!Ce.test(ve)){for(var we=!1,ze=re.parentNode;ze;ze=ze.parentNode){var nt=ze.tagName;if(Se.test(nt)&&ze.className&&me.test(ze.className)){we=!0;break}}if(!we){re.className+=" prettyprinted";var ft=z.lang;if(!ft){ft=ve.match(ht);var tt;!ft&&(tt=xe(re))&&Fe.test(tt.tagName)&&(ft=tt.className.match(ht)),ft&&(ft=ft[1])}var Ct;if(_e.test(re.tagName))Ct=1;else{var _t=re.currentStyle,dt=Ue.defaultView,kt=_t?_t.whiteSpace:dt&&dt.getComputedStyle?dt.getComputedStyle(re,null).getPropertyValue("white-space"):0;Ct=kt&&kt.substring(0,3)==="pre"}var It=z.linenums;(It=It==="true"||+It)||(It=ve.match(/\blinenums\b(?::(\d+))?/),It=It?It[1]&&It[1].length?+It[1]:!0:!1),It&&Oe(re,It,Ct);var Dt={langExtension:ft,sourceNode:re,numberLines:It,pre:Ct,sourceCode:null,basePos:null,spans:null,decorations:null};Ke(Dt)}}}mt<Ge.length?M.setTimeout(ue,250):typeof ie=="function"&&ie()}ue()}var Xe=M.PR={createSimpleLexer:Ee,registerLangHandler:he,sourceDecorator:je,PR_ATTRIB_NAME:R,PR_ATTRIB_VALUE:I,PR_COMMENT:g,PR_DECLARATION:x,PR_KEYWORD:E,PR_LITERAL:o,PR_NOCODE:B,PR_PLAIN:t,PR_PUNCTUATION:r,PR_SOURCE:A,PR_STRING:u,PR_TAG:T,PR_TYPE:s,prettyPrintOne:_?M.prettyPrintOne=it:S=it,prettyPrint:j=_?M.prettyPrint=Qe:j=Qe},ee=M.define;typeof ee=="function"&&ee.amd&&ee("google-code-prettify",[],function(){return Xe})})()},T8No:function(ot,fe,U){"use strict";U.d(fe,"a",function(){return k}),U.d(fe,"b",function(){return C}),U.d(fe,"d",function(){return m}),U.d(fe,"c",function(){return f}),U.d(fe,"e",function(){return v});var Z=U("N0LK"),N=U("Cg/j"),_=function(){var a=function(e,n){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,h){i.__proto__=h}||function(i,h){for(var d in h)h.hasOwnProperty(d)&&(i[d]=h[d])},a(e,n)};return function(e,n){a(e,n);function i(){this.constructor=e}e.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),k=function(){function a(){}return a.has=function(e){return S.create(e)},a.equals=function(e,n){return j.create(e,n)},a.regex=function(e,n){return w.create(e,n)},a.not=function(e){return O.create(e)},a.and=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return y.create(e)},a.or=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return C.create(e)},a.deserialize=function(e,n){return n===void 0&&(n=!1),e?this._deserializeOrExpression(e,n):void 0},a._deserializeOrExpression=function(e,n){var i=this,h=e.split("||");return C.create(h.map(function(d){return i._deserializeAndExpression(d,n)}))},a._deserializeAndExpression=function(e,n){var i=this,h=e.split("&&");return y.create(h.map(function(d){return i._deserializeOne(d,n)}))},a._deserializeOne=function(e,n){if(e=e.trim(),e.indexOf("!=")>=0){var i=e.split("!=");return M.create(i[0].trim(),this._deserializeValue(i[1],n))}if(e.indexOf("==")>=0){var i=e.split("==");return j.create(i[0].trim(),this._deserializeValue(i[1],n))}if(e.indexOf("=~")>=0){var i=e.split("=~");return w.create(i[0].trim(),this._deserializeRegexValue(i[1],n))}return/^\!\s*/.test(e)?O.create(e.substr(1).trim()):S.create(e)},a._deserializeValue=function(e,n){if(e=e.trim(),e==="true")return!0;if(e==="false")return!1;var i=/^'([^']*)'$/.exec(e);return i?i[1].trim():e},a._deserializeRegexValue=function(e,n){if(Object(Z.x)(e)){if(n)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}var i=e.indexOf("/"),h=e.lastIndexOf("/");if(i===h||i<0){if(n)throw new Error("bad regexp-value '"+e+"', missing /-enclosure");return console.warn("bad regexp-value '"+e+"', missing /-enclosure"),null}var d=e.slice(i+1,h),u=e[h+1]==="i"?"i":"";try{return new RegExp(d,u)}catch(E){if(n)throw new Error("bad regexp-value '"+e+"', parse error: "+E);return console.warn("bad regexp-value '"+e+"', parse error: "+E),null}},a}();function b(a,e){var n=a.getType(),i=e.getType();if(n!==i)return n-i;switch(n){case 1:return a.cmp(e);case 2:return a.cmp(e);case 3:return a.cmp(e);case 4:return a.cmp(e);case 6:return a.cmp(e);case 7:return a.cmp(e);case 5:return a.cmp(e);default:throw new Error("Unknown ContextKeyExpr!")}}var S=function(){function a(e){this.key=e}return a.create=function(e){return new a(e)},a.prototype.getType=function(){return 1},a.prototype.cmp=function(e){return this.key<e.key?-1:this.key>e.key?1:0},a.prototype.equals=function(e){return e instanceof a?this.key===e.key:!1},a.prototype.evaluate=function(e){return!!e.getValue(this.key)},a.prototype.keys=function(){return[this.key]},a.prototype.negate=function(){return O.create(this.key)},a}(),j=function(){function a(e,n){this.key=e,this.value=n}return a.create=function(e,n){return typeof n=="boolean"?n?S.create(e):O.create(e):new a(e,n)},a.prototype.getType=function(){return 3},a.prototype.cmp=function(e){return this.key<e.key?-1:this.key>e.key?1:this.value<e.value?-1:this.value>e.value?1:0},a.prototype.equals=function(e){return e instanceof a?this.key===e.key&&this.value===e.value:!1},a.prototype.evaluate=function(e){return e.getValue(this.key)==this.value},a.prototype.keys=function(){return[this.key]},a.prototype.negate=function(){return M.create(this.key,this.value)},a}(),M=function(){function a(e,n){this.key=e,this.value=n}return a.create=function(e,n){return typeof n=="boolean"?n?O.create(e):S.create(e):new a(e,n)},a.prototype.getType=function(){return 4},a.prototype.cmp=function(e){return this.key<e.key?-1:this.key>e.key?1:this.value<e.value?-1:this.value>e.value?1:0},a.prototype.equals=function(e){return e instanceof a?this.key===e.key&&this.value===e.value:!1},a.prototype.evaluate=function(e){return e.getValue(this.key)!=this.value},a.prototype.keys=function(){return[this.key]},a.prototype.negate=function(){return j.create(this.key,this.value)},a}(),O=function(){function a(e){this.key=e}return a.create=function(e){return new a(e)},a.prototype.getType=function(){return 2},a.prototype.cmp=function(e){return this.key<e.key?-1:this.key>e.key?1:0},a.prototype.equals=function(e){return e instanceof a?this.key===e.key:!1},a.prototype.evaluate=function(e){return!e.getValue(this.key)},a.prototype.keys=function(){return[this.key]},a.prototype.negate=function(){return S.create(this.key)},a}(),w=function(){function a(e,n){this.key=e,this.regexp=n}return a.create=function(e,n){return new a(e,n)},a.prototype.getType=function(){return 6},a.prototype.cmp=function(e){if(this.key<e.key)return-1;if(this.key>e.key)return 1;var n=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return n<i?-1:n>i?1:0},a.prototype.equals=function(e){if(e instanceof a){var n=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&n===i}return!1},a.prototype.evaluate=function(e){var n=e.getValue(this.key);return this.regexp?this.regexp.test(n):!1},a.prototype.keys=function(){return[this.key]},a.prototype.negate=function(){return c.create(this)},a}(),c=function(){function a(e){this._actual=e}return a.create=function(e){return new a(e)},a.prototype.getType=function(){return 7},a.prototype.cmp=function(e){return this._actual.cmp(e._actual)},a.prototype.equals=function(e){return e instanceof a?this._actual.equals(e._actual):!1},a.prototype.evaluate=function(e){return!this._actual.evaluate(e)},a.prototype.keys=function(){return this._actual.keys()},a.prototype.negate=function(){return this._actual},a}(),y=function(){function a(e){this.expr=e}return a.create=function(e){var n=a._normalizeArr(e);return n.length===0?void 0:n.length===1?n[0]:new a(n)},a.prototype.getType=function(){return 5},a.prototype.cmp=function(e){if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(var n=0,i=this.expr.length;n<i;n++){var h=b(this.expr[n],e.expr[n]);if(h!==0)return h}return 0},a.prototype.equals=function(e){if(e instanceof a){if(this.expr.length!==e.expr.length)return!1;for(var n=0,i=this.expr.length;n<i;n++)if(!this.expr[n].equals(e.expr[n]))return!1;return!0}return!1},a.prototype.evaluate=function(e){for(var n=0,i=this.expr.length;n<i;n++)if(!this.expr[n].evaluate(e))return!1;return!0},a._normalizeArr=function(e){var n=[];if(e){for(var i=0,h=e.length;i<h;i++){var d=e[i];if(!d)continue;if(d instanceof a){n=n.concat(d.expr);continue}if(d instanceof C)throw new Error('It is not allowed to have an or expression here due to lack of parens! For example "a && (b||c)" is not supported, use "(a&&b) || (a&&c)" instead.');n.push(d)}n.sort(b)}return n},a.prototype.keys=function(){for(var e=[],n=0,i=this.expr;n<i.length;n++){var h=i[n];e.push.apply(e,h.keys())}return e},a.prototype.negate=function(){for(var e=[],n=0,i=this.expr;n<i.length;n++){var h=i[n];e.push(h.negate())}return C.create(e)},a}(),C=function(){function a(e){this.expr=e}return a.create=function(e){var n=a._normalizeArr(e);return n.length===0?void 0:n.length===1?n[0]:new a(n)},a.prototype.getType=function(){return 8},a.prototype.equals=function(e){if(e instanceof a){if(this.expr.length!==e.expr.length)return!1;for(var n=0,i=this.expr.length;n<i;n++)if(!this.expr[n].equals(e.expr[n]))return!1;return!0}return!1},a.prototype.evaluate=function(e){for(var n=0,i=this.expr.length;n<i;n++)if(this.expr[n].evaluate(e))return!0;return!1},a._normalizeArr=function(e){var n=[];if(e){for(var i=0,h=e.length;i<h;i++){var d=e[i];if(!d)continue;if(d instanceof a){n=n.concat(d.expr);continue}n.push(d)}n.sort(b)}return n},a.prototype.keys=function(){for(var e=[],n=0,i=this.expr;n<i.length;n++){var h=i[n];e.push.apply(e,h.keys())}return e},a.prototype.negate=function(){for(var e=[],n=0,i=this.expr;n<i.length;n++){var h=i[n];e.push(h.negate())}for(var d=function(A){return A instanceof a?A.expr:[A]};e.length>1;){for(var u=e.shift(),E=e.shift(),g=[],s=0,o=d(u);s<o.length;s++)for(var r=o[s],t=0,T=d(E);t<T.length;t++){var x=T[t];g.push(k.and(r,x))}e.unshift(k.or.apply(k,g))}return e[0]},a}(),m=function(a){_(e,a);function e(n,i){var h=a.call(this,n)||this;return h._defaultValue=i,h}return e.prototype.bindTo=function(n){return n.createKey(this.key,this._defaultValue)},e.prototype.getValue=function(n){return n.getContextKeyValue(this.key)},e.prototype.toNegated=function(){return k.not(this.key)},e}(S),f=Object(N.c)("contextKeyService"),v="setContext"},WaYH:function(ot,fe,U){"use strict";var Z=U("rePB"),N=U("Ff2n"),_=U("VTBJ"),k=U("1OyB"),b=U("vuIU"),S=U("JX7q"),j=U("Ji7U"),M=U("LK+K"),O=U("q1tI"),w=U("TSYQ"),c=U.n(w),y=U("sboe"),C=U("OZM5"),m=function(E){var g=E.prefixCls,s=E.level,o=E.isStart,r=E.isEnd;if(!s)return null;for(var t="".concat(g,"-indent-unit"),T=[],x=0;x<s;x+=1){var A;T.push(O.createElement("span",{key:x,className:c()(t,(A={},Object(Z.a)(A,"".concat(t,"-start"),o[x+1]),Object(Z.a)(A,"".concat(t,"-end"),r[x+1]),Object(Z.a)(A,"".concat(t,"-end-first-level"),!x&&r[0]),A))}))}return O.createElement("span",{"aria-hidden":"true",className:"".concat(g,"-indent")},T)},f=m,v=U("815F"),a="open",e="close",n="---",i=function(u){Object(j.a)(g,u);var E=Object(M.a)(g);function g(){var s;return Object(k.a)(this,g),s=E.apply(this,arguments),s.state={dragNodeHighlight:!1},s.onSelectorClick=function(o){var r=s.props.context.onNodeClick;r(o,Object(v.b)(s.props)),s.isSelectable()?s.onSelect(o):s.onCheck(o)},s.onSelectorDoubleClick=function(o){var r=s.props.context.onNodeDoubleClick;r(o,Object(v.b)(s.props))},s.onSelect=function(o){if(s.isDisabled())return;var r=s.props.context.onNodeSelect;o.preventDefault(),r(o,Object(v.b)(s.props))},s.onCheck=function(o){if(s.isDisabled())return;var r=s.props,t=r.disableCheckbox,T=r.checked,x=s.props.context.onNodeCheck;if(!s.isCheckable()||t)return;o.preventDefault();var A=!T;x(o,Object(v.b)(s.props),A)},s.onMouseEnter=function(o){var r=s.props.context.onNodeMouseEnter;r(o,Object(v.b)(s.props))},s.onMouseLeave=function(o){var r=s.props.context.onNodeMouseLeave;r(o,Object(v.b)(s.props))},s.onContextMenu=function(o){var r=s.props.context.onNodeContextMenu;r(o,Object(v.b)(s.props))},s.onDragStart=function(o){var r=s.props.context.onNodeDragStart;o.stopPropagation(),s.setState({dragNodeHighlight:!0}),r(o,Object(S.a)(s));try{o.dataTransfer.setData("text/plain","")}catch(t){}},s.onDragEnter=function(o){var r=s.props.context.onNodeDragEnter;o.preventDefault(),o.stopPropagation(),r(o,Object(S.a)(s))},s.onDragOver=function(o){var r=s.props.context.onNodeDragOver;o.preventDefault(),o.stopPropagation(),r(o,Object(S.a)(s))},s.onDragLeave=function(o){var r=s.props.context.onNodeDragLeave;o.stopPropagation(),r(o,Object(S.a)(s))},s.onDragEnd=function(o){var r=s.props.context.onNodeDragEnd;o.stopPropagation(),s.setState({dragNodeHighlight:!1}),r(o,Object(S.a)(s))},s.onDrop=function(o){var r=s.props.context.onNodeDrop;o.preventDefault(),o.stopPropagation(),s.setState({dragNodeHighlight:!1}),r(o,Object(S.a)(s))},s.onExpand=function(o){var r=s.props.context.onNodeExpand;r(o,Object(v.b)(s.props))},s.setSelectHandle=function(o){s.selectHandle=o},s.getNodeState=function(){var o=s.props.expanded;return s.isLeaf()?null:o?a:e},s.hasChildren=function(){var o=s.props.eventKey,r=s.props.context.keyEntities,t=r[o]||{},T=t.children;return!!(T||[]).length},s.isLeaf=function(){var o=s.props,r=o.isLeaf,t=o.loaded,T=s.props.context.loadData,x=s.hasChildren();return r===!1?!1:r||!T&&!x||T&&t&&!x},s.isDisabled=function(){var o=s.props.disabled,r=s.props.context.disabled;return!!(r||o)},s.isCheckable=function(){var o=s.props.checkable,r=s.props.context.checkable;return!r||o===!1?!1:r},s.syncLoadData=function(o){var r=o.expanded,t=o.loading,T=o.loaded,x=s.props.context,A=x.loadData,R=x.onNodeLoad;if(t)return;A&&r&&!s.isLeaf()&&(!s.hasChildren()&&!T&&R(Object(v.b)(s.props)))},s.renderSwitcher=function(){var o=s.props,r=o.expanded,t=o.switcherIcon,T=s.props.context,x=T.prefixCls,A=T.switcherIcon,R=t||A;if(s.isLeaf())return O.createElement("span",{className:c()("".concat(x,"-switcher"),"".concat(x,"-switcher-noop"))},typeof R=="function"?R(Object(_.a)(Object(_.a)({},s.props),{},{isLeaf:!0})):R);var I=c()("".concat(x,"-switcher"),"".concat(x,"-switcher_").concat(r?a:e));return O.createElement("span",{onClick:s.onExpand,className:I},typeof R=="function"?R(Object(_.a)(Object(_.a)({},s.props),{},{isLeaf:!1})):R)},s.renderCheckbox=function(){var o=s.props,r=o.checked,t=o.halfChecked,T=o.disableCheckbox,x=s.props.context.prefixCls,A=s.isDisabled(),R=s.isCheckable();if(!R)return null;var I=typeof R!="boolean"?R:null;return O.createElement("span",{className:c()("".concat(x,"-checkbox"),r&&"".concat(x,"-checkbox-checked"),!r&&t&&"".concat(x,"-checkbox-indeterminate"),(A||T)&&"".concat(x,"-checkbox-disabled")),onClick:s.onCheck},I)},s.renderIcon=function(){var o=s.props.loading,r=s.props.context.prefixCls;return O.createElement("span",{className:c()("".concat(r,"-iconEle"),"".concat(r,"-icon__").concat(s.getNodeState()||"docu"),o&&"".concat(r,"-icon_loading"))})},s.renderSelector=function(){var o=s.state.dragNodeHighlight,r=s.props,t=r.title,T=r.selected,x=r.icon,A=r.loading,R=r.data,I=s.props.context,B=I.prefixCls,W=I.showIcon,$=I.icon,X=I.draggable,V=I.loadData,se=I.titleRender,xe=s.isDisabled(),Ee="".concat(B,"-node-content-wrapper"),je;if(W){var Ae=x||$;je=Ae?O.createElement("span",{className:c()("".concat(B,"-iconEle"),"".concat(B,"-icon__customize"))},typeof Ae=="function"?Ae(s.props):Ae):s.renderIcon()}else V&&A&&(je=s.renderIcon());var Oe;typeof t=="function"?Oe=t(R):se?Oe=se(R):Oe=t;var Le=O.createElement("span",{className:"".concat(B,"-title")},Oe);return O.createElement("span",{ref:s.setSelectHandle,title:typeof t=="string"?t:"",className:c()("".concat(Ee),"".concat(Ee,"-").concat(s.getNodeState()||"normal"),!xe&&(T||o)&&"".concat(B,"-node-selected"),!xe&&X&&"draggable"),draggable:!xe&&X||void 0,"aria-grabbed":!xe&&X||void 0,onMouseEnter:s.onMouseEnter,onMouseLeave:s.onMouseLeave,onContextMenu:s.onContextMenu,onClick:s.onSelectorClick,onDoubleClick:s.onSelectorDoubleClick,onDragStart:X?s.onDragStart:void 0},je,Le)},s}return Object(b.a)(g,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var o=this.props.selectable,r=this.props.context.selectable;return typeof o=="boolean"?o:r}},{key:"render",value:function(){var o,r=this.props,t=r.eventKey,T=r.className,x=r.style,A=r.dragOver,R=r.dragOverGapTop,I=r.dragOverGapBottom,B=r.isLeaf,W=r.isStart,$=r.isEnd,X=r.expanded,V=r.selected,se=r.checked,xe=r.halfChecked,Ee=r.loading,je=r.domRef,Ae=r.active,Oe=r.onMouseMove,Le=Object(N.a)(r,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Pe=this.props.context,he=Pe.prefixCls,Q=Pe.filterTreeNode,Ke=Pe.draggable,it=Pe.keyEntities,Qe=this.isDisabled(),Xe=Object(C.f)(Le),ee=it[t]||{},ie=ee.level,be=$[$.length-1];return O.createElement("div",Object.assign({ref:je,className:c()(T,"".concat(he,"-treenode"),(o={},Object(Z.a)(o,"".concat(he,"-treenode-disabled"),Qe),Object(Z.a)(o,"".concat(he,"-treenode-switcher-").concat(X?"open":"close"),!B),Object(Z.a)(o,"".concat(he,"-treenode-checkbox-checked"),se),Object(Z.a)(o,"".concat(he,"-treenode-checkbox-indeterminate"),xe),Object(Z.a)(o,"".concat(he,"-treenode-selected"),V),Object(Z.a)(o,"".concat(he,"-treenode-loading"),Ee),Object(Z.a)(o,"".concat(he,"-treenode-active"),Ae),Object(Z.a)(o,"".concat(he,"-treenode-leaf-last"),be),Object(Z.a)(o,"drag-over",!Qe&&A),Object(Z.a)(o,"drag-over-gap-top",!Qe&&R),Object(Z.a)(o,"drag-over-gap-bottom",!Qe&&I),Object(Z.a)(o,"filter-node",Q&&Q(Object(v.b)(this.props))),o)),style:x,onDragEnter:Ke?this.onDragEnter:void 0,onDragOver:Ke?this.onDragOver:void 0,onDragLeave:Ke?this.onDragLeave:void 0,onDrop:Ke?this.onDrop:void 0,onDragEnd:Ke?this.onDragEnd:void 0,onMouseMove:Oe},Xe),O.createElement(f,{prefixCls:he,level:ie,isStart:W,isEnd:$}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),g}(O.Component),h=function(E){return O.createElement(y.a.Consumer,null,function(g){return O.createElement(i,Object.assign({},E,{context:g}))})};h.displayName="TreeNode",h.defaultProps={title:n},h.isTreeNode=1;var d=fe.a=h},Y1PL:function(ot,fe,U){"use strict";U.r(fe),U.d(fe,"ResizableTextArea",function(){return xe});var Z=U("wx14"),N=U("1OyB"),_=U("vuIU"),k=U("Ji7U"),b=U("LK+K"),S=U("q1tI"),j=U("VTBJ"),M=U("rePB"),O=U("Zm9Q"),w=U("Kwbf"),c=U("c+Xe"),y=U("m+aA"),C=U("bdgK"),m=new Map;function f(Ae){Ae.forEach(function(Oe){var Le,Pe=Oe.target;(Le=m.get(Pe))===null||Le===void 0||Le.forEach(function(he){return he(Pe)})})}var v=new C.default(f),a=null,e=null;function n(Ae,Oe){m.has(Ae)||(m.set(Ae,new Set),v.observe(Ae)),m.get(Ae).add(Oe)}function i(Ae,Oe){m.has(Ae)&&(m.get(Ae).delete(Oe),m.get(Ae).size||(v.unobserve(Ae),m.delete(Ae)))}var h=function(Ae){Object(k.a)(Le,Ae);var Oe=Object(b.a)(Le);function Le(){return Object(N.a)(this,Le),Oe.apply(this,arguments)}return Object(_.a)(Le,[{key:"render",value:function(){return this.props.children}}]),Le}(S.Component),d=S.createContext(null);function u(Ae){var Oe=Ae.children,Le=Ae.onBatchResize,Pe=S.useRef(0),he=S.useRef([]),Q=S.useContext(d),Ke=S.useCallback(function(it,Qe,Xe){Pe.current+=1;var ee=Pe.current;he.current.push({size:it,element:Qe,data:Xe}),Promise.resolve().then(function(){ee===Pe.current&&(Le==null||Le(he.current),he.current=[])}),Q==null||Q(it,Qe,Xe)},[Le,Q]);return S.createElement(d.Provider,{value:Ke},Oe)}function E(Ae){var Oe=Ae.children,Le=Ae.disabled,Pe=S.useRef(null),he=S.useRef(null),Q=S.useContext(d),Ke=S.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),it=S.isValidElement(Oe)&&Object(c.c)(Oe),Qe=it?Oe.ref:null,Xe=S.useMemo(function(){return Object(c.a)(Qe,Pe)},[Qe,Pe]),ee=S.useRef(Ae);ee.current=Ae;var ie=S.useCallback(function(be){var Re=ee.current,Ue=Re.onResize,Ie=Re.data,He=be.getBoundingClientRect(),Ge=He.width,ct=He.height,rt=be.offsetWidth,st=be.offsetHeight,Ze=Math.floor(Ge),mt=Math.floor(ct);if(Ke.current.width!==Ze||Ke.current.height!==mt||Ke.current.offsetWidth!==rt||Ke.current.offsetHeight!==st){var ht={width:Ze,height:mt,offsetWidth:rt,offsetHeight:st};Ke.current=ht;var me=rt===Math.round(Ge)?Ge:rt,Ce=st===Math.round(ct)?ct:st,_e=Object(j.a)(Object(j.a)({},ht),{},{offsetWidth:me,offsetHeight:Ce});Q==null||Q(_e,be,Ie),Ue&&Promise.resolve().then(function(){Ue(_e,be)})}},[]);return S.useEffect(function(){var be=Object(y.a)(Pe.current)||Object(y.a)(he.current);return be&&!Le&&n(be,ie),function(){return i(be,ie)}},[Pe.current,Le]),S.createElement(h,{ref:he},it?S.cloneElement(Oe,{ref:Xe}):Oe)}var g="rc-observer-key";function s(Ae){var Oe=Ae.children,Le=Object(O.a)(Oe);return Le.map(function(Pe,he){var Q=(Pe==null?void 0:Pe.key)||"".concat(g,"-").concat(he);return S.createElement(E,Object(Z.a)({},Ae,{key:Q}),Pe)})}s.Collection=u;var o=s,r=U("bT9E"),t=U("TSYQ"),T=U.n(t),x=`
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
`,A=["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"],R={},I;function B(Ae){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Le=Ae.getAttribute("id")||Ae.getAttribute("data-reactid")||Ae.getAttribute("name");if(Oe&&R[Le])return R[Le];var Pe=window.getComputedStyle(Ae),he=Pe.getPropertyValue("box-sizing")||Pe.getPropertyValue("-moz-box-sizing")||Pe.getPropertyValue("-webkit-box-sizing"),Q=parseFloat(Pe.getPropertyValue("padding-bottom"))+parseFloat(Pe.getPropertyValue("padding-top")),Ke=parseFloat(Pe.getPropertyValue("border-bottom-width"))+parseFloat(Pe.getPropertyValue("border-top-width")),it=A.map(function(Xe){return"".concat(Xe,":").concat(Pe.getPropertyValue(Xe))}).join(";"),Qe={sizingStyle:it,paddingSize:Q,borderSize:Ke,boxSizing:he};return Oe&&Le&&(R[Le]=Qe),Qe}function W(Ae){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Pe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;I||(I=document.createElement("textarea"),I.setAttribute("tab-index","-1"),I.setAttribute("aria-hidden","true"),document.body.appendChild(I)),Ae.getAttribute("wrap")?I.setAttribute("wrap",Ae.getAttribute("wrap")):I.removeAttribute("wrap");var he=B(Ae,Oe),Q=he.paddingSize,Ke=he.borderSize,it=he.boxSizing,Qe=he.sizingStyle;I.setAttribute("style","".concat(Qe,";").concat(x)),I.value=Ae.value||Ae.placeholder||"";var Xe=Number.MIN_SAFE_INTEGER,ee=Number.MAX_SAFE_INTEGER,ie=I.scrollHeight,be;if(it==="border-box"?ie+=Ke:it==="content-box"&&(ie-=Q),Le!==null||Pe!==null){I.value=" ";var Re=I.scrollHeight-Q;Le!==null&&(Xe=Re*Le,it==="border-box"&&(Xe=Xe+Q+Ke),ie=Math.max(Xe,ie)),Pe!==null&&(ee=Re*Pe,it==="border-box"&&(ee=ee+Q+Ke),be=ie>ee?"":"hidden",ie=Math.min(ee,ie))}return{height:ie,minHeight:Xe,maxHeight:ee,overflowY:be,resize:"none"}}var $=U("Gytx"),X=U.n($),V;(function(Ae){Ae[Ae.NONE=0]="NONE",Ae[Ae.RESIZING=1]="RESIZING",Ae[Ae.RESIZED=2]="RESIZED"})(V||(V={}));var se=function(Ae){Object(k.a)(Le,Ae);var Oe=Object(b.a)(Le);function Le(Pe){var he;return Object(N.a)(this,Le),he=Oe.call(this,Pe),he.nextFrameActionId=void 0,he.resizeFrameId=void 0,he.textArea=void 0,he.saveTextArea=function(Q){he.textArea=Q},he.handleResize=function(Q){var Ke=he.state.resizeStatus,it=he.props,Qe=it.autoSize,Xe=it.onResize;if(Ke!==V.NONE)return;typeof Xe=="function"&&Xe(Q),Qe&&he.resizeOnNextFrame()},he.resizeOnNextFrame=function(){cancelAnimationFrame(he.nextFrameActionId),he.nextFrameActionId=requestAnimationFrame(he.resizeTextarea)},he.resizeTextarea=function(){var Q=he.props.autoSize;if(!Q||!he.textArea)return;var Ke=Q.minRows,it=Q.maxRows,Qe=W(he.textArea,!1,Ke,it);he.setState({textareaStyles:Qe,resizeStatus:V.RESIZING},function(){cancelAnimationFrame(he.resizeFrameId),he.resizeFrameId=requestAnimationFrame(function(){he.setState({resizeStatus:V.RESIZED},function(){he.resizeFrameId=requestAnimationFrame(function(){he.setState({resizeStatus:V.NONE}),he.fixFirefoxAutoScroll()})})})})},he.renderTextArea=function(){var Q=he.props,Ke=Q.prefixCls,it=Ke===void 0?"rc-textarea":Ke,Qe=Q.autoSize,Xe=Q.onResize,ee=Q.className,ie=Q.disabled,be=he.state,Re=be.textareaStyles,Ue=be.resizeStatus,Ie=Object(r.a)(he.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),He=T()(it,ee,Object(M.a)({},"".concat(it,"-disabled"),ie));"value"in Ie&&(Ie.value=Ie.value||"");var Ge=Object(j.a)(Object(j.a)(Object(j.a)({},he.props.style),Re),Ue===V.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return S.createElement(o,{onResize:he.handleResize,disabled:!(Qe||Xe)},S.createElement("textarea",Object(Z.a)({},Ie,{className:He,style:Ge,ref:he.saveTextArea})))},he.state={textareaStyles:{},resizeStatus:V.NONE},he}return Object(_.a)(Le,[{key:"componentDidUpdate",value:function(he){(he.value!==this.props.value||!X()(he.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var he=this.textArea.selectionStart,Q=this.textArea.selectionEnd;this.textArea.setSelectionRange(he,Q)}}catch(Ke){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Le}(S.Component),xe=se,Ee=function(Ae){Object(k.a)(Le,Ae);var Oe=Object(b.a)(Le);function Le(Pe){var he;Object(N.a)(this,Le),he=Oe.call(this,Pe),he.resizableTextArea=void 0,he.focus=function(){he.resizableTextArea.textArea.focus()},he.saveTextArea=function(Ke){he.resizableTextArea=Ke},he.handleChange=function(Ke){var it=he.props.onChange;he.setValue(Ke.target.value,function(){he.resizableTextArea.resizeTextarea()}),it&&it(Ke)},he.handleKeyDown=function(Ke){var it=he.props,Qe=it.onPressEnter,Xe=it.onKeyDown;Ke.keyCode===13&&Qe&&Qe(Ke),Xe&&Xe(Ke)};var Q=typeof Pe.value=="undefined"||Pe.value===null?Pe.defaultValue:Pe.value;return he.state={value:Q},he}return Object(_.a)(Le,[{key:"setValue",value:function(he,Q){"value"in this.props||this.setState({value:he},Q)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return S.createElement(xe,Object(Z.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(he){return"value"in he?{value:he.value}:null}}]),Le}(S.Component),je=fe.default=Ee},ZW9T:function(ot,fe,U){"use strict";U.d(fe,"a",function(){return o});var Z=U("k1fw"),N=U("oBTY"),_=U("9og8"),k=U("miYZ"),b=U("tsqr"),S=U("rAM+"),j=U("tJVT"),M=U("PpiC"),O=U("WmNS"),w=U.n(O),c=U("q1tI"),y=U.n(c),C=U("bdgK");function m(r,t,T,x,A){var R=t.getWordUntilPosition(T),I={startLineNumber:T.lineNumber,endLineNumber:T.lineNumber,startColumn:R.startColumn,endColumn:R.endColumn},B=x.map(function(W){return{label:W,kind:r.languages.CompletionItemKind.Keyword,insertText:W,insertTextRules:r.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:I}});return A.map(function(W){B.push(Object(Z.a)(Object(Z.a)({},W),{},{range:I}))}),B}var f=function(r){var t={label:"ifelse",kind:r.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`),insertTextRules:r.languages.CompletionItemInsertTextRule.InsertAsSnippet},T=["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","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];r.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(I,B){var W=m(r,I,B,T,[t]);return{suggestions:W}}});var x=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];r.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(I,B){var W=[{label:"print",kind:r.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
`),insertTextRules:r.languages.CompletionItemInsertTextRule.InsertAsSnippet}],$=m(r,I,B,x,W);return{suggestions:$}}});var A=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];r.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(I,B){var W=[t,{label:"main",kind:r.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
`),insertTextRules:r.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:r.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
`),insertTextRules:r.languages.CompletionItemInsertTextRule.InsertAsSnippet}],$=m(r,I,B,A,W);return{suggestions:$}}})},v="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",a=U("fjLI"),e=U("LvDl"),n=U("+ua5");function i(r){return/^\d+$/.test(r)?"".concat(r,"px"):r}function h(){}var d=!1,u={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python",Scala:"scale"};function E(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=r;if(Array.isArray(r)){for(var T=0;T<r.length;T++){var x=u[r[T]];if(x)return x}return t[0]}return u[t]||t}var g=null,s=fe.b=function(r){var t=r.width,T=t===void 0?"100%":t,x=r.height,A=x===void 0?"100%":x,R=r.value,I=r.language,B=I===void 0?"javascript":I,W=r.style,$=W===void 0?{}:W,X=r.options,V=X===void 0?{}:X,se=r.overrideServices,xe=se===void 0?{}:se,Ee=r.theme,je=Ee===void 0?"vs-dark":Ee,Ae=r.onEditBlur,Oe=r.onSave,Le=r.autoHeight,Pe=Le===void 0?!1:Le,he=r.forbidCopy,Q=he===void 0?!1:he,Ke=r.onChange,it=Ke===void 0?h:Ke,Qe=r.editorDidMount,Xe=Qe===void 0?h:Qe,ee=r.onFocus,ie=ee===void 0?h:ee,be=r.onBreakPoint,Re=be===void 0?h:be,Ue=r.breakPointValue,Ie=Ue===void 0?[]:Ue,He=r.filename,Ge=He===void 0?"educoder.txt":He,ct=r.errorLine,rt=r.errorContent,st=rt===void 0?"":rt,Ze=r.highlightLine,mt=r.openBreakPoint,ht=mt===void 0?!1:mt,me=Object(M.a)(r,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint"]),Ce=Object(c.useRef)(),_e=Object(c.useRef)({}),Fe=Object(c.useRef)(),Se=Object(c.useRef)(),Me=Object(c.useRef)([]),ue=Object(c.useRef)(!1),te=Object(c.useRef)(),re=Object(c.useState)(!1),z=Object(j.a)(re,2),G=z[0],J=z[1];function ne(){var pt;return Ce.current&&(pt=new C.default(function(lt){var vt=Object(S.a)(lt),Lt;try{for(vt.s();!(Lt=vt.n()).done;){var fr=Lt.value;(fr.target.offsetHeight>0||fr.target.offsetWidth>0)&&_e.current.instance.layout()}}catch(ar){vt.e(ar)}finally{vt.f()}}),pt.observe(Ce.current)),pt}function ve(){b.b.warn({content:decodeURIComponent(v),key:"monaco-editor-tip"})}var we=function(){var lt=_e.current.instance;if(R!=null&&lt&&G){var vt=lt.getModel();vt&&R!==vt.getValue()&&(d=!0,vt.setValue(R),lt.layout(),d=!1)}};Object(c.useEffect)(function(){try{var pt,lt=_e.current.instance;Se.current&&clearTimeout(Se.current),Se.current=setTimeout(function(){we()},500),lt==null||((pt=lt.updateOptions)===null||pt===void 0)||pt.call(lt,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(R.split(/\r\n|\r|\n/g).length))+3,5)})}catch(vt){debugger}},[R,G,_e.current]),Object(c.useEffect)(function(){try{if(ct&&_e.current&&_e.current.instance){var pt=_e.current.instance;pt.changeViewZones(function(vt){var Lt=document.createElement("div");Lt.style.padding="10px 20px",Lt.style.width="calc(100% - 20px)",Lt.className="my-error-line-wrp",Lt.innerHTML=st,vt.addZone({afterLineNumber:ct||11,heightInLines:3,domNode:Lt})});var lt={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};pt.addOverlayWidget(lt),pt.revealPositionInCenter({lineNumber:20,column:1})}}catch(vt){debugger}},[ct,_e.current,G]),Object(c.useEffect)(function(){var pt;if((pt=_e.current)!==null&&pt!==void 0&&pt.instance&&G&&ht){var lt=_e.current.instance,vt=lt.getModel();if(!vt)return;var Lt=function(){var Gt=[],Pt=[],Vt=vt.getAllDecorations(),Yt=Object(S.a)(Vt),rr;try{for(Yt.s();!(rr=Yt.n()).done;){var L=rr.value;if(L.options.className==="highlighted-line"){var l;Gt.push(L==null||((l=L.range)===null||l===void 0)?void 0:l.startLineNumber),Pt.push(L==null?void 0:L.id)}}}catch(D){Yt.e(D)}finally{Yt.f()}vt.deltaDecorations(Pt,[]);var p=vt.getLineCount();!!Ze&&Ze<=p&&(lt.deltaDecorations([],[{range:new g.Range(Ze,1,Ze,vt.getLineMaxColumn(Ze)),options:{isWholeLine:!0,className:"highlighted-line"}}]),lt.revealLineInCenter(Ze))};Lt();var fr=function(){var Gt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Pt=[],Vt=[],Yt=vt.getAllDecorations(),rr=Object(S.a)(Yt),L;try{for(rr.s();!(L=rr.n()).done;){var l=L.value;if(l.options.linesDecorationsClassName==="breakpoints"){var p;Pt.push(l==null||((p=l.range)===null||p===void 0)?void 0:p.startLineNumber),Vt.push(l==null?void 0:l.id)}}}catch(D){rr.e(D)}finally{rr.f()}if(Gt)return{lines:Pt,ids:Vt};Re(Pt)},ar=function(){var gt=Object(_.a)(w.a.mark(function Gt(Pt){var Vt;return w.a.wrap(function(rr){for(;;)switch(rr.prev=rr.next){case 0:return Vt={range:new g.Range(Pt,1,Pt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}},rr.next=3,vt.deltaDecorations([],[Vt]);case 3:fr();case 4:case"end":return rr.stop()}},Gt)}));return function(Pt){return gt.apply(this,arguments)}}(),dr=function(){var gt=Object(_.a)(w.a.mark(function Gt(Pt){var Vt,Yt,rr,L,l;return w.a.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:Vt=[],Yt=lt.getLineDecorations(Pt),rr=Object(S.a)(Yt);try{for(rr.s();!(L=rr.n()).done;)l=L.value,l.options.linesDecorationsClassName==="breakpoints"&&Vt.push(l.id)}catch(F){rr.e(F)}finally{rr.f()}return D.next=6,vt.deltaDecorations(Vt,[]);case 6:fr();case 7:case"end":return D.stop()}},Gt)}));return function(Pt){return gt.apply(this,arguments)}}(),yr=function(Gt){var Pt=lt.getLineDecorations(Gt),Vt=Object(S.a)(Pt),Yt;try{for(Vt.s();!(Yt=Vt.n()).done;){var rr=Yt.value;if(rr.options.linesDecorationsClassName==="breakpoints")return!0}}catch(L){Vt.e(L)}finally{Vt.f()}return!1};if(!Object(e.isEqual)(Ie,fr(!0).lines)){vt.deltaDecorations(fr(!0).ids,[]);var Mr=Ie.map(function(gt){return{range:new g.Range(gt,1,gt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}}});vt.deltaDecorations([],Mr)}var Nr=lt.onDidChangeModelContent(function(gt){var Gt=lt.getPosition();if(Gt){var Pt=Gt.lineNumber;vt.getLineContent(Pt).trim()===""?dr(Pt):yr(Pt)&&(dr(Pt),ar(Pt))}}),Hr=lt.onMouseDown(function(gt){var Gt,Pt,Vt;if(gt.target.detail&&(Gt=gt.target)!==null&&Gt!==void 0&&(Pt=Gt.element)!==null&&Pt!==void 0&&(Vt=Pt.className)!==null&&Vt!==void 0&&Vt.includes("line-numbers")){var Yt=gt.target.position.lineNumber;if(vt.getLineContent(Yt).trim()==="")return;yr(Yt)?dr(Yt):ar(Yt)}}),Or=function(Gt){var Pt={range:new g.Range(Gt,1,Gt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Me.current=lt.deltaDecorations(Me.current,[Pt])},_r=function(){Me.current=lt.deltaDecorations(Me.current,[])},Xr=lt.onMouseMove(function(gt){var Gt,Pt,Vt;if(_r(),gt.target.detail&&(Gt=gt.target)!==null&&Gt!==void 0&&(Pt=Gt.element)!==null&&Pt!==void 0&&(Vt=Pt.className)!==null&&Vt!==void 0&&Vt.includes("line-numbers")){var Yt=gt.target.position.lineNumber;if(vt.getLineContent(Yt).trim()==="")return;Or(Yt)}}),Ur=lt.onMouseLeave(function(){_r()});return function(){Nr.dispose(),Hr.dispose(),Xr.dispose(),Ur.dispose()}}},[_e.current,G,Ie,Ze,ht]);function ze(){var pt=_e.current.instance;if(pt){var lt=pt.getSelection(),vt=_e.current.pastePos||{},Lt=new g.Range(vt.startLineNumber||lt.endLineNumber,vt.startColumn||lt.endColumn,vt.endLineNumber||lt.endLineNumber,vt.endColumn||lt.endColumn);setTimeout(function(){pt.executeEdits("",[{range:Lt,text:""}])},300)}}function nt(pt){(window.navigator.platform.match("Mac")?pt.metaKey:pt.ctrlKey)&&pt.keyCode==83&&(pt.preventDefault(),Oe())}var ft=function(){if(Pe&&_e.current.instance){var lt=_e.current.instance.getContentHeight();Nt(lt<A?A:lt)}else Nt(A)};function tt(pt){var lt=document.createEvent("MouseEvents");lt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),pt.dispatchEvent(lt)}var Ct=function(lt){var vt=lt.keyCode,Lt=lt.ctrlKey,fr=lt.metaKey,ar=lt.target,dr=lt.type;return(dr==="paste"||(vt===67||vt===86)&&(fr||Lt))&&ar.nodeName==="TEXTAREA"&&(ve(),lt.preventDefault()),!1};function _t(pt,lt){var vt=window.URL||window.webkitURL||window,Lt=new Blob([lt]),fr=document.createElementNS("http://www.w3.org/1999/xhtml","a");fr.href=vt.createObjectURL(Lt),fr.download=pt,tt(fr)}Object(c.useEffect)(function(){ft()},[ft]),Object(c.useEffect)(function(){Ce.current&&!G&&U.e(27).then(U.t.bind(null,"M/lh",7)).then(function(pt){try{g=pt,_e.current.instance=g.editor.create(Ce.current,{value:R,language:E(B),theme:je,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},xe);var lt=_e.current.instance,vt=a.c._menuItems,Lt=Object(N.a)(vt).find(function(ar){return ar[0]._debugName=="EditorContext"});if(Xe(lt,g),setTimeout(function(){ft(),_e.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){_t(Ge||"educoder.txt",lt.getValue())}}),lt.getDomNode().addEventListener("input",function(){Fe.current.autoFormat&&lt.getAction("editor.action.formatDocument").run()})},500),_e.current.subscription=lt.onDidChangeModelContent(function(ar){debugger;ue.current?clearTimeout(te.current):(ft(),it(lt.getValue(),ar)),te.current=setTimeout(function(){ue.current=!1},500)}),window.Monaco||f(g,E(B)),Q&&(Ce.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",Ct),window.removeEventListener("paste",Ct),window.addEventListener("keydown",Ct),window.addEventListener("paste",Ct)),window.Monaco=g,Ae&&lt.onDidBlurEditorWidget(function(){Ae(lt.getValue())}),ie&&lt.onDidFocusEditorText(function(){ie(lt.getValue())}),Q)try{window.addEventListener("paste",ze)}catch(ar){}var fr=ne();return J(!0),function(){var ar=_e.current.instance;ar.dispose();var dr=ar.getModel();dr&&dr.dispose(),_e.current.subscription&&_e.current.subscription.dispose(),Q&&window.removeEventListener("paste",ze),fr.unobserve(Ce.current)}}catch(ar){debugger}})},[]),Object(c.useEffect)(function(){var pt=_e.current.instance;if(pt&&G)return document.addEventListener("keydown",nt,!1),function(){document.removeEventListener("keydown",nt)}},[Oe,G]),Object(c.useEffect)(function(){var pt=_e.current.instance;if(pt&&G){var lt=E(B);g.editor.setModelLanguage(pt.getModel(),lt)}},[B,G]),Object(c.useEffect)(function(){var pt=_e.current.instance;pt&&G&&g.editor.setTheme(je)},[je,G]),Object(c.useEffect)(function(){var pt=_e.current.instance;Fe.current=V,pt&&G&&(pt.updateOptions(Object(Z.a)({},V)),setTimeout(function(){pt.getModel().updateOptions(Object(Z.a)({},V))},200))},[JSON.stringify(V),G]),Object(c.useEffect)(function(){var pt=_e.current.instance;pt&&G&&pt.layout()},[T,A,G]);var dt=Object(c.useState)(i(T)),kt=Object(j.a)(dt,2),It=kt[0],Dt=kt[1],zt=Object(c.useState)(i(A)),xt=Object(j.a)(zt,2),Bt=xt[0],Nt=xt[1],qe=Object(Z.a)(Object(Z.a)({},$),{},{width:It,height:Bt});return y.a.createElement("div",{className:"my-monaco-editor",ref:Ce,style:qe})};function o(r){var t=r.width,T=t===void 0?"100%":t,x=r.height,A=x===void 0?"100%":x,R=r.original,I=r.modified,B=r.language,W=r.options,$=W===void 0?{}:W,X=Object(c.useRef)(),V=Object(c.useState)(null),se=Object(j.a)(V,2),xe=se[0],Ee=se[1];function je(Pe){var he;return X.current&&(he=new C.default(function(Q){var Ke=Object(S.a)(Q),it;try{for(Ke.s();!(it=Ke.n()).done;){var Qe=it.value;(Qe.target.offsetHeight>0||Qe.target.offsetWidth>0)&&Pe.layout()}}catch(Xe){Ke.e(Xe)}finally{Ke.f()}}),he.observe(X.current)),he}Object(c.useEffect)(function(){return X.current&&U.e(27).then(U.t.bind(null,"M/lh",7)).then(function(Pe){g=Pe;var he=g.editor.createDiffEditor(X.current,Object(Z.a)(Object(Z.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},$),{},{wordWrap:!0}));Ee(he);var Q=je(he);return function(){he.dispose();var Ke=he.getModel();Ke&&Ke.dispose(),Q.unobserve(X.current)}}),function(){window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}},[]),Object(c.useEffect)(function(){xe&&xe.setModel({original:g.editor.createModel(R,B),modified:g.editor.createModel(I,B)})},[R,I,B,xe]);var Ae=i(T),Oe=i(A),Le={width:Ae,height:Oe};return y.a.createElement("div",{className:"my-diff-editor",ref:X,style:Le})}},bT9E:function(ot,fe,U){"use strict";U.d(fe,"a",function(){return N});var Z=U("VTBJ");function N(_,k){var b=Object(Z.a)({},_);return Array.isArray(k)&&k.forEach(function(S){delete b[S]}),b}},biw7:function(ot,fe,U){"use strict";var Z=U("q1tI"),N=U.n(Z),_=Z.createContext(null);fe.a=_},eZjB:function(ot,fe,U){ot.exports=U.p+"static/a1.80c95864.svg"},fjLI:function(ot,fe,U){"use strict";U.d(fe,"e",function(){return w}),U.d(fe,"a",function(){return c}),U.d(fe,"c",function(){return y}),U.d(fe,"d",function(){return m}),U.d(fe,"b",function(){return f});var Z=U("8HAY"),N=U("Cg/j"),_=U("T8No"),k=U("nnTU"),b=U("MI8n"),S=function(){var v=function(a,e){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var h in i)i.hasOwnProperty(h)&&(n[h]=i[h])},v(a,e)};return function(a,e){v(a,e);function n(){this.constructor=a}a.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),j=function(v,a,e,n){var i=arguments.length,h=i<3?a:n===null?n=Object.getOwnPropertyDescriptor(a,e):n,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(v,a,e,n);else for(var u=v.length-1;u>=0;u--)(d=v[u])&&(h=(i<3?d(h):i>3?d(a,e,h):d(a,e))||h);return i>3&&h&&Object.defineProperty(a,e,h),h},M=function(v,a){return function(e,n){a(e,n,v)}},O=function(){for(var v=0,a=0,e=arguments.length;a<e;a++)v+=arguments[a].length;for(var n=Array(v),i=0,a=0;a<e;a++)for(var h=arguments[a],d=0,u=h.length;d<u;d++,i++)n[i]=h[d];return n};function w(v){return v.command!==void 0}var c=Object(N.c)("menuService"),y=new(function(){function v(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new b.a,this.onDidChangeMenu=this._onDidChangeMenu.event}return v.prototype.addCommand=function(a){var e=this;return this._commands.set(a.id,a),this._onDidChangeMenu.fire(0),{dispose:function(){e._commands.delete(a.id)&&e._onDidChangeMenu.fire(0)}}},v.prototype.getCommand=function(a){return this._commands.get(a)},v.prototype.getCommands=function(){var a=new Map;return this._commands.forEach(function(e,n){return a.set(n,e)}),a},v.prototype.appendMenuItem=function(a,e){var n=this,i=this._menuItems.get(a);return i?i.push(e):(i=[e],this._menuItems.set(a,i)),this._onDidChangeMenu.fire(a),{dispose:function(){var h=i.indexOf(e);h>=0&&(i.splice(h,1),n._onDidChangeMenu.fire(a))}}},v.prototype.getMenuItems=function(a){var e=(this._menuItems.get(a)||[]).slice(0);return a===0&&this._appendImplicitItems(e),e},v.prototype._appendImplicitItems=function(a){for(var e=new Set,n=a.filter(function(g){return w(g)}),i=0,h=n;i<h.length;i++){var d=h[i],u=d.command,E=d.alt;e.add(u.id),E&&e.add(E.id)}this._commands.forEach(function(g,s){e.has(s)||a.push({command:g})})},v}()),C=function(v){S(a,v);function a(e,n,i){var h=v.call(this,e,n)||this;return h._commandService=i,h}return a.prototype.run=function(){for(var e,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return(e=this._commandService).executeCommand.apply(e,O([this.id],n))},a=j([M(2,k.b)],a),a}(Z.a),m=function(v){S(a,v);function a(e){var n=this;return typeof e.title=="string"?n=v.call(this,"",e.title,"submenu")||this:n=v.call(this,"",e.title.value,"submenu")||this,n.item=e,n}return a}(Z.a),f=function(v){S(a,v);function a(e,n,i,h,d){var u=this;return typeof e.title=="string"?u=v.call(this,e.id,e.title,d)||this:u=v.call(this,e.id,e.title.value,d)||this,u._cssClass=void 0,u._enabled=!e.precondition||h.contextMatchesRules(e.precondition),u._checked=Boolean(e.toggled&&h.contextMatchesRules(e.toggled)),u._options=i||{},u.item=e,u.alt=n?new a(n,void 0,u._options,h,d):void 0,u}return a.prototype.dispose=function(){this.alt&&this.alt.dispose(),v.prototype.dispose.call(this)},a.prototype.run=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=[];return this._options.arg&&(i=O(i,[this._options.arg])),this._options.shouldForwardArgs&&(i=O(i,e)),v.prototype.run.apply(this,i)},a=j([M(3,_.c),M(4,k.b)],a),a}(C)},fyJ8:function(ot,fe,U){"use strict";var Z=U("rePB"),N=U("VTBJ"),_=U("Ff2n"),k=U("U8pU"),b=U("q1tI"),S=U.n(b),j=U("TSYQ"),M=U.n(j),O=U("c+Xe"),w=U("sR1s");function c(v){return v&&Object(k.a)(v)==="object"&&!Array.isArray(v)&&!b.isValidElement(v)}function y(v){return typeof v=="string"?!0:Object(O.c)(v)}function C(v,a){var e,n=v.prefixCls,i=v.className,h=v.record,d=v.index,u=v.dataIndex,E=v.render,g=v.children,s=v.component,o=s===void 0?"td":s,r=v.colSpan,t=v.rowSpan,T=v.fixLeft,x=v.fixRight,A=v.firstFixLeft,R=v.lastFixLeft,I=v.firstFixRight,B=v.lastFixRight,W=v.appendNode,$=v.additionalProps,X=$===void 0?{}:$,V=v.ellipsis,se=v.align,xe=v.rowType,Ee=v.isSticky,je="".concat(n,"-cell"),Ae,Oe;if(g)Oe=g;else{var Le=Object(w.b)(h,u);if(Oe=Le,E){var Pe=E(Le,h,d);c(Pe)?(Oe=Pe.children,Ae=Pe.props):Oe=Pe}}Object(k.a)(Oe)==="object"&&!Array.isArray(Oe)&&!b.isValidElement(Oe)&&(Oe=null),V&&(R||I)&&(Oe=b.createElement("span",{className:"".concat(je,"-content")},Oe));var he=Ae||{},Q=he.colSpan,Ke=he.rowSpan,it=he.style,Qe=he.className,Xe=Object(_.a)(he,["colSpan","rowSpan","style","className"]),ee=Q!==void 0?Q:r,ie=Ke!==void 0?Ke:t;if(ee===0||ie===0)return null;var be={},Re=typeof T=="number",Ue=typeof x=="number";Re&&(be.position="sticky",be.left=T),Ue&&(be.position="sticky",be.right=x);var Ie={};se&&(Ie.textAlign=se);var He,Ge=V===!0?{showTitle:!0}:V;Ge&&(Ge.showTitle||xe==="header")&&(typeof Oe=="string"||typeof Oe=="number"?He=Oe.toString():b.isValidElement(Oe)&&typeof Oe.props.children=="string"&&(He=Oe.props.children));var ct=Object(N.a)(Object(N.a)(Object(N.a)({title:He},Xe),X),{},{colSpan:ee&&ee!==1?ee:null,rowSpan:ie&&ie!==1?ie:null,className:M()(je,i,(e={},Object(Z.a)(e,"".concat(je,"-fix-left"),Re),Object(Z.a)(e,"".concat(je,"-fix-left-first"),A),Object(Z.a)(e,"".concat(je,"-fix-left-last"),R),Object(Z.a)(e,"".concat(je,"-fix-right"),Ue),Object(Z.a)(e,"".concat(je,"-fix-right-first"),I),Object(Z.a)(e,"".concat(je,"-fix-right-last"),B),Object(Z.a)(e,"".concat(je,"-ellipsis"),V),Object(Z.a)(e,"".concat(je,"-with-append"),W),Object(Z.a)(e,"".concat(je,"-fix-sticky"),(Re||Ue)&&Ee),e),X.className,Qe),style:Object(N.a)(Object(N.a)(Object(N.a)(Object(N.a)({},X.style),Ie),be),it),ref:y(o)?a:null});return b.createElement(o,Object.assign({},ct),W,Oe)}var m=b.forwardRef(C);m.displayName="Cell";var f=b.memo(m,function(v,a){return a.shouldCellUpdate?!a.shouldCellUpdate(a.record,v.record):!1});fe.a=f},hW8S:function(ot,fe,U){"use strict";U.d(fe,"a",function(){return k}),U.d(fe,"c",function(){return b}),U.d(fe,"b",function(){return S});var Z=U("VTBJ"),N=U("Ff2n"),_=U("Kwbf"),k="RC_TABLE_INTERNAL_COL_DEFINE";function b(j){var M=j.expandable,O=Object(N.a)(j,["expandable"]);return"expandable"in j?Object(Z.a)(Object(Z.a)({},O),M):O}function S(j){return Object.keys(j).reduce(function(M,O){return(O.substr(0,5)==="data-"||O.substr(0,5)==="aria-")&&(M[O]=j[O]),M},{})}},k3GJ:function(ot,fe,U){"use strict";U.d(fe,"a",function(){return pi});var Z=U("rePB"),N=U("ODXe"),_=U("Ff2n"),k=U("VTBJ"),b=U("q1tI"),S=U("TSYQ"),j=U.n(S),M=U("Zm9Q"),O=U("6cGi"),w=U("KQm4"),c=U("xEkU"),y=U.n(c),C=U("t23M");function m(q){var ce=Object(b.useRef)(),ge=Object(b.useRef)(!1);function oe(){for(var K=arguments.length,Y=new Array(K),H=0;H<K;H++)Y[H]=arguments[H];ge.current||(y.a.cancel(ce.current),ce.current=y()(function(){q.apply(void 0,Y)}))}return Object(b.useEffect)(function(){return function(){ge.current=!0,y.a.cancel(ce.current)}},[]),oe}function f(q){var ce=Object(b.useRef)([]),ge=Object(b.useState)({}),oe=Object(N.a)(ge,2),K=oe[1],Y=Object(b.useRef)(typeof q=="function"?q():q),H=m(function(){var le=Y.current;ce.current.forEach(function(ye){le=ye(le)}),ce.current=[],Y.current=le,K({})});function ae(le){ce.current.push(le),H()}return[Y.current,ae]}var v=U("4IlW");function a(q,ce){var ge,oe=q.prefixCls,K=q.id,Y=q.active,H=q.rtl,ae=q.tab,le=ae.key,ye=ae.tab,pe=ae.disabled,Te=ae.closeIcon,Ne=q.tabBarGutter,Je=q.tabPosition,Ye=q.closable,ut=q.renderWrapper,Rt=q.removeAriaLabel,Wt=q.editable,Mt=q.onClick,Ht=q.onRemove,Kt=q.onFocus,Ut="".concat(oe,"-tab");b.useEffect(function(){return Ht},[]);var jt={};Je==="top"||Je==="bottom"?jt[H?"marginLeft":"marginRight"]=Ne:jt.marginBottom=Ne;var qt=Wt&&Ye!==!1&&!pe;function $t(Ot){if(pe)return;Mt(Ot)}function Cr(Ot){Ot.preventDefault(),Ot.stopPropagation(),Wt.onEdit("remove",{key:le,event:Ot})}var cr=b.createElement("div",{key:le,ref:ce,className:j()(Ut,(ge={},Object(Z.a)(ge,"".concat(Ut,"-with-remove"),qt),Object(Z.a)(ge,"".concat(Ut,"-active"),Y),Object(Z.a)(ge,"".concat(Ut,"-disabled"),pe),ge)),style:jt,onClick:$t},b.createElement("div",{role:"tab","aria-selected":Y,id:K&&"".concat(K,"-tab-").concat(le),className:"".concat(Ut,"-btn"),"aria-controls":K&&"".concat(K,"-panel-").concat(le),"aria-disabled":pe,tabIndex:pe?null:0,onClick:function(wt){wt.stopPropagation(),$t(wt)},onKeyDown:function(wt){[v.a.SPACE,v.a.ENTER].includes(wt.which)&&(wt.preventDefault(),$t(wt))},onFocus:Kt},ye),qt&&b.createElement("button",{type:"button","aria-label":Rt||"remove",tabIndex:0,className:"".concat(Ut,"-remove"),onClick:function(wt){wt.stopPropagation(),Cr(wt)}},Te||Wt.removeIcon||"\xD7"));return ut&&(cr=ut(cr)),cr}var e=b.forwardRef(a),n={width:0,height:0,left:0,top:0};function i(q,ce,ge){return Object(b.useMemo)(function(){for(var oe,K=new Map,Y=ce.get((oe=q[0])===null||oe===void 0?void 0:oe.key)||n,H=Y.left+Y.width,ae=0;ae<q.length;ae+=1){var le=q[ae].key,ye=ce.get(le);if(!ye){var pe;ye=ce.get((pe=q[ae-1])===null||pe===void 0?void 0:pe.key)||n}var Te=K.get(le)||Object(k.a)({},ye);Te.right=H-Te.left-Te.width,K.set(le,Te)}return K},[q.map(function(oe){return oe.key}).join("_"),ce,ge])}var h={width:0,height:0,left:0,top:0,right:0};function d(q,ce,ge,oe,K){var Y=K.tabs,H=K.tabPosition,ae=K.rtl,le,ye,pe;["top","bottom"].includes(H)?(le="width",ye=ae?"right":"left",pe=Math.abs(ce.left)):(le="height",ye="top",pe=-ce.top);var Te=ce[le],Ne=ge[le],Je=oe[le],Ye=Te;return Ne+Je>Te&&(Ye=Te-Je),Object(b.useMemo)(function(){if(!Y.length)return[0,0];for(var ut=Y.length,Rt=ut,Wt=0;Wt<ut;Wt+=1){var Mt=q.get(Y[Wt].key)||h;if(Mt[ye]+Mt[le]>pe+Ye){Rt=Wt-1;break}}for(var Ht=0,Kt=ut-1;Kt>=0;Kt-=1){var Ut=q.get(Y[Kt].key)||h;if(Ut[ye]<pe){Ht=Kt+1;break}}return[Ht,Rt]},[q,pe,Ye,H,Y.map(function(ut){return ut.key}).join("_"),ae])}var u=U("wx14"),E=U("1OyB"),g=U("vuIU"),s=U("JX7q"),o=U("Ji7U"),r=U("LK+K"),t=U("I8Z2"),T=U("bT9E"),x=U("2GS6"),A=U("Gytx"),R=U.n(A),I=U("U8pU"),B=/iPhone/i,W=/iPod/i,$=/iPad/i,X=/\bAndroid(?:.+)Mobile\b/i,V=/Android/i,se=/\bAndroid(?:.+)SD4930UR\b/i,xe=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,Ee=/Windows Phone/i,je=/\bWindows(?:.+)ARM\b/i,Ae=/BlackBerry/i,Oe=/BB10/i,Le=/Opera Mini/i,Pe=/\b(CriOS|Chrome)(?:.+)Mobile/i,he=/Mobile(?:.+)Firefox\b/i;function Q(q,ce){return q.test(ce)}function Ke(q){var ce=q||(typeof navigator!="undefined"?navigator.userAgent:""),ge=(ce||"").split("[FBAN");if(typeof ge[1]!="undefined"){var oe=ge,K=Object(N.a)(oe,1);ce=K[0]}if(ge=ce.split("Twitter"),typeof ge[1]!="undefined"){var Y=ge,H=Object(N.a)(Y,1);ce=H[0]}var ae={apple:{phone:Q(B,ce)&&!Q(Ee,ce),ipod:Q(W,ce),tablet:!Q(B,ce)&&Q($,ce)&&!Q(Ee,ce),device:(Q(B,ce)||Q(W,ce)||Q($,ce))&&!Q(Ee,ce)},amazon:{phone:Q(se,ce),tablet:!Q(se,ce)&&Q(xe,ce),device:Q(se,ce)||Q(xe,ce)},android:{phone:!Q(Ee,ce)&&Q(se,ce)||!Q(Ee,ce)&&Q(X,ce),tablet:!Q(Ee,ce)&&!Q(se,ce)&&!Q(X,ce)&&(Q(xe,ce)||Q(V,ce)),device:!Q(Ee,ce)&&(Q(se,ce)||Q(xe,ce)||Q(X,ce)||Q(V,ce))||Q(/\bokhttp\b/i,ce)},windows:{phone:Q(Ee,ce),tablet:Q(je,ce),device:Q(Ee,ce)||Q(je,ce)},other:{blackberry:Q(Ae,ce),blackberry10:Q(Oe,ce),opera:Q(Le,ce),firefox:Q(he,ce),chrome:Q(Pe,ce),device:Q(Ae,ce)||Q(Oe,ce)||Q(Le,ce)||Q(he,ce)||Q(Pe,ce)},any:null,phone:null,tablet:null};return ae.any=ae.apple.device||ae.android.device||ae.windows.device||ae.other.device,ae.phone=ae.apple.phone||ae.android.phone||ae.windows.phone,ae.tablet=ae.apple.tablet||ae.android.tablet||ae.windows.tablet,ae}var it=Object(k.a)(Object(k.a)({},Ke()),{},{isMobile:Ke}),Qe=it;function Xe(){}function ee(q,ce,ge){var oe=ce||"";return q.key||"".concat(oe,"item_").concat(ge)}function ie(q){return"".concat(q,"-menu-")}function be(q,ce){var ge=-1;b.Children.forEach(q,function(oe){ge+=1,oe&&oe.type&&oe.type.isMenuItemGroup?b.Children.forEach(oe.props.children,function(K){ge+=1,ce(K,ge)}):ce(oe,ge)})}function Re(q,ce,ge){if(!q||ge.find)return;b.Children.forEach(q,function(oe){if(oe){var K=oe.type;if(!K||!(K.isSubMenu||K.isMenuItem||K.isMenuItemGroup))return;ce.indexOf(oe.key)!==-1?ge.find=!0:oe.props.children&&Re(oe.props.children,ce,ge)}})}var Ue=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],Ie=function(ce){var ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,oe=ce&&typeof ce.getBoundingClientRect=="function"&&ce.getBoundingClientRect().width;if(oe){if(ge){var K=getComputedStyle(ce),Y=K.marginLeft,H=K.marginRight;oe+=+Y.replace("px","")+ +H.replace("px","")}oe=+oe.toFixed(6)}return oe||0},He=function(ce,ge,oe){ce&&Object(I.a)(ce.style)==="object"&&(ce.style[ge]=oe)},Ge=function(){return Qe.any},ct=U("bdgK"),rt=U("i8i4"),st=U.n(rt),Ze=U("wgJM"),mt=U("l4aY"),ht=U("m+aA"),me=U("c+Xe"),Ce=U("zT1h"),_e=U("QC+M");function Fe(q,ce,ge){return ge?q[0]===ce[0]:q[0]===ce[0]&&q[1]===ce[1]}function Se(q,ce,ge){var oe=q[ce]||{};return Object(k.a)(Object(k.a)({},oe),ge)}function Me(q,ce,ge,oe){for(var K=ge.points,Y=Object.keys(q),H=0;H<Y.length;H+=1){var ae=Y[H];if(Fe(q[ae].points,K,oe))return"".concat(ce,"-placement-").concat(ae)}return""}var ue=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var q=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(q)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(q==null?void 0:q.substr(0,4)))},te=U("MNnm");function re(q,ce){var ge={};return ge[q.toLowerCase()]=ce.toLowerCase(),ge["Webkit".concat(q)]="webkit".concat(ce),ge["Moz".concat(q)]="moz".concat(ce),ge["ms".concat(q)]="MS".concat(ce),ge["O".concat(q)]="o".concat(ce.toLowerCase()),ge}function z(q,ce){var ge={animationend:re("Animation","AnimationEnd"),transitionend:re("Transition","TransitionEnd")};return q&&("AnimationEvent"in ce||delete ge.animationend.animation,"TransitionEvent"in ce||delete ge.transitionend.transition),ge}var G=z(Object(te.a)(),typeof window!="undefined"?window:{}),J={};if(Object(te.a)()){var ne=document.createElement("div");J=ne.style}var ve={};function we(q){if(ve[q])return ve[q];var ce=G[q];if(ce)for(var ge=Object.keys(ce),oe=ge.length,K=0;K<oe;K+=1){var Y=ge[K];if(Object.prototype.hasOwnProperty.call(ce,Y)&&Y in J)return ve[q]=ce[Y],ve[q]}return""}var ze=we("animationend"),nt=we("transitionend"),ft=!!(ze&&nt),tt=ze||"animationend",Ct=nt||"transitionend";function _t(q,ce){if(!q)return null;if(Object(I.a)(q)==="object"){var ge=ce.replace(/-\w/g,function(oe){return oe[1].toUpperCase()});return q[ge]}return"".concat(q,"-").concat(ce)}var dt="none",kt="appear",It="enter",Dt="leave",zt="none",xt="prepare",Bt="start",Nt="active",qe="end";function pt(q){var ce=Object(b.useRef)(!1),ge=Object(b.useState)(q),oe=Object(N.a)(ge,2),K=oe[0],Y=oe[1];function H(ae){ce.current||Y(ae)}return Object(b.useEffect)(function(){return function(){ce.current=!0}},[]),[K,H]}var lt=Object(te.a)()?b.useLayoutEffect:b.useEffect,vt=lt,Lt=function(){var q=b.useRef(null);function ce(){Ze.a.cancel(q.current)}function ge(oe){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;ce();var Y=Object(Ze.a)(function(){K<=1?oe({isCanceled:function(){return Y!==q.current}}):ge(oe,K-1)});q.current=Y}return b.useEffect(function(){return function(){ce()}},[]),[ge,ce]},fr=[xt,Bt,Nt,qe],ar=!1,dr=!0;function yr(q){return q===Nt||q===qe}var Mr=function(q,ce){var ge=b.useState(zt),oe=Object(N.a)(ge,2),K=oe[0],Y=oe[1],H=Lt(),ae=Object(N.a)(H,2),le=ae[0],ye=ae[1];function pe(){Y(xt)}return vt(function(){if(K!==zt&&K!==qe){var Te=fr.indexOf(K),Ne=fr[Te+1],Je=ce(K);Je===ar?Y(Ne):le(function(Ye){function ut(){if(Ye.isCanceled())return;Y(Ne)}Je===!0?ut():Promise.resolve(Je).then(ut)})}},[q,K]),b.useEffect(function(){return function(){ye()}},[]),[pe,K]},Nr=function(q){var ce=Object(b.useRef)(),ge=Object(b.useRef)(q);ge.current=q;var oe=b.useCallback(function(H){ge.current(H)},[]);function K(H){H&&(H.removeEventListener(Ct,oe),H.removeEventListener(tt,oe))}function Y(H){ce.current&&ce.current!==H&&K(ce.current),H&&H!==ce.current&&(H.addEventListener(Ct,oe),H.addEventListener(tt,oe),ce.current=H)}return b.useEffect(function(){return function(){K(ce.current)}},[]),[Y,K]};function Hr(q,ce,ge,oe){var K=oe.motionEnter,Y=K===void 0?!0:K,H=oe.motionAppear,ae=H===void 0?!0:H,le=oe.motionLeave,ye=le===void 0?!0:le,pe=oe.motionDeadline,Te=oe.motionLeaveImmediately,Ne=oe.onAppearPrepare,Je=oe.onEnterPrepare,Ye=oe.onLeavePrepare,ut=oe.onAppearStart,Rt=oe.onEnterStart,Wt=oe.onLeaveStart,Mt=oe.onAppearActive,Ht=oe.onEnterActive,Kt=oe.onLeaveActive,Ut=oe.onAppearEnd,jt=oe.onEnterEnd,qt=oe.onLeaveEnd,$t=oe.onVisibleChanged,Cr=pt(),cr=Object(N.a)(Cr,2),Ot=cr[0],wt=cr[1],Jt=pt(dt),Zt=Object(N.a)(Jt,2),Et=Zt[0],er=Zt[1],br=pt(null),tr=Object(N.a)(br,2),pr=tr[0],xr=tr[1],Fr=Object(b.useRef)(!1),Jr=Object(b.useRef)(null),wr=Object(b.useRef)(!1),Qr=Object(b.useRef)(null);function yn(){var Er=ge();return Er||Qr.current}var en=Object(b.useRef)(!1);function tn(Er){var ur=yn();if(Er&&!Er.deadline&&Er.target!==ur)return;var Kr;Et===kt&&en.current?Kr=Ut==null?void 0:Ut(ur,Er):Et===It&&en.current?Kr=jt==null?void 0:jt(ur,Er):Et===Dt&&en.current&&(Kr=qt==null?void 0:qt(ur,Er)),Kr!==!1&&!wr.current&&(er(dt),xr(null))}var Lr=Nr(tn),Vr=Object(N.a)(Lr,1),Wr=Vr[0],Ir=b.useMemo(function(){var Er,ur,Kr;switch(Et){case"appear":return Er={},Object(Z.a)(Er,xt,Ne),Object(Z.a)(Er,Bt,ut),Object(Z.a)(Er,Nt,Mt),Er;case"enter":return ur={},Object(Z.a)(ur,xt,Je),Object(Z.a)(ur,Bt,Rt),Object(Z.a)(ur,Nt,Ht),ur;case"leave":return Kr={},Object(Z.a)(Kr,xt,Ye),Object(Z.a)(Kr,Bt,Wt),Object(Z.a)(Kr,Nt,Kt),Kr;default:return{}}},[Et]),Dn=Mr(Et,function(Er){if(Er===xt){var ur=Ir[xt];return ur?ur(yn()):ar}if(gr in Ir){var Kr;xr(((Kr=Ir[gr])===null||Kr===void 0?void 0:Kr.call(Ir,yn(),null))||null)}return gr===Nt&&(Wr(yn()),pe>0&&(clearTimeout(Jr.current),Jr.current=setTimeout(function(){tn({deadline:!0})},pe))),dr}),Ln=Object(N.a)(Dn,2),Fn=Ln[0],gr=Ln[1],xn=yr(gr);en.current=xn,vt(function(){wt(ce);var Er=Fr.current;if(Fr.current=!0,!q)return;var ur;!Er&&ce&&ae&&(ur=kt),Er&&ce&&Y&&(ur=It),(Er&&!ce&&ye||!Er&&Te&&!ce&&ye)&&(ur=Dt),ur&&(er(ur),Fn())},[ce]),Object(b.useEffect)(function(){(Et===kt&&!ae||Et===It&&!Y||Et===Dt&&!ye)&&er(dt)},[ae,Y,ye]),Object(b.useEffect)(function(){return function(){clearTimeout(Jr.current),wr.current=!0}},[]),Object(b.useEffect)(function(){Ot!==void 0&&Et===dt&&($t==null||$t(Ot))},[Ot,Et]);var Wn=pr;return Ir[xt]&&gr===Bt&&(Wn=Object(k.a)({transition:"none"},Wn)),[Et,gr,Wn,Ot!=null?Ot:ce]}var Or=function(q){Object(o.a)(ge,q);var ce=Object(r.a)(ge);function ge(){return Object(E.a)(this,ge),ce.apply(this,arguments)}return Object(g.a)(ge,[{key:"render",value:function(){return this.props.children}}]),ge}(b.Component),_r=Or;function Xr(q){var ce=q;Object(I.a)(q)==="object"&&(ce=q.transitionSupport);function ge(K){return!!(K.motionName&&ce)}var oe=b.forwardRef(function(K,Y){var H=K.visible,ae=H===void 0?!0:H,le=K.removeOnLeave,ye=le===void 0?!0:le,pe=K.forceRender,Te=K.children,Ne=K.motionName,Je=K.leavedClassName,Ye=K.eventProps,ut=ge(K),Rt=Object(b.useRef)(),Wt=Object(b.useRef)();function Mt(){try{return Object(ht.a)(Rt.current||Wt.current)}catch(er){return null}}var Ht=Hr(ut,ae,Mt,K),Kt=Object(N.a)(Ht,4),Ut=Kt[0],jt=Kt[1],qt=Kt[2],$t=Kt[3],Cr=b.useRef($t);$t&&(Cr.current=!0);var cr=Object(b.useRef)(Y);cr.current=Y;var Ot=b.useCallback(function(er){Rt.current=er,Object(me.b)(cr.current,er)},[]),wt,Jt=Object(k.a)(Object(k.a)({},Ye),{},{visible:ae});if(!Te)wt=null;else if(Ut===dt||!ge(K))$t?wt=Te(Object(k.a)({},Jt),Ot):!ye&&Cr.current?wt=Te(Object(k.a)(Object(k.a)({},Jt),{},{className:Je}),Ot):pe?wt=Te(Object(k.a)(Object(k.a)({},Jt),{},{style:{display:"none"}}),Ot):wt=null;else{var Zt,Et;jt===xt?Et="prepare":yr(jt)?Et="active":jt===Bt&&(Et="start"),wt=Te(Object(k.a)(Object(k.a)({},Jt),{},{className:j()(_t(Ne,Ut),(Zt={},Object(Z.a)(Zt,_t(Ne,"".concat(Ut,"-").concat(Et)),Et),Object(Z.a)(Zt,Ne,typeof Ne=="string"),Zt)),style:qt}),Ot)}return b.createElement(_r,{ref:Wt},wt)});return oe.displayName="CSSMotion",oe}var Ur=Xr(ft),gt="add",Gt="keep",Pt="remove",Vt="removed";function Yt(q){var ce;return q&&Object(I.a)(q)==="object"&&"key"in q?ce=q:ce={key:q},Object(k.a)(Object(k.a)({},ce),{},{key:String(ce.key)})}function rr(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return q.map(Yt)}function L(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],ge=[],oe=0,K=ce.length,Y=rr(q),H=rr(ce);Y.forEach(function(ye){for(var pe=!1,Te=oe;Te<K;Te+=1){var Ne=H[Te];if(Ne.key===ye.key){oe<Te&&(ge=ge.concat(H.slice(oe,Te).map(function(Je){return Object(k.a)(Object(k.a)({},Je),{},{status:gt})})),oe=Te),ge.push(Object(k.a)(Object(k.a)({},Ne),{},{status:Gt})),oe+=1,pe=!0;break}}pe||ge.push(Object(k.a)(Object(k.a)({},ye),{},{status:Pt}))}),oe<K&&(ge=ge.concat(H.slice(oe).map(function(ye){return Object(k.a)(Object(k.a)({},ye),{},{status:gt})})));var ae={};ge.forEach(function(ye){var pe=ye.key;ae[pe]=(ae[pe]||0)+1});var le=Object.keys(ae).filter(function(ye){return ae[ye]>1});return le.forEach(function(ye){ge=ge.filter(function(pe){var Te=pe.key,Ne=pe.status;return Te!==ye||Ne!==Pt}),ge.forEach(function(pe){pe.key===ye&&(pe.status=Gt)})}),ge}var l=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function p(q){var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ur,ge=function(oe){Object(o.a)(Y,oe);var K=Object(r.a)(Y);function Y(){var H;return Object(E.a)(this,Y),H=K.apply(this,arguments),H.state={keyEntities:[]},H.removeKey=function(ae){H.setState(function(le){var ye=le.keyEntities;return{keyEntities:ye.map(function(pe){return pe.key!==ae?pe:Object(k.a)(Object(k.a)({},pe),{},{status:Vt})})}})},H}return Object(g.a)(Y,[{key:"render",value:function(){var ae=this,le=this.state.keyEntities,ye=this.props,pe=ye.component,Te=ye.children,Ne=ye.onVisibleChanged,Je=Object(_.a)(ye,["component","children","onVisibleChanged"]),Ye=pe||b.Fragment,ut={};return l.forEach(function(Rt){ut[Rt]=Je[Rt],delete Je[Rt]}),delete Je.keys,b.createElement(Ye,Je,le.map(function(Rt){var Wt=Rt.status,Mt=Object(_.a)(Rt,["status"]),Ht=Wt===gt||Wt===Gt;return b.createElement(ce,Object(u.a)({},ut,{key:Mt.key,visible:Ht,eventProps:Mt,onVisibleChanged:function(Ut){Ne==null||Ne(Ut,{key:Mt.key}),Ut||ae.removeKey(Mt.key)}}),Te)}))}}],[{key:"getDerivedStateFromProps",value:function(ae,le){var ye=ae.keys,pe=le.keyEntities,Te=rr(ye),Ne=L(pe,Te);return{keyEntities:Ne.filter(function(Je){var Ye=pe.find(function(ut){var Rt=ut.key;return Je.key===Rt});return!(Ye&&Ye.status===Vt&&Je.status===Pt)})}}}]),Y}(b.Component);return ge.defaultProps={component:"div"},ge}var D=p(ft),F=Ur;function P(q){var ce=q.prefixCls,ge=q.motion,oe=q.animation,K=q.transitionName;return ge||(oe?{motionName:"".concat(ce,"-").concat(oe)}:K?{motionName:K}:null)}function de(q){var ce=q.prefixCls,ge=q.visible,oe=q.zIndex,K=q.mask,Y=q.maskMotion,H=q.maskAnimation,ae=q.maskTransitionName;if(!K)return null;var le={};return(Y||ae||H)&&(le=Object(k.a)({motionAppear:!0},P({motion:Y,prefixCls:ce,transitionName:ae,animation:H}))),b.createElement(F,Object(u.a)({},le,{visible:ge,removeOnLeave:!0}),function(ye){var pe=ye.className;return b.createElement("div",{style:{zIndex:oe},className:j()("".concat(ce,"-mask"),pe)})})}var We=U("9mu1"),at=U("o0o1"),yt=U.n(at),Ve=U("HaE+"),St=["measure","align",null,"motion"],At=function(q,ce){var ge=Object(b.useState)(null),oe=Object(N.a)(ge,2),K=oe[0],Y=oe[1],H=Object(b.useRef)(),ae=Object(b.useRef)(!1);function le(Te){ae.current||Y(Te)}function ye(){Ze.a.cancel(H.current)}function pe(Te){ye(),H.current=Object(Ze.a)(function(){le(function(Ne){switch(K){case"align":return"motion";case"motion":return"stable";default:}return Ne}),Te==null||Te()})}return Object(b.useEffect)(function(){le("measure")},[q]),Object(b.useEffect)(function(){switch(K){case"measure":ce();break;default:}K&&(H.current=Object(Ze.a)(Object(Ve.a)(yt.a.mark(function Te(){var Ne,Je;return yt.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:Ne=St.indexOf(K),Je=St[Ne+1],Je&&Ne!==-1&&le(Je);case 3:case"end":return ut.stop()}},Te)}))))},[K]),Object(b.useEffect)(function(){return function(){ae.current=!0,ye()}},[]),[K,pe]},nr=function(q){var ce=b.useState({width:0,height:0}),ge=Object(N.a)(ce,2),oe=ge[0],K=ge[1];function Y(ae){K({width:ae.offsetWidth,height:ae.offsetHeight})}var H=b.useMemo(function(){var ae={};if(q){var le=oe.width,ye=oe.height;q.indexOf("height")!==-1&&ye?ae.height=ye:q.indexOf("minHeight")!==-1&&ye&&(ae.minHeight=ye),q.indexOf("width")!==-1&&le?ae.width=le:q.indexOf("minWidth")!==-1&&le&&(ae.minWidth=le)}return ae},[q,oe]);return[H,Y]},ke=b.forwardRef(function(q,ce){var ge=q.visible,oe=q.prefixCls,K=q.className,Y=q.style,H=q.children,ae=q.zIndex,le=q.stretch,ye=q.destroyPopupOnHide,pe=q.forceRender,Te=q.align,Ne=q.point,Je=q.getRootDomNode,Ye=q.getClassNameFromAlign,ut=q.onAlign,Rt=q.onMouseEnter,Wt=q.onMouseLeave,Mt=q.onMouseDown,Ht=q.onTouchStart,Kt=Object(b.useRef)(),Ut=Object(b.useRef)(),jt=Object(b.useState)(),qt=Object(N.a)(jt,2),$t=qt[0],Cr=qt[1],cr=nr(le),Ot=Object(N.a)(cr,2),wt=Ot[0],Jt=Ot[1];function Zt(){le&&Jt(Je())}var Et=At(ge,Zt),er=Object(N.a)(Et,2),br=er[0],tr=er[1],pr=Object(b.useRef)();function xr(){return Ne||Je}function Fr(){var Lr;(Lr=Kt.current)===null||Lr===void 0||Lr.forceAlign()}function Jr(Lr,Vr){var Wr=Ye(Vr);$t!==Wr&&Cr(Wr),br==="align"&&($t!==Wr?Promise.resolve().then(function(){Fr()}):tr(function(){var Ir;(Ir=pr.current)===null||Ir===void 0||Ir.call(pr)}),ut==null||ut(Lr,Vr))}var wr=Object(k.a)({},P(q));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(Lr){var Vr=wr[Lr];wr[Lr]=function(Wr,Ir){return tr(),Vr==null?void 0:Vr(Wr,Ir)}});function Qr(){return new Promise(function(Lr){pr.current=Lr})}b.useEffect(function(){!wr.motionName&&br==="motion"&&tr()},[wr.motionName,br]),b.useImperativeHandle(ce,function(){return{forceAlign:Fr,getElement:function(){return Ut.current}}});var yn=Object(k.a)(Object(k.a)({},wt),{},{zIndex:ae,opacity:br==="motion"||br==="stable"||!ge?void 0:0,pointerEvents:br==="stable"?void 0:"none"},Y),en=!0;(Te==null?void 0:Te.points)&&(br==="align"||br==="stable")&&(en=!1);var tn=H;return b.Children.count(H)>1&&(tn=b.createElement("div",{className:"".concat(oe,"-content")},H)),b.createElement(F,Object(u.a)({visible:ge,ref:Ut,leavedClassName:"".concat(oe,"-hidden")},wr,{onAppearPrepare:Qr,onEnterPrepare:Qr,removeOnLeave:ye,forceRender:pe}),function(Lr,Vr){var Wr=Lr.className,Ir=Lr.style,Dn=j()(oe,K,$t,Wr);return b.createElement(We.a,{target:xr(),key:"popup",ref:Kt,monitorWindowResize:!0,disabled:en,align:Te,onAlign:Jr},b.createElement("div",{ref:Vr,className:Dn,onMouseEnter:Rt,onMouseLeave:Wt,onMouseDownCapture:Mt,onTouchStartCapture:Ht,style:Object(k.a)(Object(k.a)({},Ir),yn)},tn))})});ke.displayName="PopupInner";var Ar=ke,mr=b.forwardRef(function(q,ce){var ge=q.prefixCls,oe=q.visible,K=q.zIndex,Y=q.children,H=q.mobile;H=H===void 0?{}:H;var ae=H.popupClassName,le=H.popupStyle,ye=H.popupMotion,pe=ye===void 0?{}:ye,Te=H.popupRender,Ne=b.useRef();b.useImperativeHandle(ce,function(){return{forceAlign:function(){},getElement:function(){return Ne.current}}});var Je=Object(k.a)({zIndex:K},le),Ye=Y;return b.Children.count(Y)>1&&(Ye=b.createElement("div",{className:"".concat(ge,"-content")},Y)),Te&&(Ye=Te(Ye)),b.createElement(F,Object(u.a)({visible:oe,ref:Ne,removeOnLeave:!0},pe),function(ut,Rt){var Wt=ut.className,Mt=ut.style,Ht=j()(ge,ae,Wt);return b.createElement("div",{ref:Rt,className:Ht,style:Object(k.a)(Object(k.a)({},Mt),Je)},Ye)})});mr.displayName="MobilePopupInner";var jr=mr,Cn=["visible","mobile"],nn=b.forwardRef(function(q,ce){var ge=q.visible,oe=q.mobile,K=Object(_.a)(q,Cn),Y=Object(b.useState)(ge),H=Object(N.a)(Y,2),ae=H[0],le=H[1],ye=Object(b.useState)(!1),pe=Object(N.a)(ye,2),Te=pe[0],Ne=pe[1],Je=Object(k.a)(Object(k.a)({},K),{},{visible:ae});Object(b.useEffect)(function(){le(ge),ge&&oe&&Ne(ue())},[ge,oe]);var Ye=Te?b.createElement(jr,Object(u.a)({},Je,{mobile:oe,ref:ce})):b.createElement(Ar,Object(u.a)({},Je,{ref:ce}));return b.createElement("div",null,b.createElement(de,Je),Ye)});nn.displayName="Popup";var zr=nn,Zr=b.createContext(null),$r=Zr;function an(){}function Tn(){return""}function hn(q){return q?q.ownerDocument:window.document}var bn=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function Mn(q){var ce=function(ge){Object(o.a)(K,ge);var oe=Object(r.a)(K);function K(Y){var H;Object(E.a)(this,K),H=oe.call(this,Y),H.popupRef=b.createRef(),H.triggerRef=b.createRef(),H.attachId=void 0,H.clickOutsideHandler=void 0,H.touchOutsideHandler=void 0,H.contextMenuOutsideHandler1=void 0,H.contextMenuOutsideHandler2=void 0,H.mouseDownTimeout=void 0,H.focusTime=void 0,H.preClickTime=void 0,H.preTouchTime=void 0,H.delayTimer=void 0,H.hasPopupMouseDown=void 0,H.onMouseEnter=function(le){var ye=H.props.mouseEnterDelay;H.fireEvents("onMouseEnter",le),H.delaySetPopupVisible(!0,ye,ye?null:le)},H.onMouseMove=function(le){H.fireEvents("onMouseMove",le),H.setPoint(le)},H.onMouseLeave=function(le){H.fireEvents("onMouseLeave",le),H.delaySetPopupVisible(!1,H.props.mouseLeaveDelay)},H.onPopupMouseEnter=function(){H.clearDelayTimer()},H.onPopupMouseLeave=function(le){var ye;if(le.relatedTarget&&!le.relatedTarget.setTimeout&&Object(mt.a)((ye=H.popupRef.current)===null||ye===void 0?void 0:ye.getElement(),le.relatedTarget))return;H.delaySetPopupVisible(!1,H.props.mouseLeaveDelay)},H.onFocus=function(le){H.fireEvents("onFocus",le),H.clearDelayTimer(),H.isFocusToShow()&&(H.focusTime=Date.now(),H.delaySetPopupVisible(!0,H.props.focusDelay))},H.onMouseDown=function(le){H.fireEvents("onMouseDown",le),H.preClickTime=Date.now()},H.onTouchStart=function(le){H.fireEvents("onTouchStart",le),H.preTouchTime=Date.now()},H.onBlur=function(le){H.fireEvents("onBlur",le),H.clearDelayTimer(),H.isBlurToHide()&&H.delaySetPopupVisible(!1,H.props.blurDelay)},H.onContextMenu=function(le){le.preventDefault(),H.fireEvents("onContextMenu",le),H.setPopupVisible(!0,le)},H.onContextMenuClose=function(){H.isContextMenuToShow()&&H.close()},H.onClick=function(le){if(H.fireEvents("onClick",le),H.focusTime){var ye;if(H.preClickTime&&H.preTouchTime?ye=Math.min(H.preClickTime,H.preTouchTime):H.preClickTime?ye=H.preClickTime:H.preTouchTime&&(ye=H.preTouchTime),Math.abs(ye-H.focusTime)<20)return;H.focusTime=0}H.preClickTime=0,H.preTouchTime=0,H.isClickToShow()&&(H.isClickToHide()||H.isBlurToHide())&&le&&le.preventDefault&&le.preventDefault();var pe=!H.state.popupVisible;(H.isClickToHide()&&!pe||pe&&H.isClickToShow())&&H.setPopupVisible(!H.state.popupVisible,le)},H.onPopupMouseDown=function(){if(H.hasPopupMouseDown=!0,clearTimeout(H.mouseDownTimeout),H.mouseDownTimeout=window.setTimeout(function(){H.hasPopupMouseDown=!1},0),H.context){var le;(le=H.context).onPopupMouseDown.apply(le,arguments)}},H.onDocumentClick=function(le){if(H.props.mask&&!H.props.maskClosable)return;var ye=le.target,pe=H.getRootDomNode(),Te=H.getPopupDomNode();(!Object(mt.a)(pe,ye)||H.isContextMenuOnly())&&!Object(mt.a)(Te,ye)&&!H.hasPopupMouseDown&&H.close()},H.getRootDomNode=function(){var le=H.props.getTriggerDOMNode;if(le)return le(H.triggerRef.current);try{var ye=Object(ht.a)(H.triggerRef.current);if(ye)return ye}catch(pe){}return st.a.findDOMNode(Object(s.a)(H))},H.getPopupClassNameFromAlign=function(le){var ye=[],pe=H.props,Te=pe.popupPlacement,Ne=pe.builtinPlacements,Je=pe.prefixCls,Ye=pe.alignPoint,ut=pe.getPopupClassNameFromAlign;return Te&&Ne&&ye.push(Me(Ne,Je,le,Ye)),ut&&ye.push(ut(le)),ye.join(" ")},H.getComponent=function(){var le=H.props,ye=le.prefixCls,pe=le.destroyPopupOnHide,Te=le.popupClassName,Ne=le.onPopupAlign,Je=le.popupMotion,Ye=le.popupAnimation,ut=le.popupTransitionName,Rt=le.popupStyle,Wt=le.mask,Mt=le.maskAnimation,Ht=le.maskTransitionName,Kt=le.maskMotion,Ut=le.zIndex,jt=le.popup,qt=le.stretch,$t=le.alignPoint,Cr=le.mobile,cr=le.forceRender,Ot=H.state,wt=Ot.popupVisible,Jt=Ot.point,Zt=H.getPopupAlign(),Et={};return H.isMouseEnterToShow()&&(Et.onMouseEnter=H.onPopupMouseEnter),H.isMouseLeaveToHide()&&(Et.onMouseLeave=H.onPopupMouseLeave),Et.onMouseDown=H.onPopupMouseDown,Et.onTouchStart=H.onPopupMouseDown,b.createElement(zr,Object(u.a)({prefixCls:ye,destroyPopupOnHide:pe,visible:wt,point:$t&&Jt,className:Te,align:Zt,onAlign:Ne,animation:Ye,getClassNameFromAlign:H.getPopupClassNameFromAlign},Et,{stretch:qt,getRootDomNode:H.getRootDomNode,style:Rt,mask:Wt,zIndex:Ut,transitionName:ut,maskAnimation:Mt,maskTransitionName:Ht,maskMotion:Kt,ref:H.popupRef,motion:Je,mobile:Cr,forceRender:cr}),typeof jt=="function"?jt():jt)},H.attachParent=function(le){Ze.a.cancel(H.attachId);var ye=H.props,pe=ye.getPopupContainer,Te=ye.getDocument,Ne=H.getRootDomNode(),Je;pe?(Ne||pe.length===0)&&(Je=pe(Ne)):Je=Te(H.getRootDomNode()).body,Je?Je.appendChild(le):H.attachId=Object(Ze.a)(function(){H.attachParent(le)})},H.getContainer=function(){var le=H.props.getDocument,ye=le(H.getRootDomNode()).createElement("div");return ye.style.position="absolute",ye.style.top="0",ye.style.left="0",ye.style.width="100%",H.attachParent(ye),ye},H.setPoint=function(le){var ye=H.props.alignPoint;if(!ye||!le)return;H.setState({point:{pageX:le.pageX,pageY:le.pageY}})},H.handlePortalUpdate=function(){H.state.prevPopupVisible!==H.state.popupVisible&&H.props.afterPopupVisibleChange(H.state.popupVisible)},H.triggerContextValue={onPopupMouseDown:H.onPopupMouseDown};var ae;return"popupVisible"in Y?ae=!!Y.popupVisible:ae=!!Y.defaultPopupVisible,H.state={prevPopupVisible:ae,popupVisible:ae},bn.forEach(function(le){H["fire".concat(le)]=function(ye){H.fireEvents(le,ye)}}),H}return Object(g.a)(K,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var H=this.props,ae=this.state;if(ae.popupVisible){var le;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(le=H.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Ce.a)(le,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(le=le||H.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Ce.a)(le,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(le=le||H.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Ce.a)(le,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Ce.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),Ze.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var H;return((H=this.popupRef.current)===null||H===void 0?void 0:H.getElement())||null}},{key:"getPopupAlign",value:function(){var H=this.props,ae=H.popupPlacement,le=H.popupAlign,ye=H.builtinPlacements;return ae&&ye?Se(ye,ae,le):le}},{key:"setPopupVisible",value:function(H,ae){var le=this.props.alignPoint,ye=this.state.popupVisible;this.clearDelayTimer(),ye!==H&&("popupVisible"in this.props||this.setState({popupVisible:H,prevPopupVisible:ye}),this.props.onPopupVisibleChange(H)),le&&ae&&H&&this.setPoint(ae)}},{key:"delaySetPopupVisible",value:function(H,ae,le){var ye=this,pe=ae*1e3;if(this.clearDelayTimer(),pe){var Te=le?{pageX:le.pageX,pageY:le.pageY}:null;this.delayTimer=window.setTimeout(function(){ye.setPopupVisible(H,Te),ye.clearDelayTimer()},pe)}else this.setPopupVisible(H,le)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(H){var ae=this.props.children.props,le=this.props;return ae[H]&&le[H]?this["fire".concat(H)]:ae[H]||le[H]}},{key:"isClickToShow",value:function(){var H=this.props,ae=H.action,le=H.showAction;return ae.indexOf("click")!==-1||le.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var H=this.props.action;return H==="contextMenu"||H.length===1&&H[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var H=this.props,ae=H.action,le=H.showAction;return ae.indexOf("contextMenu")!==-1||le.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var H=this.props,ae=H.action,le=H.hideAction;return ae.indexOf("click")!==-1||le.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var H=this.props,ae=H.action,le=H.showAction;return ae.indexOf("hover")!==-1||le.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var H=this.props,ae=H.action,le=H.hideAction;return ae.indexOf("hover")!==-1||le.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var H=this.props,ae=H.action,le=H.showAction;return ae.indexOf("focus")!==-1||le.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var H=this.props,ae=H.action,le=H.hideAction;return ae.indexOf("focus")!==-1||le.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var H;(H=this.popupRef.current)===null||H===void 0||H.forceAlign()}}},{key:"fireEvents",value:function(H,ae){var le=this.props.children.props[H];le&&le(ae);var ye=this.props[H];ye&&ye(ae)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var H=this.state.popupVisible,ae=this.props,le=ae.children,ye=ae.forceRender,pe=ae.alignPoint,Te=ae.className,Ne=ae.autoDestroy,Je=b.Children.only(le),Ye={key:"trigger"};this.isContextMenuToShow()?Ye.onContextMenu=this.onContextMenu:Ye.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(Ye.onClick=this.onClick,Ye.onMouseDown=this.onMouseDown,Ye.onTouchStart=this.onTouchStart):(Ye.onClick=this.createTwoChains("onClick"),Ye.onMouseDown=this.createTwoChains("onMouseDown"),Ye.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(Ye.onMouseEnter=this.onMouseEnter,pe&&(Ye.onMouseMove=this.onMouseMove)):Ye.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?Ye.onMouseLeave=this.onMouseLeave:Ye.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(Ye.onFocus=this.onFocus,Ye.onBlur=this.onBlur):(Ye.onFocus=this.createTwoChains("onFocus"),Ye.onBlur=this.createTwoChains("onBlur"));var ut=j()(Je&&Je.props&&Je.props.className,Te);ut&&(Ye.className=ut);var Rt=Object(k.a)({},Ye);Object(me.c)(Je)&&(Rt.ref=Object(me.a)(this.triggerRef,Je.ref));var Wt=b.cloneElement(Je,Rt),Mt;return(H||this.popupRef.current||ye)&&(Mt=b.createElement(q,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!H&&Ne&&(Mt=null),b.createElement($r.Provider,{value:this.triggerContextValue},Wt,Mt)}}],[{key:"getDerivedStateFromProps",value:function(H,ae){var le=H.popupVisible,ye={};return le!==void 0&&ae.popupVisible!==le&&(ye.popupVisible=le,ye.prevPopupVisible=ae.popupVisible),ye}}]),K}(b.Component);return ce.contextType=$r,ce.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:Tn,getDocument:hn,onPopupVisibleChange:an,afterPopupVisibleChange:an,onPopupAlign:an,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},ce}var on=Mn(_e.a),Rr={adjustX:1,adjustY:1},qr={topLeft:{points:["bl","tl"],overflow:Rr,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Rr,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Rr,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Rr,offset:[4,0]}},Sn={topLeft:{points:["bl","tl"],overflow:Rr,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Rr,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Rr,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Rr,offset:[4,0]}},fn=qr,sr=0,Ft={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},vr=function(ce,ge,oe){var K=ie(ge),Y=ce.getState();ce.setState({defaultActiveFirst:Object(k.a)(Object(k.a)({},Y.defaultActiveFirst),{},Object(Z.a)({},K,oe))})},Xt=function(q){Object(o.a)(ge,q);var ce=Object(r.a)(ge);function ge(oe){var K;Object(E.a)(this,ge),K=ce.call(this,oe),K.onDestroy=function(pe){K.props.onDestroy(pe)},K.onKeyDown=function(pe){var Te=pe.keyCode,Ne=K.menuInstance,Je=K.props.store,Ye=K.getVisible();if(Te===v.a.ENTER)return K.onTitleClick(pe),vr(Je,K.props.eventKey,!0),!0;if(Te===v.a.RIGHT)return Ye?Ne.onKeyDown(pe):(K.triggerOpenChange(!0),vr(Je,K.props.eventKey,!0)),!0;if(Te===v.a.LEFT){var ut;if(Ye)ut=Ne.onKeyDown(pe);else return;return ut||(K.triggerOpenChange(!1),ut=!0),ut}return Ye&&(Te===v.a.UP||Te===v.a.DOWN)?Ne.onKeyDown(pe):void 0},K.onOpenChange=function(pe){K.props.onOpenChange(pe)},K.onPopupVisibleChange=function(pe){K.triggerOpenChange(pe,pe?"mouseenter":"mouseleave")},K.onMouseEnter=function(pe){var Te=K.props,Ne=Te.eventKey,Je=Te.onMouseEnter,Ye=Te.store;vr(Ye,K.props.eventKey,!1),Je({key:Ne,domEvent:pe})},K.onMouseLeave=function(pe){var Te=K.props,Ne=Te.parentMenu,Je=Te.eventKey,Ye=Te.onMouseLeave;Ne.subMenuInstance=Object(s.a)(K),Ye({key:Je,domEvent:pe})},K.onTitleMouseEnter=function(pe){var Te=K.props,Ne=Te.eventKey,Je=Te.onItemHover,Ye=Te.onTitleMouseEnter;Je({key:Ne,hover:!0}),Ye({key:Ne,domEvent:pe})},K.onTitleMouseLeave=function(pe){var Te=K.props,Ne=Te.parentMenu,Je=Te.eventKey,Ye=Te.onItemHover,ut=Te.onTitleMouseLeave;Ne.subMenuInstance=Object(s.a)(K),Ye({key:Je,hover:!1}),ut({key:Je,domEvent:pe})},K.onTitleClick=function(pe){var Te=Object(s.a)(K),Ne=Te.props;if(Ne.onTitleClick({key:Ne.eventKey,domEvent:pe}),Ne.triggerSubMenuAction==="hover")return;K.triggerOpenChange(!K.getVisible(),"click"),vr(Ne.store,K.props.eventKey,!1)},K.onSubMenuClick=function(pe){typeof K.props.onClick=="function"&&K.props.onClick(K.addKeyPath(pe))},K.onSelect=function(pe){K.props.onSelect(pe)},K.onDeselect=function(pe){K.props.onDeselect(pe)},K.getPrefixCls=function(){return"".concat(K.props.rootPrefixCls,"-submenu")},K.getActiveClassName=function(){return"".concat(K.getPrefixCls(),"-active")},K.getDisabledClassName=function(){return"".concat(K.getPrefixCls(),"-disabled")},K.getSelectedClassName=function(){return"".concat(K.getPrefixCls(),"-selected")},K.getOpenClassName=function(){return"".concat(K.props.rootPrefixCls,"-submenu-open")},K.getVisible=function(){return K.state.isOpen},K.getMode=function(){return K.state.mode},K.saveMenuInstance=function(pe){K.menuInstance=pe},K.addKeyPath=function(pe){return Object(k.a)(Object(k.a)({},pe),{},{keyPath:(pe.keyPath||[]).concat(K.props.eventKey)})},K.triggerOpenChange=function(pe,Te){var Ne=K.props.eventKey,Je=function(){K.onOpenChange({key:Ne,item:Object(s.a)(K),trigger:Te,open:pe})};Te==="mouseenter"?K.mouseenterTimeout=setTimeout(function(){Je()},0):Je()},K.isChildrenSelected=function(){var pe={find:!1};return Re(K.props.children,K.props.selectedKeys,pe),pe.find},K.isInlineMode=function(){return K.getMode()==="inline"},K.adjustWidth=function(){if(!K.subMenuTitle||!K.menuInstance)return;var pe=rt.findDOMNode(K.menuInstance);if(pe.offsetWidth>=K.subMenuTitle.offsetWidth)return;pe.style.minWidth="".concat(K.subMenuTitle.offsetWidth,"px")},K.saveSubMenuTitle=function(pe){K.subMenuTitle=pe},K.getBaseProps=function(){var pe=Object(s.a)(K),Te=pe.props,Ne=K.getMode();return{mode:Ne==="horizontal"?"vertical":Ne,visible:K.getVisible(),level:Te.level+1,inlineIndent:Te.inlineIndent,focusable:!1,onClick:K.onSubMenuClick,onSelect:K.onSelect,onDeselect:K.onDeselect,onDestroy:K.onDestroy,selectedKeys:Te.selectedKeys,eventKey:"".concat(Te.eventKey,"-menu-"),openKeys:Te.openKeys,motion:Te.motion,onOpenChange:K.onOpenChange,subMenuOpenDelay:Te.subMenuOpenDelay,parentMenu:Object(s.a)(K),subMenuCloseDelay:Te.subMenuCloseDelay,forceSubMenuRender:Te.forceSubMenuRender,triggerSubMenuAction:Te.triggerSubMenuAction,builtinPlacements:Te.builtinPlacements,defaultActiveFirst:Te.store.getState().defaultActiveFirst[ie(Te.eventKey)],multiple:Te.multiple,prefixCls:Te.rootPrefixCls,id:K.internalMenuId,manualRef:K.saveMenuInstance,itemIcon:Te.itemIcon,expandIcon:Te.expandIcon,direction:Te.direction}},K.getMotion=function(pe,Te){var Ne=Object(s.a)(K),Je=Ne.haveRendered,Ye=K.props,ut=Ye.motion,Rt=Ye.rootPrefixCls,Wt=Object(k.a)(Object(k.a)({},ut),{},{leavedClassName:"".concat(Rt,"-hidden"),removeOnLeave:!1,motionAppear:Je||!Te||pe!=="inline"});return Wt};var Y=oe.store,H=oe.eventKey,ae=Y.getState(),le=ae.defaultActiveFirst;K.isRootMenu=!1;var ye=!1;return le&&(ye=le[H]),vr(Y,H,ye),K.state={mode:oe.mode,isOpen:oe.isOpen},K}return Object(g.a)(ge,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var K=this,Y=this.props,H=Y.mode,ae=Y.parentMenu,le=Y.manualRef,ye=Y.isOpen,pe=function(){K.setState({mode:H,isOpen:ye})},Te=ye!==this.state.isOpen,Ne=H!==this.state.mode;if((Ne||Te)&&(Ze.a.cancel(this.updateStateRaf),Ne?this.updateStateRaf=Object(Ze.a)(pe):pe()),le&&le(this),H!=="horizontal"||!(ae==null?void 0:ae.isRootMenu)||!ye)return;this.minWidthTimeout=setTimeout(function(){return K.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var K=this.props,Y=K.onDestroy,H=K.eventKey;Y&&Y(H),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),Ze.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(K,Y){var H=this.getBaseProps();return b.createElement(On,Object(u.a)({},H,{id:this.internalMenuId,className:K,style:Y}),this.props.children)}},{key:"renderChildren",value:function(){var K=this,Y=this.getBaseProps(),H=Y.mode,ae=Y.visible,le=Y.forceSubMenuRender,ye=Y.direction,pe=this.getMotion(H,ae);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||ae||le,!this.haveOpened)return b.createElement("div",null);var Te=j()("".concat(Y.prefixCls,"-sub"),Object(Z.a)({},"".concat(Y.prefixCls,"-rtl"),ye==="rtl"));return this.isInlineMode()?b.createElement(F,Object(u.a)({visible:Y.visible,forceRender:le},pe),function(Ne){var Je=Ne.className,Ye=Ne.style,ut=j()(Te,Je);return K.renderPopupMenu(ut,Ye)}):this.renderPopupMenu(Te)}},{key:"render",value:function(){var K,Y,H,ae=Object(k.a)({},this.props),le=this.getVisible(),ye=this.getPrefixCls(),pe=this.isInlineMode(),Te=this.getMode(),Ne=j()(ye,"".concat(ye,"-").concat(Te),(K={},Object(Z.a)(K,ae.className,!!ae.className),Object(Z.a)(K,this.getOpenClassName(),le),Object(Z.a)(K,this.getActiveClassName(),ae.active||le&&!pe),Object(Z.a)(K,this.getDisabledClassName(),ae.disabled),Object(Z.a)(K,this.getSelectedClassName(),this.isChildrenSelected()),K));this.internalMenuId||(ae.eventKey?this.internalMenuId="".concat(ae.eventKey,"$Menu"):(sr+=1,this.internalMenuId="$__$".concat(sr,"$Menu")));var Je={},Ye={},ut={};ae.disabled||(Je={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Ye={onClick:this.onTitleClick},ut={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Rt={},Wt=ae.direction,Mt=Wt==="rtl";pe&&(Mt?Rt.paddingRight=ae.inlineIndent*ae.level:Rt.paddingLeft=ae.inlineIndent*ae.level);var Ht={};this.getVisible()&&(Ht={"aria-owns":this.internalMenuId});var Kt=null;Te!=="horizontal"&&(Kt=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(Kt=b.createElement(this.props.expandIcon,Object(k.a)({},this.props))));var Ut=b.createElement("div",Object(u.a)({ref:this.saveSubMenuTitle,style:Rt,className:"".concat(ye,"-title"),role:"button"},ut,Ye,{"aria-expanded":le},Ht,{"aria-haspopup":"true",title:typeof ae.title=="string"?ae.title:void 0}),ae.title,Kt||b.createElement("i",{className:"".concat(ye,"-arrow")})),jt=this.renderChildren(),qt=((Y=ae.parentMenu)===null||Y===void 0?void 0:Y.isRootMenu)?ae.parentMenu.props.getPopupContainer:function(xr){return xr.parentNode},$t=Ft[Te],Cr=ae.popupOffset?{offset:ae.popupOffset}:{},cr=j()((H={},Object(Z.a)(H,ae.popupClassName,ae.popupClassName&&!pe),Object(Z.a)(H,"".concat(ye,"-rtl"),Mt),H)),Ot=ae.disabled,wt=ae.triggerSubMenuAction,Jt=ae.subMenuOpenDelay,Zt=ae.forceSubMenuRender,Et=ae.subMenuCloseDelay,er=ae.builtinPlacements;Ue.forEach(function(xr){return delete ae[xr]}),delete ae.onClick;var br=Mt?Object(k.a)(Object(k.a)({},Sn),er):Object(k.a)(Object(k.a)({},qr),er);delete ae.direction;var tr=this.getBaseProps(),pr=pe?null:this.getMotion(tr.mode,tr.visible);return b.createElement("li",Object(u.a)({},ae,Je,{className:Ne,role:"menuitem"}),b.createElement(on,{prefixCls:ye,popupClassName:j()("".concat(ye,"-popup"),cr),getPopupContainer:qt,builtinPlacements:br,popupPlacement:$t,popupVisible:pe?!1:le,popupAlign:Cr,popup:pe?null:jt,action:Ot||pe?[]:[wt],mouseEnterDelay:Jt,mouseLeaveDelay:Et,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Zt,popupMotion:pr},Ut),pe?jt:null)}}]),ge}(b.Component);Xt.defaultProps={onMouseEnter:Xe,onMouseLeave:Xe,onTitleMouseEnter:Xe,onTitleMouseLeave:Xe,onTitleClick:Xe,manualRef:Xe,mode:"vertical",title:""};var Tr=Object(t.b)(function(q,ce){var ge=q.openKeys,oe=q.activeKey,K=q.selectedKeys,Y=ce.eventKey,H=ce.subMenuKey;return{isOpen:ge.indexOf(Y)>-1,active:oe[H]===Y,selectedKeys:K}})(Xt);Tr.isSubMenu=!0;var or=Tr,pn="menuitem-overflowed",Sr=.5,En=function(q){Object(o.a)(ge,q);var ce=Object(r.a)(ge);function ge(){var oe;return Object(E.a)(this,ge),oe=ce.apply(this,arguments),oe.resizeObserver=null,oe.mutationObserver=null,oe.originalTotalWidth=0,oe.overflowedItems=[],oe.menuItemSizes=[],oe.cancelFrameId=null,oe.state={lastVisibleIndex:void 0},oe.childRef=b.createRef(),oe.getMenuItemNodes=function(){var K=oe.props.prefixCls,Y=oe.childRef.current;return Y?[].slice.call(Y.children).filter(function(H){return H.className.split(" ").indexOf("".concat(K,"-overflowed-submenu"))<0}):[]},oe.getOverflowedSubMenuItem=function(K,Y,H){var ae=oe.props,le=ae.overflowedIndicator,ye=ae.level,pe=ae.mode,Te=ae.prefixCls,Ne=ae.theme;if(ye!==1||pe!=="horizontal")return null;var Je=oe.props.children[0],Ye=Je.props,ut=Ye.children,Rt=Ye.title,Wt=Ye.style,Mt=Object(_.a)(Ye,["children","title","style"]),Ht=Object(k.a)({},Wt),Kt="".concat(K,"-overflowed-indicator"),Ut="".concat(K,"-overflowed-indicator");Y.length===0&&H!==!0?Ht=Object(k.a)(Object(k.a)({},Ht),{},{display:"none"}):H&&(Ht=Object(k.a)(Object(k.a)({},Ht),{},{visibility:"hidden",position:"absolute"}),Kt="".concat(Kt,"-placeholder"),Ut="".concat(Ut,"-placeholder"));var jt=Ne?"".concat(Te,"-").concat(Ne):"",qt={};return Ue.forEach(function($t){Mt[$t]!==void 0&&(qt[$t]=Mt[$t])}),b.createElement(or,Object(u.a)({title:le,className:"".concat(Te,"-overflowed-submenu"),popupClassName:jt},qt,{key:Kt,eventKey:Ut,disabled:!1,style:Ht}),Y)},oe.setChildrenWidthAndResize=function(){if(oe.props.mode!=="horizontal")return;var K=oe.childRef.current;if(!K)return;var Y=K.children;if(!Y||Y.length===0)return;var H=K.children[Y.length-1];He(H,"display","inline-block");var ae=oe.getMenuItemNodes(),le=ae.filter(function(ye){return ye.className.split(" ").indexOf(pn)>=0});le.forEach(function(ye){He(ye,"display","inline-block")}),oe.menuItemSizes=ae.map(function(ye){return Ie(ye,!0)}),le.forEach(function(ye){He(ye,"display","none")}),oe.overflowedIndicatorWidth=Ie(K.children[K.children.length-1],!0),oe.originalTotalWidth=oe.menuItemSizes.reduce(function(ye,pe){return ye+pe},0),oe.handleResize(),He(H,"display","none")},oe.handleResize=function(){if(oe.props.mode!=="horizontal")return;var K=oe.childRef.current;if(!K)return;var Y=Ie(K);oe.overflowedItems=[];var H=0,ae;oe.originalTotalWidth>Y+Sr&&(ae=-1,oe.menuItemSizes.forEach(function(le){H+=le,H+oe.overflowedIndicatorWidth<=Y&&(ae+=1)})),oe.setState({lastVisibleIndex:ae})},oe}return Object(g.a)(ge,[{key:"componentDidMount",value:function(){var K=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Y=this.childRef.current;if(!Y)return;this.resizeObserver=new ct.default(function(H){H.forEach(function(){var ae=K.cancelFrameId;cancelAnimationFrame(ae),K.cancelFrameId=requestAnimationFrame(K.setChildrenWidthAndResize)})}),[].slice.call(Y.children).concat(Y).forEach(function(H){K.resizeObserver.observe(H)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){K.resizeObserver.disconnect(),[].slice.call(Y.children).concat(Y).forEach(function(H){K.resizeObserver.observe(H)}),K.setChildrenWidthAndResize()}),this.mutationObserver.observe(Y,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(K){var Y=this,H=this.state.lastVisibleIndex;return(K||[]).reduce(function(ae,le,ye){var pe=le;if(Y.props.mode==="horizontal"){var Te=Y.getOverflowedSubMenuItem(le.props.eventKey,[]);H!==void 0&&Y.props.className.indexOf("".concat(Y.props.prefixCls,"-root"))!==-1&&(ye>H&&(pe=b.cloneElement(le,{style:{display:"none"},eventKey:"".concat(le.props.eventKey,"-hidden"),className:"".concat(pn)})),ye===H+1&&(Y.overflowedItems=K.slice(H+1).map(function(Je){return b.cloneElement(Je,{key:Je.props.eventKey,mode:"vertical-left"})}),Te=Y.getOverflowedSubMenuItem(le.props.eventKey,Y.overflowedItems)));var Ne=[].concat(Object(w.a)(ae),[Te,pe]);return ye===K.length-1&&Ne.push(Y.getOverflowedSubMenuItem(le.props.eventKey,[],!0)),Ne}return[].concat(Object(w.a)(ae),[pe])},[])}},{key:"render",value:function(){var K=this.props,Y=K.visible,H=K.prefixCls,ae=K.overflowedIndicator,le=K.mode,ye=K.level,pe=K.tag,Te=K.children,Ne=K.theme,Je=Object(_.a)(K,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Ye=pe;return b.createElement(Ye,Object(u.a)({ref:this.childRef},Je),this.renderChildren(Te))}}]),ge}(b.Component);En.defaultProps={tag:"div",className:""};var sn=En;function mn(q){return q.length?q.every(function(ce){return!!ce.props.disabled}):!0}function ln(q,ce,ge){var oe=q.getState();q.setState({activeKey:Object(k.a)(Object(k.a)({},oe.activeKey),{},Object(Z.a)({},ce,ge))})}function Br(q){return q.eventKey||"0-menu-"}function wn(q,ce){var ge=ce,oe=q.children,K=q.eventKey;if(ge){var Y;if(be(oe,function(H,ae){H&&H.props&&!H.props.disabled&&ge===ee(H,K,ae)&&(Y=!0)}),Y)return ge}return ge=null,q.defaultActiveFirst&&be(oe,function(H,ae){!ge&&H&&!H.props.disabled&&(ge=ee(H,K,ae))}),ge}function un(q){if(!q)return;var ce=this.instanceArray.indexOf(q);ce!==-1?this.instanceArray[ce]=q:this.instanceArray.push(q)}var Kn=function(q){Object(o.a)(ge,q);var ce=Object(r.a)(ge);function ge(oe){var K;return Object(E.a)(this,ge),K=ce.call(this,oe),K.onKeyDown=function(Y,H){var ae=Y.keyCode,le;if(K.getFlatInstanceArray().forEach(function(pe){pe&&pe.props.active&&pe.onKeyDown&&(le=pe.onKeyDown(Y))}),le)return 1;var ye=null;return(ae===v.a.UP||ae===v.a.DOWN)&&(ye=K.step(ae===v.a.UP?-1:1)),ye?(Y.preventDefault(),ln(K.props.store,Br(K.props),ye.props.eventKey),typeof H=="function"&&H(ye),1):void 0},K.onItemHover=function(Y){var H=Y.key,ae=Y.hover;ln(K.props.store,Br(K.props),ae?H:null)},K.onDeselect=function(Y){K.props.onDeselect(Y)},K.onSelect=function(Y){K.props.onSelect(Y)},K.onClick=function(Y){K.props.onClick(Y)},K.onOpenChange=function(Y){K.props.onOpenChange(Y)},K.onDestroy=function(Y){K.props.onDestroy(Y)},K.getFlatInstanceArray=function(){return K.instanceArray},K.step=function(Y){var H=K.getFlatInstanceArray(),ae=K.props.store.getState().activeKey[Br(K.props)],le=H.length;if(!le)return null;Y<0&&(H=H.concat().reverse());var ye=-1;if(H.every(function(Je,Ye){return Je&&Je.props.eventKey===ae?(ye=Ye,!1):!0}),!K.props.defaultActiveFirst&&ye!==-1&&mn(H.slice(ye,le-1)))return;var pe=(ye+1)%le,Te=pe;do{var Ne=H[Te];if(!Ne||Ne.props.disabled)Te=(Te+1)%le;else return Ne}while(Te!==pe);return null},K.renderCommonMenuItem=function(Y,H,ae){var le=K.props.store.getState(),ye=Object(s.a)(K),pe=ye.props,Te=ee(Y,pe.eventKey,H),Ne=Y.props;if(!Ne||typeof Y.type=="string")return Y;var Je=Te===le.activeKey,Ye=Object(k.a)(Object(k.a)({mode:Ne.mode||pe.mode,level:pe.level,inlineIndent:pe.inlineIndent,renderMenuItem:K.renderMenuItem,rootPrefixCls:pe.prefixCls,index:H,parentMenu:pe.parentMenu,manualRef:Ne.disabled?void 0:Object(x.a)(Y.ref,un.bind(Object(s.a)(K))),eventKey:Te,active:!Ne.disabled&&Je,multiple:pe.multiple,onClick:function(Rt){(Ne.onClick||Xe)(Rt),K.onClick(Rt)},onItemHover:K.onItemHover,motion:pe.motion,subMenuOpenDelay:pe.subMenuOpenDelay,subMenuCloseDelay:pe.subMenuCloseDelay,forceSubMenuRender:pe.forceSubMenuRender,onOpenChange:K.onOpenChange,onDeselect:K.onDeselect,onSelect:K.onSelect,builtinPlacements:pe.builtinPlacements,itemIcon:Ne.itemIcon||K.props.itemIcon,expandIcon:Ne.expandIcon||K.props.expandIcon},ae),{},{direction:pe.direction});return(pe.mode==="inline"||Ge())&&(Ye.triggerSubMenuAction="click"),b.cloneElement(Y,Object(k.a)(Object(k.a)({},Ye),{},{key:Te||H}))},K.renderMenuItem=function(Y,H,ae){if(!Y)return null;var le=K.props.store.getState(),ye={openKeys:le.openKeys,selectedKeys:le.selectedKeys,triggerSubMenuAction:K.props.triggerSubMenuAction,subMenuKey:ae};return K.renderCommonMenuItem(Y,H,ye)},oe.store.setState({activeKey:Object(k.a)(Object(k.a)({},oe.store.getState().activeKey),{},Object(Z.a)({},oe.eventKey,wn(oe,oe.activeKey)))}),K.instanceArray=[],K}return Object(g.a)(ge,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(K){return this.props.visible||K.visible||this.props.className!==K.className||!R()(this.props.style,K.style)}},{key:"componentDidUpdate",value:function(K){var Y=this.props,H="activeKey"in Y?Y.activeKey:Y.store.getState().activeKey[Br(Y)],ae=wn(Y,H);if(ae!==H)ln(Y.store,Br(Y),ae);else if("activeKey"in K){var le=wn(K,K.activeKey);ae!==le&&ln(Y.store,Br(Y),ae)}}},{key:"render",value:function(){var K=this,Y=Object(u.a)({},this.props);this.instanceArray=[];var H=j()(Y.prefixCls,Y.className,"".concat(Y.prefixCls,"-").concat(Y.mode)),ae={className:H,role:Y.role||"menu"};Y.id&&(ae.id=Y.id),Y.focusable&&(ae.tabIndex=0,ae.onKeyDown=this.onKeyDown);var le=Y.prefixCls,ye=Y.eventKey,pe=Y.visible,Te=Y.level,Ne=Y.mode,Je=Y.overflowedIndicator,Ye=Y.theme;return Ue.forEach(function(ut){return delete Y[ut]}),delete Y.onClick,b.createElement(sn,Object(u.a)({},Y,{prefixCls:le,mode:Ne,tag:"ul",level:Te,theme:Ye,visible:pe,overflowedIndicator:Je},ae),Object(M.a)(Y.children).map(function(ut,Rt){return K.renderMenuItem(ut,Rt,ye||"0-menu-")}))}}]),ge}(b.Component);Kn.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:Xe};var Hn=Object(t.b)()(Kn),On=Hn,vn=U("Kwbf");function In(q,ce,ge){var oe=q.prefixCls,K=q.motion,Y=q.defaultMotions,H=Y===void 0?{}:Y,ae=q.openAnimation,le=q.openTransitionName,ye=ce.switchingModeFromInline;if(K)return K;if(Object(I.a)(ae)==="object"&&ae)Object(vn.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof ae=="string")return{motionName:"".concat(oe,"-open-").concat(ae)};if(le)return{motionName:le};var pe=H[ge];return pe||(ye?null:H.other)}var Gr=function(q){Object(o.a)(ge,q);var ce=Object(r.a)(ge);function ge(oe){var K;Object(E.a)(this,ge),K=ce.call(this,oe),K.onSelect=function(ae){var le=Object(s.a)(K),ye=le.props;if(ye.selectable){var pe=K.store.getState(),Te=pe.selectedKeys,Ne=ae.key;ye.multiple?Te=Te.concat([Ne]):Te=[Ne],"selectedKeys"in ye||K.store.setState({selectedKeys:Te}),ye.onSelect(Object(k.a)(Object(k.a)({},ae),{},{selectedKeys:Te}))}},K.onClick=function(ae){var le=K.getRealMenuMode(),ye=Object(s.a)(K),pe=ye.store,Te=ye.props.onOpenChange;le!=="inline"&&!("openKeys"in K.props)&&(pe.setState({openKeys:[]}),Te([])),K.props.onClick(ae)},K.onKeyDown=function(ae,le){K.innerMenu.getWrappedInstance().onKeyDown(ae,le)},K.onOpenChange=function(ae){var le=Object(s.a)(K),ye=le.props,pe=K.store.getState().openKeys.concat(),Te=!1,Ne=function(Ye){var ut=!1;if(Ye.open)ut=pe.indexOf(Ye.key)===-1,ut&&pe.push(Ye.key);else{var Rt=pe.indexOf(Ye.key);ut=Rt!==-1,ut&&pe.splice(Rt,1)}Te=Te||ut};Array.isArray(ae)?ae.forEach(Ne):Ne(ae),Te&&("openKeys"in K.props||K.store.setState({openKeys:pe}),ye.onOpenChange(pe))},K.onDeselect=function(ae){var le=Object(s.a)(K),ye=le.props;if(ye.selectable){var pe=K.store.getState().selectedKeys.concat(),Te=ae.key,Ne=pe.indexOf(Te);Ne!==-1&&pe.splice(Ne,1),"selectedKeys"in ye||K.store.setState({selectedKeys:pe}),ye.onDeselect(Object(k.a)(Object(k.a)({},ae),{},{selectedKeys:pe}))}},K.onMouseEnter=function(ae){K.restoreModeVerticalFromInline();var le=K.props.onMouseEnter;le&&le(ae)},K.onTransitionEnd=function(ae){var le=ae.propertyName==="width"&&ae.target===ae.currentTarget,ye=ae.target.className,pe=Object.prototype.toString.call(ye)==="[object SVGAnimatedString]"?ye.animVal:ye,Te=ae.propertyName==="font-size"&&pe.indexOf("anticon")>=0;(le||Te)&&K.restoreModeVerticalFromInline()},K.setInnerMenu=function(ae){K.innerMenu=ae},K.isRootMenu=!0;var Y=oe.defaultSelectedKeys,H=oe.defaultOpenKeys;return"selectedKeys"in oe&&(Y=oe.selectedKeys||[]),"openKeys"in oe&&(H=oe.openKeys||[]),K.store=Object(t.c)({selectedKeys:Y,openKeys:H,activeKey:{"0-menu-":wn(oe,oe.activeKey)}}),K.state={switchingModeFromInline:!1,prevProps:oe,inlineOpenKeys:[],store:K.store},K}return Object(g.a)(ge,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(K){var Y=this.props,H=Y.siderCollapsed,ae=Y.inlineCollapsed,le=Y.onOpenChange;(!K.inlineCollapsed&&ae||!K.siderCollapsed&&H)&&le([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var K=this.props.collapsedWidth,Y=this.store,H=this.prevOpenKeys,ae=this.getInlineCollapsed()&&(K===0||K==="0"||K==="0px");ae?(this.prevOpenKeys=Y.getState().openKeys.concat(),this.store.setState({openKeys:[]})):H&&(this.store.setState({openKeys:H}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var K=this.props.mode,Y=this.state.switchingModeFromInline,H=this.getInlineCollapsed();return Y&&H?"inline":H?"vertical":K}},{key:"getInlineCollapsed",value:function(){var K=this.props,Y=K.inlineCollapsed,H=K.siderCollapsed;return H!==void 0?H:Y}},{key:"restoreModeVerticalFromInline",value:function(){var K=this.state.switchingModeFromInline;K&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var K=Object(k.a)({},Object(T.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Y=this.getRealMenuMode();return K.className+=" ".concat(K.prefixCls,"-root"),K.direction==="rtl"&&(K.className+=" ".concat(K.prefixCls,"-rtl")),K=Object(k.a)(Object(k.a)({},K),{},{mode:Y,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:In(this.props,this.state,Y)}),delete K.openAnimation,delete K.openTransitionName,b.createElement(t.a,{store:this.store},b.createElement(On,Object(u.a)({},K,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(K,Y){var H=Y.prevProps,ae=Y.store,le=ae.getState(),ye={},pe={prevProps:K};return H.mode==="inline"&&K.mode!=="inline"&&(pe.switchingModeFromInline=!0),"openKeys"in K?ye.openKeys=K.openKeys||[]:((K.inlineCollapsed&&!H.inlineCollapsed||K.siderCollapsed&&!H.siderCollapsed)&&(pe.switchingModeFromInline=!0,pe.inlineOpenKeys=le.openKeys,ye.openKeys=[]),(!K.inlineCollapsed&&H.inlineCollapsed||!K.siderCollapsed&&H.siderCollapsed)&&(ye.openKeys=Y.inlineOpenKeys,pe.inlineOpenKeys=[])),Object.keys(ye).length&&ae.setState(ye),pe}}]),ge}(b.Component);Gr.defaultProps={selectable:!0,onClick:Xe,onSelect:Xe,onOpenChange:Xe,onDeselect:Xe,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:b.createElement("span",null,"\xB7\xB7\xB7")};var kn=Gr,dn=function(q){Object(o.a)(ge,q);var ce=Object(r.a)(ge);function ge(){var oe;return Object(E.a)(this,ge),oe=ce.apply(this,arguments),oe.onKeyDown=function(K){var Y=K.keyCode;return Y===v.a.ENTER?(oe.onClick(K),!0):void 0},oe.onMouseLeave=function(K){var Y=oe.props,H=Y.eventKey,ae=Y.onItemHover,le=Y.onMouseLeave;ae({key:H,hover:!1}),le({key:H,domEvent:K})},oe.onMouseEnter=function(K){var Y=oe.props,H=Y.eventKey,ae=Y.onItemHover,le=Y.onMouseEnter;ae({key:H,hover:!0}),le({key:H,domEvent:K})},oe.onClick=function(K){var Y=oe.props,H=Y.eventKey,ae=Y.multiple,le=Y.onClick,ye=Y.onSelect,pe=Y.onDeselect,Te=Y.isSelected,Ne={key:H,keyPath:[H],item:Object(s.a)(oe),domEvent:K};le(Ne),ae?Te?pe(Ne):ye(Ne):Te||ye(Ne)},oe.saveNode=function(K){oe.node=K},oe}return Object(g.a)(ge,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var K=this.props;K.onDestroy&&K.onDestroy(K.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var K,Y=Object(k.a)({},this.props),H=j()(this.getPrefixCls(),Y.className,(K={},Object(Z.a)(K,this.getActiveClassName(),!Y.disabled&&Y.active),Object(Z.a)(K,this.getSelectedClassName(),Y.isSelected),Object(Z.a)(K,this.getDisabledClassName(),Y.disabled),K)),ae=Object(k.a)(Object(k.a)({},Y.attribute),{},{title:typeof Y.title=="string"?Y.title:void 0,className:H,role:Y.role||"menuitem","aria-disabled":Y.disabled});Y.role==="option"?ae=Object(k.a)(Object(k.a)({},ae),{},{role:"option","aria-selected":Y.isSelected}):(Y.role===null||Y.role==="none")&&(ae.role="none");var le={onClick:Y.disabled?null:this.onClick,onMouseLeave:Y.disabled?null:this.onMouseLeave,onMouseEnter:Y.disabled?null:this.onMouseEnter},ye=Object(k.a)({},Y.style);Y.mode==="inline"&&(Y.direction==="rtl"?ye.paddingRight=Y.inlineIndent*Y.level:ye.paddingLeft=Y.inlineIndent*Y.level),Ue.forEach(function(Te){return delete Y[Te]}),delete Y.direction;var pe=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(pe=b.createElement(this.props.itemIcon,this.props)),b.createElement("li",Object(u.a)({},Object(T.a)(Y,["onClick","onMouseEnter","onMouseLeave","onSelect"]),ae,le,{style:ye,ref:this.saveNode}),Y.children,pe)}}]),ge}(b.Component);dn.isMenuItem=!0,dn.defaultProps={onSelect:Xe,onMouseEnter:Xe,onMouseLeave:Xe,manualRef:Xe};var Nn=Object(t.b)(function(q,ce){var ge=q.activeKey,oe=q.selectedKeys,K=ce.eventKey,Y=ce.subMenuKey;return{active:ge[Y]===K,isSelected:Array.isArray(oe)?oe.indexOf(K)!==-1:oe===K}})(dn),_n=Nn,gn=function(q){Object(o.a)(ge,q);var ce=Object(r.a)(ge);function ge(){var oe;return Object(E.a)(this,ge),oe=ce.apply(this,arguments),oe.renderInnerMenuItem=function(K){var Y=oe.props,H=Y.renderMenuItem,ae=Y.index;return H(K,ae,oe.props.subMenuKey)},oe}return Object(g.a)(ge,[{key:"render",value:function(){var K=Object(u.a)({},this.props),Y=K.className,H=Y===void 0?"":Y,ae=K.rootPrefixCls,le="".concat(ae,"-item-group-title"),ye="".concat(ae,"-item-group-list"),pe=K.title,Te=K.children;return Ue.forEach(function(Ne){return delete K[Ne]}),delete K.direction,b.createElement("li",Object(u.a)({},K,{onClick:function(Je){return Je.stopPropagation()},className:"".concat(H," ").concat(ae,"-item-group")}),b.createElement("div",{className:le,title:typeof pe=="string"?pe:void 0},pe),b.createElement("ul",{className:ye},b.Children.map(Te,this.renderInnerMenuItem)))}}]),ge}(b.Component);gn.isMenuItemGroup=!0,gn.defaultProps={disabled:!0};var Vn=gn,Un=function(ce){var ge=ce.className,oe=ce.rootPrefixCls,K=ce.style;return b.createElement("li",{className:"".concat(ge," ").concat(oe,"-item-divider"),style:K})};Un.defaultProps={disabled:!0,className:"",style:{}};var jn=Un,Yr=kn,Bn=U("eDIo");function Xn(q,ce){var ge=q.prefixCls,oe=q.editable,K=q.locale,Y=q.style;return!oe||oe.showAdd===!1?null:b.createElement("button",{ref:ce,type:"button",className:"".concat(ge,"-nav-add"),style:Y,"aria-label":(K==null?void 0:K.addAriaLabel)||"Add tab",onClick:function(ae){oe.onEdit("add",{event:ae})}},oe.addIcon||"+")}var An=b.forwardRef(Xn);function $n(q,ce){var ge=q.prefixCls,oe=q.id,K=q.tabs,Y=q.locale,H=q.mobile,ae=q.moreIcon,le=ae===void 0?"More":ae,ye=q.moreTransitionName,pe=q.style,Te=q.className,Ne=q.editable,Je=q.tabBarGutter,Ye=q.rtl,ut=q.onTabClick,Rt=Object(b.useState)(!1),Wt=Object(N.a)(Rt,2),Mt=Wt[0],Ht=Wt[1],Kt=Object(b.useState)(null),Ut=Object(N.a)(Kt,2),jt=Ut[0],qt=Ut[1],$t="".concat(oe,"-more-popup"),Cr="".concat(ge,"-dropdown"),cr=jt!==null?"".concat($t,"-").concat(jt):null,Ot=Y==null?void 0:Y.dropdownAriaLabel,wt=b.createElement(Yr,{onClick:function(pr){var xr=pr.key,Fr=pr.domEvent;ut(xr,Fr),Ht(!1)},id:$t,tabIndex:-1,role:"listbox","aria-activedescendant":cr,selectedKeys:[jt],"aria-label":Ot!==void 0?Ot:"expanded dropdown"},K.map(function(tr){return b.createElement(_n,{key:tr.key,id:"".concat($t,"-").concat(tr.key),role:"option","aria-controls":oe&&"".concat(oe,"-panel-").concat(tr.key),disabled:tr.disabled},tr.tab)}));function Jt(tr){for(var pr=K.filter(function(Qr){return!Qr.disabled}),xr=pr.findIndex(function(Qr){return Qr.key===jt})||0,Fr=pr.length,Jr=0;Jr<Fr;Jr+=1){xr=(xr+tr+Fr)%Fr;var wr=pr[xr];if(!wr.disabled){qt(wr.key);return}}}function Zt(tr){var pr=tr.which;if(!Mt){[v.a.DOWN,v.a.SPACE,v.a.ENTER].includes(pr)&&(Ht(!0),tr.preventDefault());return}switch(pr){case v.a.UP:Jt(-1),tr.preventDefault();break;case v.a.DOWN:Jt(1),tr.preventDefault();break;case v.a.ESC:Ht(!1);break;case v.a.SPACE:case v.a.ENTER:jt!==null&&ut(jt,tr);break}}Object(b.useEffect)(function(){var tr=document.getElementById(cr);tr&&tr.scrollIntoView&&tr.scrollIntoView(!1)},[jt]),Object(b.useEffect)(function(){Mt||qt(null)},[Mt]);var Et=Object(Z.a)({},Ye?"marginLeft":"marginRight",Je);K.length||(Et.visibility="hidden",Et.order=1);var er=j()(Object(Z.a)({},"".concat(Cr,"-rtl"),Ye)),br=H?null:b.createElement(Bn.a,{prefixCls:Cr,overlay:wt,trigger:["hover"],visible:Mt,transitionName:ye,onVisibleChange:Ht,overlayClassName:er,mouseEnterDelay:.1,mouseLeaveDelay:.1},b.createElement("button",{type:"button",className:"".concat(ge,"-nav-more"),style:Et,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":$t,id:"".concat(oe,"-more"),"aria-expanded":Mt,onKeyDown:Zt},le));return b.createElement("div",{className:j()("".concat(ge,"-nav-operations"),Te),style:pe,ref:ce},br,b.createElement(An,{prefixCls:ge,locale:Y,editable:Ne}))}var Yn=b.forwardRef($n),$e=Object(b.createContext)(null),De=.1,Be=.01,et=20,bt=Math.pow(.995,et);function Tt(){var q=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(q)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(q.substr(0,4)))}function lr(q,ce){var ge=Object(b.useState)(),oe=Object(N.a)(ge,2),K=oe[0],Y=oe[1],H=Object(b.useState)(0),ae=Object(N.a)(H,2),le=ae[0],ye=ae[1],pe=Object(b.useState)(0),Te=Object(N.a)(pe,2),Ne=Te[0],Je=Te[1],Ye=Object(b.useState)(),ut=Object(N.a)(Ye,2),Rt=ut[0],Wt=ut[1],Mt=Object(b.useRef)();function Ht(Ot){var wt=Ot.touches[0],Jt=wt.screenX,Zt=wt.screenY;Y({x:Jt,y:Zt}),window.clearInterval(Mt.current)}function Kt(Ot){if(!K)return;Ot.preventDefault();var wt=Ot.touches[0],Jt=wt.screenX,Zt=wt.screenY;Y({x:Jt,y:Zt});var Et=Jt-K.x,er=Zt-K.y;ce(Et,er);var br=Date.now();ye(br),Je(br-le),Wt({x:Et,y:er})}function Ut(){if(!K)return;if(Y(null),Wt(null),Rt){var Ot=Rt.x/Ne,wt=Rt.y/Ne,Jt=Math.abs(Ot),Zt=Math.abs(wt);if(Math.max(Jt,Zt)<De)return;var Et=Ot,er=wt;Mt.current=window.setInterval(function(){if(Math.abs(Et)<Be&&Math.abs(er)<Be){window.clearInterval(Mt.current);return}Et*=bt,er*=bt,ce(Et*et,er*et)},et)}}var jt=Object(b.useRef)(0),qt=Object(b.useRef)(!1),$t=Object(b.useRef)();function Cr(Ot){var wt=Ot.deltaX,Jt=Ot.deltaY,Zt=0,Et=Math.abs(wt),er=Math.abs(Jt);Et===er?Zt=$t.current==="x"?wt:Jt:Et>er?(Zt=wt,$t.current="x"):(Zt=Jt,$t.current="y");var br=Date.now();br-jt.current>100&&(qt.current=!1),(ce(-Zt,-Zt)||qt.current)&&(Ot.preventDefault(),qt.current=!0),jt.current=br}var cr=Object(b.useRef)(null);cr.current={onTouchStart:Ht,onTouchMove:Kt,onTouchEnd:Ut,onWheel:Cr},b.useEffect(function(){function Ot(Et){cr.current.onTouchStart(Et)}function wt(Et){cr.current.onTouchMove(Et)}function Jt(Et){cr.current.onTouchEnd(Et)}function Zt(Et){cr.current.onWheel(Et)}return document.addEventListener("touchmove",wt,{passive:!1}),document.addEventListener("touchend",Jt,{passive:!1}),q.current.addEventListener("touchstart",Ot,{passive:!1}),q.current.addEventListener("wheel",Zt),function(){document.removeEventListener("touchmove",wt),document.removeEventListener("touchend",Jt)}},[])}function Pr(){var q=Object(b.useRef)(new Map);function ce(oe){return q.current.has(oe)||q.current.set(oe,b.createRef()),q.current.get(oe)}function ge(oe){q.current.delete(oe)}return[ce,ge]}function Dr(q,ce){var ge=b.useRef(q),oe=b.useState({}),K=Object(N.a)(oe,2),Y=K[1];function H(ae){var le=typeof ae=="function"?ae(ge.current):ae;le!==ge.current&&ce(le,ge.current),ge.current=le,Y({})}return[ge.current,H]}var ir=function(ce){var ge=ce.position,oe=ce.prefixCls,K=ce.extra;if(!K)return null;var Y,H=K;return ge==="right"&&(Y=H.right||!H.left&&H||null),ge==="left"&&(Y=H.left||null),Y?b.createElement("div",{className:"".concat(oe,"-extra-content")},Y):null};function Rn(q,ce){var ge,oe=b.useContext($e),K=oe.prefixCls,Y=oe.tabs,H=q.className,ae=q.style,le=q.id,ye=q.animated,pe=q.activeKey,Te=q.rtl,Ne=q.extra,Je=q.editable,Ye=q.locale,ut=q.tabPosition,Rt=q.tabBarGutter,Wt=q.children,Mt=q.onTabClick,Ht=q.onTabScroll,Kt=Object(b.useRef)(),Ut=Object(b.useRef)(),jt=Object(b.useRef)(),qt=Object(b.useRef)(),$t=Pr(),Cr=Object(N.a)($t,2),cr=Cr[0],Ot=Cr[1],wt=ut==="top"||ut==="bottom",Jt=Dr(0,function(hr,Qt){wt&&Ht&&Ht({direction:hr>Qt?"left":"right"})}),Zt=Object(N.a)(Jt,2),Et=Zt[0],er=Zt[1],br=Dr(0,function(hr,Qt){!wt&&Ht&&Ht({direction:hr>Qt?"top":"bottom"})}),tr=Object(N.a)(br,2),pr=tr[0],xr=tr[1],Fr=Object(b.useState)(0),Jr=Object(N.a)(Fr,2),wr=Jr[0],Qr=Jr[1],yn=Object(b.useState)(0),en=Object(N.a)(yn,2),tn=en[0],Lr=en[1],Vr=Object(b.useState)(0),Wr=Object(N.a)(Vr,2),Ir=Wr[0],Dn=Wr[1],Ln=Object(b.useState)(0),Fn=Object(N.a)(Ln,2),gr=Fn[0],xn=Fn[1],Wn=Object(b.useState)(null),Er=Object(N.a)(Wn,2),ur=Er[0],Kr=Er[1],Gi=Object(b.useState)(null),gi=Object(N.a)(Gi,2),zn=gi[0],Vi=gi[1],Xi=Object(b.useState)(0),yi=Object(N.a)(Xi,2),$i=yi[0],Yi=yi[1],Ji=Object(b.useState)(0),bi=Object(N.a)(Ji,2),Qi=bi[0],Zi=bi[1],qi=f(new Map),Ei=Object(N.a)(qi,2),ea=Ei[0],ta=Ei[1],ii=i(Y,ea,wr),xi="".concat(K,"-nav-operations-hidden"),Jn=0,Qn=0;wt?Te?(Jn=0,Qn=Math.max(0,wr-ur)):(Jn=Math.min(0,ur-wr),Qn=0):(Jn=Math.min(0,zn-tn),Qn=0);function ai(hr){return hr<Jn?[Jn,!1]:hr>Qn?[Qn,!1]:[hr,!0]}var Ci=Object(b.useRef)(),ra=Object(b.useState)(),Ti=Object(N.a)(ra,2),oi=Ti[0],Si=Ti[1];function si(){Si(Date.now())}function li(){window.clearTimeout(Ci.current)}lr(Kt,function(hr,Qt){var kr=!1;function rn(qn,ei){qn(function(ti){var ri=ai(ti+ei),Gn=Object(N.a)(ri,2),hi=Gn[0],fi=Gn[1];return kr=fi,hi})}if(wt){if(ur>=wr)return kr;rn(er,hr)}else{if(zn>=tn)return kr;rn(xr,Qt)}return li(),si(),kr}),Object(b.useEffect)(function(){return li(),oi&&(Ci.current=window.setTimeout(function(){Si(0)},100)),li},[oi]);function wi(){var hr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:pe,Qt=ii.get(hr);if(!Qt)return;if(wt){var kr=Et;Te?Qt.right<Et?kr=Qt.right:Qt.right+Qt.width>Et+ur&&(kr=Qt.right+Qt.width-ur):Qt.left<-Et?kr=-Qt.left:Qt.left+Qt.width>-Et+ur&&(kr=-(Qt.left+Qt.width-ur)),xr(0),er(ai(kr)[0])}else{var rn=pr;Qt.top<-pr?rn=-Qt.top:Qt.top+Qt.height>-pr+zn&&(rn=-(Qt.top+Qt.height-zn)),er(0),xr(ai(rn)[0])}}var na=d(ii,{width:ur,height:zn,left:Et,top:pr},{width:Ir,height:gr},{width:$i,height:Qi},Object(k.a)(Object(k.a)({},q),{},{tabs:Y})),Oi=Object(N.a)(na,2),ia=Oi[0],aa=Oi[1],oa=Y.map(function(hr){var Qt=hr.key;return b.createElement(e,{id:le,prefixCls:K,key:Qt,rtl:Te,tab:hr,closable:hr.closable,editable:Je,active:Qt===pe,tabPosition:ut,tabBarGutter:Rt,renderWrapper:Wt,removeAriaLabel:Ye==null?void 0:Ye.removeAriaLabel,ref:cr(Qt),onClick:function(rn){Mt(Qt,rn)},onRemove:function(){Ot(Qt)},onFocus:function(){wi(Qt),si(),Te||(Kt.current.scrollLeft=0),Kt.current.scrollTop=0}})}),ui=m(function(){var hr,Qt,kr,rn,qn,ei,ti,ri,Gn,hi=((hr=Kt.current)===null||hr===void 0?void 0:hr.offsetWidth)||0,fi=((Qt=Kt.current)===null||Qt===void 0?void 0:Qt.offsetHeight)||0,Ii=((kr=qt.current)===null||kr===void 0?void 0:kr.offsetWidth)||0,ki=((rn=qt.current)===null||rn===void 0?void 0:rn.offsetHeight)||0,ha=((qn=jt.current)===null||qn===void 0?void 0:qn.offsetWidth)||0,fa=((ei=jt.current)===null||ei===void 0?void 0:ei.offsetHeight)||0;Kr(hi),Vi(fi),Yi(Ii),Zi(ki);var Ni=(((ti=Ut.current)===null||ti===void 0?void 0:ti.offsetWidth)||0)-Ii,Ui=(((ri=Ut.current)===null||ri===void 0?void 0:ri.offsetHeight)||0)-ki;Qr(Ni),Lr(Ui);var ji=(Gn=jt.current)===null||Gn===void 0?void 0:Gn.className.includes(xi);Dn(Ni-(ji?0:ha)),xn(Ui-(ji?0:fa)),ta(function(){var Bi=new Map;return Y.forEach(function(pa){var Fi=pa.key,ni=cr(Fi).current;ni&&Bi.set(Fi,{width:ni.offsetWidth,height:ni.offsetHeight,left:ni.offsetLeft,top:ni.offsetTop})}),Bi})}),sa=Y.slice(0,ia),la=Y.slice(aa+1),_i=[].concat(Object(w.a)(sa),Object(w.a)(la)),ua=Object(b.useState)(),Ai=Object(N.a)(ua,2),da=Ai[0],ca=Ai[1],Pn=ii.get(pe),Ri=Object(b.useRef)();function Di(){y.a.cancel(Ri.current)}Object(b.useEffect)(function(){var hr={};return Pn&&(wt?(Te?hr.right=Pn.right:hr.left=Pn.left,hr.width=Pn.width):(hr.top=Pn.top,hr.height=Pn.height)),Di(),Ri.current=y()(function(){ca(hr)}),Di},[Pn,wt,Te]),Object(b.useEffect)(function(){wi()},[pe,Pn,ii,wt]),Object(b.useEffect)(function(){ui()},[Te,Rt,pe,Y.map(function(hr){return hr.key}).join("_")]);var Li=!!_i.length,Zn="".concat(K,"-nav-wrap"),di,ci,Pi,Mi;return wt?Te?(ci=Et>0,di=Et+ur<wr):(di=Et<0,ci=-Et+ur<wr):(Pi=pr<0,Mi=-pr+zn<tn),b.createElement("div",{ref:ce,role:"tablist",className:j()("".concat(K,"-nav"),H),style:ae,onKeyDown:function(){si()}},b.createElement(ir,{position:"left",extra:Ne,prefixCls:K}),b.createElement(C.a,{onResize:ui},b.createElement("div",{className:j()(Zn,(ge={},Object(Z.a)(ge,"".concat(Zn,"-ping-left"),di),Object(Z.a)(ge,"".concat(Zn,"-ping-right"),ci),Object(Z.a)(ge,"".concat(Zn,"-ping-top"),Pi),Object(Z.a)(ge,"".concat(Zn,"-ping-bottom"),Mi),ge)),ref:Kt},b.createElement(C.a,{onResize:ui},b.createElement("div",{ref:Ut,className:"".concat(K,"-nav-list"),style:{transform:"translate(".concat(Et,"px, ").concat(pr,"px)"),transition:oi?"none":void 0}},oa,b.createElement(An,{ref:qt,prefixCls:K,locale:Ye,editable:Je,style:{visibility:Li?"hidden":null}}),b.createElement("div",{className:j()("".concat(K,"-ink-bar"),Object(Z.a)({},"".concat(K,"-ink-bar-animated"),ye.inkBar)),style:da}))))),b.createElement(Yn,Object.assign({},q,{ref:jt,prefixCls:K,tabs:_i,className:!Li&&xi})),b.createElement(ir,{position:"right",extra:Ne,prefixCls:K}))}var cn=b.forwardRef(Rn);function Wi(q){var ce=q.id,ge=q.activeKey,oe=q.animated,K=q.tabPosition,Y=q.rtl,H=q.destroyInactiveTabPane,ae=b.useContext($e),le=ae.prefixCls,ye=ae.tabs,pe=oe.tabPane,Te=ye.findIndex(function(Ne){return Ne.key===ge});return b.createElement("div",{className:j()("".concat(le,"-content-holder"))},b.createElement("div",{className:j()("".concat(le,"-content"),"".concat(le,"-content-").concat(K),Object(Z.a)({},"".concat(le,"-content-animated"),pe)),style:Te&&pe?Object(Z.a)({},Y?"marginRight":"marginLeft","-".concat(Te,"00%")):null},ye.map(function(Ne){return b.cloneElement(Ne.node,{key:Ne.key,prefixCls:le,tabKey:Ne.key,id:ce,animated:pe,active:Ne.key===ge,destroyInactiveTabPane:H})})))}function pi(q){var ce=q.prefixCls,ge=q.forceRender,oe=q.className,K=q.style,Y=q.id,H=q.active,ae=q.animated,le=q.destroyInactiveTabPane,ye=q.tabKey,pe=q.children,Te=b.useState(ge),Ne=Object(N.a)(Te,2),Je=Ne[0],Ye=Ne[1];b.useEffect(function(){H?Ye(!0):le&&Ye(!1)},[H,le]);var ut={};return H||(ae?(ut.visibility="hidden",ut.height=0,ut.overflowY="hidden"):ut.display="none"),b.createElement("div",{id:Y&&"".concat(Y,"-panel-").concat(ye),role:"tabpanel",tabIndex:H?0:-1,"aria-labelledby":Y&&"".concat(Y,"-tab-").concat(ye),"aria-hidden":!H,style:Object(k.a)(Object(k.a)({},ut),K),className:j()("".concat(ce,"-tabpane"),H&&"".concat(ce,"-tabpane-active"),oe)},(H||Je||ge)&&pe)}var mi=0;function Ki(q){return Object(M.a)(q).map(function(ce){if(b.isValidElement(ce)){var ge=ce.key!==void 0?String(ce.key):void 0;return Object(k.a)(Object(k.a)({key:ge},ce.props),{},{node:ce})}return null}).filter(function(ce){return ce})}function Hi(q,ce){var ge,oe=q.id,K=q.prefixCls,Y=K===void 0?"rc-tabs":K,H=q.className,ae=q.children,le=q.direction,ye=q.activeKey,pe=q.defaultActiveKey,Te=q.editable,Ne=q.animated,Je=q.tabPosition,Ye=Je===void 0?"top":Je,ut=q.tabBarGutter,Rt=q.tabBarStyle,Wt=q.tabBarExtraContent,Mt=q.locale,Ht=q.moreIcon,Kt=q.moreTransitionName,Ut=q.destroyInactiveTabPane,jt=q.renderTabBar,qt=q.onChange,$t=q.onTabClick,Cr=q.onTabScroll,cr=Object(_.a)(q,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),Ot=Ki(ae),wt=le==="rtl",Jt;Ne===!1?Jt={inkBar:!1,tabPane:!1}:Jt=Object(k.a)({inkBar:!0,tabPane:!1},Ne!==!0?Ne:null);var Zt=Object(b.useState)(!1),Et=Object(N.a)(Zt,2),er=Et[0],br=Et[1];Object(b.useEffect)(function(){br(Tt())},[]);var tr=Object(O.a)(function(){var gr;return(gr=Ot[0])===null||gr===void 0?void 0:gr.key},{value:ye,defaultValue:pe}),pr=Object(N.a)(tr,2),xr=pr[0],Fr=pr[1],Jr=Object(b.useState)(function(){return Ot.findIndex(function(gr){return gr.key===xr})}),wr=Object(N.a)(Jr,2),Qr=wr[0],yn=wr[1];Object(b.useEffect)(function(){var gr=Ot.findIndex(function(Wn){return Wn.key===xr});if(gr===-1){var xn;gr=Math.max(0,Math.min(Qr,Ot.length-1)),Fr((xn=Ot[gr])===null||xn===void 0?void 0:xn.key)}yn(gr)},[Ot.map(function(gr){return gr.key}).join("_"),xr,Qr]);var en=Object(O.a)(null,{value:oe}),tn=Object(N.a)(en,2),Lr=tn[0],Vr=tn[1],Wr=Ye;er&&!["left","right"].includes(Ye)&&(Wr="top"),Object(b.useEffect)(function(){oe||(Vr("rc-tabs-".concat(mi)),mi+=1)},[]);function Ir(gr,xn){$t==null||$t(gr,xn),Fr(gr),qt==null||qt(gr)}var Dn={id:Lr,activeKey:xr,animated:Jt,tabPosition:Wr,rtl:wt,mobile:er},Ln,Fn=Object(k.a)(Object(k.a)({},Dn),{},{editable:Te,locale:Mt,moreIcon:Ht,moreTransitionName:Kt,tabBarGutter:ut,onTabClick:Ir,onTabScroll:Cr,extra:Wt,style:Rt,panes:ae});return jt?Ln=jt(Fn,cn):Ln=b.createElement(cn,Object.assign({},Fn)),b.createElement($e.Provider,{value:{tabs:Ot,prefixCls:Y}},b.createElement("div",Object.assign({ref:ce,id:oe,className:j()(Y,"".concat(Y,"-").concat(Wr),(ge={},Object(Z.a)(ge,"".concat(Y,"-mobile"),er),Object(Z.a)(ge,"".concat(Y,"-editable"),Te),Object(Z.a)(ge,"".concat(Y,"-rtl"),wt),ge),H)},cr),Ln,b.createElement(Wi,Object.assign({destroyInactiveTabPane:Ut},Dn,{animated:Jt}))))}var vi=b.forwardRef(Hi);vi.TabPane=pi;var zi=vi,ma=fe.b=zi},n6Qo:function(ot,fe,U){"use strict";U.d(fe,"a",function(){return M});var Z=U("q1tI"),N=U("biw7"),_=U("fyJ8");function k(O){var w=O.className,c=O.index,y=O.children,C=O.colSpan,m=O.rowSpan,f=Z.useContext(N.a),v=f.prefixCls,a=f.fixedInfoList,e=a[c];return Z.createElement(_.a,Object.assign({className:w,index:c,component:"td",prefixCls:v,record:null,dataIndex:null,render:function(){return{children:y,props:{colSpan:C,rowSpan:m}}}},e))}function b(O){return Z.createElement("tr",Object.assign({},O))}function S(O){var w=O.children,c=Z.useContext(N.a),y=c.prefixCls;return Z.createElement("tfoot",{className:"".concat(y,"-summary")},w)}var j=fe.b=S,M={Cell:k,Row:b}},nnTU:function(ot,fe,U){"use strict";U.d(fe,"b",function(){return M}),U.d(fe,"a",function(){return O});var Z=U("pmY6"),N=U("746U"),_=U("Cg/j"),k=U("MI8n"),b=U("24hK"),S=U("QDVR"),j=function(){for(var w=0,c=0,y=arguments.length;c<y;c++)w+=arguments[c].length;for(var C=Array(w),m=0,c=0;c<y;c++)for(var f=arguments[c],v=0,a=f.length;v<a;v++,m++)C[m]=f[v];return C},M=Object(_.c)("commandService"),O=new(function(){function w(){this._commands=new Map,this._onDidRegisterCommand=new k.a,this.onDidRegisterCommand=this._onDidRegisterCommand.event}return w.prototype.registerCommand=function(c,y){var C=this;if(!c)throw new Error("invalid command");if(typeof c=="string"){if(!y)throw new Error("invalid command");return this.registerCommand({id:c,handler:y})}if(c.description){for(var m=[],f=0,v=c.description.args;f<v.length;f++){var a=v[f];m.push(a.constraint)}var e=c.handler;c.handler=function(u){for(var E=[],g=1;g<arguments.length;g++)E[g-1]=arguments[g];return Object(N.m)(E,m),e.apply(void 0,j([u],E))}}var n=c.id,i=this._commands.get(n);i||(i=new b.a,this._commands.set(n,i));var h=i.unshift(c),d=Object(Z.h)(function(){h();var u=C._commands.get(n);(u==null?void 0:u.isEmpty())&&C._commands.delete(n)});return this._onDidRegisterCommand.fire(n),d},w.prototype.registerCommandAlias=function(c,y){return O.registerCommand(c,function(C){for(var m,f=[],v=1;v<arguments.length;v++)f[v-1]=arguments[v];return(m=C.get(M)).executeCommand.apply(m,j([y],f))})},w.prototype.getCommand=function(c){var y=this._commands.get(c);return!y||y.isEmpty()?void 0:y.iterator().next().value},w.prototype.getCommands=function(){for(var c=new Map,y=0,C=Object(S.d)(this._commands);y<C.length;y++){var m=C[y],f=this.getCommand(m);f&&c.set(m,f)}return c},w}())},p5ED:function(ot,fe,U){"use strict";var Z=U("+L6B"),N=U("2/Rp"),_=U("5Dmo"),k=U("3S7+"),b=U("k1fw"),S=U("9og8"),j=U("tJVT"),M=U("WmNS"),O=U.n(M),w=U("q1tI"),c=U.n(w),y=U("vHTk"),C=U.n(y),m=U("yEEn"),f=U("ZW9T"),v=U("1vsH"),a=U("V0Rq"),e=U("m3rI");fe.a=function(n){var i,h,d,u,E,g,s=n.editOffice,o=s===void 0?"view":s,r=n.name,t=n.data,T=n.theme,x=n.type,A=n.filename,R=n.monacoEditor,I=n.className,B=n.style,W=n.close,$=n.onClose,X=n.hasMask,V=n.disabledDownload,se=n.onImgDimensions,xe=n.otherData,Ee=Object(w.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),je=Object(j.a)(Ee,2),Ae=je[0],Oe=je[1],Le=Object(w.useState)(""),Pe=Object(j.a)(Le,2),he=Pe[0],Q=Pe[1],Ke=Object(w.useState)(),it=Object(j.a)(Ke,2),Qe=it[0],Xe=it[1],ee=window.ENV==="build"?"/react/build":"",ie=location.host.startsWith("localhost")?e.a.PROXY_SERVER:e.a.API_SERVER,be,Re=1024*1024,Ue=10*Re,Ie=Object(w.useRef)();(i=t)!==null&&i!==void 0&&i.startsWith("/api")&&x!=="txt"&&(t=e.a.API_SERVER+t),x==="office"&&(be=Object(v.P)(t).filesize,be>Ue&&(x="other")),A&&(R.filename=A),Object(w.useEffect)(function(){var rt,st,Ze=(rt=document.cookie)===null||rt===void 0||((st=rt.replace(/\s/g,""))===null||st===void 0)?void 0:st.split(";");Ze==null||Ze.map(function(mt){var ht=mt.split("=");ht[0]==="_educoder_session"&&Q(ht[1])})},[]),Object(w.useEffect)(function(){x==="office"&&He()},[x,t]);var He=function(){var rt=Object(S.a)(O.a.mark(function st(){var Ze,mt,ht;return O.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return console.log("data:",t),Ze=t,t.startsWith("http")||(Ze=location.origin+Ze),mt=new URL(Ze).pathname.split("/").pop(),Ce.next=6,Object(a.U)({attachment_id:mt});case 6:ht=Ce.sent,Xe(ht);case 8:case"end":return Ce.stop()}},st)}));return function(){return rt.apply(this,arguments)}}(),Ge=function(){if(t.startsWith("http")||t.startsWith("blob:")){ct();return}Object(v.x)(A||"educoder",t,A)},ct=function(){Object(v.v)(A||"educoder",decodeURIComponent(t))};return c.a.createElement("div",{style:Object(b.a)({},B||{}),className:"".concat(X&&C.a.bgBlack," ").concat(x?C.a.wrp:"hide")},W&&c.a.createElement("div",{className:C.a.close,ref:Ie},!!se&&c.a.createElement(k.a,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:function(){return Ie.current}},c.a.createElement("span",{onClick:function(){$(),se()}},c.a.createElement("i",{className:"icon-yulanpizhu"}))),!V&&c.a.createElement(k.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ie.current}},c.a.createElement("span",{onClick:ct},c.a.createElement("i",{className:"icon-quxiaozhiding"}))),c.a.createElement(k.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ie.current}},c.a.createElement("span",{className:"",onClick:$},c.a.createElement("i",{className:"icon-guanbi1"})))),c.a.createElement("div",{className:"".concat(C.a[I]," ").concat(I," ").concat(C.a.monaco," ").concat(x==="txt"?"show":"hide")},x==="txt"&&c.a.createElement(f.b,R)),x==="audio"&&c.a.createElement("audio",{src:"".concat(((h=t)===null||h===void 0?void 0:h.indexOf("http://"))>-1||((d=t)===null||d===void 0?void 0:d.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(t),autoPlay:!0}),x==="video"&&c.a.createElement(c.a.Fragment,null,((u=t)===null||u===void 0?void 0:u.indexOf("http"))>-1?c.a.createElement("video",{controls:!0,src:"".concat(t),autoPlay:!0}):c.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(t),autoPlay:!0})),x==="office"&&Qe&&c.a.createElement("iframe",{src:"".concat(ee,"/office.html?key=").concat(Qe.key,"&url=").concat(ie+Qe.url,"&callbackUrl=").concat(ie+Qe.callbackUrl,"&fileType=").concat(Qe.fileType,"&title=").concat(Qe.title,"&model=").concat(o,"&officeServer=").concat(e.a.OFFICE_SERVER,"&disabledDownload=").concat(!!V)}),(x==="xlsx"||x==="doc"||x==="pptx"||x==="docx")&&c.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(xe.key,"&url=").concat(e.a.API_SERVER+xe.url,"&callbackUrl=").concat(e.a.API_SERVER+xe.callbackUrl,"&fileType=").concat(xe.fileType,"&title=").concat(xe.title,"&model=").concat(xe.model)}),x==="html"&&c.a.createElement("iframe",{src:t+"&disposition=inline"}),x==="pdf"&&c.a.createElement("embed",{className:C.a.embed,src:t}),x==="image"&&c.a.createElement("img",{src:"".concat(((E=t)===null||E===void 0?void 0:E.indexOf("http://"))>-1||((g=t)===null||g===void 0?void 0:g.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(t)}),x==="other"&&c.a.createElement("div",null,c.a.createElement(N.a,{type:"primary",size:"large",onClick:Ge},c.a.createElement(m.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),x==="download"&&c.a.createElement(N.a,{type:"primary",size:"large",onClick:Ge},c.a.createElement(m.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},pIsd:function(ot,fe,U){var Z=U("BJfS"),N=function(b){var S=/[height|width]$/;return S.test(b)},_=function(b){var S="",j=Object.keys(b);return j.forEach(function(M,O){var w=b[M];M=Z(M),N(M)&&typeof w=="number"&&(w=w+"px"),w===!0?S+=M:w===!1?S+="not "+M:S+="("+M+": "+w+")",O<j.length-1&&(S+=" and ")}),S},k=function(b){var S="";return typeof b=="string"?b:b instanceof Array?(b.forEach(function(j,M){S+=_(j),M<b.length-1&&(S+=", ")}),S):_(b)};ot.exports=k},pmY6:function(ot,fe,U){"use strict";U.d(fe,"g",function(){return b}),U.d(fe,"f",function(){return S}),U.d(fe,"e",function(){return j}),U.d(fe,"h",function(){return M}),U.d(fe,"b",function(){return O}),U.d(fe,"a",function(){return w}),U.d(fe,"d",function(){return c}),U.d(fe,"c",function(){return y});var Z=!1,N="__is_disposable_tracked__";function _(C){if(!Z)return;if(C&&C!==w.None)try{C[N]=!0}catch(m){}}function k(C){if(!Z)return C;var m=new Error("Potentially leaked disposable").stack;return setTimeout(function(){C[N]||console.log(m)},3e3),C}function b(C){return typeof C.dispose=="function"&&C.dispose.length===0}function S(C){return Array.isArray(C)?(C.forEach(function(m){m&&(_(m),m.dispose())}),[]):C?(_(C),C.dispose(),C):void 0}function j(){for(var C=[],m=0;m<arguments.length;m++)C[m]=arguments[m];return C.forEach(_),k({dispose:function(){return S(C)}})}function M(C){var m=k({dispose:function(){_(m),C()}});return m}var O=function(){function C(){this._toDispose=new Set,this._isDisposed=!1}return C.prototype.dispose=function(){if(this._isDisposed)return;_(this),this._isDisposed=!0,this.clear()},C.prototype.clear=function(){this._toDispose.forEach(function(m){return m.dispose()}),this._toDispose.clear()},C.prototype.add=function(m){if(!m)return m;if(m===this)throw new Error("Cannot register a disposable on itself!");return _(m),this._isDisposed?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(m),m},C}(),w=function(){function C(){this._store=new O,k(this)}return C.prototype.dispose=function(){_(this),this._store.dispose()},C.prototype._register=function(m){if(m===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(m)},C.None=Object.freeze({dispose:function(){}}),C}(),c=function(){function C(){this._isDisposed=!1,k(this)}return Object.defineProperty(C.prototype,"value",{get:function(){return this._isDisposed?void 0:this._value},set:function(m){if(this._isDisposed||m===this._value)return;this._value&&this._value.dispose(),m&&_(m),this._value=m},enumerable:!0,configurable:!0}),C.prototype.clear=function(){this.value=void 0},C.prototype.dispose=function(){this._isDisposed=!0,_(this),this._value&&this._value.dispose(),this._value=void 0},C}(),y=function(){function C(m){this.object=m}return C.prototype.dispose=function(){},C}()},"rAM+":function(ot,fe,U){"use strict";U.d(fe,"a",function(){return N});var Z=U("Qw5x");function N(_,k){var b;if(typeof Symbol=="undefined"||_[Symbol.iterator]==null){if(Array.isArray(_)||(b=Object(Z.a)(_))||k&&_&&typeof _.length=="number"){b&&(_=b);var S=0,j=function(){};return{s:j,n:function(){return S>=_.length?{done:!0}:{done:!1,value:_[S++]}},e:function(y){throw y},f:j}}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 M=!0,O=!1,w;return{s:function(){b=_[Symbol.iterator]()},n:function(){var y=b.next();return M=y.done,y},e:function(y){O=!0,w=y},f:function(){try{!M&&b.return!=null&&b.return()}finally{if(O)throw w}}}}},rUJ1:function(ot,fe){const U=/[&<>"']/,Z=/[&<>"']/g,N=/[<>"']|&(?!#?\w+;)/,_=/[<>"']|&(?!#?\w+;)/g,k={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},b=g=>k[g];function S(g,s){if(s){if(U.test(g))return g.replace(Z,b)}else if(N.test(g))return g.replace(_,b);return g}const j=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function M(g){return g.replace(j,(s,o)=>(o=o.toLowerCase(),o==="colon"?":":o.charAt(0)==="#"?o.charAt(1)==="x"?String.fromCharCode(parseInt(o.substring(2),16)):String.fromCharCode(+o.substring(1)):""))}const O=/(^|[^\[])\^/g;function w(g,s){g=g.source||g,s=s||"";const o={replace:(r,t)=>(t=t.source||t,t=t.replace(O,"$1"),g=g.replace(r,t),o),getRegex:()=>new RegExp(g,s)};return o}const c=/[^\w:]/g,y=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function C(g,s,o){if(g){let r;try{r=decodeURIComponent(M(o)).replace(c,"").toLowerCase()}catch(t){return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}s&&!y.test(o)&&(o=e(s,o));try{o=encodeURI(o).replace(/%25/g,"%")}catch(r){return null}return o}const m={},f=/^[^:]+:\/*[^/]*$/,v=/^([^:]+:)[\s\S]*$/,a=/^([^:]+:\/*[^/]*)[\s\S]*$/;function e(g,s){m[" "+g]||(f.test(g)?m[" "+g]=g+"/":m[" "+g]=d(g,"/",!0)),g=m[" "+g];const o=g.indexOf(":")===-1;return s.substring(0,2)==="//"?o?s:g.replace(v,"$1")+s:s.charAt(0)==="/"?o?s:g.replace(a,"$1")+s:g+s}const n={exec:function(){}};function i(g){let s=1,o,r;for(;s<arguments.length;s++){o=arguments[s];for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(g[r]=o[r])}return g}function h(g,s){const o=g.replace(/\|/g,(T,x,A)=>{let R=!1,I=x;for(;--I>=0&&A[I]==="\\";)R=!R;return R?"|":" |"}),r=o.split(/ \|/);let t=0;if(r.length>s)r.splice(s);else for(;r.length<s;)r.push("");for(;t<r.length;t++)r[t]=r[t].trim().replace(/\\\|/g,"|");return r}function d(g,s,o){const r=g.length;if(r===0)return"";let t=0;for(;t<r;){const T=g.charAt(r-t-1);if(T===s&&!o)t++;else if(T!==s&&o)t++;else break}return g.substr(0,r-t)}function u(g,s){if(g.indexOf(s[1])===-1)return-1;const o=g.length;let r=0,t=0;for(;t<o;t++)if(g[t]==="\\")t++;else if(g[t]===s[0])r++;else if(g[t]===s[1]&&(r--,r<0))return t;return-1}function E(g){g&&g.sanitize&&!g.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")}ot.exports={escape:S,unescape:M,edit:w,cleanUrl:C,resolveUrl:e,noopTest:n,merge:i,splitCells:h,rtrim:d,findClosingBracket:u,checkSanitizeDeprecation:E}},sR1s:function(ot,fe,U){"use strict";U.d(fe,"b",function(){return k}),U.d(fe,"a",function(){return b}),U.d(fe,"c",function(){return S}),U.d(fe,"d",function(){return j});var Z=U("U8pU"),N="RC_TABLE_KEY";function _(M){return M==null?[]:Array.isArray(M)?M:[M]}function k(M,O){if(!O&&typeof O!="number")return M;for(var w=_(O),c=M,y=0;y<w.length;y+=1){if(!c)return null;var C=w[y];c=c[C]}return c}function b(M){var O=[],w={};return M.forEach(function(c){for(var y=c||{},C=y.key,m=y.dataIndex,f=C||_(m).join("-")||N;w[f];)f="".concat(f,"_next");w[f]=!0,O.push(f)}),O}function S(){var M={};function O(C,m){m&&Object.keys(m).forEach(function(f){var v=m[f];v&&Object(Z.a)(v)==="object"?(C[f]=C[f]||{},O(C[f],v)):C[f]=v})}for(var w=arguments.length,c=new Array(w),y=0;y<w;y++)c[y]=arguments[y];return c.forEach(function(C){O(M,C)}),M}function j(M){return M!=null}},sboe:function(ot,fe,U){"use strict";U.d(fe,"a",function(){return _});var Z=U("q1tI"),N=U.n(Z),_=Z.createContext(null)},t23M:function(ot,fe,U){"use strict";var Z=U("VTBJ"),N=U("1OyB"),_=U("vuIU"),k=U("Ji7U"),b=U("LK+K"),S=U("q1tI"),j=U.n(S),M=U("m+aA"),O=U("Zm9Q"),w=U("Kwbf"),c=U("c+Xe"),y=U("bdgK"),C="rc-observer-key",m=function(f){Object(k.a)(a,f);var v=Object(b.a)(a);function a(){var e;return Object(N.a)(this,a),e=v.apply(this,arguments),e.resizeObserver=null,e.childNode=null,e.currentElement=null,e.state={width:0,height:0,offsetHeight:0,offsetWidth:0},e.onResize=function(n){var i=e.props.onResize,h=n[0].target,d=h.getBoundingClientRect(),u=d.width,E=d.height,g=h.offsetWidth,s=h.offsetHeight,o=Math.floor(u),r=Math.floor(E);if(e.state.width!==o||e.state.height!==r||e.state.offsetWidth!==g||e.state.offsetHeight!==s){var t={width:o,height:r,offsetWidth:g,offsetHeight:s};e.setState(t),i&&Promise.resolve().then(function(){i(Object(Z.a)(Object(Z.a)({},t),{},{offsetWidth:g,offsetHeight:s}))})}},e.setChildNode=function(n){e.childNode=n},e}return Object(_.a)(a,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var n=this.props.disabled;if(n){this.destroyObserver();return}var i=Object(M.a)(this.childNode||this),h=i!==this.currentElement;h&&(this.destroyObserver(),this.currentElement=i),!this.resizeObserver&&i&&(this.resizeObserver=new y.default(this.onResize),this.resizeObserver.observe(i))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var n=this.props.children,i=Object(O.a)(n);if(i.length>1)Object(w.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(i.length===0)return Object(w.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var h=i[0];if(S.isValidElement(h)&&Object(c.c)(h)){var d=h.ref;i[0]=S.cloneElement(h,{ref:Object(c.a)(d,this.setChildNode)})}return i.length===1?i[0]:i.map(function(u,E){return!S.isValidElement(u)||"key"in u&&u.key!==null?u:S.cloneElement(u,{key:"".concat(C,"-").concat(E)})})}}]),a}(S.Component);m.displayName="ResizeObserver",fe.a=m},t6v1:function(ot,fe,U){ot.exports=U.p+"static/a2.d632a3a4.svg"},uf8j:function(ot,fe,U){ot.exports=U.p+"static/a.2d0eaf1f.svg"},ulZh:function(ot,fe,U){typeof window!="undefined"&&function(N,_){ot.exports=_()}(this,function(){return function(Z){var N={};function _(k){if(N[k])return N[k].exports;var b=N[k]={i:k,l:!1,exports:{}};return Z[k].call(b.exports,b,b.exports,_),b.l=!0,b.exports}return _.m=Z,_.c=N,_.d=function(k,b,S){_.o(k,b)||Object.defineProperty(k,b,{enumerable:!0,get:S})},_.r=function(k){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(k,"__esModule",{value:!0})},_.t=function(k,b){if(b&1&&(k=_(k)),b&8)return k;if(b&4&&typeof k=="object"&&k&&k.__esModule)return k;var S=Object.create(null);if(_.r(S),Object.defineProperty(S,"default",{enumerable:!0,value:k}),b&2&&typeof k!="string")for(var j in k)_.d(S,j,function(M){return k[M]}.bind(null,j));return S},_.n=function(k){var b=k&&k.__esModule?function(){return k.default}:function(){return k};return _.d(b,"a",b),b},_.o=function(k,b){return Object.prototype.hasOwnProperty.call(k,b)},_.p="/dist/",_(_.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(Z,N,_){"use strict";var k=Object.prototype.hasOwnProperty,b="~";function S(){}Object.create&&(S.prototype=Object.create(null),new S().__proto__||(b=!1));function j(c,y,C){this.fn=c,this.context=y,this.once=C||!1}function M(c,y,C,m,f){if(typeof C!="function")throw new TypeError("The listener must be a function");var v=new j(C,m||c,f),a=b?b+y:y;return c._events[a]?c._events[a].fn?c._events[a]=[c._events[a],v]:c._events[a].push(v):(c._events[a]=v,c._eventsCount++),c}function O(c,y){--c._eventsCount===0?c._events=new S:delete c._events[y]}function w(){this._events=new S,this._eventsCount=0}w.prototype.eventNames=function(){var y=[],C,m;if(this._eventsCount===0)return y;for(m in C=this._events)k.call(C,m)&&y.push(b?m.slice(1):m);return Object.getOwnPropertySymbols?y.concat(Object.getOwnPropertySymbols(C)):y},w.prototype.listeners=function(y){var C=b?b+y:y,m=this._events[C];if(!m)return[];if(m.fn)return[m.fn];for(var f=0,v=m.length,a=new Array(v);f<v;f++)a[f]=m[f].fn;return a},w.prototype.listenerCount=function(y){var C=b?b+y:y,m=this._events[C];return m?m.fn?1:m.length:0},w.prototype.emit=function(y,C,m,f,v,a){var e=b?b+y:y;if(!this._events[e])return!1;var n=this._events[e],i=arguments.length,h,d;if(n.fn){n.once&&this.removeListener(y,n.fn,void 0,!0);switch(i){case 1:return n.fn.call(n.context),!0;case 2:return n.fn.call(n.context,C),!0;case 3:return n.fn.call(n.context,C,m),!0;case 4:return n.fn.call(n.context,C,m,f),!0;case 5:return n.fn.call(n.context,C,m,f,v),!0;case 6:return n.fn.call(n.context,C,m,f,v,a),!0}for(d=1,h=new Array(i-1);d<i;d++)h[d-1]=arguments[d];n.fn.apply(n.context,h)}else{var u=n.length,E;for(d=0;d<u;d++){n[d].once&&this.removeListener(y,n[d].fn,void 0,!0);switch(i){case 1:n[d].fn.call(n[d].context);break;case 2:n[d].fn.call(n[d].context,C);break;case 3:n[d].fn.call(n[d].context,C,m);break;case 4:n[d].fn.call(n[d].context,C,m,f);break;default:if(!h)for(E=1,h=new Array(i-1);E<i;E++)h[E-1]=arguments[E];n[d].fn.apply(n[d].context,h)}}}return!0},w.prototype.on=function(y,C,m){return M(this,y,C,m,!1)},w.prototype.once=function(y,C,m){return M(this,y,C,m,!0)},w.prototype.removeListener=function(y,C,m,f){var v=b?b+y:y;if(!this._events[v])return this;if(!C)return O(this,v),this;var a=this._events[v];if(a.fn)a.fn===C&&(!f||a.once)&&(!m||a.context===m)&&O(this,v);else{for(var e=0,n=[],i=a.length;e<i;e++)(a[e].fn!==C||f&&!a[e].once||m&&a[e].context!==m)&&n.push(a[e]);n.length?this._events[v]=n.length===1?n[0]:n:O(this,v)}return this},w.prototype.removeAllListeners=function(y){var C;return y?(C=b?b+y:y,this._events[C]&&O(this,C)):(this._events=new S,this._eventsCount=0),this},w.prototype.off=w.prototype.removeListener,w.prototype.addListener=w.prototype.on,w.prefixed=b,w.EventEmitter=w,Z.exports=w},"./node_modules/url-toolkit/src/url-toolkit.js":function(Z,N,_){(function(k){var b=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,S=/^([^\/?#]*)([^]*)$/,j=/(?:\/|^)\.(?=\/)/g,M=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,O={buildAbsoluteURL:function(w,c,y){if(y=y||{},w=w.trim(),c=c.trim(),!c){if(!y.alwaysNormalize)return w;var C=O.parseURL(w);if(!C)throw new Error("Error trying to parse base URL.");return C.path=O.normalizePath(C.path),O.buildURLFromParts(C)}var m=O.parseURL(c);if(!m)throw new Error("Error trying to parse relative URL.");if(m.scheme)return y.alwaysNormalize?(m.path=O.normalizePath(m.path),O.buildURLFromParts(m)):c;var f=O.parseURL(w);if(!f)throw new Error("Error trying to parse base URL.");if(!f.netLoc&&f.path&&f.path[0]!=="/"){var v=S.exec(f.path);f.netLoc=v[1],f.path=v[2]}f.netLoc&&!f.path&&(f.path="/");var a={scheme:f.scheme,netLoc:m.netLoc,path:null,params:m.params,query:m.query,fragment:m.fragment};if(!m.netLoc&&(a.netLoc=f.netLoc,m.path[0]!=="/"))if(!m.path)a.path=f.path,m.params||(a.params=f.params,m.query||(a.query=f.query));else{var e=f.path,n=e.substring(0,e.lastIndexOf("/")+1)+m.path;a.path=O.normalizePath(n)}return a.path===null&&(a.path=y.alwaysNormalize?O.normalizePath(m.path):m.path),O.buildURLFromParts(a)},parseURL:function(w){var c=b.exec(w);return c?{scheme:c[1]||"",netLoc:c[2]||"",path:c[3]||"",params:c[4]||"",query:c[5]||"",fragment:c[6]||""}:null},normalizePath:function(w){for(w=w.split("").reverse().join("").replace(j,"");w.length!==(w=w.replace(M,"")).length;);return w.split("").reverse().join("")},buildURLFromParts:function(w){return w.scheme+w.netLoc+w.path+w.params+w.query+w.fragment}};Z.exports=O})(this)},"./node_modules/webworkify-webpack/index.js":function(Z,N,_){function k(y){var C={};function m(v){if(C[v])return C[v].exports;var a=C[v]={i:v,l:!1,exports:{}};return y[v].call(a.exports,a,a.exports,m),a.l=!0,a.exports}m.m=y,m.c=C,m.i=function(v){return v},m.d=function(v,a,e){m.o(v,a)||Object.defineProperty(v,a,{configurable:!1,enumerable:!0,get:e})},m.r=function(v){Object.defineProperty(v,"__esModule",{value:!0})},m.n=function(v){var a=v&&v.__esModule?function(){return v.default}:function(){return v};return m.d(a,"a",a),a},m.o=function(v,a){return Object.prototype.hasOwnProperty.call(v,a)},m.p="/",m.oe=function(v){throw console.error(v),v};var f=m(m.s=ENTRY_MODULE);return f.default||f}var b="[\\.|\\-|\\+|\\w|/|@]+",S="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+b+").*?\\)";function j(y){return(y+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function M(y){return!isNaN(1*y)}function O(y,C,m){var f={};f[m]=[];var v=C.toString(),a=v.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!a)return f;for(var e=a[1],n=new RegExp("(\\\\n|\\W)"+j(e)+S,"g"),i;i=n.exec(v);){if(i[3]==="dll-reference")continue;f[m].push(i[3])}for(n=new RegExp("\\("+j(e)+'\\("(dll-reference\\s('+b+'))"\\)\\)'+S,"g");i=n.exec(v);)y[i[2]]||(f[m].push(i[1]),y[i[2]]=_(i[1]).m),f[i[2]]=f[i[2]]||[],f[i[2]].push(i[4]);for(var h=Object.keys(f),d=0;d<h.length;d++)for(var u=0;u<f[h[d]].length;u++)M(f[h[d]][u])&&(f[h[d]][u]=1*f[h[d]][u]);return f}function w(y){var C=Object.keys(y);return C.reduce(function(m,f){return m||y[f].length>0},!1)}function c(y,C){for(var m={main:[C]},f={main:[]},v={main:{}};w(m);)for(var a=Object.keys(m),e=0;e<a.length;e++){var n=a[e],i=m[n],h=i.pop();if(v[n]=v[n]||{},v[n][h]||!y[n][h])continue;v[n][h]=!0,f[n]=f[n]||[],f[n].push(h);for(var d=O(y,y[n][h],n),u=Object.keys(d),E=0;E<u.length;E++)m[u[E]]=m[u[E]]||[],m[u[E]]=m[u[E]].concat(d[u[E]])}return f}Z.exports=function(y,C){C=C||{};var m={main:_.m},f=C.all?{main:Object.keys(m.main)}:c(m,y),v="";Object.keys(f).filter(function(h){return h!=="main"}).forEach(function(h){for(var d=0;f[h][d];)d++;f[h].push(d),m[h][d]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",v=v+"var "+h+" = ("+k.toString().replace("ENTRY_MODULE",JSON.stringify(d))+")({"+f[h].map(function(u){return""+JSON.stringify(u)+": "+m[h][u].toString()}).join(",")+`});
`}),v=v+"new (("+k.toString().replace("ENTRY_MODULE",JSON.stringify(y))+")({"+f.main.map(function(h){return""+JSON.stringify(h)+": "+m.main[h].toString()}).join(",")+"}))(self);";var a=new window.Blob([v],{type:"text/javascript"});if(C.bare)return a;var e=window.URL||window.webkitURL||window.mozURL||window.msURL,n=e.createObjectURL(a),i=new window.Worker(n);return i.objectURL=n,i}},"./src/config.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"hlsDefaultConfig",function(){return E}),_.d(N,"mergeConfig",function(){return s}),_.d(N,"enableStreamingMode",function(){return o});var k=_("./src/controller/abr-controller.ts"),b=_("./src/controller/audio-stream-controller.ts"),S=_("./src/controller/audio-track-controller.ts"),j=_("./src/controller/subtitle-stream-controller.ts"),M=_("./src/controller/subtitle-track-controller.ts"),O=_("./src/controller/buffer-controller.ts"),w=_("./src/controller/timeline-controller.ts"),c=_("./src/controller/cap-level-controller.ts"),y=_("./src/controller/fps-controller.ts"),C=_("./src/controller/eme-controller.ts"),m=_("./src/controller/cmcd-controller.ts"),f=_("./src/utils/xhr-loader.ts"),v=_("./src/utils/fetch-loader.ts"),a=_("./src/utils/cues.ts"),e=_("./src/utils/mediakeys-helper.ts"),n=_("./src/utils/logger.ts");function i(){return i=Object.assign||function(r){for(var t=1;t<arguments.length;t++){var T=arguments[t];for(var x in T)Object.prototype.hasOwnProperty.call(T,x)&&(r[x]=T[x])}return r},i.apply(this,arguments)}function h(r,t){var T=Object.keys(r);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(r);t&&(x=x.filter(function(A){return Object.getOwnPropertyDescriptor(r,A).enumerable})),T.push.apply(T,x)}return T}function d(r){for(var t=1;t<arguments.length;t++){var T=arguments[t]!=null?arguments[t]:{};t%2?h(Object(T),!0).forEach(function(x){u(r,x,T[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(T)):h(Object(T)).forEach(function(x){Object.defineProperty(r,x,Object.getOwnPropertyDescriptor(T,x))})}return r}function u(r,t,T){return t in r?Object.defineProperty(r,t,{value:T,enumerable:!0,configurable:!0,writable:!0}):r[t]=T,r}var E=d(d({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:f.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:k.default,bufferController:O.default,capLevelController:c.default,fpsController:y.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:e.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},g()),{},{subtitleStreamController:j.SubtitleStreamController,subtitleTrackController:M.default,timelineController:w.TimelineController,audioStreamController:b.default,audioTrackController:S.default,emeController:C.default,cmcdController:m.default});function g(){return{cueHandler:a.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function s(r,t){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(t.liveMaxLatencyDurationCount!==void 0&&(t.liveSyncDurationCount===void 0||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(t.liveMaxLatencyDuration!==void 0&&(t.liveSyncDuration===void 0||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return i({},r,t)}function o(r){var t=r.loader;if(t!==v.default&&t!==f.default)n.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),r.progressive=!1;else{var T=Object(v.fetchSupported)();T&&(r.loader=v.default,r.progressive=!0,r.enableSoftwareAES=!0,n.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(Z,N,_){"use strict";_.r(N);var k=_("./src/polyfills/number.ts"),b=_("./src/utils/ewma-bandwidth-estimator.ts"),S=_("./src/events.ts"),j=_("./src/utils/buffer-helper.ts"),M=_("./src/errors.ts"),O=_("./src/types/loader.ts"),w=_("./src/utils/logger.ts");function c(m,f){for(var v=0;v<f.length;v++){var a=f[v];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(m,a.key,a)}}function y(m,f,v){return f&&c(m.prototype,f),v&&c(m,v),m}var C=function(){function m(v){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=v;var a=v.config;this.bwEstimator=new b.default(a.abrEwmaSlowVoD,a.abrEwmaFastVoD,a.abrEwmaDefaultEstimate),this.registerListeners()}var f=m.prototype;return f.registerListeners=function(){var a=this.hls;a.on(S.Events.FRAG_LOADING,this.onFragLoading,this),a.on(S.Events.FRAG_LOADED,this.onFragLoaded,this),a.on(S.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.on(S.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.on(S.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var a=this.hls;a.off(S.Events.FRAG_LOADING,this.onFragLoading,this),a.off(S.Events.FRAG_LOADED,this.onFragLoaded,this),a.off(S.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.off(S.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.off(S.Events.ERROR,this.onError,this)},f.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},f.onFragLoading=function(a,e){var n=e.frag;if(n.type===O.PlaylistLevelType.MAIN&&!this.timer){var i;this.fragCurrent=n,this.partCurrent=(i=e.part)!=null?i:null,this.timer=self.setInterval(this.onCheck,100)}},f.onLevelLoaded=function(a,e){var n=this.hls.config;e.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD)},f._abandonRulesCheck=function(){var a=this.fragCurrent,e=this.partCurrent,n=this.hls,i=n.autoLevelEnabled,h=n.config,d=n.media;if(!a||!d)return;var u=e?e.stats:a.stats,E=e?e.duration:a.duration;if(u.aborted){w.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!i||d.paused||!d.playbackRate||!d.readyState)return;var g=performance.now()-u.loading.start,s=Math.abs(d.playbackRate);if(g<=500*E/s)return;var o=n.levels,r=n.minAutoLevel,t=o[a.level],T=u.total||Math.max(u.loaded,Math.round(E*t.maxBitrate/8)),x=Math.max(1,u.bwEstimate?u.bwEstimate/8:u.loaded*1e3/g),A=(T-u.loaded)/x,R=d.currentTime,I=(j.BufferHelper.bufferInfo(d,R,h.maxBufferHole).end-R)/s;if(I>=2*E/s||A<=I)return;var B=Number.POSITIVE_INFINITY,W;for(W=a.level-1;W>r;W--){var $=o[W].maxBitrate;if(B=E*$/(8*.8*x),B<I)break}if(B>=A)return;var X=this.bwEstimator.getEstimate();w.logger.warn("Fragment "+a.sn+(e?" part "+e.index:"")+" of level "+a.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+W+`
Current BW estimate: `+(Object(k.isFiniteNumber)(X)?(X/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+A.toFixed(3)+` s
Estimated load time for the next fragment: `+B.toFixed(3)+` s
Time to underbuffer: `+I.toFixed(3)+" s"),n.nextLoadLevel=W,this.bwEstimator.sample(g,u.loaded),this.clearTimer(),a.loader&&(this.fragCurrent=this.partCurrent=null,a.loader.abort()),n.trigger(S.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:a,part:e,stats:u})},f.onFragLoaded=function(a,e){var n=e.frag,i=e.part;if(n.type===O.PlaylistLevelType.MAIN&&Object(k.isFiniteNumber)(n.sn)){var h=i?i.stats:n.stats,d=i?i.duration:n.duration;if(this.clearTimer(),this.lastLoadedFragLevel=n.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var u=this.hls.levels[n.level],E=(u.loaded?u.loaded.bytes:0)+h.loaded,g=(u.loaded?u.loaded.duration:0)+d;u.loaded={bytes:E,duration:g},u.realBitrate=Math.round(8*E/g)}if(n.bitrateTest){var s={stats:h,frag:n,part:i,id:n.type};this.onFragBuffered(S.Events.FRAG_BUFFERED,s),n.bitrateTest=!1}}},f.onFragBuffered=function(a,e){var n=e.frag,i=e.part,h=i?i.stats:n.stats;if(h.aborted)return;if(n.type!==O.PlaylistLevelType.MAIN||n.sn==="initSegment")return;var d=h.parsing.end-h.loading.start;this.bwEstimator.sample(d,h.loaded),h.bwEstimate=this.bwEstimator.getEstimate(),n.bitrateTest?this.bitrateTestDelay=d/1e3:this.bitrateTestDelay=0},f.onError=function(a,e){switch(e.details){case M.ErrorDetails.FRAG_LOAD_ERROR:case M.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},f.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},f.getNextABRAutoLevel=function(){var a=this.fragCurrent,e=this.partCurrent,n=this.hls,i=n.maxAutoLevel,h=n.config,d=n.minAutoLevel,u=n.media,E=e?e.duration:a?a.duration:0,g=u?u.currentTime:0,s=u&&u.playbackRate!==0?Math.abs(u.playbackRate):1,o=this.bwEstimator?this.bwEstimator.getEstimate():h.abrEwmaDefaultEstimate,r=(j.BufferHelper.bufferInfo(u,g,h.maxBufferHole).end-g)/s,t=this.findBestLevel(o,d,i,r,h.abrBandWidthFactor,h.abrBandWidthUpFactor);if(t>=0)return t;w.logger.trace((r?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var T=E?Math.min(E,h.maxStarvationDelay):h.maxStarvationDelay,x=h.abrBandWidthFactor,A=h.abrBandWidthUpFactor;if(!r){var R=this.bitrateTestDelay;if(R){var I=E?Math.min(E,h.maxLoadingDelay):h.maxLoadingDelay;T=I-R,w.logger.trace("bitrate test took "+Math.round(1e3*R)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*T)+" ms"),x=A=1}}return t=this.findBestLevel(o,d,i,r+T,x,A),Math.max(t,0)},f.findBestLevel=function(a,e,n,i,h,d){for(var u,E=this.fragCurrent,g=this.partCurrent,s=this.lastLoadedFragLevel,o=this.hls.levels,r=o[s],t=!!(r!=null&&(u=r.details)!==null&&u!==void 0&&u.live),T=r==null?void 0:r.codecSet,x=g?g.duration:E?E.duration:0,A=n;A>=e;A--){var R=o[A];if(!R||T&&R.codecSet!==T)continue;var I=R.details,B=(g?I==null?void 0:I.partTarget:I==null?void 0:I.averagetargetduration)||x,W=void 0;A<=s?W=h*a:W=d*a;var $=o[A].maxBitrate,X=$*B/W;if(w.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+A+"/"+Math.round(W)+"/"+$+"/"+B+"/"+i+"/"+X),W>$&&(!X||t&&!this.bitrateTestDelay||X<i))return A}return-1},y(m,[{key:"nextAutoLevel",get:function(){var a=this._nextAutoLevel,e=this.bwEstimator;if(a!==-1&&(!e||!e.canEstimate()))return a;var n=this.getNextABRAutoLevel();return a!==-1&&(n=Math.min(a,n)),n},set:function(a){this._nextAutoLevel=a}}]),m}();N.default=C},"./src/controller/audio-stream-controller.ts":function(Z,N,_){"use strict";_.r(N);var k=_("./src/polyfills/number.ts"),b=_("./src/controller/base-stream-controller.ts"),S=_("./src/events.ts"),j=_("./src/utils/buffer-helper.ts"),M=_("./src/controller/fragment-tracker.ts"),O=_("./src/types/level.ts"),w=_("./src/types/loader.ts"),c=_("./src/loader/fragment.ts"),y=_("./src/demux/chunk-cache.ts"),C=_("./src/demux/transmuxer-interface.ts"),m=_("./src/types/transmuxer.ts"),f=_("./src/controller/fragment-finders.ts"),v=_("./src/utils/discontinuities.ts"),a=_("./src/errors.ts"),e=_("./src/utils/logger.ts");function n(){return n=Object.assign||function(E){for(var g=1;g<arguments.length;g++){var s=arguments[g];for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(E[o]=s[o])}return E},n.apply(this,arguments)}function i(E,g){E.prototype=Object.create(g.prototype),E.prototype.constructor=E,h(E,g)}function h(E,g){return h=Object.setPrototypeOf||function(o,r){return o.__proto__=r,o},h(E,g)}var d=100,u=function(E){i(g,E);function g(o,r){var t;return t=E.call(this,o,r,"[audio-stream-controller]")||this,t.videoBuffer=null,t.videoTrackCC=-1,t.waitingVideoCC=-1,t.audioSwitch=!1,t.trackId=-1,t.waitingData=null,t.mainDetails=null,t.bufferFlushed=!1,t._registerListeners(),t}var s=g.prototype;return s.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},s._registerListeners=function(){var r=this.hls;r.on(S.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(S.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(S.Events.LEVEL_LOADED,this.onLevelLoaded,this),r.on(S.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),r.on(S.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),r.on(S.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),r.on(S.Events.ERROR,this.onError,this),r.on(S.Events.BUFFER_RESET,this.onBufferReset,this),r.on(S.Events.BUFFER_CREATED,this.onBufferCreated,this),r.on(S.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),r.on(S.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),r.on(S.Events.FRAG_BUFFERED,this.onFragBuffered,this)},s._unregisterListeners=function(){var r=this.hls;r.off(S.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(S.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(S.Events.LEVEL_LOADED,this.onLevelLoaded,this),r.off(S.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),r.off(S.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),r.off(S.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),r.off(S.Events.ERROR,this.onError,this),r.off(S.Events.BUFFER_RESET,this.onBufferReset,this),r.off(S.Events.BUFFER_CREATED,this.onBufferCreated,this),r.off(S.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),r.off(S.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),r.off(S.Events.FRAG_BUFFERED,this.onFragBuffered,this)},s.onInitPtsFound=function(r,t){var T=t.frag,x=t.id,A=t.initPTS;if(x==="main"){var R=T.cc;this.initPTS[T.cc]=A,this.log("InitPTS for cc: "+R+" found from main: "+A),this.videoTrackCC=R,this.state===b.State.WAITING_INIT_PTS&&this.tick()}},s.startLoad=function(r){if(!this.levels){this.startPosition=r,this.state=b.State.STOPPED;return}var t=this.lastCurrentTime;this.stopLoad(),this.setInterval(d),this.fragLoadError=0,t>0&&r===-1?(this.log("Override startPosition with lastCurrentTime @"+t.toFixed(3)),this.state=b.State.IDLE):(this.loadedmetadata=!1,this.state=b.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=r,this.tick()},s.doTick=function(){switch(this.state){case b.State.IDLE:this.doTickIdle();break;case b.State.WAITING_TRACK:{var r,t=this.levels,T=this.trackId,x=t==null||((r=t[T])===null||r===void 0)?void 0:r.details;if(x){if(this.waitForCdnTuneIn(x))break;this.state=b.State.WAITING_INIT_PTS}break}case b.State.FRAG_LOADING_WAITING_RETRY:{var A,R=performance.now(),I=this.retryDate;(!I||R>=I||(A=this.media)!==null&&A!==void 0&&A.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=b.State.IDLE);break}case b.State.WAITING_INIT_PTS:{var B=this.waitingData;if(B){var W=B.frag,$=B.part,X=B.cache,V=B.complete;if(this.initPTS[W.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=b.State.FRAG_LOADING;var se=X.flush(),xe={frag:W,part:$,payload:se,networkDetails:null};this._handleFragmentLoadProgress(xe),V&&E.prototype._handleFragmentLoadComplete.call(this,xe)}else if(this.videoTrackCC!==this.waitingVideoCC)e.logger.log("Waiting fragment cc ("+W.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var Ee=this.getLoadPosition(),je=j.BufferHelper.bufferInfo(this.mediaBuffer,Ee,this.config.maxBufferHole),Ae=Object(f.fragmentWithinToleranceTest)(je.end,this.config.maxFragLookUpTolerance,W);Ae<0&&(e.logger.log("Waiting fragment cc ("+W.cc+") @ "+W.start+" cancelled because another fragment at "+je.end+" is needed"),this.clearWaitingFragment())}}else this.state=b.State.IDLE}}this.onTickEnd()},s.clearWaitingFragment=function(){var r=this.waitingData;r&&(this.fragmentTracker.removeFragment(r.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=b.State.IDLE)},s.onTickEnd=function(){var r=this.media;if(!r||!r.readyState)return;var t=this.mediaBuffer?this.mediaBuffer:r,T=t.buffered;!this.loadedmetadata&&T.length&&(this.loadedmetadata=!0),this.lastCurrentTime=r.currentTime},s.doTickIdle=function(){var r,t,T=this.hls,x=this.levels,A=this.media,R=this.trackId,I=T.config;if(!x||!x[R])return;if(!A&&(this.startFragRequested||!I.startFragPrefetch))return;var B=x[R],W=B.details;if(!W||W.live&&this.levelLastLoaded!==R||this.waitForCdnTuneIn(W)){this.state=b.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,c.ElementaryStreamTypes.AUDIO,w.PlaylistLevelType.AUDIO));var $=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,w.PlaylistLevelType.AUDIO);if($===null)return;var X=$.len,V=this.getMaxBufferLength(),se=this.audioSwitch;if(X>=V&&!se)return;if(!se&&this._streamEnded($,W)){T.trigger(S.Events.BUFFER_EOS,{type:"audio"}),this.state=b.State.ENDED;return}var xe=W.fragments,Ee=xe[0].start,je=$.end;if(se){var Ae=this.getLoadPosition();je=Ae,W.PTSKnown&&Ae<Ee&&(($.end>Ee||$.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),A.currentTime=Ee+.05))}var Oe=this.getNextFragment(je,W);if(!Oe){this.bufferFlushed=!0;return}((r=Oe.decryptdata)===null||r===void 0?void 0:r.keyFormat)==="identity"&&!((t=Oe.decryptdata)!==null&&t!==void 0&&t.key)?this.loadKey(Oe,W):this.loadFragment(Oe,W,je)},s.getMaxBufferLength=function(){var r=E.prototype.getMaxBufferLength.call(this),t=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,w.PlaylistLevelType.MAIN);return t===null?r:Math.max(r,t.len)},s.onMediaDetaching=function(){this.videoBuffer=null,E.prototype.onMediaDetaching.call(this)},s.onAudioTracksUpdated=function(r,t){var T=t.audioTracks;this.resetTransmuxer(),this.levels=T.map(function(x){return new O.Level(x)})},s.onAudioTrackSwitching=function(r,t){var T=!!t.url;this.trackId=t.id;var x=this.fragCurrent;x!=null&&x.loader&&x.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),T?this.setInterval(d):this.resetTransmuxer(),T?(this.audioSwitch=!0,this.state=b.State.IDLE):this.state=b.State.STOPPED,this.tick()},s.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},s.onLevelLoaded=function(r,t){this.mainDetails=t.details},s.onAudioTrackLoaded=function(r,t){var T,x=this.levels,A=t.details,R=t.id;if(!x){this.warn("Audio tracks were reset while loading level "+R);return}this.log("Track "+R+" loaded ["+A.startSN+","+A.endSN+"],duration:"+A.totalduration);var I=x[R],B=0;if(A.live||(T=I.details)!==null&&T!==void 0&&T.live){var W=this.mainDetails;if(A.fragments[0]||(A.deltaUpdateFailed=!0),A.deltaUpdateFailed||!W)return;!I.details&&A.hasProgramDateTime&&W.hasProgramDateTime?(Object(v.alignMediaPlaylistByPDT)(A,W),B=A.fragments[0].start):B=this.alignPlaylists(A,I.details)}I.details=A,this.levelLastLoaded=R,!this.startFragRequested&&(this.mainDetails||!A.live)&&this.setStartPosition(I.details,B),this.state===b.State.WAITING_TRACK&&!this.waitForCdnTuneIn(A)&&(this.state=b.State.IDLE),this.tick()},s._handleFragmentLoadProgress=function(r){var t,T=r.frag,x=r.part,A=r.payload,R=this.config,I=this.trackId,B=this.levels;if(!B){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+T.sn+" of level "+T.level+" will not be buffered");return}var W=B[I];console.assert(W,"Audio track is defined on fragment load progress");var $=W.details;console.assert($,"Audio track details are defined on fragment load progress");var X=R.defaultAudioCodec||W.audioCodec||"mp4a.40.2",V=this.transmuxer;V||(V=this.transmuxer=new C.default(this.hls,w.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var se=this.initPTS[T.cc],xe=(t=T.initSegment)===null||t===void 0?void 0:t.data;if(se!==void 0){var Ee=!1,je=x?x.index:-1,Ae=je!==-1,Oe=new m.ChunkMetadata(T.level,T.sn,T.stats.chunkCount,A.byteLength,je,Ae);V.push(A,xe,X,"",T,x,$.totalduration,Ee,Oe,se)}else{e.logger.log("Unknown video PTS for cc "+T.cc+", waiting for video PTS before demuxing audio frag "+T.sn+" of ["+$.startSN+" ,"+$.endSN+"],track "+I);var Le=this.waitingData=this.waitingData||{frag:T,part:x,cache:new y.default,complete:!1},Pe=Le.cache;Pe.push(new Uint8Array(A)),this.waitingVideoCC=this.videoTrackCC,this.state=b.State.WAITING_INIT_PTS}},s._handleFragmentLoadComplete=function(r){if(this.waitingData){this.waitingData.complete=!0;return}E.prototype._handleFragmentLoadComplete.call(this,r)},s.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},s.onBufferCreated=function(r,t){var T=t.tracks.audio;T&&(this.mediaBuffer=T.buffer),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer)},s.onFragBuffered=function(r,t){var T=t.frag,x=t.part;if(T.type!==w.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(T)){this.warn("Fragment "+T.sn+(x?" p: "+x.index:"")+" of level "+T.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}T.sn!=="initSegment"&&(this.fragPrevious=T,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(S.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(T,x)},s.onError=function(r,t){switch(t.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:case a.ErrorDetails.KEY_LOAD_ERROR:case a.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(w.PlaylistLevelType.AUDIO,t);break;case a.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case a.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==b.State.ERROR&&this.state!==b.State.STOPPED&&(this.state=t.fatal?b.State.ERROR:b.State.IDLE,this.warn(t.details+" while loading frag, switching to "+this.state+" state"));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(t.parent==="audio"&&(this.state===b.State.PARSING||this.state===b.State.PARSED)){var T=!0,x=this.getFwdBufferInfo(this.mediaBuffer,w.PlaylistLevelType.AUDIO);x&&x.len>.5&&(T=!this.reduceMaxBufferLength(x.len)),T&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,E.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},s.onBufferFlushed=function(r,t){var T=t.type;T===c.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},s._handleTransmuxComplete=function(r){var t,T="audio",x=this.hls,A=r.remuxResult,R=r.chunkMeta,I=this.getCurrentContext(R);if(!I){this.warn("The loading context changed while buffering fragment "+R.sn+" of level "+R.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(R.level);return}var B=I.frag,W=I.part,$=A.audio,X=A.text,V=A.id3,se=A.initSegment;if(this.fragContextChanged(B))return;if(this.state=b.State.PARSING,this.audioSwitch&&$&&this.completeAudioSwitch(),se!=null&&se.tracks&&(this._bufferInitSegment(se.tracks,B,R),x.trigger(S.Events.FRAG_PARSING_INIT_SEGMENT,{frag:B,id:T,tracks:se.tracks})),$){var xe=$.startPTS,Ee=$.endPTS,je=$.startDTS,Ae=$.endDTS;W&&(W.elementaryStreams[c.ElementaryStreamTypes.AUDIO]={startPTS:xe,endPTS:Ee,startDTS:je,endDTS:Ae}),B.setElementaryStreamInfo(c.ElementaryStreamTypes.AUDIO,xe,Ee,je,Ae),this.bufferFragmentData($,B,W,R)}if(V!=null&&(t=V.samples)!==null&&t!==void 0&&t.length){var Oe=n({frag:B,id:T},V);x.trigger(S.Events.FRAG_PARSING_METADATA,Oe)}if(X){var Le=n({frag:B,id:T},X);x.trigger(S.Events.FRAG_PARSING_USERDATA,Le)}},s._bufferInitSegment=function(r,t,T){if(this.state!==b.State.PARSING)return;r.video&&delete r.video;var x=r.audio;if(!x)return;x.levelCodec=x.codec,x.id="audio",this.log("Init audio buffer, container:"+x.container+", codecs[parsed]=["+x.codec+"]"),this.hls.trigger(S.Events.BUFFER_CODECS,r);var A=x.initSegment;if(A!=null&&A.byteLength){var R={type:"audio",frag:t,part:null,chunkMeta:T,parent:t.type,data:A};this.hls.trigger(S.Events.BUFFER_APPENDING,R)}this.tick()},s.loadFragment=function(r,t,T){var x=this.fragmentTracker.getState(r);this.fragCurrent=r,(this.audioSwitch||x===M.FragmentState.NOT_LOADED||x===M.FragmentState.PARTIAL)&&(r.sn==="initSegment"?this._loadInitSegment(r):t.live&&!Object(k.isFiniteNumber)(this.initPTS[r.cc])?(this.log("Waiting for video PTS in continuity counter "+r.cc+" of live stream before loading audio fragment "+r.sn+" of level "+this.trackId),this.state=b.State.WAITING_INIT_PTS):(this.startFragRequested=!0,E.prototype.loadFragment.call(this,r,t,T)))},s.completeAudioSwitch=function(){var r=this.hls,t=this.media,T=this.trackId;t&&(this.log("Switching audio track : flushing all audio"),E.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,r.trigger(S.Events.AUDIO_TRACK_SWITCHED,{id:T})},g}(b.default);N.default=u},"./src/controller/audio-track-controller.ts":function(Z,N,_){"use strict";_.r(N);var k=_("./src/events.ts"),b=_("./src/errors.ts"),S=_("./src/controller/base-playlist-controller.ts"),j=_("./src/types/loader.ts");function M(C,m){for(var f=0;f<m.length;f++){var v=m[f];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(C,v.key,v)}}function O(C,m,f){return m&&M(C.prototype,m),f&&M(C,f),C}function w(C,m){C.prototype=Object.create(m.prototype),C.prototype.constructor=C,c(C,m)}function c(C,m){return c=Object.setPrototypeOf||function(v,a){return v.__proto__=a,v},c(C,m)}var y=function(C){w(m,C);function m(v){var a;return a=C.call(this,v,"[audio-track-controller]")||this,a.tracks=[],a.groupId=null,a.tracksInGroup=[],a.trackId=-1,a.trackName="",a.selectDefaultTrack=!0,a.registerListeners(),a}var f=m.prototype;return f.registerListeners=function(){var a=this.hls;a.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(k.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(k.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.on(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.on(k.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var a=this.hls;a.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(k.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(k.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.off(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.off(k.Events.ERROR,this.onError,this)},f.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,C.prototype.destroy.call(this)},f.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},f.onManifestParsed=function(a,e){this.tracks=e.audioTracks||[]},f.onAudioTrackLoaded=function(a,e){var n=e.id,i=e.details,h=this.tracksInGroup[n];if(!h){this.warn("Invalid audio track id "+n);return}var d=h.details;h.details=e.details,this.log("audioTrack "+n+" loaded ["+i.startSN+"-"+i.endSN+"]"),n===this.trackId&&(this.retryCount=0,this.playlistLoaded(n,e,d))},f.onLevelLoading=function(a,e){this.switchLevel(e.level)},f.onLevelSwitching=function(a,e){this.switchLevel(e.level)},f.switchLevel=function(a){var e=this.hls.levels[a];if(!(e!=null&&e.audioGroupIds))return;var n=e.audioGroupIds[e.urlId];if(this.groupId!==n){this.groupId=n;var i=this.tracks.filter(function(d){return!n||d.groupId===n});this.selectDefaultTrack&&!i.some(function(d){return d.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=i;var h={audioTracks:i};this.log("Updating audio tracks, "+i.length+' track(s) found in "'+n+'" group-id'),this.hls.trigger(k.Events.AUDIO_TRACKS_UPDATED,h),this.selectInitialTrack()}},f.onError=function(a,e){if(C.prototype.onError.call(this,a,e),e.fatal||!e.context)return;e.context.type===j.PlaylistContextType.AUDIO_TRACK&&e.context.id===this.trackId&&e.context.groupId===this.groupId&&this.retryLoadingOrFail(e)},f.setAudioTrack=function(a){var e=this.tracksInGroup;if(a<0||a>=e.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var n=e[this.trackId];this.log("Now switching to audio-track index "+a);var i=e[a],h=i.id,d=i.groupId,u=d===void 0?"":d,E=i.name,g=i.type,s=i.url;if(this.trackId=a,this.trackName=E,this.selectDefaultTrack=!1,this.hls.trigger(k.Events.AUDIO_TRACK_SWITCHING,{id:h,groupId:u,name:E,type:g,url:s}),i.details&&!i.details.live)return;var o=this.switchParams(i.url,n==null?void 0:n.details);this.loadPlaylist(o)},f.selectInitialTrack=function(){var a=this.tracksInGroup;console.assert(a.length,"Initial audio track should be selected when tracks are known");var e=this.trackName,n=this.findTrackId(e)||this.findTrackId();n!==-1?this.setAudioTrack(n):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(k.Events.ERROR,{type:b.ErrorTypes.MEDIA_ERROR,details:b.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},f.findTrackId=function(a){for(var e=this.tracksInGroup,n=0;n<e.length;n++){var i=e[n];if((!this.selectDefaultTrack||i.default)&&(!a||a===i.name))return i.id}return-1},f.loadPlaylist=function(a){var e=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(e)){var n=e.id,i=e.groupId,h=e.url;if(a)try{h=a.addDirectives(h)}catch(d){this.warn("Could not construct new URL with HLS Delivery Directives: "+d)}this.log("loading audio-track playlist for id: "+n),this.clearTimer(),this.hls.trigger(k.Events.AUDIO_TRACK_LOADING,{url:h,id:n,groupId:i,deliveryDirectives:a||null})}},O(m,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(a){this.selectDefaultTrack=!1,this.setAudioTrack(a)}}]),m}(S.default);N.default=y},"./src/controller/base-playlist-controller.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"default",function(){return O});var k=_("./src/polyfills/number.ts"),b=_("./src/types/level.ts"),S=_("./src/controller/level-helper.ts"),j=_("./src/utils/logger.ts"),M=_("./src/errors.ts"),O=function(){function w(y,C){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=j.logger.log.bind(j.logger,C+":"),this.warn=j.logger.warn.bind(j.logger,C+":"),this.hls=y}var c=w.prototype;return c.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},c.onError=function(C,m){m.fatal&&m.type===M.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},c.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},c.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},c.stopLoad=function(){this.canLoad=!1,this.clearTimer()},c.switchParams=function(C,m){var f=m==null?void 0:m.renditionReports;if(f)for(var v=0;v<f.length;v++){var a=f[v],e=""+a.URI;if(e===C.substr(-e.length)){var n=parseInt(a["LAST-MSN"]),i=parseInt(a["LAST-PART"]);if(m&&this.hls.config.lowLatencyMode){var h=Math.min(m.age-m.partTarget,m.targetduration);i!==void 0&&h>m.partTarget&&(i+=1)}if(Object(k.isFiniteNumber)(n))return new b.HlsUrlParameters(n,Object(k.isFiniteNumber)(i)?i:void 0,b.HlsSkip.No)}}},c.loadPlaylist=function(C){},c.shouldLoadTrack=function(C){return this.canLoad&&C&&!!C.url&&(!C.details||C.details.live)},c.playlistLoaded=function(C,m,f){var v=this,a=m.details,e=m.stats,n=e.loading.end?Math.max(0,self.performance.now()-e.loading.end):0;if(a.advancedDateTime=Date.now()-n,a.live||f!=null&&f.live){if(a.reloaded(f),f&&this.log("live playlist "+C+" "+(a.advanced?"REFRESHED "+a.lastPartSn+"-"+a.lastPartIndex:"MISSED")),f&&a.fragments.length>0&&Object(S.mergeDetails)(f,a),!this.canLoad||!a.live)return;var i,h=void 0,d=void 0;if(a.canBlockReload&&a.endSN&&a.advanced){var u=this.hls.config.lowLatencyMode,E=a.lastPartSn,g=a.endSN,s=a.lastPartIndex,o=s!==-1,r=E===g,t=u?0:s;o?(h=r?g+1:E,d=r?t:s+1):h=g+1;var T=a.age,x=T+a.ageHeader,A=Math.min(x-a.partTarget,a.targetduration*1.5);if(A>0){if(f&&A>f.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+f.tuneInGoal+" to: "+A+" with playlist age: "+a.age),A=0;else{var R=Math.floor(A/a.targetduration);if(h+=R,d!==void 0){var I=Math.round(A%a.targetduration/a.partTarget);d+=I}this.log("CDN Tune-in age: "+a.ageHeader+"s last advanced "+T.toFixed(2)+"s goal: "+A+" skip sn "+R+" to part "+d)}a.tuneInGoal=A}if(i=this.getDeliveryDirectives(a,m.deliveryDirectives,h,d),u||!r){this.loadPlaylist(i);return}}else i=this.getDeliveryDirectives(a,m.deliveryDirectives,h,d);var B=Object(S.computeReloadInterval)(a,e);h!==void 0&&a.canBlockReload&&(B-=a.partTarget||1),this.log("reload live playlist "+C+" in "+Math.round(B)+" ms"),this.timer=self.setTimeout(function(){return v.loadPlaylist(i)},B)}else this.clearTimer()},c.getDeliveryDirectives=function(C,m,f,v){var a=Object(b.getSkipValue)(C,f);return m!=null&&m.skip&&C.deltaUpdateFailed&&(f=m.msn,v=m.part,a=b.HlsSkip.No),new b.HlsUrlParameters(f,v,a)},c.retryLoadingOrFail=function(C){var m=this,f=this.hls.config,v=this.retryCount<f.levelLoadingMaxRetry;if(v){var a;if(this.retryCount++,C.details.indexOf("LoadTimeOut")>-1&&(a=C.context)!==null&&a!==void 0&&a.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+C.details+'"'),this.loadPlaylist();else{var e=Math.min(Math.pow(2,this.retryCount)*f.levelLoadingRetryDelay,f.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return m.loadPlaylist()},e),this.warn("retry playlist loading #"+this.retryCount+" in "+e+' ms after "'+C.details+'"')}}else this.warn('cannot recover from error "'+C.details+'"'),this.clearTimer(),C.fatal=!0;return v},w}()},"./src/controller/base-stream-controller.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"State",function(){return g}),_.d(N,"default",function(){return s});var k=_("./src/polyfills/number.ts"),b=_("./src/task-loop.ts"),S=_("./src/controller/fragment-tracker.ts"),j=_("./src/utils/buffer-helper.ts"),M=_("./src/utils/logger.ts"),O=_("./src/events.ts"),w=_("./src/errors.ts"),c=_("./src/types/transmuxer.ts"),y=_("./src/utils/mp4-tools.ts"),C=_("./src/utils/discontinuities.ts"),m=_("./src/controller/fragment-finders.ts"),f=_("./src/controller/level-helper.ts"),v=_("./src/loader/fragment-loader.ts"),a=_("./src/crypt/decrypter.ts"),e=_("./src/utils/time-ranges.ts"),n=_("./src/types/loader.ts");function i(o,r){for(var t=0;t<r.length;t++){var T=r[t];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(o,T.key,T)}}function h(o,r,t){return r&&i(o.prototype,r),t&&i(o,t),o}function d(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function u(o,r){o.prototype=Object.create(r.prototype),o.prototype.constructor=o,E(o,r)}function E(o,r){return E=Object.setPrototypeOf||function(T,x){return T.__proto__=x,T},E(o,r)}var g={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},s=function(o){u(r,o);function r(T,x,A){var R;return R=o.call(this)||this,R.hls=void 0,R.fragPrevious=null,R.fragCurrent=null,R.fragmentTracker=void 0,R.transmuxer=null,R._state=g.STOPPED,R.media=void 0,R.mediaBuffer=void 0,R.config=void 0,R.bitrateTest=!1,R.lastCurrentTime=0,R.nextLoadPosition=0,R.startPosition=0,R.loadedmetadata=!1,R.fragLoadError=0,R.retryDate=0,R.levels=null,R.fragmentLoader=void 0,R.levelLastLoaded=null,R.startFragRequested=!1,R.decrypter=void 0,R.initPTS=[],R.onvseeking=null,R.onvended=null,R.logPrefix="",R.log=void 0,R.warn=void 0,R.logPrefix=A,R.log=M.logger.log.bind(M.logger,A+":"),R.warn=M.logger.warn.bind(M.logger,A+":"),R.hls=T,R.fragmentLoader=new v.default(T.config),R.fragmentTracker=x,R.config=T.config,R.decrypter=new a.default(T,T.config),T.on(O.Events.KEY_LOADED,R.onKeyLoaded,d(R)),R}var t=r.prototype;return t.doTick=function(){this.onTickEnd()},t.onTickEnd=function(){},t.startLoad=function(x){},t.stopLoad=function(){this.fragmentLoader.abort();var x=this.fragCurrent;x&&this.fragmentTracker.removeFragment(x),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=g.STOPPED},t._streamEnded=function(x,A){var R=this.fragCurrent,I=this.fragmentTracker;if(!A.live&&R&&R.sn===A.endSN&&!x.nextStart){var B=I.getState(R);return B===S.FragmentState.PARTIAL||B===S.FragmentState.OK}return!1},t.onMediaAttached=function(x,A){var R=this.media=this.mediaBuffer=A.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),R.addEventListener("seeking",this.onvseeking),R.addEventListener("ended",this.onvended);var I=this.config;this.levels&&I.autoStartLoad&&this.state===g.STOPPED&&this.startLoad(I.startPosition)},t.onMediaDetaching=function(){var x=this.media;x!=null&&x.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),x&&(x.removeEventListener("seeking",this.onvseeking),x.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},t.onMediaSeeking=function(){var x=this.config,A=this.fragCurrent,R=this.media,I=this.mediaBuffer,B=this.state,W=R?R.currentTime:0,$=j.BufferHelper.bufferInfo(I||R,W,x.maxBufferHole);if(this.log("media seeking to "+(Object(k.isFiniteNumber)(W)?W.toFixed(3):W)+", state: "+B),B===g.ENDED)this.resetLoadingState();else if(A&&!$.len){var X=x.maxFragLookUpTolerance,V=A.start-X,se=A.start+A.duration+X,xe=W>se;(W<V||xe)&&(xe&&A.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),A.loader.abort()),this.resetLoadingState())}R&&(this.lastCurrentTime=W),!this.loadedmetadata&&!$.len&&(this.nextLoadPosition=this.startPosition=W),this.tickImmediate()},t.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},t.onKeyLoaded=function(x,A){if(this.state!==g.KEY_LOADING||A.frag!==this.fragCurrent||!this.levels)return;this.state=g.IDLE;var R=this.levels[A.frag.level].details;R&&this.loadFragment(A.frag,R,A.frag.start)},t.onHandlerDestroying=function(){this.stopLoad(),o.prototype.onHandlerDestroying.call(this)},t.onHandlerDestroyed=function(){this.state=g.STOPPED,this.hls.off(O.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,o.prototype.onHandlerDestroyed.call(this)},t.loadKey=function(x,A){this.log("Loading key for "+x.sn+" of ["+A.startSN+"-"+A.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+x.level),this.state=g.KEY_LOADING,this.fragCurrent=x,this.hls.trigger(O.Events.KEY_LOADING,{frag:x})},t.loadFragment=function(x,A,R){this._loadFragForPlayback(x,A,R)},t._loadFragForPlayback=function(x,A,R){var I=this,B=function($){if(I.fragContextChanged(x)){I.warn("Fragment "+x.sn+($.part?" p: "+$.part.index:"")+" of level "+x.level+" was dropped during download."),I.fragmentTracker.removeFragment(x);return}x.stats.chunkCount++,I._handleFragmentLoadProgress($)};this._doFragLoad(x,A,R,B).then(function(W){if(!W)return;I.fragLoadError=0;var $=I.state;if(I.fragContextChanged(x)){($===g.FRAG_LOADING||$===g.BACKTRACKING||!I.fragCurrent&&$===g.PARSING)&&(I.fragmentTracker.removeFragment(x),I.state=g.IDLE);return}if("payload"in W&&(I.log("Loaded fragment "+x.sn+" of level "+x.level),I.hls.trigger(O.Events.FRAG_LOADED,W),I.state===g.BACKTRACKING)){I.fragmentTracker.backtrack(x,W),I.resetFragmentLoading(x);return}I._handleFragmentLoadComplete(W)}).catch(function(W){I.warn(W),I.resetFragmentLoading(x)})},t.flushMainBuffer=function(x,A,R){if(R===void 0&&(R=null),!(x-A))return;var I={startOffset:x,endOffset:A,type:R};this.fragLoadError=0,this.hls.trigger(O.Events.BUFFER_FLUSHING,I)},t._loadInitSegment=function(x){var A=this;this._doFragLoad(x).then(function(R){if(!R||A.fragContextChanged(x)||!A.levels)throw new Error("init load aborted");return R}).then(function(R){var I=A.hls,B=R.payload,W=x.decryptdata;if(B&&B.byteLength>0&&W&&W.key&&W.iv&&W.method==="AES-128"){var $=self.performance.now();return A.decrypter.webCryptoDecrypt(new Uint8Array(B),W.key.buffer,W.iv.buffer).then(function(X){var V=self.performance.now();return I.trigger(O.Events.FRAG_DECRYPTED,{frag:x,payload:X,stats:{tstart:$,tdecrypt:V}}),R.payload=X,R})}return R}).then(function(R){var I=A.fragCurrent,B=A.hls,W=A.levels;if(!W)throw new Error("init load aborted, missing levels");var $=W[x.level].details;console.assert($,"Level details are defined when init segment is loaded");var X=x.stats;A.state=g.IDLE,A.fragLoadError=0,x.data=new Uint8Array(R.payload),X.parsing.start=X.buffering.start=self.performance.now(),X.parsing.end=X.buffering.end=self.performance.now(),R.frag===I&&B.trigger(O.Events.FRAG_BUFFERED,{stats:X,frag:I,part:null,id:x.type}),A.tick()}).catch(function(R){A.warn(R),A.resetFragmentLoading(x)})},t.fragContextChanged=function(x){var A=this.fragCurrent;return!x||!A||x.level!==A.level||x.sn!==A.sn||x.urlId!==A.urlId},t.fragBufferedComplete=function(x,A){var R=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+x.type+" sn: "+x.sn+(A?" part: "+A.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+x.level+" "+e.default.toString(j.BufferHelper.getBuffered(R))),this.state=g.IDLE,this.tick()},t._handleFragmentLoadComplete=function(x){var A=this.transmuxer;if(!A)return;var R=x.frag,I=x.part,B=x.partsLoaded,W=!B||B.length===0||B.some(function(X){return!X}),$=new c.ChunkMetadata(R.level,R.sn,R.stats.chunkCount+1,0,I?I.index:-1,!W);A.flush($)},t._handleFragmentLoadProgress=function(x){},t._doFragLoad=function(x,A,R,I){var B=this;if(R===void 0&&(R=null),!this.levels)throw new Error("frag load aborted, missing levels");if(R=Math.max(x.start,R||0),this.config.lowLatencyMode&&A){var W=A.partList;if(W&&I){R>x.end&&A.fragmentHint&&(x=A.fragmentHint);var $=this.getNextPart(W,x,R);if($>-1){var X=W[$];return this.log("Loading part sn: "+x.sn+" p: "+X.index+" cc: "+x.cc+" of playlist ["+A.startSN+"-"+A.endSN+"] parts [0-"+$+"-"+(W.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+x.level+", target: "+parseFloat(R.toFixed(3))),this.nextLoadPosition=X.start+X.duration,this.state=g.FRAG_LOADING,this.hls.trigger(O.Events.FRAG_LOADING,{frag:x,part:W[$],targetBufferTime:R}),this.doFragPartsLoad(x,W,$,I).catch(function(V){return B.handleFragLoadError(V)})}else if(!x.url||this.loadedEndOfParts(W,R))return Promise.resolve(null)}}return this.log("Loading fragment "+x.sn+" cc: "+x.cc+" "+(A?"of ["+A.startSN+"-"+A.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+x.level+", target: "+parseFloat(R.toFixed(3))),Object(k.isFiniteNumber)(x.sn)&&!this.bitrateTest&&(this.nextLoadPosition=x.start+x.duration),this.state=g.FRAG_LOADING,this.hls.trigger(O.Events.FRAG_LOADING,{frag:x,targetBufferTime:R}),this.fragmentLoader.load(x,I).catch(function(V){return B.handleFragLoadError(V)})},t.doFragPartsLoad=function(x,A,R,I){var B=this;return new Promise(function(W,$){var X=[],V=function se(xe){var Ee=A[xe];B.fragmentLoader.loadPart(x,Ee,I).then(function(je){X[Ee.index]=je;var Ae=je.part;B.hls.trigger(O.Events.FRAG_LOADED,je);var Oe=A[xe+1];if(Oe&&Oe.fragment===x)se(xe+1);else return W({frag:x,part:Ae,partsLoaded:X})}).catch($)};V(R)})},t.handleFragLoadError=function(x){var A=x.data;return A&&A.details===w.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(A.frag,A.part):this.hls.trigger(O.Events.ERROR,A),null},t._handleTransmuxerFlush=function(x){var A=this.getCurrentContext(x);if(!A||this.state!==g.PARSING){this.fragCurrent||(this.state=g.IDLE);return}var R=A.frag,I=A.part,B=A.level,W=self.performance.now();R.stats.parsing.end=W,I&&(I.stats.parsing.end=W),this.updateLevelTiming(R,I,B,x.partial)},t.getCurrentContext=function(x){var A=this.levels,R=x.level,I=x.sn,B=x.part;if(!A||!A[R])return this.warn("Levels object was unset while buffering fragment "+I+" of level "+R+". The current chunk will not be buffered."),null;var W=A[R],$=B>-1?Object(f.getPartWith)(W,I,B):null,X=$?$.fragment:Object(f.getFragmentWithSN)(W,I,this.fragCurrent);return X?{frag:X,part:$,level:W}:null},t.bufferFragmentData=function(x,A,R,I){if(!x||this.state!==g.PARSING)return;var B=x.data1,W=x.data2,$=B;if(B&&W&&($=Object(y.appendUint8Array)(B,W)),!$||!$.length)return;var X={type:x.type,frag:A,part:R,chunkMeta:I,parent:A.type,data:$};this.hls.trigger(O.Events.BUFFER_APPENDING,X),x.dropped&&x.independent&&!R&&this.flushBufferGap(A)},t.flushBufferGap=function(x){var A=this.media;if(!A)return;if(!j.BufferHelper.isBuffered(A,A.currentTime)){this.flushMainBuffer(0,x.start);return}var R=A.currentTime,I=j.BufferHelper.bufferInfo(A,R,0),B=x.duration,W=Math.min(this.config.maxFragLookUpTolerance*2,B*.25),$=Math.max(Math.min(x.start-W,I.end-W),R+W);x.start-$>W&&this.flushMainBuffer($,x.start)},t.getFwdBufferInfo=function(x,A){var R=this.config,I=this.getLoadPosition();if(!Object(k.isFiniteNumber)(I))return null;var B=j.BufferHelper.bufferInfo(x,I,R.maxBufferHole);if(B.len===0&&B.nextStart!==void 0){var W=this.fragmentTracker.getBufferedFrag(I,A);if(W&&B.nextStart<W.end)return j.BufferHelper.bufferInfo(x,I,Math.max(B.nextStart,R.maxBufferHole))}return B},t.getMaxBufferLength=function(x){var A=this.config,R;return x?R=Math.max(8*A.maxBufferSize/x,A.maxBufferLength):R=A.maxBufferLength,Math.min(R,A.maxMaxBufferLength)},t.reduceMaxBufferLength=function(x){var A=this.config,R=x||A.maxBufferLength;return A.maxMaxBufferLength>=R?(A.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+A.maxMaxBufferLength+"s"),!0):!1},t.getNextFragment=function(x,A){var R,I,B=A.fragments,W=B.length;if(!W)return null;var $=this.config,X=B[0].start,V;if(A.live){var se=$.initialLiveManifestSize;if(W<se)return this.warn("Not enough fragments to start playback (have: "+W+", need: "+se+")"),null;!A.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(V=this.getInitialLiveFragment(A,B),this.startPosition=V?this.hls.liveSyncPosition||V.start:x)}else x<=X&&(V=B[0]);if(!V){var xe=$.lowLatencyMode?A.partEnd:A.fragmentEnd;V=this.getFragmentAtPosition(x,xe,A)}return(R=V)!==null&&R!==void 0&&R.initSegment&&!((I=V)!==null&&I!==void 0&&I.initSegment.data)&&!this.bitrateTest&&(V=V.initSegment),V},t.getNextPart=function(x,A,R){for(var I=-1,B=!1,W=!0,$=0,X=x.length;$<X;$++){var V=x[$];if(W=W&&!V.independent,I>-1&&R<V.start)break;var se=V.loaded;!se&&(B||V.independent||W)&&V.fragment===A&&(I=$),B=se}return I},t.loadedEndOfParts=function(x,A){var R=x[x.length-1];return R&&A>R.start&&R.loaded},t.getInitialLiveFragment=function(x,A){var R=this.fragPrevious,I=null;if(R){if(x.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+R.programDateTime),I=Object(m.findFragmentByPDT)(A,R.endProgramDateTime,this.config.maxFragLookUpTolerance)),!I){var B=R.sn+1;if(B>=x.startSN&&B<=x.endSN){var W=A[B-x.startSN];R.cc===W.cc&&(I=W,this.log("Live playlist, switching playlist, load frag with next SN: "+I.sn))}I||(I=Object(m.findFragWithCC)(A,R.cc),I&&this.log("Live playlist, switching playlist, load frag with same CC: "+I.sn))}}else{var $=this.hls.liveSyncPosition;$!==null&&(I=this.getFragmentAtPosition($,this.bitrateTest?x.fragmentEnd:x.edge,x))}return I},t.getFragmentAtPosition=function(x,A,R){var I=this.config,B=this.fragPrevious,W=R.fragments,$=R.endSN,X=R.fragmentHint,V=I.maxFragLookUpTolerance,se=!!(I.lowLatencyMode&&R.partList&&X);se&&X&&!this.bitrateTest&&(W=W.concat(X),$=X.sn);var xe;if(x<A){var Ee=x>A-V?0:V;xe=Object(m.findFragmentByPTS)(B,W,x,Ee)}else xe=W[W.length-1];if(xe){var je=xe.sn-R.startSN,Ae=B&&xe.level===B.level,Oe=W[je+1],Le=this.fragmentTracker.getState(xe);if(Le===S.FragmentState.BACKTRACKED){xe=null;for(var Pe=je;W[Pe]&&this.fragmentTracker.getState(W[Pe])===S.FragmentState.BACKTRACKED;)B?xe=W[Pe--]:xe=W[--Pe];xe||(xe=Oe)}else B&&xe.sn===B.sn&&!se&&(Ae&&(xe.sn<$&&this.fragmentTracker.getState(Oe)!==S.FragmentState.OK?(this.log("SN "+xe.sn+" just loaded, load next one: "+Oe.sn),xe=Oe):xe=null))}return xe},t.synchronizeToLiveEdge=function(x){var A=this.config,R=this.media;if(!R)return;var I=this.hls.liveSyncPosition,B=R.currentTime,W=x.fragments[0].start,$=x.edge,X=B>=W-A.maxFragLookUpTolerance&&B<=$;if(I!==null&&R.duration>I&&(B<I||!X)){var V=A.liveMaxLatencyDuration!==void 0?A.liveMaxLatencyDuration:A.liveMaxLatencyDurationCount*x.targetduration;(!X&&R.readyState<4||B<$-V)&&(this.loadedmetadata||(this.nextLoadPosition=I),R.readyState&&(this.warn("Playback: "+B.toFixed(3)+" is located too far from the end of live sliding playlist: "+$+", reset currentTime to : "+I.toFixed(3)),R.currentTime=I))}},t.alignPlaylists=function(x,A){var R=this.levels,I=this.levelLastLoaded,B=this.fragPrevious,W=I!==null?R[I]:null,$=x.fragments.length;if(!$)return this.warn("No fragments in live playlist"),0;var X=x.fragments[0].start,V=!A,se=x.alignedSliding&&Object(k.isFiniteNumber)(X);if(V||!se&&!X){Object(C.alignStream)(B,W,x);var xe=x.fragments[0].start;return this.log("Live playlist sliding: "+xe.toFixed(2)+" start-sn: "+(A?A.startSN:"na")+"->"+x.startSN+" prev-sn: "+(B?B.sn:"na")+" fragments: "+$),xe}return X},t.waitForCdnTuneIn=function(x){var A=3;return x.live&&x.canBlockReload&&x.tuneInGoal>Math.max(x.partHoldBack,x.partTarget*A)},t.setStartPosition=function(x,A){var R=this.startPosition;if(R<A&&(R=-1),R===-1||this.lastCurrentTime===-1){var I=x.startTimeOffset;Object(k.isFiniteNumber)(I)?(R=A+I,I<0&&(R+=x.totalduration),R=Math.min(Math.max(A,R),A+x.totalduration),this.log("Start time offset "+I+" found in playlist, adjust startPosition to "+R),this.startPosition=R):x.live?R=this.hls.liveSyncPosition||A:this.startPosition=R=0,this.lastCurrentTime=R}this.nextLoadPosition=R},t.getLoadPosition=function(){var x=this.media,A=0;return this.loadedmetadata&&x?A=x.currentTime:this.nextLoadPosition&&(A=this.nextLoadPosition),A},t.handleFragLoadAborted=function(x,A){this.transmuxer&&x.sn!=="initSegment"&&x.stats.aborted&&(this.warn("Fragment "+x.sn+(A?" part"+A.index:"")+" of level "+x.level+" was aborted"),this.resetFragmentLoading(x))},t.resetFragmentLoading=function(x){(!this.fragCurrent||!this.fragContextChanged(x))&&(this.state=g.IDLE)},t.onFragmentOrKeyLoadError=function(x,A){if(A.fatal)return;var R=A.frag;if(!R||R.type!==x)return;var I=this.fragCurrent;console.assert(I&&R.sn===I.sn&&R.level===I.level&&R.urlId===I.urlId,"Frag load error must match current frag to retry");var B=this.config;if(this.fragLoadError+1<=B.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(R.level))return;var W=Math.min(Math.pow(2,this.fragLoadError)*B.fragLoadingRetryDelay,B.fragLoadingMaxRetryTimeout);this.warn("Fragment "+R.sn+" of "+x+" "+R.level+" failed to load, retrying in "+W+"ms"),this.retryDate=self.performance.now()+W,this.fragLoadError++,this.state=g.FRAG_LOADING_WAITING_RETRY}else A.levelRetry?(x===n.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=g.IDLE):(M.logger.error(A.details+" reaches max retry, redispatch as fatal ..."),A.fatal=!0,this.hls.stopLoad(),this.state=g.ERROR)},t.afterBufferFlushed=function(x,A,R){if(!x)return;var I=j.BufferHelper.getBuffered(x);this.fragmentTracker.detectEvictedFragments(A,I,R),this.state===g.ENDED&&this.resetLoadingState()},t.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=g.IDLE},t.resetLiveStartWhenNotLoaded=function(x){if(!this.loadedmetadata){this.startFragRequested=!1;var A=this.levels?this.levels[x].details:null;if(A!=null&&A.live)return this.startPosition=-1,this.setStartPosition(A,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},t.updateLevelTiming=function(x,A,R,I){var B=this,W=R.details;console.assert(!!W,"level.details must be defined");var $=Object.keys(x.elementaryStreams).reduce(function(X,V){var se=x.elementaryStreams[V];if(se){var xe=se.endPTS-se.startPTS;if(xe<=0)return B.warn("Could not parse fragment "+x.sn+" "+V+" duration reliably ("+xe+") resetting transmuxer to fallback to playlist timing"),B.resetTransmuxer(),X||!1;var Ee=I?0:Object(f.updateFragPTSDTS)(W,x,se.startPTS,se.endPTS,se.startDTS,se.endDTS);return B.hls.trigger(O.Events.LEVEL_PTS_UPDATED,{details:W,level:R,drift:Ee,type:V,frag:x,start:se.startPTS,end:se.endPTS}),!0}return X},!1);$?(this.state=g.PARSED,this.hls.trigger(O.Events.FRAG_PARSED,{frag:x,part:A})):this.resetLoadingState()},t.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},h(r,[{key:"state",get:function(){return this._state},set:function(x){var A=this._state;A!==x&&(this._state=x,this.log(A+"->"+x))}}]),r}(b.default)},"./src/controller/buffer-controller.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"default",function(){return m});var k=_("./src/polyfills/number.ts"),b=_("./src/events.ts"),S=_("./src/utils/logger.ts"),j=_("./src/errors.ts"),M=_("./src/utils/buffer-helper.ts"),O=_("./src/utils/mediasource-helper.ts"),w=_("./src/loader/fragment.ts"),c=_("./src/controller/buffer-operation-queue.ts"),y=Object(O.getMediaSource)(),C=/([ha]vc.)(?:\.[^.,]+)+/,m=function(){function f(a){var e=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var n=e.hls,i=e.media,h=e.mediaSource;S.logger.log("[buffer-controller]: Media source opened"),i&&(e.updateMediaElementDuration(),n.trigger(b.Events.MEDIA_ATTACHED,{media:i})),h&&h.removeEventListener("sourceopen",e._onMediaSourceOpen),e.checkPendingTracks()},this._onMediaSourceClose=function(){S.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){S.logger.log("[buffer-controller]: Media source ended")},this.hls=a,this._initSourceBuffer(),this.registerListeners()}var v=f.prototype;return v.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},v.destroy=function(){this.unregisterListeners(),this.details=null},v.registerListeners=function(){var e=this.hls;e.on(b.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(b.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(b.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(b.Events.BUFFER_RESET,this.onBufferReset,this),e.on(b.Events.BUFFER_APPENDING,this.onBufferAppending,this),e.on(b.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.on(b.Events.BUFFER_EOS,this.onBufferEos,this),e.on(b.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(b.Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(b.Events.FRAG_PARSED,this.onFragParsed,this),e.on(b.Events.FRAG_CHANGED,this.onFragChanged,this)},v.unregisterListeners=function(){var e=this.hls;e.off(b.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(b.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(b.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(b.Events.BUFFER_RESET,this.onBufferReset,this),e.off(b.Events.BUFFER_APPENDING,this.onBufferAppending,this),e.off(b.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.off(b.Events.BUFFER_EOS,this.onBufferEos,this),e.off(b.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(b.Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(b.Events.FRAG_PARSED,this.onFragParsed,this),e.off(b.Events.FRAG_CHANGED,this.onFragChanged,this)},v._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new c.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},v.onManifestParsed=function(e,n){var i=2;(n.audio&&!n.video||!n.altAudio)&&(i=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=i,this.details=null,S.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},v.onMediaAttaching=function(e,n){var i=this.media=n.media;if(i&&y){var h=this.mediaSource=new y;h.addEventListener("sourceopen",this._onMediaSourceOpen),h.addEventListener("sourceended",this._onMediaSourceEnded),h.addEventListener("sourceclose",this._onMediaSourceClose),i.src=self.URL.createObjectURL(h),this._objectUrl=i.src}},v.onMediaDetaching=function(){var e=this.media,n=this.mediaSource,i=this._objectUrl;if(n){if(S.logger.log("[buffer-controller]: media source detaching"),n.readyState==="open")try{n.endOfStream()}catch(h){S.logger.warn("[buffer-controller]: onMediaDetaching: "+h.message+" while calling endOfStream")}this.onBufferReset(),n.removeEventListener("sourceopen",this._onMediaSourceOpen),n.removeEventListener("sourceended",this._onMediaSourceEnded),n.removeEventListener("sourceclose",this._onMediaSourceClose),e&&(i&&self.URL.revokeObjectURL(i),e.src===i?(e.removeAttribute("src"),e.load()):S.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(b.Events.MEDIA_DETACHED,void 0)},v.onBufferReset=function(){var e=this;this.getSourceBufferTypes().forEach(function(n){var i=e.sourceBuffer[n];try{i&&(e.removeBufferListeners(n),e.mediaSource&&e.mediaSource.removeSourceBuffer(i),e.sourceBuffer[n]=void 0)}catch(h){S.logger.warn("[buffer-controller]: Failed to reset the "+n+" buffer",h)}}),this._initSourceBuffer()},v.onBufferCodecs=function(e,n){var i=this,h=this.getSourceBufferTypes().length;if(Object.keys(n).forEach(function(d){if(h){var u=i.tracks[d];if(u&&typeof u.buffer.changeType=="function"){var E=n[d],g=E.codec,s=E.levelCodec,o=E.container,r=(u.levelCodec||u.codec).replace(C,"$1"),t=(s||g).replace(C,"$1");if(r!==t){var T=o+";codecs="+(s||g);i.appendChangeType(d,T)}}}else i.pendingTracks[d]=n[d]}),h)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},v.appendChangeType=function(e,n){var i=this,h=this.operationQueue,d={execute:function(){var E=i.sourceBuffer[e];E&&(S.logger.log("[buffer-controller]: changing "+e+" sourceBuffer type to "+n),E.changeType(n)),h.shiftAndExecuteNext(e)},onStart:function(){},onComplete:function(){},onError:function(E){S.logger.warn("[buffer-controller]: Failed to change "+e+" SourceBuffer type",E)}};h.append(d,e)},v.onBufferAppending=function(e,n){var i=this,h=this.hls,d=this.operationQueue,u=this.tracks,E=n.data,g=n.type,s=n.frag,o=n.part,r=n.chunkMeta,t=r.buffering[g],T=self.performance.now();t.start=T;var x=s.stats.buffering,A=o?o.stats.buffering:null;x.start===0&&(x.start=T),A&&A.start===0&&(A.start=T);var R=u.audio,I=g==="audio"&&r.id===1&&(R==null?void 0:R.container)==="audio/mpeg",B={execute:function(){if(t.executeStart=self.performance.now(),I){var $=i.sourceBuffer[g];if($){var X=s.start-$.timestampOffset;Math.abs(X)>=.1&&(S.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+s.start+" (delta: "+X+") sn: "+s.sn+")"),$.timestampOffset=s.start)}}i.appendExecutor(E,g)},onStart:function(){},onComplete:function(){var $=self.performance.now();t.executeEnd=t.end=$,x.first===0&&(x.first=$),A&&A.first===0&&(A.first=$);var X=i.sourceBuffer,V={};for(var se in X)V[se]=M.BufferHelper.getBuffered(X[se]);i.appendError=0,i.hls.trigger(b.Events.BUFFER_APPENDED,{type:g,frag:s,part:o,chunkMeta:r,parent:s.type,timeRanges:V})},onError:function($){S.logger.error("[buffer-controller]: Error encountered while trying to append to the "+g+" SourceBuffer",$);var X={type:j.ErrorTypes.MEDIA_ERROR,parent:s.type,details:j.ErrorDetails.BUFFER_APPEND_ERROR,err:$,fatal:!1};$.code===DOMException.QUOTA_EXCEEDED_ERR?X.details=j.ErrorDetails.BUFFER_FULL_ERROR:(i.appendError++,X.details=j.ErrorDetails.BUFFER_APPEND_ERROR,i.appendError>h.config.appendErrorMaxRetry&&(S.logger.error("[buffer-controller]: Failed "+h.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),X.fatal=!0)),h.trigger(b.Events.ERROR,X)}};d.append(B,g)},v.onBufferFlushing=function(e,n){var i=this,h=this.operationQueue,d=function(E){return{execute:i.removeExecutor.bind(i,E,n.startOffset,n.endOffset),onStart:function(){},onComplete:function(){i.hls.trigger(b.Events.BUFFER_FLUSHED,{type:E})},onError:function(s){S.logger.warn("[buffer-controller]: Failed to remove from "+E+" SourceBuffer",s)}}};n.type?h.append(d(n.type),n.type):this.getSourceBufferTypes().forEach(function(u){h.append(d(u),u)})},v.onFragParsed=function(e,n){var i=this,h=n.frag,d=n.part,u=[],E=d?d.elementaryStreams:h.elementaryStreams;E[w.ElementaryStreamTypes.AUDIOVIDEO]?u.push("audiovideo"):(E[w.ElementaryStreamTypes.AUDIO]&&u.push("audio"),E[w.ElementaryStreamTypes.VIDEO]&&u.push("video"));var g=function(){var o=self.performance.now();h.stats.buffering.end=o,d&&(d.stats.buffering.end=o);var r=d?d.stats:h.stats;i.hls.trigger(b.Events.FRAG_BUFFERED,{frag:h,part:d,stats:r,id:h.type})};u.length===0&&S.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+h.type+" level: "+h.level+" sn: "+h.sn),this.blockBuffers(g,u)},v.onFragChanged=function(e,n){this.flushBackBuffer()},v.onBufferEos=function(e,n){var i=this,h=this.getSourceBufferTypes().reduce(function(d,u){var E=i.sourceBuffer[u];return(!n.type||n.type===u)&&(E&&!E.ended&&(E.ended=!0,S.logger.log("[buffer-controller]: "+u+" sourceBuffer now EOS"))),d&&!!(!E||E.ended)},!0);h&&this.blockBuffers(function(){var d=i.mediaSource;if(!d||d.readyState!=="open")return;d.endOfStream()})},v.onLevelUpdated=function(e,n){var i=n.details;if(!i.fragments.length)return;this.details=i,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},v.flushBackBuffer=function(){var e=this.hls,n=this.details,i=this.media,h=this.sourceBuffer;if(!i||n===null)return;var d=this.getSourceBufferTypes();if(!d.length)return;var u=n.live&&e.config.liveBackBufferLength!==null?e.config.liveBackBufferLength:e.config.backBufferLength;if(!Object(k.isFiniteNumber)(u)||u<0)return;var E=i.currentTime,g=n.levelTargetDuration,s=Math.max(u,g),o=Math.floor(E/g)*g-s;d.forEach(function(r){var t=h[r];if(t){var T=M.BufferHelper.getBuffered(t);T.length>0&&o>T.start(0)&&(e.trigger(b.Events.BACK_BUFFER_REACHED,{bufferEnd:o}),n.live&&e.trigger(b.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:o}),e.trigger(b.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:o,type:r}))}})},v.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var e=this.details,n=this.hls,i=this.media,h=this.mediaSource,d=e.fragments[0].start+e.totalduration,u=i.duration,E=Object(k.isFiniteNumber)(h.duration)?h.duration:0;e.live&&n.config.liveDurationInfinity?(S.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),h.duration=Infinity,this.updateSeekableRange(e)):(d>E&&d>u||!Object(k.isFiniteNumber)(u))&&(S.logger.log("[buffer-controller]: Updating Media Source duration to "+d.toFixed(3)),h.duration=d)},v.updateSeekableRange=function(e){var n=this.mediaSource,i=e.fragments,h=i.length;if(h&&e.live&&n!==null&&n!==void 0&&n.setLiveSeekableRange){var d=Math.max(0,i[0].start),u=Math.max(d,d+e.totalduration);n.setLiveSeekableRange(d,u)}},v.checkPendingTracks=function(){var e=this.bufferCodecEventsExpected,n=this.operationQueue,i=this.pendingTracks,h=Object.keys(i).length;if(h&&!e||h===2){this.createSourceBuffers(i),this.pendingTracks={};var d=this.getSourceBufferTypes();if(d.length===0){this.hls.trigger(b.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}d.forEach(function(u){n.executeNext(u)})}},v.createSourceBuffers=function(e){var n=this.sourceBuffer,i=this.mediaSource;if(!i)throw Error("createSourceBuffers called when mediaSource was null");var h=0;for(var d in e)if(!n[d]){var u=e[d];if(!u)throw Error("source buffer exists for track "+d+", however track does not");var E=u.levelCodec||u.codec,g=u.container+";codecs="+E;S.logger.log("[buffer-controller]: creating sourceBuffer("+g+")");try{var s=n[d]=i.addSourceBuffer(g),o=d;this.addBufferListener(o,"updatestart",this._onSBUpdateStart),this.addBufferListener(o,"updateend",this._onSBUpdateEnd),this.addBufferListener(o,"error",this._onSBUpdateError),this.tracks[d]={buffer:s,codec:E,container:u.container,levelCodec:u.levelCodec,id:u.id},h++}catch(r){S.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+r.message),this.hls.trigger(b.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:r,mimeType:g})}}h&&this.hls.trigger(b.Events.BUFFER_CREATED,{tracks:this.tracks})},v._onSBUpdateStart=function(e){var n=this.operationQueue,i=n.current(e);i.onStart()},v._onSBUpdateEnd=function(e){var n=this.operationQueue,i=n.current(e);i.onComplete(),n.shiftAndExecuteNext(e)},v._onSBUpdateError=function(e,n){S.logger.error("[buffer-controller]: "+e+" SourceBuffer error",n),this.hls.trigger(b.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var i=this.operationQueue.current(e);i&&i.onError(n)},v.removeExecutor=function(e,n,i){var h=this.media,d=this.mediaSource,u=this.operationQueue,E=this.sourceBuffer,g=E[e];if(!h||!d||!g){S.logger.warn("[buffer-controller]: Attempting to remove from the "+e+" SourceBuffer, but it does not exist"),u.shiftAndExecuteNext(e);return}var s=Object(k.isFiniteNumber)(h.duration)?h.duration:Infinity,o=Object(k.isFiniteNumber)(d.duration)?d.duration:Infinity,r=Math.max(0,n),t=Math.min(i,s,o);t>r?(S.logger.log("[buffer-controller]: Removing ["+r+","+t+"] from the "+e+" SourceBuffer"),console.assert(!g.updating,e+" sourceBuffer must not be updating"),g.remove(r,t)):u.shiftAndExecuteNext(e)},v.appendExecutor=function(e,n){var i=this.operationQueue,h=this.sourceBuffer,d=h[n];if(!d){S.logger.warn("[buffer-controller]: Attempting to append to the "+n+" SourceBuffer, but it does not exist"),i.shiftAndExecuteNext(n);return}d.ended=!1,console.assert(!d.updating,n+" sourceBuffer must not be updating"),d.appendBuffer(e)},v.blockBuffers=function(e,n){var i=this;if(n===void 0&&(n=this.getSourceBufferTypes()),!n.length){S.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(e);return}var h=this.operationQueue,d=n.map(function(u){return h.appendBlocker(u)});Promise.all(d).then(function(){e(),n.forEach(function(u){var E=i.sourceBuffer[u];(!E||!E.updating)&&h.shiftAndExecuteNext(u)})})},v.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},v.addBufferListener=function(e,n,i){var h=this.sourceBuffer[e];if(!h)return;var d=i.bind(this,e);this.listeners[e].push({event:n,listener:d}),h.addEventListener(n,d)},v.removeBufferListeners=function(e){var n=this.sourceBuffer[e];if(!n)return;this.listeners[e].forEach(function(i){n.removeEventListener(i.event,i.listener)})},f}()},"./src/controller/buffer-operation-queue.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"default",function(){return b});var k=_("./src/utils/logger.ts"),b=function(){function S(M){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=M}var j=S.prototype;return j.append=function(O,w){var c=this.queues[w];c.push(O),c.length===1&&this.buffers[w]&&this.executeNext(w)},j.insertAbort=function(O,w){var c=this.queues[w];c.unshift(O),this.executeNext(w)},j.appendBlocker=function(O){var w,c=new Promise(function(C){w=C}),y={execute:w,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(y,O),c},j.executeNext=function(O){var w=this.buffers,c=this.queues,y=w[O],C=c[O];if(C.length){var m=C[0];try{m.execute()}catch(f){k.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),m.onError(f),(!y||!y.updating)&&(C.shift(),this.executeNext(O))}}},j.shiftAndExecuteNext=function(O){this.queues[O].shift(),this.executeNext(O)},j.current=function(O){return this.queues[O][0]},S}()},"./src/controller/cap-level-controller.ts":function(Z,N,_){"use strict";_.r(N);var k=_("./src/events.ts");function b(M,O){for(var w=0;w<O.length;w++){var c=O[w];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(M,c.key,c)}}function S(M,O,w){return O&&b(M.prototype,O),w&&b(M,w),M}var j=function(){function M(w){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=w,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var O=M.prototype;return O.setStreamController=function(c){this.streamController=c},O.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},O.registerListeners=function(){var c=this.hls;c.on(k.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),c.on(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),c.on(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.on(k.Events.BUFFER_CODECS,this.onBufferCodecs,this),c.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},O.unregisterListener=function(){var c=this.hls;c.off(k.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),c.off(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),c.off(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.off(k.Events.BUFFER_CODECS,this.onBufferCodecs,this),c.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},O.onFpsDropLevelCapping=function(c,y){M.isLevelAllowed(y.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(y.droppedLevel)},O.onMediaAttaching=function(c,y){this.media=y.media instanceof HTMLVideoElement?y.media:null},O.onManifestParsed=function(c,y){var C=this.hls;this.restrictedLevels=[],this.firstLevel=y.firstLevel,C.config.capLevelToPlayerSize&&y.video&&this.startCapping()},O.onBufferCodecs=function(c,y){var C=this.hls;C.config.capLevelToPlayerSize&&y.video&&this.startCapping()},O.onMediaDetaching=function(){this.stopCapping()},O.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var c=this.hls.levels;if(c.length){var y=this.hls;y.autoLevelCapping=this.getMaxLevel(c.length-1),y.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=y.autoLevelCapping}}},O.getMaxLevel=function(c){var y=this,C=this.hls.levels;if(!C.length)return-1;var m=C.filter(function(f,v){return M.isLevelAllowed(v,y.restrictedLevels)&&v<=c});return this.clientRect=null,M.getMaxLevelByMediaSize(m,this.mediaWidth,this.mediaHeight)},O.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()},O.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},O.getDimensions=function(){if(this.clientRect)return this.clientRect;var c=this.media,y={width:0,height:0};if(c){var C=c.getBoundingClientRect();y.width=C.width,y.height=C.height,!y.width&&!y.height&&(y.width=C.right-C.left||c.width||0,y.height=C.bottom-C.top||c.height||0)}return this.clientRect=y,y},M.isLevelAllowed=function(c,y){return y===void 0&&(y=[]),y.indexOf(c)===-1},M.getMaxLevelByMediaSize=function(c,y,C){if(!c||!c.length)return-1;for(var m=function(n,i){return i?n.width!==i.width||n.height!==i.height:!0},f=c.length-1,v=0;v<c.length;v+=1){var a=c[v];if((a.width>=y||a.height>=C)&&m(a,c[v+1])){f=v;break}}return f},S(M,[{key:"mediaWidth",get:function(){return this.getDimensions().width*M.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*M.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var c=1;try{c=self.devicePixelRatio}catch(y){}return c}}]),M}();N.default=j},"./src/controller/cmcd-controller.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"default",function(){return m});var k=_("./src/events.ts"),b=_("./src/types/cmcd.ts"),S=_("./src/utils/buffer-helper.ts"),j=_("./src/utils/logger.ts");function M(f,v){for(var a=0;a<v.length;a++){var e=v[a];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(f,e.key,e)}}function O(f,v,a){return v&&M(f.prototype,v),a&&M(f,a),f}function w(f,v){var a=typeof Symbol!="undefined"&&f[Symbol.iterator]||f["@@iterator"];if(a)return(a=a.call(f)).next.bind(a);if(Array.isArray(f)||(a=c(f))||v&&f&&typeof f.length=="number"){a&&(f=a);var e=0;return function(){return e>=f.length?{done:!0}:{done:!1,value:f[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 c(f,v){if(!f)return;if(typeof f=="string")return y(f,v);var a=Object.prototype.toString.call(f).slice(8,-1);if(a==="Object"&&f.constructor&&(a=f.constructor.name),a==="Map"||a==="Set")return Array.from(f);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return y(f,v)}function y(f,v){(v==null||v>f.length)&&(v=f.length);for(var a=0,e=new Array(v);a<v;a++)e[a]=f[a];return e}function C(){return C=Object.assign||function(f){for(var v=1;v<arguments.length;v++){var a=arguments[v];for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&(f[e]=a[e])}return f},C.apply(this,arguments)}var m=function(){function f(a){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(h){try{e.apply(h,{ot:b.CMCDObjectType.MANIFEST,su:!e.initialized})}catch(d){j.logger.warn("Could not generate manifest CMCD data.",d)}},this.applyFragmentData=function(h){try{var d=h.frag,u=e.hls.levels[d.level],E=e.getObjectType(d),g={d:d.duration*1e3,ot:E};(E===b.CMCDObjectType.VIDEO||E===b.CMCDObjectType.AUDIO||E==b.CMCDObjectType.MUXED)&&(g.br=u.bitrate/1e3,g.tb=e.getTopBandwidth(E),g.bl=e.getBufferLength(E)),e.apply(h,g)}catch(s){j.logger.warn("Could not generate segment CMCD data.",s)}},this.hls=a;var n=this.config=a.config,i=n.cmcd;i!=null&&(n.pLoader=this.createPlaylistLoader(),n.fLoader=this.createFragmentLoader(),this.sid=i.sessionId||f.uuid(),this.cid=i.contentId,this.useHeaders=i.useHeaders===!0,this.registerListeners())}var v=f.prototype;return v.registerListeners=function(){var e=this.hls;e.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(k.Events.MEDIA_DETACHED,this.onMediaDetached,this),e.on(k.Events.BUFFER_CREATED,this.onBufferCreated,this)},v.unregisterListeners=function(){var e=this.hls;e.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(k.Events.MEDIA_DETACHED,this.onMediaDetached,this),e.off(k.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},v.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},v.onMediaAttached=function(e,n){this.media=n.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},v.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},v.onBufferCreated=function(e,n){var i,h;this.audioBuffer=(i=n.tracks.audio)===null||i===void 0?void 0:i.buffer,this.videoBuffer=(h=n.tracks.video)===null||h===void 0?void 0:h.buffer},v.createData=function(){var e;return{v:b.CMCDVersion,sf:b.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}},v.apply=function(e,n){n===void 0&&(n={}),C(n,this.createData());var i=n.ot===b.CMCDObjectType.INIT||n.ot===b.CMCDObjectType.VIDEO||n.ot===b.CMCDObjectType.MUXED;if(this.starved&&i&&(n.bs=!0,n.su=!0,this.starved=!1),n.su==null&&(n.su=this.buffering),this.useHeaders){var h=f.toHeaders(n);if(!Object.keys(h).length)return;e.headers||(e.headers={}),C(e.headers,h)}else{var d=f.toQuery(n);if(!d)return;e.url=f.appendQueryToUri(e.url,d)}},v.getObjectType=function(e){var n=e.type;return n==="subtitle"?b.CMCDObjectType.TIMED_TEXT:e.sn==="initSegment"?b.CMCDObjectType.INIT:n==="audio"?b.CMCDObjectType.AUDIO:n==="main"?this.hls.audioTracks.length?b.CMCDObjectType.VIDEO:b.CMCDObjectType.MUXED:void 0},v.getTopBandwidth=function(e){for(var n=0,i=e===b.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,h=w(i),d;!(d=h()).done;){var u=d.value;u.bitrate>n&&(n=u.bitrate)}return n>0?n:NaN},v.getBufferLength=function(e){var n=this.hls.media,i=e===b.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!i||!n)return NaN;var h=S.BufferHelper.bufferInfo(i,n.currentTime,this.config.maxBufferHole);return h.len*1e3},v.createPlaylistLoader=function(){var e=this.config.pLoader,n=this.applyPlaylistData,i=e||this.config.loader;return function(){function h(u){this.loader=void 0,this.loader=new i(u)}var d=h.prototype;return d.destroy=function(){this.loader.destroy()},d.abort=function(){this.loader.abort()},d.load=function(E,g,s){n(E),this.loader.load(E,g,s)},O(h,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),h}()},v.createFragmentLoader=function(){var e=this.config.fLoader,n=this.applyFragmentData,i=e||this.config.loader;return function(){function h(u){this.loader=void 0,this.loader=new i(u)}var d=h.prototype;return d.destroy=function(){this.loader.destroy()},d.abort=function(){this.loader.abort()},d.load=function(E,g,s){n(E),this.loader.load(E,g,s)},O(h,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),h}()},f.uuid=function(){var e=URL.createObjectURL(new Blob),n=e.toString();return URL.revokeObjectURL(e),n.substr(n.lastIndexOf("/")+1)},f.serialize=function(e){for(var n=[],i=function(I){return!Number.isNaN(I)&&I!=null&&I!==""&&I!==!1},h=function(I){return Math.round(I)},d=function(I){return h(I/100)*100},u=function(I){return encodeURIComponent(I)},E={br:h,d:h,bl:d,dl:d,mtp:d,nor:u,rtp:d,tb:h},g=Object.keys(e||{}).sort(),s=w(g),o;!(o=s()).done;){var r=o.value,t=e[r];if(!i(t))continue;if(r==="v"&&t===1)continue;if(r=="pr"&&t===1)continue;var T=E[r];T&&(t=T(t));var x=typeof t,A=void 0;r==="ot"||r==="sf"||r==="st"?A=r+"="+t:x==="boolean"?A=r:x==="number"?A=r+"="+t:A=r+"="+JSON.stringify(t),n.push(A)}return n.join(",")},f.toHeaders=function(e){for(var n=Object.keys(e),i={},h=["Object","Request","Session","Status"],d=[{},{},{},{}],u={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},E=0,g=n;E<g.length;E++){var s=g[E],o=u[s]!=null?u[s]:1;d[o][s]=e[s]}for(var r=0;r<d.length;r++){var t=f.serialize(d[r]);t&&(i["CMCD-"+h[r]]=t)}return i},f.toQuery=function(e){return"CMCD="+encodeURIComponent(f.serialize(e))},f.appendQueryToUri=function(e,n){if(!n)return e;var i=e.includes("?")?"&":"?";return""+e+i+n},f}()},"./src/controller/eme-controller.ts":function(Z,N,_){"use strict";_.r(N);var k=_("./src/events.ts"),b=_("./src/errors.ts"),S=_("./src/utils/logger.ts"),j=_("./src/utils/mediakeys-helper.ts");function M(m,f){for(var v=0;v<f.length;v++){var a=f[v];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(m,a.key,a)}}function O(m,f,v){return f&&M(m.prototype,f),v&&M(m,v),m}var w=3,c=function(f,v,a){var e={audioCapabilities:[],videoCapabilities:[]};return f.forEach(function(n){e.audioCapabilities.push({contentType:'audio/mp4; codecs="'+n+'"',robustness:a.audioRobustness||""})}),v.forEach(function(n){e.videoCapabilities.push({contentType:'video/mp4; codecs="'+n+'"',robustness:a.videoRobustness||""})}),[e]},y=function(f,v,a,e){switch(f){case j.KeySystems.WIDEVINE:return c(v,a,e);default:throw new Error("Unknown key-system: "+f)}},C=function(){function m(v){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=v,this._config=v.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var f=m.prototype;return f.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},f._registerListeners=function(){this.hls.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(k.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(k.Events.MANIFEST_PARSED,this.onManifestParsed,this)},f._unregisterListeners=function(){this.hls.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(k.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(k.Events.MANIFEST_PARSED,this.onManifestParsed,this)},f.getLicenseServerUrl=function(a){switch(a){case j.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+a+'"')},f._attemptKeySystemAccess=function(a,e,n){var i=this,h=y(a,e,n,this._drmSystemOptions);S.logger.log("Requesting encrypted media key-system access");var d=this.requestMediaKeySystemAccess(a,h);this.mediaKeysPromise=d.then(function(u){return i._onMediaKeySystemAccessObtained(a,u)}),d.catch(function(u){S.logger.error('Failed to obtain key-system "'+a+'" access:',u)})},f._onMediaKeySystemAccessObtained=function(a,e){var n=this;S.logger.log('Access for key-system "'+a+'" obtained');var i={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:e,mediaKeySystemDomain:a};this._mediaKeysList.push(i);var h=Promise.resolve().then(function(){return e.createMediaKeys()}).then(function(d){return i.mediaKeys=d,S.logger.log('Media-keys created for key-system "'+a+'"'),n._onMediaKeysCreated(),d});return h.catch(function(d){S.logger.error("Failed to create media-keys:",d)}),h},f._onMediaKeysCreated=function(){var a=this;this._mediaKeysList.forEach(function(e){e.mediaKeysSession||(e.mediaKeysSession=e.mediaKeys.createSession(),a._onNewMediaKeySession(e.mediaKeysSession))})},f._onNewMediaKeySession=function(a){var e=this;S.logger.log("New key-system session "+a.sessionId),a.addEventListener("message",function(n){e._onKeySessionMessage(a,n.message)},!1)},f._onKeySessionMessage=function(a,e){S.logger.log("Got EME message event, creating license request"),this._requestLicense(e,function(n){S.logger.log("Received license data (length: "+(n&&n.byteLength)+"), updating key-session"),a.update(n)})},f.onMediaEncrypted=function(a){var e=this;if(S.logger.log('Media is encrypted using "'+a.initDataType+'" init data type'),!this.mediaKeysPromise){S.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(k.Events.ERROR,{type:b.ErrorTypes.KEY_SYSTEM_ERROR,details:b.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var n=function(h){if(!e._media)return;e._attemptSetMediaKeys(h),e._generateRequestWithPreferredKeySession(a.initDataType,a.initData)};this.mediaKeysPromise.then(n).catch(n)},f._attemptSetMediaKeys=function(a){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var e=this._mediaKeysList[0];if(!e||!e.mediaKeys){S.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(k.Events.ERROR,{type:b.ErrorTypes.KEY_SYSTEM_ERROR,details:b.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}S.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(e.mediaKeys),this._hasSetMediaKeys=!0}},f._generateRequestWithPreferredKeySession=function(a,e){var n=this,i=this._mediaKeysList[0];if(!i){S.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(k.Events.ERROR,{type:b.ErrorTypes.KEY_SYSTEM_ERROR,details:b.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(i.mediaKeysSessionInitialized){S.logger.warn("Key-Session already initialized but requested again");return}var h=i.mediaKeysSession;if(!h){S.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(k.Events.ERROR,{type:b.ErrorTypes.KEY_SYSTEM_ERROR,details:b.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!e){S.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(k.Events.ERROR,{type:b.ErrorTypes.KEY_SYSTEM_ERROR,details:b.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}S.logger.log('Generating key-session request for "'+a+'" init data type'),i.mediaKeysSessionInitialized=!0,h.generateRequest(a,e).then(function(){S.logger.debug("Key-session generation succeeded")}).catch(function(d){S.logger.error("Error generating key-session request:",d),n.hls.trigger(k.Events.ERROR,{type:b.ErrorTypes.KEY_SYSTEM_ERROR,details:b.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},f._createLicenseXhr=function(a,e,n){var i=new XMLHttpRequest;i.responseType="arraybuffer",i.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,i,a,e,n);var h=this._licenseXhrSetup;if(h)try{h.call(this.hls,i,a),h=void 0}catch(d){S.logger.error(d)}try{i.readyState||i.open("POST",a,!0),h&&h.call(this.hls,i,a)}catch(d){throw new Error("issue setting up KeySystem license XHR "+d)}return i},f._onLicenseRequestReadyStageChange=function(a,e,n,i){switch(a.readyState){case 4:if(a.status===200){this._requestLicenseFailureCount=0,S.logger.log("License request succeeded");var h=a.response,d=this._licenseResponseCallback;if(d)try{h=d.call(this.hls,a,e)}catch(E){S.logger.error(E)}i(h)}else{if(S.logger.error("License Request XHR failed ("+e+"). Status: "+a.status+" ("+a.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>w){this.hls.trigger(k.Events.ERROR,{type:b.ErrorTypes.KEY_SYSTEM_ERROR,details:b.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var u=w-this._requestLicenseFailureCount+1;S.logger.warn("Retrying license request, "+u+" attempts left"),this._requestLicense(n,i)}break}},f._generateLicenseRequestChallenge=function(a,e){switch(a.mediaKeySystemDomain){case j.KeySystems.WIDEVINE:return e}throw new Error("unsupported key-system: "+a.mediaKeySystemDomain)},f._requestLicense=function(a,e){S.logger.log("Requesting content license for key-system");var n=this._mediaKeysList[0];if(!n){S.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(k.Events.ERROR,{type:b.ErrorTypes.KEY_SYSTEM_ERROR,details:b.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var i=this.getLicenseServerUrl(n.mediaKeySystemDomain),h=this._createLicenseXhr(i,a,e);S.logger.log("Sending license request to URL: "+i);var d=this._generateLicenseRequestChallenge(n,a);h.send(d)}catch(u){S.logger.error("Failure requesting DRM license: "+u),this.hls.trigger(k.Events.ERROR,{type:b.ErrorTypes.KEY_SYSTEM_ERROR,details:b.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},f.onMediaAttached=function(a,e){if(!this._emeEnabled)return;var n=e.media;this._media=n,n.addEventListener("encrypted",this._onMediaEncrypted)},f.onMediaDetached=function(){var a=this._media,e=this._mediaKeysList;if(!a)return;a.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(e.map(function(n){if(n.mediaKeysSession)return n.mediaKeysSession.close().catch(function(){})})).then(function(){return a.setMediaKeys(null)}).catch(function(){})},f.onManifestParsed=function(a,e){if(!this._emeEnabled)return;var n=e.levels.map(function(h){return h.audioCodec}).filter(function(h){return!!h}),i=e.levels.map(function(h){return h.videoCodec}).filter(function(h){return!!h});this._attemptKeySystemAccess(j.KeySystems.WIDEVINE,n,i)},O(m,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),m}();N.default=C},"./src/controller/fps-controller.ts":function(Z,N,_){"use strict";_.r(N);var k=_("./src/events.ts"),b=_("./src/utils/logger.ts"),S=function(){function j(O){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=O,this.registerListeners()}var M=j.prototype;return M.setStreamController=function(w){this.streamController=w},M.registerListeners=function(){this.hls.on(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},M.unregisterListeners=function(){this.hls.off(k.Events.MEDIA_ATTACHING,this.onMediaAttaching)},M.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},M.onMediaAttaching=function(w,c){var y=this.hls.config;if(y.capLevelOnFPSDrop){var C=c.media instanceof self.HTMLVideoElement?c.media:null;this.media=C,C&&typeof C.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),y.fpsDroppedMonitoringPeriod)}},M.checkFPS=function(w,c,y){var C=performance.now();if(c){if(this.lastTime){var m=C-this.lastTime,f=y-this.lastDroppedFrames,v=c-this.lastDecodedFrames,a=1e3*f/m,e=this.hls;if(e.trigger(k.Events.FPS_DROP,{currentDropped:f,currentDecoded:v,totalDroppedFrames:y}),a>0&&f>e.config.fpsDroppedMonitoringThreshold*v){var n=e.currentLevel;b.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+n),n>0&&(e.autoLevelCapping===-1||e.autoLevelCapping>=n)&&(n=n-1,e.trigger(k.Events.FPS_DROP_LEVEL_CAPPING,{level:n,droppedLevel:e.currentLevel}),e.autoLevelCapping=n,this.streamController.nextLevelSwitch())}}this.lastTime=C,this.lastDroppedFrames=y,this.lastDecodedFrames=c}},M.checkFPSInterval=function(){var w=this.media;if(w)if(this.isVideoPlaybackQualityAvailable){var c=w.getVideoPlaybackQuality();this.checkFPS(w,c.totalVideoFrames,c.droppedVideoFrames)}else this.checkFPS(w,w.webkitDecodedFrameCount,w.webkitDroppedFrameCount)},j}();N.default=S},"./src/controller/fragment-finders.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"findFragmentByPDT",function(){return S}),_.d(N,"findFragmentByPTS",function(){return j}),_.d(N,"fragmentWithinToleranceTest",function(){return M}),_.d(N,"pdtWithinToleranceTest",function(){return O}),_.d(N,"findFragWithCC",function(){return w});var k=_("./src/polyfills/number.ts"),b=_("./src/utils/binary-search.ts");function S(c,y,C){if(y===null||!Array.isArray(c)||!c.length||!Object(k.isFiniteNumber)(y))return null;var m=c[0].programDateTime;if(y<(m||0))return null;var f=c[c.length-1].endProgramDateTime;if(y>=(f||0))return null;C=C||0;for(var v=0;v<c.length;++v){var a=c[v];if(O(y,C,a))return a}return null}function j(c,y,C,m){C===void 0&&(C=0),m===void 0&&(m=0);var f=null;if(c?f=y[c.sn-y[0].sn+1]||null:C===0&&y[0].start===0&&(f=y[0]),f&&M(C,m,f)===0)return f;var v=b.default.search(y,M.bind(null,C,m));return v||f}function M(c,y,C){c===void 0&&(c=0),y===void 0&&(y=0);var m=Math.min(y,C.duration+(C.deltaPTS?C.deltaPTS:0));return C.start+C.duration-m<=c?1:C.start-m>c&&C.start?-1:0}function O(c,y,C){var m=Math.min(y,C.duration+(C.deltaPTS?C.deltaPTS:0))*1e3,f=C.endProgramDateTime||0;return f-m>c}function w(c,y){return b.default.search(c,function(C){return C.cc<y?1:C.cc>y?-1:0})}},"./src/controller/fragment-tracker.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"FragmentState",function(){return S}),_.d(N,"FragmentTracker",function(){return j});var k=_("./src/events.ts"),b=_("./src/types/loader.ts"),S;(function(w){w.NOT_LOADED="NOT_LOADED",w.BACKTRACKED="BACKTRACKED",w.APPENDING="APPENDING",w.PARTIAL="PARTIAL",w.OK="OK"})(S||(S={}));var j=function(){function w(y){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=y,this._registerListeners()}var c=w.prototype;return c._registerListeners=function(){var C=this.hls;C.on(k.Events.BUFFER_APPENDED,this.onBufferAppended,this),C.on(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),C.on(k.Events.FRAG_LOADED,this.onFragLoaded,this)},c._unregisterListeners=function(){var C=this.hls;C.off(k.Events.BUFFER_APPENDED,this.onBufferAppended,this),C.off(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),C.off(k.Events.FRAG_LOADED,this.onFragLoaded,this)},c.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},c.getAppendedFrag=function(C,m){if(m===b.PlaylistLevelType.MAIN){var f=this.activeFragment,v=this.activeParts;if(!f)return null;if(v)for(var a=v.length;a--;){var e=v[a],n=e?e.end:f.appendedPTS;if(e.start<=C&&n!==void 0&&C<=n)return a>9&&(this.activeParts=v.slice(a-9)),e}else if(f.start<=C&&f.appendedPTS!==void 0&&C<=f.appendedPTS)return f}return this.getBufferedFrag(C,m)},c.getBufferedFrag=function(C,m){for(var f=this.fragments,v=Object.keys(f),a=v.length;a--;){var e=f[v[a]];if((e==null?void 0:e.body.type)===m&&e.buffered){var n=e.body;if(n.start<=C&&C<=n.end)return n}}return null},c.detectEvictedFragments=function(C,m,f){var v=this;Object.keys(this.fragments).forEach(function(a){var e=v.fragments[a];if(!e)return;if(!e.buffered){e.body.type===f&&v.removeFragment(e.body);return}var n=e.range[C];if(!n)return;n.time.some(function(i){var h=!v.isTimeBuffered(i.startPTS,i.endPTS,m);return h&&v.removeFragment(e.body),h})})},c.detectPartialFragments=function(C){var m=this,f=this.timeRanges,v=C.frag,a=C.part;if(!f||v.sn==="initSegment")return;var e=O(v),n=this.fragments[e];if(!n)return;Object.keys(f).forEach(function(i){var h=v.elementaryStreams[i];if(!h)return;var d=f[i],u=a!==null||h.partial===!0;n.range[i]=m.getBufferedTimes(v,a,u,d)}),n.backtrack=n.loaded=null,Object.keys(n.range).length?n.buffered=!0:this.removeFragment(n.body)},c.fragBuffered=function(C){var m=O(C),f=this.fragments[m];f&&(f.backtrack=f.loaded=null,f.buffered=!0)},c.getBufferedTimes=function(C,m,f,v){for(var a={time:[],partial:f},e=m?m.start:C.start,n=m?m.end:C.end,i=C.minEndPTS||n,h=C.maxStartPTS||e,d=0;d<v.length;d++){var u=v.start(d)-this.bufferPadding,E=v.end(d)+this.bufferPadding;if(h>=u&&i<=E){a.time.push({startPTS:Math.max(e,v.start(d)),endPTS:Math.min(n,v.end(d))});break}else if(e<E&&n>u)a.partial=!0,a.time.push({startPTS:Math.max(e,v.start(d)),endPTS:Math.min(n,v.end(d))});else if(n<=u)break}return a},c.getPartialFragment=function(C){var m=null,f,v,a,e=0,n=this.bufferPadding,i=this.fragments;return Object.keys(i).forEach(function(h){var d=i[h];if(!d)return;M(d)&&(v=d.body.start-n,a=d.body.end+n,C>=v&&C<=a&&(f=Math.min(C-v,a-C),e<=f&&(m=d.body,e=f)))}),m},c.getState=function(C){var m=O(C),f=this.fragments[m];return f?f.buffered?M(f)?S.PARTIAL:S.OK:f.backtrack?S.BACKTRACKED:S.APPENDING:S.NOT_LOADED},c.backtrack=function(C,m){var f=O(C),v=this.fragments[f];if(!v||v.backtrack)return null;var a=v.backtrack=m||v.loaded;return v.loaded=null,a},c.getBacktrackData=function(C){var m=O(C),f=this.fragments[m];if(f){var v,a=f.backtrack;if(a!=null&&(v=a.payload)!==null&&v!==void 0&&v.byteLength)return a;this.removeFragment(C)}return null},c.isTimeBuffered=function(C,m,f){for(var v,a,e=0;e<f.length;e++){if(v=f.start(e)-this.bufferPadding,a=f.end(e)+this.bufferPadding,C>=v&&m<=a)return!0;if(m<=v)return!1}return!1},c.onFragLoaded=function(C,m){var f=m.frag,v=m.part;if(f.sn==="initSegment"||f.bitrateTest||v)return;var a=O(f);this.fragments[a]={body:f,loaded:m,backtrack:null,buffered:!1,range:Object.create(null)}},c.onBufferAppended=function(C,m){var f=this,v=m.frag,a=m.part,e=m.timeRanges;if(v.type===b.PlaylistLevelType.MAIN)if(this.activeFragment=v,a){var n=this.activeParts;n||(this.activeParts=n=[]),n.push(a)}else this.activeParts=null;this.timeRanges=e,Object.keys(e).forEach(function(i){var h=e[i];if(f.detectEvictedFragments(i,h),!a)for(var d=0;d<h.length;d++)v.appendedPTS=Math.max(h.end(d),v.appendedPTS||0)})},c.onFragBuffered=function(C,m){this.detectPartialFragments(m)},c.hasFragment=function(C){var m=O(C);return!!this.fragments[m]},c.removeFragmentsInRange=function(C,m,f){var v=this;Object.keys(this.fragments).forEach(function(a){var e=v.fragments[a];if(!e)return;if(e.buffered){var n=e.body;n.type===f&&n.start<m&&n.end>C&&v.removeFragment(n)}})},c.removeFragment=function(C){var m=O(C);C.stats.loaded=0,C.clearElementaryStreamInfo(),delete this.fragments[m]},c.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},w}();function M(w){var c,y;return w.buffered&&(((c=w.range.video)===null||c===void 0?void 0:c.partial)||((y=w.range.audio)===null||y===void 0?void 0:y.partial))}function O(w){return w.type+"_"+w.level+"_"+w.urlId+"_"+w.sn}},"./src/controller/gap-controller.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"STALL_MINIMUM_DURATION_MS",function(){return M}),_.d(N,"MAX_START_GAP_JUMP",function(){return O}),_.d(N,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return w}),_.d(N,"SKIP_BUFFER_RANGE_START",function(){return c}),_.d(N,"default",function(){return y});var k=_("./src/utils/buffer-helper.ts"),b=_("./src/errors.ts"),S=_("./src/events.ts"),j=_("./src/utils/logger.ts"),M=250,O=2,w=.1,c=.05,y=function(){function C(f,v,a,e){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=f,this.media=v,this.fragmentTracker=a,this.hls=e}var m=C.prototype;return m.destroy=function(){this.hls=this.fragmentTracker=this.media=null},m.poll=function(v){var a=this.config,e=this.media,n=this.stalled,i=e.currentTime,h=e.seeking,d=this.seeking&&!h,u=!this.seeking&&h;if(this.seeking=h,i!==v){if(this.moved=!0,n!==null){if(this.stallReported){var E=self.performance.now()-n;j.logger.warn("playback not stuck anymore @"+i+", after "+Math.round(E)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((u||d)&&(this.stalled=null),e.paused||e.ended||e.playbackRate===0||!k.BufferHelper.getBuffered(e).length)return;var g=k.BufferHelper.bufferInfo(e,i,0),s=g.len>0,o=g.nextStart||0;if(!s&&!o)return;if(h){var r=g.len>O,t=!o||o-i>O&&!this.fragmentTracker.getPartialFragment(i);if(r||t)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var T,x=Math.max(o,g.start||0)-i,A=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,R=A==null||((T=A.details)===null||T===void 0)?void 0:T.live,I=R?A.details.targetduration*2:O;if(x>0&&x<=I){this._trySkipBufferHole(null);return}}var B=self.performance.now();if(n===null){this.stalled=B;return}var W=B-n;!h&&W>=M&&this._reportStall(g.len);var $=k.BufferHelper.bufferInfo(e,i,a.maxBufferHole);this._tryFixBufferStall($,W)},m._tryFixBufferStall=function(v,a){var e=this.config,n=this.fragmentTracker,i=this.media,h=i.currentTime,d=n.getPartialFragment(h);if(d){var u=this._trySkipBufferHole(d);if(u)return}v.len>e.maxBufferHole&&a>e.highBufferWatchdogPeriod*1e3&&(j.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},m._reportStall=function(v){var a=this.hls,e=this.media,n=this.stallReported;n||(this.stallReported=!0,j.logger.warn("Playback stalling at @"+e.currentTime+" due to low buffer (buffer="+v+")"),a.trigger(S.Events.ERROR,{type:b.ErrorTypes.MEDIA_ERROR,details:b.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:v}))},m._trySkipBufferHole=function(v){for(var a=this.config,e=this.hls,n=this.media,i=n.currentTime,h=0,d=k.BufferHelper.getBuffered(n),u=0;u<d.length;u++){var E=d.start(u);if(i+a.maxBufferHole>=h&&i<E){var g=Math.max(E+c,n.currentTime+w);return j.logger.warn("skipping hole, adjusting currentTime from "+i+" to "+g),this.moved=!0,this.stalled=null,n.currentTime=g,v&&e.trigger(S.Events.ERROR,{type:b.ErrorTypes.MEDIA_ERROR,details:b.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+i+" to "+g,frag:v}),g}h=d.end(u)}return 0},m._tryNudgeBuffer=function(){var v=this.config,a=this.hls,e=this.media,n=e.currentTime,i=(this.nudgeRetry||0)+1;if(this.nudgeRetry=i,i<v.nudgeMaxRetry){var h=n+i*v.nudgeOffset;j.logger.warn("Nudging 'currentTime' from "+n+" to "+h),e.currentTime=h,a.trigger(S.Events.ERROR,{type:b.ErrorTypes.MEDIA_ERROR,details:b.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else j.logger.error("Playhead still not moving while enough data buffered @"+n+" after "+v.nudgeMaxRetry+" nudges"),a.trigger(S.Events.ERROR,{type:b.ErrorTypes.MEDIA_ERROR,details:b.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},C}()},"./src/controller/id3-track-controller.ts":function(Z,N,_){"use strict";_.r(N);var k=_("./src/events.ts"),b=_("./src/utils/texttrack-utils.ts"),S=_("./src/demux/id3.ts"),j=.25,M=function(){function O(c){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=c,this._registerListeners()}var w=O.prototype;return w.destroy=function(){this._unregisterListeners()},w._registerListeners=function(){var y=this.hls;y.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),y.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),y.on(k.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),y.on(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w._unregisterListeners=function(){var y=this.hls;y.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),y.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),y.off(k.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),y.off(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w.onMediaAttached=function(y,C){this.media=C.media},w.onMediaDetaching=function(){if(!this.id3Track)return;Object(b.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},w.getID3Track=function(y){if(!this.media)return;for(var C=0;C<y.length;C++){var m=y[C];if(m.kind==="metadata"&&m.label==="id3")return Object(b.sendAddTrackEvent)(m,this.media),m}return this.media.addTextTrack("metadata","id3")},w.onFragParsingMetadata=function(y,C){if(!this.media)return;var m=C.frag,f=C.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var v=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,a=0;a<f.length;a++){var e=S.getID3Frames(f[a].data);if(e){var n=f[a].pts,i=a<f.length-1?f[a+1].pts:m.end,h=i-n;h<=0&&(i=n+j);for(var d=0;d<e.length;d++){var u=e[d];if(!S.isTimeStampFrame(u)){var E=new v(n,i,"");E.value=u,this.id3Track.addCue(E)}}}}},w.onBufferFlushing=function(y,C){var m=C.startOffset,f=C.endOffset,v=C.type;if(!v||v==="audio"){var a=this.id3Track;a&&Object(b.removeCuesInRange)(a,m,f)}},O}();N.default=M},"./src/controller/latency-controller.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"default",function(){return O});var k=_("./src/errors.ts"),b=_("./src/events.ts"),S=_("./src/utils/logger.ts");function j(w,c){for(var y=0;y<c.length;y++){var C=c[y];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(w,C.key,C)}}function M(w,c,y){return c&&j(w.prototype,c),y&&j(w,y),w}var O=function(){function w(y){var C=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 C.timeupdate()},this.hls=y,this.config=y.config,this.registerListeners()}var c=w.prototype;return c.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},c.registerListeners=function(){this.hls.on(b.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(b.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(b.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(b.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(b.Events.ERROR,this.onError,this)},c.unregisterListeners=function(){this.hls.off(b.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(b.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(b.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(b.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(b.Events.ERROR,this.onError)},c.onMediaAttached=function(C,m){this.media=m.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},c.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},c.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},c.onLevelUpdated=function(C,m){var f=m.details;this.levelDetails=f,f.advanced&&this.timeupdate(),!f.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},c.onError=function(C,m){if(m.details!==k.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,S.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},c.timeupdate=function(){var C=this.media,m=this.levelDetails;if(!C||!m)return;this.currentTime=C.currentTime;var f=this.computeLatency();if(f===null)return;this._latency=f;var v=this.config,a=v.lowLatencyMode,e=v.maxLiveSyncPlaybackRate;if(!a||e===1)return;var n=this.targetLatency;if(n===null)return;var i=f-n,h=Math.min(this.maxLatency,n+m.targetduration),d=i<h;if(m.live&&d&&i>.05&&this.forwardBufferLength>1){var u=Math.min(2,Math.max(1,e)),E=Math.round(2/(1+Math.exp(-.75*i-this.edgeStalled))*20)/20;C.playbackRate=Math.min(u,Math.max(1,E))}else C.playbackRate!==1&&C.playbackRate!==0&&(C.playbackRate=1)},c.estimateLiveEdge=function(){var C=this.levelDetails;return C===null?null:C.edge+C.age},c.computeLatency=function(){var C=this.estimateLiveEdge();return C===null?null:C-this.currentTime},M(w,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var C=this.config,m=this.levelDetails;return C.liveMaxLatencyDuration!==void 0?C.liveMaxLatencyDuration:m?C.liveMaxLatencyDurationCount*m.targetduration:0}},{key:"targetLatency",get:function(){var C=this.levelDetails;if(C===null)return null;var m=C.holdBack,f=C.partHoldBack,v=C.targetduration,a=this.config,e=a.liveSyncDuration,n=a.liveSyncDurationCount,i=a.lowLatencyMode,h=this.hls.userConfig,d=i&&f||m;(h.liveSyncDuration||h.liveSyncDurationCount||d===0)&&(d=e!==void 0?e:n*v);var u=v,E=1;return d+Math.min(this.stallCount*E,u)}},{key:"liveSyncPosition",get:function(){var C=this.estimateLiveEdge(),m=this.targetLatency,f=this.levelDetails;if(C===null||m===null||f===null)return null;var v=f.edge,a=C-m-this.edgeStalled,e=v-f.totalduration,n=v-(this.config.lowLatencyMode&&f.partTarget||f.targetduration);return Math.min(Math.max(e,a),n)}},{key:"drift",get:function(){var C=this.levelDetails;return C===null?1:C.drift}},{key:"edgeStalled",get:function(){var C=this.levelDetails;if(C===null)return 0;var m=(this.config.lowLatencyMode&&C.partTarget||C.targetduration)*3;return Math.max(C.age-m,0)}},{key:"forwardBufferLength",get:function(){var C=this.media,m=this.levelDetails;if(!C||!m)return 0;var f=C.buffered.length;return f?C.buffered.end(f-1):m.edge-this.currentTime}}]),w}()},"./src/controller/level-controller.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"default",function(){return a});var k=_("./src/types/level.ts"),b=_("./src/events.ts"),S=_("./src/errors.ts"),j=_("./src/utils/codecs.ts"),M=_("./src/controller/level-helper.ts"),O=_("./src/controller/base-playlist-controller.ts"),w=_("./src/types/loader.ts");function c(){return c=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var h in i)Object.prototype.hasOwnProperty.call(i,h)&&(e[h]=i[h])}return e},c.apply(this,arguments)}function y(e,n){for(var i=0;i<n.length;i++){var h=n[i];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(e,h.key,h)}}function C(e,n,i){return n&&y(e.prototype,n),i&&y(e,i),e}function m(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,f(e,n)}function f(e,n){return f=Object.setPrototypeOf||function(h,d){return h.__proto__=d,h},f(e,n)}var v=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),a=function(e){m(n,e);function n(h){var d;return d=e.call(this,h,"[level-controller]")||this,d._levels=[],d._firstLevel=-1,d._startLevel=void 0,d.currentLevelIndex=-1,d.manualLevelIndex=-1,d.onParsedComplete=void 0,d._registerListeners(),d}var i=n.prototype;return i._registerListeners=function(){var d=this.hls;d.on(b.Events.MANIFEST_LOADED,this.onManifestLoaded,this),d.on(b.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.on(b.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),d.on(b.Events.FRAG_LOADED,this.onFragLoaded,this),d.on(b.Events.ERROR,this.onError,this)},i._unregisterListeners=function(){var d=this.hls;d.off(b.Events.MANIFEST_LOADED,this.onManifestLoaded,this),d.off(b.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.off(b.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),d.off(b.Events.FRAG_LOADED,this.onFragLoaded,this),d.off(b.Events.ERROR,this.onError,this)},i.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,e.prototype.destroy.call(this)},i.startLoad=function(){var d=this._levels;d.forEach(function(u){u.loadError=0}),e.prototype.startLoad.call(this)},i.onManifestLoaded=function(d,u){var E=[],g=[],s=[],o,r={},t,T=!1,x=!1,A=!1;if(u.levels.forEach(function(W){var $=W.attrs;T=T||!!(W.width&&W.height),x=x||!!W.videoCodec,A=A||!!W.audioCodec,v&&W.audioCodec&&W.audioCodec.indexOf("mp4a.40.34")!==-1&&(W.audioCodec=void 0);var X=W.bitrate+"-"+W.attrs.RESOLUTION+"-"+W.attrs.CODECS;t=r[X],t?t.url.push(W.url):(t=new k.Level(W),r[X]=t,E.push(t)),$&&($.AUDIO&&Object(M.addGroupId)(t,"audio",$.AUDIO),$.SUBTITLES&&Object(M.addGroupId)(t,"text",$.SUBTITLES))}),(T||x)&&A&&(E=E.filter(function(W){var $=W.videoCodec,X=W.width,V=W.height;return!!$||!!(X&&V)})),E=E.filter(function(W){var $=W.audioCodec,X=W.videoCodec;return(!$||Object(j.isCodecSupportedInMp4)($,"audio"))&&(!X||Object(j.isCodecSupportedInMp4)(X,"video"))}),u.audioTracks&&(g=u.audioTracks.filter(function(W){return!W.audioCodec||Object(j.isCodecSupportedInMp4)(W.audioCodec,"audio")}),Object(M.assignTrackIdsByGroup)(g)),u.subtitles&&(s=u.subtitles,Object(M.assignTrackIdsByGroup)(s)),E.length>0){o=E[0].bitrate,E.sort(function(W,$){return W.bitrate-$.bitrate}),this._levels=E;for(var R=0;R<E.length;R++)if(E[R].bitrate===o){this._firstLevel=R,this.log("manifest loaded, "+E.length+" level(s) found, first bitrate: "+o);break}var I=A&&!x,B={levels:E,audioTracks:g,subtitleTracks:s,firstLevel:this._firstLevel,stats:u.stats,audio:A,video:x,altAudio:!I&&g.some(function(W){return!!W.url})};this.hls.trigger(b.Events.MANIFEST_PARSED,B),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(b.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:u.url,reason:"no level with compatible codecs found in manifest"})},i.onError=function(d,u){if(e.prototype.onError.call(this,d,u),u.fatal)return;var E=u.context,g=this._levels[this.currentLevelIndex];if(E&&(E.type===w.PlaylistContextType.AUDIO_TRACK&&g.audioGroupIds&&E.groupId===g.audioGroupIds[g.urlId]||E.type===w.PlaylistContextType.SUBTITLE_TRACK&&g.textGroupIds&&E.groupId===g.textGroupIds[g.urlId])){this.redundantFailover(this.currentLevelIndex);return}var s=!1,o=!0,r;switch(u.details){case S.ErrorDetails.FRAG_LOAD_ERROR:case S.ErrorDetails.FRAG_LOAD_TIMEOUT:case S.ErrorDetails.KEY_LOAD_ERROR:case S.ErrorDetails.KEY_LOAD_TIMEOUT:if(u.frag){var t=this._levels[u.frag.level];t?(t.fragmentError++,t.fragmentError>this.hls.config.fragLoadingMaxRetry&&(r=u.frag.level)):r=u.frag.level}break;case S.ErrorDetails.LEVEL_LOAD_ERROR:case S.ErrorDetails.LEVEL_LOAD_TIMEOUT:E&&(E.deliveryDirectives&&(o=!1),r=E.level),s=!0;break;case S.ErrorDetails.REMUX_ALLOC_ERROR:r=u.level,s=!0;break}r!==void 0&&this.recoverLevel(u,r,s,o)},i.recoverLevel=function(d,u,E,g){var s=d.details,o=this._levels[u];if(o.loadError++,E){var r=this.retryLoadingOrFail(d);if(r)d.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(g){var t=o.url.length;if(t>1&&o.loadError<t)d.levelRetry=!0,this.redundantFailover(u);else if(this.manualLevelIndex===-1){var T=u===0?this._levels.length-1:u-1;this.currentLevelIndex!==T&&this._levels[T].loadError===0&&(this.warn(s+": switch to "+T),d.levelRetry=!0,this.hls.nextAutoLevel=T)}}},i.redundantFailover=function(d){var u=this._levels[d],E=u.url.length;if(E>1){var g=(u.urlId+1)%E;this.warn("Switching to redundant URL-id "+g),this._levels.forEach(function(s){s.urlId=g}),this.level=d}},i.onFragLoaded=function(d,u){var E=u.frag;if(E!==void 0&&E.type===w.PlaylistLevelType.MAIN){var g=this._levels[E.level];g!==void 0&&(g.fragmentError=0,g.loadError=0)}},i.onLevelLoaded=function(d,u){var E,g=u.level,s=u.details,o=this._levels[g];if(!o){var r;this.warn("Invalid level index "+g),(r=u.deliveryDirectives)!==null&&r!==void 0&&r.skip&&(s.deltaUpdateFailed=!0);return}g===this.currentLevelIndex?(o.fragmentError===0&&(o.loadError=0,this.retryCount=0),this.playlistLoaded(g,u,o.details)):(E=u.deliveryDirectives)!==null&&E!==void 0&&E.skip&&(s.deltaUpdateFailed=!0)},i.onAudioTrackSwitched=function(d,u){var E=this.hls.levels[this.currentLevelIndex];if(!E)return;if(E.audioGroupIds){for(var g=-1,s=this.hls.audioTracks[u.id].groupId,o=0;o<E.audioGroupIds.length;o++)if(E.audioGroupIds[o]===s){g=o;break}g!==E.urlId&&(E.urlId=g,this.startLoad())}},i.loadPlaylist=function(d){var u=this.currentLevelIndex,E=this._levels[u];if(this.canLoad&&E&&E.url.length>0){var g=E.urlId,s=E.url[g];if(d)try{s=d.addDirectives(s)}catch(o){this.warn("Could not construct new URL with HLS Delivery Directives: "+o)}this.log("Attempt loading level index "+u+(d?" at sn "+d.msn+" part "+d.part:"")+" with URL-id "+g+" "+s),this.clearTimer(),this.hls.trigger(b.Events.LEVEL_LOADING,{url:s,level:u,id:g,deliveryDirectives:d||null})}},i.removeLevel=function(d,u){var E=function(o,r){return r!==u},g=this._levels.filter(function(s,o){return o!==d?!0:s.url.length>1&&u!==void 0?(s.url=s.url.filter(E),s.audioGroupIds&&(s.audioGroupIds=s.audioGroupIds.filter(E)),s.textGroupIds&&(s.textGroupIds=s.textGroupIds.filter(E)),s.urlId=0,!0):!1}).map(function(s,o){var r=s.details;return r!=null&&r.fragments&&r.fragments.forEach(function(t){t.level=o}),s});this._levels=g,this.hls.trigger(b.Events.LEVELS_UPDATED,{levels:g})},C(n,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(d){var u,E=this._levels;if(E.length===0)return;if(this.currentLevelIndex===d&&(u=E[d])!==null&&u!==void 0&&u.details)return;if(d<0||d>=E.length){var g=d<0;if(this.hls.trigger(b.Events.ERROR,{type:S.ErrorTypes.OTHER_ERROR,details:S.ErrorDetails.LEVEL_SWITCH_ERROR,level:d,fatal:g,reason:"invalid level idx"}),g)return;d=Math.min(d,E.length-1)}this.clearTimer();var s=this.currentLevelIndex,o=E[s],r=E[d];this.log("switching to level "+d+" from "+s),this.currentLevelIndex=d;var t=c({},r,{level:d,maxBitrate:r.maxBitrate,uri:r.uri,urlId:r.urlId});delete t._urlId,this.hls.trigger(b.Events.LEVEL_SWITCHING,t);var T=r.details;if(!T||T.live){var x=this.switchParams(r.uri,o==null?void 0:o.details);this.loadPlaylist(x)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(d){this.manualLevelIndex=d,this._startLevel===void 0&&(this._startLevel=d),d!==-1&&(this.level=d)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(d){this._firstLevel=d}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var d=this.hls.config.startLevel;return d!==void 0?d:this._firstLevel}else return this._startLevel},set:function(d){this._startLevel=d}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(d){this.level=d,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=d)}}]),n}(O.default)},"./src/controller/level-helper.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"addGroupId",function(){return S}),_.d(N,"assignTrackIdsByGroup",function(){return j}),_.d(N,"updatePTS",function(){return M}),_.d(N,"updateFragPTSDTS",function(){return w}),_.d(N,"mergeDetails",function(){return c}),_.d(N,"mapPartIntersection",function(){return y}),_.d(N,"mapFragmentIntersection",function(){return C}),_.d(N,"adjustSliding",function(){return m}),_.d(N,"addSliding",function(){return f}),_.d(N,"computeReloadInterval",function(){return v}),_.d(N,"getFragmentWithSN",function(){return a}),_.d(N,"getPartWith",function(){return e});var k=_("./src/polyfills/number.ts"),b=_("./src/utils/logger.ts");function S(n,i,h){switch(i){case"audio":n.audioGroupIds||(n.audioGroupIds=[]),n.audioGroupIds.push(h);break;case"text":n.textGroupIds||(n.textGroupIds=[]),n.textGroupIds.push(h);break}}function j(n){var i={};n.forEach(function(h){var d=h.groupId||"";h.id=i[d]=i[d]||0,i[d]++})}function M(n,i,h){var d=n[i],u=n[h];O(d,u)}function O(n,i){var h=i.startPTS;if(Object(k.isFiniteNumber)(h)){var d=0,u;i.sn>n.sn?(d=h-n.start,u=n):(d=n.start-h,u=i),u.duration!==d&&(u.duration=d)}else if(i.sn>n.sn){var E=n.cc===i.cc;E&&n.minEndPTS?i.start=n.start+(n.minEndPTS-n.start):i.start=n.start+n.duration}else i.start=Math.max(n.start-i.duration,0)}function w(n,i,h,d,u,E){var g=d-h;g<=0&&(b.logger.warn("Fragment should have a positive duration",i),d=h+i.duration,E=u+i.duration);var s=h,o=d,r=i.startPTS,t=i.endPTS;if(Object(k.isFiniteNumber)(r)){var T=Math.abs(r-h);Object(k.isFiniteNumber)(i.deltaPTS)?i.deltaPTS=Math.max(T,i.deltaPTS):i.deltaPTS=T,s=Math.max(h,r),h=Math.min(h,r),u=Math.min(u,i.startDTS),o=Math.min(d,t),d=Math.max(d,t),E=Math.max(E,i.endDTS)}i.duration=d-h;var x=h-i.start;i.appendedPTS=d,i.start=i.startPTS=h,i.maxStartPTS=s,i.startDTS=u,i.endPTS=d,i.minEndPTS=o,i.endDTS=E;var A=i.sn;if(!n||A<n.startSN||A>n.endSN)return 0;var R,I=A-n.startSN,B=n.fragments;for(B[I]=i,R=I;R>0;R--)O(B[R],B[R-1]);for(R=I;R<B.length-1;R++)O(B[R],B[R+1]);return n.fragmentHint&&O(B[B.length-1],n.fragmentHint),n.PTSKnown=n.alignedSliding=!0,x}function c(n,i){for(var h=null,d=n.fragments,u=d.length-1;u>=0;u--){var E=d[u].initSegment;if(E){h=E;break}}n.fragmentHint&&delete n.fragmentHint.endPTS;var g=0,s;if(C(n,i,function(R,I){R.relurl&&(g=R.cc-I.cc),Object(k.isFiniteNumber)(R.startPTS)&&Object(k.isFiniteNumber)(R.endPTS)&&(I.start=I.startPTS=R.startPTS,I.startDTS=R.startDTS,I.appendedPTS=R.appendedPTS,I.maxStartPTS=R.maxStartPTS,I.endPTS=R.endPTS,I.endDTS=R.endDTS,I.minEndPTS=R.minEndPTS,I.duration=R.endPTS-R.startPTS,I.duration&&(s=I),i.PTSKnown=i.alignedSliding=!0),I.elementaryStreams=R.elementaryStreams,I.loader=R.loader,I.stats=R.stats,I.urlId=R.urlId,R.initSegment&&(I.initSegment=R.initSegment,h=R.initSegment)}),h){var o=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments;o.forEach(function(R){var I;(!R.initSegment||R.initSegment.relurl===((I=h)===null||I===void 0?void 0:I.relurl))&&(R.initSegment=h)})}if(i.skippedSegments&&(i.deltaUpdateFailed=i.fragments.some(function(R){return!R}),i.deltaUpdateFailed)){b.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var r=i.skippedSegments;r--;)i.fragments.shift();i.startSN=i.fragments[0].sn,i.startCC=i.fragments[0].cc}var t=i.fragments;if(g){b.logger.warn("discontinuity sliding from playlist, take drift into account");for(var T=0;T<t.length;T++)t[T].cc+=g}i.skippedSegments&&(i.startCC=i.fragments[0].cc),y(n.partList,i.partList,function(R,I){I.elementaryStreams=R.elementaryStreams,I.stats=R.stats}),s?w(i,s,s.startPTS,s.endPTS,s.startDTS,s.endDTS):m(n,i),t.length&&(i.totalduration=i.edge-t[0].start),i.driftStartTime=n.driftStartTime,i.driftStart=n.driftStart;var x=i.advancedDateTime;if(i.advanced&&x){var A=i.edge;i.driftStart||(i.driftStartTime=x,i.driftStart=A),i.driftEndTime=x,i.driftEnd=A}else i.driftEndTime=n.driftEndTime,i.driftEnd=n.driftEnd,i.advancedDateTime=n.advancedDateTime}function y(n,i,h){if(n&&i)for(var d=0,u=0,E=n.length;u<=E;u++){var g=n[u],s=i[u+d];g&&s&&g.index===s.index&&g.fragment.sn===s.fragment.sn?h(g,s):d--}}function C(n,i,h){for(var d=i.skippedSegments,u=Math.max(n.startSN,i.startSN)-i.startSN,E=(n.fragmentHint?1:0)+(d?i.endSN:Math.min(n.endSN,i.endSN))-i.startSN,g=i.startSN-n.startSN,s=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments,o=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments,r=u;r<=E;r++){var t=o[g+r],T=s[r];d&&!T&&r<d&&(T=i.fragments[r]=t),t&&T&&h(t,T)}}function m(n,i){var h=i.startSN+i.skippedSegments-n.startSN,d=n.fragments;if(h<0||h>=d.length)return;f(i,d[h].start)}function f(n,i){if(i){for(var h=n.fragments,d=n.skippedSegments;d<h.length;d++)h[d].start+=i;n.fragmentHint&&(n.fragmentHint.start+=i)}}function v(n,i){var h=1e3*n.levelTargetDuration,d=h/2,u=n.age,E=u>0&&u<h*3,g=i.loading.end-i.loading.start,s,o=n.availabilityDelay;if(n.updated===!1)if(E){var r=333*n.misses;s=Math.max(Math.min(d,g*2),r),n.availabilityDelay=(n.availabilityDelay||0)+s}else s=d;else E?(o=Math.min(o||h/2,u),n.availabilityDelay=o,s=o+h-u):s=h-g;return Math.round(s)}function a(n,i,h){if(!n||!n.details)return null;var d=n.details,u=d.fragments[i-d.startSN];return u||(u=d.fragmentHint,u&&u.sn===i?u:i<d.startSN&&h&&h.sn===i?h:null)}function e(n,i,h){if(!n||!n.details)return null;var d=n.details.partList;if(d)for(var u=d.length;u--;){var E=d[u];if(E.index===h&&E.fragment.sn===i)return E}return null}},"./src/controller/stream-controller.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"default",function(){return d});var k=_("./src/polyfills/number.ts"),b=_("./src/controller/base-stream-controller.ts"),S=_("./src/is-supported.ts"),j=_("./src/events.ts"),M=_("./src/utils/buffer-helper.ts"),O=_("./src/controller/fragment-tracker.ts"),w=_("./src/types/loader.ts"),c=_("./src/loader/fragment.ts"),y=_("./src/demux/transmuxer-interface.ts"),C=_("./src/types/transmuxer.ts"),m=_("./src/controller/gap-controller.ts"),f=_("./src/errors.ts"),v=_("./src/utils/logger.ts");function a(u,E){for(var g=0;g<E.length;g++){var s=E[g];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(u,s.key,s)}}function e(u,E,g){return E&&a(u.prototype,E),g&&a(u,g),u}function n(u,E){u.prototype=Object.create(E.prototype),u.prototype.constructor=u,i(u,E)}function i(u,E){return i=Object.setPrototypeOf||function(s,o){return s.__proto__=o,s},i(u,E)}var h=100,d=function(u){n(E,u);function E(s,o){var r;return r=u.call(this,s,o,"[stream-controller]")||this,r.audioCodecSwap=!1,r.gapController=null,r.level=-1,r._forceStartLoad=!1,r.altAudio=!1,r.audioOnly=!1,r.fragPlaying=null,r.onvplaying=null,r.onvseeked=null,r.fragLastKbps=0,r.stalled=!1,r.couldBacktrack=!1,r.audioCodecSwitch=!1,r.videoBuffer=null,r._registerListeners(),r}var g=E.prototype;return g._registerListeners=function(){var o=this.hls;o.on(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(j.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.on(j.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),o.on(j.Events.ERROR,this.onError,this),o.on(j.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),o.on(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),o.on(j.Events.BUFFER_CREATED,this.onBufferCreated,this),o.on(j.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),o.on(j.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),o.on(j.Events.FRAG_BUFFERED,this.onFragBuffered,this)},g._unregisterListeners=function(){var o=this.hls;o.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.off(j.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),o.off(j.Events.ERROR,this.onError,this),o.off(j.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),o.off(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),o.off(j.Events.BUFFER_CREATED,this.onBufferCreated,this),o.off(j.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),o.off(j.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),o.off(j.Events.FRAG_BUFFERED,this.onFragBuffered,this)},g.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},g.startLoad=function(o){if(this.levels){var r=this.lastCurrentTime,t=this.hls;if(this.stopLoad(),this.setInterval(h),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var T=t.startLevel;T===-1&&(t.config.testBandwidth?(T=0,this.bitrateTest=!0):T=t.nextAutoLevel),this.level=t.nextLoadLevel=T,this.loadedmetadata=!1}r>0&&o===-1&&(this.log("Override startPosition with lastCurrentTime @"+r.toFixed(3)),o=r),this.state=b.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=o,this.tick()}else this._forceStartLoad=!0,this.state=b.State.STOPPED},g.stopLoad=function(){this._forceStartLoad=!1,u.prototype.stopLoad.call(this)},g.doTick=function(){switch(this.state){case b.State.IDLE:this.doTickIdle();break;case b.State.WAITING_LEVEL:{var o,r=this.levels,t=this.level,T=r==null||((o=r[t])===null||o===void 0)?void 0:o.details;if(T&&(!T.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(T))break;this.state=b.State.IDLE;break}break}case b.State.FRAG_LOADING_WAITING_RETRY:{var x,A=self.performance.now(),R=this.retryDate;(!R||A>=R||(x=this.media)!==null&&x!==void 0&&x.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=b.State.IDLE)}break;default:break}this.onTickEnd()},g.onTickEnd=function(){u.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},g.doTickIdle=function(){var o,r,t=this.hls,T=this.levelLastLoaded,x=this.levels,A=this.media,R=t.config,I=t.nextLoadLevel;if(T===null||!A&&(this.startFragRequested||!R.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!x||!x[I])return;var B=x[I];this.level=t.nextLoadLevel=I;var W=B.details;if(!W||this.state===b.State.WAITING_LEVEL||W.live&&this.levelLastLoaded!==I){this.state=b.State.WAITING_LEVEL;return}var $=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:A,w.PlaylistLevelType.MAIN);if($===null)return;var X=$.len,V=this.getMaxBufferLength(B.maxBitrate);if(X>=V)return;if(this._streamEnded($,W)){var se={};this.altAudio&&(se.type="video"),this.hls.trigger(j.Events.BUFFER_EOS,se),this.state=b.State.ENDED;return}var xe=$.end,Ee=this.getNextFragment(xe,W);if(this.couldBacktrack&&!this.fragPrevious&&Ee&&Ee.sn!=="initSegment"){var je=Ee.sn-W.startSN;je>1&&(Ee=W.fragments[je-1],this.fragmentTracker.removeFragment(Ee))}if(Ee&&this.fragmentTracker.getState(Ee)===O.FragmentState.OK&&this.nextLoadPosition>xe){var Ae=this.audioOnly&&!this.altAudio?c.ElementaryStreamTypes.AUDIO:c.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(A,Ae,w.PlaylistLevelType.MAIN),Ee=this.getNextFragment(this.nextLoadPosition,W)}if(!Ee)return;Ee.initSegment&&!Ee.initSegment.data&&!this.bitrateTest&&(Ee=Ee.initSegment),((o=Ee.decryptdata)===null||o===void 0?void 0:o.keyFormat)==="identity"&&!((r=Ee.decryptdata)!==null&&r!==void 0&&r.key)?this.loadKey(Ee,W):this.loadFragment(Ee,W,xe)},g.loadFragment=function(o,r,t){var T,x=this.fragmentTracker.getState(o);if(this.fragCurrent=o,x===O.FragmentState.BACKTRACKED){var A=this.fragmentTracker.getBacktrackData(o);if(A){this._handleFragmentLoadProgress(A),this._handleFragmentLoadComplete(A);return}else x=O.FragmentState.NOT_LOADED}x===O.FragmentState.NOT_LOADED||x===O.FragmentState.PARTIAL?o.sn==="initSegment"?this._loadInitSegment(o):this.bitrateTest?(o.bitrateTest=!0,this.log("Fragment "+o.sn+" of level "+o.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(o)):(this.startFragRequested=!0,u.prototype.loadFragment.call(this,o,r,t)):x===O.FragmentState.APPENDING?this.reduceMaxBufferLength(o.duration)&&this.fragmentTracker.removeFragment(o):((T=this.media)===null||T===void 0?void 0:T.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},g.getAppendedFrag=function(o){var r=this.fragmentTracker.getAppendedFrag(o,w.PlaylistLevelType.MAIN);return r&&"fragment"in r?r.fragment:r},g.getBufferedFrag=function(o){return this.fragmentTracker.getBufferedFrag(o,w.PlaylistLevelType.MAIN)},g.followingBufferedFrag=function(o){return o?this.getBufferedFrag(o.end+.5):null},g.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},g.nextLevelSwitch=function(){var o=this.levels,r=this.media;if(r!=null&&r.readyState){var t,T=this.getAppendedFrag(r.currentTime);if(T&&T.start>1&&this.flushMainBuffer(0,T.start-1),!r.paused&&o){var x=this.hls.nextLoadLevel,A=o[x],R=this.fragLastKbps;R&&this.fragCurrent?t=this.fragCurrent.duration*A.maxBitrate/(1e3*R)+1:t=0}else t=0;var I=this.getBufferedFrag(r.currentTime+t);if(I){var B=this.followingBufferedFrag(I);if(B){this.abortCurrentFrag();var W=B.maxStartPTS?B.maxStartPTS:B.start,$=B.duration,X=Math.max(I.end,W+Math.min(Math.max($-this.config.maxFragLookUpTolerance,$*.5),$*.75));this.flushMainBuffer(X,Number.POSITIVE_INFINITY)}}}},g.abortCurrentFrag=function(){var o=this.fragCurrent;this.fragCurrent=null,o!=null&&o.loader&&o.loader.abort(),this.state===b.State.KEY_LOADING&&(this.state=b.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},g.flushMainBuffer=function(o,r){u.prototype.flushMainBuffer.call(this,o,r,this.altAudio?"video":null)},g.onMediaAttached=function(o,r){u.prototype.onMediaAttached.call(this,o,r);var t=r.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),t.addEventListener("playing",this.onvplaying),t.addEventListener("seeked",this.onvseeked),this.gapController=new m.default(this.config,t,this.fragmentTracker,this.hls)},g.onMediaDetaching=function(){var o=this.media;o&&(o.removeEventListener("playing",this.onvplaying),o.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),u.prototype.onMediaDetaching.call(this)},g.onMediaPlaying=function(){this.tick()},g.onMediaSeeked=function(){var o=this.media,r=o?o.currentTime:null;Object(k.isFiniteNumber)(r)&&this.log("Media seeked to "+r.toFixed(3)),this.tick()},g.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(j.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},g.onManifestParsed=function(o,r){var t=!1,T=!1,x;r.levels.forEach(function(A){x=A.audioCodec,x&&(x.indexOf("mp4a.40.2")!==-1&&(t=!0),x.indexOf("mp4a.40.5")!==-1&&(T=!0))}),this.audioCodecSwitch=t&&T&&!Object(S.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=r.levels,this.startFragRequested=!1},g.onLevelLoading=function(o,r){var t=this.levels;if(!t||this.state!==b.State.IDLE)return;var T=t[r.level];(!T.details||T.details.live&&this.levelLastLoaded!==r.level||this.waitForCdnTuneIn(T.details))&&(this.state=b.State.WAITING_LEVEL)},g.onLevelLoaded=function(o,r){var t,T=this.levels,x=r.level,A=r.details,R=A.totalduration;if(!T){this.warn("Levels were reset while loading level "+x);return}this.log("Level "+x+" loaded ["+A.startSN+","+A.endSN+"], cc ["+A.startCC+", "+A.endCC+"] duration:"+R);var I=this.fragCurrent;I&&(this.state===b.State.FRAG_LOADING||this.state===b.State.FRAG_LOADING_WAITING_RETRY)&&(I.level!==r.level&&I.loader&&(this.state=b.State.IDLE,I.loader.abort()));var B=T[x],W=0;if(A.live||(t=B.details)!==null&&t!==void 0&&t.live){if(A.fragments[0]||(A.deltaUpdateFailed=!0),A.deltaUpdateFailed)return;W=this.alignPlaylists(A,B.details)}if(B.details=A,this.levelLastLoaded=x,this.hls.trigger(j.Events.LEVEL_UPDATED,{details:A,level:x}),this.state===b.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(A))return;this.state=b.State.IDLE}this.startFragRequested?A.live&&this.synchronizeToLiveEdge(A):this.setStartPosition(A,W),this.tick()},g._handleFragmentLoadProgress=function(o){var r,t=o.frag,T=o.part,x=o.payload,A=this.levels;if(!A){this.warn("Levels were reset while fragment load was in progress. Fragment "+t.sn+" of level "+t.level+" will not be buffered");return}var R=A[t.level],I=R.details;if(!I){this.warn("Dropping fragment "+t.sn+" of level "+t.level+" after level details were reset");return}var B=R.videoCodec,W=I.PTSKnown||!I.live,$=(r=t.initSegment)===null||r===void 0?void 0:r.data,X=this._getAudioCodec(R),V=this.transmuxer=this.transmuxer||new y.default(this.hls,w.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),se=T?T.index:-1,xe=se!==-1,Ee=new C.ChunkMetadata(t.level,t.sn,t.stats.chunkCount,x.byteLength,se,xe),je=this.initPTS[t.cc];V.push(x,$,X,B,t,T,I.totalduration,W,Ee,je)},g.onAudioTrackSwitching=function(o,r){var t=this.altAudio,T=!!r.url,x=r.id;if(!T){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var A=this.fragCurrent;A!=null&&A.loader&&(this.log("Switching to main audio track, cancel main fragment load"),A.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var R=this.hls;t&&R.trigger(j.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),R.trigger(j.Events.AUDIO_TRACK_SWITCHED,{id:x})}},g.onAudioTrackSwitched=function(o,r){var t=r.id,T=!!this.hls.audioTracks[t].url;if(T){var x=this.videoBuffer;x&&this.mediaBuffer!==x&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=x)}this.altAudio=T,this.tick()},g.onBufferCreated=function(o,r){var t=r.tracks,T,x,A=!1;for(var R in t){var I=t[R];if(I.id==="main"){if(x=R,T=I,R==="video"){var B=t[R];B&&(this.videoBuffer=B.buffer)}}else A=!0}A&&T?(this.log("Alternate track found, use "+x+".buffered to schedule main fragment loading"),this.mediaBuffer=T.buffer):this.mediaBuffer=this.media},g.onFragBuffered=function(o,r){var t=r.frag,T=r.part;if(t&&t.type!==w.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(t)){this.warn("Fragment "+t.sn+(T?" p: "+T.index:"")+" of level "+t.level+" finished buffering, but was aborted. state: "+this.state),this.state===b.State.PARSED&&(this.state=b.State.IDLE);return}var x=T?T.stats:t.stats;this.fragLastKbps=Math.round(8*x.total/(x.buffering.end-x.loading.first)),t.sn!=="initSegment"&&(this.fragPrevious=t),this.fragBufferedComplete(t,T)},g.onError=function(o,r){switch(r.details){case f.ErrorDetails.FRAG_LOAD_ERROR:case f.ErrorDetails.FRAG_LOAD_TIMEOUT:case f.ErrorDetails.KEY_LOAD_ERROR:case f.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(w.PlaylistLevelType.MAIN,r);break;case f.ErrorDetails.LEVEL_LOAD_ERROR:case f.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==b.State.ERROR&&(r.fatal?(this.warn(""+r.details),this.state=b.State.ERROR):!r.levelRetry&&this.state===b.State.WAITING_LEVEL&&(this.state=b.State.IDLE));break;case f.ErrorDetails.BUFFER_FULL_ERROR:if(r.parent==="main"&&(this.state===b.State.PARSING||this.state===b.State.PARSED)){var t=!0,T=this.getFwdBufferInfo(this.media,w.PlaylistLevelType.MAIN);T&&T.len>.5&&(t=!this.reduceMaxBufferLength(T.len)),t&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},g.checkBuffer=function(){var o=this.media,r=this.gapController;if(!o||!r||!o.readyState)return;var t=M.BufferHelper.getBuffered(o);!this.loadedmetadata&&t.length?(this.loadedmetadata=!0,this.seekToStartPos()):r.poll(this.lastCurrentTime),this.lastCurrentTime=o.currentTime},g.onFragLoadEmergencyAborted=function(){this.state=b.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},g.onBufferFlushed=function(o,r){var t=r.type;if(t!==c.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var T=(t===c.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(T,t,w.PlaylistLevelType.MAIN)}},g.onLevelsUpdated=function(o,r){this.levels=r.levels},g.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},g.seekToStartPos=function(){var o=this.media,r=o.currentTime,t=this.startPosition;if(t>=0&&r<t){if(o.seeking){v.logger.log("could not seek to "+t+", already seeking at "+r);return}var T=M.BufferHelper.getBuffered(o),x=T.length?T.start(0):0,A=x-t;A>0&&(A<this.config.maxBufferHole||A<this.config.maxFragLookUpTolerance)&&(v.logger.log("adjusting start position by "+A+" to match buffer start"),t+=A,this.startPosition=t),this.log("seek to target start position "+t+" from current time "+r),o.currentTime=t}},g._getAudioCodec=function(o){var r=this.config.defaultAudioCodec||o.audioCodec;return this.audioCodecSwap&&r&&(this.log("Swapping audio codec"),r.indexOf("mp4a.40.5")!==-1?r="mp4a.40.2":r="mp4a.40.5"),r},g._loadBitrateTestFrag=function(o){var r=this;this._doFragLoad(o).then(function(t){var T=r.hls;if(!t||T.nextLoadLevel||r.fragContextChanged(o))return;r.fragLoadError=0,r.state=b.State.IDLE,r.startFragRequested=!1,r.bitrateTest=!1;var x=o.stats;x.parsing.start=x.parsing.end=x.buffering.start=x.buffering.end=self.performance.now(),T.trigger(j.Events.FRAG_LOADED,t)})},g._handleTransmuxComplete=function(o){var r,t="main",T=this.hls,x=o.remuxResult,A=o.chunkMeta,R=this.getCurrentContext(A);if(!R){this.warn("The loading context changed while buffering fragment "+A.sn+" of level "+A.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(A.level);return}var I=R.frag,B=R.part,W=R.level,$=x.video,X=x.text,V=x.id3,se=x.initSegment,xe=this.altAudio?void 0:x.audio;if(this.fragContextChanged(I))return;if(this.state=b.State.PARSING,se){se.tracks&&(this._bufferInitSegment(W,se.tracks,I,A),T.trigger(j.Events.FRAG_PARSING_INIT_SEGMENT,{frag:I,id:t,tracks:se.tracks}));var Ee=se.initPTS,je=se.timescale;Object(k.isFiniteNumber)(Ee)&&(this.initPTS[I.cc]=Ee,T.trigger(j.Events.INIT_PTS_FOUND,{frag:I,id:t,initPTS:Ee,timescale:je}))}if($&&x.independent!==!1){if(W.details){var Ae=$.startPTS,Oe=$.endPTS,Le=$.startDTS,Pe=$.endDTS;if(B)B.elementaryStreams[$.type]={startPTS:Ae,endPTS:Oe,startDTS:Le,endDTS:Pe};else if($.firstKeyFrame&&$.independent&&(this.couldBacktrack=!0),$.dropped&&$.independent){var he=this.getLoadPosition()+this.config.maxBufferHole;if(he<Ae){this.backtrack(I);return}I.setElementaryStreamInfo($.type,I.start,Oe,I.start,Pe,!0)}I.setElementaryStreamInfo($.type,Ae,Oe,Le,Pe),this.bufferFragmentData($,I,B,A)}}else if(x.independent===!1){this.backtrack(I);return}if(xe){var Q=xe.startPTS,Ke=xe.endPTS,it=xe.startDTS,Qe=xe.endDTS;B&&(B.elementaryStreams[c.ElementaryStreamTypes.AUDIO]={startPTS:Q,endPTS:Ke,startDTS:it,endDTS:Qe}),I.setElementaryStreamInfo(c.ElementaryStreamTypes.AUDIO,Q,Ke,it,Qe),this.bufferFragmentData(xe,I,B,A)}if(V!=null&&(r=V.samples)!==null&&r!==void 0&&r.length){var Xe={frag:I,id:t,samples:V.samples};T.trigger(j.Events.FRAG_PARSING_METADATA,Xe)}if(X){var ee={frag:I,id:t,samples:X.samples};T.trigger(j.Events.FRAG_PARSING_USERDATA,ee)}},g._bufferInitSegment=function(o,r,t,T){var x=this;if(this.state!==b.State.PARSING)return;this.audioOnly=!!r.audio&&!r.video,this.altAudio&&!this.audioOnly&&delete r.audio;var A=r.audio,R=r.video,I=r.audiovideo;if(A){var B=o.audioCodec,W=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(B&&(B.indexOf("mp4a.40.5")!==-1?B="mp4a.40.2":B="mp4a.40.5"),A.metadata.channelCount!==1&&W.indexOf("firefox")===-1&&(B="mp4a.40.5")),W.indexOf("android")!==-1&&A.container!=="audio/mpeg"&&(B="mp4a.40.2",this.log("Android: force audio codec to "+B)),o.audioCodec&&o.audioCodec!==B&&this.log('Swapping manifest audio codec "'+o.audioCodec+'" for "'+B+'"'),A.levelCodec=B,A.id="main",this.log("Init audio buffer, container:"+A.container+", codecs[selected/level/parsed]=["+(B||"")+"/"+(o.audioCodec||"")+"/"+A.codec+"]")}R&&(R.levelCodec=o.videoCodec,R.id="main",this.log("Init video buffer, container:"+R.container+", codecs[level/parsed]=["+(o.videoCodec||"")+"/"+R.codec+"]")),I&&this.log("Init audiovideo buffer, container:"+I.container+", codecs[level/parsed]=["+(o.attrs.CODECS||"")+"/"+I.codec+"]"),this.hls.trigger(j.Events.BUFFER_CODECS,r),Object.keys(r).forEach(function($){var X=r[$],V=X.initSegment;V!=null&&V.byteLength&&x.hls.trigger(j.Events.BUFFER_APPENDING,{type:$,data:V,frag:t,part:null,chunkMeta:T,parent:t.type})}),this.tick()},g.backtrack=function(o){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(o);var r=this.fragmentTracker.backtrack(o);this.fragPrevious=null,this.nextLoadPosition=o.start,r?this.resetFragmentLoading(o):this.state=b.State.BACKTRACKING},g.checkFragmentChanged=function(){var o=this.media,r=null;if(o&&o.readyState>1&&o.seeking===!1){var t=o.currentTime;if(M.BufferHelper.isBuffered(o,t)?r=this.getAppendedFrag(t):M.BufferHelper.isBuffered(o,t+.1)&&(r=this.getAppendedFrag(t+.1)),r){var T=this.fragPlaying,x=r.level;(!T||r.sn!==T.sn||T.level!==x||r.urlId!==T.urlId)&&(this.hls.trigger(j.Events.FRAG_CHANGED,{frag:r}),(!T||T.level!==x)&&this.hls.trigger(j.Events.LEVEL_SWITCHED,{level:x}),this.fragPlaying=r)}}},e(E,[{key:"nextLevel",get:function(){var o=this.nextBufferedFrag;return o?o.level:-1}},{key:"currentLevel",get:function(){var o=this.media;if(o){var r=this.getAppendedFrag(o.currentTime);if(r)return r.level}return-1}},{key:"nextBufferedFrag",get:function(){var o=this.media;if(o){var r=this.getAppendedFrag(o.currentTime);return this.followingBufferedFrag(r)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),E}(b.default)},"./src/controller/subtitle-stream-controller.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"SubtitleStreamController",function(){return n});var k=_("./src/events.ts"),b=_("./src/utils/logger.ts"),S=_("./src/utils/buffer-helper.ts"),j=_("./src/controller/fragment-finders.ts"),M=_("./src/utils/discontinuities.ts"),O=_("./src/controller/level-helper.ts"),w=_("./src/controller/fragment-tracker.ts"),c=_("./src/controller/base-stream-controller.ts"),y=_("./src/types/loader.ts"),C=_("./src/types/level.ts");function m(i,h){for(var d=0;d<h.length;d++){var u=h[d];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}}function f(i,h,d){return h&&m(i.prototype,h),d&&m(i,d),i}function v(i,h){i.prototype=Object.create(h.prototype),i.prototype.constructor=i,a(i,h)}function a(i,h){return a=Object.setPrototypeOf||function(u,E){return u.__proto__=E,u},a(i,h)}var e=500,n=function(i){v(h,i);function h(u,E){var g;return g=i.call(this,u,E,"[subtitle-stream-controller]")||this,g.levels=[],g.currentTrackId=-1,g.tracksBuffered=[],g.mainDetails=null,g._registerListeners(),g}var d=h.prototype;return d.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},d._registerListeners=function(){var E=this.hls;E.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.on(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(k.Events.ERROR,this.onError,this),E.on(k.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),E.on(k.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),E.on(k.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),E.on(k.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),E.on(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},d._unregisterListeners=function(){var E=this.hls;E.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.off(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(k.Events.ERROR,this.onError,this),E.off(k.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),E.off(k.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),E.off(k.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),E.off(k.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),E.off(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},d.startLoad=function(){this.stopLoad(),this.state=c.State.IDLE,this.setInterval(e),this.tick()},d.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},d.onLevelLoaded=function(E,g){this.mainDetails=g.details},d.onSubtitleFragProcessed=function(E,g){var s=g.frag,o=g.success;if(this.fragPrevious=s,this.state=c.State.IDLE,!o)return;var r=this.tracksBuffered[this.currentTrackId];if(!r)return;for(var t,T=s.start,x=0;x<r.length;x++)if(T>=r[x].start&&T<=r[x].end){t=r[x];break}var A=s.start+s.duration;t?t.end=A:(t={start:T,end:A},r.push(t)),this.fragmentTracker.fragBuffered(s)},d.onBufferFlushing=function(E,g){var s=g.startOffset,o=g.endOffset;if(s===0&&o!==Number.POSITIVE_INFINITY){var r=this.currentTrackId,t=this.levels;if(!t.length||!t[r]||!t[r].details)return;var T=t[r].details,x=T.targetduration,A=o-x;if(A<=0)return;g.endOffsetSubtitles=Math.max(0,A),this.tracksBuffered.forEach(function(R){for(var I=0;I<R.length;){if(R[I].end<=A){R.shift();continue}else if(R[I].start<A)R[I].start=A;else break;I++}}),this.fragmentTracker.removeFragmentsInRange(s,A,y.PlaylistLevelType.SUBTITLE)}},d.onError=function(E,g){var s,o=g.frag;if(!o||o.type!==y.PlaylistLevelType.SUBTITLE)return;(s=this.fragCurrent)!==null&&s!==void 0&&s.loader&&this.fragCurrent.loader.abort(),this.state=c.State.IDLE},d.onSubtitleTracksUpdated=function(E,g){var s=this,o=g.subtitleTracks;this.tracksBuffered=[],this.levels=o.map(function(r){return new C.Level(r)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(r){s.tracksBuffered[r.id]=[]}),this.mediaBuffer=null},d.onSubtitleTrackSwitch=function(E,g){if(this.currentTrackId=g.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var s=this.levels[this.currentTrackId];s!=null&&s.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,s&&this.setInterval(e)},d.onSubtitleTrackLoaded=function(E,g){var s,o=g.details,r=g.id,t=this.currentTrackId,T=this.levels;if(!T.length)return;var x=T[t];if(r>=T.length||r!==t||!x)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,o.live||(s=x.details)!==null&&s!==void 0&&s.live){var A=this.mainDetails;if(o.deltaUpdateFailed||!A)return;var R=A.fragments[0];if(!x.details)o.hasProgramDateTime&&A.hasProgramDateTime?Object(M.alignMediaPlaylistByPDT)(o,A):R&&Object(O.addSliding)(o,R.start);else{var I=this.alignPlaylists(o,x.details);I===0&&R&&Object(O.addSliding)(o,R.start)}}if(x.details=o,this.levelLastLoaded=r,this.tick(),o.live&&!this.fragCurrent&&this.media&&this.state===c.State.IDLE){var B=Object(j.findFragmentByPTS)(null,o.fragments,this.media.currentTime,0);B||(this.warn("Subtitle playlist not aligned with playback"),x.details=void 0)}},d._handleFragmentLoadComplete=function(E){var g=E.frag,s=E.payload,o=g.decryptdata,r=this.hls;if(this.fragContextChanged(g))return;if(s&&s.byteLength>0&&o&&o.key&&o.iv&&o.method==="AES-128"){var t=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(s),o.key.buffer,o.iv.buffer).then(function(T){var x=performance.now();r.trigger(k.Events.FRAG_DECRYPTED,{frag:g,payload:T,stats:{tstart:t,tdecrypt:x}})})}},d.doTick=function(){if(!this.media){this.state=c.State.IDLE;return}if(this.state===c.State.IDLE){var E,g=this.currentTrackId,s=this.levels;if(!s.length||!s[g]||!s[g].details)return;var o=s[g].details,r=o.targetduration,t=this.config,T=this.media,x=S.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,T.currentTime-r,t.maxBufferHole),A=x.end,R=x.len,I=this.getMaxBufferLength()+r;if(R>I)return;console.assert(o,"Subtitle track details are defined on idle subtitle stream controller tick");var B=o.fragments,W=B.length,$=o.edge,X,V=this.fragPrevious;if(A<$){var se=t.maxFragLookUpTolerance;V&&o.hasProgramDateTime&&(X=Object(j.findFragmentByPDT)(B,V.endProgramDateTime,se)),X||(X=Object(j.findFragmentByPTS)(V,B,A,se),!X&&V&&V.start<B[0].start&&(X=B[0]))}else X=B[W-1];(E=X)!==null&&E!==void 0&&E.encrypted?(b.logger.log("Loading key for "+X.sn),this.state=c.State.KEY_LOADING,this.hls.trigger(k.Events.KEY_LOADING,{frag:X})):X&&this.fragmentTracker.getState(X)===w.FragmentState.NOT_LOADED&&this.loadFragment(X,o,A)}},d.loadFragment=function(E,g,s){this.fragCurrent=E,i.prototype.loadFragment.call(this,E,g,s)},f(h,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),h}(c.default)},"./src/controller/subtitle-track-controller.ts":function(Z,N,_){"use strict";_.r(N);var k=_("./src/events.ts"),b=_("./src/utils/texttrack-utils.ts"),S=_("./src/controller/base-playlist-controller.ts"),j=_("./src/types/loader.ts");function M(m,f){for(var v=0;v<f.length;v++){var a=f[v];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(m,a.key,a)}}function O(m,f,v){return f&&M(m.prototype,f),v&&M(m,v),m}function w(m,f){m.prototype=Object.create(f.prototype),m.prototype.constructor=m,c(m,f)}function c(m,f){return c=Object.setPrototypeOf||function(a,e){return a.__proto__=e,a},c(m,f)}var y=function(m){w(f,m);function f(a){var e;return e=m.call(this,a,"[subtitle-track-controller]")||this,e.media=null,e.tracks=[],e.groupId=null,e.tracksInGroup=[],e.trackId=-1,e.selectDefaultTrack=!0,e.queuedDefaultTrack=-1,e.trackChangeListener=function(){return e.onTextTracksChanged()},e.asyncPollTrackChange=function(){return e.pollTrackChange(0)},e.useTextTrackPolling=!1,e.subtitlePollingInterval=-1,e.subtitleDisplay=!0,e.registerListeners(),e}var v=f.prototype;return v.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,m.prototype.destroy.call(this)},v.registerListeners=function(){var e=this.hls;e.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(k.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(k.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(k.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(k.Events.ERROR,this.onError,this)},v.unregisterListeners=function(){var e=this.hls;e.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(k.Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(k.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(k.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(k.Events.ERROR,this.onError,this)},v.onMediaAttached=function(e,n){if(this.media=n.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)},v.pollTrackChange=function(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,e)},v.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 e=C(this.media.textTracks);e.forEach(function(n){Object(b.clearCurrentCues)(n)}),this.subtitleTrack=-1,this.media=null},v.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},v.onManifestParsed=function(e,n){this.tracks=n.subtitleTracks},v.onSubtitleTrackLoaded=function(e,n){var i=n.id,h=n.details,d=this.trackId,u=this.tracksInGroup[d];if(!u){this.warn("Invalid subtitle track id "+i);return}var E=u.details;u.details=n.details,this.log("subtitle track "+i+" loaded ["+h.startSN+"-"+h.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,n,E))},v.onLevelLoading=function(e,n){this.switchLevel(n.level)},v.onLevelSwitching=function(e,n){this.switchLevel(n.level)},v.switchLevel=function(e){var n=this.hls.levels[e];if(!(n!=null&&n.textGroupIds))return;var i=n.textGroupIds[n.urlId];if(this.groupId!==i){var h=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,d=this.tracks.filter(function(g){return!i||g.groupId===i});this.tracksInGroup=d;var u=this.findTrackId(h==null?void 0:h.name)||this.findTrackId();this.groupId=i;var E={subtitleTracks:d};this.log("Updating subtitle tracks, "+d.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(k.Events.SUBTITLE_TRACKS_UPDATED,E),u!==-1&&this.setSubtitleTrack(u,h)}},v.findTrackId=function(e){for(var n=this.tracksInGroup,i=0;i<n.length;i++){var h=n[i];if((!this.selectDefaultTrack||h.default)&&(!e||e===h.name))return h.id}return-1},v.onError=function(e,n){if(m.prototype.onError.call(this,e,n),n.fatal||!n.context)return;n.context.type===j.PlaylistContextType.SUBTITLE_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},v.loadPlaylist=function(e){var n=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(n)){var i=n.id,h=n.groupId,d=n.url;if(e)try{d=e.addDirectives(d)}catch(u){this.warn("Could not construct new URL with HLS Delivery Directives: "+u)}this.log("Loading subtitle playlist for id "+i),this.hls.trigger(k.Events.SUBTITLE_TRACK_LOADING,{url:d,id:i,groupId:h,deliveryDirectives:e||null})}},v.toggleTrackModes=function(e){var n=this,i=this.media,h=this.subtitleDisplay,d=this.trackId;if(!i)return;var u=C(i.textTracks),E=u.filter(function(o){return o.groupId===n.groupId});if(e===-1)[].slice.call(u).forEach(function(o){o.mode="disabled"});else{var g=E[d];g&&(g.mode="disabled")}var s=E[e];s&&(s.mode=h?"showing":"hidden")},v.setSubtitleTrack=function(e,n){var i,h=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(this.trackId!==e&&this.toggleTrackModes(e),this.trackId===e&&(e===-1||(i=h[e])!==null&&i!==void 0&&i.details)||e<-1||e>=h.length)return;this.clearTimer();var d=h[e];if(this.log("Switching to subtitle track "+e),this.trackId=e,d){var u=d.id,E=d.groupId,g=E===void 0?"":E,s=d.name,o=d.type,r=d.url;this.hls.trigger(k.Events.SUBTITLE_TRACK_SWITCH,{id:u,groupId:g,name:s,type:o,url:r});var t=this.switchParams(d.url,n==null?void 0:n.details);this.loadPlaylist(t)}else this.hls.trigger(k.Events.SUBTITLE_TRACK_SWITCH,{id:e})},v.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var e=-1,n=C(this.media.textTracks),i=0;i<n.length;i++)if(n[i].mode==="hidden")e=i;else if(n[i].mode==="showing"){e=i;break}this.subtitleTrack!==e&&(this.subtitleTrack=e)},O(f,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(e){this.selectDefaultTrack=!1;var n=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(e,n)}}]),f}(S.default);function C(m){for(var f=[],v=0;v<m.length;v++){var a=m[v];a.kind==="subtitles"&&a.label&&f.push(m[v])}return f}N.default=y},"./src/controller/timeline-controller.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"TimelineController",function(){return C});var k=_("./src/polyfills/number.ts"),b=_("./src/events.ts"),S=_("./src/utils/cea-608-parser.ts"),j=_("./src/utils/output-filter.ts"),M=_("./src/utils/webvtt-parser.ts"),O=_("./src/utils/texttrack-utils.ts"),w=_("./src/utils/imsc1-ttml-parser.ts"),c=_("./src/types/loader.ts"),y=_("./src/utils/logger.ts"),C=function(){function a(n){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=v(),this.captionsProperties=void 0,this.hls=n,this.config=n.config,this.Cues=n.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 i=new j.default(this,"textTrack1"),h=new j.default(this,"textTrack2"),d=new j.default(this,"textTrack3"),u=new j.default(this,"textTrack4");this.cea608Parser1=new S.default(1,i,h),this.cea608Parser2=new S.default(3,d,u)}n.on(b.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.on(b.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(b.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(b.Events.MANIFEST_LOADED,this.onManifestLoaded,this),n.on(b.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),n.on(b.Events.FRAG_LOADING,this.onFragLoading,this),n.on(b.Events.FRAG_LOADED,this.onFragLoaded,this),n.on(b.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),n.on(b.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),n.on(b.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),n.on(b.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),n.on(b.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var e=a.prototype;return e.destroy=function(){var i=this.hls;i.off(b.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.off(b.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(b.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(b.Events.MANIFEST_LOADED,this.onManifestLoaded,this),i.off(b.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),i.off(b.Events.FRAG_LOADING,this.onFragLoading,this),i.off(b.Events.FRAG_LOADED,this.onFragLoaded,this),i.off(b.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),i.off(b.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),i.off(b.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.off(b.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),i.off(b.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},e.addCues=function(i,h,d,u,E){for(var g=!1,s=E.length;s--;){var o=E[s],r=f(o[0],o[1],h,d);if(r>=0&&(o[0]=Math.min(o[0],h),o[1]=Math.max(o[1],d),g=!0,r/(d-h)>.5))return}if(g||E.push([h,d]),this.config.renderTextTracksNatively){var t=this.captionsTracks[i];this.Cues.newCue(t,h,d,u)}else{var T=this.Cues.newCue(null,h,d,u);this.hls.trigger(b.Events.CUES_PARSED,{type:"captions",cues:T,track:i})}},e.onInitPtsFound=function(i,h){var d=this,u=h.frag,E=h.id,g=h.initPTS,s=h.timescale,o=this.unparsedVttFrags;E==="main"&&(this.initPTS[u.cc]=g,this.timescale[u.cc]=s),o.length&&(this.unparsedVttFrags=[],o.forEach(function(r){d.onFragLoaded(b.Events.FRAG_LOADED,r)}))},e.getExistingTrack=function(i){var h=this.media;if(h)for(var d=0;d<h.textTracks.length;d++){var u=h.textTracks[d];if(u[i])return u}return null},e.createCaptionsTrack=function(i){this.config.renderTextTracksNatively?this.createNativeTrack(i):this.createNonNativeTrack(i)},e.createNativeTrack=function(i){if(this.captionsTracks[i])return;var h=this.captionsProperties,d=this.captionsTracks,u=this.media,E=h[i],g=E.label,s=E.languageCode,o=this.getExistingTrack(i);if(o)d[i]=o,Object(O.clearCurrentCues)(d[i]),Object(O.sendAddTrackEvent)(d[i],u);else{var r=this.createTextTrack("captions",g,s);r&&(r[i]=!0,d[i]=r)}},e.createNonNativeTrack=function(i){if(this.nonNativeCaptionsTracks[i])return;var h=this.captionsProperties[i];if(!h)return;var d=h.label,u={_id:i,label:d,kind:"captions",default:h.media?!!h.media.default:!1,closedCaptions:h.media};this.nonNativeCaptionsTracks[i]=u,this.hls.trigger(b.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[u]})},e.createTextTrack=function(i,h,d){var u=this.media;return u?u.addTextTrack(i,h,d):void 0},e.onMediaAttaching=function(i,h){this.media=h.media,this._cleanTracks()},e.onMediaDetaching=function(){var i=this.captionsTracks;Object.keys(i).forEach(function(h){Object(O.clearCurrentCues)(i[h]),delete i[h]}),this.nonNativeCaptionsTracks={}},e.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=v(),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())},e._cleanTracks=function(){var i=this.media;if(!i)return;var h=i.textTracks;if(h)for(var d=0;d<h.length;d++)Object(O.clearCurrentCues)(h[d])},e.onSubtitleTracksUpdated=function(i,h){var d=this;this.textTracks=[];var u=h.subtitleTracks||[],E=u.some(function(r){return r.textCodec===w.IMSC1_CODEC});if(this.config.enableWebVTT||E&&this.config.enableIMSC1){var g=this.tracks&&u&&this.tracks.length===u.length;if(this.tracks=u||[],this.config.renderTextTracksNatively){var s=this.media?this.media.textTracks:[];this.tracks.forEach(function(r,t){var T;if(t<s.length){for(var x=null,A=0;A<s.length;A++)if(m(s[A],r)){x=s[A];break}x&&(T=x)}T?Object(O.clearCurrentCues)(T):(T=d.createTextTrack("subtitles",r.name,r.lang),T&&(T.mode="disabled")),T&&(T.groupId=r.groupId,d.textTracks.push(T))})}else if(!g&&this.tracks&&this.tracks.length){var o=this.tracks.map(function(r){return{label:r.name,kind:r.type.toLowerCase(),default:r.default,subtitleTrack:r}});this.hls.trigger(b.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:o})}}},e.onManifestLoaded=function(i,h){var d=this;this.config.enableCEA708Captions&&h.captions&&h.captions.forEach(function(u){var E=/(?:CC|SERVICE)([1-4])/.exec(u.instreamId);if(!E)return;var g="textTrack"+E[1],s=d.captionsProperties[g];if(!s)return;s.label=u.name,u.lang&&(s.languageCode=u.lang),s.media=u})},e.onFragLoading=function(i,h){var d=this.cea608Parser1,u=this.cea608Parser2,E=this.lastSn,g=this.lastPartIndex;if(!this.enabled||!(d&&u))return;if(h.frag.type===c.PlaylistLevelType.MAIN){var s,o,r=h.frag.sn,t=(s=h==null||((o=h.part)===null||o===void 0)?void 0:o.index)!=null?s:-1;r===E+1||r===E&&t===g+1||(d.reset(),u.reset()),this.lastSn=r,this.lastPartIndex=t}},e.onFragLoaded=function(i,h){var d=h.frag,u=h.payload,E=this.initPTS,g=this.unparsedVttFrags;if(d.type===c.PlaylistLevelType.SUBTITLE)if(u.byteLength){if(!Object(k.isFiniteNumber)(E[d.cc])){g.push(h),E.length&&this.hls.trigger(b.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:new Error("Missing initial subtitle PTS")});return}var s=d.decryptdata;if(s==null||s.key==null||s.method!=="AES-128"){var o=this.tracks[d.level],r=this.vttCCs;r[d.cc]||(r[d.cc]={start:d.start,prevCC:this.prevCC,new:!0},this.prevCC=d.cc),o&&o.textCodec===w.IMSC1_CODEC?this._parseIMSC1(d,u):this._parseVTTs(d,u,r)}}else this.hls.trigger(b.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:new Error("Empty subtitle payload")})},e._parseIMSC1=function(i,h){var d=this,u=this.hls;Object(w.parseIMSC1)(h,this.initPTS[i.cc],this.timescale[i.cc],function(E){d._appendCues(E,i.level),u.trigger(b.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},function(E){y.logger.log("Failed to parse IMSC1: "+E),u.trigger(b.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:E})})},e._parseVTTs=function(i,h,d){var u=this,E=this.hls;Object(M.parseWebVTT)(h,this.initPTS[i.cc],this.timescale[i.cc],d,i.cc,i.start,function(g){u._appendCues(g,i.level),E.trigger(b.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},function(g){u._fallbackToIMSC1(i,h),y.logger.log("Failed to parse VTT cue: "+g),E.trigger(b.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:g})})},e._fallbackToIMSC1=function(i,h){var d=this,u=this.tracks[i.level];u.textCodec||Object(w.parseIMSC1)(h,this.initPTS[i.cc],this.timescale[i.cc],function(){u.textCodec=w.IMSC1_CODEC,d._parseIMSC1(i,h)},function(){u.textCodec="wvtt"})},e._appendCues=function(i,h){var d=this.hls;if(this.config.renderTextTracksNatively){var u=this.textTracks[h];if(u.mode==="disabled")return;i.forEach(function(s){return Object(O.addCueToTrack)(u,s)})}else{var E=this.tracks[h],g=E.default?"default":"subtitles"+h;d.trigger(b.Events.CUES_PARSED,{type:"subtitles",cues:i,track:g})}},e.onFragDecrypted=function(i,h){var d=h.frag;if(d.type===c.PlaylistLevelType.SUBTITLE){if(!Object(k.isFiniteNumber)(this.initPTS[d.cc])){this.unparsedVttFrags.push(h);return}this.onFragLoaded(b.Events.FRAG_LOADED,h)}},e.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},e.onFragParsingUserdata=function(i,h){var d=this.cea608Parser1,u=this.cea608Parser2;if(!this.enabled||!(d&&u))return;for(var E=0;E<h.samples.length;E++){var g=h.samples[E].bytes;if(g){var s=this.extractCea608Data(g);d.addData(h.samples[E].pts,s[0]),u.addData(h.samples[E].pts,s[1])}}},e.onBufferFlushing=function(i,h){var d=h.startOffset,u=h.endOffset,E=h.endOffsetSubtitles,g=h.type,s=this.media;if(!s||s.currentTime<u)return;if(!g||g==="video"){var o=this.captionsTracks;Object.keys(o).forEach(function(t){return Object(O.removeCuesInRange)(o[t],d,u)})}if(this.config.renderTextTracksNatively&&(d===0&&E!==void 0)){var r=this.textTracks;Object.keys(r).forEach(function(t){return Object(O.removeCuesInRange)(r[t],d,E)})}},e.extractCea608Data=function(i){for(var h=i[0]&31,d=2,u=[[],[]],E=0;E<h;E++){var g=i[d++],s=127&i[d++],o=127&i[d++],r=(4&g)!==0,t=3&g;if(s===0&&o===0)continue;r&&((t===0||t===1)&&(u[t].push(s),u[t].push(o)))}return u},a}();function m(a,e){return a&&a.label===e.name&&!(a.textTrack1||a.textTrack2)}function f(a,e,n,i){return Math.min(e,i)-Math.max(a,n)}function v(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"default",function(){return k});var k=function(){function b(j,M){this.subtle=void 0,this.aesIV=void 0,this.subtle=j,this.aesIV=M}var S=b.prototype;return S.decrypt=function(M,O){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},O,M)},b}()},"./src/crypt/aes-decryptor.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"removePadding",function(){return b}),_.d(N,"default",function(){return S});var k=_("./src/utils/typed-array.ts");function b(j){var M=j.byteLength,O=M&&new DataView(j.buffer).getUint8(M-1);return O?Object(k.sliceUint8)(j,0,M-O):j}var S=function(){function j(){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 M=j.prototype;return M.uint8ArrayToUint32Array_=function(w){for(var c=new DataView(w),y=new Uint32Array(4),C=0;C<4;C++)y[C]=c.getUint32(C*4);return y},M.initTable=function(){var w=this.sBox,c=this.invSBox,y=this.subMix,C=y[0],m=y[1],f=y[2],v=y[3],a=this.invSubMix,e=a[0],n=a[1],i=a[2],h=a[3],d=new Uint32Array(256),u=0,E=0,g=0;for(g=0;g<256;g++)g<128?d[g]=g<<1:d[g]=g<<1^283;for(g=0;g<256;g++){var s=E^E<<1^E<<2^E<<3^E<<4;s=s>>>8^s&255^99,w[u]=s,c[s]=u;var o=d[u],r=d[o],t=d[r],T=d[s]*257^s*16843008;C[u]=T<<24|T>>>8,m[u]=T<<16|T>>>16,f[u]=T<<8|T>>>24,v[u]=T,T=t*16843009^r*65537^o*257^u*16843008,e[s]=T<<24|T>>>8,n[s]=T<<16|T>>>16,i[s]=T<<8|T>>>24,h[s]=T,u?(u=o^d[d[d[t^o]]],E^=d[d[E]]):u=E=1}},M.expandKey=function(w){for(var c=this.uint8ArrayToUint32Array_(w),y=!0,C=0;C<c.length&&y;)y=c[C]===this.key[C],C++;if(y)return;this.key=c;var m=this.keySize=c.length;if(m!==4&&m!==6&&m!==8)throw new Error("Invalid aes key size="+m);var f=this.ksRows=(m+6+1)*4,v,a,e=this.keySchedule=new Uint32Array(f),n=this.invKeySchedule=new Uint32Array(f),i=this.sBox,h=this.rcon,d=this.invSubMix,u=d[0],E=d[1],g=d[2],s=d[3],o,r;for(v=0;v<f;v++){if(v<m){o=e[v]=c[v];continue}r=o,v%m===0?(r=r<<8|r>>>24,r=i[r>>>24]<<24|i[r>>>16&255]<<16|i[r>>>8&255]<<8|i[r&255],r^=h[v/m|0]<<24):m>6&&v%m===4&&(r=i[r>>>24]<<24|i[r>>>16&255]<<16|i[r>>>8&255]<<8|i[r&255]),e[v]=o=(e[v-m]^r)>>>0}for(a=0;a<f;a++)v=f-a,a&3?r=e[v]:r=e[v-4],a<4||v<=4?n[a]=r:n[a]=u[i[r>>>24]]^E[i[r>>>16&255]]^g[i[r>>>8&255]]^s[i[r&255]],n[a]=n[a]>>>0},M.networkToHostOrderSwap=function(w){return w<<24|(w&65280)<<8|(w&16711680)>>8|w>>>24},M.decrypt=function(w,c,y){for(var C=this.keySize+6,m=this.invKeySchedule,f=this.invSBox,v=this.invSubMix,a=v[0],e=v[1],n=v[2],i=v[3],h=this.uint8ArrayToUint32Array_(y),d=h[0],u=h[1],E=h[2],g=h[3],s=new Int32Array(w),o=new Int32Array(s.length),r,t,T,x,A,R,I,B,W,$,X,V,se,xe,Ee=this.networkToHostOrderSwap;c<s.length;){for(W=Ee(s[c]),$=Ee(s[c+1]),X=Ee(s[c+2]),V=Ee(s[c+3]),A=W^m[0],R=V^m[1],I=X^m[2],B=$^m[3],se=4,xe=1;xe<C;xe++)r=a[A>>>24]^e[R>>16&255]^n[I>>8&255]^i[B&255]^m[se],t=a[R>>>24]^e[I>>16&255]^n[B>>8&255]^i[A&255]^m[se+1],T=a[I>>>24]^e[B>>16&255]^n[A>>8&255]^i[R&255]^m[se+2],x=a[B>>>24]^e[A>>16&255]^n[R>>8&255]^i[I&255]^m[se+3],A=r,R=t,I=T,B=x,se=se+4;r=f[A>>>24]<<24^f[R>>16&255]<<16^f[I>>8&255]<<8^f[B&255]^m[se],t=f[R>>>24]<<24^f[I>>16&255]<<16^f[B>>8&255]<<8^f[A&255]^m[se+1],T=f[I>>>24]<<24^f[B>>16&255]<<16^f[A>>8&255]<<8^f[R&255]^m[se+2],x=f[B>>>24]<<24^f[A>>16&255]<<16^f[R>>8&255]<<8^f[I&255]^m[se+3],o[c]=Ee(r^d),o[c+1]=Ee(x^u),o[c+2]=Ee(T^E),o[c+3]=Ee(t^g),d=W,u=$,E=X,g=V,c=c+4}return o.buffer},j}()},"./src/crypt/decrypter.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"default",function(){return c});var k=_("./src/crypt/aes-crypto.ts"),b=_("./src/crypt/fast-aes-key.ts"),S=_("./src/crypt/aes-decryptor.ts"),j=_("./src/utils/logger.ts"),M=_("./src/utils/mp4-tools.ts"),O=_("./src/utils/typed-array.ts"),w=16,c=function(){function y(m,f,v){var a=v===void 0?{}:v,e=a.removePKCS7Padding,n=e===void 0?!0:e;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=m,this.config=f,this.removePKCS7Padding=n,n)try{var i=self.crypto;i&&(this.subtle=i.subtle||i.webkitSubtle)}catch(h){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var C=y.prototype;return C.destroy=function(){this.observer=null},C.isSync=function(){return this.config.enableSoftwareAES},C.flush=function(){var f=this.currentResult;if(!f){this.reset();return}var v=new Uint8Array(f);return this.reset(),this.removePKCS7Padding?Object(S.removePadding)(v):v},C.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},C.decrypt=function(f,v,a,e){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(f),v,a);var n=this.flush();n&&e(n.buffer)}else this.webCryptoDecrypt(new Uint8Array(f),v,a).then(e)},C.softwareDecrypt=function(f,v,a){var e=this.currentIV,n=this.currentResult,i=this.remainderData;this.logOnce("JS AES decrypt"),i&&(f=Object(M.appendUint8Array)(i,f),this.remainderData=null);var h=this.getValidChunk(f);if(!h.length)return null;e&&(a=e);var d=this.softwareDecrypter;d||(d=this.softwareDecrypter=new S.default),d.expandKey(v);var u=n;return this.currentResult=d.decrypt(h.buffer,0,a),this.currentIV=Object(O.sliceUint8)(h,-16).buffer,u||null},C.webCryptoDecrypt=function(f,v,a){var e=this,n=this.subtle;return(this.key!==v||!this.fastAesKey)&&(this.key=v,this.fastAesKey=new b.default(n,v)),this.fastAesKey.expandKey().then(function(i){if(!n)return Promise.reject(new Error("web crypto not initialized"));var h=new k.default(n,a);return h.decrypt(f.buffer,i)}).catch(function(i){return e.onWebCryptoError(i,f,v,a)})},C.onWebCryptoError=function(f,v,a,e){return j.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",f),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(v,a,e)},C.getValidChunk=function(f){var v=f,a=f.length-f.length%w;return a!==f.length&&(v=Object(O.sliceUint8)(f,0,a),this.remainderData=Object(O.sliceUint8)(f,a)),v},C.logOnce=function(f){if(!this.logEnabled)return;j.logger.log("[decrypter.ts]: "+f),this.logEnabled=!1},y}()},"./src/crypt/fast-aes-key.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"default",function(){return k});var k=function(){function b(j,M){this.subtle=void 0,this.key=void 0,this.subtle=j,this.key=M}var S=b.prototype;return S.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},b}()},"./src/demux/aacdemuxer.ts":function(Z,N,_){"use strict";_.r(N);var k=_("./src/demux/base-audio-demuxer.ts"),b=_("./src/demux/adts.ts"),S=_("./src/utils/logger.ts"),j=_("./src/demux/id3.ts");function M(c,y){c.prototype=Object.create(y.prototype),c.prototype.constructor=c,O(c,y)}function O(c,y){return O=Object.setPrototypeOf||function(m,f){return m.__proto__=f,m},O(c,y)}var w=function(c){M(y,c);function y(m,f){var v;return v=c.call(this)||this,v.observer=void 0,v.config=void 0,v.observer=m,v.config=f,v}var C=y.prototype;return C.resetInitSegment=function(f,v,a){c.prototype.resetInitSegment.call(this,f,v,a),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:f,duration:a,inputTimeScale:9e4,dropped:0}},y.probe=function(f){if(!f)return!1;for(var v=j.getID3Data(f,0)||[],a=v.length,e=f.length;a<e;a++)if(b.probe(f,a))return S.logger.log("ADTS sync word found !"),!0;return!1},C.canParse=function(f,v){return b.canParse(f,v)},C.appendFrame=function(f,v,a){b.initTrackConfig(f,this.observer,v,a,f.manifestCodec);var e=b.appendFrame(f,v,a,this.initPTS,this.frameIndex);if(e&&e.missing===0)return e},y}(k.default);w.minProbeByteLength=9,N.default=w},"./src/demux/adts.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"getAudioConfig",function(){return j}),_.d(N,"isHeaderPattern",function(){return M}),_.d(N,"getHeaderLength",function(){return O}),_.d(N,"getFullFrameLength",function(){return w}),_.d(N,"canGetFrameLength",function(){return c}),_.d(N,"isHeader",function(){return y}),_.d(N,"canParse",function(){return C}),_.d(N,"probe",function(){return m}),_.d(N,"initTrackConfig",function(){return f}),_.d(N,"getFrameDuration",function(){return v}),_.d(N,"parseFrameHeader",function(){return a}),_.d(N,"appendFrame",function(){return e});var k=_("./src/utils/logger.ts"),b=_("./src/errors.ts"),S=_("./src/events.ts");function j(n,i,h,d){var u,E,g,s,o=navigator.userAgent.toLowerCase(),r=d,t=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];u=((i[h+2]&192)>>>6)+1;var T=(i[h+2]&60)>>>2;if(T>t.length-1){n.trigger(S.Events.ERROR,{type:b.ErrorTypes.MEDIA_ERROR,details:b.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+T});return}return g=(i[h+2]&1)<<2,g|=(i[h+3]&192)>>>6,k.logger.log("manifest codec:"+d+", ADTS type:"+u+", samplingIndex:"+T),/firefox/i.test(o)?T>=6?(u=5,s=new Array(4),E=T-3):(u=2,s=new Array(2),E=T):o.indexOf("android")!==-1?(u=2,s=new Array(2),E=T):(u=5,s=new Array(4),d&&(d.indexOf("mp4a.40.29")!==-1||d.indexOf("mp4a.40.5")!==-1)||!d&&T>=6?E=T-3:((d&&d.indexOf("mp4a.40.2")!==-1&&(T>=6&&g===1||/vivaldi/i.test(o))||!d&&g===1)&&(u=2,s=new Array(2)),E=T)),s[0]=u<<3,s[0]|=(T&14)>>1,s[1]|=(T&1)<<7,s[1]|=g<<3,u===5&&(s[1]|=(E&14)>>1,s[2]=(E&1)<<7,s[2]|=2<<2,s[3]=0),{config:s,samplerate:t[T],channelCount:g,codec:"mp4a.40."+u,manifestCodec:r}}function M(n,i){return n[i]===255&&(n[i+1]&246)===240}function O(n,i){return n[i+1]&1?7:9}function w(n,i){return(n[i+3]&3)<<11|n[i+4]<<3|(n[i+5]&224)>>>5}function c(n,i){return i+5<n.length}function y(n,i){return i+1<n.length&&M(n,i)}function C(n,i){return c(n,i)&&M(n,i)&&w(n,i)<=n.length-i}function m(n,i){if(y(n,i)){var h=O(n,i);if(i+h>=n.length)return!1;var d=w(n,i);if(d<=h)return!1;var u=i+d;return u===n.length||y(n,u)}return!1}function f(n,i,h,d,u){if(!n.samplerate){var E=j(i,h,d,u);if(!E)return;n.config=E.config,n.samplerate=E.samplerate,n.channelCount=E.channelCount,n.codec=E.codec,n.manifestCodec=E.manifestCodec,k.logger.log("parsed codec:"+n.codec+", rate:"+E.samplerate+", channels:"+E.channelCount)}}function v(n){return 1024*9e4/n}function a(n,i,h,d,u){var E=O(n,i),g=w(n,i);if(g-=E,g>0){var s=h+d*u;return{headerLength:E,frameLength:g,stamp:s}}}function e(n,i,h,d,u){var E=v(n.samplerate),g=a(i,h,d,u,E);if(g){var s=g.frameLength,o=g.headerLength,r=g.stamp,t=o+s,T=Math.max(0,h+t-i.length),x;T?(x=new Uint8Array(t-o),x.set(i.subarray(h+o,i.length),0)):x=i.subarray(h+o,h+t);var A={unit:x,pts:r};return T||n.samples.push(A),{sample:A,length:t,missing:T}}}},"./src/demux/base-audio-demuxer.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"initPTSFn",function(){return w});var k=_("./src/polyfills/number.ts"),b=_("./src/demux/id3.ts"),S=_("./src/demux/dummy-demuxed-track.ts"),j=_("./src/utils/mp4-tools.ts"),M=_("./src/utils/typed-array.ts"),O=function(){function c(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var y=c.prototype;return y.resetInitSegment=function(m,f,v){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},y.resetTimeStamp=function(){},y.resetContiguity=function(){},y.canParse=function(m,f){return!1},y.appendFrame=function(m,f,v){},y.demux=function(m,f){this.cachedData&&(m=Object(j.appendUint8Array)(this.cachedData,m),this.cachedData=null);var v=b.getID3Data(m,0),a=v?v.length:0,e,n,i=this._audioTrack,h=this._id3Track,d=v?b.getTimeStamp(v):void 0,u=m.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=w(d,f)),v&&v.length>0&&h.samples.push({pts:this.initPTS,dts:this.initPTS,data:v}),n=this.initPTS;a<u;){if(this.canParse(m,a)){var E=this.appendFrame(i,m,a);E?(this.frameIndex++,n=E.sample.pts,a+=E.length,e=a):a=u}else b.canParse(m,a)?(v=b.getID3Data(m,a),h.samples.push({pts:n,dts:n,data:v}),a+=v.length,e=a):a++;if(a===u&&e!==u){var g=Object(M.sliceUint8)(m,e);this.cachedData?this.cachedData=Object(j.appendUint8Array)(this.cachedData,g):this.cachedData=g}}return{audioTrack:i,avcTrack:Object(S.dummyTrack)(),id3Track:h,textTrack:Object(S.dummyTrack)()}},y.demuxSampleAes=function(m,f,v){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},y.flush=function(m){var f=this.cachedData;return f&&(this.cachedData=null,this.demux(f,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(S.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(S.dummyTrack)()}},y.destroy=function(){},c}(),w=function(y,C){return Object(k.isFiniteNumber)(y)?y*90:C*9e4};N.default=O},"./src/demux/chunk-cache.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"default",function(){return k});var k=function(){function S(){this.chunks=[],this.dataLength=0}var j=S.prototype;return j.push=function(O){this.chunks.push(O),this.dataLength+=O.length},j.flush=function(){var O=this.chunks,w=this.dataLength,c;if(O.length)O.length===1?c=O[0]:c=b(O,w);else return new Uint8Array(0);return this.reset(),c},j.reset=function(){this.chunks.length=0,this.dataLength=0},S}();function b(S,j){for(var M=new Uint8Array(j),O=0,w=0;w<S.length;w++){var c=S[w];M.set(c,O),O+=c.length}return M}},"./src/demux/dummy-demuxed-track.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"dummyTrack",function(){return k});function k(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(Z,N,_){"use strict";_.r(N);var k=_("./src/utils/logger.ts"),b=function(){function S(M){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=M,this.bytesAvailable=M.byteLength,this.word=0,this.bitsAvailable=0}var j=S.prototype;return j.loadWord=function(){var O=this.data,w=this.bytesAvailable,c=O.byteLength-w,y=new Uint8Array(4),C=Math.min(4,w);if(C===0)throw new Error("no bytes available");y.set(O.subarray(c,c+C)),this.word=new DataView(y.buffer).getUint32(0),this.bitsAvailable=C*8,this.bytesAvailable-=C},j.skipBits=function(O){var w;this.bitsAvailable>O?(this.word<<=O,this.bitsAvailable-=O):(O-=this.bitsAvailable,w=O>>3,O-=w>>3,this.bytesAvailable-=w,this.loadWord(),this.word<<=O,this.bitsAvailable-=O)},j.readBits=function(O){var w=Math.min(this.bitsAvailable,O),c=this.word>>>32-w;return O>32&&k.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=w,this.bitsAvailable>0?this.word<<=w:this.bytesAvailable>0&&this.loadWord(),w=O-w,w>0&&this.bitsAvailable?c<<w|this.readBits(w):c},j.skipLZ=function(){var O;for(O=0;O<this.bitsAvailable;++O)if((this.word&2147483648>>>O)!==0)return this.word<<=O,this.bitsAvailable-=O,O;return this.loadWord(),O+this.skipLZ()},j.skipUEG=function(){this.skipBits(1+this.skipLZ())},j.skipEG=function(){this.skipBits(1+this.skipLZ())},j.readUEG=function(){var O=this.skipLZ();return this.readBits(O+1)-1},j.readEG=function(){var O=this.readUEG();return 1&O?1+O>>>1:-1*(O>>>1)},j.readBoolean=function(){return this.readBits(1)===1},j.readUByte=function(){return this.readBits(8)},j.readUShort=function(){return this.readBits(16)},j.readUInt=function(){return this.readBits(32)},j.skipScalingList=function(O){for(var w=8,c=8,y,C=0;C<O;C++)c!==0&&(y=this.readEG(),c=(w+y+256)%256),w=c===0?w:c},j.readSPS=function(){var O=0,w=0,c=0,y=0,C,m,f,v=this.readUByte.bind(this),a=this.readBits.bind(this),e=this.readUEG.bind(this),n=this.readBoolean.bind(this),i=this.skipBits.bind(this),h=this.skipEG.bind(this),d=this.skipUEG.bind(this),u=this.skipScalingList.bind(this);v();var E=v();if(a(5),i(3),v(),d(),E===100||E===110||E===122||E===244||E===44||E===83||E===86||E===118||E===128){var g=e();if(g===3&&i(1),d(),d(),i(1),n())for(m=g!==3?8:12,f=0;f<m;f++)n()&&(f<6?u(16):u(64))}d();var s=e();if(s===0)e();else if(s===1)for(i(1),h(),h(),C=e(),f=0;f<C;f++)h();d(),i(1);var o=e(),r=e(),t=a(1);t===0&&i(1),i(1),n()&&(O=e(),w=e(),c=e(),y=e());var T=[1,1];if(n()&&n()){var x=v();switch(x){case 1:T=[1,1];break;case 2:T=[12,11];break;case 3:T=[10,11];break;case 4:T=[16,11];break;case 5:T=[40,33];break;case 6:T=[24,11];break;case 7:T=[20,11];break;case 8:T=[32,11];break;case 9:T=[80,33];break;case 10:T=[18,11];break;case 11:T=[15,11];break;case 12:T=[64,33];break;case 13:T=[160,99];break;case 14:T=[4,3];break;case 15:T=[3,2];break;case 16:T=[2,1];break;case 255:{T=[v()<<8|v(),v()<<8|v()];break}}}return{width:Math.ceil((o+1)*16-O*2-w*2),height:(2-t)*(r+1)*16-(t?2:4)*(c+y),pixelRatio:T}},j.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},S}();N.default=b},"./src/demux/id3.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"isHeader",function(){return k}),_.d(N,"isFooter",function(){return b}),_.d(N,"getID3Data",function(){return S}),_.d(N,"canParse",function(){return M}),_.d(N,"getTimeStamp",function(){return O}),_.d(N,"isTimeStampFrame",function(){return w}),_.d(N,"getID3Frames",function(){return y}),_.d(N,"decodeFrame",function(){return C}),_.d(N,"utf8ArrayToStr",function(){return e}),_.d(N,"testables",function(){return n});var k=function(u,E){return E+10<=u.length&&(u[E]===73&&u[E+1]===68&&u[E+2]===51&&(u[E+3]<255&&u[E+4]<255&&(u[E+6]<128&&u[E+7]<128&&u[E+8]<128&&u[E+9]<128)))},b=function(u,E){return E+10<=u.length&&(u[E]===51&&u[E+1]===68&&u[E+2]===73&&(u[E+3]<255&&u[E+4]<255&&(u[E+6]<128&&u[E+7]<128&&u[E+8]<128&&u[E+9]<128)))},S=function(u,E){for(var g=E,s=0;k(u,E);){s+=10;var o=j(u,E+6);s+=o,b(u,E+10)&&(s+=10),E+=s}return s>0?u.subarray(g,g+s):void 0},j=function(u,E){var g=0;return g=(u[E]&127)<<21,g|=(u[E+1]&127)<<14,g|=(u[E+2]&127)<<7,g|=u[E+3]&127,g},M=function(u,E){return k(u,E)&&j(u,E+6)+10<=u.length-E},O=function(u){for(var E=y(u),g=0;g<E.length;g++){var s=E[g];if(w(s))return a(s)}return},w=function(u){return u&&u.key==="PRIV"&&u.info==="com.apple.streaming.transportStreamTimestamp"},c=function(u){var E=String.fromCharCode(u[0],u[1],u[2],u[3]),g=j(u,4),s=10;return{type:E,size:g,data:u.subarray(s,s+g)}},y=function(u){for(var E=0,g=[];k(u,E);){var s=j(u,E+6);E+=10;for(var o=E+s;E+8<o;){var r=c(u.subarray(E)),t=C(r);t&&g.push(t),E+=r.size+10}b(u,E)&&(E+=10)}return g},C=function(u){return u.type==="PRIV"?m(u):u.type[0]==="W"?v(u):f(u)},m=function(u){if(u.size<2)return;var E=e(u.data,!0),g=new Uint8Array(u.data.subarray(E.length+1));return{key:u.type,info:E,data:g.buffer}},f=function(u){if(u.size<2)return;if(u.type==="TXXX"){var E=1,g=e(u.data.subarray(E),!0);E+=g.length+1;var s=e(u.data.subarray(E));return{key:u.type,info:g,data:s}}var o=e(u.data.subarray(1));return{key:u.type,data:o}},v=function(u){if(u.type==="WXXX"){if(u.size<2)return;var E=1,g=e(u.data.subarray(E),!0);E+=g.length+1;var s=e(u.data.subarray(E));return{key:u.type,info:g,data:s}}var o=e(u.data);return{key:u.type,data:o}},a=function(u){if(u.data.byteLength===8){var E=new Uint8Array(u.data),g=E[3]&1,s=(E[4]<<23)+(E[5]<<15)+(E[6]<<7)+E[7];return s/=45,g&&(s+=4772185884e-2),Math.round(s)}return},e=function(u,E){E===void 0&&(E=!1);var g=h();if(g){var s=g.decode(u);if(E){var o=s.indexOf("\0");return o!==-1?s.substring(0,o):s}return s.replace(/\0/g,"")}for(var r=u.length,t,T,x,A="",R=0;R<r;){if(t=u[R++],t===0&&E)return A;if(t===0||t===3)continue;switch(t>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:A+=String.fromCharCode(t);break;case 12:case 13:T=u[R++],A+=String.fromCharCode((t&31)<<6|T&63);break;case 14:T=u[R++],x=u[R++],A+=String.fromCharCode((t&15)<<12|(T&63)<<6|(x&63)<<0);break;default:}}return A},n={decodeTextFrame:f},i;function h(){return!i&&typeof self.TextDecoder!="undefined"&&(i=new self.TextDecoder("utf-8")),i}},"./src/demux/mp3demuxer.ts":function(Z,N,_){"use strict";_.r(N);var k=_("./src/demux/base-audio-demuxer.ts"),b=_("./src/demux/id3.ts"),S=_("./src/utils/logger.ts"),j=_("./src/demux/mpegaudio.ts");function M(c,y){c.prototype=Object.create(y.prototype),c.prototype.constructor=c,O(c,y)}function O(c,y){return O=Object.setPrototypeOf||function(m,f){return m.__proto__=f,m},O(c,y)}var w=function(c){M(y,c);function y(){return c.apply(this,arguments)||this}var C=y.prototype;return C.resetInitSegment=function(f,v,a){c.prototype.resetInitSegment.call(this,f,v,a),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:f,duration:a,inputTimeScale:9e4,dropped:0}},y.probe=function(f){if(!f)return!1;for(var v=b.getID3Data(f,0)||[],a=v.length,e=f.length;a<e;a++)if(j.probe(f,a))return S.logger.log("MPEG Audio sync word found !"),!0;return!1},C.canParse=function(f,v){return j.canParse(f,v)},C.appendFrame=function(f,v,a){return this.initPTS===null?void 0:j.appendFrame(f,v,a,this.initPTS,this.frameIndex)},y}(k.default);w.minProbeByteLength=4,N.default=w},"./src/demux/mp4demuxer.ts":function(Z,N,_){"use strict";_.r(N);var k=_("./src/utils/mp4-tools.ts"),b=_("./src/demux/dummy-demuxed-track.ts"),S=function(){function j(O,w){this.remainderData=null,this.config=void 0,this.config=w}var M=j.prototype;return M.resetTimeStamp=function(){},M.resetInitSegment=function(){},M.resetContiguity=function(){},j.probe=function(w){return Object(k.findBox)({data:w,start:0,end:Math.min(w.length,16384)},["moof"]).length>0},M.demux=function(w){var c=w,y=Object(b.dummyTrack)();if(this.config.progressive){this.remainderData&&(c=Object(k.appendUint8Array)(this.remainderData,w));var C=Object(k.segmentValidRange)(c);this.remainderData=C.remainder,y.samples=C.valid||new Uint8Array}else y.samples=c;return{audioTrack:Object(b.dummyTrack)(),avcTrack:y,id3Track:Object(b.dummyTrack)(),textTrack:Object(b.dummyTrack)()}},M.flush=function(){var w=Object(b.dummyTrack)();return w.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(b.dummyTrack)(),avcTrack:w,id3Track:Object(b.dummyTrack)(),textTrack:Object(b.dummyTrack)()}},M.demuxSampleAes=function(w,c,y){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},M.destroy=function(){},j}();S.minProbeByteLength=1024,N.default=S},"./src/demux/mpegaudio.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"appendFrame",function(){return O}),_.d(N,"parseHeader",function(){return w}),_.d(N,"isHeaderPattern",function(){return c}),_.d(N,"isHeader",function(){return y}),_.d(N,"canParse",function(){return C}),_.d(N,"probe",function(){return m});var k=null,b=[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],S=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],j=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],M=[0,1,1,4];function O(f,v,a,e,n){if(a+24>v.length)return;var i=w(v,a);if(i&&a+i.frameLength<=v.length){var h=i.samplesPerFrame*9e4/i.sampleRate,d=e+n*h,u={unit:v.subarray(a,a+i.frameLength),pts:d,dts:d};return f.config=[],f.channelCount=i.channelCount,f.samplerate=i.sampleRate,f.samples.push(u),{sample:u,length:i.frameLength,missing:0}}}function w(f,v){var a=f[v+1]>>3&3,e=f[v+1]>>1&3,n=f[v+2]>>4&15,i=f[v+2]>>2&3;if(a!==1&&n!==0&&n!==15&&i!==3){var h=f[v+2]>>1&1,d=f[v+3]>>6,u=a===3?3-e:e===3?3:4,E=b[u*14+n-1]*1e3,g=a===3?0:a===2?1:2,s=S[g*3+i],o=d===3?1:2,r=j[a][e],t=M[e],T=r*8*t,x=Math.floor(r*E/s+h)*t;if(k===null){var A=navigator.userAgent||"",R=A.match(/Chrome\/(\d+)/i);k=R?parseInt(R[1]):0}var I=!!k&&k<=87;return I&&e===2&&E>=224e3&&d===0&&(f[v+3]=f[v+3]|128),{sampleRate:s,channelCount:o,frameLength:x,samplesPerFrame:T}}}function c(f,v){return f[v]===255&&(f[v+1]&224)===224&&(f[v+1]&6)!==0}function y(f,v){return v+1<f.length&&c(f,v)}function C(f,v){var a=4;return c(f,v)&&a<=f.length-v}function m(f,v){if(v+1<f.length&&c(f,v)){var a=4,e=w(f,v),n=a;e!=null&&e.frameLength&&(n=e.frameLength);var i=v+n;return i===f.length||y(f,i)}return!1}},"./src/demux/sample-aes.ts":function(Z,N,_){"use strict";_.r(N);var k=_("./src/crypt/decrypter.ts"),b=_("./src/demux/tsdemuxer.ts"),S=function(){function j(O,w,c){this.keyData=void 0,this.decrypter=void 0,this.keyData=c,this.decrypter=new k.default(O,w,{removePKCS7Padding:!1})}var M=j.prototype;return M.decryptBuffer=function(w,c){this.decrypter.decrypt(w,this.keyData.key.buffer,this.keyData.iv.buffer,c)},M.decryptAacSample=function(w,c,y,C){var m=w[c].unit,f=m.subarray(16,m.length-m.length%16),v=f.buffer.slice(f.byteOffset,f.byteOffset+f.length),a=this;this.decryptBuffer(v,function(e){var n=new Uint8Array(e);m.set(n,16),C||a.decryptAacSamples(w,c+1,y)})},M.decryptAacSamples=function(w,c,y){for(;;c++){if(c>=w.length){y();return}if(w[c].unit.length<32)continue;var C=this.decrypter.isSync();if(this.decryptAacSample(w,c,y,C),!C)return}},M.getAvcEncryptedData=function(w){for(var c=Math.floor((w.length-48)/160)*16+16,y=new Int8Array(c),C=0,m=32;m<=w.length-16;m+=160,C+=16)y.set(w.subarray(m,m+16),C);return y},M.getAvcDecryptedUnit=function(w,c){for(var y=new Uint8Array(c),C=0,m=32;m<=w.length-16;m+=160,C+=16)w.set(y.subarray(C,C+16),m);return w},M.decryptAvcSample=function(w,c,y,C,m,f){var v=Object(b.discardEPB)(m.data),a=this.getAvcEncryptedData(v),e=this;this.decryptBuffer(a.buffer,function(n){m.data=e.getAvcDecryptedUnit(v,n),f||e.decryptAvcSamples(w,c,y+1,C)})},M.decryptAvcSamples=function(w,c,y,C){if(w instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;c++,y=0){if(c>=w.length){C();return}for(var m=w[c].units;!(y>=m.length);y++){var f=m[y];if(f.data.length<=48||f.type!==1&&f.type!==5)continue;var v=this.decrypter.isSync();if(this.decryptAvcSample(w,c,y,C,f,v),!v)return}}},j}();N.default=S},"./src/demux/transmuxer-interface.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"default",function(){return m});var k=_("./node_modules/webworkify-webpack/index.js"),b=_.n(k),S=_("./src/events.ts"),j=_("./src/demux/transmuxer.ts"),M=_("./src/utils/logger.ts"),O=_("./src/errors.ts"),w=_("./src/utils/mediasource-helper.ts"),c=_("./node_modules/eventemitter3/index.js"),y=_.n(c),C=Object(w.getMediaSource)()||{isTypeSupported:function(){return!1}},m=function(){function f(a,e,n,i){var h=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=a,this.id=e,this.onTransmuxComplete=n,this.onFlush=i;var d=a.config,u=function(r,t){t=t||{},t.frag=h.frag,t.id=h.id,a.trigger(r,t)};this.observer=new c.EventEmitter,this.observer.on(S.Events.FRAG_DECRYPTED,u),this.observer.on(S.Events.ERROR,u);var E={mp4:C.isTypeSupported("video/mp4"),mpeg:C.isTypeSupported("audio/mpeg"),mp3:C.isTypeSupported('audio/mp4; codecs="mp3"')},g=navigator.vendor;if(d.enableWorker&&typeof Worker!="undefined"){M.logger.log("demuxing in webworker");var s;try{s=this.worker=k("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),s.addEventListener("message",this.onwmsg),s.onerror=function(o){a.trigger(S.Events.ERROR,{type:O.ErrorTypes.OTHER_ERROR,details:O.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(o.message+" ("+o.filename+":"+o.lineno+")")})},s.postMessage({cmd:"init",typeSupported:E,vendor:g,id:e,config:JSON.stringify(d)})}catch(o){M.logger.warn("Error in worker:",o),M.logger.error("Error while initializing DemuxerWorker, fallback to inline"),s&&self.URL.revokeObjectURL(s.objectURL),this.transmuxer=new j.default(this.observer,E,d,g,e),this.worker=null}}else this.transmuxer=new j.default(this.observer,E,d,g,e)}var v=f.prototype;return v.destroy=function(){var e=this.worker;if(e)e.removeEventListener("message",this.onwmsg),e.terminate(),this.worker=null;else{var n=this.transmuxer;n&&(n.destroy(),this.transmuxer=null)}var i=this.observer;i&&i.removeAllListeners(),this.observer=null},v.push=function(e,n,i,h,d,u,E,g,s,o){var r=this;s.transmuxing.start=self.performance.now();var t=this.transmuxer,T=this.worker,x=u?u.start:d.start,A=d.decryptdata,R=this.frag,I=!(R&&d.cc===R.cc),B=!(R&&s.level===R.level),W=R?s.sn-R.sn:-1,$=this.part?s.part-this.part.index:1,X=!B&&(W===1||W===0&&$===1),V=self.performance.now();(B||W||d.stats.parsing.start===0)&&(d.stats.parsing.start=V),u&&($||!X)&&(u.stats.parsing.start=V);var se=new j.TransmuxState(I,X,g,B,x);if(!X||I){M.logger.log("[transmuxer-interface, "+d.type+"]: Starting new transmux session for sn: "+s.sn+" p: "+s.part+" level: "+s.level+" id: "+s.id+`
discontinuity: `+I+`
trackSwitch: `+B+`
contiguous: `+X+`
accurateTimeOffset: `+g+`
timeOffset: `+x);var xe=new j.TransmuxConfig(i,h,n,E,o);this.configureTransmuxer(xe)}if(this.frag=d,this.part=u,T)T.postMessage({cmd:"demux",data:e,decryptdata:A,chunkMeta:s,state:se},e instanceof ArrayBuffer?[e]:[]);else if(t){var Ee=t.push(e,A,s,se);Object(j.isPromise)(Ee)?Ee.then(function(je){r.handleTransmuxComplete(je)}):this.handleTransmuxComplete(Ee)}},v.flush=function(e){var n=this;e.transmuxing.start=self.performance.now();var i=this.transmuxer,h=this.worker;if(h)h.postMessage({cmd:"flush",chunkMeta:e});else if(i){var d=i.flush(e);Object(j.isPromise)(d)?d.then(function(u){n.handleFlushResult(u,e)}):this.handleFlushResult(d,e)}},v.handleFlushResult=function(e,n){var i=this;e.forEach(function(h){i.handleTransmuxComplete(h)}),this.onFlush(n)},v.onWorkerMessage=function(e){var n=e.data,i=this.hls;switch(n.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(n.data);break}case"flush":{this.onFlush(n.data);break}default:{n.data=n.data||{},n.data.frag=this.frag,n.data.id=this.id,i.trigger(n.event,n.data);break}}},v.configureTransmuxer=function(e){var n=this.worker,i=this.transmuxer;n?n.postMessage({cmd:"configure",config:e}):i&&i.configure(e)},v.handleTransmuxComplete=function(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)},f}()},"./src/demux/transmuxer-worker.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"default",function(){return O});var k=_("./src/demux/transmuxer.ts"),b=_("./src/events.ts"),S=_("./src/utils/logger.ts"),j=_("./node_modules/eventemitter3/index.js"),M=_.n(j);function O(m){var f=new j.EventEmitter,v=function(e,n){m.postMessage({event:e,data:n})};f.on(b.Events.FRAG_DECRYPTED,v),f.on(b.Events.ERROR,v),m.addEventListener("message",function(a){var e=a.data;switch(e.cmd){case"init":{var n=JSON.parse(e.config);m.transmuxer=new k.default(f,e.typeSupported,n,e.vendor,e.id),Object(S.enableLogs)(n.debug),v("init",null);break}case"configure":{m.transmuxer.configure(e.config);break}case"demux":{var i=m.transmuxer.push(e.data,e.decryptdata,e.chunkMeta,e.state);Object(k.isPromise)(i)?i.then(function(u){w(m,u)}):w(m,i);break}case"flush":{var h=e.chunkMeta,d=m.transmuxer.flush(h);Object(k.isPromise)(d)?d.then(function(u){y(m,u,h)}):y(m,d,h);break}default:break}})}function w(m,f){if(C(f.remuxResult))return;var v=[],a=f.remuxResult,e=a.audio,n=a.video;e&&c(v,e),n&&c(v,n),m.postMessage({event:"transmuxComplete",data:f},v)}function c(m,f){f.data1&&m.push(f.data1.buffer),f.data2&&m.push(f.data2.buffer)}function y(m,f,v){f.forEach(function(a){w(m,a)}),m.postMessage({event:"flush",data:v})}function C(m){return!m.audio&&!m.video&&!m.text&&!m.id3&&!m.initSegment}},"./src/demux/transmuxer.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"default",function(){return n}),_.d(N,"isPromise",function(){return d}),_.d(N,"TransmuxConfig",function(){return u}),_.d(N,"TransmuxState",function(){return E});var k=_("./src/events.ts"),b=_("./src/errors.ts"),S=_("./src/crypt/decrypter.ts"),j=_("./src/demux/aacdemuxer.ts"),M=_("./src/demux/mp4demuxer.ts"),O=_("./src/demux/tsdemuxer.ts"),w=_("./src/demux/mp3demuxer.ts"),c=_("./src/remux/mp4-remuxer.ts"),y=_("./src/remux/passthrough-remuxer.ts"),C=_("./src/demux/chunk-cache.ts"),m=_("./src/utils/mp4-tools.ts"),f=_("./src/utils/logger.ts"),v;try{v=self.performance.now.bind(self.performance)}catch(g){f.logger.debug("Unable to use Performance API on this environment"),v=self.Date.now}var a=[{demux:O.default,remux:c.default},{demux:M.default,remux:y.default},{demux:j.default,remux:c.default},{demux:w.default,remux:c.default}],e=1024;a.forEach(function(g){var s=g.demux;e=Math.max(e,s.minProbeByteLength)});var n=function(){function g(o,r,t,T,x){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new C.default,this.observer=o,this.typeSupported=r,this.config=t,this.vendor=T,this.id=x}var s=g.prototype;return s.configure=function(r){this.transmuxConfig=r,this.decrypter&&this.decrypter.reset()},s.push=function(r,t,T,x){var A=this,R=T.transmuxing;R.executeStart=v();var I=new Uint8Array(r),B=this.cache,W=this.config,$=this.currentTransmuxState,X=this.transmuxConfig;x&&(this.currentTransmuxState=x);var V=i(I,t);if(V&&V.method==="AES-128"){var se=this.getDecrypter();if(W.enableSoftwareAES){var xe=se.softwareDecrypt(I,V.key.buffer,V.iv.buffer);if(!xe)return R.executeEnd=v(),h(T);I=new Uint8Array(xe)}else return this.decryptionPromise=se.webCryptoDecrypt(I,V.key.buffer,V.iv.buffer).then(function(be){var Re=A.push(be,null,T);return A.decryptionPromise=null,Re}),this.decryptionPromise}var Ee=x||$,je=Ee.contiguous,Ae=Ee.discontinuity,Oe=Ee.trackSwitch,Le=Ee.accurateTimeOffset,Pe=Ee.timeOffset,he=X.audioCodec,Q=X.videoCodec,Ke=X.defaultInitPts,it=X.duration,Qe=X.initSegmentData;if((Ae||Oe)&&this.resetInitSegment(Qe,he,Q,it),Ae&&this.resetInitialTimestamp(Ke),je||this.resetContiguity(),this.needsProbing(I,Ae,Oe)){if(B.dataLength){var Xe=B.flush();I=Object(m.appendUint8Array)(Xe,I)}this.configureTransmuxer(I,X)}var ee=this.transmux(I,V,Pe,Le,T),ie=this.currentTransmuxState;return ie.contiguous=!0,ie.discontinuity=!1,ie.trackSwitch=!1,R.executeEnd=v(),ee},s.flush=function(r){var t=this,T=r.transmuxing;T.executeStart=v();var x=this.decrypter,A=this.cache,R=this.currentTransmuxState,I=this.decryptionPromise;if(I)return I.then(function(){return t.flush(r)});var B=[],W=R.timeOffset;if(x){var $=x.flush();$&&B.push(this.push($,null,r))}var X=A.dataLength;A.reset();var V=this.demuxer,se=this.remuxer;if(!V||!se)return X>=e&&this.observer.emit(k.Events.ERROR,k.Events.ERROR,{type:b.ErrorTypes.MEDIA_ERROR,details:b.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),T.executeEnd=v(),[h(r)];var xe=V.flush(W);return d(xe)?xe.then(function(Ee){return t.flushRemux(B,Ee,r),B}):(this.flushRemux(B,xe,r),B)},s.flushRemux=function(r,t,T){var x=t.audioTrack,A=t.avcTrack,R=t.id3Track,I=t.textTrack,B=this.currentTransmuxState,W=B.accurateTimeOffset,$=B.timeOffset;f.logger.log("[transmuxer.ts]: Flushed fragment "+T.sn+(T.part>-1?" p: "+T.part:"")+" of level "+T.level);var X=this.remuxer.remux(x,A,R,I,$,W,!0,this.id);r.push({remuxResult:X,chunkMeta:T}),T.transmuxing.executeEnd=v()},s.resetInitialTimestamp=function(r){var t=this.demuxer,T=this.remuxer;if(!t||!T)return;t.resetTimeStamp(r),T.resetTimeStamp(r)},s.resetContiguity=function(){var r=this.demuxer,t=this.remuxer;if(!r||!t)return;r.resetContiguity(),t.resetNextTimestamp()},s.resetInitSegment=function(r,t,T,x){var A=this.demuxer,R=this.remuxer;if(!A||!R)return;A.resetInitSegment(t,T,x),R.resetInitSegment(r,t,T)},s.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},s.transmux=function(r,t,T,x,A){var R;return t&&t.method==="SAMPLE-AES"?R=this.transmuxSampleAes(r,t,T,x,A):R=this.transmuxUnencrypted(r,T,x,A),R},s.transmuxUnencrypted=function(r,t,T,x){var A=this.demuxer.demux(r,t,!1,!this.config.progressive),R=A.audioTrack,I=A.avcTrack,B=A.id3Track,W=A.textTrack,$=this.remuxer.remux(R,I,B,W,t,T,!1,this.id);return{remuxResult:$,chunkMeta:x}},s.transmuxSampleAes=function(r,t,T,x,A){var R=this;return this.demuxer.demuxSampleAes(r,t,T).then(function(I){var B=R.remuxer.remux(I.audioTrack,I.avcTrack,I.id3Track,I.textTrack,T,x,!1,R.id);return{remuxResult:B,chunkMeta:A}})},s.configureTransmuxer=function(r,t){for(var T=this.config,x=this.observer,A=this.typeSupported,R=this.vendor,I=t.audioCodec,B=t.defaultInitPts,W=t.duration,$=t.initSegmentData,X=t.videoCodec,V,se=0,xe=a.length;se<xe;se++)if(a[se].demux.probe(r)){V=a[se];break}V||(f.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),V={demux:M.default,remux:y.default});var Ee=this.demuxer,je=this.remuxer,Ae=V.remux,Oe=V.demux;(!je||!(je instanceof Ae))&&(this.remuxer=new Ae(x,T,A,R)),(!Ee||!(Ee instanceof Oe))&&(this.demuxer=new Oe(x,T,A),this.probe=Oe.probe),this.resetInitSegment($,I,X,W),this.resetInitialTimestamp(B)},s.needsProbing=function(r,t,T){return!this.demuxer||!this.remuxer||t||T},s.getDecrypter=function(){var r=this.decrypter;return r||(r=this.decrypter=new S.default(this.observer,this.config)),r},g}();function i(g,s){var o=null;return g.byteLength>0&&s!=null&&s.key!=null&&s.iv!==null&&s.method!=null&&(o=s),o}var h=function(s){return{remuxResult:{},chunkMeta:s}};function d(g){return"then"in g&&g.then instanceof Function}var u=function(s,o,r,t,T){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=s,this.videoCodec=o,this.initSegmentData=r,this.duration=t,this.defaultInitPts=T},E=function(s,o,r,t,T){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=s,this.contiguous=o,this.accurateTimeOffset=r,this.trackSwitch=t,this.timeOffset=T}},"./src/demux/tsdemuxer.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"discardEPB",function(){return h});var k=_("./src/demux/adts.ts"),b=_("./src/demux/mpegaudio.ts"),S=_("./src/demux/exp-golomb.ts"),j=_("./src/demux/id3.ts"),M=_("./src/demux/sample-aes.ts"),O=_("./src/events.ts"),w=_("./src/utils/mp4-tools.ts"),c=_("./src/utils/logger.ts"),y=_("./src/errors.ts"),C={video:1,audio:2,id3:3,text:4},m=function(){function d(E,g,s){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=E,this.config=g,this.typeSupported=s}d.probe=function(g){var s=d.syncOffset(g);return s<0?!1:(s&&c.logger.warn("MPEG2-TS detected but first sync word found @ offset "+s+", junk ahead ?"),!0)},d.syncOffset=function(g){for(var s=Math.min(1e3,g.length-3*188),o=0;o<s;){if(g[o]===71&&g[o+188]===71&&g[o+2*188]===71)return o;o++}return-1},d.createTrack=function(g,s){return{container:g==="video"||g==="audio"?"video/mp2t":void 0,type:g,id:C[g],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:g==="audio"?s:void 0}};var u=d.prototype;return u.resetInitSegment=function(g,s,o){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=d.createTrack("video",o),this._audioTrack=d.createTrack("audio",o),this._id3Track=d.createTrack("id3",o),this._txtTrack=d.createTrack("text",o),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=g,this.videoCodec=s,this._duration=o},u.resetTimeStamp=function(){},u.resetContiguity=function(){var g=this._audioTrack,s=this._avcTrack,o=this._id3Track;g&&(g.pesData=null),s&&(s.pesData=null),o&&(o.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},u.demux=function(g,s,o,r){o===void 0&&(o=!1),r===void 0&&(r=!1),o||(this.sampleAes=null);var t,T=this._avcTrack,x=this._audioTrack,A=this._id3Track,R=T.pid,I=T.pesData,B=x.pid,W=A.pid,$=x.pesData,X=A.pesData,V=!1,se=this.pmtParsed,xe=this._pmtId,Ee=g.length;if(this.remainderData&&(g=Object(w.appendUint8Array)(this.remainderData,g),Ee=g.length,this.remainderData=null),Ee<188&&!r)return this.remainderData=g,{audioTrack:x,avcTrack:T,id3Track:A,textTrack:this._txtTrack};var je=Math.max(0,d.syncOffset(g));Ee-=(Ee+je)%188,Ee<g.byteLength&&!r&&(this.remainderData=new Uint8Array(g.buffer,Ee,g.buffer.byteLength-Ee));for(var Ae=je;Ae<Ee;Ae+=188)if(g[Ae]===71){var Oe=!!(g[Ae+1]&64),Le=((g[Ae+1]&31)<<8)+g[Ae+2],Pe=(g[Ae+3]&48)>>4,he=void 0;if(Pe>1){if(he=Ae+5+g[Ae+4],he===Ae+188)continue}else he=Ae+4;switch(Le){case R:Oe&&(I&&(t=e(I))&&this.parseAVCPES(t,!1),I={data:[],size:0}),I&&(I.data.push(g.subarray(he,Ae+188)),I.size+=Ae+188-he);break;case B:Oe&&($&&(t=e($))&&(x.isAAC?this.parseAACPES(t):this.parseMPEGPES(t)),$={data:[],size:0}),$&&($.data.push(g.subarray(he,Ae+188)),$.size+=Ae+188-he);break;case W:Oe&&(X&&(t=e(X))&&this.parseID3PES(t),X={data:[],size:0}),X&&(X.data.push(g.subarray(he,Ae+188)),X.size+=Ae+188-he);break;case 0:Oe&&(he+=g[he]+1),xe=this._pmtId=v(g,he);break;case xe:{Oe&&(he+=g[he]+1);var Q=a(g,he,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,o);R=Q.avc,R>0&&(T.pid=R),B=Q.audio,B>0&&(x.pid=B,x.isAAC=Q.isAAC),W=Q.id3,W>0&&(A.pid=W),V&&!se&&(c.logger.log("reparse from beginning"),V=!1,Ae=je-188),se=this.pmtParsed=!0;break}case 17:case 8191:break;default:V=!0;break}}else this.observer.emit(O.Events.ERROR,O.Events.ERROR,{type:y.ErrorTypes.MEDIA_ERROR,details:y.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});T.pesData=I,x.pesData=$,A.pesData=X;var Ke={audioTrack:x,avcTrack:T,id3Track:A,textTrack:this._txtTrack};return r&&this.extractRemainingSamples(Ke),Ke},u.flush=function(){var g=this.remainderData;this.remainderData=null;var s;return g?s=this.demux(g,-1,!1,!0):s={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(s),this.sampleAes?this.decrypt(s,this.sampleAes):s},u.extractRemainingSamples=function(g){var s=g.audioTrack,o=g.avcTrack,r=g.id3Track,t=o.pesData,T=s.pesData,x=r.pesData,A;t&&(A=e(t))?(this.parseAVCPES(A,!0),o.pesData=null):o.pesData=t,T&&(A=e(T))?(s.isAAC?this.parseAACPES(A):this.parseMPEGPES(A),s.pesData=null):(T!=null&&T.size&&c.logger.log("last AAC PES packet truncated,might overlap between fragments"),s.pesData=T),x&&(A=e(x))?(this.parseID3PES(A),r.pesData=null):r.pesData=x},u.demuxSampleAes=function(g,s,o){var r=this.demux(g,o,!0,!this.config.progressive),t=this.sampleAes=new M.default(this.observer,this.config,s);return this.decrypt(r,t)},u.decrypt=function(g,s){return new Promise(function(o){var r=g.audioTrack,t=g.avcTrack;r.samples&&r.isAAC?s.decryptAacSamples(r.samples,0,function(){t.samples?s.decryptAvcSamples(t.samples,0,0,function(){o(g)}):o(g)}):t.samples&&s.decryptAvcSamples(t.samples,0,0,function(){o(g)})})},u.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},u.parseAVCPES=function(g,s){var o=this,r=this._avcTrack,t=this.parseAVCNALu(g.data),T=!1,x=this.avcSample,A,R=!1;g.data=null,x&&t.length&&!r.audFound&&(n(x,r),x=this.avcSample=f(!1,g.pts,g.dts,"")),t.forEach(function(I){switch(I.type){case 1:{A=!0,x||(x=o.avcSample=f(!0,g.pts,g.dts,"")),T&&(x.debug+="NDR "),x.frame=!0;var B=I.data;if(R&&B.length>4){var W=new S.default(B).readSliceType();(W===2||W===4||W===7||W===9)&&(x.key=!0)}break}case 5:A=!0,x||(x=o.avcSample=f(!0,g.pts,g.dts,"")),T&&(x.debug+="IDR "),x.key=!0,x.frame=!0;break;case 6:{A=!0,T&&x&&(x.debug+="SEI ");var $=new S.default(h(I.data));$.readUByte();for(var X=0,V=0,se=!1,xe=0;!se&&$.bytesAvailable>1;){X=0;do xe=$.readUByte(),X+=xe;while(xe===255);V=0;do xe=$.readUByte(),V+=xe;while(xe===255);if(X===4&&$.bytesAvailable!==0){se=!0;var Ee=$.readUByte();if(Ee===181){var je=$.readUShort();if(je===49){var Ae=$.readUInt();if(Ae===1195456820){var Oe=$.readUByte();if(Oe===3){for(var Le=$.readUByte(),Pe=$.readUByte(),he=31&Le,Q=[Le,Pe],Ke=0;Ke<he;Ke++)Q.push($.readUByte()),Q.push($.readUByte()),Q.push($.readUByte());i(o._txtTrack.samples,{type:3,pts:g.pts,bytes:Q})}}}}}else if(X===5&&$.bytesAvailable!==0){if(se=!0,V>16){for(var it=[],Qe=0;Qe<16;Qe++)it.push($.readUByte().toString(16)),(Qe===3||Qe===5||Qe===7||Qe===9)&&it.push("-");for(var Xe=V-16,ee=new Uint8Array(Xe),ie=0;ie<Xe;ie++)ee[ie]=$.readUByte();i(o._txtTrack.samples,{pts:g.pts,payloadType:X,uuid:it.join(""),userData:Object(j.utf8ArrayToStr)(ee),userDataBytes:ee})}}else if(V<$.bytesAvailable)for(var be=0;be<V;be++)$.readUByte()}break}case 7:if(A=!0,R=!0,T&&x&&(x.debug+="SPS "),!r.sps){var Re=new S.default(I.data),Ue=Re.readSPS();r.width=Ue.width,r.height=Ue.height,r.pixelRatio=Ue.pixelRatio,r.sps=[I.data],r.duration=o._duration;for(var Ie=I.data.subarray(1,4),He="avc1.",Ge=0;Ge<3;Ge++){var ct=Ie[Ge].toString(16);ct.length<2&&(ct="0"+ct),He+=ct}r.codec=He}break;case 8:A=!0,T&&x&&(x.debug+="PPS "),r.pps||(r.pps=[I.data]);break;case 9:A=!1,r.audFound=!0,x&&n(x,r),x=o.avcSample=f(!1,g.pts,g.dts,T?"AUD ":"");break;case 12:A=!1;break;default:A=!1,x&&(x.debug+="unknown NAL "+I.type+" ");break}if(x&&A){var rt=x.units;rt.push(I)}}),s&&x&&(n(x,r),this.avcSample=null)},u.getLastNalUnit=function(){var g,s=this.avcSample,o;if(!s||s.units.length===0){var r=this._avcTrack.samples;s=r[r.length-1]}if((g=s)!==null&&g!==void 0&&g.units){var t=s.units;o=t[t.length-1]}return o},u.parseAVCNALu=function(g){var s=g.byteLength,o=this._avcTrack,r=o.naluState||0,t=r,T=[],x=0,A,R,I,B=-1,W=0;for(r===-1&&(B=0,W=g[0]&31,r=0,x=1);x<s;){if(A=g[x++],!r){r=A?0:1;continue}if(r===1){r=A?0:2;continue}if(!A)r=3;else if(A===1){if(B>=0){var $={data:g.subarray(B,x-r-1),type:W};T.push($)}else{var X=this.getLastNalUnit();if(X&&(t&&x<=4-t&&(X.state&&(X.data=X.data.subarray(0,X.data.byteLength-t))),R=x-r-1,R>0)){var V=new Uint8Array(X.data.byteLength+R);V.set(X.data,0),V.set(g.subarray(0,R),X.data.byteLength),X.data=V,X.state=0}}x<s?(I=g[x]&31,B=x,W=I,r=0):r=-1}else r=0}if(B>=0&&r>=0){var se={data:g.subarray(B,s),type:W,state:r};T.push(se)}if(T.length===0){var xe=this.getLastNalUnit();if(xe){var Ee=new Uint8Array(xe.data.byteLength+g.byteLength);Ee.set(xe.data,0),Ee.set(g,xe.data.byteLength),xe.data=Ee}}return o.naluState=r,T},u.parseAACPES=function(g){var s=0,o=this._audioTrack,r=this.aacOverFlow,t=g.data;if(r){this.aacOverFlow=null;var T=r.sample.unit.byteLength,x=Math.min(r.missing,T),A=T-x;r.sample.unit.set(t.subarray(0,x),A),o.samples.push(r.sample),s=r.missing}var R,I;for(R=s,I=t.length;R<I-1&&!k.isHeader(t,R);R++);if(R!==s){var B,W;if(R<I-1?(B="AAC PES did not start with ADTS header,offset:"+R,W=!1):(B="no ADTS header found in AAC PES",W=!0),c.logger.warn("parsing error:"+B),this.observer.emit(O.Events.ERROR,O.Events.ERROR,{type:y.ErrorTypes.MEDIA_ERROR,details:y.ErrorDetails.FRAG_PARSING_ERROR,fatal:W,reason:B}),W)return}k.initTrackConfig(o,this.observer,t,R,this.audioCodec);var $;if(g.pts!==void 0)$=g.pts;else if(r){var X=k.getFrameDuration(o.samplerate);$=r.sample.pts+X}else{c.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var V=0;R<I;)if(k.isHeader(t,R)){if(R+5<I){var se=k.appendFrame(o,t,R,$,V);if(se)if(se.missing)this.aacOverFlow=se;else{R+=se.length,V++;continue}}break}else R++},u.parseMPEGPES=function(g){var s=g.data,o=s.length,r=0,t=0,T=g.pts;if(T===void 0){c.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;t<o;)if(b.isHeader(s,t)){var x=b.appendFrame(this._audioTrack,s,t,T,r);if(x)t+=x.length,r++;else break}else t++},u.parseID3PES=function(g){if(g.pts===void 0){c.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(g)},d}();m.minProbeByteLength=188;function f(d,u,E,g){return{key:d,frame:!1,pts:u,dts:E,units:[],debug:g,length:0}}function v(d,u){return(d[u+10]&31)<<8|d[u+11]}function a(d,u,E,g){var s={audio:-1,avc:-1,id3:-1,isAAC:!0},o=(d[u+1]&15)<<8|d[u+2],r=u+3+o-4,t=(d[u+10]&15)<<8|d[u+11];for(u+=12+t;u<r;){var T=(d[u+1]&31)<<8|d[u+2];switch(d[u]){case 207:if(!g){c.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:s.audio===-1&&(s.audio=T);break;case 21:s.id3===-1&&(s.id3=T);break;case 219:if(!g){c.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:s.avc===-1&&(s.avc=T);break;case 3:case 4:E?s.audio===-1&&(s.audio=T,s.isAAC=!1):c.logger.log("MPEG audio found, not supported in this browser");break;case 36:c.logger.warn("Unsupported HEVC stream type found");break;default:break}u+=((d[u+3]&15)<<8|d[u+4])+5}return s}function e(d){var u=0,E,g,s,o,r,t=d.data;if(!d||d.size===0)return null;for(;t[0].length<19&&t.length>1;){var T=new Uint8Array(t[0].length+t[1].length);T.set(t[0]),T.set(t[1],t[0].length),t[0]=T,t.splice(1,1)}E=t[0];var x=(E[0]<<16)+(E[1]<<8)+E[2];if(x===1){if(g=(E[4]<<8)+E[5],g&&g>d.size-6)return null;var A=E[7];A&192&&(o=(E[9]&14)*536870912+(E[10]&255)*4194304+(E[11]&254)*16384+(E[12]&255)*128+(E[13]&254)/2,A&64?(r=(E[14]&14)*536870912+(E[15]&255)*4194304+(E[16]&254)*16384+(E[17]&255)*128+(E[18]&254)/2,o-r>60*9e4&&(c.logger.warn(Math.round((o-r)/9e4)+"s delta between PTS and DTS, align them"),o=r)):r=o),s=E[8];var R=s+9;if(d.size<=R)return null;d.size-=R;for(var I=new Uint8Array(d.size),B=0,W=t.length;B<W;B++){E=t[B];var $=E.byteLength;if(R)if(R>$){R-=$;continue}else E=E.subarray(R),$-=R,R=0;I.set(E,u),u+=$}return g&&(g-=s+3),{data:I,pts:o,dts:r,len:g}}return null}function n(d,u){if(d.units.length&&d.frame){if(d.pts===void 0){var E=u.samples,g=E.length;if(g){var s=E[g-1];d.pts=s.pts,d.dts=s.dts}else{u.dropped++;return}}u.samples.push(d)}d.debug.length&&c.logger.log(d.pts+"/"+d.dts+":"+d.debug)}function i(d,u){var E=d.length;if(E>0){if(u.pts>=d[E-1].pts)d.push(u);else for(var g=E-1;g>=0;g--)if(u.pts<d[g].pts){d.splice(g,0,u);break}}else d.push(u)}function h(d){for(var u=d.byteLength,E=[],g=1;g<u-2;)d[g]===0&&d[g+1]===0&&d[g+2]===3?(E.push(g+2),g+=2):g++;if(E.length===0)return d;var s=u-E.length,o=new Uint8Array(s),r=0;for(g=0;g<s;r++,g++)r===E[0]&&(r++,E.shift()),o[g]=d[r];return o}N.default=m},"./src/errors.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"ErrorTypes",function(){return k}),_.d(N,"ErrorDetails",function(){return b});var k;(function(S){S.NETWORK_ERROR="networkError",S.MEDIA_ERROR="mediaError",S.KEY_SYSTEM_ERROR="keySystemError",S.MUX_ERROR="muxError",S.OTHER_ERROR="otherError"})(k||(k={}));var b;(function(S){S.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",S.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",S.KEY_SYSTEM_NO_SESSION="keySystemNoSession",S.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",S.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",S.MANIFEST_LOAD_ERROR="manifestLoadError",S.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",S.MANIFEST_PARSING_ERROR="manifestParsingError",S.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",S.LEVEL_EMPTY_ERROR="levelEmptyError",S.LEVEL_LOAD_ERROR="levelLoadError",S.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",S.LEVEL_SWITCH_ERROR="levelSwitchError",S.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",S.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",S.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",S.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",S.FRAG_LOAD_ERROR="fragLoadError",S.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",S.FRAG_DECRYPT_ERROR="fragDecryptError",S.FRAG_PARSING_ERROR="fragParsingError",S.REMUX_ALLOC_ERROR="remuxAllocError",S.KEY_LOAD_ERROR="keyLoadError",S.KEY_LOAD_TIMEOUT="keyLoadTimeOut",S.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",S.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",S.BUFFER_APPEND_ERROR="bufferAppendError",S.BUFFER_APPENDING_ERROR="bufferAppendingError",S.BUFFER_STALLED_ERROR="bufferStalledError",S.BUFFER_FULL_ERROR="bufferFullError",S.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",S.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",S.INTERNAL_EXCEPTION="internalException",S.INTERNAL_ABORTED="aborted",S.UNKNOWN="unknown"})(b||(b={}))},"./src/events.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"Events",function(){return k});var k;(function(b){b.MEDIA_ATTACHING="hlsMediaAttaching",b.MEDIA_ATTACHED="hlsMediaAttached",b.MEDIA_DETACHING="hlsMediaDetaching",b.MEDIA_DETACHED="hlsMediaDetached",b.BUFFER_RESET="hlsBufferReset",b.BUFFER_CODECS="hlsBufferCodecs",b.BUFFER_CREATED="hlsBufferCreated",b.BUFFER_APPENDING="hlsBufferAppending",b.BUFFER_APPENDED="hlsBufferAppended",b.BUFFER_EOS="hlsBufferEos",b.BUFFER_FLUSHING="hlsBufferFlushing",b.BUFFER_FLUSHED="hlsBufferFlushed",b.MANIFEST_LOADING="hlsManifestLoading",b.MANIFEST_LOADED="hlsManifestLoaded",b.MANIFEST_PARSED="hlsManifestParsed",b.LEVEL_SWITCHING="hlsLevelSwitching",b.LEVEL_SWITCHED="hlsLevelSwitched",b.LEVEL_LOADING="hlsLevelLoading",b.LEVEL_LOADED="hlsLevelLoaded",b.LEVEL_UPDATED="hlsLevelUpdated",b.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",b.LEVELS_UPDATED="hlsLevelsUpdated",b.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",b.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",b.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",b.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",b.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",b.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",b.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",b.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",b.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",b.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",b.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",b.CUES_PARSED="hlsCuesParsed",b.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",b.INIT_PTS_FOUND="hlsInitPtsFound",b.FRAG_LOADING="hlsFragLoading",b.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",b.FRAG_LOADED="hlsFragLoaded",b.FRAG_DECRYPTED="hlsFragDecrypted",b.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",b.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",b.FRAG_PARSING_METADATA="hlsFragParsingMetadata",b.FRAG_PARSED="hlsFragParsed",b.FRAG_BUFFERED="hlsFragBuffered",b.FRAG_CHANGED="hlsFragChanged",b.FPS_DROP="hlsFpsDrop",b.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",b.ERROR="hlsError",b.DESTROYING="hlsDestroying",b.KEY_LOADING="hlsKeyLoading",b.KEY_LOADED="hlsKeyLoaded",b.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",b.BACK_BUFFER_REACHED="hlsBackBufferReached"})(k||(k={}))},"./src/hls.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"default",function(){return d});var k=_("./node_modules/url-toolkit/src/url-toolkit.js"),b=_.n(k),S=_("./src/loader/playlist-loader.ts"),j=_("./src/loader/key-loader.ts"),M=_("./src/controller/id3-track-controller.ts"),O=_("./src/controller/latency-controller.ts"),w=_("./src/controller/level-controller.ts"),c=_("./src/controller/fragment-tracker.ts"),y=_("./src/controller/stream-controller.ts"),C=_("./src/is-supported.ts"),m=_("./src/utils/logger.ts"),f=_("./src/config.ts"),v=_("./node_modules/eventemitter3/index.js"),a=_.n(v),e=_("./src/events.ts"),n=_("./src/errors.ts");function i(u,E){for(var g=0;g<E.length;g++){var s=E[g];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(u,s.key,s)}}function h(u,E,g){return E&&i(u.prototype,E),g&&i(u,g),u}var d=function(){u.isSupported=function(){return Object(C.isSupported)()};function u(g){g===void 0&&(g={}),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.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 s=this.config=Object(f.mergeConfig)(u.DefaultConfig,g);this.userConfig=g,Object(m.enableLogs)(s.debug),this._autoLevelCapping=-1,s.progressive&&Object(f.enableStreamingMode)(s);var o=s.abrController,r=s.bufferController,t=s.capLevelController,T=s.fpsController,x=this.abrController=new o(this),A=this.bufferController=new r(this),R=this.capLevelController=new t(this),I=new T(this),B=new S.default(this),W=new j.default(this),$=new M.default(this),X=this.levelController=new w.default(this),V=new c.FragmentTracker(this),se=this.streamController=new y.default(this,V);R.setStreamController(se),I.setStreamController(se);var xe=[X,se];this.networkControllers=xe;var Ee=[B,W,x,A,R,I,$,V];this.audioTrackController=this.createController(s.audioTrackController,null,xe),this.createController(s.audioStreamController,V,xe),this.subtitleTrackController=this.createController(s.subtitleTrackController,null,xe),this.createController(s.subtitleStreamController,V,xe),this.createController(s.timelineController,null,Ee),this.emeController=this.createController(s.emeController,null,Ee),this.cmcdController=this.createController(s.cmcdController,null,Ee),this.latencyController=this.createController(O.default,null,Ee),this.coreComponents=Ee}var E=u.prototype;return E.createController=function(s,o,r){if(s){var t=o?new s(this,o):new s(this);return r&&r.push(t),t}return null},E.on=function(s,o,r){r===void 0&&(r=this),this._emitter.on(s,o,r)},E.once=function(s,o,r){r===void 0&&(r=this),this._emitter.once(s,o,r)},E.removeAllListeners=function(s){this._emitter.removeAllListeners(s)},E.off=function(s,o,r,t){r===void 0&&(r=this),this._emitter.off(s,o,r,t)},E.listeners=function(s){return this._emitter.listeners(s)},E.emit=function(s,o,r){return this._emitter.emit(s,o,r)},E.trigger=function(s,o){if(this.config.debug)return this.emit(s,s,o);try{return this.emit(s,s,o)}catch(r){m.logger.error("An internal error happened while handling event "+s+'. Error message: "'+r.message+'". Here is a stacktrace:',r),this.trigger(e.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:s,error:r})}return!1},E.listenerCount=function(s){return this._emitter.listenerCount(s)},E.destroy=function(){m.logger.log("destroy"),this.trigger(e.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(s){return s.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(s){return s.destroy()}),this.coreComponents.length=0},E.attachMedia=function(s){m.logger.log("attachMedia"),this._media=s,this.trigger(e.Events.MEDIA_ATTACHING,{media:s})},E.detachMedia=function(){m.logger.log("detachMedia"),this.trigger(e.Events.MEDIA_DETACHING,void 0),this._media=null},E.loadSource=function(s){this.stopLoad();var o=this.media,r=this.url,t=this.url=k.buildAbsoluteURL(self.location.href,s,{alwaysNormalize:!0});m.logger.log("loadSource:"+t),o&&r&&r!==t&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(o)),this.trigger(e.Events.MANIFEST_LOADING,{url:s})},E.startLoad=function(s){s===void 0&&(s=-1),m.logger.log("startLoad("+s+")"),this.networkControllers.forEach(function(o){o.startLoad(s)})},E.stopLoad=function(){m.logger.log("stopLoad"),this.networkControllers.forEach(function(s){s.stopLoad()})},E.swapAudioCodec=function(){m.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},E.recoverMediaError=function(){m.logger.log("recoverMediaError");var s=this._media;this.detachMedia(),s&&this.attachMedia(s)},E.removeLevel=function(s,o){o===void 0&&(o=0),this.levelController.removeLevel(s,o)},h(u,[{key:"levels",get:function(){var s=this.levelController.levels;return s||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(s){m.logger.log("set currentLevel:"+s),this.loadLevel=s,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(s){m.logger.log("set nextLevel:"+s),this.levelController.manualLevel=s,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(s){m.logger.log("set loadLevel:"+s),this.levelController.manualLevel=s}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(s){this.levelController.nextLoadLevel=s}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(s){m.logger.log("set firstLevel:"+s),this.levelController.firstLevel=s}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(s){m.logger.log("set startLevel:"+s),s!==-1&&(s=Math.max(s,this.minAutoLevel)),this.levelController.startLevel=s}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(s){var o=!!s;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(s){this._autoLevelCapping!==s&&(m.logger.log("set autoLevelCapping:"+s),this._autoLevelCapping=s)}},{key:"bandwidthEstimate",get:function(){var s=this.abrController.bwEstimator;return s?s.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var s=this.levels,o=this.config.minAutoBitrate;if(!s)return 0;for(var r=s.length,t=0;t<r;t++)if(s[t].maxBitrate>o)return t;return 0}},{key:"maxAutoLevel",get:function(){var s=this.levels,o=this.autoLevelCapping,r;return o===-1&&s&&s.length?r=s.length-1:r=o,r}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(s){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,s)}},{key:"audioTracks",get:function(){var s=this.audioTrackController;return s?s.audioTracks:[]}},{key:"audioTrack",get:function(){var s=this.audioTrackController;return s?s.audioTrack:-1},set:function(s){var o=this.audioTrackController;o&&(o.audioTrack=s)}},{key:"subtitleTracks",get:function(){var s=this.subtitleTrackController;return s?s.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var s=this.subtitleTrackController;return s?s.subtitleTrack:-1},set:function(s){var o=this.subtitleTrackController;o&&(o.subtitleTrack=s)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var s=this.subtitleTrackController;return s?s.subtitleDisplay:!1},set:function(s){var o=this.subtitleTrackController;o&&(o.subtitleDisplay=s)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(s){this.config.lowLatencyMode=s}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return e.Events}},{key:"ErrorTypes",get:function(){return n.ErrorTypes}},{key:"ErrorDetails",get:function(){return n.ErrorDetails}},{key:"DefaultConfig",get:function(){return u.defaultConfig?u.defaultConfig:f.hlsDefaultConfig},set:function(s){u.defaultConfig=s}}]),u}();d.defaultConfig=void 0},"./src/is-supported.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"isSupported",function(){return S}),_.d(N,"changeTypeSupported",function(){return j});var k=_("./src/utils/mediasource-helper.ts");function b(){return self.SourceBuffer||self.WebKitSourceBuffer}function S(){var M=Object(k.getMediaSource)();if(!M)return!1;var O=b(),w=M&&typeof M.isTypeSupported=="function"&&M.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),c=!O||O.prototype&&typeof O.prototype.appendBuffer=="function"&&typeof O.prototype.remove=="function";return!!w&&!!c}function j(){var M,O=b();return typeof(O==null||((M=O.prototype)===null||M===void 0)?void 0:M.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"default",function(){return m}),_.d(N,"LoadError",function(){return v});var k=_("./src/polyfills/number.ts"),b=_("./src/errors.ts");function S(a,e){a.prototype=Object.create(e.prototype),a.prototype.constructor=a,c(a,e)}function j(a){var e=typeof Map=="function"?new Map:void 0;return j=function(i){if(i===null||!w(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e!="undefined"){if(e.has(i))return e.get(i);e.set(i,h)}function h(){return M(i,arguments,y(this).constructor)}return h.prototype=Object.create(i.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),c(h,i)},j(a)}function M(a,e,n){return O()?M=Reflect.construct:M=function(h,d,u){var E=[null];E.push.apply(E,d);var g=Function.bind.apply(h,E),s=new g;return u&&c(s,u.prototype),s},M.apply(null,arguments)}function O(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}function w(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function c(a,e){return c=Object.setPrototypeOf||function(i,h){return i.__proto__=h,i},c(a,e)}function y(a){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},y(a)}var C=Math.pow(2,17),m=function(){function a(n){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=n}var e=a.prototype;return e.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},e.abort=function(){this.loader&&this.loader.abort()},e.load=function(i,h){var d=this,u=i.url;if(!u)return Promise.reject(new v({type:b.ErrorTypes.NETWORK_ERROR,details:b.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,networkDetails:null},"Fragment does not have a "+(u?"part list":"url")));this.abort();var E=this.config,g=E.fLoader,s=E.loader;return new Promise(function(o,r){d.loader&&d.loader.destroy();var t=d.loader=i.loader=g?new g(E):new s(E),T=f(i),x={timeout:E.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:E.fragLoadingMaxRetryTimeout,highWaterMark:C};i.stats=t.stats,t.load(T,x,{onSuccess:function(R,I,B,W){d.resetLoader(i,t),o({frag:i,part:null,payload:R.data,networkDetails:W})},onError:function(R,I,B){d.resetLoader(i,t),r(new v({type:b.ErrorTypes.NETWORK_ERROR,details:b.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,response:R,networkDetails:B}))},onAbort:function(R,I,B){d.resetLoader(i,t),r(new v({type:b.ErrorTypes.NETWORK_ERROR,details:b.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:i,networkDetails:B}))},onTimeout:function(R,I,B){d.resetLoader(i,t),r(new v({type:b.ErrorTypes.NETWORK_ERROR,details:b.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:i,networkDetails:B}))},onProgress:function(R,I,B,W){h&&h({frag:i,part:null,payload:B,networkDetails:W})}})})},e.loadPart=function(i,h,d){var u=this;this.abort();var E=this.config,g=E.fLoader,s=E.loader;return new Promise(function(o,r){u.loader&&u.loader.destroy();var t=u.loader=i.loader=g?new g(E):new s(E),T=f(i,h),x={timeout:E.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:E.fragLoadingMaxRetryTimeout,highWaterMark:C};h.stats=t.stats,t.load(T,x,{onSuccess:function(R,I,B,W){u.resetLoader(i,t),u.updateStatsFromPart(i,h);var $={frag:i,part:h,payload:R.data,networkDetails:W};d($),o($)},onError:function(R,I,B){u.resetLoader(i,t),r(new v({type:b.ErrorTypes.NETWORK_ERROR,details:b.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,part:h,response:R,networkDetails:B}))},onAbort:function(R,I,B){i.stats.aborted=h.stats.aborted,u.resetLoader(i,t),r(new v({type:b.ErrorTypes.NETWORK_ERROR,details:b.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:i,part:h,networkDetails:B}))},onTimeout:function(R,I,B){u.resetLoader(i,t),r(new v({type:b.ErrorTypes.NETWORK_ERROR,details:b.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:i,part:h,networkDetails:B}))}})})},e.updateStatsFromPart=function(i,h){var d=i.stats,u=h.stats,E=u.total;if(d.loaded+=u.loaded,E){var g=Math.round(i.duration/h.duration),s=Math.min(Math.round(d.loaded/E),g),o=g-s,r=o*Math.round(d.loaded/s);d.total=d.loaded+r}else d.total=Math.max(d.loaded,d.total);var t=d.loading,T=u.loading;t.start?t.first+=T.first-T.start:(t.start=T.start,t.first=T.first),t.end=T.end},e.resetLoader=function(i,h){i.loader=null,this.loader===h&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),h.destroy()},a}();function f(a,e){e===void 0&&(e=null);var n=e||a,i={frag:a,part:e,responseType:"arraybuffer",url:n.url,headers:{},rangeStart:0,rangeEnd:0},h=n.byteRangeStartOffset,d=n.byteRangeEndOffset;return Object(k.isFiniteNumber)(h)&&Object(k.isFiniteNumber)(d)&&(i.rangeStart=h,i.rangeEnd=d),i}var v=function(a){S(e,a);function e(n){for(var i,h=arguments.length,d=new Array(h>1?h-1:0),u=1;u<h;u++)d[u-1]=arguments[u];return i=a.call.apply(a,[this].concat(d))||this,i.data=void 0,i.data=n,i}return e}(j(Error))},"./src/loader/fragment.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"ElementaryStreamTypes",function(){return m}),_.d(N,"BaseSegment",function(){return f}),_.d(N,"Fragment",function(){return v}),_.d(N,"Part",function(){return a});var k=_("./src/polyfills/number.ts"),b=_("./node_modules/url-toolkit/src/url-toolkit.js"),S=_.n(b),j=_("./src/utils/logger.ts"),M=_("./src/loader/level-key.ts"),O=_("./src/loader/load-stats.ts");function w(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,c(e,n)}function c(e,n){return c=Object.setPrototypeOf||function(h,d){return h.__proto__=d,h},c(e,n)}function y(e,n){for(var i=0;i<n.length;i++){var h=n[i];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(e,h.key,h)}}function C(e,n,i){return n&&y(e.prototype,n),i&&y(e,i),e}var m;(function(e){e.AUDIO="audio",e.VIDEO="video",e.AUDIOVIDEO="audiovideo"})(m||(m={}));var f=function(){function e(i){var h;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(h={},h[m.AUDIO]=null,h[m.VIDEO]=null,h[m.AUDIOVIDEO]=null,h),this.baseurl=i}var n=e.prototype;return n.setByteRange=function(h,d){var u=h.split("@",2),E=[];u.length===1?E[0]=d?d.byteRangeEndOffset:0:E[0]=parseInt(u[1]),E[1]=parseInt(u[0])+E[0],this._byteRange=E},C(e,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(b.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(h){this._url=h}}]),e}(),v=function(e){w(n,e);function n(h,d){var u;return u=e.call(this,d)||this,u._decryptdata=null,u.rawProgramDateTime=null,u.programDateTime=null,u.tagList=[],u.duration=0,u.sn=0,u.levelkey=void 0,u.type=void 0,u.loader=null,u.level=-1,u.cc=0,u.startPTS=void 0,u.endPTS=void 0,u.appendedPTS=void 0,u.startDTS=void 0,u.endDTS=void 0,u.start=0,u.deltaPTS=void 0,u.maxStartPTS=void 0,u.minEndPTS=void 0,u.stats=new O.LoadStats,u.urlId=0,u.data=void 0,u.bitrateTest=!1,u.title=null,u.initSegment=null,u.type=h,u}var i=n.prototype;return i.createInitializationVector=function(d){for(var u=new Uint8Array(16),E=12;E<16;E++)u[E]=d>>8*(15-E)&255;return u},i.setDecryptDataFromLevelKey=function(d,u){var E=d;return(d==null?void 0:d.method)==="AES-128"&&d.uri&&!d.iv&&(E=M.LevelKey.fromURI(d.uri),E.method=d.method,E.iv=this.createInitializationVector(u),E.keyFormat="identity"),E},i.setElementaryStreamInfo=function(d,u,E,g,s,o){o===void 0&&(o=!1);var r=this.elementaryStreams,t=r[d];if(!t){r[d]={startPTS:u,endPTS:E,startDTS:g,endDTS:s,partial:o};return}t.startPTS=Math.min(t.startPTS,u),t.endPTS=Math.max(t.endPTS,E),t.startDTS=Math.min(t.startDTS,g),t.endDTS=Math.max(t.endDTS,s)},i.clearElementaryStreamInfo=function(){var d=this.elementaryStreams;d[m.AUDIO]=null,d[m.VIDEO]=null,d[m.AUDIOVIDEO]=null},C(n,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var d=this.sn;typeof d!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&j.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),d=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,d)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(k.isFiniteNumber)(this.programDateTime))return null;var d=Object(k.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+d*1e3}},{key:"encrypted",get:function(){var d;return!!((d=this.decryptdata)!==null&&d!==void 0&&d.keyFormat&&this.decryptdata.uri)}}]),n}(f),a=function(e){w(n,e);function n(i,h,d,u,E){var g;g=e.call(this,d)||this,g.fragOffset=0,g.duration=0,g.gap=!1,g.independent=!1,g.relurl=void 0,g.fragment=void 0,g.index=void 0,g.stats=new O.LoadStats,g.duration=i.decimalFloatingPoint("DURATION"),g.gap=i.bool("GAP"),g.independent=i.bool("INDEPENDENT"),g.relurl=i.enumeratedString("URI"),g.fragment=h,g.index=u;var s=i.enumeratedString("BYTERANGE");return s&&g.setByteRange(s,E),E&&(g.fragOffset=E.fragOffset+E.duration),g}return C(n,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var h=this.elementaryStreams;return!!(h.audio||h.video||h.audiovideo)}}]),n}(f)},"./src/loader/key-loader.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"default",function(){return j});var k=_("./src/events.ts"),b=_("./src/errors.ts"),S=_("./src/utils/logger.ts"),j=function(){function M(w){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=w,this._registerListeners()}var O=M.prototype;return O._registerListeners=function(){this.hls.on(k.Events.KEY_LOADING,this.onKeyLoading,this)},O._unregisterListeners=function(){this.hls.off(k.Events.KEY_LOADING,this.onKeyLoading)},O.destroy=function(){this._unregisterListeners();for(var c in this.loaders){var y=this.loaders[c];y&&y.destroy()}this.loaders={}},O.onKeyLoading=function(c,y){var C=y.frag,m=C.type,f=this.loaders[m];if(!C.decryptdata){S.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var v=C.decryptdata.uri;if(v!==this.decrypturl||this.decryptkey===null){var a=this.hls.config;if(f&&(S.logger.warn("abort previous key loader for type:"+m),f.abort()),!v){S.logger.warn("key uri is falsy");return}var e=a.loader,n=C.loader=this.loaders[m]=new e(a);this.decrypturl=v,this.decryptkey=null;var i={url:v,frag:C,responseType:"arraybuffer"},h={timeout:a.fragLoadingTimeOut,maxRetry:0,retryDelay:a.fragLoadingRetryDelay,maxRetryDelay:a.fragLoadingMaxRetryTimeout,highWaterMark:0},d={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};n.load(i,h,d)}else this.decryptkey&&(C.decryptdata.key=this.decryptkey,this.hls.trigger(k.Events.KEY_LOADED,{frag:C}))},O.loadsuccess=function(c,y,C){var m=C.frag;if(!m.decryptdata){S.logger.error("after key load, decryptdata unset");return}this.decryptkey=m.decryptdata.key=new Uint8Array(c.data),m.loader=null,delete this.loaders[m.type],this.hls.trigger(k.Events.KEY_LOADED,{frag:m})},O.loaderror=function(c,y){var C=y.frag,m=C.loader;m&&m.abort(),delete this.loaders[C.type],this.hls.trigger(k.Events.ERROR,{type:b.ErrorTypes.NETWORK_ERROR,details:b.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:C,response:c})},O.loadtimeout=function(c,y){var C=y.frag,m=C.loader;m&&m.abort(),delete this.loaders[C.type],this.hls.trigger(k.Events.ERROR,{type:b.ErrorTypes.NETWORK_ERROR,details:b.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:C})},M}()},"./src/loader/level-details.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"LevelDetails",function(){return M});var k=_("./src/polyfills/number.ts");function b(O,w){for(var c=0;c<w.length;c++){var y=w[c];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(O,y.key,y)}}function S(O,w,c){return w&&b(O.prototype,w),c&&b(O,c),O}var j=10,M=function(){function O(c){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=c}var w=O.prototype;return w.reloaded=function(y){if(!y){this.advanced=!0,this.updated=!0;return}var C=this.lastPartSn-y.lastPartSn,m=this.lastPartIndex-y.lastPartIndex;this.updated=this.endSN!==y.endSN||!!m||!!C,this.advanced=this.endSN>y.endSN||C>0||C===0&&m>0,this.updated||this.advanced?this.misses=Math.floor(y.misses*.6):this.misses=y.misses+1,this.availabilityDelay=y.availabilityDelay},S(O,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(k.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||j}},{key:"drift",get:function(){var y=this.driftEndTime-this.driftStartTime;if(y>0){var C=this.driftEnd-this.driftStart;return C*1e3/y}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var y;return(y=this.partList)!==null&&y!==void 0&&y.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var y;return(y=this.fragments)!==null&&y!==void 0&&y.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 y;return(y=this.partList)!==null&&y!==void 0&&y.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var y;return(y=this.partList)!==null&&y!==void 0&&y.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),O}()},"./src/loader/level-key.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"LevelKey",function(){return M});var k=_("./node_modules/url-toolkit/src/url-toolkit.js"),b=_.n(k);function S(O,w){for(var c=0;c<w.length;c++){var y=w[c];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(O,y.key,y)}}function j(O,w,c){return w&&S(O.prototype,w),c&&S(O,c),O}var M=function(){O.fromURL=function(c,y){return new O(c,y)},O.fromURI=function(c){return new O(c)};function O(w,c){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,c?this._uri=Object(k.buildAbsoluteURL)(w,c,{alwaysNormalize:!0}):this._uri=w}return j(O,[{key:"uri",get:function(){return this._uri}}]),O}()},"./src/loader/load-stats.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"LoadStats",function(){return k});var k=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"default",function(){return n});var k=_("./src/polyfills/number.ts"),b=_("./node_modules/url-toolkit/src/url-toolkit.js"),S=_.n(b),j=_("./src/loader/fragment.ts"),M=_("./src/loader/level-details.ts"),O=_("./src/loader/level-key.ts"),w=_("./src/utils/attr-list.ts"),c=_("./src/utils/logger.ts"),y=_("./src/utils/codecs.ts"),C=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,m=/#EXT-X-MEDIA:(.*)/g,f=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),v=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),a=/\.(mp4|m4s|m4v|m4a)$/i;function e(E){var g,s;return a.test((g=(s=b.parseURL(E))===null||s===void 0?void 0:s.path)!=null?g:"")}var n=function(){function E(){}return E.findGroup=function(s,o){for(var r=0;r<s.length;r++){var t=s[r];if(t.id===o)return t}},E.convertAVC1ToAVCOTI=function(s){var o=s.split(".");if(o.length>2){var r=o.shift()+".";return r+=parseInt(o.shift()).toString(16),r+=("000"+parseInt(o.shift()).toString(16)).substr(-4),r}return s},E.resolve=function(s,o){return b.buildAbsoluteURL(o,s,{alwaysNormalize:!0})},E.parseMasterPlaylist=function(s,o){var r=[],t={},T=!1;C.lastIndex=0;for(var x;(x=C.exec(s))!=null;)if(x[1]){var A=new w.AttrList(x[1]),R={attrs:A,bitrate:A.decimalInteger("AVERAGE-BANDWIDTH")||A.decimalInteger("BANDWIDTH"),name:A.NAME,url:E.resolve(x[2],o)},I=A.decimalResolution("RESOLUTION");I&&(R.width=I.width,R.height=I.height),i((A.CODECS||"").split(/[ ,]+/).filter(function(W){return W}),R),R.videoCodec&&R.videoCodec.indexOf("avc1")!==-1&&(R.videoCodec=E.convertAVC1ToAVCOTI(R.videoCodec)),r.push(R)}else if(x[3]){var B=new w.AttrList(x[3]);B["DATA-ID"]&&(T=!0,t[B["DATA-ID"]]=B)}return{levels:r,sessionData:T?t:null}},E.parseMasterPlaylistMedia=function(s,o,r,t){t===void 0&&(t=[]);var T,x=[],A=0;for(m.lastIndex=0;(T=m.exec(s))!==null;){var R=new w.AttrList(T[1]);if(R.TYPE===r){var I={attrs:R,bitrate:0,id:A++,groupId:R["GROUP-ID"],instreamId:R["INSTREAM-ID"],name:R.NAME||R.LANGUAGE||"",type:r,default:R.bool("DEFAULT"),autoselect:R.bool("AUTOSELECT"),forced:R.bool("FORCED"),lang:R.LANGUAGE,url:R.URI?E.resolve(R.URI,o):""};if(t.length){var B=E.findGroup(t,I.groupId)||t[0];h(I,B,"audioCodec"),h(I,B,"textCodec")}x.push(I)}}return x},E.parseLevelPlaylist=function(s,o,r,t,T){var x=new M.LevelDetails(o),A=x.fragments,R=null,I=0,B=0,W=0,$=0,X=null,V=new j.Fragment(t,o),se,xe,Ee,je=-1,Ae=!1;for(f.lastIndex=0,x.m3u8=s;(se=f.exec(s))!==null;){Ae&&(Ae=!1,V=new j.Fragment(t,o),V.start=W,V.sn=I,V.cc=$,V.level=r,R&&(V.initSegment=R,V.rawProgramDateTime=R.rawProgramDateTime));var Oe=se[1];if(Oe){V.duration=parseFloat(Oe);var Le=(" "+se[2]).slice(1);V.title=Le||null,V.tagList.push(Le?["INF",Oe,Le]:["INF",Oe])}else if(se[3])Object(k.isFiniteNumber)(V.duration)&&(V.start=W,Ee&&(V.levelkey=Ee),V.sn=I,V.level=r,V.cc=$,V.urlId=T,A.push(V),V.relurl=(" "+se[3]).slice(1),u(V,X),X=V,W+=V.duration,I++,B=0,Ae=!0);else if(se[4]){var Pe=(" "+se[4]).slice(1);X?V.setByteRange(Pe,X):V.setByteRange(Pe)}else if(se[5])V.rawProgramDateTime=(" "+se[5]).slice(1),V.tagList.push(["PROGRAM-DATE-TIME",V.rawProgramDateTime]),je===-1&&(je=A.length);else{if(se=se[0].match(v),!se){c.logger.warn("No matches on slow regex match for level playlist!");continue}for(xe=1;xe<se.length&&!(typeof se[xe]!="undefined");xe++);var he=(" "+se[xe]).slice(1),Q=(" "+se[xe+1]).slice(1),Ke=se[xe+2]?(" "+se[xe+2]).slice(1):"";switch(he){case"PLAYLIST-TYPE":x.type=Q.toUpperCase();break;case"MEDIA-SEQUENCE":I=x.startSN=parseInt(Q);break;case"SKIP":{var it=new w.AttrList(Q),Qe=it.decimalInteger("SKIPPED-SEGMENTS");if(Object(k.isFiniteNumber)(Qe)){x.skippedSegments=Qe;for(var Xe=Qe;Xe--;)A.unshift(null);I+=Qe}var ee=it.enumeratedString("RECENTLY-REMOVED-DATERANGES");ee&&(x.recentlyRemovedDateranges=ee.split(" "));break}case"TARGETDURATION":x.targetduration=parseFloat(Q);break;case"VERSION":x.version=parseInt(Q);break;case"EXTM3U":break;case"ENDLIST":x.live=!1;break;case"#":(Q||Ke)&&V.tagList.push(Ke?[Q,Ke]:[Q]);break;case"DIS":$++;case"GAP":V.tagList.push([he]);break;case"BITRATE":V.tagList.push([he,Q]);break;case"DISCONTINUITY-SEQ":$=parseInt(Q);break;case"KEY":{var ie,be=new w.AttrList(Q),Re=be.enumeratedString("METHOD"),Ue=be.URI,Ie=be.hexadecimalInteger("IV"),He=be.enumeratedString("KEYFORMATVERSIONS"),Ge=be.enumeratedString("KEYID"),ct=(ie=be.enumeratedString("KEYFORMAT"))!=null?ie:"identity",rt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(rt.indexOf(ct)>-1){c.logger.warn("Keyformat "+ct+" is not supported from the manifest");continue}else if(ct!=="identity")continue;Re&&(Ee=O.LevelKey.fromURL(o,Ue),Ue&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Re)>=0&&(Ee.method=Re,Ee.keyFormat=ct,Ge&&(Ee.keyID=Ge),He&&(Ee.keyFormatVersions=He),Ee.iv=Ie));break}case"START":{var st=new w.AttrList(Q),Ze=st.decimalFloatingPoint("TIME-OFFSET");Object(k.isFiniteNumber)(Ze)&&(x.startTimeOffset=Ze);break}case"MAP":{var mt=new w.AttrList(Q);V.relurl=mt.URI,mt.BYTERANGE&&V.setByteRange(mt.BYTERANGE),V.level=r,V.sn="initSegment",Ee&&(V.levelkey=Ee),V.initSegment=null,R=V,Ae=!0;break}case"SERVER-CONTROL":{var ht=new w.AttrList(Q);x.canBlockReload=ht.bool("CAN-BLOCK-RELOAD"),x.canSkipUntil=ht.optionalFloat("CAN-SKIP-UNTIL",0),x.canSkipDateRanges=x.canSkipUntil>0&&ht.bool("CAN-SKIP-DATERANGES"),x.partHoldBack=ht.optionalFloat("PART-HOLD-BACK",0),x.holdBack=ht.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var me=new w.AttrList(Q);x.partTarget=me.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ce=x.partList;Ce||(Ce=x.partList=[]);var _e=B>0?Ce[Ce.length-1]:void 0,Fe=B++,Se=new j.Part(new w.AttrList(Q),V,o,Fe,_e);Ce.push(Se),V.duration+=Se.duration;break}case"PRELOAD-HINT":{var Me=new w.AttrList(Q);x.preloadHint=Me;break}case"RENDITION-REPORT":{var ue=new w.AttrList(Q);x.renditionReports=x.renditionReports||[],x.renditionReports.push(ue);break}default:c.logger.warn("line parsed but not handled: "+se);break}}}X&&!X.relurl?(A.pop(),W-=X.duration,x.partList&&(x.fragmentHint=X)):x.partList&&(u(V,X),V.cc=$,x.fragmentHint=V);var te=A.length,re=A[0],z=A[te-1];if(W+=x.skippedSegments*x.targetduration,W>0&&te&&z){x.averagetargetduration=W/te;var G=z.sn;x.endSN=G!=="initSegment"?G:0,re&&(x.startCC=re.cc,re.initSegment||x.fragments.every(function(J){return J.relurl&&e(J.relurl)})&&(c.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),V=new j.Fragment(t,o),V.relurl=z.relurl,V.level=r,V.sn="initSegment",re.initSegment=V,x.needSidxRanges=!0))}else x.endSN=0,x.startCC=0;return x.fragmentHint&&(W+=x.fragmentHint.duration),x.totalduration=W,x.endCC=$,je>0&&d(A,je),x},E}();function i(E,g){["video","audio","text"].forEach(function(s){var o=E.filter(function(t){return Object(y.isCodecType)(t,s)});if(o.length){var r=o.filter(function(t){return t.lastIndexOf("avc1",0)===0||t.lastIndexOf("mp4a",0)===0});g[s+"Codec"]=r.length>0?r[0]:o[0],E=E.filter(function(t){return o.indexOf(t)===-1})}}),g.unknownCodecs=E}function h(E,g,s){var o=g[s];o&&(E[s]=o)}function d(E,g){for(var s=E[g],o=g;o--;){var r=E[o];if(!r)return;r.programDateTime=s.programDateTime-r.duration*1e3,s=r}}function u(E,g){E.rawProgramDateTime?E.programDateTime=Date.parse(E.rawProgramDateTime):g!=null&&g.programDateTime&&(E.programDateTime=g.endProgramDateTime),Object(k.isFiniteNumber)(E.programDateTime)||(E.programDateTime=null,E.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(Z,N,_){"use strict";_.r(N);var k=_("./src/polyfills/number.ts"),b=_("./src/events.ts"),S=_("./src/errors.ts"),j=_("./src/utils/logger.ts"),M=_("./src/utils/mp4-tools.ts"),O=_("./src/loader/m3u8-parser.ts"),w=_("./src/types/loader.ts"),c=_("./src/utils/attr-list.ts");function y(f){var v=f.type;switch(v){case w.PlaylistContextType.AUDIO_TRACK:return w.PlaylistLevelType.AUDIO;case w.PlaylistContextType.SUBTITLE_TRACK:return w.PlaylistLevelType.SUBTITLE;default:return w.PlaylistLevelType.MAIN}}function C(f,v){var a=f.url;return(a===void 0||a.indexOf("data:")===0)&&(a=v.url),a}var m=function(){function f(a){this.hls=void 0,this.loaders=Object.create(null),this.hls=a,this.registerListeners()}var v=f.prototype;return v.registerListeners=function(){var e=this.hls;e.on(b.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(b.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(b.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(b.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},v.unregisterListeners=function(){var e=this.hls;e.off(b.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(b.Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(b.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(b.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},v.createInternalLoader=function(e){var n=this.hls.config,i=n.pLoader,h=n.loader,d=i||h,u=new d(n);return e.loader=u,this.loaders[e.type]=u,u},v.getInternalLoader=function(e){return this.loaders[e.type]},v.resetInternalLoader=function(e){this.loaders[e]&&delete this.loaders[e]},v.destroyInternalLoaders=function(){for(var e in this.loaders){var n=this.loaders[e];n&&n.destroy(),this.resetInternalLoader(e)}},v.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},v.onManifestLoading=function(e,n){var i=n.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:w.PlaylistContextType.MANIFEST,url:i,deliveryDirectives:null})},v.onLevelLoading=function(e,n){var i=n.id,h=n.level,d=n.url,u=n.deliveryDirectives;this.load({id:i,groupId:null,level:h,responseType:"text",type:w.PlaylistContextType.LEVEL,url:d,deliveryDirectives:u})},v.onAudioTrackLoading=function(e,n){var i=n.id,h=n.groupId,d=n.url,u=n.deliveryDirectives;this.load({id:i,groupId:h,level:null,responseType:"text",type:w.PlaylistContextType.AUDIO_TRACK,url:d,deliveryDirectives:u})},v.onSubtitleTrackLoading=function(e,n){var i=n.id,h=n.groupId,d=n.url,u=n.deliveryDirectives;this.load({id:i,groupId:h,level:null,responseType:"text",type:w.PlaylistContextType.SUBTITLE_TRACK,url:d,deliveryDirectives:u})},v.load=function(e){var n,i=this.hls.config,h=this.getInternalLoader(e);if(h){var d=h.context;if(d&&d.url===e.url){j.logger.trace("[playlist-loader]: playlist request ongoing");return}j.logger.log("[playlist-loader]: aborting previous loader for type: "+e.type),h.abort()}var u,E,g,s;switch(e.type){case w.PlaylistContextType.MANIFEST:u=i.manifestLoadingMaxRetry,E=i.manifestLoadingTimeOut,g=i.manifestLoadingRetryDelay,s=i.manifestLoadingMaxRetryTimeout;break;case w.PlaylistContextType.LEVEL:case w.PlaylistContextType.AUDIO_TRACK:case w.PlaylistContextType.SUBTITLE_TRACK:u=0,E=i.levelLoadingTimeOut;break;default:u=i.levelLoadingMaxRetry,E=i.levelLoadingTimeOut,g=i.levelLoadingRetryDelay,s=i.levelLoadingMaxRetryTimeout;break}if(h=this.createInternalLoader(e),(n=e.deliveryDirectives)!==null&&n!==void 0&&n.part){var o;if(e.type===w.PlaylistContextType.LEVEL&&e.level!==null?o=this.hls.levels[e.level].details:e.type===w.PlaylistContextType.AUDIO_TRACK&&e.id!==null?o=this.hls.audioTracks[e.id].details:e.type===w.PlaylistContextType.SUBTITLE_TRACK&&e.id!==null&&(o=this.hls.subtitleTracks[e.id].details),o){var r=o.partTarget,t=o.targetduration;r&&t&&(E=Math.min(Math.max(r*3,t*.8)*1e3,E))}}var T={timeout:E,maxRetry:u,retryDelay:g,maxRetryDelay:s,highWaterMark:0},x={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};h.load(e,T,x)},v.loadsuccess=function(e,n,i,h){if(h===void 0&&(h=null),i.isSidxRequest){this.handleSidxRequest(e,i),this.handlePlaylistLoaded(e,n,i,h);return}this.resetInternalLoader(i.type);var d=e.data;if(d.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(e,i,"no EXTM3U delimiter",h);return}n.parsing.start=performance.now(),d.indexOf("#EXTINF:")>0||d.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(e,n,i,h):this.handleMasterPlaylist(e,n,i,h)},v.loaderror=function(e,n,i){i===void 0&&(i=null),this.handleNetworkError(n,i,!1,e)},v.loadtimeout=function(e,n,i){i===void 0&&(i=null),this.handleNetworkError(n,i,!0)},v.handleMasterPlaylist=function(e,n,i,h){var d=this.hls,u=e.data,E=C(e,i),g=O.default.parseMasterPlaylist(u,E),s=g.levels,o=g.sessionData;if(!s.length){this.handleManifestParsingError(e,i,"no level found in manifest",h);return}var r=s.map(function(I){return{id:I.attrs.AUDIO,audioCodec:I.audioCodec}}),t=s.map(function(I){return{id:I.attrs.SUBTITLES,textCodec:I.textCodec}}),T=O.default.parseMasterPlaylistMedia(u,E,"AUDIO",r),x=O.default.parseMasterPlaylistMedia(u,E,"SUBTITLES",t),A=O.default.parseMasterPlaylistMedia(u,E,"CLOSED-CAPTIONS");if(T.length){var R=T.some(function(I){return!I.url});!R&&s[0].audioCodec&&!s[0].attrs.AUDIO&&(j.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),T.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new c.AttrList({}),bitrate:0,url:""}))}d.trigger(b.Events.MANIFEST_LOADED,{levels:s,audioTracks:T,subtitles:x,captions:A,url:E,stats:n,networkDetails:h,sessionData:o})},v.handleTrackOrLevelPlaylist=function(e,n,i,h){var d=this.hls,u=i.id,E=i.level,g=i.type,s=C(e,i),o=Object(k.isFiniteNumber)(u)?u:0,r=Object(k.isFiniteNumber)(E)?E:o,t=y(i),T=O.default.parseLevelPlaylist(e.data,s,r,t,o);if(!T.fragments.length){d.trigger(b.Events.ERROR,{type:S.ErrorTypes.NETWORK_ERROR,details:S.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:s,reason:"no fragments found in level",level:typeof i.level=="number"?i.level:void 0});return}if(g===w.PlaylistContextType.MANIFEST){var x={attrs:new c.AttrList({}),bitrate:0,details:T,name:"",url:s};d.trigger(b.Events.MANIFEST_LOADED,{levels:[x],audioTracks:[],url:s,stats:n,networkDetails:h,sessionData:null})}if(n.parsing.end=performance.now(),T.needSidxRanges){var A,R=(A=T.fragments[0].initSegment)===null||A===void 0?void 0:A.url;this.load({url:R,isSidxRequest:!0,type:g,level:E,levelDetails:T,id:u,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}i.levelDetails=T,this.handlePlaylistLoaded(e,n,i,h)},v.handleSidxRequest=function(e,n){var i=Object(M.parseSegmentIndex)(new Uint8Array(e.data));if(!i)return;var h=i.references,d=n.levelDetails;h.forEach(function(u,E){var g=u.info,s=d.fragments[E];s.byteRange.length===0&&s.setByteRange(String(1+g.end-g.start)+"@"+String(g.start)),s.initSegment&&s.initSegment.setByteRange(String(i.moovEndOffset)+"@0")})},v.handleManifestParsingError=function(e,n,i,h){this.hls.trigger(b.Events.ERROR,{type:S.ErrorTypes.NETWORK_ERROR,details:S.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:n.type===w.PlaylistContextType.MANIFEST,url:e.url,reason:i,response:e,context:n,networkDetails:h})},v.handleNetworkError=function(e,n,i,h){i===void 0&&(i=!1),j.logger.warn("[playlist-loader]: A network "+(i?"timeout":"error")+" occurred while loading "+e.type+" level: "+e.level+" id: "+e.id+' group-id: "'+e.groupId+'"');var d=S.ErrorDetails.UNKNOWN,u=!1,E=this.getInternalLoader(e);switch(e.type){case w.PlaylistContextType.MANIFEST:d=i?S.ErrorDetails.MANIFEST_LOAD_TIMEOUT:S.ErrorDetails.MANIFEST_LOAD_ERROR,u=!0;break;case w.PlaylistContextType.LEVEL:d=i?S.ErrorDetails.LEVEL_LOAD_TIMEOUT:S.ErrorDetails.LEVEL_LOAD_ERROR,u=!1;break;case w.PlaylistContextType.AUDIO_TRACK:d=i?S.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:S.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,u=!1;break;case w.PlaylistContextType.SUBTITLE_TRACK:d=i?S.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:S.ErrorDetails.SUBTITLE_LOAD_ERROR,u=!1;break}E&&this.resetInternalLoader(e.type);var g={type:S.ErrorTypes.NETWORK_ERROR,details:d,fatal:u,url:e.url,loader:E,context:e,networkDetails:n};h&&(g.response=h),this.hls.trigger(b.Events.ERROR,g)},v.handlePlaylistLoaded=function(e,n,i,h){var d=i.type,u=i.level,E=i.id,g=i.groupId,s=i.loader,o=i.levelDetails,r=i.deliveryDirectives;if(!(o!=null&&o.targetduration)){this.handleManifestParsingError(e,i,"invalid target duration",h);return}if(!s)return;o.live&&(s.getCacheAge&&(o.ageHeader=s.getCacheAge()||0),(!s.getCacheAge||isNaN(o.ageHeader))&&(o.ageHeader=0));switch(d){case w.PlaylistContextType.MANIFEST:case w.PlaylistContextType.LEVEL:this.hls.trigger(b.Events.LEVEL_LOADED,{details:o,level:u||0,id:E||0,stats:n,networkDetails:h,deliveryDirectives:r});break;case w.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(b.Events.AUDIO_TRACK_LOADED,{details:o,id:E||0,groupId:g||"",stats:n,networkDetails:h,deliveryDirectives:r});break;case w.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(b.Events.SUBTITLE_TRACK_LOADED,{details:o,id:E||0,groupId:g||"",stats:n,networkDetails:h,deliveryDirectives:r});break}},f}();N.default=m},"./src/polyfills/number.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"isFiniteNumber",function(){return k}),_.d(N,"MAX_SAFE_INTEGER",function(){return b});var k=Number.isFinite||function(S){return typeof S=="number"&&isFinite(S)},b=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(Z,N,_){"use strict";_.r(N);var k=function(){function b(){}return b.getSilentFrame=function(j,M){switch(j){case"mp4a.40.2":if(M===1)return new Uint8Array([0,200,0,128,35,128]);if(M===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(M===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(M===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(M===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(M===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(M===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(M===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(M===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},b}();N.default=k},"./src/remux/mp4-generator.ts":function(Z,N,_){"use strict";_.r(N);var k=Math.pow(2,32)-1,b=function(){function S(){}return S.init=function(){S.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 M;for(M in S.types)S.types.hasOwnProperty(M)&&(S.types[M]=[M.charCodeAt(0),M.charCodeAt(1),M.charCodeAt(2),M.charCodeAt(3)]);var O=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]),w=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]);S.HDLR_TYPES={video:O,audio:w};var c=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),y=new Uint8Array([0,0,0,0,0,0,0,0]);S.STTS=S.STSC=S.STCO=y,S.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),S.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),S.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),S.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var C=new Uint8Array([105,115,111,109]),m=new Uint8Array([97,118,99,49]),f=new Uint8Array([0,0,0,1]);S.FTYP=S.box(S.types.ftyp,C,f,C,m),S.DINF=S.box(S.types.dinf,S.box(S.types.dref,c))},S.box=function(M){for(var O=8,w=arguments.length,c=new Array(w>1?w-1:0),y=1;y<w;y++)c[y-1]=arguments[y];for(var C=c.length,m=C;C--;)O+=c[C].byteLength;var f=new Uint8Array(O);for(f[0]=O>>24&255,f[1]=O>>16&255,f[2]=O>>8&255,f[3]=O&255,f.set(M,4),C=0,O=8;C<m;C++)f.set(c[C],O),O+=c[C].byteLength;return f},S.hdlr=function(M){return S.box(S.types.hdlr,S.HDLR_TYPES[M])},S.mdat=function(M){return S.box(S.types.mdat,M)},S.mdhd=function(M,O){O*=M;var w=Math.floor(O/(k+1)),c=Math.floor(O%(k+1));return S.box(S.types.mdhd,new Uint8Array([1,0,0,0,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,w>>24,w>>16&255,w>>8&255,w&255,c>>24,c>>16&255,c>>8&255,c&255,85,196,0,0]))},S.mdia=function(M){return S.box(S.types.mdia,S.mdhd(M.timescale,M.duration),S.hdlr(M.type),S.minf(M))},S.mfhd=function(M){return S.box(S.types.mfhd,new Uint8Array([0,0,0,0,M>>24,M>>16&255,M>>8&255,M&255]))},S.minf=function(M){return M.type==="audio"?S.box(S.types.minf,S.box(S.types.smhd,S.SMHD),S.DINF,S.stbl(M)):S.box(S.types.minf,S.box(S.types.vmhd,S.VMHD),S.DINF,S.stbl(M))},S.moof=function(M,O,w){return S.box(S.types.moof,S.mfhd(M),S.traf(w,O))},S.moov=function(M){for(var O=M.length,w=[];O--;)w[O]=S.trak(M[O]);return S.box.apply(null,[S.types.moov,S.mvhd(M[0].timescale,M[0].duration)].concat(w).concat(S.mvex(M)))},S.mvex=function(M){for(var O=M.length,w=[];O--;)w[O]=S.trex(M[O]);return S.box.apply(null,[S.types.mvex].concat(w))},S.mvhd=function(M,O){O*=M;var w=Math.floor(O/(k+1)),c=Math.floor(O%(k+1)),y=new Uint8Array([1,0,0,0,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,w>>24,w>>16&255,w>>8&255,w&255,c>>24,c>>16&255,c>>8&255,c&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 S.box(S.types.mvhd,y)},S.sdtp=function(M){var O=M.samples||[],w=new Uint8Array(4+O.length),c,y;for(c=0;c<O.length;c++)y=O[c].flags,w[c+4]=y.dependsOn<<4|y.isDependedOn<<2|y.hasRedundancy;return S.box(S.types.sdtp,w)},S.stbl=function(M){return S.box(S.types.stbl,S.stsd(M),S.box(S.types.stts,S.STTS),S.box(S.types.stsc,S.STSC),S.box(S.types.stsz,S.STSZ),S.box(S.types.stco,S.STCO))},S.avc1=function(M){var O=[],w=[],c,y,C;for(c=0;c<M.sps.length;c++)y=M.sps[c],C=y.byteLength,O.push(C>>>8&255),O.push(C&255),O=O.concat(Array.prototype.slice.call(y));for(c=0;c<M.pps.length;c++)y=M.pps[c],C=y.byteLength,w.push(C>>>8&255),w.push(C&255),w=w.concat(Array.prototype.slice.call(y));var m=S.box(S.types.avcC,new Uint8Array([1,O[3],O[4],O[5],252|3,224|M.sps.length].concat(O).concat([M.pps.length]).concat(w))),f=M.width,v=M.height,a=M.pixelRatio[0],e=M.pixelRatio[1];return S.box(S.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,f>>8&255,f&255,v>>8&255,v&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]),m,S.box(S.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),S.box(S.types.pasp,new Uint8Array([a>>24,a>>16&255,a>>8&255,a&255,e>>24,e>>16&255,e>>8&255,e&255])))},S.esds=function(M){var O=M.config.length;return new Uint8Array([0,0,0,0,3,23+O,0,1,0,4,15+O,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([O]).concat(M.config).concat([6,1,2]))},S.mp4a=function(M){var O=M.samplerate;return S.box(S.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,M.channelCount,0,16,0,0,0,0,O>>8&255,O&255,0,0]),S.box(S.types.esds,S.esds(M)))},S.mp3=function(M){var O=M.samplerate;return S.box(S.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,M.channelCount,0,16,0,0,0,0,O>>8&255,O&255,0,0]))},S.stsd=function(M){return M.type==="audio"?!M.isAAC&&M.codec==="mp3"?S.box(S.types.stsd,S.STSD,S.mp3(M)):S.box(S.types.stsd,S.STSD,S.mp4a(M)):S.box(S.types.stsd,S.STSD,S.avc1(M))},S.tkhd=function(M){var O=M.id,w=M.duration*M.timescale,c=M.width,y=M.height,C=Math.floor(w/(k+1)),m=Math.floor(w%(k+1));return S.box(S.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,O>>24&255,O>>16&255,O>>8&255,O&255,0,0,0,0,C>>24,C>>16&255,C>>8&255,C&255,m>>24,m>>16&255,m>>8&255,m&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,c>>8&255,c&255,0,0,y>>8&255,y&255,0,0]))},S.traf=function(M,O){var w=S.sdtp(M),c=M.id,y=Math.floor(O/(k+1)),C=Math.floor(O%(k+1));return S.box(S.types.traf,S.box(S.types.tfhd,new Uint8Array([0,0,0,0,c>>24,c>>16&255,c>>8&255,c&255])),S.box(S.types.tfdt,new Uint8Array([1,0,0,0,y>>24,y>>16&255,y>>8&255,y&255,C>>24,C>>16&255,C>>8&255,C&255])),S.trun(M,w.length+16+20+8+16+8+8),w)},S.trak=function(M){return M.duration=M.duration||4294967295,S.box(S.types.trak,S.tkhd(M),S.mdia(M))},S.trex=function(M){var O=M.id;return S.box(S.types.trex,new Uint8Array([0,0,0,0,O>>24,O>>16&255,O>>8&255,O&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},S.trun=function(M,O){var w=M.samples||[],c=w.length,y=12+16*c,C=new Uint8Array(y),m,f,v,a,e,n;for(O+=8+y,C.set([0,0,15,1,c>>>24&255,c>>>16&255,c>>>8&255,c&255,O>>>24&255,O>>>16&255,O>>>8&255,O&255],0),m=0;m<c;m++)f=w[m],v=f.duration,a=f.size,e=f.flags,n=f.cts,C.set([v>>>24&255,v>>>16&255,v>>>8&255,v&255,a>>>24&255,a>>>16&255,a>>>8&255,a&255,e.isLeading<<2|e.dependsOn,e.isDependedOn<<6|e.hasRedundancy<<4|e.paddingValue<<1|e.isNonSync,e.degradPrio&240<<8,e.degradPrio&15,n>>>24&255,n>>>16&255,n>>>8&255,n&255],12+16*m);return S.box(S.types.trun,C)},S.initSegment=function(M){S.types||S.init();var O=S.moov(M),w=new Uint8Array(S.FTYP.byteLength+O.byteLength);return w.set(S.FTYP),w.set(O,S.FTYP.byteLength),w},S}();b.types=void 0,b.HDLR_TYPES=void 0,b.STTS=void 0,b.STSC=void 0,b.STCO=void 0,b.STSZ=void 0,b.VMHD=void 0,b.SMHD=void 0,b.STSD=void 0,b.FTYP=void 0,b.DINF=void 0,N.default=b},"./src/remux/mp4-remuxer.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"default",function(){return n}),_.d(N,"normalizePts",function(){return i});var k=_("./src/polyfills/number.ts"),b=_("./src/remux/aac-helper.ts"),S=_("./src/remux/mp4-generator.ts"),j=_("./src/events.ts"),M=_("./src/errors.ts"),O=_("./src/utils/logger.ts"),w=_("./src/types/loader.ts"),c=_("./src/utils/timescale-conversion.ts");function y(){return y=Object.assign||function(E){for(var g=1;g<arguments.length;g++){var s=arguments[g];for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(E[o]=s[o])}return E},y.apply(this,arguments)}var C=10*1e3,m=1024,f=1152,v=null,a=null,e=!1,n=function(){function E(s,o,r,t){if(t===void 0&&(t=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=s,this.config=o,this.typeSupported=r,this.ISGenerated=!1,v===null){var T=navigator.userAgent||"",x=T.match(/Chrome\/(\d+)/i);v=x?parseInt(x[1]):0}if(a===null){var A=navigator.userAgent.match(/Safari\/(\d+)/i);a=A?parseInt(A[1]):0}e=!!v&&v<75||!!a&&a<600}var g=E.prototype;return g.destroy=function(){},g.resetTimeStamp=function(o){O.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=o},g.resetNextTimestamp=function(){O.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},g.resetInitSegment=function(){O.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},g.getVideoStartPts=function(o){var r=!1,t=o.reduce(function(T,x){var A=x.pts-T;return A<-4294967296?(r=!0,i(T,x.pts)):A>0?T:x.pts},o[0].pts);return r&&O.logger.debug("PTS rollover detected"),t},g.remux=function(o,r,t,T,x,A,R,I){var B,W,$,X,V,se,xe=x,Ee=x,je=o.pid>-1,Ae=r.pid>-1,Oe=r.samples.length,Le=o.samples.length>0,Pe=Oe>1,he=(!je||Le)&&(!Ae||Pe)||this.ISGenerated||R;if(he){this.ISGenerated||($=this.generateIS(o,r,x));var Q=this.isVideoContiguous,Ke=-1;if(Pe&&(Ke=h(r.samples),!Q&&this.config.forceKeyFrameOnDiscontinuity))if(se=!0,Ke>0){O.logger.warn("[mp4-remuxer]: Dropped "+Ke+" out of "+Oe+" video samples due to a missing keyframe");var it=this.getVideoStartPts(r.samples);r.samples=r.samples.slice(Ke),r.dropped+=Ke,Ee+=(r.samples[0].pts-it)/(r.timescale||9e4)}else Ke===-1&&(O.logger.warn("[mp4-remuxer]: No keyframe found out of "+Oe+" video samples"),se=!1);if(this.ISGenerated){if(Le&&Pe){var Qe=this.getVideoStartPts(r.samples),Xe=i(o.samples[0].pts,Qe)-Qe,ee=Xe/r.inputTimeScale;xe+=Math.max(0,ee),Ee+=Math.max(0,-ee)}if(Le){if(o.samplerate||(O.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),$=this.generateIS(o,r,x)),W=this.remuxAudio(o,xe,this.isAudioContiguous,A,Ae||Pe||I===w.PlaylistLevelType.AUDIO?Ee:void 0),Pe){var ie=W?W.endPTS-W.startPTS:0;r.inputTimeScale||(O.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),$=this.generateIS(o,r,x)),B=this.remuxVideo(r,Ee,Q,ie)}}else Pe&&(B=this.remuxVideo(r,Ee,Q,0));B&&(B.firstKeyFrame=Ke,B.independent=Ke!==-1)}}return this.ISGenerated&&(t.samples.length&&(V=this.remuxID3(t,x)),T.samples.length&&(X=this.remuxText(T,x))),{audio:W,video:B,initSegment:$,independent:se,text:X,id3:V}},g.generateIS=function(o,r,t){var T=o.samples,x=r.samples,A=this.typeSupported,R={},I=!Object(k.isFiniteNumber)(this._initPTS),B="audio/mp4",W,$,X;if(I&&(W=$=Infinity),o.config&&T.length&&(o.timescale=o.samplerate,o.isAAC||(A.mpeg?(B="audio/mpeg",o.codec=""):A.mp3&&(o.codec="mp3")),R.audio={id:"audio",container:B,codec:o.codec,initSegment:!o.isAAC&&A.mpeg?new Uint8Array(0):S.default.initSegment([o]),metadata:{channelCount:o.channelCount}},I&&(X=o.inputTimeScale,W=$=T[0].pts-Math.round(X*t))),r.sps&&r.pps&&x.length&&(r.timescale=r.inputTimeScale,R.video={id:"main",container:"video/mp4",codec:r.codec,initSegment:S.default.initSegment([r]),metadata:{width:r.width,height:r.height}},I)){X=r.inputTimeScale;var V=this.getVideoStartPts(x),se=Math.round(X*t);$=Math.min($,i(x[0].dts,V)-se),W=Math.min(W,V-se)}if(Object.keys(R).length)return this.ISGenerated=!0,I&&(this._initPTS=W,this._initDTS=$),{tracks:R,initPTS:W,timescale:X}},g.remuxVideo=function(o,r,t,T){var x=o.inputTimeScale,A=o.samples,R=[],I=A.length,B=this._initPTS,W=this.nextAvcDts,$=8,X,V,se,xe=Number.POSITIVE_INFINITY,Ee=Number.NEGATIVE_INFINITY,je=0,Ae=!1;if(!t||W===null){var Oe=r*x,Le=A[0].pts-i(A[0].dts,A[0].pts);W=Oe-Le}for(var Pe=0;Pe<I;Pe++){var he=A[Pe];if(he.pts=i(he.pts-B,W),he.dts=i(he.dts-B,W),he.dts>he.pts){var Q=9e4*.2;je=Math.max(Math.min(je,he.pts-he.dts),-1*Q)}he.dts<A[Pe>0?Pe-1:Pe].dts&&(Ae=!0)}Ae&&A.sort(function(Ct,_t){var dt=Ct.dts-_t.dts,kt=Ct.pts-_t.pts;return dt||kt}),V=A[0].dts,se=A[A.length-1].dts;var Ke=Math.round((se-V)/(I-1));if(je<0){if(je<Ke*-2){O.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(c.toMsFromMpegTsClock)(-Ke,!0)+" ms");for(var it=je,Qe=0;Qe<I;Qe++)A[Qe].dts=it=Math.max(it,A[Qe].pts-Ke),A[Qe].pts=Math.max(it,A[Qe].pts)}else{O.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(c.toMsFromMpegTsClock)(je,!0)+" ms to overcome this issue");for(var Xe=0;Xe<I;Xe++)A[Xe].dts=A[Xe].dts+je}V=A[0].dts}if(t){var ee=V-W,ie=ee>Ke,be=ee<-1;if(ie||be){ie?O.logger.warn("AVC: "+Object(c.toMsFromMpegTsClock)(ee,!0)+" ms ("+ee+"dts) hole between fragments detected, filling it"):O.logger.warn("AVC: "+Object(c.toMsFromMpegTsClock)(-ee,!0)+" ms ("+ee+"dts) overlapping between fragments detected"),V=W;var Re=A[0].pts-ee;A[0].dts=V,A[0].pts=Re,O.logger.log("Video: First PTS/DTS adjusted: "+Object(c.toMsFromMpegTsClock)(Re,!0)+"/"+Object(c.toMsFromMpegTsClock)(V,!0)+", delta: "+Object(c.toMsFromMpegTsClock)(ee,!0)+" ms")}}e&&(V=Math.max(0,V));for(var Ue=0,Ie=0,He=0;He<I;He++){for(var Ge=A[He],ct=Ge.units,rt=ct.length,st=0,Ze=0;Ze<rt;Ze++)st+=ct[Ze].data.length;Ie+=st,Ue+=rt,Ge.length=st,Ge.dts=Math.max(Ge.dts,V),Ge.pts=Math.max(Ge.pts,Ge.dts,0),xe=Math.min(Ge.pts,xe),Ee=Math.max(Ge.pts,Ee)}se=A[I-1].dts;var mt=Ie+4*Ue+8,ht;try{ht=new Uint8Array(mt)}catch(Ct){this.observer.emit(j.Events.ERROR,j.Events.ERROR,{type:M.ErrorTypes.MUX_ERROR,details:M.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:mt,reason:"fail allocating video mdat "+mt});return}var me=new DataView(ht.buffer);me.setUint32(0,mt),ht.set(S.default.types.mdat,4);for(var Ce=0;Ce<I;Ce++){for(var _e=A[Ce],Fe=_e.units,Se=0,Me=0,ue=Fe.length;Me<ue;Me++){var te=Fe[Me],re=te.data,z=te.data.byteLength;me.setUint32($,z),$+=4,ht.set(re,$),$+=z,Se+=4+z}if(Ce<I-1)X=A[Ce+1].dts-_e.dts;else{var G=this.config,J=_e.dts-A[Ce>0?Ce-1:Ce].dts;if(G.stretchShortVideoTrack&&this.nextAudioPts!==null){var ne=Math.floor(G.maxBufferHole*x),ve=(T?xe+T*x:this.nextAudioPts)-_e.pts;ve>ne?(X=ve-J,X<0&&(X=J),O.logger.log("[mp4-remuxer]: It is approximately "+ve/90+" ms to the next segment; using duration "+X/90+" ms for the last video frame.")):X=J}else X=J}var we=Math.round(_e.pts-_e.dts);R.push(new d(_e.key,X,Se,we))}if(R.length&&v&&v<70){var ze=R[0].flags;ze.dependsOn=2,ze.isNonSync=0}console.assert(X!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=W=se+X,this.isVideoContiguous=!0;var nt=S.default.moof(o.sequenceNumber++,V,y({},o,{samples:R})),ft="video",tt={data1:nt,data2:ht,startPTS:xe/x,endPTS:(Ee+X)/x,startDTS:V/x,endDTS:W/x,type:ft,hasAudio:!1,hasVideo:!0,nb:R.length,dropped:o.dropped};return o.samples=[],o.dropped=0,console.assert(ht.length,"MDAT length must not be zero"),tt},g.remuxAudio=function(o,r,t,T,x){var A=o.inputTimeScale,R=o.samplerate?o.samplerate:A,I=A/R,B=o.isAAC?m:f,W=B*I,$=this._initPTS,X=!o.isAAC&&this.typeSupported.mpeg,V=[],se=o.samples,xe=X?0:8,Ee=this.nextAudioPts||-1,je=r*A;if(this.isAudioContiguous=t=t||se.length&&Ee>0&&(T&&Math.abs(je-Ee)<9e3||Math.abs(i(se[0].pts-$,je)-Ee)<20*W),se.forEach(function(re){re.pts=i(re.pts-$,je)}),!t||Ee<0){if(se=se.filter(function(re){return re.pts>=0}),!se.length)return;x===0?Ee=0:T?Ee=Math.max(0,je):Ee=se[0].pts}if(o.isAAC)for(var Ae=x!==void 0,Oe=this.config.maxAudioFramesDrift,Le=0,Pe=Ee;Le<se.length;Le++){var he=se[Le],Q=he.pts,Ke=Q-Pe,it=Math.abs(1e3*Ke/A);if(Ke<=-Oe*W&&Ae)Le===0&&(O.logger.warn("Audio frame @ "+(Q/A).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Ke/A)+" ms."),this.nextAudioPts=Ee=Pe=Q);else if(Ke>=Oe*W&&it<C&&Ae){var Qe=Math.round(Ke/W);Pe=Q-Qe*W,Pe<0&&(Qe--,Pe+=W),Le===0&&(this.nextAudioPts=Ee=Pe),O.logger.warn("[mp4-remuxer]: Injecting "+Qe+" audio frame @ "+(Pe/A).toFixed(3)+"s due to "+Math.round(1e3*Ke/A)+" ms gap.");for(var Xe=0;Xe<Qe;Xe++){var ee=Math.max(Pe,0),ie=b.default.getSilentFrame(o.manifestCodec||o.codec,o.channelCount);ie||(O.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ie=he.unit.subarray()),se.splice(Le,0,{unit:ie,pts:ee}),Pe+=W,Le++}}he.pts=Pe,Pe+=W}for(var be=null,Re=null,Ue,Ie=0,He=se.length;He--;)Ie+=se[He].unit.byteLength;for(var Ge=0,ct=se.length;Ge<ct;Ge++){var rt=se[Ge],st=rt.unit,Ze=rt.pts;if(Re!==null){var mt=V[Ge-1];mt.duration=Math.round((Ze-Re)/I)}else if(t&&o.isAAC&&(Ze=Ee),be=Ze,Ie>0){Ie+=xe;try{Ue=new Uint8Array(Ie)}catch(re){this.observer.emit(j.Events.ERROR,j.Events.ERROR,{type:M.ErrorTypes.MUX_ERROR,details:M.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ie,reason:"fail allocating audio mdat "+Ie});return}if(!X){var ht=new DataView(Ue.buffer);ht.setUint32(0,Ie),Ue.set(S.default.types.mdat,4)}}else return;Ue.set(st,xe);var me=st.byteLength;xe+=me,V.push(new d(!0,B,me,0)),Re=Ze}var Ce=V.length;if(!Ce)return;var _e=V[V.length-1];this.nextAudioPts=Ee=Re+I*_e.duration;var Fe=X?new Uint8Array(0):S.default.moof(o.sequenceNumber++,be/I,y({},o,{samples:V}));o.samples=[];var Se=be/A,Me=Ee/A,ue="audio",te={data1:Fe,data2:Ue,startPTS:Se,endPTS:Me,startDTS:Se,endDTS:Me,type:ue,hasAudio:!0,hasVideo:!1,nb:Ce};return this.isAudioContiguous=!0,console.assert(Ue.length,"MDAT length must not be zero"),te},g.remuxEmptyAudio=function(o,r,t,T){var x=o.inputTimeScale,A=o.samplerate?o.samplerate:x,R=x/A,I=this.nextAudioPts,B=(I!==null?I:T.startDTS*x)+this._initDTS,W=T.endDTS*x+this._initDTS,$=R*m,X=Math.ceil((W-B)/$),V=b.default.getSilentFrame(o.manifestCodec||o.codec,o.channelCount);if(O.logger.warn("[mp4-remuxer]: remux empty Audio"),!V){O.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var se=[],xe=0;xe<X;xe++){var Ee=B+xe*$;se.push({unit:V,pts:Ee,dts:Ee})}return o.samples=se,this.remuxAudio(o,r,t,!1)},g.remuxID3=function(o,r){var t=o.samples.length;if(!t)return;for(var T=o.inputTimeScale,x=this._initPTS,A=this._initDTS,R=0;R<t;R++){var I=o.samples[R];I.pts=i(I.pts-x,r*T)/T,I.dts=i(I.dts-A,r*T)/T}var B=o.samples;return o.samples=[],{samples:B}},g.remuxText=function(o,r){var t=o.samples.length;if(!t)return;for(var T=o.inputTimeScale,x=this._initPTS,A=0;A<t;A++){var R=o.samples[A];R.pts=i(R.pts-x,r*T)/T}o.samples.sort(function(B,W){return B.pts-W.pts});var I=o.samples;return o.samples=[],{samples:I}},E}();function i(E,g){var s;if(g===null)return E;for(g<E?s=-8589934592:s=8589934592;Math.abs(E-g)>4294967296;)E+=s;return E}function h(E){for(var g=0;g<E.length;g++)if(E[g].key)return g;return-1}var d=function(g,s,o,r){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=s,this.size=o,this.cts=r,this.flags=new u(g)},u=function(g){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=g?2:1,this.isNonSync=g?0:1}},"./src/remux/passthrough-remuxer.ts":function(Z,N,_){"use strict";_.r(N);var k=_("./src/polyfills/number.ts"),b=_("./src/utils/mp4-tools.ts"),S=_("./src/loader/fragment.ts"),j=_("./src/utils/logger.ts"),M=function(){function c(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var y=c.prototype;return y.destroy=function(){},y.resetTimeStamp=function(m){this.initPTS=m,this.lastEndDTS=null},y.resetNextTimestamp=function(){this.lastEndDTS=null},y.resetInitSegment=function(m,f,v){this.audioCodec=f,this.videoCodec=v,this.generateInitSegment(m),this.emitInitSegment=!0},y.generateInitSegment=function(m){var f=this.audioCodec,v=this.videoCodec;if(!m||!m.byteLength){this.initTracks=void 0,this.initData=void 0;return}var a=this.initData=Object(b.parseInitSegment)(m);f||(f=w(a.audio,S.ElementaryStreamTypes.AUDIO)),v||(v=w(a.video,S.ElementaryStreamTypes.VIDEO));var e={};a.audio&&a.video?e.audiovideo={container:"video/mp4",codec:f+","+v,initSegment:m,id:"main"}:a.audio?e.audio={container:"audio/mp4",codec:f,initSegment:m,id:"audio"}:a.video?e.video={container:"video/mp4",codec:v,initSegment:m,id:"main"}:j.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=e},y.remux=function(m,f,v,a,e){var n=this.initPTS,i=this.lastEndDTS,h={audio:void 0,video:void 0,text:a,id3:v,initSegment:void 0};Object(k.isFiniteNumber)(i)||(i=this.lastEndDTS=e||0);var d=f.samples;if(!d||!d.length)return h;var u={initPTS:void 0,timescale:1},E=this.initData;if((!E||!E.length)&&(this.generateInitSegment(d),E=this.initData),!E||!E.length)return j.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),h;this.emitInitSegment&&(u.tracks=this.initTracks,this.emitInitSegment=!1),Object(k.isFiniteNumber)(n)||(this.initPTS=u.initPTS=n=O(E,d,i));var g=Object(b.getDuration)(d,E),s=i,o=g+s;Object(b.offsetStartDTS)(E,d,n),g>0?this.lastEndDTS=o:(j.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var r=!!E.audio,t=!!E.video,T="";r&&(T+="audio"),t&&(T+="video");var x={data1:d,startPTS:s,startDTS:s,endPTS:o,endDTS:o,type:T,hasAudio:r,hasVideo:t,nb:1,dropped:0};return h.audio=x.type==="audio"?x:void 0,h.video=x.type!=="audio"?x:void 0,h.text=a,h.id3=v,h.initSegment=u,h},c}(),O=function(y,C,m){return Object(b.getStartDTS)(y,C)-m};function w(c,y){var C=c==null?void 0:c.codec;return C&&C.length>4?C:C==="hvc1"?"hvc1.1.c.L120.90":C==="av01"?"av01.0.04M.08":C==="avc1"||y===S.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}N.default=M},"./src/task-loop.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"default",function(){return k});var k=function(){function b(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var S=b.prototype;return S.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},S.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},S.onHandlerDestroyed=function(){},S.hasInterval=function(){return!!this._tickInterval},S.hasNextTick=function(){return!!this._tickTimer},S.setInterval=function(M){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,M),!0)},S.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},S.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},S.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},S.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},S.doTick=function(){},b}()},"./src/types/cmcd.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"CMCDVersion",function(){return k}),_.d(N,"CMCDObjectType",function(){return b}),_.d(N,"CMCDStreamingFormat",function(){return S}),_.d(N,"CMCDStreamType",function(){return j});var k=1,b;(function(M){M.MANIFEST="m",M.AUDIO="a",M.VIDEO="v",M.MUXED="av",M.INIT="i",M.CAPTION="c",M.TIMED_TEXT="tt",M.KEY="k",M.OTHER="o"})(b||(b={}));var S;(function(M){M.DASH="d",M.HLS="h",M.SMOOTH="s",M.OTHER="o"})(S||(S={}));var j;(function(M){M.VOD="v",M.LIVE="l"})(j||(j={}))},"./src/types/level.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"HlsSkip",function(){return S}),_.d(N,"getSkipValue",function(){return j}),_.d(N,"HlsUrlParameters",function(){return M}),_.d(N,"Level",function(){return O});function k(w,c){for(var y=0;y<c.length;y++){var C=c[y];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(w,C.key,C)}}function b(w,c,y){return c&&k(w.prototype,c),y&&k(w,y),w}var S;(function(w){w.No="",w.Yes="YES",w.v2="v2"})(S||(S={}));function j(w,c){var y=w.canSkipUntil,C=w.canSkipDateRanges,m=w.endSN,f=c!==void 0?c-m:0;return y&&f<y?C?S.v2:S.Yes:S.No}var M=function(){function w(y,C,m){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=y,this.part=C,this.skip=m}var c=w.prototype;return c.addDirectives=function(C){var m=new self.URL(C);return this.msn!==void 0&&m.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&m.searchParams.set("_HLS_part",this.part.toString()),this.skip&&m.searchParams.set("_HLS_skip",this.skip),m.toString()},w}(),O=function(){function w(c){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=[c.url],this.attrs=c.attrs,this.bitrate=c.bitrate,c.details&&(this.details=c.details),this.id=c.id||0,this.name=c.name,this.width=c.width||0,this.height=c.height||0,this.audioCodec=c.audioCodec,this.videoCodec=c.videoCodec,this.unknownCodecs=c.unknownCodecs,this.codecSet=[c.videoCodec,c.audioCodec].filter(function(y){return y}).join(",").replace(/\.[^.,]+/g,"")}return b(w,[{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(y){var C=y%this.url.length;this._urlId!==C&&(this.details=void 0,this._urlId=C)}}]),w}()},"./src/types/loader.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"PlaylistContextType",function(){return k}),_.d(N,"PlaylistLevelType",function(){return b});var k;(function(S){S.MANIFEST="manifest",S.LEVEL="level",S.AUDIO_TRACK="audioTrack",S.SUBTITLE_TRACK="subtitleTrack"})(k||(k={}));var b;(function(S){S.MAIN="main",S.AUDIO="audio",S.SUBTITLE="subtitle"})(b||(b={}))},"./src/types/transmuxer.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"ChunkMetadata",function(){return k});var k=function(j,M,O,w,c,y){w===void 0&&(w=0),c===void 0&&(c=-1),y===void 0&&(y=!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=b(),this.buffering={audio:b(),video:b(),audiovideo:b()},this.level=j,this.sn=M,this.id=O,this.size=w,this.part=c,this.partial=y};function b(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"AttrList",function(){return S});var k=/^(\d+)x(\d+)$/,b=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,S=function(){function j(O){typeof O=="string"&&(O=j.parseAttrList(O));for(var w in O)O.hasOwnProperty(w)&&(this[w]=O[w])}var M=j.prototype;return M.decimalInteger=function(w){var c=parseInt(this[w],10);return c>Number.MAX_SAFE_INTEGER?Infinity:c},M.hexadecimalInteger=function(w){if(this[w]){var c=(this[w]||"0x").slice(2);c=(c.length&1?"0":"")+c;for(var y=new Uint8Array(c.length/2),C=0;C<c.length/2;C++)y[C]=parseInt(c.slice(C*2,C*2+2),16);return y}else return null},M.hexadecimalIntegerAsNumber=function(w){var c=parseInt(this[w],16);return c>Number.MAX_SAFE_INTEGER?Infinity:c},M.decimalFloatingPoint=function(w){return parseFloat(this[w])},M.optionalFloat=function(w,c){var y=this[w];return y?parseFloat(y):c},M.enumeratedString=function(w){return this[w]},M.bool=function(w){return this[w]==="YES"},M.decimalResolution=function(w){var c=k.exec(this[w]);return c===null?void 0:{width:parseInt(c[1],10),height:parseInt(c[2],10)}},j.parseAttrList=function(w){var c,y={},C='"';for(b.lastIndex=0;(c=b.exec(w))!==null;){var m=c[2];m.indexOf(C)===0&&m.lastIndexOf(C)===m.length-1&&(m=m.slice(1,-1)),y[c[1]]=m}return y},j}()},"./src/utils/binary-search.ts":function(Z,N,_){"use strict";_.r(N);var k={search:function(S,j){for(var M=0,O=S.length-1,w=null,c=null;M<=O;){w=(M+O)/2|0,c=S[w];var y=j(c);if(y>0)M=w+1;else if(y<0)O=w-1;else return c}return null}};N.default=k},"./src/utils/buffer-helper.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"BufferHelper",function(){return S});var k=_("./src/utils/logger.ts"),b={length:0,start:function(){return 0},end:function(){return 0}},S=function(){function j(){}return j.isBuffered=function(O,w){try{if(O){for(var c=j.getBuffered(O),y=0;y<c.length;y++)if(w>=c.start(y)&&w<=c.end(y))return!0}}catch(C){}return!1},j.bufferInfo=function(O,w,c){try{if(O){var y=j.getBuffered(O),C=[],m;for(m=0;m<y.length;m++)C.push({start:y.start(m),end:y.end(m)});return this.bufferedInfo(C,w,c)}}catch(f){}return{len:0,start:w,end:w,nextStart:void 0}},j.bufferedInfo=function(O,w,c){w=Math.max(0,w),O.sort(function(u,E){var g=u.start-E.start;return g||E.end-u.end});var y=[];if(c)for(var C=0;C<O.length;C++){var m=y.length;if(m){var f=y[m-1].end;O[C].start-f<c?O[C].end>f&&(y[m-1].end=O[C].end):y.push(O[C])}else y.push(O[C])}else y=O;for(var v=0,a,e=w,n=w,i=0;i<y.length;i++){var h=y[i].start,d=y[i].end;if(w+c>=h&&w<d)e=h,n=d,v=n-w;else if(w+c<h){a=h;break}}return{len:v,start:e||0,end:n||0,nextStart:a}},j.getBuffered=function(O){try{return O.buffered}catch(w){return k.logger.log("failed to get media.buffered",w),b}},j}()},"./src/utils/cea-608-parser.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"Row",function(){return n}),_.d(N,"CaptionScreen",function(){return i});var k=_("./src/utils/logger.ts"),b={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},S=function(o){var r=o;return b.hasOwnProperty(o)&&(r=b[o]),String.fromCharCode(r)},j=15,M=100,O={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},w={17:2,18:4,21:6,22:8,23:10,19:13,20:15},c={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},y={25:2,26:4,29:6,30:8,31:10,27:13,28:15},C=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],m;(function(s){s[s.ERROR=0]="ERROR",s[s.TEXT=1]="TEXT",s[s.WARNING=2]="WARNING",s[s.INFO=2]="INFO",s[s.DEBUG=3]="DEBUG",s[s.DATA=3]="DATA"})(m||(m={}));var f=function(){function s(){this.time=null,this.verboseLevel=m.ERROR}var o=s.prototype;return o.log=function(t,T){this.verboseLevel>=t&&k.logger.log(this.time+" ["+t+"] "+T)},s}(),v=function(o){for(var r=[],t=0;t<o.length;t++)r.push(o[t].toString(16));return r},a=function(){function s(r,t,T,x,A){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=r||"white",this.underline=t||!1,this.italics=T||!1,this.background=x||"black",this.flash=A||!1}var o=s.prototype;return o.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},o.setStyles=function(t){for(var T=["foreground","underline","italics","background","flash"],x=0;x<T.length;x++){var A=T[x];t.hasOwnProperty(A)&&(this[A]=t[A])}},o.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},o.equals=function(t){return this.foreground===t.foreground&&this.underline===t.underline&&this.italics===t.italics&&this.background===t.background&&this.flash===t.flash},o.copy=function(t){this.foreground=t.foreground,this.underline=t.underline,this.italics=t.italics,this.background=t.background,this.flash=t.flash},o.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},s}(),e=function(){function s(r,t,T,x,A,R){this.uchar=void 0,this.penState=void 0,this.uchar=r||" ",this.penState=new a(t,T,x,A,R)}var o=s.prototype;return o.reset=function(){this.uchar=" ",this.penState.reset()},o.setChar=function(t,T){this.uchar=t,this.penState.copy(T)},o.setPenState=function(t){this.penState.copy(t)},o.equals=function(t){return this.uchar===t.uchar&&this.penState.equals(t.penState)},o.copy=function(t){this.uchar=t.uchar,this.penState.copy(t.penState)},o.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},s}(),n=function(){function s(r){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var t=0;t<M;t++)this.chars.push(new e);this.logger=r,this.pos=0,this.currPenState=new a}var o=s.prototype;return o.equals=function(t){for(var T=!0,x=0;x<M;x++)if(!this.chars[x].equals(t.chars[x])){T=!1;break}return T},o.copy=function(t){for(var T=0;T<M;T++)this.chars[T].copy(t.chars[T])},o.isEmpty=function(){for(var t=!0,T=0;T<M;T++)if(!this.chars[T].isEmpty()){t=!1;break}return t},o.setCursor=function(t){this.pos!==t&&(this.pos=t),this.pos<0?(this.logger.log(m.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>M&&(this.logger.log(m.DEBUG,"Too large cursor position "+this.pos),this.pos=M)},o.moveCursor=function(t){var T=this.pos+t;if(t>1)for(var x=this.pos+1;x<T+1;x++)this.chars[x].setPenState(this.currPenState);this.setCursor(T)},o.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},o.insertChar=function(t){t>=144&&this.backSpace();var T=S(t);if(this.pos>=M){this.logger.log(m.ERROR,"Cannot insert "+t.toString(16)+" ("+T+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(T,this.currPenState),this.moveCursor(1)},o.clearFromPos=function(t){var T;for(T=t;T<M;T++)this.chars[T].reset()},o.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},o.clearToEndOfRow=function(){this.clearFromPos(this.pos)},o.getTextString=function(){for(var t=[],T=!0,x=0;x<M;x++){var A=this.chars[x].uchar;A!==" "&&(T=!1),t.push(A)}return T?"":t.join("")},o.setPenStyles=function(t){this.currPenState.setStyles(t);var T=this.chars[this.pos];T.setPenState(this.currPenState)},s}(),i=function(){function s(r){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var t=0;t<j;t++)this.rows.push(new n(r));this.logger=r,this.currRow=j-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var o=s.prototype;return o.reset=function(){for(var t=0;t<j;t++)this.rows[t].clear();this.currRow=j-1},o.equals=function(t){for(var T=!0,x=0;x<j;x++)if(!this.rows[x].equals(t.rows[x])){T=!1;break}return T},o.copy=function(t){for(var T=0;T<j;T++)this.rows[T].copy(t.rows[T])},o.isEmpty=function(){for(var t=!0,T=0;T<j;T++)if(!this.rows[T].isEmpty()){t=!1;break}return t},o.backSpace=function(){var t=this.rows[this.currRow];t.backSpace()},o.clearToEndOfRow=function(){var t=this.rows[this.currRow];t.clearToEndOfRow()},o.insertChar=function(t){var T=this.rows[this.currRow];T.insertChar(t)},o.setPen=function(t){var T=this.rows[this.currRow];T.setPenStyles(t)},o.moveCursor=function(t){var T=this.rows[this.currRow];T.moveCursor(t)},o.setCursor=function(t){this.logger.log(m.INFO,"setCursor: "+t);var T=this.rows[this.currRow];T.setCursor(t)},o.setPAC=function(t){this.logger.log(m.INFO,"pacData = "+JSON.stringify(t));var T=t.row-1;if(this.nrRollUpRows&&T<this.nrRollUpRows-1&&(T=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==T){for(var x=0;x<j;x++)this.rows[x].clear();var A=this.currRow+1-this.nrRollUpRows,R=this.lastOutputScreen;if(R){var I=R.rows[A].cueStartTime,B=this.logger.time;if(I&&B!==null&&I<B)for(var W=0;W<this.nrRollUpRows;W++)this.rows[T-this.nrRollUpRows+W+1].copy(R.rows[A+W])}}this.currRow=T;var $=this.rows[this.currRow];if(t.indent!==null){var X=t.indent,V=Math.max(X-1,0);$.setCursor(t.indent),t.color=$.chars[V].penState.foreground}var se={foreground:t.color,underline:t.underline,italics:t.italics,background:"black",flash:!1};this.setPen(se)},o.setBkgData=function(t){this.logger.log(m.INFO,"bkgData = "+JSON.stringify(t)),this.backSpace(),this.setPen(t),this.insertChar(32)},o.setRollUpRows=function(t){this.nrRollUpRows=t},o.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(m.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(m.TEXT,this.getDisplayText());var t=this.currRow+1-this.nrRollUpRows,T=this.rows.splice(t,1)[0];T.clear(),this.rows.splice(this.currRow,0,T),this.logger.log(m.INFO,"Rolling up")},o.getDisplayText=function(t){t=t||!1;for(var T=[],x="",A=-1,R=0;R<j;R++){var I=this.rows[R].getTextString();I&&(A=R+1,t?T.push("Row "+A+": '"+I+"'"):T.push(I.trim()))}return T.length>0&&(t?x="["+T.join(" | ")+"]":x=T.join(`
`)),x},o.getTextAndFormat=function(){return this.rows},s}(),h=function(){function s(r,t,T){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=r,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new i(T),this.nonDisplayedMemory=new i(T),this.lastOutputScreen=new i(T),this.currRollUpRow=this.displayedMemory.rows[j-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=T}var o=s.prototype;return o.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[j-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},o.getHandler=function(){return this.outputFilter},o.setHandler=function(t){this.outputFilter=t},o.setPAC=function(t){this.writeScreen.setPAC(t)},o.setBkgData=function(t){this.writeScreen.setBkgData(t)},o.setMode=function(t){if(t===this.mode)return;this.mode=t,this.logger.log(m.INFO,"MODE="+t),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=t},o.insertChars=function(t){for(var T=0;T<t.length;T++)this.writeScreen.insertChar(t[T]);var x=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(m.INFO,x+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(m.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},o.ccRCL=function(){this.logger.log(m.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},o.ccBS=function(){if(this.logger.log(m.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},o.ccAOF=function(){},o.ccAON=function(){},o.ccDER=function(){this.logger.log(m.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},o.ccRU=function(t){this.logger.log(m.INFO,"RU("+t+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(t)},o.ccFON=function(){this.logger.log(m.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},o.ccRDC=function(){this.logger.log(m.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},o.ccTR=function(){this.logger.log(m.INFO,"TR"),this.setMode("MODE_TEXT")},o.ccRTD=function(){this.logger.log(m.INFO,"RTD"),this.setMode("MODE_TEXT")},o.ccEDM=function(){this.logger.log(m.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},o.ccCR=function(){this.logger.log(m.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},o.ccENM=function(){this.logger.log(m.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},o.ccEOC=function(){if(this.logger.log(m.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var t=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=t,this.writeScreen=this.nonDisplayedMemory,this.logger.log(m.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},o.ccTO=function(t){this.logger.log(m.INFO,"TO("+t+") - Tab Offset"),this.writeScreen.moveCursor(t)},o.ccMIDROW=function(t){var T={flash:!1};if(T.underline=t%2===1,T.italics=t>=46,T.italics)T.foreground="white";else{var x=Math.floor(t/2)-16,A=["white","green","blue","cyan","red","yellow","magenta"];T.foreground=A[x]}this.logger.log(m.INFO,"MIDROW: "+JSON.stringify(T)),this.writeScreen.setPen(T)},o.outputDataUpdate=function(t){t===void 0&&(t=!1);var T=this.logger.time;if(T===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=T:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,T,this.lastOutputScreen),t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:T),this.lastOutputScreen.copy(this.displayedMemory))},o.cueSplitAtTime=function(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))},s}(),d=function(){function s(r,t,T){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var x=new f;this.channels=[null,new h(r,t,x),new h(r+1,T,x)],this.cmdHistory=g(),this.logger=x}var o=s.prototype;return o.getHandler=function(t){return this.channels[t].getHandler()},o.setHandler=function(t,T){this.channels[t].setHandler(T)},o.addData=function(t,T){var x,A,R,I=!1;this.logger.time=t;for(var B=0;B<T.length;B+=2){if(A=T[B]&127,R=T[B+1]&127,A===0&&R===0)continue;if(this.logger.log(m.DATA,"["+v([T[B],T[B+1]])+"] -> ("+v([A,R])+")"),x=this.parseCmd(A,R),x||(x=this.parseMidrow(A,R)),x||(x=this.parsePAC(A,R)),x||(x=this.parseBackgroundAttributes(A,R)),!x&&(I=this.parseChars(A,R),I)){var W=this.currentChannel;if(W&&W>0){var $=this.channels[W];$.insertChars(I)}else this.logger.log(m.WARNING,"No channel found yet. TEXT-MODE?")}!x&&!I&&this.logger.log(m.WARNING,"Couldn't parse cleaned data "+v([A,R])+" orig: "+v([T[B],T[B+1]]))}},o.parseCmd=function(t,T){var x=this.cmdHistory,A=(t===20||t===28||t===21||t===29)&&T>=32&&T<=47,R=(t===23||t===31)&&T>=33&&T<=35;if(!(A||R))return!1;if(E(t,T,x))return u(null,null,x),this.logger.log(m.DEBUG,"Repeated command ("+v([t,T])+") is dropped"),!0;var I=t===20||t===21||t===23?1:2,B=this.channels[I];return t===20||t===21||t===28||t===29?T===32?B.ccRCL():T===33?B.ccBS():T===34?B.ccAOF():T===35?B.ccAON():T===36?B.ccDER():T===37?B.ccRU(2):T===38?B.ccRU(3):T===39?B.ccRU(4):T===40?B.ccFON():T===41?B.ccRDC():T===42?B.ccTR():T===43?B.ccRTD():T===44?B.ccEDM():T===45?B.ccCR():T===46?B.ccENM():T===47&&B.ccEOC():B.ccTO(T-32),u(t,T,x),this.currentChannel=I,!0},o.parseMidrow=function(t,T){var x=0;if((t===17||t===25)&&T>=32&&T<=47){if(t===17?x=1:x=2,x!==this.currentChannel)return this.logger.log(m.ERROR,"Mismatch channel in midrow parsing"),!1;var A=this.channels[x];return A?(A.ccMIDROW(T),this.logger.log(m.DEBUG,"MIDROW ("+v([t,T])+")"),!0):!1}return!1},o.parsePAC=function(t,T){var x,A=this.cmdHistory,R=(t>=17&&t<=23||t>=25&&t<=31)&&T>=64&&T<=127,I=(t===16||t===24)&&T>=64&&T<=95;if(!(R||I))return!1;if(E(t,T,A))return u(null,null,A),!0;var B=t<=23?1:2;T>=64&&T<=95?x=B===1?O[t]:c[t]:x=B===1?w[t]:y[t];var W=this.channels[B];return W?(W.setPAC(this.interpretPAC(x,T)),u(t,T,A),this.currentChannel=B,!0):!1},o.interpretPAC=function(t,T){var x,A={color:null,italics:!1,indent:null,underline:!1,row:t};return T>95?x=T-96:x=T-64,A.underline=(x&1)===1,x<=13?A.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(x/2)]:x<=15?(A.italics=!0,A.color="white"):A.indent=Math.floor((x-16)/2)*4,A},o.parseChars=function(t,T){var x,A=null,R=null;if(t>=25?(x=2,R=t-8):(x=1,R=t),R>=17&&R<=19){var I;R===17?I=T+80:R===18?I=T+112:I=T+144,this.logger.log(m.INFO,"Special char '"+S(I)+"' in channel "+x),A=[I]}else t>=32&&t<=127&&(A=T===0?[t]:[t,T]);if(A){var B=v(A);this.logger.log(m.DEBUG,"Char codes = "+B.join(",")),u(t,T,this.cmdHistory)}return A},o.parseBackgroundAttributes=function(t,T){var x=(t===16||t===24)&&T>=32&&T<=47,A=(t===23||t===31)&&T>=45&&T<=47;if(!(x||A))return!1;var R,I={};t===16||t===24?(R=Math.floor((T-32)/2),I.background=C[R],T%2===1&&(I.background=I.background+"_semi")):T===45?I.background="transparent":(I.foreground="black",T===47&&(I.underline=!0));var B=t<=23?1:2,W=this.channels[B];return W.setBkgData(I),u(t,T,this.cmdHistory),!0},o.reset=function(){for(var t=0;t<Object.keys(this.channels).length;t++){var T=this.channels[t];T&&T.reset()}this.cmdHistory=g()},o.cueSplitAtTime=function(t){for(var T=0;T<this.channels.length;T++){var x=this.channels[T];x&&x.cueSplitAtTime(t)}},s}();function u(s,o,r){r.a=s,r.b=o}function E(s,o,r){return r.a===s&&r.b===o}function g(){return{a:null,b:null}}N.default=d},"./src/utils/codecs.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"isCodecType",function(){return b}),_.d(N,"isCodecSupportedInMp4",function(){return S});var k={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function b(j,M){var O=k[M];return!!O&&O[j.slice(0,4)]===!0}function S(j,M){return MediaSource.isTypeSupported((M||"video")+'/mp4;codecs="'+j+'"')}},"./src/utils/cues.ts":function(Z,N,_){"use strict";_.r(N);var k=_("./src/utils/vttparser.ts"),b=_("./src/utils/webvtt-parser.ts"),S=_("./src/utils/texttrack-utils.ts"),j=/\s/,M={newCue:function(w,c,y,C){for(var m=[],f,v,a,e,n,i=self.VTTCue||self.TextTrackCue,h=0;h<C.rows.length;h++)if(f=C.rows[h],a=!0,e=0,n="",!f.isEmpty()){for(var d=0;d<f.chars.length;d++)j.test(f.chars[d].uchar)&&a?e++:(n+=f.chars[d].uchar,a=!1);f.cueStartTime=c,c===y&&(y+=1e-4),e>=16?e--:e++;var u=Object(k.fixLineBreaks)(n.trim()),E=Object(b.generateCueId)(c,y,u);(!w||!w.cues||!w.cues.getCueById(E))&&(v=new i(c,y,u),v.id=E,v.line=h+1,v.align="left",v.position=10+Math.min(80,Math.floor(e*8/32)*10),m.push(v))}return w&&m.length&&(m.sort(function(g,s){return g.line==="auto"||s.line==="auto"?0:g.line>8&&s.line>8?s.line-g.line:g.line-s.line}),m.forEach(function(g){return Object(S.addCueToTrack)(w,g)})),m}};N.default=M},"./src/utils/discontinuities.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"findFirstFragWithCC",function(){return j}),_.d(N,"shouldAlignOnDiscontinuities",function(){return M}),_.d(N,"findDiscontinuousReferenceFrag",function(){return O}),_.d(N,"adjustSlidingStart",function(){return c}),_.d(N,"alignStream",function(){return y}),_.d(N,"alignPDT",function(){return m}),_.d(N,"alignFragmentByPDTDelta",function(){return f}),_.d(N,"alignMediaPlaylistByPDT",function(){return v});var k=_("./src/polyfills/number.ts"),b=_("./src/utils/logger.ts"),S=_("./src/controller/level-helper.ts");function j(a,e){for(var n=null,i=0,h=a.length;i<h;i++){var d=a[i];if(d&&d.cc===e){n=d;break}}return n}function M(a,e,n){return!!(e.details&&(n.endCC>n.startCC||a&&a.cc<n.startCC))}function O(a,e){var n=a.fragments,i=e.fragments;if(!i.length||!n.length){b.logger.log("No fragments to align");return}var h=j(n,i[0].cc);if(!h||h&&!h.startPTS){b.logger.log("No frag in previous level to align on");return}return h}function w(a,e){if(a){var n=a.start+e;a.start=a.startPTS=n,a.endPTS=n+a.duration}}function c(a,e){for(var n=e.fragments,i=0,h=n.length;i<h;i++)w(n[i],a);e.fragmentHint&&w(e.fragmentHint,a),e.alignedSliding=!0}function y(a,e,n){if(!e)return;C(a,n,e),!n.alignedSliding&&e.details&&m(n,e.details),!n.alignedSliding&&e.details&&!n.skippedSegments&&Object(S.adjustSliding)(e.details,n)}function C(a,e,n){if(M(a,n,e)){var i=O(n.details,e);i&&Object(k.isFiniteNumber)(i.start)&&(b.logger.log("Adjusting PTS using last level due to CC increase within current level "+e.url),c(i.start,e))}}function m(a,e){if(!e.fragments.length||!a.hasProgramDateTime||!e.hasProgramDateTime)return;var n=e.fragments[0].programDateTime,i=a.fragments[0].programDateTime,h=(i-n)/1e3+e.fragments[0].start;h&&Object(k.isFiniteNumber)(h)&&(b.logger.log("Adjusting PTS using programDateTime delta "+(i-n)+"ms, sliding:"+h.toFixed(3)+" "+a.url+" "),c(h,a))}function f(a,e){var n=a.programDateTime;if(!n)return;var i=(n-e)/1e3;a.start=a.startPTS=i,a.endPTS=i+a.duration}function v(a,e){if(!e.fragments.length||!a.hasProgramDateTime||!e.hasProgramDateTime)return;var n=e.fragments[0].programDateTime,i=e.fragments[0].start,h=n-i*1e3;a.fragments.forEach(function(d){f(d,h)}),a.fragmentHint&&f(a.fragmentHint,h),a.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(Z,N,_){"use strict";_.r(N);var k=_("./src/utils/ewma.ts"),b=function(){function S(M,O,w){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=w,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new k.default(M),this.fast_=new k.default(O)}var j=S.prototype;return j.update=function(O,w){var c=this.slow_,y=this.fast_;this.slow_.halfLife!==O&&(this.slow_=new k.default(O,c.getEstimate(),c.getTotalWeight())),this.fast_.halfLife!==w&&(this.fast_=new k.default(w,y.getEstimate(),y.getTotalWeight()))},j.sample=function(O,w){O=Math.max(O,this.minDelayMs_);var c=8*w,y=O/1e3,C=c/y;this.fast_.sample(y,C),this.slow_.sample(y,C)},j.canEstimate=function(){var O=this.fast_;return O&&O.getTotalWeight()>=this.minWeight_},j.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},j.destroy=function(){},S}();N.default=b},"./src/utils/ewma.ts":function(Z,N,_){"use strict";_.r(N);var k=function(){function b(j,M,O){M===void 0&&(M=0),O===void 0&&(O=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=j,this.alpha_=j?Math.exp(Math.log(.5)/j):0,this.estimate_=M,this.totalWeight_=O}var S=b.prototype;return S.sample=function(M,O){var w=Math.pow(this.alpha_,M);this.estimate_=O*(1-w)+w*this.estimate_,this.totalWeight_+=M},S.getTotalWeight=function(){return this.totalWeight_},S.getEstimate=function(){if(this.alpha_){var M=1-Math.pow(this.alpha_,this.totalWeight_);if(M)return this.estimate_/M}return this.estimate_},b}();N.default=k},"./src/utils/fetch-loader.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"fetchSupported",function(){return f});var k=_("./src/polyfills/number.ts"),b=_("./src/loader/load-stats.ts"),S=_("./src/demux/chunk-cache.ts");function j(i,h){i.prototype=Object.create(h.prototype),i.prototype.constructor=i,y(i,h)}function M(i){var h=typeof Map=="function"?new Map:void 0;return M=function(u){if(u===null||!c(u))return u;if(typeof u!="function")throw new TypeError("Super expression must either be null or a function");if(typeof h!="undefined"){if(h.has(u))return h.get(u);h.set(u,E)}function E(){return O(u,arguments,C(this).constructor)}return E.prototype=Object.create(u.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),y(E,u)},M(i)}function O(i,h,d){return w()?O=Reflect.construct:O=function(E,g,s){var o=[null];o.push.apply(o,g);var r=Function.bind.apply(E,o),t=new r;return s&&y(t,s.prototype),t},O.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(i){return!1}}function c(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function y(i,h){return y=Object.setPrototypeOf||function(u,E){return u.__proto__=E,u},y(i,h)}function C(i){return C=Object.setPrototypeOf?Object.getPrototypeOf:function(d){return d.__proto__||Object.getPrototypeOf(d)},C(i)}function m(){return m=Object.assign||function(i){for(var h=1;h<arguments.length;h++){var d=arguments[h];for(var u in d)Object.prototype.hasOwnProperty.call(d,u)&&(i[u]=d[u])}return i},m.apply(this,arguments)}function f(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(i){}return!1}var v=function(){function i(d){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=d.fetchSetup||e,this.controller=new self.AbortController,this.stats=new b.LoadStats}var h=i.prototype;return h.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},h.abortInternal=function(){var u=this.response;(!u||!u.ok)&&(this.stats.aborted=!0,this.controller.abort())},h.abort=function(){var u;this.abortInternal(),(u=this.callbacks)!==null&&u!==void 0&&u.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},h.load=function(u,E,g){var s=this,o=this.stats;if(o.loading.start)throw new Error("Loader can only be used once.");o.loading.start=self.performance.now();var r=a(u,this.controller.signal),t=g.onProgress,T=u.responseType==="arraybuffer",x=T?"byteLength":"length";this.context=u,this.config=E,this.callbacks=g,this.request=this.fetchSetup(u,r),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){s.abortInternal(),g.onTimeout(o,u,s.response)},E.timeout),self.fetch(this.request).then(function(A){if(s.response=s.loader=A,!A.ok){var R=A.status,I=A.statusText;throw new n(I||"fetch, bad network response",R,A)}return o.loading.first=Math.max(self.performance.now(),o.loading.start),o.total=parseInt(A.headers.get("Content-Length")||"0"),t&&Object(k.isFiniteNumber)(E.highWaterMark)?s.loadProgressively(A,o,u,E.highWaterMark,t):T?A.arrayBuffer():A.text()}).then(function(A){var R=s.response;self.clearTimeout(s.requestTimeout),o.loading.end=Math.max(self.performance.now(),o.loading.first),o.loaded=o.total=A[x];var I={url:R.url,data:A};t&&!Object(k.isFiniteNumber)(E.highWaterMark)&&t(o,u,A,R),g.onSuccess(I,o,u,R)}).catch(function(A){if(self.clearTimeout(s.requestTimeout),o.aborted)return;var R=A.code||0;g.onError({code:R,text:A.message},u,A.details)})},h.getCacheAge=function(){var u=null;if(this.response){var E=this.response.headers.get("age");u=E?parseFloat(E):null}return u},h.loadProgressively=function(u,E,g,s,o){s===void 0&&(s=0);var r=new S.default,t=u.body.getReader(),T=function x(){return t.read().then(function(A){if(A.done)return r.dataLength&&o(E,g,r.flush(),u),Promise.resolve(new ArrayBuffer(0));var R=A.value,I=R.length;return E.loaded+=I,I<s||r.dataLength?(r.push(R),r.dataLength>=s&&o(E,g,r.flush(),u)):o(E,g,R,u),x()}).catch(function(){return Promise.reject()})};return T()},i}();function a(i,h){var d={method:"GET",mode:"cors",credentials:"same-origin",signal:h,headers:new self.Headers(m({},i.headers))};return i.rangeEnd&&d.headers.set("Range","bytes="+i.rangeStart+"-"+String(i.rangeEnd-1)),d}function e(i,h){return new self.Request(i.url,h)}var n=function(i){j(h,i);function h(d,u,E){var g;return g=i.call(this,d)||this,g.code=void 0,g.details=void 0,g.code=u,g.details=E,g}return h}(M(Error));N.default=v},"./src/utils/imsc1-ttml-parser.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"IMSC1_CODEC",function(){return c}),_.d(N,"parseIMSC1",function(){return f});var k=_("./src/utils/mp4-tools.ts"),b=_("./src/utils/vttparser.ts"),S=_("./src/utils/vttcue.ts"),j=_("./src/demux/id3.ts"),M=_("./src/utils/timescale-conversion.ts"),O=_("./src/utils/webvtt-parser.ts");function w(){return w=Object.assign||function(s){for(var o=1;o<arguments.length;o++){var r=arguments[o];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(s[t]=r[t])}return s},w.apply(this,arguments)}var c="stpp.ttml.im1t",y=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,C=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,m={left:"start",center:"center",right:"end",start:"start",end:"end"};function f(s,o,r,t,T){var x=Object(k.findBox)(new Uint8Array(s),["mdat"]);if(x.length===0){T(new Error("Could not parse IMSC1 mdat"));return}var A=x[0],R=Object(j.utf8ArrayToStr)(new Uint8Array(s,A.start,A.end-A.start)),I=Object(M.toTimescaleFromScale)(o,1,r);try{t(v(R,I))}catch(B){T(B)}}function v(s,o){var r=new DOMParser,t=r.parseFromString(s,"text/xml"),T=t.getElementsByTagName("tt")[0];if(!T)throw new Error("Invalid ttml");var x={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},A=Object.keys(x).reduce(function($,X){return $[X]=T.getAttribute("ttp:"+X)||x[X],$},{}),R=T.getAttribute("xml:space")!=="preserve",I=e(a(T,"styling","style")),B=e(a(T,"layout","region")),W=a(T,"body","[begin]");return[].map.call(W,function($){var X=n($,R);if(!X||!$.hasAttribute("begin"))return null;var V=u($.getAttribute("begin"),A),se=u($.getAttribute("dur"),A),xe=u($.getAttribute("end"),A);if(V===null)throw d($);if(xe===null){if(se===null)throw d($);xe=V+se}var Ee=new S.default(V-o,xe-o,X);Ee.id=Object(O.generateCueId)(Ee.startTime,Ee.endTime,Ee.text);var je=B[$.getAttribute("region")],Ae=I[$.getAttribute("style")];Ee.position=10,Ee.size=80;var Oe=i(je,Ae),Le=Oe.textAlign;if(Le){var Pe=m[Le];Pe&&(Ee.lineAlign=Pe),Ee.align=Le}return w(Ee,Oe),Ee}).filter(function($){return $!==null})}function a(s,o,r){var t=s.getElementsByTagName(o)[0];return t?[].slice.call(t.querySelectorAll(r)):[]}function e(s){return s.reduce(function(o,r){var t=r.getAttribute("xml:id");return t&&(o[t]=r),o},{})}function n(s,o){return[].slice.call(s.childNodes).reduce(function(r,t,T){var x;return t.nodeName==="br"&&T?r+`
`:(x=t.childNodes)!==null&&x!==void 0&&x.length?n(t,o):o?r+t.textContent.trim().replace(/\s+/g," "):r+t.textContent},"")}function i(s,o){var r="http://www.w3.org/ns/ttml#styling",t=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return t.reduce(function(T,x){var A=h(o,r,x)||h(s,r,x);return A&&(T[x]=A),T},{})}function h(s,o,r){return s.hasAttributeNS(o,r)?s.getAttributeNS(o,r):null}function d(s){return new Error("Could not parse ttml timestamp "+s)}function u(s,o){if(!s)return null;var r=Object(b.parseTimeStamp)(s);return r===null&&(y.test(s)?r=E(s,o):C.test(s)&&(r=g(s,o))),r}function E(s,o){var r=y.exec(s),t=(r[4]|0)+(r[5]|0)/o.subFrameRate;return(r[1]|0)*3600+(r[2]|0)*60+(r[3]|0)+t/o.frameRate}function g(s,o){var r=C.exec(s),t=Number(r[1]),T=r[2];switch(T){case"h":return t*3600;case"m":return t*60;case"ms":return t*1e3;case"f":return t/o.frameRate;case"t":return t/o.tickRate}return t}},"./src/utils/logger.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"enableLogs",function(){return O}),_.d(N,"logger",function(){return w});var k=function(){},b={trace:k,debug:k,log:k,warn:k,info:k,error:k},S=b;function j(c){var y=self.console[c];return y?y.bind(self.console,"["+c+"] >"):k}function M(c){for(var y=arguments.length,C=new Array(y>1?y-1:0),m=1;m<y;m++)C[m-1]=arguments[m];C.forEach(function(f){S[f]=c[f]?c[f].bind(c):j(f)})}function O(c){if(self.console&&c===!0||typeof c=="object"){M(c,"debug","log","info","warn","error");try{S.log()}catch(y){S=b}}else S=b}var w=S},"./src/utils/mediakeys-helper.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"KeySystems",function(){return k}),_.d(N,"requestMediaKeySystemAccess",function(){return b});var k;(function(S){S.WIDEVINE="com.widevine.alpha",S.PLAYREADY="com.microsoft.playready"})(k||(k={}));var b=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"getMediaSource",function(){return k});function k(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"bin2str",function(){return M}),_.d(N,"readUint16",function(){return O}),_.d(N,"readUint32",function(){return w}),_.d(N,"writeUint32",function(){return c}),_.d(N,"findBox",function(){return y}),_.d(N,"parseSegmentIndex",function(){return C}),_.d(N,"parseInitSegment",function(){return m}),_.d(N,"getStartDTS",function(){return f}),_.d(N,"getDuration",function(){return v}),_.d(N,"computeRawDurationFromSamples",function(){return a}),_.d(N,"offsetStartDTS",function(){return e}),_.d(N,"segmentValidRange",function(){return n}),_.d(N,"appendUint8Array",function(){return i});var k=_("./src/utils/typed-array.ts"),b=_("./src/loader/fragment.ts"),S=Math.pow(2,32)-1,j=[].push;function M(h){return String.fromCharCode.apply(null,h)}function O(h,d){"data"in h&&(d+=h.start,h=h.data);var u=h[d]<<8|h[d+1];return u<0?65536+u:u}function w(h,d){"data"in h&&(d+=h.start,h=h.data);var u=h[d]<<24|h[d+1]<<16|h[d+2]<<8|h[d+3];return u<0?4294967296+u:u}function c(h,d,u){"data"in h&&(d+=h.start,h=h.data),h[d]=u>>24,h[d+1]=u>>16&255,h[d+2]=u>>8&255,h[d+3]=u&255}function y(h,d){var u=[];if(!d.length)return u;var E,g,s;"data"in h?(E=h.data,g=h.start,s=h.end):(E=h,g=0,s=E.byteLength);for(var o=g;o<s;){var r=w(E,o),t=M(E.subarray(o+4,o+8)),T=r>1?o+r:s;if(t===d[0])if(d.length===1)u.push({data:E,start:o+8,end:T});else{var x=y({data:E,start:o+8,end:T},d.slice(1));x.length&&j.apply(u,x)}o=T}return u}function C(h){var d=y(h,["moov"]),u=d[0],E=u?u.end:null,g=y(h,["sidx"]);if(!g||!g[0])return null;var s=[],o=g[0],r=o.data[0],t=r===0?8:16,T=w(o,t);t+=4;var x=0,A=0;r===0?t+=8:t+=16,t+=2;var R=o.end+A,I=O(o,t);t+=2;for(var B=0;B<I;B++){var W=t,$=w(o,W);W+=4;var X=$&2147483647,V=($&2147483648)>>>31;if(V===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var se=w(o,W);W+=4,s.push({referenceSize:X,subsegmentDuration:se,info:{duration:se/T,start:R,end:R+X-1}}),R+=X,W+=4,t=W}return{earliestPresentationTime:x,timescale:T,version:r,referencesCount:I,references:s,moovEndOffset:E}}function m(h){for(var d=[],u=y(h,["moov","trak"]),E=0;E<u.length;E++){var g=u[E],s=y(g,["tkhd"])[0];if(s){var o=s.data[s.start],r=o===0?12:20,t=w(s,r),T=y(g,["mdia","mdhd"])[0];if(T){o=T.data[T.start],r=o===0?12:20;var x=w(T,r),A=y(g,["mdia","hdlr"])[0];if(A){var R=M(A.data.subarray(A.start+8,A.start+12)),I={soun:b.ElementaryStreamTypes.AUDIO,vide:b.ElementaryStreamTypes.VIDEO}[R];if(I){var B=y(g,["mdia","minf","stbl","stsd"])[0],W=void 0;B&&(W=M(B.data.subarray(B.start+12,B.start+16))),d[t]={timescale:x,type:I},d[I]={timescale:x,id:t,codec:W}}}}}}var $=y(h,["moov","mvex","trex"]);return $.forEach(function(X){var V=w(X,4),se=d[V];se&&(se.default={duration:w(X,12),flags:w(X,20)})}),d}function f(h,d){return y(d,["moof","traf"]).reduce(function(u,E){var g=y(E,["tfdt"])[0],s=g.data[g.start],o=y(E,["tfhd"]).reduce(function(r,t){var T=w(t,4),x=h[T];if(x){var A=w(g,4);s===1&&(A*=Math.pow(2,32),A+=w(g,8));var R=x.timescale||9e4,I=A/R;if(isFinite(I)&&(r===null||I<r))return I}return r},null);return o!==null&&isFinite(o)&&(u===null||o<u)?o:u},null)||0}function v(h,d){for(var u=0,E=0,g=0,s=y(h,["moof","traf"]),o=0;o<s.length;o++){var r=s[o],t=y(r,["tfhd"])[0],T=w(t,4),x=d[T];if(!x)continue;var A=x.default,R=w(t,0)|(A==null?void 0:A.flags),I=A==null?void 0:A.duration;R&8&&(R&2?I=w(t,12):I=w(t,8));for(var B=x.timescale||9e4,W=y(r,["trun"]),$=0;$<W.length;$++){if(I){var X=w(W[$],4);u=I*X}else u=a(W[$]);x.type===b.ElementaryStreamTypes.VIDEO?E+=u/B:x.type===b.ElementaryStreamTypes.AUDIO&&(g+=u/B)}}if(E===0&&g===0){var V=C(h);if(V!=null&&V.references)return V.references.reduce(function(se,xe){return se+xe.info.duration||0},0)}return E||g}function a(h){var d=w(h,0),u=8;d&1&&(u+=4),d&4&&(u+=4);for(var E=0,g=w(h,4),s=0;s<g;s++){if(d&256){var o=w(h,u);E+=o,u+=4}d&512&&(u+=4),d&1024&&(u+=4),d&2048&&(u+=4)}return E}function e(h,d,u){y(d,["moof","traf"]).forEach(function(E){y(E,["tfhd"]).forEach(function(g){var s=w(g,4),o=h[s];if(!o)return;var r=o.timescale||9e4;y(E,["tfdt"]).forEach(function(t){var T=t.data[t.start],x=w(t,4);if(T===0)c(t,4,x-u*r);else{x*=Math.pow(2,32),x+=w(t,8),x-=u*r,x=Math.max(x,0);var A=Math.floor(x/(S+1)),R=Math.floor(x%(S+1));c(t,4,A),c(t,8,R)}})})})}function n(h){var d={valid:null,remainder:null},u=y(h,["moof"]);if(u){if(u.length<2)return d.remainder=h,d}else return d;var E=u[u.length-1];return d.valid=Object(k.sliceUint8)(h,0,E.start-8),d.remainder=Object(k.sliceUint8)(h,E.start-8),d}function i(h,d){var u=new Uint8Array(h.length+d.length);return u.set(h),u.set(d,h.length),u}},"./src/utils/output-filter.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"default",function(){return k});var k=function(){function b(j,M){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=j,this.trackName=M}var S=b.prototype;return S.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},S.newCue=function(M,O,w){(this.startTime===null||this.startTime>M)&&(this.startTime=M),this.endTime=O,this.screen=w,this.timelineController.createCaptionsTrack(this.trackName)},S.reset=function(){this.cueRanges=[]},b}()},"./src/utils/texttrack-utils.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"sendAddTrackEvent",function(){return b}),_.d(N,"addCueToTrack",function(){return S}),_.d(N,"clearCurrentCues",function(){return j}),_.d(N,"removeCuesInRange",function(){return M}),_.d(N,"getCuesInRange",function(){return w});var k=_("./src/utils/logger.ts");function b(c,y){var C;try{C=new Event("addtrack")}catch(m){C=document.createEvent("Event"),C.initEvent("addtrack",!1,!1)}C.track=c,y.dispatchEvent(C)}function S(c,y){var C=c.mode;if(C==="disabled"&&(c.mode="hidden"),c.cues&&!c.cues.getCueById(y.id))try{if(c.addCue(y),!c.cues.getCueById(y.id))throw new Error("addCue is failed for: "+y)}catch(f){k.logger.debug("[texttrack-utils]: "+f);var m=new self.TextTrackCue(y.startTime,y.endTime,y.text);m.id=y.id,c.addCue(m)}C==="disabled"&&(c.mode=C)}function j(c){var y=c.mode;if(y==="disabled"&&(c.mode="hidden"),c.cues)for(var C=c.cues.length;C--;)c.removeCue(c.cues[C]);y==="disabled"&&(c.mode=y)}function M(c,y,C){var m=c.mode;if(m==="disabled"&&(c.mode="hidden"),c.cues&&c.cues.length>0)for(var f=w(c.cues,y,C),v=0;v<f.length;v++)c.removeCue(f[v]);m==="disabled"&&(c.mode=m)}function O(c,y){if(y<c[0].startTime)return 0;var C=c.length-1;if(y>c[C].endTime)return-1;for(var m=0,f=C;m<=f;){var v=Math.floor((f+m)/2);if(y<c[v].startTime)f=v-1;else if(y>c[v].startTime&&m<C)m=v+1;else return v}return c[m].startTime-y<y-c[f].startTime?m:f}function w(c,y,C){var m=[],f=O(c,y);if(f>-1)for(var v=f,a=c.length;v<a;v++){var e=c[v];if(e.startTime>=y&&e.endTime<=C)m.push(e);else if(e.startTime>C)return m}return m}},"./src/utils/time-ranges.ts":function(Z,N,_){"use strict";_.r(N);var k={toString:function(S){for(var j="",M=S.length,O=0;O<M;O++)j+="["+S.start(O).toFixed(3)+","+S.end(O).toFixed(3)+"]";return j}};N.default=k},"./src/utils/timescale-conversion.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"toTimescaleFromBase",function(){return b}),_.d(N,"toTimescaleFromScale",function(){return S}),_.d(N,"toMsFromMpegTsClock",function(){return j}),_.d(N,"toMpegTsClockFromTimescale",function(){return M});var k=9e4;function b(O,w,c,y){c===void 0&&(c=1),y===void 0&&(y=!1);var C=O*w*c;return y?Math.round(C):C}function S(O,w,c,y){return c===void 0&&(c=1),y===void 0&&(y=!1),b(O,w,1/c,y)}function j(O,w){return w===void 0&&(w=!1),b(O,1e3,1/k,w)}function M(O,w){return w===void 0&&(w=1),b(O,k,1/w)}},"./src/utils/typed-array.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"sliceUint8",function(){return k});function k(b,S,j){return Uint8Array.prototype.slice?b.slice(S,j):new Uint8Array(Array.prototype.slice.call(b,S,j))}},"./src/utils/vttcue.ts":function(Z,N,_){"use strict";_.r(N),N.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var k=["","lr","rl"],b=["start","middle","end","left","right"];function S(c,y){if(typeof y!="string")return!1;if(!Array.isArray(c))return!1;var C=y.toLowerCase();return~c.indexOf(C)?C:!1}function j(c){return S(k,c)}function M(c){return S(b,c)}function O(c){for(var y=arguments.length,C=new Array(y>1?y-1:0),m=1;m<y;m++)C[m-1]=arguments[m];for(var f=1;f<arguments.length;f++){var v=arguments[f];for(var a in v)c[a]=v[a]}return c}function w(c,y,C){var m=this,f={enumerable:!0};m.hasBeenReset=!1;var v="",a=!1,e=c,n=y,i=C,h=null,d="",u=!0,E="auto",g="start",s=50,o="middle",r=50,t="middle";Object.defineProperty(m,"id",O({},f,{get:function(){return v},set:function(x){v=""+x}})),Object.defineProperty(m,"pauseOnExit",O({},f,{get:function(){return a},set:function(x){a=!!x}})),Object.defineProperty(m,"startTime",O({},f,{get:function(){return e},set:function(x){if(typeof x!="number")throw new TypeError("Start time must be set to a number.");e=x,this.hasBeenReset=!0}})),Object.defineProperty(m,"endTime",O({},f,{get:function(){return n},set:function(x){if(typeof x!="number")throw new TypeError("End time must be set to a number.");n=x,this.hasBeenReset=!0}})),Object.defineProperty(m,"text",O({},f,{get:function(){return i},set:function(x){i=""+x,this.hasBeenReset=!0}})),Object.defineProperty(m,"region",O({},f,{get:function(){return h},set:function(x){h=x,this.hasBeenReset=!0}})),Object.defineProperty(m,"vertical",O({},f,{get:function(){return d},set:function(x){var A=j(x);if(A===!1)throw new SyntaxError("An invalid or illegal string was specified.");d=A,this.hasBeenReset=!0}})),Object.defineProperty(m,"snapToLines",O({},f,{get:function(){return u},set:function(x){u=!!x,this.hasBeenReset=!0}})),Object.defineProperty(m,"line",O({},f,{get:function(){return E},set:function(x){if(typeof x!="number"&&x!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");E=x,this.hasBeenReset=!0}})),Object.defineProperty(m,"lineAlign",O({},f,{get:function(){return g},set:function(x){var A=M(x);if(!A)throw new SyntaxError("An invalid or illegal string was specified.");g=A,this.hasBeenReset=!0}})),Object.defineProperty(m,"position",O({},f,{get:function(){return s},set:function(x){if(x<0||x>100)throw new Error("Position must be between 0 and 100.");s=x,this.hasBeenReset=!0}})),Object.defineProperty(m,"positionAlign",O({},f,{get:function(){return o},set:function(x){var A=M(x);if(!A)throw new SyntaxError("An invalid or illegal string was specified.");o=A,this.hasBeenReset=!0}})),Object.defineProperty(m,"size",O({},f,{get:function(){return r},set:function(x){if(x<0||x>100)throw new Error("Size must be between 0 and 100.");r=x,this.hasBeenReset=!0}})),Object.defineProperty(m,"align",O({},f,{get:function(){return t},set:function(x){var A=M(x);if(!A)throw new SyntaxError("An invalid or illegal string was specified.");t=A,this.hasBeenReset=!0}})),m.displayState=void 0}return w.prototype.getCueAsHTML=function(){var c=self.WebVTT;return c.convertCueToDOMTree(self,this.text)},w}()},"./src/utils/vttparser.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"parseTimeStamp",function(){return S}),_.d(N,"fixLineBreaks",function(){return y}),_.d(N,"VTTParser",function(){return C});var k=_("./src/utils/vttcue.ts"),b=function(){function m(){}var f=m.prototype;return f.decode=function(a,e){if(!a)return"";if(typeof a!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(a))},m}();function S(m){function f(a,e,n,i){return(a|0)*3600+(e|0)*60+(n|0)+parseFloat(i||0)}var v=m.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return v?parseFloat(v[2])>59?f(v[2],v[3],0,v[4]):f(v[1],v[2],v[3],v[4]):null}var j=function(){function m(){this.values=Object.create(null)}var f=m.prototype;return f.set=function(a,e){!this.get(a)&&e!==""&&(this.values[a]=e)},f.get=function(a,e,n){return n?this.has(a)?this.values[a]:e[n]:this.has(a)?this.values[a]:e},f.has=function(a){return a in this.values},f.alt=function(a,e,n){for(var i=0;i<n.length;++i)if(e===n[i]){this.set(a,e);break}},f.integer=function(a,e){/^-?\d+$/.test(e)&&this.set(a,parseInt(e,10))},f.percent=function(a,e){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(e)){var n=parseFloat(e);if(n>=0&&n<=100)return this.set(a,n),!0}return!1},m}();function M(m,f,v,a){var e=a?m.split(a):[m];for(var n in e){if(typeof e[n]!="string")continue;var i=e[n].split(v);if(i.length!==2)continue;var h=i[0],d=i[1];f(h,d)}}var O=new k.default(0,0,""),w=O.align==="middle"?"middle":"center";function c(m,f,v){var a=m;function e(){var h=S(m);if(h===null)throw new Error("Malformed timestamp: "+a);return m=m.replace(/^[^\sa-zA-Z-]+/,""),h}function n(h,d){var u=new j;M(h,function(s,o){var r;switch(s){case"region":for(var t=v.length-1;t>=0;t--)if(v[t].id===o){u.set(s,v[t].region);break}break;case"vertical":u.alt(s,o,["rl","lr"]);break;case"line":r=o.split(","),u.integer(s,r[0]),u.percent(s,r[0])&&u.set("snapToLines",!1),u.alt(s,r[0],["auto"]),r.length===2&&u.alt("lineAlign",r[1],["start",w,"end"]);break;case"position":r=o.split(","),u.percent(s,r[0]),r.length===2&&u.alt("positionAlign",r[1],["start",w,"end","line-left","line-right","auto"]);break;case"size":u.percent(s,o);break;case"align":u.alt(s,o,["start",w,"end","left","right"]);break}},/:/,/\s/),d.region=u.get("region",null),d.vertical=u.get("vertical","");var E=u.get("line","auto");E==="auto"&&O.line===-1&&(E=-1),d.line=E,d.lineAlign=u.get("lineAlign","start"),d.snapToLines=u.get("snapToLines",!0),d.size=u.get("size",100),d.align=u.get("align",w);var g=u.get("position","auto");g==="auto"&&O.position===50&&(g=d.align==="start"||d.align==="left"?0:d.align==="end"||d.align==="right"?100:50),d.position=g}function i(){m=m.replace(/^\s+/,"")}if(i(),f.startTime=e(),i(),m.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+a);m=m.substr(3),i(),f.endTime=e(),i(),n(m,f)}function y(m){return m.replace(/<br(?: \/)?>/gi,`
`)}var C=function(){function m(){this.state="INITIAL",this.buffer="",this.decoder=new b,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var f=m.prototype;return f.parse=function(a){var e=this;a&&(e.buffer+=e.decoder.decode(a,{stream:!0}));function n(){var g=e.buffer,s=0;for(g=y(g);s<g.length&&g[s]!=="\r"&&g[s]!==`
`;)++s;var o=g.substr(0,s);return g[s]==="\r"&&++s,g[s]===`
`&&++s,e.buffer=g.substr(s),o}function i(g){M(g,function(s,o){},/:/)}try{var h="";if(e.state==="INITIAL"){if(!/\r\n|\n/.test(e.buffer))return this;h=n();var d=h.match(/^()?WEBVTT([ \t].*)?$/);if(!d||!d[0])throw new Error("Malformed WebVTT signature.");e.state="HEADER"}for(var u=!1;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;u?u=!1:h=n();switch(e.state){case"HEADER":/:/.test(h)?i(h):h||(e.state="ID");continue;case"NOTE":h||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(h)){e.state="NOTE";break}if(!h)continue;if(e.cue=new k.default(0,0,""),e.state="CUE",h.indexOf("-->")===-1){e.cue.id=h;continue}case"CUE":if(!e.cue){e.state="BADCUE";continue}try{c(h,e.cue,e.regionList)}catch(g){e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":{var E=h.indexOf("-->")!==-1;if(!h||E&&(u=!0)){e.oncue&&e.cue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}if(e.cue===null)continue;e.cue.text&&(e.cue.text+=`
`),e.cue.text+=h}continue;case"BADCUE":h||(e.state="ID")}}}catch(g){e.state==="CUETEXT"&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state=e.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},f.flush=function(){var a=this;try{if((a.cue||a.state==="HEADER")&&(a.buffer+=`
`,a.parse()),a.state==="INITIAL"||a.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(e){a.onparsingerror&&a.onparsingerror(e)}return a.onflush&&a.onflush(),this},m}()},"./src/utils/webvtt-parser.ts":function(Z,N,_){"use strict";_.r(N),_.d(N,"generateCueId",function(){return C}),_.d(N,"parseWebVTT",function(){return f});var k=_("./src/polyfills/number.ts"),b=_("./src/utils/vttparser.ts"),S=_("./src/demux/id3.ts"),j=_("./src/utils/timescale-conversion.ts"),M=_("./src/remux/mp4-remuxer.ts"),O=/\r\n|\n\r|\n|\r/g,w=function(a,e,n){return n===void 0&&(n=0),a.substr(n,e.length)===e},c=function(a){var e=parseInt(a.substr(-3)),n=parseInt(a.substr(-6,2)),i=parseInt(a.substr(-9,2)),h=a.length>9?parseInt(a.substr(0,a.indexOf(":"))):0;if(!Object(k.isFiniteNumber)(e)||!Object(k.isFiniteNumber)(n)||!Object(k.isFiniteNumber)(i)||!Object(k.isFiniteNumber)(h))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+a);return e+=1e3*n,e+=60*1e3*i,e+=60*60*1e3*h,e},y=function(a){for(var e=5381,n=a.length;n;)e=e*33^a.charCodeAt(--n);return(e>>>0).toString()};function C(v,a,e){return y(v.toString())+y(a.toString())+y(e)}var m=function(a,e,n){var i=a[e],h=a[i.prevCC];if(!h||!h.new&&i.new){a.ccOffset=a.presentationOffset=i.start,i.new=!1;return}for(;(d=h)!==null&&d!==void 0&&d.new;){var d;a.ccOffset+=i.start-h.start,i.new=!1,i=h,h=a[i.prevCC]}a.presentationOffset=n};function f(v,a,e,n,i,h,d,u){var E=new b.VTTParser,g=Object(S.utf8ArrayToStr)(new Uint8Array(v)).trim().replace(O,`
`).split(`
`),s=[],o=Object(j.toMpegTsClockFromTimescale)(a,e),r="00:00.000",t=0,T=0,x,A=!0,R=!1;E.oncue=function(I){var B=n[i],W=n.ccOffset,$=(t-o)/9e4;if(B!=null&&B.new&&(T!==void 0?W=n.ccOffset=B.start:m(n,i,$)),$&&(W=$-n.presentationOffset),R){var X=I.endTime-I.startTime,V=Object(M.normalizePts)((I.startTime+W-T)*9e4,h*9e4)/9e4;I.startTime=V,I.endTime=V+X}var se=I.text.trim();I.text=decodeURIComponent(encodeURIComponent(se)),I.id||(I.id=C(I.startTime,I.endTime,se)),I.endTime>0&&s.push(I)},E.onparsingerror=function(I){x=I},E.onflush=function(){if(x){u(x);return}d(s)},g.forEach(function(I){if(A)if(w(I,"X-TIMESTAMP-MAP=")){A=!1,R=!0,I.substr(16).split(",").forEach(function(B){w(B,"LOCAL:")?r=B.substr(6):w(B,"MPEGTS:")&&(t=parseInt(B.substr(7)))});try{T=c(r)/1e3}catch(B){R=!1,x=B}return}else I===""&&(A=!1);E.parse(I+`
`)}),E.flush()}},"./src/utils/xhr-loader.ts":function(Z,N,_){"use strict";_.r(N);var k=_("./src/utils/logger.ts"),b=_("./src/loader/load-stats.ts"),S=/^age:\s*[\d.]+\s*$/m,j=function(){function M(w){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=w?w.xhrSetup:null,this.stats=new b.LoadStats,this.retryDelay=0}var O=M.prototype;return O.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},O.abortInternal=function(){var c=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),c&&(c.onreadystatechange=null,c.onprogress=null,c.readyState!==4&&(this.stats.aborted=!0,c.abort()))},O.abort=function(){var c;this.abortInternal(),(c=this.callbacks)!==null&&c!==void 0&&c.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},O.load=function(c,y,C){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=c,this.config=y,this.callbacks=C,this.retryDelay=y.retryDelay,this.loadInternal()},O.loadInternal=function(){var c=this.config,y=this.context;if(!c)return;var C=this.loader=new self.XMLHttpRequest,m=this.stats;m.loading.first=0,m.loaded=0;var f=this.xhrSetup;try{if(f)try{f(C,y.url)}catch(e){C.open("GET",y.url,!0),f(C,y.url)}C.readyState||C.open("GET",y.url,!0);var v=this.context.headers;if(v)for(var a in v)C.setRequestHeader(a,v[a])}catch(e){this.callbacks.onError({code:C.status,text:e.message},y,C);return}y.rangeEnd&&C.setRequestHeader("Range","bytes="+y.rangeStart+"-"+(y.rangeEnd-1)),C.onreadystatechange=this.readystatechange.bind(this),C.onprogress=this.loadprogress.bind(this),C.responseType=y.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),c.timeout),C.send()},O.readystatechange=function(){var c=this.context,y=this.loader,C=this.stats;if(!c||!y)return;var m=y.readyState,f=this.config;if(C.aborted)return;if(m>=2)if(self.clearTimeout(this.requestTimeout),C.loading.first===0&&(C.loading.first=Math.max(self.performance.now(),C.loading.start)),m===4){y.onreadystatechange=null,y.onprogress=null;var v=y.status;if(v>=200&&v<300){C.loading.end=Math.max(self.performance.now(),C.loading.first);var a,e;if(c.responseType==="arraybuffer"?(a=y.response,e=a.byteLength):(a=y.responseText,e=a.length),C.loaded=C.total=e,!this.callbacks)return;var n=this.callbacks.onProgress;if(n&&n(C,c,a,y),!this.callbacks)return;var i={url:y.responseURL,data:a};this.callbacks.onSuccess(i,C,c,y)}else C.retry>=f.maxRetry||v>=400&&v<499?(k.logger.error(v+" while loading "+c.url),this.callbacks.onError({code:v,text:y.statusText},c,y)):(k.logger.warn(v+" while loading "+c.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,f.maxRetryDelay),C.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),f.timeout)},O.loadtimeout=function(){k.logger.warn("timeout while loading "+this.context.url);var c=this.callbacks;c&&(this.abortInternal(),c.onTimeout(this.stats,this.context,this.loader))},O.loadprogress=function(c){var y=this.stats;y.loaded=c.loaded,c.lengthComputable&&(y.total=c.total)},O.getCacheAge=function(){var c=null;if(this.loader&&S.test(this.loader.getAllResponseHeaders())){var y=this.loader.getResponseHeader("age");c=y?parseFloat(y):null}return c},M}();N.default=j}}).default})},vHTk:function(ot,fe,U){ot.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(ot,fe,U){"use strict";U.d(fe,"a",function(){return st});var Z=U("rePB"),N=U("VTBJ"),_=U("KQm4"),k=U("U8pU"),b=U("ODXe"),S=U("q1tI"),j=U("TSYQ"),M=U.n(j),O=U("Gytx"),w=U.n(O),c=U("Kwbf"),y=U("t23M"),C=U("qx4F"),m=U("6eGT"),f=U("IBYe"),v=U("Ff2n"),a=U("c+Xe"),e=U("fyJ8"),n=U("biw7");function i(me,Ce,_e,Fe,Se){var Me=_e[me]||{},ue=_e[Ce]||{},te,re;Me.fixed==="left"?te=Fe.left[me]:ue.fixed==="right"&&(re=Fe.right[Ce]);var z=!1,G=!1,J=!1,ne=!1,ve=_e[Ce+1],we=_e[me-1];if(Se==="rtl"){if(te!==void 0){var ze=we&&we.fixed==="left";ne=!ze}else if(re!==void 0){var nt=ve&&ve.fixed==="right";J=!nt}}else if(te!==void 0){var ft=ve&&ve.fixed==="left";z=!ft}else if(re!==void 0){var tt=we&&we.fixed==="right";G=!tt}return{fixLeft:te,fixRight:re,lastFixLeft:z,firstFixRight:G,lastFixRight:J,firstFixLeft:ne,isSticky:Fe.isSticky}}var h=U("sR1s");function d(me){var Ce=me.cells,_e=me.stickyOffsets,Fe=me.flattenColumns,Se=me.rowComponent,Me=me.cellComponent,ue=me.onHeaderRow,te=me.index,re=S.useContext(n.a),z=re.prefixCls,G=re.direction,J;ue&&(J=ue(Ce.map(function(ve){return ve.column}),te));var ne=Object(h.a)(Ce.map(function(ve){return ve.column}));return S.createElement(Se,Object.assign({},J),Ce.map(function(ve,we){var ze=ve.column,nt=i(ve.colStart,ve.colEnd,Fe,_e,G),ft;return ze&&ze.onHeaderCell&&(ft=ve.column.onHeaderCell(ze)),S.createElement(e.a,Object.assign({},ve,{ellipsis:ze.ellipsis,align:ze.align,component:Me,prefixCls:z,key:ne[we]},nt,{additionalProps:ft,rowType:"header"}))}))}d.displayName="HeaderRow";var u=d;function E(me){var Ce=[];function _e(ue,te){var re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Ce[re]=Ce[re]||[];var z=te,G=ue.filter(Boolean).map(function(J){var ne={key:J.key,className:J.className||"",children:J.title,column:J,colStart:z},ve=1,we=J.children;return we&&we.length>0&&(ve=_e(we,z,re+1).reduce(function(ze,nt){return ze+nt},0),ne.hasSubColumns=!0),"colSpan"in J&&(ve=J.colSpan),"rowSpan"in J&&(ne.rowSpan=J.rowSpan),ne.colSpan=ve,ne.colEnd=ne.colStart+ve-1,Ce[re].push(ne),z+=ve,ve});return G}_e(me,0);for(var Fe=Ce.length,Se=function(te){Ce[te].forEach(function(re){!("rowSpan"in re)&&!re.hasSubColumns&&(re.rowSpan=Fe-te)})},Me=0;Me<Fe;Me+=1)Se(Me);return Ce}function g(me){var Ce=me.stickyOffsets,_e=me.columns,Fe=me.flattenColumns,Se=me.onHeaderRow,Me=S.useContext(n.a),ue=Me.prefixCls,te=Me.getComponent,re=S.useMemo(function(){return E(_e)},[_e]),z=te(["header","wrapper"],"thead"),G=te(["header","row"],"tr"),J=te(["header","cell"],"th");return S.createElement(z,{className:"".concat(ue,"-thead")},re.map(function(ne,ve){var we=S.createElement(u,{key:ve,flattenColumns:Fe,cells:ne,stickyOffsets:Ce,rowComponent:G,cellComponent:J,onHeaderRow:Se,index:ve});return we}))}var s=g,o=U("hW8S");function r(me){for(var Ce=me.colWidths,_e=me.columns,Fe=me.columCount,Se=[],Me=Fe||_e.length,ue=!1,te=Me-1;te>=0;te-=1){var re=Ce[te],z=_e&&_e[te],G=z&&z[o.a];(re||G||ue)&&(Se.unshift(S.createElement("col",Object.assign({key:te,style:{width:re,minWidth:re}},G))),ue=!0)}return S.createElement("colgroup",null,Se)}var t=r;function T(me,Ce){return Object(S.useMemo)(function(){for(var _e=[],Fe=0;Fe<Ce;Fe+=1){var Se=me[Fe];if(Se!==void 0)_e[Fe]=Se;else return null}return _e},[me.join("_"),Ce])}var x=S.forwardRef(function(me,Ce){var _e=me.noData,Fe=me.columns,Se=me.flattenColumns,Me=me.colWidths,ue=me.columCount,te=me.stickyOffsets,re=me.direction,z=me.fixHeader,G=me.offsetHeader,J=me.stickyClassName,ne=me.onScroll,ve=Object(v.a)(me,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),we=S.useContext(n.a),ze=we.prefixCls,nt=we.scrollbarSize,ft=we.isSticky,tt=ft&&!z?0:nt,Ct=S.useRef(null),_t=S.useCallback(function(Bt){Object(a.b)(Ce,Bt),Object(a.b)(Ct,Bt)},[]);S.useEffect(function(){var Bt;function Nt(qe){var pt=qe.currentTarget,lt=qe.deltaX;lt&&(ne({currentTarget:pt,scrollLeft:pt.scrollLeft+lt}),qe.preventDefault())}return(Bt=Ct.current)===null||Bt===void 0||Bt.addEventListener("wheel",Nt),function(){var qe;(qe=Ct.current)===null||qe===void 0||qe.removeEventListener("wheel",Nt)}},[]);var dt=Se[Se.length-1],kt={fixed:dt?dt.fixed:null,onHeaderCell:function(){return{className:"".concat(ze,"-cell-scrollbar")}}},It=Object(S.useMemo)(function(){return tt?[].concat(Object(_.a)(Fe),[kt]):Fe},[tt,Fe]),Dt=Object(S.useMemo)(function(){return tt?[].concat(Object(_.a)(Se),[kt]):Se},[tt,Se]),zt=Object(S.useMemo)(function(){var Bt=te.right,Nt=te.left;return Object(N.a)(Object(N.a)({},te),{},{left:re==="rtl"?[].concat(Object(_.a)(Nt.map(function(qe){return qe+tt})),[0]):Nt,right:re==="rtl"?Bt:[].concat(Object(_.a)(Bt.map(function(qe){return qe+tt})),[0]),isSticky:ft})},[tt,te,ft]),xt=T(Me,ue);return S.createElement("div",{style:Object(N.a)({overflow:"hidden"},ft?{top:G}:{}),ref:_t,className:M()("".concat(ze,"-header"),Object(Z.a)({},J,!!J))},S.createElement("table",{style:{tableLayout:"fixed",visibility:_e||xt?null:"hidden"}},S.createElement(t,{colWidths:xt?[].concat(Object(_.a)(xt),[tt]):[],columCount:ue+1,columns:Dt}),S.createElement(s,Object.assign({},ve,{stickyOffsets:zt,columns:It,flattenColumns:Dt}))))});x.displayName="FixedHeader";var A=x,R=S.createContext(null),I=R;function B(me){var Ce=me.prefixCls,_e=me.children,Fe=me.component,Se=me.cellComponent,Me=me.fixHeader,ue=me.fixColumn,te=me.horizonScroll,re=me.className,z=me.expanded,G=me.componentWidth,J=me.colSpan,ne=S.useContext(n.a),ve=ne.scrollbarSize;return S.useMemo(function(){var we=_e;return ue&&(we=S.createElement("div",{style:{width:G-(Me?ve:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Ce,"-expanded-row-fixed")},we)),S.createElement(Fe,{className:re,style:{display:z?null:"none"}},S.createElement(e.a,{component:Se,prefixCls:Ce,colSpan:J},we))},[_e,Fe,Me,te,re,z,G,J,ve])}var W=B;function $(me){var Ce=me.className,_e=me.style,Fe=me.record,Se=me.index,Me=me.rowKey,ue=me.getRowKey,te=me.rowExpandable,re=me.expandedKeys,z=me.onRow,G=me.indent,J=G===void 0?0:G,ne=me.rowComponent,ve=me.cellComponent,we=me.childrenColumnName,ze=S.useContext(n.a),nt=ze.prefixCls,ft=ze.fixedInfoList,tt=S.useContext(I),Ct=tt.fixHeader,_t=tt.fixColumn,dt=tt.horizonScroll,kt=tt.componentWidth,It=tt.flattenColumns,Dt=tt.expandableType,zt=tt.expandRowByClick,xt=tt.onTriggerExpand,Bt=tt.rowClassName,Nt=tt.expandedRowClassName,qe=tt.indentSize,pt=tt.expandIcon,lt=tt.expandedRowRender,vt=tt.expandIconColumnIndex,Lt=S.useState(!1),fr=Object(b.a)(Lt,2),ar=fr[0],dr=fr[1],yr=re&&re.has(me.recordKey);S.useEffect(function(){yr&&dr(!0)},[yr]);var Mr=Dt==="row"&&(!te||te(Fe)),Nr=Dt==="nest",Hr=we&&Fe&&Fe[we],Or=Mr||Nr,_r;z&&(_r=z(Fe,Se));var Xr=function(l){if(zt&&Or&&xt(Fe,l),_r&&_r.onClick){for(var p,D=arguments.length,F=new Array(D>1?D-1:0),P=1;P<D;P++)F[P-1]=arguments[P];(p=_r).onClick.apply(p,[l].concat(F))}},Ur;typeof Bt=="string"?Ur=Bt:typeof Bt=="function"&&(Ur=Bt(Fe,Se,J));var gt=Object(h.a)(It),Gt=S.createElement(ne,Object.assign({},_r,{"data-row-key":Me,className:M()(Ce,"".concat(nt,"-row"),"".concat(nt,"-row-level-").concat(J),Ur,_r&&_r.className),style:Object(N.a)(Object(N.a)({},_e),_r?_r.style:null),onClick:Xr}),It.map(function(L,l){var p=L.render,D=L.dataIndex,F=L.className,P=gt[l],de=ft[l],We;l===(vt||0)&&Nr&&(We=S.createElement(S.Fragment,null,S.createElement("span",{style:{paddingLeft:"".concat(qe*J,"px")},className:"".concat(nt,"-row-indent indent-level-").concat(J)}),pt({prefixCls:nt,expanded:yr,expandable:Hr,record:Fe,onExpand:xt})));var at;return L.onCell&&(at=L.onCell(Fe,Se)),S.createElement(e.a,Object.assign({className:F,ellipsis:L.ellipsis,align:L.align,component:ve,prefixCls:nt,key:P,record:Fe,index:Se,dataIndex:D,render:p,shouldCellUpdate:L.shouldCellUpdate},de,{appendNode:We,additionalProps:at}))})),Pt;if(Mr&&(ar||yr)){var Vt=lt(Fe,Se,J+1,yr),Yt=Nt&&Nt(Fe,Se,J);Pt=S.createElement(W,{expanded:yr,className:M()("".concat(nt,"-expanded-row"),"".concat(nt,"-expanded-row-level-").concat(J+1),Yt),prefixCls:nt,fixHeader:Ct,fixColumn:_t,horizonScroll:dt,component:ne,componentWidth:kt,cellComponent:ve,colSpan:It.length},Vt)}var rr;return Hr&&yr&&(rr=(Fe[we]||[]).map(function(L,l){var p=ue(L,l);return S.createElement($,Object.assign({},me,{key:p,rowKey:p,record:L,recordKey:p,index:l,indent:J+1}))})),S.createElement(S.Fragment,null,Gt,Pt,rr)}$.displayName="BodyRow";var X=$,V=S.createContext(null),se=V;function xe(me){var Ce=me.columnKey,_e=me.onColumnResize,Fe=S.useRef();return S.useEffect(function(){Fe.current&&_e(Ce,Fe.current.offsetWidth)},[]),S.createElement(y.a,{onResize:function(Me){var ue=Me.offsetWidth;_e(Ce,ue)}},S.createElement("td",{ref:Fe,style:{padding:0,border:0,height:0}},S.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function Ee(me){var Ce=me.data,_e=me.getRowKey,Fe=me.measureColumnWidth,Se=me.expandedKeys,Me=me.onRow,ue=me.rowExpandable,te=me.emptyNode,re=me.childrenColumnName,z=S.useContext(se),G=z.onColumnResize,J=S.useContext(n.a),ne=J.prefixCls,ve=J.getComponent,we=S.useContext(I),ze=we.fixHeader,nt=we.horizonScroll,ft=we.flattenColumns,tt=we.componentWidth;return S.useMemo(function(){var Ct=ve(["body","wrapper"],"tbody"),_t=ve(["body","row"],"tr"),dt=ve(["body","cell"],"td"),kt;Ce.length?kt=Ce.map(function(Dt,zt){var xt=_e(Dt,zt);return S.createElement(X,{key:xt,rowKey:xt,record:Dt,recordKey:xt,index:zt,rowComponent:_t,cellComponent:dt,expandedKeys:Se,onRow:Me,getRowKey:_e,rowExpandable:ue,childrenColumnName:re})}):kt=S.createElement(W,{expanded:!0,className:"".concat(ne,"-placeholder"),prefixCls:ne,fixHeader:ze,fixColumn:nt,horizonScroll:nt,component:_t,componentWidth:tt,cellComponent:dt,colSpan:ft.length},te);var It=Object(h.a)(ft);return S.createElement(Ct,{className:"".concat(ne,"-tbody")},Fe&&S.createElement("tr",{"aria-hidden":"true",className:"".concat(ne,"-measure-row"),style:{height:0}},It.map(function(Dt){return S.createElement(xe,{key:Dt,columnKey:Dt,onColumnResize:G})})),kt)},[Ce,ne,Me,Fe,Se,_e,ve,tt,te,ft])}var je=S.memo(Ee);je.displayName="Body";var Ae=je,Oe=U("wRmb"),Le=U("xEkU"),Pe=U.n(Le);function he(me){var Ce=Object(S.useRef)(me),_e=Object(S.useState)({}),Fe=Object(b.a)(_e,2),Se=Fe[1],Me=Object(S.useRef)(null),ue=Object(S.useRef)([]);function te(re){Me.current===null&&(ue.current=[],Me.current=Pe()(function(){ue.current.forEach(function(z){Ce.current=z(Ce.current)}),Me.current=null,Se({})})),ue.current.push(re)}return Object(S.useEffect)(function(){return function(){Pe.a.cancel(Me.current)}},[]),[Ce.current,te]}function Q(me){var Ce=Object(S.useRef)(me),_e=Object(S.useRef)(null);function Fe(){window.clearTimeout(_e.current)}function Se(ue){Ce.current=ue,Fe(),_e.current=window.setTimeout(function(){Ce.current=null,_e.current=null},100)}function Me(){return Ce.current}return Object(S.useEffect)(function(){return Fe},[]),[Se,Me]}function Ke(me,Ce,_e){var Fe=Object(S.useMemo)(function(){for(var Se=[],Me=[],ue=0,te=0,re=0;re<Ce;re+=1)if(_e==="rtl"){Me[re]=te,te+=me[re]||0;var z=Ce-re-1;Se[z]=ue,ue+=me[z]||0}else{Se[re]=ue,ue+=me[re]||0;var G=Ce-re-1;Me[G]=te,te+=me[G]||0}return{left:Se,right:Me}},[me,Ce,_e]);return Fe}var it=Ke;function Qe(me){var Ce=me.className,_e=me.children;return S.createElement("div",{className:Ce},_e)}var Xe=Qe,ee=U("n6Qo");function ie(me){var Ce,_e=me.prefixCls,Fe=me.record,Se=me.onExpand,Me=me.expanded,ue=me.expandable,te="".concat(_e,"-row-expand-icon");if(!ue)return S.createElement("span",{className:M()(te,"".concat(_e,"-row-spaced"))});var re=function(G){Se(Fe,G),G.stopPropagation()};return S.createElement("span",{className:M()(te,(Ce={},Object(Z.a)(Ce,"".concat(_e,"-row-expanded"),Me),Object(Z.a)(Ce,"".concat(_e,"-row-collapsed"),!Me),Ce)),onClick:re})}function be(me,Ce,_e){var Fe=[];function Se(Me){(Me||[]).forEach(function(ue,te){Fe.push(Ce(ue,te)),Se(ue[_e])})}return Se(me),Fe}var Re=U("zT1h"),Ue=U("y0+3"),Ie=function(Ce,_e){var Fe,Se,Me=Ce.scrollBodyRef,ue=Ce.onScroll,te=Ce.offsetScroll,re=S.useContext(n.a),z=re.prefixCls,G=((Fe=Me.current)===null||Fe===void 0?void 0:Fe.scrollWidth)||0,J=((Se=Me.current)===null||Se===void 0?void 0:Se.clientWidth)||0,ne=G&&J*(J/G),ve=S.useRef(),we=he({scrollLeft:0,isHiddenScrollBar:!1}),ze=Object(b.a)(we,2),nt=ze[0],ft=ze[1],tt=S.useRef({delta:0,x:0}),Ct=S.useState(!1),_t=Object(b.a)(Ct,2),dt=_t[0],kt=_t[1],It=function(){kt(!1)},Dt=function(qe){qe.persist(),tt.current.delta=qe.pageX-nt.scrollLeft,tt.current.x=0,kt(!0),qe.preventDefault()},zt=function(qe){var pt,lt=qe||((pt=window)===null||pt===void 0?void 0:pt.event),vt=lt.buttons;if(!dt||vt===0){dt&&kt(!1);return}var Lt=tt.current.x+qe.pageX-tt.current.x-tt.current.delta;Lt<=0&&(Lt=0),Lt+ne>=J&&(Lt=J-ne),ue({scrollLeft:Lt/J*(G+2)}),tt.current.x=qe.pageX},xt=function(){var qe=Object(Ue.b)(Me.current).top,pt=qe+Me.current.offsetHeight,lt=document.documentElement.scrollTop+window.innerHeight;pt-Object(C.a)()<=lt||qe>=lt-te?ft(function(vt){return Object(N.a)(Object(N.a)({},vt),{},{isHiddenScrollBar:!0})}):ft(function(vt){return Object(N.a)(Object(N.a)({},vt),{},{isHiddenScrollBar:!1})})},Bt=function(qe){ft(function(pt){return Object(N.a)(Object(N.a)({},pt),{},{scrollLeft:qe/G*J||0})})};return S.useImperativeHandle(_e,function(){return{setScrollLeft:Bt}}),S.useEffect(function(){var Nt=Object(Re.a)(document.body,"mouseup",It,!1),qe=Object(Re.a)(document.body,"mousemove",zt,!1);return xt(),function(){Nt.remove(),qe.remove()}},[ne,dt]),S.useEffect(function(){var Nt=Object(Re.a)(window,"scroll",xt,!1),qe=Object(Re.a)(window,"resize",xt,!1);return function(){Nt.remove(),qe.remove()}},[]),S.useEffect(function(){nt.isHiddenScrollBar||ft(function(Nt){var qe,pt;return Object(N.a)(Object(N.a)({},Nt),{},{scrollLeft:Me.current.scrollLeft/((qe=Me.current)===null||qe===void 0?void 0:qe.scrollWidth)*((pt=Me.current)===null||pt===void 0?void 0:pt.clientWidth)})})},[nt.isHiddenScrollBar]),G<=J||!ne||nt.isHiddenScrollBar?null:S.createElement("div",{style:{height:Object(C.a)(),width:J,bottom:te},className:"".concat(z,"-sticky-scroll")},S.createElement("div",{onMouseDown:Dt,ref:ve,className:M()("".concat(z,"-sticky-scroll-bar"),Object(Z.a)({},"".concat(z,"-sticky-scroll-bar-active"),dt)),style:{width:"".concat(ne,"px"),transform:"translate3d(".concat(nt.scrollLeft,"px, 0, 0)")}}))},He=S.forwardRef(Ie);function Ge(me,Ce){return S.useMemo(function(){var _e=!!me;return{isSticky:_e,stickyClassName:_e?"".concat(Ce,"-sticky-header"):"",offsetHeader:Object(k.a)(me)==="object"&&me.offsetHeader||0,offsetScroll:Object(k.a)(me)==="object"&&me.offsetScroll||0}},[me,Ce])}var ct=[],rt={},st="rc-table-internal-hook",Ze=S.memo(function(me){var Ce=me.children;return Ce},function(me,Ce){return w()(me.props,Ce.props)?me.pingLeft!==Ce.pingLeft||me.pingRight!==Ce.pingRight:!1});function mt(me){var Ce,_e=me.prefixCls,Fe=me.className,Se=me.rowClassName,Me=me.style,ue=me.data,te=me.rowKey,re=me.scroll,z=me.tableLayout,G=me.direction,J=me.title,ne=me.footer,ve=me.summary,we=me.id,ze=me.showHeader,nt=me.components,ft=me.emptyText,tt=me.onRow,Ct=me.onHeaderRow,_t=me.internalHooks,dt=me.transformColumns,kt=me.internalRefs,It=me.sticky,Dt=ue||ct,zt=!!Dt.length,xt=S.useState(0),Bt=Object(b.a)(xt,2),Nt=Bt[0],qe=Bt[1];S.useEffect(function(){qe(Object(C.a)())});var pt=S.useMemo(function(){return Object(h.c)(nt,{})},[nt]),lt=S.useCallback(function(De,Be){return Object(h.b)(pt,De)||Be},[pt]),vt=S.useMemo(function(){return typeof te=="function"?te:function(De){var Be=De&&De[te];return Be}},[te]),Lt=Object(o.c)(me),fr=Lt.expandIcon,ar=Lt.expandedRowKeys,dr=Lt.defaultExpandedRowKeys,yr=Lt.defaultExpandAllRows,Mr=Lt.expandedRowRender,Nr=Lt.onExpand,Hr=Lt.onExpandedRowsChange,Or=Lt.expandRowByClick,_r=Lt.rowExpandable,Xr=Lt.expandIconColumnIndex,Ur=Lt.expandedRowClassName,gt=Lt.childrenColumnName,Gt=Lt.indentSize,Pt=fr||ie,Vt=gt||"children",Yt=S.useMemo(function(){return Mr?"row":me.expandable&&_t===st&&me.expandable.__PARENT_RENDER_ICON__||Dt.some(function(De){return De&&Object(k.a)(De)==="object"&&De[Vt]})?"nest":!1},[!!Mr,Dt]),rr=S.useState(function(){return dr||(yr?be(Dt,vt,Vt):[])}),L=Object(b.a)(rr,2),l=L[0],p=L[1],D=S.useMemo(function(){return new Set(ar||l||[])},[ar,l]),F=S.useCallback(function(De){var Be=vt(De,Dt.indexOf(De)),et,bt=D.has(Be);bt?(D.delete(Be),et=Object(_.a)(D)):et=[].concat(Object(_.a)(D),[Be]),p(et),Nr&&Nr(!bt,De),Hr&&Hr(et)},[vt,D,Dt,Nr,Hr]),P=S.useState(0),de=Object(b.a)(P,2),We=de[0],at=de[1],yt=Object(Oe.b)(Object(N.a)(Object(N.a)(Object(N.a)({},me),Lt),{},{expandable:!!Mr,expandedKeys:D,getRowKey:vt,onTriggerExpand:F,expandIcon:Pt,expandIconColumnIndex:Xr,direction:G}),_t===st?dt:null),Ve=Object(b.a)(yt,2),St=Ve[0],At=Ve[1],nr=S.useMemo(function(){return{columns:St,flattenColumns:At}},[St,At]),ke=S.useRef(),Ar=S.useRef(),mr=S.useRef(),jr=S.useState(!1),Cn=Object(b.a)(jr,2),nn=Cn[0],zr=Cn[1],Zr=S.useState(!1),$r=Object(b.a)(Zr,2),an=$r[0],Tn=$r[1],hn=he(new Map),bn=Object(b.a)(hn,2),Mn=bn[0],on=bn[1],Rr=Object(h.a)(At),qr=Rr.map(function(De){return Mn.get(De)}),Sn=S.useMemo(function(){return qr},[qr.join("_")]),fn=it(Sn,At.length,G),sr=re&&Object(h.d)(re.y),Ft=re&&Object(h.d)(re.x),vr=Ft&&At.some(function(De){var Be=De.fixed;return Be}),Xt=S.useRef(),Tr=Ge(It,_e),or=Tr.isSticky,pn=Tr.offsetHeader,Sr=Tr.offsetScroll,En=Tr.stickyClassName,sn,mn,ln;sr&&(mn={overflowY:"scroll",maxHeight:re.y}),Ft&&(sn={overflowX:"auto"},sr||(mn={overflowY:"hidden"}),ln={width:re.x===!0?"auto":re.x,minWidth:"100%"});var Br=S.useCallback(function(De,Be){on(function(et){var bt=new Map(et);return bt.set(De,Be),bt})},[]),wn=Q(null),un=Object(b.a)(wn,2),Kn=un[0],Hn=un[1];function On(De,Be){if(!Be)return;typeof Be=="function"?Be(De):Be.scrollLeft!==De&&(Be.scrollLeft=De)}var vn=function(Be){var et=Be.currentTarget,bt=Be.scrollLeft,Tt=typeof bt=="number"?bt:et.scrollLeft,lr=et||rt;if(!Hn()||Hn()===lr){var Pr;Kn(lr),On(Tt,Ar.current),On(Tt,mr.current),On(Tt,(Pr=Xt.current)===null||Pr===void 0?void 0:Pr.setScrollLeft)}if(et){var Dr=et.scrollWidth,ir=et.clientWidth;zr(Tt>0),Tn(Tt<Dr-ir)}},In=function(){mr.current&&vn({currentTarget:mr.current})},Gr=function(Be){var et=Be.width;In(),at(ke.current?ke.current.offsetWidth:et)};S.useEffect(function(){return In},[]),S.useEffect(function(){Ft&&In()},[Ft]),S.useEffect(function(){_t===st&&kt&&(kt.body.current=mr.current)});var kn=lt(["table"],"table"),dn=S.useMemo(function(){return z||(vr?re.x==="max-content"?"auto":"fixed":sr||At.some(function(De){var Be=De.ellipsis;return Be})?"fixed":"auto")},[sr,vr,At,z]),Nn,_n={colWidths:Sn,columCount:At.length,stickyOffsets:fn,onHeaderRow:Ct,fixHeader:sr},gn=S.useMemo(function(){return zt?null:typeof ft=="function"?ft():ft},[zt,ft]),Vn=S.createElement(Ae,{data:Dt,measureColumnWidth:sr||Ft||or,expandedKeys:D,rowExpandable:_r,getRowKey:vt,onRow:tt,emptyNode:gn,childrenColumnName:Vt}),Un=S.createElement(t,{colWidths:At.map(function(De){var Be=De.width;return Be}),columns:At}),jn=ve&&S.createElement(ee.b,null,ve(Dt)),Yr=lt(["body"]);if(sr||or){var Bn;typeof Yr=="function"?(Bn=Yr(Dt,{scrollbarSize:Nt,ref:mr,onScroll:vn}),_n.colWidths=At.map(function(De,Be){var et=De.width,bt=Be===St.length-1?et-Nt:et;return typeof bt=="number"&&!Number.isNaN(bt)?bt:(Object(c.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):Bn=S.createElement("div",{style:Object(N.a)(Object(N.a)({},sn),mn),onScroll:vn,ref:mr,className:M()("".concat(_e,"-body"))},S.createElement(kn,{style:Object(N.a)(Object(N.a)({},ln),{},{tableLayout:dn})},Un,Vn,jn),or&&S.createElement(He,{ref:Xt,offsetScroll:Sr,scrollBodyRef:mr,onScroll:vn})),Nn=S.createElement(S.Fragment,null,ze!==!1&&S.createElement(A,Object.assign({noData:!Dt.length},_n,nr,{direction:G,offsetHeader:pn,stickyClassName:En,ref:Ar,onScroll:vn})),Bn)}else Nn=S.createElement("div",{style:Object(N.a)(Object(N.a)({},sn),mn),className:M()("".concat(_e,"-content")),onScroll:vn,ref:mr},S.createElement(kn,{style:Object(N.a)(Object(N.a)({},ln),{},{tableLayout:dn})},Un,ze!==!1&&S.createElement(s,Object.assign({},_n,nr)),Vn,jn));var Xn=Object(o.b)(me),An=S.createElement("div",Object.assign({className:M()(_e,Fe,(Ce={},Object(Z.a)(Ce,"".concat(_e,"-rtl"),G==="rtl"),Object(Z.a)(Ce,"".concat(_e,"-ping-left"),nn),Object(Z.a)(Ce,"".concat(_e,"-ping-right"),an),Object(Z.a)(Ce,"".concat(_e,"-layout-fixed"),z==="fixed"),Object(Z.a)(Ce,"".concat(_e,"-fixed-header"),sr),Object(Z.a)(Ce,"".concat(_e,"-fixed-column"),vr),Object(Z.a)(Ce,"".concat(_e,"-scroll-horizontal"),Ft),Object(Z.a)(Ce,"".concat(_e,"-has-fix-left"),At[0]&&At[0].fixed),Object(Z.a)(Ce,"".concat(_e,"-has-fix-right"),At[At.length-1]&&At[At.length-1].fixed==="right"),Ce)),style:Me,id:we,ref:ke},Xn),S.createElement(Ze,{pingLeft:nn,pingRight:an,props:Object(N.a)(Object(N.a)({},me),{},{stickyOffsets:fn,mergedExpandedKeys:D})},J&&S.createElement(Xe,{className:"".concat(_e,"-title")},J(Dt)),S.createElement("div",{className:"".concat(_e,"-container")},Nn),ne&&S.createElement(Xe,{className:"".concat(_e,"-footer")},ne(Dt))));Ft&&(An=S.createElement(y.a,{onResize:Gr},An));var $n=S.useMemo(function(){return{prefixCls:_e,getComponent:lt,scrollbarSize:Nt,direction:G,fixedInfoList:At.map(function(De,Be){return i(Be,Be,At,fn,G)}),isSticky:or}},[_e,lt,Nt,G,At,fn,G,or]),Yn=S.useMemo(function(){return Object(N.a)(Object(N.a)({},nr),{},{tableLayout:dn,rowClassName:Se,expandedRowClassName:Ur,componentWidth:We,fixHeader:sr,fixColumn:vr,horizonScroll:Ft,expandIcon:Pt,expandableType:Yt,expandRowByClick:Or,expandedRowRender:Mr,onTriggerExpand:F,expandIconColumnIndex:Xr,indentSize:Gt})},[nr,dn,Se,Ur,We,sr,vr,Ft,Pt,Yt,Or,Mr,F,Xr,Gt]),$e=S.useMemo(function(){return{onColumnResize:Br}},[Br]);return S.createElement(n.a.Provider,{value:$n},S.createElement(I.Provider,{value:Yn},S.createElement(se.Provider,{value:$e},An)))}mt.Column=f.a,mt.ColumnGroup=m.a,mt.Summary=ee.a,mt.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var ht=fe.b=mt},wRmb:function(ot,fe,U){"use strict";U.d(fe,"a",function(){return w});var Z=U("rePB"),N=U("KQm4"),_=U("VTBJ"),k=U("Ff2n"),b=U("q1tI"),S=U.n(b),j=U("Kwbf"),M=U("Zm9Q"),O=U("hW8S");function w(f){return Object(M.a)(f).filter(function(v){return b.isValidElement(v)}).map(function(v){var a=v.key,e=v.props,n=e.children,i=Object(k.a)(e,["children"]),h=Object(_.a)({key:a},i);return n&&(h.children=w(n)),h})}function c(f){return f.reduce(function(v,a){var e=a.fixed,n=e===!0?"left":e,i=a.children;return i&&i.length>0?[].concat(Object(N.a)(v),Object(N.a)(c(i).map(function(h){return Object(_.a)({fixed:n},h)}))):[].concat(Object(N.a)(v),[Object(_.a)(Object(_.a)({},a),{},{fixed:n})])},[])}function y(f){for(var v=!0,a=0;a<f.length;a+=1){var e=f[a];if(v&&e.fixed!=="left")v=!1;else if(!v&&e.fixed==="left"){Object(j.a)(!1,"Index ".concat(a-1," of `columns` missing `fixed='left'` prop."));break}}for(var n=!0,i=f.length-1;i>=0;i-=1){var h=f[i];if(n&&h.fixed!=="right")n=!1;else if(!n&&h.fixed==="right"){Object(j.a)(!1,"Index ".concat(i+1," of `columns` missing `fixed='right'` prop."));break}}}function C(f){return f.map(function(v){var a=v.fixed,e=Object(k.a)(v,["fixed"]),n=a;return a==="left"?n="right":a==="right"&&(n="left"),Object(_.a)({fixed:n},e)})}function m(f,v){var a=f.prefixCls,e=f.columns,n=f.children,i=f.expandable,h=f.expandedKeys,d=f.getRowKey,u=f.onTriggerExpand,E=f.expandIcon,g=f.rowExpandable,s=f.expandIconColumnIndex,o=f.direction,r=f.expandRowByClick,t=b.useMemo(function(){return e||w(n)},[e,n]),T=b.useMemo(function(){if(i){var R,I=s||0,B=t[I],W=(R={},Object(Z.a)(R,O.a,{className:"".concat(a,"-expand-icon-col")}),Object(Z.a)(R,"title",""),Object(Z.a)(R,"fixed",B?B.fixed:null),Object(Z.a)(R,"className","".concat(a,"-row-expand-icon-cell")),Object(Z.a)(R,"render",function(V,se,xe){var Ee=d(se,xe),je=h.has(Ee),Ae=g?g(se):!0,Oe=E({prefixCls:a,expanded:je,expandable:Ae,record:se,onExpand:u});return r?b.createElement("span",{onClick:function(Pe){return Pe.stopPropagation()}},Oe):Oe}),R),$=t.slice();return I>=0&&$.splice(I,0,W),$}return t},[i,t,d,h,E,o]),x=b.useMemo(function(){var R=T;return v&&(R=v(R)),R.length||(R=[{render:function(){return null}}]),R},[v,T,o]),A=b.useMemo(function(){return o==="rtl"?C(c(x)):c(x)},[x,o]);return[x,A]}fe.b=m},wwSX:function(ot,fe,U){ot.exports=U.p+"static/b2.2c844a2a.svg"},"y0+3":function(ot,fe,U){"use strict";U.d(fe,"a",function(){return c}),U.d(fe,"b",function(){return C});var Z=/margin|padding|width|height|max|min|offset/,N={left:!0,top:!0},_={cssFloat:1,styleFloat:1,float:1};function k(m){return m.nodeType===1?m.ownerDocument.defaultView.getComputedStyle(m,null):{}}function b(m,f,v){if(f=f.toLowerCase(),v==="auto"){if(f==="height")return m.offsetHeight;if(f==="width")return m.offsetWidth}return f in N||(N[f]=Z.test(f)),N[f]?parseFloat(v)||0:v}function S(m,f){var v=arguments.length,a=k(m);return f=_[f]?"cssFloat"in m.style?"cssFloat":"styleFloat":f,v===1?a:b(m,f,a[f]||m.style[f])}function j(m,f,v){var a=arguments.length;if(f=_[f]?"cssFloat"in m.style?"cssFloat":"styleFloat":f,a===3)return typeof v=="number"&&Z.test(f)&&(v="".concat(v,"px")),m.style[f]=v,v;for(var e in f)f.hasOwnProperty(e)&&j(m,e,f[e]);return k(m)}function M(m){return m===document.body?document.documentElement.clientWidth:m.offsetWidth}function O(m){return m===document.body?window.innerHeight||document.documentElement.clientHeight:m.offsetHeight}function w(){var m=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),f=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:m,height:f}}function c(){var m=document.documentElement.clientWidth,f=window.innerHeight||document.documentElement.clientHeight;return{width:m,height:f}}function y(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function C(m){var f=m.getBoundingClientRect(),v=document.documentElement;return{left:f.left+(window.pageXOffset||v.scrollLeft)-(v.clientLeft||document.body.clientLeft||0),top:f.top+(window.pageYOffset||v.scrollTop)-(v.clientTop||document.body.clientTop||0)}}},y3Jh:function(ot,fe,U){"use strict";U.r(fe);var Z=U("fV52"),N=U("3I+P"),_=U("g9YV"),k=U("wCAj"),b=U("Znn+"),S=U("ZTPi"),j=U("5NDa"),M=U("5rEg"),O=U("OaEy"),w=U("2fM7"),c=U("lUTK"),y=U("BvKs"),C=U("2qtc"),m=U("kLXV"),f=U("miYZ"),v=U("tsqr"),a=U("k1fw"),e=U("oBTY"),n=U("+L6B"),i=U("2/Rp"),h=U("qVdP"),d=U("jsC+"),u=U("9og8"),E=U("tJVT"),g=U("PpiC"),s=U("WmNS"),o=U.n(s),r=U("q1tI"),t=U.n(r),T=U("Ty5D"),x=U("9kvl"),A=U("9Bee"),R=U("wd/R"),I=U.n(R),B=U("m3rI"),W=U("ErOA"),$=U("5A5F"),X=U.n($),V=U("xKgJ"),se=U("zqRK"),xe=U.n(se),Ee=U("uf8j"),je=U.n(Ee),Ae=U("yR49"),Oe=U.n(Ae),Le=U("3SPk"),Pe=U.n(Le),he=U("eZjB"),Q=U.n(he),Ke=U("t6v1"),it=U.n(Ke),Qe=U("+92d"),Xe=U.n(Qe),ee=U("wwSX"),ie=U.n(ee),be=U("zlzj"),Re=U.n(be),Ue=U("+RDj"),Ie=U.n(Ue),He=U("LvDl"),Ge=U.n(He),ct=U("1vsH"),rt=U("yDOu"),st=U.n(rt),Ze=function(ht){var me,Ce,_e,Fe,Se,Me,ue,te,re,z,G,J,ne,ve,we,ze,nt,ft=ht.globalSetting,tt=ht.user,Ct=ht.dispatch,_t=Object(g.a)(ht,["globalSetting","user","dispatch"]),dt=Object(T.h)(),kt={page:1,per_page:30,tag_discipline_id:[-1],source_discipline_id:[-1],status:null,difficulty:null,search:"",save_search:"",sort_by:null,sort_direction:null,filter:(dt==null||((me=dt.query)===null||me===void 0)?void 0:me.tab)||"public"},It=Object(r.useState)(0),Dt=Object(E.a)(It,2),zt=Dt[0],xt=Dt[1],Bt=Object(r.useState)(0),Nt=Object(E.a)(Bt,2),qe=Nt[0],pt=Nt[1],lt=Object(r.useState)(0),vt=Object(E.a)(lt,2),Lt=vt[0],fr=vt[1],ar=Object(r.useState)([]),dr=Object(E.a)(ar,2),yr=dr[0],Mr=dr[1],Nr=Object(r.useState)([]),Hr=Object(E.a)(Nr,2),Or=Hr[0],_r=Hr[1],Xr=Object(r.useState)({}),Ur=Object(E.a)(Xr,2),gt=Ur[0],Gt=Ur[1],Pt=Object(r.useState)(!1),Vt=Object(E.a)(Pt,2),Yt=Vt[0],rr=Vt[1],L=Object(r.useState)([]),l=Object(E.a)(L,2),p=l[0],D=l[1],F=Object(r.useState)(!0),P=Object(E.a)(F,2),de=P[0],We=P[1],at=Object(r.useState)(null),yt=Object(E.a)(at,2),Ve=yt[0],St=yt[1],At=Object(r.useState)(kt),nr=Object(E.a)(At,2),ke=nr[0],Ar=nr[1],mr=Object(r.useRef)(null),jr=Object(r.useRef)(null),Cn=Object(r.useState)([]),nn=Object(E.a)(Cn,2),zr=nn[0],Zr=nn[1],$r=Object(r.useMemo)(function(){return["not_reviewed","under_review","review_finished"].includes(ke.filter)},[ke.filter]),an=Object(r.useState)(!1),Tn=Object(E.a)(an,2),hn=Tn[0],bn=Tn[1],Mn=Object(r.useState)(!1),on=Object(E.a)(Mn,2),Rr=on[0],qr=on[1],Sn=Object(r.useState)(""),fn=Object(E.a)(Sn,2),sr=fn[0],Ft=fn[1],vr=Object(r.useState)([]),Xt=Object(E.a)(vr,2),Tr=Xt[0],or=Xt[1],pn=Object(r.useState)(!1),Sr=Object(E.a)(pn,2),En=Sr[0],sn=Sr[1],mn=Object(r.useState)([]),ln=Object(E.a)(mn,2),Br=ln[0],wn=ln[1],un=function(){var $e=Object(u.a)(o.a.mark(function De(Be,et,bt){var Tt,lr,Pr,Dr,ir;return o.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:return Be.persist(),Be!=null&&(Tt=Be.target)!==null&&Tt!==void 0&&(lr=Tt.style)!==null&&lr!==void 0&&lr.pointerEvents&&(Be.target.style.pointerEvents="none"),cn.next=4,Object(W.a)("/api/practices/".concat(et.identifier,"/start"),{method:"get"});case 4:if(ir=cn.sent,!((ir==null?void 0:ir.status)===0)){cn.next=10;break}if(!bt){cn.next=9;break}return Object(ct.O)("/problems/".concat(ir==null?void 0:ir.identifier,"/oj/").concat(et==null?void 0:et.identifier,"?tab=3")),cn.abrupt("return");case 9:Object(ct.O)("/problems/".concat(ir==null?void 0:ir.identifier,"/oj/").concat(et==null?void 0:et.identifier));case 10:Be!=null&&(Pr=Be.target)!==null&&Pr!==void 0&&(Dr=Pr.style)!==null&&Dr!==void 0&&Dr.pointerEvents&&(Be.target.style.pointerEvents="auto");case 11:case"end":return cn.stop()}},De)}));return function(Be,et,bt){return $e.apply(this,arguments)}}();Object(r.useEffect)(function(){var $e=I()().add(0,"days").unix(),De=localStorage.getItem("problemsclose");if(!De){sn(!0);return}$e>parseInt(De)&&sn(!0)},[]);var Kn=["\u672A\u53D1\u5E03","\u5DF2\u516C\u5F00","\u672A\u5BA1\u6838","\u5BA1\u6838\u4E2D","\u672A\u516C\u5F00","\u672A\u901A\u8FC7"],Hn=[{title:"\u9898\u76EE\u540D\u79F0",dataIndex:"name",ellipsis:!0,render:function(De,Be){return t.a.createElement("div",{className:X.a.titleWarp},(ke==null?void 0:ke.filter)==="mine"?t.a.createElement("span",{className:X.a.tag},Kn[Be.practice_status]):null,t.a.createElement("span",{title:De,className:X.a.hov,onClick:function(bt){return un(bt,Be)}},De))}},(ke==null?void 0:ke.filter)==="public"?{title:"\u9898\u89E3",dataIndex:"solution_count",width:100,sorter:!0,render:function(De,Be){return t.a.createElement("span",{style:{display:"flex"}},t.a.createElement("span",{onClick:function(bt){return un(bt,Be,!0)},className:"current"},De),(Be==null?void 0:Be.has_video_solution)&&t.a.createElement("img",{className:"ml5",src:xe.a}))}}:null,(ke==null?void 0:ke.filter)==="public"?{title:"\u901A\u8FC7\u7387",dataIndex:"pass_ratio",sorter:!0,width:90}:null,{title:"\u96BE\u5EA6",dataIndex:"difficulty",sorter:!0,align:"center",width:90,render:function(De){return t.a.createElement(t.a.Fragment,null,De===1&&t.a.createElement("span",{className:X.a["btn-style-1"]},"\u7B80\u5355"),De===2&&t.a.createElement("span",{className:X.a["btn-style-2"]},"\u9002\u4E2D"),De===3&&t.a.createElement("span",{className:X.a["btn-style-3"]},"\u56F0\u96BE"))}},(ke==null?void 0:ke.filter)==="public"?{title:"\u4EBA\u6570",dataIndex:"user_count",align:"center",sorter:!0,width:80}:null,(ke==null?void 0:ke.filter)==="public"?{title:"\u72B6\u6001",dataIndex:"status",width:90,render:function(De,Be){return Object(V.p)()?t.a.createElement(t.a.Fragment,null,Ve===(Be==null?void 0:Be.identifier)?t.a.createElement("span",{className:X.a.hovBtn,onClick:function(bt){return un(bt,Be)}},"\u5F00\u542F\u5237\u9898"):t.a.createElement(t.a.Fragment,null,De===0&&t.a.createElement("span",{style:{color:"#666666"}},"\u672A\u5F00\u542F"),De===1&&t.a.createElement("span",{style:{color:"#666666"}},"\u8FDB\u884C\u4E2D"),De===2&&t.a.createElement("span",{style:{color:"#666666"}},"\u5DF2\u901A\u8FC7"))):"-"}}:null,(ke==null?void 0:ke.filter)!=="public"?{title:"\u77E5\u8BC6\u70B9",dataIndex:"tag_disciplines_name",ellipsis:!0,width:200,render:function(De){return t.a.createElement("span",null,De==null?void 0:De.join("\u3001"))}}:null,(ke==null?void 0:ke.filter)==="all"?{title:"\u521B\u5EFA\u8005",dataIndex:"creator",ellipsis:!0,width:100}:null,(ke==null?void 0:ke.filter)!=="public"?{title:"\u66F4\u65B0\u65F6\u95F4",dataIndex:"updated_at",sorter:!0,width:180}:null,Object(V.v)()?{title:"\u64CD\u4F5C",dataIndex:"action",key:"action",align:"center",width:80,render:function(De,Be){return t.a.createElement(d.a,{className:"ml10",overlay:Xn(Be==null?void 0:Be.identifier,Be)},t.a.createElement("span",{style:{cursor:"default"},onClick:function(bt){return bt.preventDefault()}},t.a.createElement("span",{className:"c-grey-666"},"\u66F4\u591A"),t.a.createElement("i",{style:{display:"inline-block",transform:"scale(0.6)",fontSize:12},className:"c-grey-c iconfont icon-xiajiantou1"})))}}:Yt&&(ke==null?void 0:ke.filter)!=="public"?{title:"\u64CD\u4F5C",dataIndex:"action",key:"action",align:"center",width:80,render:function(De,Be){return Be!=null&&Be.is_self&&(Be==null?void 0:Be.practice_status)!==1?t.a.createElement(d.a,{className:"ml10",overlay:An(Be==null?void 0:Be.identifier,Be)},t.a.createElement("span",{style:{cursor:"default"},onClick:function(bt){return bt.preventDefault()}},t.a.createElement("span",{className:"c-grey-666"},"\u66F4\u591A"),t.a.createElement("i",{style:{display:"inline-block",transform:"scale(0.6)",fontSize:12},className:"c-grey-c iconfont icon-xiajiantou1"}))):"-"}}:null].filter(function($e){return!!$e}),On=[{title:"\u9898\u76EE\u540D\u79F0",dataIndex:"name",ellipsis:!0,render:function(De,Be){return t.a.createElement("span",{className:X.a.hov,onClick:function(bt){return un(bt,Be)}},De)}},{title:"\u96BE\u5EA6",dataIndex:"difficulty",sorter:!0,align:"center",width:90,render:function(De){return t.a.createElement(t.a.Fragment,null,De===1&&t.a.createElement("span",{className:X.a["btn-style-1"]},"\u7B80\u5355"),De===2&&t.a.createElement("span",{className:X.a["btn-style-2"]},"\u9002\u4E2D"),De===3&&t.a.createElement("span",{className:X.a["btn-style-3"]},"\u56F0\u96BE"))}},(ke==null?void 0:ke.filter)==="not_reviewed"?{title:"\u521B\u5EFA\u8005",dataIndex:"creator",ellipsis:!0,width:100}:{title:"\u5BA1\u6838\u8005",dataIndex:"reviewer",ellipsis:!0,width:100},(ke==null?void 0:ke.filter)==="not_reviewed"?{title:"\u53D1\u5E03\u65F6\u95F4",dataIndex:"submit_time",width:180}:null,(ke==null?void 0:ke.filter)==="under_review"?{title:"\u5F00\u59CB\u5BA1\u6838\u65F6\u95F4",dataIndex:"start_review_time",width:180}:null,(ke==null?void 0:ke.filter)==="review_finished"?{title:"\u6700\u540E\u5BA1\u6838\u65F6\u95F4",dataIndex:"review_time",width:180}:null,{title:"\u64CD\u4F5C",dataIndex:"action",key:"action",align:"center",width:120,render:function(De,Be){var et;switch(ke==null?void 0:ke.filter){case"under_review":et=t.a.createElement("div",{style:{display:"flex"}},t.a.createElement(i.a,{type:"link",size:"small",onClick:function(Tt){return un(Tt,Be)}},"\u5BA1\u6838"),t.a.createElement(i.a,{type:"link",style:{color:"#666"},size:"small",onClick:function(Tt){return kn({e:Tt,record:Be,op:"release"})}},"\u79FB\u51FA"));break;case"review_finished":et=t.a.createElement(i.a,{type:"link",size:"small",onClick:function(Tt){bn(!0),vn(Be)}},"\u5BA1\u6838\u8BB0\u5F55");break;default:et=t.a.createElement(i.a,{type:"link",block:!0,onClick:function(Tt){return kn({e:Tt,record:Be,op:"claim"})}},"\u5F00\u59CB\u5BA1\u6838");break}return et}}].filter(function($e){return!!$e}),vn=function(){var $e=Object(u.a)(o.a.mark(function De(Be){var et;return o.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return or([]),Tt.next=3,Object(W.a)("/api/practices/".concat(Be.identifier,"/review_list"),{method:"get"});case 3:et=Tt.sent,or(et==null?void 0:et.reviews_list);case 5:case"end":return Tt.stop()}},De)}));return function(Be){return $e.apply(this,arguments)}}(),In=[{title:"\u5BA1\u6838\u65F6\u95F4",dataIndex:"review_time",key:"review_time",render:function(De,Be){return t.a.createElement("span",null,I()(De).format("YYYY-MM-DD HH:mm:ss"))}},{title:"\u5BA1\u6838\u8005",dataIndex:"reviewer",key:"reviewer"},{title:"\u5BA1\u6838\u7ED3\u679C",dataIndex:"status",width:120,key:"status",render:function(De,Be){return De==="5"||De===5?t.a.createElement("div",{style:{display:"flex",alignItems:"center"}},t.a.createElement("div",{style:{color:"#333333",marginRight:"5px",whiteSpace:"nowrap"}},"\u672A\u901A\u8FC7"),t.a.createElement("div",{style:{color:"#0152d9",whiteSpace:"nowrap",cursor:"pointer"},onClick:function(){Ft(Be.description),qr(!0)}},"\u67E5\u770B\u539F\u56E0")):t.a.createElement("span",null,"\u5DF2\u901A\u8FC7")}}];Object(r.useEffect)(function(){Nn(),Gr(ke)},[]),Object(r.useEffect)(function(){if(yr.length!==0){var $e;(mr==null||(($e=mr.current)===null||$e===void 0)?void 0:$e.clientHeight)>92&&xt(1)}},[yr]),Object(r.useEffect)(function(){if(Or.length!==0){var $e;(jr==null||(($e=jr.current)===null||$e===void 0)?void 0:$e.clientHeight)>92&&pt(1)}},[Or]),Object(r.useEffect)(function(){return Ct({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),Ct({type:"globalSetting/setShowQuestionBackTop",payload:!0}),function(){Ct({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),Ct({type:"globalSetting/setShowQuestionBackTop",payload:!1})}},[]),Object(r.useEffect)(function(){var $e;(document.title==="\u4EBA\u5DE5\u667A\u80FD\u79D1\u7814\u670D\u52A1\u5E73\u53F0"||document.title==="\u9996\u9875"||document.title==="\u5B9E\u8DF5\u6559\u5B66\u5E73\u53F0"||($e=document.title)!==null&&$e!==void 0&&$e.includes("img"))&&(document.title="\u5728\u7EBF\u5237\u9898")},[ft]),Object(r.useEffect)(function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}},[]);var Gr=function(){var $e=Object(u.a)(o.a.mark(function De(Be){var et,bt,Tt,lr;return o.a.wrap(function(Dr){for(;;)switch(Dr.prev=Dr.next){case 0:return Tt=Ge.a.cloneDeep(Be),Tt.tag_discipline_id=(et=Tt.tag_discipline_id)!==null&&et!==void 0&&et.includes(-1)?[]:Tt.tag_discipline_id,Tt.source_discipline_id=(bt=Tt.source_discipline_id)!==null&&bt!==void 0&&bt.includes(-1)?[]:Tt.source_discipline_id,console.log(Tt,"sendData"),We(!0),D([]),Dr.next=8,Object(W.a)("/api/practices.json",{method:"get",params:Tt});case 8:lr=Dr.sent,Zr([]),We(!1),fr(lr==null?void 0:lr.practices_count),D(lr==null?void 0:lr.practices_list),wn((lr==null?void 0:lr.recommend_subjects)||[]);case 14:case"end":return Dr.stop()}},De)}));return function(Be){return $e.apply(this,arguments)}}(),kn=function(){var $e=Object(u.a)(o.a.mark(function De(Be){var et,bt,Tt,lr,Pr,Dr;return o.a.wrap(function(Rn){for(;;)switch(Rn.prev=Rn.next){case 0:return et=Be.op,bt=Be.description,Tt=Be.record,lr=Be.e,Pr={op:et,description:bt},We(!0),Rn.next=5,Object(W.a)("/api/practices/".concat(Tt.identifier,"/review"),{method:"post",body:Pr});case 5:Dr=Rn.sent,We(!1),et==="claim"&&(Dr.status===0||Dr.status==="0")&&un(lr,Tt),Gr(ke);case 9:case"end":return Rn.stop()}},De)}));return function(Be){return $e.apply(this,arguments)}}(),dn=function(){var $e=Object(u.a)(o.a.mark(function De(Be){var et;return o.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return We(!0),Tt.next=3,Object(W.a)("/api/practices/".concat(Be.identifier,"/publish"),{method:"post"});case 3:et=Tt.sent,We(!1),Gr(ke);case 6:case"end":return Tt.stop()}},De)}));return function(Be){return $e.apply(this,arguments)}}(),Nn=function(){var $e=Object(u.a)(o.a.mark(function De(){var Be,et,bt,Tt,lr,Pr;return o.a.wrap(function(ir){for(;;)switch(ir.prev=ir.next){case 0:return ir.next=2,Object(W.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice",position:"index"}});case 2:return et=ir.sent,ir.next=5,Object(W.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice_source",position:"index"}});case 5:return bt=ir.sent,ir.next=8,Object(W.a)("/api/mypractices/rank_list",{method:"get",params:{}});case 8:Tt=ir.sent,et!=null&&et.tag_disciplines&&(lr=[{id:-1,name:"\u5168\u90E8",count:et==null?void 0:et.totalCount}].concat(Object(e.a)(et==null?void 0:et.tag_disciplines)),Mr(lr)),bt!=null&&bt.tag_disciplines&&(Pr=[{id:-1,name:"\u5168\u90E8",count:bt==null?void 0:bt.totalCount}].concat(Object(e.a)(bt==null?void 0:bt.tag_disciplines)),_r(Pr)),Gt(Tt||{}),rr(Tt==null||((Be=Tt.my_record)===null||Be===void 0)?void 0:Be.outsource);case 13:case"end":return ir.stop()}},De)}));return function(){return $e.apply(this,arguments)}}(),_n=function(De,Be){var et;ke.page=1;var bt=ke["".concat(Be,"_discipline_id")];(et=ke["".concat(Be,"_discipline_id")])!==null&&et!==void 0&&et.includes(De)?bt=bt.filter(function(Tt){return Tt!==De}):bt.push(De),De===-1?bt=[-1]:(bt=bt.filter(function(Tt){return Tt!==-1}),bt.length||(bt=[-1])),ke["".concat(Be,"_discipline_id")]=bt,Ar(Object(a.a)({},ke)),Gr(ke)},gn=function(De,Be){ke.page=1,ke[Be]=typeof De=="number"?De:null,Ar(Object(a.a)({},ke)),Gr(ke)},Vn=function(De){ke.page=1,ke.save_search=De,Ar(Object(a.a)({},ke))},Un=function(De,Be,et){ke.page=De==null?void 0:De.current,ke.per_page=De==null?void 0:De.pageSize,et!=null&&et.order?(ke.sort_by=et==null?void 0:et.field,ke.sort_direction=(et==null?void 0:et.order)==="ascend"?"asc":"desc"):(ke.sort_by=null,ke.sort_direction=null),Ar(Object(a.a)({},ke)),Gr(ke)},jn=function(De){ke.page=1,ke.filter=De,ke.status=null,ke.practice_status=null,Ar(Object(a.a)({},ke)),Gr(ke)},Yr=function(De,Be){if((Be==null?void 0:Be.length)===0){v.b.warn("\u8BF7\u9009\u62E9\u8BD5\u9898");return}var et=function(){var bt=Object(u.a)(o.a.mark(function Tt(){var lr,Pr;return o.a.wrap(function(ir){for(;;)switch(ir.prev=ir.next){case 0:return ir.next=2,Object(W.a)("/api/practices/batch_op.json",{method:"post",body:{identifier:Be,op:De}});case 2:lr=ir.sent,(lr==null?void 0:lr.status)===0&&(Pr=p.length===1&&ke.page!==1?ke.page-1:ke.page,ke.page=Pr,Ar(Object(a.a)({},ke)),Gr(ke));case 4:case"end":return ir.stop()}},Tt)}));return function(){return bt.apply(this,arguments)}}();if(De===-1){m.a.confirm({centered:!0,width:500,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u5220\u9664\u786E\u8BA4",icon:null,className:"custom-modal-divider",content:"\u5220\u9664\u540E\u9898\u76EE\u5C06\u4E0D\u53EF\u518D\u627E\u56DE\u3002",onOk:et});return}et()},Bn=t.a.createElement(y.a,null,(ke==null?void 0:ke.filter)==="public"?t.a.createElement(y.a.Item,{onClick:function(){return Yr(0,zr)}},"\u6279\u91CF\u79FB\u51FA\u516C\u5171"):[t.a.createElement(y.a.Item,{key:2,onClick:function(){return Yr(1,zr)}},"\u6279\u91CF\u79FB\u5165\u516C\u5171"),t.a.createElement(y.a.Item,{key:1,onClick:function(){return Yr(0,zr)}},"\u6279\u91CF\u79FB\u51FA\u516C\u5171")],(ke==null?void 0:ke.filter)!=="public"&&t.a.createElement(y.a.Item,{onClick:function(){return Yr(-1,zr)}},"\u6279\u91CF\u5220\u9664")),Xn=function(De,Be){return t.a.createElement(y.a,null,(Be==null?void 0:Be.practice_status)===1?t.a.createElement(y.a.Item,{onClick:function(){return Yr(0,[De])}},"\u79FB\u51FA\u516C\u5171"):t.a.createElement(y.a.Item,{onClick:function(){return Yr(1,[De])}},"\u79FB\u5165\u516C\u5171"),(ke==null?void 0:ke.filter)==="mine"?t.a.createElement(y.a.Item,{onClick:function(){return dn(Be)},disabled:![0,4,5].includes(Be.practice_status)},[0,4,5].includes(Be.practice_status)?"\u53D1\u5E03\u5BA1\u6838":"\u5DF2\u53D1\u5E03\u5BA1\u6838"):null,t.a.createElement(y.a.Item,{onClick:function(){return Object(ct.O)("/problems/".concat(De,"/ojedit"))}},"\u7F16\u8F91"),(ke==null?void 0:ke.filter)!=="public"&&t.a.createElement(y.a.Item,{onClick:function(){return Yr(-1,[De])}},"\u5220\u9664"))},An=function(De,Be){return t.a.createElement(y.a,null,t.a.createElement(y.a.Item,{onClick:function(){return dn(Be)},disabled:![0,4,5].includes(Be.practice_status)},[0,4,5].includes(Be.practice_status)?"\u53D1\u5E03\u5BA1\u6838":"\u5DF2\u53D1\u5E03\u5BA1\u6838"),t.a.createElement(y.a.Item,{onClick:function(){return Object(ct.O)("/problems/".concat(De,"/ojedit"))}},"\u7F16\u8F91"),t.a.createElement(y.a.Item,{onClick:function(){return Yr(-1,[De])}},"\u5220\u9664"))},$n=function(De){Zr(De)},Yn={selectedRowKeys:zr,columnWidth:40,onChange:$n};return t.a.createElement("section",{className:X.a.wrap},t.a.createElement("div",{className:X.a.bg},t.a.createElement("div",{className:X.a.btnWrap},t.a.createElement("div",{className:X.a.text},t.a.createElement("span",null,"\u5728\u7EBF\u5237\u9898"),t.a.createElement("span",null,"\u5FEB\u901F\u63D0\u9AD8\u7F16\u7A0B\u80FD\u529B")),t.a.createElement(d.a,{className:"ml10",overlay:t.a.createElement(y.a,null,t.a.createElement(y.a.Item,{key:1,onClick:function(){x.d.push("/problems/add")}},"\u65B0\u5EFA\u9898\u76EE"),t.a.createElement(y.a.Item,{key:2,onClick:function(){x.d.push("/problems/batchAdd")}},"\u6279\u91CF\u5BFC\u5165\u9898\u76EE"))},t.a.createElement("div",{className:X.a.btn,style:{visibility:Object(V.v)()||Yt?"visible":"hidden"}},t.a.createElement("i",{className:"iconfont icon-a-hao font12 mr5"}),t.a.createElement("span",null,"\u65B0\u5EFA\u9898\u76EE"))))),t.a.createElement("div",{className:X.a.content},t.a.createElement("div",{className:X.a.left},t.a.createElement("div",{className:X.a.filterPoint},t.a.createElement("div",{className:X.a.btnWarp,ref:mr,style:zt>0?{height:zt===1?92:"auto"}:{}},yr==null?void 0:yr.map(function($e){var De;return t.a.createElement("div",{onClick:function(){return _n($e.id,"tag")},key:$e.id,className:ke!=null&&(De=ke.tag_discipline_id)!==null&&De!==void 0&&De.includes($e.id)?X.a.btnActive:X.a.btn},t.a.createElement("span",{title:$e.name},$e.name),t.a.createElement("span",{style:{display:$e.count?"block":"none"}},$e.count))}),!!zt&&t.a.createElement(t.a.Fragment,null,zt===1?t.a.createElement("div",{onClick:function(){return xt(2)},className:X.a.action},"\u5C55\u5F00",t.a.createElement("i",{style:{transform:"scale(0.7)"},className:"iconfont icon-xiala"})):t.a.createElement("div",{onClick:function(){return xt(1)},className:X.a.action},"\u6536\u8D77",t.a.createElement("i",{style:{transform:"rotate(180deg) translateY(1px) scale(0.7)"},className:"iconfont icon-xiala"}))))),!!Or.length&&t.a.createElement(t.a.Fragment,null,t.a.createElement("div",{className:X.a.line}),t.a.createElement("div",{className:X.a.filterOrigin},t.a.createElement("div",{className:X.a.btnWarp,ref:jr,style:qe>0?{height:qe===1?92:"auto"}:{}},Or==null?void 0:Or.map(function($e){var De;return t.a.createElement("div",{onClick:function(){return _n($e.id,"source")},key:$e.id,className:ke!=null&&(De=ke.source_discipline_id)!==null&&De!==void 0&&De.includes($e.id)?X.a.btnActive:X.a.btn},t.a.createElement("span",{title:$e.name},$e.name),t.a.createElement("span",null,$e.count))}),!!qe&&t.a.createElement(t.a.Fragment,null,qe===1?t.a.createElement("div",{onClick:function(){return pt(2)},className:X.a.action},"\u5C55\u5F00",t.a.createElement("i",{style:{transform:"scale(0.7)"},className:"iconfont icon-xiala"})):t.a.createElement("div",{onClick:function(){return pt(1)},className:X.a.action},"\u6536\u8D77",t.a.createElement("i",{style:{transform:"rotate(180deg) translateY(1px) scale(0.7)"},className:"iconfont icon-xiala"})))))),t.a.createElement("div",{className:X.a.control},t.a.createElement(w.a,{allowClear:!0,placeholder:"\u96BE\u5EA6",value:ke==null?void 0:ke.difficulty,onChange:function(De){return gn(De,"difficulty")}},t.a.createElement(w.a.Option,{value:1},"\u7B80\u5355"),t.a.createElement(w.a.Option,{value:2},"\u9002\u4E2D"),t.a.createElement(w.a.Option,{value:3},"\u56F0\u96BE")),Object(V.p)()&&ke.filter==="public"&&t.a.createElement(w.a,{allowClear:!0,placeholder:"\u72B6\u6001",value:ke==null?void 0:ke.status,onChange:function(De){return gn(De,"status")}},t.a.createElement(w.a.Option,{value:0},"\u672A\u5F00\u542F"),t.a.createElement(w.a.Option,{value:1},"\u8FDB\u884C\u4E2D"),t.a.createElement(w.a.Option,{value:2},"\u5DF2\u901A\u8FC7")),Object(V.p)()&&ke.filter==="mine"&&t.a.createElement(w.a,{allowClear:!0,placeholder:"\u72B6\u6001",value:ke==null?void 0:ke.practice_status,onChange:function(De){return gn(De,"practice_status")}},t.a.createElement(w.a.Option,{value:0},"\u672A\u53D1\u5E03"),t.a.createElement(w.a.Option,{value:1},"\u5DF2\u516C\u5F00"),t.a.createElement(w.a.Option,{value:2},"\u672A\u5BA1\u6838"),t.a.createElement(w.a.Option,{value:3},"\u5BA1\u6838\u4E2D"),t.a.createElement(w.a.Option,{value:4},"\u672A\u516C\u5F00"),t.a.createElement(w.a.Option,{value:5},"\u672A\u901A\u8FC7")),Object(V.p)()&&ke.filter==="all"&&t.a.createElement(w.a,{allowClear:!0,placeholder:"\u72B6\u6001",value:ke==null?void 0:ke.practice_status,onChange:function(De){return gn(De,"practice_status")}},t.a.createElement(w.a.Option,{value:0},"\u672A\u53D1\u5E03"),t.a.createElement(w.a.Option,{value:1},"\u5DF2\u516C\u5F00"),t.a.createElement(w.a.Option,{value:2},"\u672A\u5BA1\u6838"),t.a.createElement(w.a.Option,{value:3},"\u5BA1\u6838\u4E2D"),t.a.createElement(w.a.Option,{value:4},"\u672A\u516C\u5F00"),t.a.createElement(w.a.Option,{value:5},"\u672A\u901A\u8FC7")),t.a.createElement(M.a.Search,{placeholder:Object(V.v)()?"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0\u3001\u521B\u5EFA\u8005\u641C\u7D22":"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0\u641C\u7D22",value:ke==null?void 0:ke.save_search,onChange:function(De){return Vn(De.target.value)},onSearch:function(){ke.page=1,ke.search=ke.save_search,Ar(Object(a.a)({},ke)),Gr(ke)}})),t.a.createElement("div",{className:X.a.table},t.a.createElement("div",{className:X.a.tabWarp,style:Object(V.v)()||Yt?{}:{height:10,border:0}},Object(V.v)()?t.a.createElement(S.a,{className:X.a.tab,activeKey:$r?"not_reviewed":ke.filter,onChange:jn},t.a.createElement(S.a.TabPane,{tab:"\u516C\u5171",key:"public"}),t.a.createElement(S.a.TabPane,{tab:"\u5168\u90E8",key:"all"}),t.a.createElement(S.a.TabPane,{tab:"\u6211\u521B\u5EFA\u7684",key:"mine"}),t.a.createElement(S.a.TabPane,{tab:"\u5BA1\u6838\u5217\u8868",key:"not_reviewed"})):Yt?t.a.createElement(S.a,{className:X.a.tab,activeKey:$r?"not_reviewed":ke.filter,onChange:jn},t.a.createElement(S.a.TabPane,{tab:"\u516C\u5171",key:"public"}),t.a.createElement(S.a.TabPane,{tab:"\u6211\u521B\u5EFA\u7684",key:"mine"}),t.a.createElement(S.a.TabPane,{tab:"\u5BA1\u6838\u5217\u8868",key:"not_reviewed"})):null,Object(V.v)()&&!$r&&t.a.createElement(d.a,{overlay:Bn},t.a.createElement("span",{className:"ant-dropdown-link font14 current",onClick:function(De){return De.preventDefault()}},"\u6279\u91CF\u64CD\u4F5C ",t.a.createElement("i",{style:{display:"inline-block",transform:"scale(0.6)",fontSize:12},className:"iconfont icon-xiajiantou1"})))),$r?t.a.createElement("div",{className:X.a.tabWarp2,style:Object(V.v)()||Yt?{}:{height:10,border:0}},t.a.createElement(S.a,{className:X.a.tab,activeKey:ke.filter,onChange:jn},t.a.createElement(S.a.TabPane,{tab:"\u5F85\u5BA1\u6838",key:"not_reviewed"}),t.a.createElement(S.a.TabPane,{tab:"\u5BA1\u6838\u4E2D",key:"under_review"}),t.a.createElement(S.a.TabPane,{tab:"\u5DF2\u5BA1\u6838",key:"review_finished"}))):null,t.a.createElement(k.a,{rowSelection:Object(V.v)()?Yn:void 0,className:X.a.customTable,dataSource:p,bordered:!1,rowKey:function(De){return De.identifier},columns:$r?On:Hn,rowClassName:X.a.row,loading:de,onRow:function(De){return{onMouseEnter:function(et){St(De==null?void 0:De.identifier)},onMouseLeave:function(et){St(null)}}},onChange:Un,pagination:{pageSize:ke.per_page,total:Lt,current:ke.page,showQuickJumper:!0,hideOnSinglePage:!0,showSizeChanger:!1,position:["bottomCenter"],showTotal:function(De){return t.a.createElement("span",{className:"mr10"},"\u5171",t.a.createElement("span",{className:"c-orange"},De),"\u6761\u6570\u636E")}}}))),t.a.createElement("div",{className:X.a.right},t.a.createElement("div",{className:X.a.title},t.a.createElement("img",{src:Object(V.p)()?B.a.IMG_SERVER+"/images/"+(gt==null||((Ce=gt.my_record)===null||Ce===void 0)?void 0:Ce.image_url):Ie.a}),t.a.createElement("span",null,"\u6211\u7684\u5237\u9898\u7EDF\u8BA1")),t.a.createElement("ul",null,t.a.createElement("li",null,t.a.createElement("div",null,t.a.createElement("span",null,"\u901A\u8FC7\u7387"),Object(V.p)()?t.a.createElement("span",null,(gt==null||((_e=gt.my_record)===null||_e===void 0)?void 0:_e.passed_ratio)||0,"%"):t.a.createElement("span",null,"-")),t.a.createElement("img",{src:je.a})),t.a.createElement("li",null,t.a.createElement("div",null,t.a.createElement("span",null,"\u5237\u9898\u6570"),Object(V.p)()?t.a.createElement("span",null,(gt==null||((Fe=gt.my_record)===null||Fe===void 0)?void 0:Fe.passed_count)||0):t.a.createElement("span",null,"-")),t.a.createElement("img",{src:Oe.a})),t.a.createElement("li",null,t.a.createElement("div",null,t.a.createElement("span",null,"\u65F6\u957F(h)"),Object(V.p)()?t.a.createElement("span",null,gt==null||((Se=gt.my_record)===null||Se===void 0||((Me=Se.time_count)===null||Me===void 0))?void 0:Me.toFixed(2)):t.a.createElement("span",null,"-")),t.a.createElement("img",{src:Pe.a}))),!!(gt!=null&&(ue=gt.rank_list)!==null&&ue!==void 0&&ue.length)&&t.a.createElement(t.a.Fragment,null,t.a.createElement("div",{className:X.a.line}),((te=tt.userInfo)===null||te===void 0?void 0:te.user_id)!=2&&Object(V.m)()&&(ft==null||((re=ft.setting)===null||re===void 0)?void 0:re.main_site)&&En&&(Br==null?void 0:Br.length)>0&&t.a.createElement("div",{className:X.a.problemsclose,style:{position:"relative"}},t.a.createElement(N.a,{autoplay:!0,pauseOnDotsHover:!0,style:{width:292,height:170,marginBottom:"10px",overflow:"hidden"}},Br==null?void 0:Br.map(function($e,De){return t.a.createElement("div",{style:{display:"flex"},key:De},t.a.createElement("a",{href:"/paths/".concat($e.identifier)},t.a.createElement("img",{style:{width:"292px",height:"170px",borderRadius:"4px"},src:B.a.IMG_SERVER+"/"+$e.image_url})))})),t.a.createElement("img",{className:X.a.imgsrc,onClick:function(){localStorage.setItem("problemsclose",I()().add(1,"days").unix()+""),sn(!1)},src:st.a})),t.a.createElement("div",{className:X.a.sort},t.a.createElement("div",{className:X.a.titles},t.a.createElement("img",{src:Q.a}),t.a.createElement("span",null,"\u6392\u884C\u699C")),!!(gt!=null&&(z=gt.my_record)!==null&&z!==void 0&&z.rank)&&t.a.createElement("div",{className:X.a.li,style:{background:"#D3EAFF"}},t.a.createElement("span",null,t.a.createElement("span",{style:{fontWeight:600,color:"#0152d9"}},(gt==null||((G=gt.my_record)===null||G===void 0)?void 0:G.rank)>999?"999+":gt==null||((J=gt.my_record)===null||J===void 0)?void 0:J.rank)),t.a.createElement("img",{className:"ml10 mr10",style:{borderRadius:"50%"},width:26,height:26,src:B.a.IMG_SERVER+"/images/"+(gt==null||((ne=gt.my_record)===null||ne===void 0)?void 0:ne.image_url)}),t.a.createElement("span",{title:gt==null||((ve=gt.my_record)===null||ve===void 0)?void 0:ve.nickname,style:{color:"#656F87",maxWidth:96,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"}},gt==null||((we=gt.my_record)===null||we===void 0)?void 0:we.nickname),t.a.createElement("img",{className:"ml10",src:it.a}),t.a.createElement("span",{style:{marginLeft:"auto",color:"#0152d9"}},gt==null||((ze=gt.my_record)===null||ze===void 0)?void 0:ze.passed_count,"\u9898")),gt==null||((nt=gt.rank_list)===null||nt===void 0)?void 0:nt.map(function($e,De){var Be=De+1;return De===0&&(Be=Xe.a),De===1&&(Be=ie.a),De===2&&(Be=Re.a),t.a.createElement("div",{className:X.a.li},t.a.createElement("span",null,typeof Be=="number"?t.a.createElement("span",{style:{fontWeight:600}},Be):t.a.createElement("img",{src:Be})),t.a.createElement("img",{className:"ml10 mr10",style:{borderRadius:"50%"},width:26,height:26,src:B.a.IMG_SERVER+"/images/"+($e==null?void 0:$e.image_url)}),t.a.createElement("span",{title:$e==null?void 0:$e.nickname,style:{color:"#656F87",width:96,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"}},$e==null?void 0:$e.nickname),t.a.createElement("span",{style:{marginLeft:"auto"}},$e.passed_count,"\u9898"))}))))),t.a.createElement(m.a,{title:"\u5BA1\u6838\u8BB0\u5F55",visible:hn,onOk:function(){},onCancel:function(){bn(!1)},footer:null,closable:!0},t.a.createElement(k.a,{dataSource:Tr,columns:In})),t.a.createElement(m.a,{title:"\u672A\u901A\u8FC7\u539F\u56E0",visible:Rr,onOk:function(){},onCancel:function(){qr(!1)},footer:null,closable:!0},t.a.createElement(A.a,{value:sr})))};fe.default=Object(x.a)(function(mt){var ht=mt.user,me=mt.globalSetting;return{user:ht,globalSetting:me}})(Ze)},yDOu:function(ot,fe){ot.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAABZlJREFUaEPtmd1rXNUah5/1tfdkkrSNMdWO+C0pp6mKYhURURRFvPFGiwj+A4p44Y30pngj5+ZcHET/AUGkeuONiKIoIqJVRO0UDdpzPAen2hhTm2Qye68vWdlOmYQ2M/2gYaQDw2K+f8/7/t53r/WOYMhvYsj1cxFgszN4MQN/mwzEGM8om0KIeD7gz+hH1//getEvvDBYU9i/nzXizwXmrAB6hXdFN3dV4mcOV2urtRam0ahEN3dV68zhau2FORuQMwI4nfAkurUDsXC0Er00j1hZXAswMk4cm6xET+wgNo4SE8y5ggwM0BXfG/Gu8P8fQibBUxOIzjKi2ILY2l4L8EedmJ8g1kaJcwvEBHTlbsLpQAbNxkAA68V/CHJ6B2JV+CRivIWsaWQxhmgfR47VEbZYC2By4lKbWN9GyJeIHUdYbBBG5iuQ2aPEeyH02moQiIEBegpUNkEmm4xpJAVqSSGlQ3UkMpNIbxG1HOFsBaENsVMQlSGWgVALhKDxY55Ajl9yhGSvmQrgJMR5AeiNfor8FMi5/yLHM6TYhpIlatGitnhUO6BkjvIeoQUy+ApAKqKLBKWIocDXJf6Ewo8bfMjw8Th+sSRMXUOYg5Ay0S3ufhB9M5AAUvRTl5lYQCbb6AKVxPtFdNBo4VFRoaNFC4MSAeUE0oQKwEqijoQo8dHihcEJj4sKLx1OjeMShMvxyU4LE4RU3AninAC60d+7Fzkzg/hsHpVsUxh0V7yJGBcxUaJ1gXnwXhq7ruPqiS1sN4aRVQDLysIJjh0+wk/vfkjL5VgRcFpgrcB2IXKLS3a6YxLfbBIPHKjstBHEhhlYH/3Zo6ipY2iboQuPSeJLR6YzzC3TXPLw3dyxZZTLfED5gOy98ClJUMk6y/z69sd89tUsv7sSm2nKBJErrClxc9tx0zvwg2ZhIIBk4xT9ZB2Xo8uAySMGQS4V2f17uOK+27lHCEasR4VkqYg8iRBSFAlS4Y3Cx8jKB5/z0fsH+Tl4SiJFIbCZxOoCl6yUspAKup+NTgtw0j5vIJP3e6MvOmQdQwbkt+3k0kcf4KEYqTuPDin6EeUdSvz17TGC0ngl8FLitcIJQfvN93jni+/5DShqljLWKNdn4cBjG9toQ4Bu8XIYxR+o5P3lZTJtyYQkN4Havqd5cHSERmkxLqC9Q6c1ZSDGqoiFSMVI0BKnNC6tmcEur9B68WXetZJODBTOUI6OUqZaYCueXfh+xdwXoNc+K2BMXkU+3R++k6vvu537O5bMO4x1mD27eWL+OP9pHuEb/gJAEGeu46bJbVx78BCvGY1VGlszlB98zvtvf8pPKQvpbgvKEbCD2mhgAJ+j6w7T7pAhybVg5LknuWvqEnYWJZkLmNKSTV/Fnssv5ZbWHN8e+oFvUwZ238CNjSlu/OU3vpr9HwczQ6klNs8o537n+3+9yicuskKgqNco2wmwwA1SB30BWi3UbImaqqPbEaMyMueoOcHIP5/iESGZtJYsiU8QzmP+cS23JsGtYzQTQGM7MwnouyN8mSxkFGXKgjGUMTD//Cu8pSMrWtPxJWVdYOfauOkM32jgNyrkMwaIgjwEakZTe/FZHneeuvVktiRLLdV7jA/o3ddzcxK+urU+RvPQj3ytUg2oqnWajDKBaEV737953To6UtIRkeLCATzD4y6eI4Cgve+lCwgwdBbqdqGhLeLz2UYntnLll00OXNA2unrWHdYLWeogezdjK5Fa6J3Vhu6stxJJfHc3OpSbuV6A7mFmKLfTqzYa1gPNqbIwVEfKLkBa09Z6KA/164p5dcgwVGOV9VlIj4dusHUqiNSZhma02J0uDPVwt3dEMrTj9V6IXlt1nx+aPzjWg5wK5lTv6X2u38iw3+e7r/edjQ76RZv1vosAmxX5ixba7Mj/bTLwJ/OqjXyXcOSkAAAAAElFTkSuQmCC"},yR49:function(ot,fe,U){ot.exports=U.p+"static/b.3edd9583.svg"},zlzj:function(ot,fe,U){ot.exports=U.p+"static/b3.30079151.svg"},zqRK:function(ot,fe,U){ot.exports=U.p+"static/v.7a1274ca.svg"}}]);