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

393 lines
982 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[100,5,7,8],{"+92d":function(Ne,ne,U){Ne.exports=U.p+"static/b1.8d46544a.svg"},"+ua5":function(Ne,ne,U){},"/cxE":function(Ne,ne,U){"use strict";U.d(ne,"f",function(){return I}),U.d(ne,"g",function(){return W}),U.d(ne,"h",function(){return P}),U.d(ne,"e",function(){return K}),U.d(ne,"b",function(){return N}),U.d(ne,"c",function(){return e}),U.d(ne,"d",function(){return C}),U.d(ne,"a",function(){return g});class Q{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(v){setTimeout(()=>{throw v.stack?new Error(v.message+`
`+v.stack):v},0)}}emit(v){this.listeners.forEach(c=>{c(v)})}onUnexpectedError(v){this.unexpectedErrorHandler(v),this.emit(v)}onUnexpectedExternalError(v){this.unexpectedErrorHandler(v)}}const H=new Q;function I(v){K(v)||H.onUnexpectedError(v);return}function W(v){K(v)||H.onUnexpectedExternalError(v);return}function P(v){if(v instanceof Error){let{name:c,message:s}=v;const i=v.stacktrace||v.stack;return{$isError:!0,name:c,message:s,stack:i}}return v}const R="Canceled";function K(v){return v instanceof Error&&v.name===R&&v.message===R}function N(){const v=new Error(R);return v.name=v.message,v}function e(v){return v?new Error(`Illegal argument: ${v}`):new Error("Illegal argument")}function C(v){return v?new Error(`Illegal state: ${v}`):new Error("Illegal state")}class g extends Error{constructor(v){super("NotSupported");v&&(this.message=v)}}},"24hK":function(Ne,ne,U){"use strict";U.d(ne,"a",function(){return H});class Q{constructor(I){this.element=I,this.next=Q.Undefined,this.prev=Q.Undefined}}Q.Undefined=new Q(void 0);class H{constructor(){this._first=Q.Undefined,this._last=Q.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Q.Undefined}clear(){let I=this._first;for(;I!==Q.Undefined;){const W=I.next;I.prev=Q.Undefined,I.next=Q.Undefined,I=W}this._first=Q.Undefined,this._last=Q.Undefined,this._size=0}unshift(I){return this._insert(I,!1)}push(I){return this._insert(I,!0)}_insert(I,W){const P=new Q(I);if(this._first===Q.Undefined)this._first=P,this._last=P;else if(W){const K=this._last;this._last=P,P.prev=K,K.next=P}else{const K=this._first;this._first=P,P.next=K,K.prev=P}this._size+=1;let R=!1;return()=>{R||(R=!0,this._remove(P))}}shift(){if(this._first===Q.Undefined)return;{const I=this._first.element;return this._remove(this._first),I}}pop(){if(this._last===Q.Undefined)return;{const I=this._last.element;return this._remove(this._last),I}}_remove(I){if(I.prev!==Q.Undefined&&I.next!==Q.Undefined){const W=I.prev;W.next=I.next,I.next.prev=W}else I.prev===Q.Undefined&&I.next===Q.Undefined?(this._first=Q.Undefined,this._last=Q.Undefined):I.next===Q.Undefined?(this._last=this._last.prev,this._last.next=Q.Undefined):I.prev===Q.Undefined&&(this._first=this._first.next,this._first.prev=Q.Undefined);this._size-=1}*[Symbol.iterator](){let I=this._first;for(;I!==Q.Undefined;)yield I.element,I=I.next}}},"3/fG":function(Ne,ne,U){"use strict";U.d(ne,"a",function(){return H});function Q(I,W){let P;return W.length===0?P=I:P=I.replace(/\{(\d+)\}/g,function(R,K){const N=K[0];return typeof W[N]!="undefined"?W[N]:R}),P}function H(I,W,...P){return Q(W,P)}},"55Ip":function(Ne,ne,U){"use strict";U.d(ne,"a",function(){return r});var Q=U("Ty5D"),H=U("dI71"),I=U("q1tI"),W=U.n(I),P=U("YS25"),R=U("17x9"),K=U.n(R),N=U("wx14"),e=U("zLVn"),C=U("9R94"),g=function(h){Object(H.a)(o,h);function o(){for(var b,p=arguments.length,d=new Array(p),A=0;A<p;A++)d[A]=arguments[A];return b=h.call.apply(h,[this].concat(d))||this,b.history=Object(P.a)(b.props),b}var u=o.prototype;return u.render=function(){return W.a.createElement(Q.c,{history:this.history,children:this.props.children})},o}(W.a.Component),v=function(h){Object(H.a)(o,h);function o(){for(var b,p=arguments.length,d=new Array(p),A=0;A<p;A++)d[A]=arguments[A];return b=h.call.apply(h,[this].concat(d))||this,b.history=Object(P.b)(b.props),b}var u=o.prototype;return u.render=function(){return W.a.createElement(Q.c,{history:this.history,children:this.props.children})},o}(W.a.Component),c=function(o,u){return typeof o=="function"?o(u):o},s=function(o,u){return typeof o=="string"?Object(P.c)(o,null,null,u):o},i=function(o){return o},l=W.a.forwardRef;typeof l=="undefined"&&(l=i);function a(h){return!!(h.metaKey||h.altKey||h.ctrlKey||h.shiftKey)}var n=l(function(h,o){var u=h.innerRef,b=h.navigate,p=h.onClick,d=Object(e.a)(h,["innerRef","navigate","onClick"]),A=d.target,D=Object(N.a)({},d,{onClick:function(L){try{p&&p(L)}catch(M){throw L.preventDefault(),M}!L.defaultPrevented&&L.button===0&&(!A||A==="_self")&&!a(L)&&(L.preventDefault(),b())}});return i!==l?D.ref=o||u:D.ref=u,W.a.createElement("a",D)}),r=l(function(h,o){var u=h.component,b=u===void 0?n:u,p=h.replace,d=h.to,A=h.innerRef,D=Object(e.a)(h,["component","replace","to","innerRef"]);return W.a.createElement(Q.e.Consumer,null,function(S){S||Object(C.a)(!1);var L=S.history,M=s(c(d,S.location),S.location),O=M?L.createHref(M):"",j=Object(N.a)({},D,{href:O,navigate:function(){var X=c(d,S.location),te=p?L.replace:L.push;te(X)}});return i!==l?j.ref=o||A:j.innerRef=A,W.a.createElement(b,j)})});if(!1)var t,E;var y=function(o){return o},m=W.a.forwardRef;typeof m=="undefined"&&(m=y);function T(){for(var h=arguments.length,o=new Array(h),u=0;u<h;u++)o[u]=arguments[u];return o.filter(function(b){return b}).join(" ")}var _=m(function(h,o){var u=h["aria-current"],b=u===void 0?"page":u,p=h.activeClassName,d=p===void 0?"active":p,A=h.activeStyle,D=h.className,S=h.exact,L=h.isActive,M=h.location,O=h.sensitive,j=h.strict,G=h.style,X=h.to,te=h.innerRef,fe=Object(e.a)(h,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return W.a.createElement(Q.e.Consumer,null,function(ve){ve||Object(C.a)(!1);var he=M||ve.location,xe=s(c(X,he),he),Se=xe.pathname,de=Se&&Se.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ie=de?Object(Q.f)(he.pathname,{path:de,exact:S,sensitive:O,strict:j}):null,Le=!!(L?L(ie,he):ie),Ve=Le?T(D,d):D,Be=Le?Object(N.a)({},G,{},A):G,je=Object(N.a)({"aria-current":Le&&b||null,className:Ve,style:Be,to:xe},fe);return y!==m?je.ref=o||te:je.innerRef=te,W.a.createElement(r,je)})});if(!1)var f},"5VLF":function(Ne,ne,U){"use strict";var Q,H;function I(W,P,R){var K=function(N,e){return W.js_beautify(N,e)};return K.js=W.js_beautify,K.css=P.css_beautify,K.html=R.html_beautify,K.js_beautify=W.js_beautify,K.css_beautify=P.css_beautify,K.html_beautify=R.html_beautify,K}!(Q=[U("6UM0"),U("TXwP"),U("psGv")],H=function(W,P,R){return I(W,P,R)}.apply(ne,Q),H!==void 0&&(Ne.exports=H))},"5Y4S":function(Ne,ne,U){"use strict";U.d(ne,"a",function(){return I});var Q=U("MNsG");const H=Q.b.performance&&typeof Q.b.performance.now=="function";class I{constructor(W){this._highResolution=H&&W,this._startTime=this._now(),this._stopTime=-1}static create(W=!0){return new I(W)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?Q.b.performance.now():Date.now()}}},"6+eU":function(Ne,ne,U){"use strict";U.d(ne,"a",function(){return m});var Q=U("wx14"),H=U("rePB"),I=U("VTBJ"),W=U("1OyB"),P=U("vuIU"),R=U("Ji7U"),K=U("LK+K"),N=U("q1tI"),e=U.n(N),C=U("TSYQ"),g=U.n(C),v=function(_){var f,h="".concat(_.rootPrefixCls,"-item"),o=g()(h,"".concat(h,"-").concat(_.page),(f={},Object(H.a)(f,"".concat(h,"-active"),_.active),Object(H.a)(f,_.className,!!_.className),Object(H.a)(f,"".concat(h,"-disabled"),!_.page),f)),u=function(){_.onClick(_.page)},b=function(d){_.onKeyPress(d,_.onClick,_.page)};return e.a.createElement("li",{title:_.showTitle?_.page:null,className:o,onClick:u,onKeyPress:b,tabIndex:"0"},_.itemRender(_.page,"page",e.a.createElement("a",{rel:"nofollow"},_.page)))},c=v,s={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},i=function(T){Object(R.a)(f,T);var _=Object(K.a)(f);function f(){var h;Object(W.a)(this,f);for(var o=arguments.length,u=new Array(o),b=0;b<o;b++)u[b]=arguments[b];return h=_.call.apply(_,[this].concat(u)),h.state={goInputText:""},h.buildOptionText=function(p){return"".concat(p," ").concat(h.props.locale.items_per_page)},h.changeSize=function(p){h.props.changeSize(Number(p))},h.handleChange=function(p){h.setState({goInputText:p.target.value})},h.handleBlur=function(p){var d=h.props,A=d.goButton,D=d.quickGo,S=d.rootPrefixCls,L=h.state.goInputText;if(A||L==="")return;if(p.relatedTarget&&(p.relatedTarget.className.indexOf("".concat(S,"-prev"))>=0||p.relatedTarget.className.indexOf("".concat(S,"-next"))>=0))return;h.setState({goInputText:""}),D(h.getValidValue())},h.go=function(p){var d=h.state.goInputText;if(d==="")return;(p.keyCode===s.ENTER||p.type==="click")&&(h.setState({goInputText:""}),h.props.quickGo(h.getValidValue()))},h}return Object(P.a)(f,[{key:"getValidValue",value:function(){var o=this.state,u=o.goInputText,b=o.current;return!u||isNaN(u)?b:Number(u)}},{key:"getPageSizeOptions",value:function(){var o=this.props,u=o.pageSize,b=o.pageSizeOptions;return b.some(function(p){return p.toString()===u.toString()})?b:b.concat([u.toString()]).sort(function(p,d){var A=isNaN(Number(p))?0:Number(p),D=isNaN(Number(d))?0:Number(d);return A-D})}},{key:"render",value:function(){var o=this,u=this.props,b=u.pageSize,p=u.locale,d=u.rootPrefixCls,A=u.changeSize,D=u.quickGo,S=u.goButton,L=u.selectComponentClass,M=u.buildOptionText,O=u.selectPrefixCls,j=u.disabled,G=this.state.goInputText,X="".concat(d,"-options"),te=L,fe=null,ve=null,he=null;if(!A&&!D)return null;var xe=this.getPageSizeOptions();if(A&&te){var Se=xe.map(function(de,ie){return e.a.createElement(te.Option,{key:ie,value:de.toString()},(M||o.buildOptionText)(de))});fe=e.a.createElement(te,{disabled:j,prefixCls:O,showSearch:!1,className:"".concat(X,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(b||xe[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ie){return ie.parentNode}},Se)}return D&&(S&&(he=typeof S=="boolean"?e.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:j,className:"".concat(X,"-quick-jumper-button")},p.jump_to_confirm):e.a.createElement("span",{onClick:this.go,onKeyUp:this.go},S)),ve=e.a.createElement("div",{className:"".concat(X,"-quick-jumper")},p.jump_to,e.a.createElement("input",{disabled:j,type:"text",value:G,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),p.page,he)),e.a.createElement("li",{className:"".concat(X)},fe,ve)}}]),f}(e.a.Component);i.defaultProps={pageSizeOptions:["10","20","50","100"]};var l=i,a=U("N2Kk");function n(){}function r(T){return typeof T=="number"&&isFinite(T)&&Math.floor(T)===T}function t(T,_,f){return f}function E(T,_,f){var h=typeof T=="undefined"?_.pageSize:T;return Math.floor((f.total-1)/h)+1}var y=function(T){Object(R.a)(f,T);var _=Object(K.a)(f);function f(h){var o;Object(W.a)(this,f),o=_.call(this,h),o.getJumpPrevPage=function(){return Math.max(1,o.state.current-(o.props.showLessItems?3:5))},o.getJumpNextPage=function(){return Math.min(E(void 0,o.state,o.props),o.state.current+(o.props.showLessItems?3:5))},o.getItemIcon=function(A,D){var S=o.props.prefixCls,L=A||e.a.createElement("button",{type:"button","aria-label":D,className:"".concat(S,"-item-link")});return typeof A=="function"&&(L=e.a.createElement(A,Object(I.a)({},o.props))),L},o.savePaginationNode=function(A){o.paginationNode=A},o.isValid=function(A){return r(A)&&A!==o.state.current},o.shouldDisplayQuickJumper=function(){var A=o.props,D=A.showQuickJumper,S=A.pageSize,L=A.total;return L<=S?!1:D},o.handleKeyDown=function(A){(A.keyCode===s.ARROW_UP||A.keyCode===s.ARROW_DOWN)&&A.preventDefault()},o.handleKeyUp=function(A){var D=o.getValidValue(A),S=o.state.currentInputValue;D!==S&&o.setState({currentInputValue:D}),A.keyCode===s.ENTER?o.handleChange(D):A.keyCode===s.ARROW_UP?o.handleChange(D-1):A.keyCode===s.ARROW_DOWN&&o.handleChange(D+1)},o.changePageSize=function(A){var D=o.state.current,S=E(A,o.state,o.props);D=D>S?S:D,S===0&&(D=o.state.current),typeof A=="number"&&("pageSize"in o.props||o.setState({pageSize:A}),"current"in o.props||o.setState({current:D,currentInputValue:D})),o.props.onShowSizeChange(D,A),"onChange"in o.props&&o.props.onChange&&o.props.onChange(D,A)},o.handleChange=function(A){var D=o.props.disabled,S=A;if(o.isValid(S)&&!D){var L=E(void 0,o.state,o.props);S>L?S=L:S<1&&(S=1),"current"in o.props||o.setState({current:S,currentInputValue:S});var M=o.state.pageSize;return o.props.onChange(S,M),S}return o.state.current},o.prev=function(){o.hasPrev()&&o.handleChange(o.state.current-1)},o.next=function(){o.hasNext()&&o.handleChange(o.state.current+1)},o.jumpPrev=function(){o.handleChange(o.getJumpPrevPage())},o.jumpNext=function(){o.handleChange(o.getJumpNextPage())},o.hasPrev=function(){return o.state.current>1},o.hasNext=function(){return o.state.current<E(void 0,o.state,o.props)},o.runIfEnter=function(A,D){if(A.key==="Enter"||A.charCode===13){for(var S=arguments.length,L=new Array(S>2?S-2:0),M=2;M<S;M++)L[M-2]=arguments[M];D.apply(void 0,L)}},o.runIfEnterPrev=function(A){o.runIfEnter(A,o.prev)},o.runIfEnterNext=function(A){o.runIfEnter(A,o.next)},o.runIfEnterJumpPrev=function(A){o.runIfEnter(A,o.jumpPrev)},o.runIfEnterJumpNext=function(A){o.runIfEnter(A,o.jumpNext)},o.handleGoTO=function(A){(A.keyCode===s.ENTER||A.type==="click")&&o.handleChange(o.state.currentInputValue)};var u=h.onChange!==n,b="current"in h;b&&!u&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var p=h.defaultCurrent;"current"in h&&(p=h.current);var d=h.defaultPageSize;return"pageSize"in h&&(d=h.pageSize),p=Math.min(p,E(d,void 0,h)),o.state={current:p,currentInputValue:p,pageSize:d},o}return Object(P.a)(f,[{key:"componentDidUpdate",value:function(o,u){var b=this.props.prefixCls;if(u.current!==this.state.current&&this.paginationNode){var p=this.paginationNode.querySelector(".".concat(b,"-item-").concat(u.current));p&&document.activeElement===p&&p.blur()}}},{key:"getValidValue",value:function(o){var u=o.target.value,b=E(void 0,this.state,this.props),p=this.state.currentInputValue,d;return u===""?d=u:isNaN(Number(u))?d=p:u>=b?d=b:d=Number(u),d}},{key:"getShowSizeChanger",value:function(){var o=this.props,u=o.showSizeChanger,b=o.total,p=o.totalBoundaryShowSizeChanger;return typeof u!="undefined"?u:b>p}},{key:"renderPrev",value:function(o){var u=this.props,b=u.prevIcon,p=u.itemRender,d=p(o,"prev",this.getItemIcon(b,"prev page")),A=!this.hasPrev();return Object(N.isValidElement)(d)?Object(N.cloneElement)(d,{disabled:A}):d}},{key:"renderNext",value:function(o){var u=this.props,b=u.nextIcon,p=u.itemRender,d=p(o,"next",this.getItemIcon(b,"next page")),A=!this.hasNext();return Object(N.isValidElement)(d)?Object(N.cloneElement)(d,{disabled:A}):d}},{key:"render",value:function(){var o=this,u=this.props,b=u.prefixCls,p=u.className,d=u.style,A=u.disabled,D=u.hideOnSinglePage,S=u.total,L=u.locale,M=u.showQuickJumper,O=u.showLessItems,j=u.showTitle,G=u.showTotal,X=u.simple,te=u.itemRender,fe=u.showPrevNextJumpers,ve=u.jumpPrevIcon,he=u.jumpNextIcon,xe=u.selectComponentClass,Se=u.selectPrefixCls,de=u.pageSizeOptions,ie=this.state,Le=ie.current,Ve=ie.pageSize,Be=ie.currentInputValue;if(D===!0&&S<=Ve)return null;var je=E(void 0,this.state,this.props),Ee=[],Te=null,Re=null,Ie=null,$=null,se=null,ue=M&&M.goButton,ce=O?1:2,_e=Le-1>0?Le-1:0,De=Le+1<je?Le+1:je,Pe=Object.keys(this.props).reduce(function(V,Y){return(Y.substr(0,5)==="data-"||Y.substr(0,5)==="aria-"||Y==="role")&&(V[Y]=o.props[Y]),V},{});if(X)return ue&&(typeof ue=="boolean"?se=e.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},L.jump_to_confirm):se=e.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},ue),se=e.a.createElement("li",{title:j?"".concat(L.jump_to).concat(Le,"/").concat(je):null,className:"".concat(b,"-simple-pager")},se)),e.a.createElement("ul",Object(Q.a)({className:g()(b,"".concat(b,"-simple"),Object(H.a)({},"".concat(b,"-disabled"),A),p),style:d,ref:this.savePaginationNode},Pe),e.a.createElement("li",{title:j?L.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:g()("".concat(b,"-prev"),Object(H.a)({},"".concat(b,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(_e)),e.a.createElement("li",{title:j?"".concat(Le,"/").concat(je):null,className:"".concat(b,"-simple-pager")},e.a.createElement("input",{type:"text",value:Be,disabled:A,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),e.a.createElement("span",{className:"".concat(b,"-slash")},"/"),je),e.a.createElement("li",{title:j?L.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:g()("".concat(b,"-next"),Object(H.a)({},"".concat(b,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(De)),se);if(je<=3+ce*2){var Me={locale:L,rootPrefixCls:b,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:j,itemRender:te};je||Ee.push(e.a.createElement(c,Object(Q.a)({},Me,{key:"noPager",page:je,className:"".concat(b,"-disabled")})));for(var Fe=1;Fe<=je;Fe+=1){var He=Le===Fe;Ee.push(e.a.createElement(c,Object(Q.a)({},Me,{key:Fe,page:Fe,active:He})))}}else{var oe=O?L.prev_3:L.prev_5,me=O?L.next_3:L.next_5;fe&&(Te=e.a.createElement("li",{title:j?oe:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:g()("".concat(b,"-jump-prev"),Object(H.a)({},"".concat(b,"-jump-prev-custom-icon"),!!ve))},te(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(ve,"prev page"))),Re=e.a.createElement("li",{title:j?me:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:g()("".concat(b,"-jump-next"),Object(H.a)({},"".concat(b,"-jump-next-custom-icon"),!!he))},te(this.getJumpNextPage(),"jump-next",this.getItemIcon(he,"next page")))),$=e.a.createElement(c,{locale:L,last:!0,rootPrefixCls:b,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:je,page:je,active:!1,showTitle:j,itemRender:te}),Ie=e.a.createElement(c,{locale:L,rootPrefixCls:b,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:j,itemRender:te});var be=Math.max(1,Le-ce),we=Math.min(Le+ce,je);Le-1<=ce&&(we=1+ce*2),je-Le<=ce&&(be=je-ce*2);for(var pe=be;pe<=we;pe+=1){var ye=Le===pe;Ee.push(e.a.createElement(c,{locale:L,rootPrefixCls:b,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:pe,page:pe,active:ye,showTitle:j,itemRender:te}))}Le-1>=ce*2&&Le!==1+2&&(Ee[0]=Object(N.cloneElement)(Ee[0],{className:"".concat(b,"-item-after-jump-prev")}),Ee.unshift(Te)),je-Le>=ce*2&&Le!==je-2&&(Ee[Ee.length-1]=Object(N.cloneElement)(Ee[Ee.length-1],{className:"".concat(b,"-item-before-jump-next")}),Ee.push(Re)),be!==1&&Ee.unshift(Ie),we!==je&&Ee.push($)}var re=null;G&&(re=e.a.createElement("li",{className:"".concat(b,"-total-text")},G(S,[S===0?0:(Le-1)*Ve+1,Le*Ve>S?S:Le*Ve])));var Z=!this.hasPrev()||!je,J=!this.hasNext()||!je;return e.a.createElement("ul",Object(Q.a)({className:g()(b,p,Object(H.a)({},"".concat(b,"-disabled"),A)),style:d,unselectable:"unselectable",ref:this.savePaginationNode},Pe),re,e.a.createElement("li",{title:j?L.prev_page:null,onClick:this.prev,tabIndex:Z?null:0,onKeyPress:this.runIfEnterPrev,className:g()("".concat(b,"-prev"),Object(H.a)({},"".concat(b,"-disabled"),Z)),"aria-disabled":Z},this.renderPrev(_e)),Ee,e.a.createElement("li",{title:j?L.next_page:null,onClick:this.next,tabIndex:J?null:0,onKeyPress:this.runIfEnterNext,className:g()("".concat(b,"-next"),Object(H.a)({},"".concat(b,"-disabled"),J)),"aria-disabled":J},this.renderNext(De)),e.a.createElement(l,{disabled:A,locale:L,rootPrefixCls:b,selectComponentClass:xe,selectPrefixCls:Se,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Le,pageSize:Ve,pageSizeOptions:de,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:ue}))}}],[{key:"getDerivedStateFromProps",value:function(o,u){var b={};if("current"in o&&(b.current=o.current,o.current!==u.current&&(b.currentInputValue=b.current)),"pageSize"in o&&o.pageSize!==u.pageSize){var p=u.current,d=E(o.pageSize,u,o);p=p>d?d:p,"current"in o||(b.current=p,b.currentInputValue=p),b.pageSize=o.pageSize}return b}}]),f}(e.a.Component);y.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:n,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:n,locale:a.a,style:{},itemRender:t,totalBoundaryShowSizeChanger:50};var m=y},"6RRn":function(Ne,ne,U){"use strict";var Q=U("wCXF"),H=U("n6Qo");U.d(ne,"b",function(){return H.a});var I=U("IBYe"),W=U("6eGT"),P=U("hW8S");U.d(ne,"a",function(){return P.a}),ne.c=Q.b},"6UM0":function(Ne,ne,U){var Q,H;(function(){var I;(function(){"use strict";var P=[function(e,C,g){var v=g(1).Beautifier,c=g(5).Options;function s(i,l){var a=new v(i,l);return a.beautify()}e.exports=s,e.exports.defaultOptions=function(){return new c}},function(e,C,g){var v=g(2).Output,c=g(3).Token,s=g(4),i=g(5).Options,l=g(7).Tokenizer,a=g(7).line_starters,n=g(7).positionable_operators,r=g(7).TOKEN;function t(O,j){return j.indexOf(O)!==-1}function E(O){return O.replace(/^\s+/g,"")}function y(O){for(var j={},G=0;G<O.length;G++)j[O[G].replace(/-/g,"_")]=O[G];return j}function m(O,j){return O&&O.type===r.RESERVED&&O.text===j}function T(O,j){return O&&O.type===r.RESERVED&&t(O.text,j)}var _=["case","return","do","if","throw","else","await","break","continue","async"],f=["before-newline","after-newline","preserve-newline"],h=y(f),o=[h.before_newline,h.preserve_newline],u={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function b(O,j){if(j.multiline_frame||j.mode===u.ForInitializer||j.mode===u.Conditional)return;O.remove_indent(j.start_line_index)}function p(O){O=O.replace(s.allLineBreaks,`
`);for(var j=[],G=O.indexOf(`
`);G!==-1;)j.push(O.substring(0,G)),O=O.substring(G+1),G=O.indexOf(`
`);return O.length&&j.push(O),j}function d(O){return O===u.ArrayLiteral}function A(O){return t(O,[u.Expression,u.ForInitializer,u.Conditional])}function D(O,j){for(var G=0;G<O.length;G++){var X=O[G].trim();if(X.charAt(0)!==j)return!1}return!0}function S(O,j){for(var G=0,X=O.length,te;G<X;G++)if(te=O[G],te&&te.indexOf(j)!==0)return!1;return!0}function L(O,j){j=j||{},this._source_text=O||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new i(j)}L.prototype.create_flags=function(O,j){var G=0;O&&(G=O.indentation_level,!this._output.just_added_newline()&&O.line_indent_level>G&&(G=O.line_indent_level));var X={mode:j,parent:O,last_token:O?O.last_token:new c(r.START_BLOCK,""),last_word:O?O.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:G,alignment:0,line_indent_level:O?O.line_indent_level:G,start_line_index:this._output.get_line_number(),ternary_depth:0};return X},L.prototype._reset=function(O){var j=O.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new v(this._options,j),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(u.BlockStatement);var G=new l(O,this._options);return this._tokens=G.tokenize(),O},L.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var O,j=this._reset(this._source_text),G=this._options.eol;this._options.eol==="auto"&&(G=`
`,j&&s.lineBreak.test(j||"")&&(G=j.match(s.lineBreak)[0]));for(var X=this._tokens.next();X;)this.handle_token(X),this._last_last_text=this._flags.last_token.text,this._flags.last_token=X,X=this._tokens.next();return O=this._output.get_code(G),O},L.prototype.handle_token=function(O,j){O.type===r.START_EXPR?this.handle_start_expr(O):O.type===r.END_EXPR?this.handle_end_expr(O):O.type===r.START_BLOCK?this.handle_start_block(O):O.type===r.END_BLOCK?this.handle_end_block(O):O.type===r.WORD?this.handle_word(O):O.type===r.RESERVED?this.handle_word(O):O.type===r.SEMICOLON?this.handle_semicolon(O):O.type===r.STRING?this.handle_string(O):O.type===r.EQUALS?this.handle_equals(O):O.type===r.OPERATOR?this.handle_operator(O):O.type===r.COMMA?this.handle_comma(O):O.type===r.BLOCK_COMMENT?this.handle_block_comment(O,j):O.type===r.COMMENT?this.handle_comment(O,j):O.type===r.DOT?this.handle_dot(O):O.type===r.EOF?this.handle_eof(O):O.type===r.UNKNOWN?this.handle_unknown(O,j):this.handle_unknown(O,j)},L.prototype.handle_whitespace_and_comments=function(O,j){var G=O.newlines,X=this._options.keep_array_indentation&&d(this._flags.mode);if(O.comments_before)for(var te=O.comments_before.next();te;)this.handle_whitespace_and_comments(te,j),this.handle_token(te,j),te=O.comments_before.next();if(X)for(var fe=0;fe<G;fe+=1)this.print_newline(fe>0,j);else if(this._options.max_preserve_newlines&&G>this._options.max_preserve_newlines&&(G=this._options.max_preserve_newlines),this._options.preserve_newlines&&G>1){this.print_newline(!1,j);for(var ve=1;ve<G;ve+=1)this.print_newline(!0,j)}};var M=["async","break","continue","return","throw","yield"];L.prototype.allow_wrap_or_preserved_newline=function(O,j){if(j=j===void 0?!1:j,this._output.just_added_newline())return;var G=this._options.preserve_newlines&&O.newlines||j,X=t(this._flags.last_token.text,n)||t(O.text,n);if(X){var te=t(this._flags.last_token.text,n)&&t(this._options.operator_position,o)||t(O.text,n);G=G&&te}if(G)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(T(this._flags.last_token,M))return;this._output.set_wrap_point()}},L.prototype.print_newline=function(O,j){if(!j&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==r.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var G=this._tokens.peek();this._flags.mode===u.Statement&&!(this._flags.if_block&&m(G,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(O)&&(this._flags.multiline_frame=!0)},L.prototype.print_token_line_indentation=function(O){this._output.just_added_newline()&&(this._options.keep_array_indentation&&O.newlines&&(O.text==="["||d(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(O.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},L.prototype.print_token=function(O){if(this._output.raw){this._output.add_raw_token(O);return}if(this._options.comma_first&&O.previous&&O.previous.type===r.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var j=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(j),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(O),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(O),this._output.non_breaking_space=!0,this._output.add_token(O.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},L.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},L.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},L.prototype.set_mode=function(O){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,O),this._flags=this.create_flags(this._previous_flags,O),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},L.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===u.Statement&&b(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},L.prototype.start_of_object_property=function(){return this._flags.parent.mode===u.ObjectLiteral&&this._flags.mode===u.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||T(this._flags.last_token,["get","set"]))},L.prototype.start_of_statement=function(O){var j=!1;return j=j||T(this._flags.last_token,["var","let","const"])&&O.type===r.WORD,j=j||m(this._flags.last_token,"do"),j=j||!(this._flags.parent.mode===u.ObjectLiteral&&this._flags.mode===u.Statement)&&T(this._flags.last_token,M)&&!O.newlines,j=j||m(this._flags.last_token,"else")&&!(m(O,"if")&&!O.comments_before),j=j||this._flags.last_token.type===r.END_EXPR&&(this._previous_flags.mode===u.ForInitializer||this._previous_flags.mode===u.Conditional),j=j||this._flags.last_token.type===r.WORD&&this._flags.mode===u.BlockStatement&&!this._flags.in_case&&!(O.text==="--"||O.text==="++")&&this._last_last_text!=="function"&&O.type!==r.WORD&&O.type!==r.RESERVED,j=j||this._flags.mode===u.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||T(this._flags.last_token,["get","set"])),j?(this.set_mode(u.Statement),this.indent(),this.handle_whitespace_and_comments(O,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O,T(O,["do","for","if","while"])),!0):!1},L.prototype.handle_start_expr=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O);var j=u.Expression;if(O.text==="["){if(this._flags.last_token.type===r.WORD||this._flags.last_token.text===")"){T(this._flags.last_token,a)&&(this._output.space_before_token=!0),this.print_token(O),this.set_mode(j),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}j=u.ArrayLiteral,d(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),t(this._flags.last_token.type,[r.START_EXPR,r.END_EXPR,r.WORD,r.OPERATOR,r.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===r.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,j=u.ForInitializer):t(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,j=u.Conditional):t(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&O.whitespace_before===""?this._output.space_before_token=!1:(t(this._flags.last_token.text,a)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===r.EQUALS||this._flags.last_token.type===r.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O);else if(this._flags.last_token.type===r.WORD){this._output.space_before_token=!1;var G=this._tokens.peek(-3);if(this._options.space_after_named_function&&G){var X=this._tokens.peek(-4);T(G,["async","function"])||G.text==="*"&&T(X,["async","function"])?this._output.space_before_token=!0:this._flags.mode===u.ObjectLiteral?(G.text==="{"||G.text===","||G.text==="*"&&(X.text==="{"||X.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(O);(this._flags.last_token.type===r.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(t(this._last_last_text,["function","yield"])||this._flags.mode===u.ObjectLiteral&&t(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===r.START_BLOCK?this.print_newline():(this._flags.last_token.type===r.END_EXPR||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===r.COMMA)&&this.allow_wrap_or_preserved_newline(O,O.newlines),this.print_token(O),this.set_mode(j),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},L.prototype.handle_end_expr=function(O){for(;this._flags.mode===u.Statement;)this.restore_mode();this.handle_whitespace_and_comments(O),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(O,O.text==="]"&&d(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===r.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(O),this.restore_mode(),b(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===u.Conditional&&(this._previous_flags.mode=u.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},L.prototype.handle_start_block=function(O){this.handle_whitespace_and_comments(O);var j=this._tokens.peek(),G=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===r.END_EXPR?(this.set_mode(u.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(u.BlockStatement):G&&(t(G.text,[":",","])&&t(j.type,[r.STRING,r.WORD,r.RESERVED])||t(j.text,["get","set","..."])&&t(G.type,[r.WORD,r.RESERVED]))?t(this._last_last_text,["class","interface"])&&!t(G.text,[":",","])?this.set_mode(u.BlockStatement):this.set_mode(u.ObjectLiteral):this._flags.last_token.type===r.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(u.BlockStatement):t(this._flags.last_token.type,[r.EQUALS,r.START_EXPR,r.COMMA,r.OPERATOR])||T(this._flags.last_token,["return","throw","import","default"])?this.set_mode(u.ObjectLiteral):this.set_mode(u.BlockStatement),this._flags.last_token&&(T(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var X=!j.comments_before&&j.text==="}",te=X&&this._flags.last_word==="function"&&this._flags.last_token.type===r.END_EXPR;if(this._options.brace_preserve_inline){var fe=0,ve=null;this._flags.inline_frame=!0;do if(fe+=1,ve=this._tokens.peek(fe-1),ve.newlines){this._flags.inline_frame=!1;break}while(ve.type!==r.EOF&&!(ve.type===r.END_BLOCK&&ve.opened===O))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&O.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==r.OPERATOR&&(te||this._flags.last_token.type===r.EQUALS||T(this._flags.last_token,_)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(d(this._previous_flags.mode)&&(this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.COMMA)&&((this._flags.last_token.type===r.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(O),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==r.OPERATOR&&this._flags.last_token.type!==r.START_EXPR&&(this._flags.last_token.type===r.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(O),this.indent(),!X&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},L.prototype.handle_end_block=function(O){for(this.handle_whitespace_and_comments(O);this._flags.mode===u.Statement;)this.restore_mode();var j=this._flags.last_token.type===r.START_BLOCK;this._flags.inline_frame&&!j?this._output.space_before_token=!0:this._options.brace_style==="expand"?j||this.print_newline():j||(d(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(O)},L.prototype.handle_word=function(O){if(O.type===r.RESERVED){if(t(O.text,["set","get"])&&this._flags.mode!==u.ObjectLiteral)O.type=r.WORD;else if(O.text==="import"&&t(this._tokens.peek().text,["(","."]))O.type=r.WORD;else if(t(O.text,["as","from"])&&!this._flags.import_block)O.type=r.WORD;else if(this._flags.mode===u.ObjectLiteral){var j=this._tokens.peek();j.text===":"&&(O.type=r.WORD)}}if(this.start_of_statement(O)?T(this._flags.last_token,["var","let","const"])&&O.type===r.WORD&&(this._flags.declaration_statement=!0):O.newlines&&!A(this._flags.mode)&&(this._flags.last_token.type!==r.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==r.EQUALS&&(this._options.preserve_newlines||!T(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(O),this.print_newline()):this.handle_whitespace_and_comments(O),this._flags.do_block&&!this._flags.do_while)if(m(O,"while")){this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&m(O,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===u.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&T(O,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(O),this._flags.in_case=!0;return}if((this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.EQUALS||this._flags.last_token.type===r.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O)),m(O,"function")){(t(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(t(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===r.OPERATOR))&&(!this._output.just_added_blankline()&&!O.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===r.RESERVED||this._flags.last_token.type===r.WORD?T(this._flags.last_token,["get","set","new","export"])||T(this._flags.last_token,M)?this._output.space_before_token=!0:m(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===r.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(A(this._flags.mode)||d(this._flags.mode))||this.print_newline(),this.print_token(O),this._flags.last_word=O.text;return}var G="NONE";if(this._flags.last_token.type===r.END_BLOCK?this._previous_flags.inline_frame?G="SPACE":T(O,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&O.newlines?G="NEWLINE":(G="SPACE",this._output.space_before_token=!0):G="NEWLINE":this._flags.last_token.type===r.SEMICOLON&&this._flags.mode===u.BlockStatement?G="NEWLINE":this._flags.last_token.type===r.SEMICOLON&&A(this._flags.mode)?G="SPACE":this._flags.last_token.type===r.STRING?G="NEWLINE":this._flags.last_token.type===r.RESERVED||this._flags.last_token.type===r.WORD||this._flags.last_token.text==="*"&&(t(this._last_last_text,["function","yield"])||this._flags.mode===u.ObjectLiteral&&t(this._last_last_text,["{",","]))?G="SPACE":this._flags.last_token.type===r.START_BLOCK?this._flags.inline_frame?G="SPACE":G="NEWLINE":this._flags.last_token.type===r.END_EXPR&&(this._output.space_before_token=!0,G="NEWLINE"),T(O,a)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?G="SPACE":G="NEWLINE"),T(O,["else","catch","finally"]))if((!(this._flags.last_token.type===r.END_BLOCK&&this._previous_flags.mode===u.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&O.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var X=this._output.current_line;X.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else G==="NEWLINE"?T(this._flags.last_token,_)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&T(O,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==r.END_EXPR?(this._flags.last_token.type!==r.START_EXPR||!T(O,["var","let","const"]))&&this._flags.last_token.text!==":"&&(m(O,"if")&&m(O.previous,"else")?this._output.space_before_token=!0:this.print_newline()):T(O,a)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&d(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():G==="SPACE"&&(this._output.space_before_token=!0);O.previous&&(O.previous.type===r.WORD||O.previous.type===r.RESERVED)&&(this._output.space_before_token=!0),this.print_token(O),this._flags.last_word=O.text,O.type===r.RESERVED&&(O.text==="do"?this._flags.do_block=!0:O.text==="if"?this._flags.if_block=!0:O.text==="import"?this._flags.import_block=!0:this._flags.import_block&&m(O,"from")&&(this._flags.import_block=!1))},L.prototype.handle_semicolon=function(O){this.start_of_statement(O)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(O);for(var j=this._tokens.peek();this._flags.mode===u.Statement&&!(this._flags.if_block&&m(j,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(O)},L.prototype.handle_string=function(O){O.text.startsWith("`")&&O.newlines===0&&O.whitespace_before===""&&(O.previous.text===")"||this._flags.last_token.type===r.WORD)||(this.start_of_statement(O)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(O),this._flags.last_token.type===r.RESERVED||this._flags.last_token.type===r.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.EQUALS||this._flags.last_token.type===r.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O):O.text.startsWith("`")&&this._flags.last_token.type===r.END_EXPR&&(O.previous.text==="]"||O.previous.text===")")&&O.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(O)},L.prototype.handle_equals=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0},L.prototype.handle_comma=function(O){this.handle_whitespace_and_comments(O,!0),this.print_token(O),this._output.space_before_token=!0,this._flags.declaration_statement?(A(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(O)):this._flags.mode===u.ObjectLiteral||this._flags.mode===u.Statement&&this._flags.parent.mode===u.ObjectLiteral?(this._flags.mode===u.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(O)},L.prototype.handle_operator=function(O){var j=O.text==="*"&&(T(this._flags.last_token,["function","yield"])||t(this._flags.last_token.type,[r.START_BLOCK,r.COMMA,r.END_BLOCK,r.SEMICOLON])),G=t(O.text,["-","+"])&&(t(this._flags.last_token.type,[r.START_BLOCK,r.START_EXPR,r.EQUALS,r.OPERATOR])||t(this._flags.last_token.text,a)||this._flags.last_token.text===",");if(!this.start_of_statement(O)){var X=!j;this.handle_whitespace_and_comments(O,X)}if(O.text==="*"&&this._flags.last_token.type===r.DOT){this.print_token(O);return}if(O.text==="::"){this.print_token(O);return}if(this._flags.last_token.type===r.OPERATOR&&t(this._options.operator_position,o)&&this.allow_wrap_or_preserved_newline(O),O.text===":"&&this._flags.in_case){this.print_token(O),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==r.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var te=!0,fe=!0,ve=!1;if(O.text===":"?this._flags.ternary_depth===0?te=!1:(this._flags.ternary_depth-=1,ve=!0):O.text==="?"&&(this._flags.ternary_depth+=1),!G&&!j&&this._options.preserve_newlines&&t(O.text,n)){var he=O.text===":",xe=he&&ve,Se=he&&!ve;switch(this._options.operator_position){case h.before_newline:this._output.space_before_token=!Se,this.print_token(O),(!he||xe)&&this.allow_wrap_or_preserved_newline(O),this._output.space_before_token=!0;return;case h.after_newline:this._output.space_before_token=!0,!he||xe?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(O):this._output.space_before_token=!1,this.print_token(O),this._output.space_before_token=!0;return;case h.preserve_newline:Se||this.allow_wrap_or_preserved_newline(O),te=!(this._output.just_added_newline()||Se),this._output.space_before_token=te,this.print_token(O),this._output.space_before_token=!0;return}}if(j){this.allow_wrap_or_preserved_newline(O),te=!1;var de=this._tokens.peek();fe=de&&t(de.type,[r.WORD,r.RESERVED])}else if(O.text==="...")this.allow_wrap_or_preserved_newline(O),te=this._flags.last_token.type===r.START_BLOCK,fe=!1;else if(t(O.text,["--","++","!","~"])||G){if((this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR)&&this.allow_wrap_or_preserved_newline(O),te=!1,fe=!1,O.newlines&&(O.text==="--"||O.text==="++"||O.text==="~")){var ie=T(this._flags.last_token,_)&&O.newlines;ie&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ie,!0)}this._flags.last_token.text===";"&&A(this._flags.mode)&&(te=!0),this._flags.last_token.type===r.RESERVED?te=!0:this._flags.last_token.type===r.END_EXPR?te=!(this._flags.last_token.text==="]"&&(O.text==="--"||O.text==="++")):this._flags.last_token.type===r.OPERATOR&&(te=t(O.text,["--","-","++","+"])&&t(this._flags.last_token.text,["--","-","++","+"]),t(O.text,["+","-"])&&t(this._flags.last_token.text,["--","++"])&&(fe=!0)),(this._flags.mode===u.BlockStatement&&!this._flags.inline_frame||this._flags.mode===u.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||te,this.print_token(O),this._output.space_before_token=fe},L.prototype.handle_block_comment=function(O,j){if(this._output.raw){this._output.add_raw_token(O),O.directives&&O.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(O.directives){this.print_newline(!1,j),this.print_token(O),O.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!s.newline.test(O.text)&&!O.newlines){this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0;return}else this.print_block_commment(O,j)},L.prototype.print_block_commment=function(O,j){var G=p(O.text),X,te=!1,fe=!1,ve=O.whitespace_before,he=ve.length;if(this.print_newline(!1,j),this.print_token_line_indentation(O),this._output.add_token(G[0]),this.print_newline(!1,j),G.length>1){for(G=G.slice(1),te=D(G,"*"),fe=S(G,ve),te&&(this._flags.alignment=1),X=0;X<G.length;X++)te?(this.print_token_line_indentation(O),this._output.add_token(E(G[X]))):fe&&G[X]?(this.print_token_line_indentation(O),this._output.add_token(G[X].substring(he))):(this._output.current_line.set_indent(-1),this._output.add_token(G[X])),this.print_newline(!1,j);this._flags.alignment=0}},L.prototype.handle_comment=function(O,j){O.newlines?this.print_newline(!1,j):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(O),this.print_newline(!1,j)},L.prototype.handle_dot=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),T(this._flags.last_token,_)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(O,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(O)},L.prototype.handle_unknown=function(O,j){this.print_token(O),O.text[O.text.length-1]===`
`&&this.print_newline(!1,j)},L.prototype.handle_eof=function(O){for(;this._flags.mode===u.Statement;)this.restore_mode();this.handle_whitespace_and_comments(O)},e.exports.Beautifier=L},function(e){function C(c){this.__parent=c,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}C.prototype.clone_empty=function(){var c=new C(this.__parent);return c.set_indent(this.__indent_count,this.__alignment_count),c},C.prototype.item=function(c){return c<0?this.__items[this.__items.length+c]:this.__items[c]},C.prototype.has_match=function(c){for(var s=this.__items.length-1;s>=0;s--)if(this.__items[s].match(c))return!0;return!1},C.prototype.set_indent=function(c,s){this.is_empty()&&(this.__indent_count=c||0,this.__alignment_count=s||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},C.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},C.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},C.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var c=this.__parent.current_line;return c.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),c.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),c.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,c.__items[0]===" "&&(c.__items.splice(0,1),c.__character_count-=1),!0}return!1},C.prototype.is_empty=function(){return this.__items.length===0},C.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},C.prototype.push=function(c){this.__items.push(c);var s=c.lastIndexOf(`
`);s!==-1?this.__character_count=c.length-s:this.__character_count+=c.length},C.prototype.pop=function(){var c=null;return this.is_empty()||(c=this.__items.pop(),this.__character_count-=c.length),c},C.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},C.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},C.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},C.prototype.toString=function(){var c="";return this.is_empty()?this.__parent.indent_empty_lines&&(c=this.__parent.get_indent_string(this.__indent_count)):(c=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),c+=this.__items.join("")),c};function g(c,s){this.__cache=[""],this.__indent_size=c.indent_size,this.__indent_string=c.indent_char,c.indent_with_tabs||(this.__indent_string=new Array(c.indent_size+1).join(c.indent_char)),s=s||"",c.indent_level>0&&(s=new Array(c.indent_level+1).join(this.__indent_string)),this.__base_string=s,this.__base_string_length=s.length}g.prototype.get_indent_size=function(c,s){var i=this.__base_string_length;return s=s||0,c<0&&(i=0),i+=c*this.__indent_size,i+=s,i},g.prototype.get_indent_string=function(c,s){var i=this.__base_string;return s=s||0,c<0&&(c=0,i=""),s+=c*this.__indent_size,this.__ensure_cache(s),i+=this.__cache[s],i},g.prototype.__ensure_cache=function(c){for(;c>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var c=this.__cache.length,s=0,i="";this.__indent_size&&c>=this.__indent_size&&(s=Math.floor(c/this.__indent_size),c-=s*this.__indent_size,i=new Array(s+1).join(this.__indent_string)),c&&(i+=new Array(c+1).join(" ")),this.__cache.push(i)};function v(c,s){this.__indent_cache=new g(c,s),this.raw=!1,this._end_with_newline=c.end_with_newline,this.indent_size=c.indent_size,this.wrap_line_length=c.wrap_line_length,this.indent_empty_lines=c.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new C(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}v.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},v.prototype.get_line_number=function(){return this.__lines.length},v.prototype.get_indent_string=function(c,s){return this.__indent_cache.get_indent_string(c,s)},v.prototype.get_indent_size=function(c,s){return this.__indent_cache.get_indent_size(c,s)},v.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},v.prototype.add_new_line=function(c){return this.is_empty()||!c&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},v.prototype.get_code=function(c){this.trim(!0);var s=this.current_line.pop();s&&(s[s.length-1]===`
`&&(s=s.replace(/\n+$/g,"")),this.current_line.push(s)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join(`
`);return c!==`
`&&(i=i.replace(/[\n]/g,c)),i},v.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},v.prototype.set_indent=function(c,s){return c=c||0,s=s||0,this.next_line.set_indent(c,s),this.__lines.length>1?(this.current_line.set_indent(c,s),!0):(this.current_line.set_indent(),!1)},v.prototype.add_raw_token=function(c){for(var s=0;s<c.newlines;s++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(c.whitespace_before),this.current_line.push(c.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},v.prototype.add_token=function(c){this.__add_space_before_token(),this.current_line.push(c),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},v.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},v.prototype.remove_indent=function(c){for(var s=this.__lines.length;c<s;)this.__lines[c]._remove_indent(),c++;this.current_line._remove_wrap_indent()},v.prototype.trim=function(c){for(c=c===void 0?!1:c,this.current_line.trim();c&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},v.prototype.just_added_newline=function(){return this.current_line.is_empty()},v.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},v.prototype.ensure_empty_line_above=function(c,s){for(var i=this.__lines.length-2;i>=0;){var l=this.__lines[i];if(l.is_empty())break;if(l.item(0).indexOf(c)!==0&&l.item(-1)!==s){this.__lines.splice(i+1,0,new C(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},e.exports.Output=v},function(e){function C(g,v,c,s){this.type=g,this.text=v,this.comments_before=null,this.newlines=c||0,this.whitespace_before=s||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}e.exports.Token=C},function(e,C){var g="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",v="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",c="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",s="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",i="(?:\\\\u[0-9a-fA-F]{4}|["+g+c+"])",l="(?:\\\\u[0-9a-fA-F]{4}|["+v+c+s+"])*";C.identifier=new RegExp(i+l,"g"),C.identifierStart=new RegExp(i),C.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+v+c+s+"])+");var a=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;C.newline=/[\n\r\u2028\u2029]/,C.lineBreak=new RegExp(`\r
|`+C.newline.source),C.allLineBreaks=new RegExp(C.lineBreak.source,"g")},function(e,C,g){var v=g(6).Options,c=["before-newline","after-newline","preserve-newline"];function s(i){v.call(this,i,"js");var l=this.raw_options.brace_style||null;l==="expand-strict"?this.raw_options.brace_style="expand":l==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var a=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var n=0;n<a.length;n++)a[n]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=a[n];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",c),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}s.prototype=new v,e.exports.Options=s},function(e){function C(c,s){this.raw_options=g(c,s),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}C.prototype._get_array=function(c,s){var i=this.raw_options[c],l=s||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(l=i.concat()):typeof i=="string"&&(l=i.split(/[^a-zA-Z0-9_\/\-]+/)),l},C.prototype._get_boolean=function(c,s){var i=this.raw_options[c],l=i===void 0?!!s:!!i;return l},C.prototype._get_characters=function(c,s){var i=this.raw_options[c],l=s||"";return typeof i=="string"&&(l=i.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),l},C.prototype._get_number=function(c,s){var i=this.raw_options[c];s=parseInt(s,10),isNaN(s)&&(s=0);var l=parseInt(i,10);return isNaN(l)&&(l=s),l},C.prototype._get_selection=function(c,s,i){var l=this._get_selection_list(c,s,i);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+c+`' can only be one of the following values:
`+s+`
You passed in: '`+this.raw_options[c]+"'");return l[0]},C.prototype._get_selection_list=function(c,s,i){if(!s||s.length===0)throw new Error("Selection list cannot be empty.");if(i=i||[s[0]],!this._is_valid_selection(i,s))throw new Error("Invalid Default Value!");var l=this._get_array(c,i);if(!this._is_valid_selection(l,s))throw new Error("Invalid Option Value: The option '"+c+`' can contain only the following values:
`+s+`
You passed in: '`+this.raw_options[c]+"'");return l},C.prototype._is_valid_selection=function(c,s){return c.length&&s.length&&!c.some(function(i){return s.indexOf(i)===-1})};function g(c,s){var i={};c=v(c);var l;for(l in c)l!==s&&(i[l]=c[l]);if(s&&c[s])for(l in c[s])i[l]=c[s][l];return i}function v(c){var s={},i;for(i in c){var l=i.replace(/-/g,"_");s[l]=c[i]}return s}e.exports.Options=C,e.exports.normalizeOpts=v,e.exports.mergeOpts=g},function(e,C,g){var v=g(8).InputScanner,c=g(9).Tokenizer,s=g(9).TOKEN,i=g(13).Directives,l=g(4),a=g(12).Pattern,n=g(14).TemplatablePattern;function r(D,S){return S.indexOf(D)!==-1}var t={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:s.START,RAW:s.RAW,EOF:s.EOF},E=new i(/\/\*/,/\*\//),y=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,m=/[0-9]/,T=/[^\d\.]/,_=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),f=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";f=f.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),f="\\?\\.(?!\\d) "+f,f=f.replace(/ /g,"|");var h=new RegExp(f),o="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),u=o.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),b=new RegExp("^(?:"+u.join("|")+")$"),p,d=function(D,S){c.call(this,D,S),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var L=new a(this._input),M=new n(this._input).read_options(this._options);this.__patterns={template:M,identifier:M.starting_with(l.identifier).matching(l.identifierMatch),number:L.matching(y),punct:L.matching(h),comment:L.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:L.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:L.matching(/<!--/),html_comment_end:L.matching(/-->/),include:L.starting_with(/#include/).until_after(l.lineBreak),shebang:L.starting_with(/#!/).until_after(l.lineBreak),xml:L.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:M.until(/['\\\n\r\u2028\u2029]/),double_quote:M.until(/["\\\n\r\u2028\u2029]/),template_text:M.until(/[`\\$]/),template_expression:M.until(/[`}\\]/)}};d.prototype=new c,d.prototype._is_comment=function(D){return D.type===t.COMMENT||D.type===t.BLOCK_COMMENT||D.type===t.UNKNOWN},d.prototype._is_opening=function(D){return D.type===t.START_BLOCK||D.type===t.START_EXPR},d.prototype._is_closing=function(D,S){return(D.type===t.END_BLOCK||D.type===t.END_EXPR)&&S&&(D.text==="]"&&S.text==="["||D.text===")"&&S.text==="("||D.text==="}"&&S.text==="{")},d.prototype._reset=function(){p=!1},d.prototype._get_next_token=function(D,S){var L=null;this._readWhitespace();var M=this._input.peek();return M===null?this._create_token(t.EOF,""):(L=L||this._read_non_javascript(M),L=L||this._read_string(M),L=L||this._read_word(D),L=L||this._read_singles(M),L=L||this._read_comment(M),L=L||this._read_regexp(M,D),L=L||this._read_xml(M,D),L=L||this._read_punctuation(),L=L||this._create_token(t.UNKNOWN,this._input.next()),L)},d.prototype._read_word=function(D){var S;if(S=this.__patterns.identifier.read(),S!=="")return S=S.replace(l.allLineBreaks,`
`),!(D.type===t.DOT||D.type===t.RESERVED&&(D.text==="set"||D.text==="get"))&&b.test(S)?(S==="in"||S==="of")&&(D.type===t.WORD||D.type===t.STRING)?this._create_token(t.OPERATOR,S):this._create_token(t.RESERVED,S):this._create_token(t.WORD,S);if(S=this.__patterns.number.read(),S!=="")return this._create_token(t.WORD,S)},d.prototype._read_singles=function(D){var S=null;return D==="("||D==="["?S=this._create_token(t.START_EXPR,D):D===")"||D==="]"?S=this._create_token(t.END_EXPR,D):D==="{"?S=this._create_token(t.START_BLOCK,D):D==="}"?S=this._create_token(t.END_BLOCK,D):D===";"?S=this._create_token(t.SEMICOLON,D):D==="."&&T.test(this._input.peek(1))?S=this._create_token(t.DOT,D):D===","&&(S=this._create_token(t.COMMA,D)),S&&this._input.next(),S},d.prototype._read_punctuation=function(){var D=this.__patterns.punct.read();if(D!=="")return D==="="?this._create_token(t.EQUALS,D):D==="?."?this._create_token(t.DOT,D):this._create_token(t.OPERATOR,D)},d.prototype._read_non_javascript=function(D){var S="";if(D==="#"){if(this._is_first_token()&&(S=this.__patterns.shebang.read(),S))return this._create_token(t.UNKNOWN,S.trim()+`
`);if(S=this.__patterns.include.read(),S)return this._create_token(t.UNKNOWN,S.trim()+`
`);D=this._input.next();var L="#";if(this._input.hasNext()&&this._input.testChar(m)){do D=this._input.next(),L+=D;while(this._input.hasNext()&&D!=="#"&&D!=="=");return D==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(L+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(L+="{}",this._input.next(),this._input.next())),this._create_token(t.WORD,L)}this._input.back()}else if(D==="<"&&this._is_first_token()){if(S=this.__patterns.html_comment_start.read(),S){for(;this._input.hasNext()&&!this._input.testChar(l.newline);)S+=this._input.next();return p=!0,this._create_token(t.COMMENT,S)}}else if(p&&D==="-"&&(S=this.__patterns.html_comment_end.read(),S))return p=!1,this._create_token(t.COMMENT,S);return null},d.prototype._read_comment=function(D){var S=null;if(D==="/"){var L="";if(this._input.peek(1)==="*"){L=this.__patterns.block_comment.read();var M=E.get_directives(L);M&&M.ignore==="start"&&(L+=E.readIgnored(this._input)),L=L.replace(l.allLineBreaks,`
`),S=this._create_token(t.BLOCK_COMMENT,L),S.directives=M}else this._input.peek(1)==="/"&&(L=this.__patterns.comment.read(),S=this._create_token(t.COMMENT,L))}return S},d.prototype._read_string=function(D){if(D==="`"||D==="'"||D==='"'){var S=this._input.next();return this.has_char_escapes=!1,D==="`"?S+=this._read_string_recursive("`",!0,"${"):S+=this._read_string_recursive(D),this.has_char_escapes&&this._options.unescape_strings&&(S=A(S)),this._input.peek()===D&&(S+=this._input.next()),S=S.replace(l.allLineBreaks,`
`),this._create_token(t.STRING,S)}return null},d.prototype._allow_regexp_or_xml=function(D){return D.type===t.RESERVED&&r(D.text,["return","case","throw","else","do","typeof","yield"])||D.type===t.END_EXPR&&D.text===")"&&D.opened.previous.type===t.RESERVED&&r(D.opened.previous.text,["if","while","for"])||r(D.type,[t.COMMENT,t.START_EXPR,t.START_BLOCK,t.START,t.END_BLOCK,t.OPERATOR,t.EQUALS,t.EOF,t.SEMICOLON,t.COMMA])},d.prototype._read_regexp=function(D,S){if(D==="/"&&this._allow_regexp_or_xml(S)){for(var L=this._input.next(),M=!1,O=!1;this._input.hasNext()&&(M||O||this._input.peek()!==D)&&!this._input.testChar(l.newline);)L+=this._input.peek(),M?M=!1:(M=this._input.peek()==="\\",this._input.peek()==="["?O=!0:this._input.peek()==="]"&&(O=!1)),this._input.next();return this._input.peek()===D&&(L+=this._input.next(),L+=this._input.read(l.identifier)),this._create_token(t.STRING,L)}return null},d.prototype._read_xml=function(D,S){if(this._options.e4x&&D==="<"&&this._allow_regexp_or_xml(S)){var L="",M=this.__patterns.xml.read_match();if(M){for(var O=M[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),j=O.indexOf("{")===0,G=0;M;){var X=!!M[1],te=M[2],fe=!!M[M.length-1]||te.slice(0,8)==="![CDATA[";if(!fe&&(te===O||j&&te.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(X?--G:++G),L+=M[0],G<=0)break;M=this.__patterns.xml.read_match()}return M||(L+=this._input.match(/[\s\S]*/g)[0]),L=L.replace(l.allLineBreaks,`
`),this._create_token(t.STRING,L)}}return null};function A(D){for(var S="",L=0,M=new v(D),O=null;M.hasNext();)if(O=M.match(/([\s]|[^\\]|\\\\)+/g),O&&(S+=O[0]),M.peek()==="\\"){if(M.next(),M.peek()==="x")O=M.match(/x([0-9A-Fa-f]{2})/g);else if(M.peek()==="u")O=M.match(/u([0-9A-Fa-f]{4})/g);else{S+="\\",M.hasNext()&&(S+=M.next());continue}if(!O)return D;if(L=parseInt(O[1],16),L>126&&L<=255&&O[0].indexOf("x")===0)return D;if(L>=0&&L<32){S+="\\"+O[0];continue}else L===34||L===39||L===92?S+="\\"+String.fromCharCode(L):S+=String.fromCharCode(L)}return S}d.prototype._read_string_recursive=function(D,S,L){var M,O;D==="'"?O=this.__patterns.single_quote:D==='"'?O=this.__patterns.double_quote:D==="`"?O=this.__patterns.template_text:D==="}"&&(O=this.__patterns.template_expression);for(var j=O.read(),G="";this._input.hasNext();){if(G=this._input.next(),G===D||!S&&l.newline.test(G)){this._input.back();break}else G==="\\"&&this._input.hasNext()?(M=this._input.peek(),M==="x"||M==="u"?this.has_char_escapes=!0:M==="\r"&&this._input.peek(1)===`
`&&this._input.next(),G+=this._input.next()):L&&(L==="${"&&G==="$"&&this._input.peek()==="{"&&(G+=this._input.next()),L===G&&(D==="`"?G+=this._read_string_recursive("}",S,"`"):G+=this._read_string_recursive("`",S,"${"),this._input.hasNext()&&(G+=this._input.next())));G+=O.read(),j+=G}return j},e.exports.Tokenizer=d,e.exports.TOKEN=t,e.exports.positionable_operators=_.slice(),e.exports.line_starters=o.slice()},function(e){var C=RegExp.prototype.hasOwnProperty("sticky");function g(v){this.__input=v||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var v=null;return this.hasNext()&&(v=this.__input.charAt(this.__position),this.__position+=1),v},g.prototype.peek=function(v){var c=null;return v=v||0,v+=this.__position,v>=0&&v<this.__input_length&&(c=this.__input.charAt(v)),c},g.prototype.__match=function(v,c){v.lastIndex=c;var s=v.exec(this.__input);return s&&!(C&&v.sticky)&&(s.index!==c&&(s=null)),s},g.prototype.test=function(v,c){return c=c||0,c+=this.__position,c>=0&&c<this.__input_length?!!this.__match(v,c):!1},g.prototype.testChar=function(v,c){var s=this.peek(c);return v.lastIndex=0,s!==null&&v.test(s)},g.prototype.match=function(v){var c=this.__match(v,this.__position);return c?this.__position+=c[0].length:c=null,c},g.prototype.read=function(v,c,s){var i="",l;return v&&(l=this.match(v),l&&(i+=l[0])),c&&(l||!v)&&(i+=this.readUntil(c,s)),i},g.prototype.readUntil=function(v,c){var s="",i=this.__position;v.lastIndex=this.__position;var l=v.exec(this.__input);return l?(i=l.index,c&&(i+=l[0].length)):i=this.__input_length,s=this.__input.substring(this.__position,i),this.__position=i,s},g.prototype.readUntilAfter=function(v){return this.readUntil(v,!0)},g.prototype.get_regexp=function(v,c){var s=null,i="g";return c&&C&&(i="y"),typeof v=="string"&&v!==""?s=new RegExp(v,i):v&&(s=new RegExp(v.source,i)),s},g.prototype.get_literal_regexp=function(v){return RegExp(v.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(v){var c=this.__position,s=this.readUntilAfter(v);return this.__position=c,s},g.prototype.lookBack=function(v){var c=this.__position-1;return c>=v.length&&this.__input.substring(c-v.length,c).toLowerCase()===v},e.exports.InputScanner=g},function(e,C,g){var v=g(8).InputScanner,c=g(3).Token,s=g(10).TokenStream,i=g(11).WhitespacePattern,l={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},a=function(n,r){this._input=new v(n),this._options=r||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new i(this._input)};a.prototype.tokenize=function(){this._input.restart(),this.__tokens=new s,this._reset();for(var n,r=new c(l.START,""),t=null,E=[],y=new s;r.type!==l.EOF;){for(n=this._get_next_token(r,t);this._is_comment(n);)y.add(n),n=this._get_next_token(r,t);y.isEmpty()||(n.comments_before=y,y=new s),n.parent=t,this._is_opening(n)?(E.push(t),t=n):t&&this._is_closing(n,t)&&(n.opened=t,t.closed=n,t=E.pop(),n.parent=t),n.previous=r,r.next=n,this.__tokens.add(n),r=n}return this.__tokens},a.prototype._is_first_token=function(){return this.__tokens.isEmpty()},a.prototype._reset=function(){},a.prototype._get_next_token=function(n,r){this._readWhitespace();var t=this._input.read(/.+/g);return t?this._create_token(l.RAW,t):this._create_token(l.EOF,"")},a.prototype._is_comment=function(n){return!1},a.prototype._is_opening=function(n){return!1},a.prototype._is_closing=function(n,r){return!1},a.prototype._create_token=function(n,r){var t=new c(n,r,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return t},a.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},e.exports.Tokenizer=a,e.exports.TOKEN=l},function(e){function C(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}C.prototype.restart=function(){this.__position=0},C.prototype.isEmpty=function(){return this.__tokens_length===0},C.prototype.hasNext=function(){return this.__position<this.__tokens_length},C.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__tokens[this.__position],this.__position+=1),g},C.prototype.peek=function(g){var v=null;return g=g||0,g+=this.__position,g>=0&&g<this.__tokens_length&&(v=this.__tokens[g]),v},C.prototype.add=function(g){this.__parent_token&&(g.parent=this.__parent_token),this.__tokens.push(g),this.__tokens_length+=1},e.exports.TokenStream=C},function(e,C,g){var v=g(12).Pattern;function c(s,i){v.call(this,s,i),i?this._line_regexp=this._input.get_regexp(i._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}c.prototype=new v,c.prototype.__set_whitespace_patterns=function(s,i){s+="\\t ",i+="\\n\\r",this._match_pattern=this._input.get_regexp("["+s+i+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+i+"]")},c.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var s=this._input.read(this._match_pattern);if(s===" ")this.whitespace_before_token=" ";else if(s){var i=this.__split(this._newline_regexp,s);this.newline_count=i.length-1,this.whitespace_before_token=i[this.newline_count]}return s},c.prototype.matching=function(s,i){var l=this._create();return l.__set_whitespace_patterns(s,i),l._update(),l},c.prototype._create=function(){return new c(this._input,this)},c.prototype.__split=function(s,i){s.lastIndex=0;for(var l=0,a=[],n=s.exec(i);n;)a.push(i.substring(l,n.index)),l=n.index+n[0].length,n=s.exec(i);return l<i.length?a.push(i.substring(l,i.length)):a.push(""),a},e.exports.WhitespacePattern=c},function(e){function C(g,v){this._input=g,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,v&&(this._starting_pattern=this._input.get_regexp(v._starting_pattern,!0),this._match_pattern=this._input.get_regexp(v._match_pattern,!0),this._until_pattern=this._input.get_regexp(v._until_pattern),this._until_after=v._until_after)}C.prototype.read=function(){var g=this._input.read(this._starting_pattern);return(!this._starting_pattern||g)&&(g+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),g},C.prototype.read_match=function(){return this._input.match(this._match_pattern)},C.prototype.until_after=function(g){var v=this._create();return v._until_after=!0,v._until_pattern=this._input.get_regexp(g),v._update(),v},C.prototype.until=function(g){var v=this._create();return v._until_after=!1,v._until_pattern=this._input.get_regexp(g),v._update(),v},C.prototype.starting_with=function(g){var v=this._create();return v._starting_pattern=this._input.get_regexp(g,!0),v._update(),v},C.prototype.matching=function(g){var v=this._create();return v._match_pattern=this._input.get_regexp(g,!0),v._update(),v},C.prototype._create=function(){return new C(this._input,this)},C.prototype._update=function(){},e.exports.Pattern=C},function(e){function C(g,v){g=typeof g=="string"?g:g.source,v=typeof v=="string"?v:v.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+v,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+v,"g")}C.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var v={};this.__directive_pattern.lastIndex=0;for(var c=this.__directive_pattern.exec(g);c;)v[c[1]]=c[2],c=this.__directive_pattern.exec(g);return v},C.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=C},function(e,C,g){var v=g(12).Pattern,c={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function s(i,l){v.call(this,i,l),this.__template_pattern=null,this._disabled=Object.assign({},c),this._excluded=Object.assign({},c),l&&(this.__template_pattern=this._input.get_regexp(l.__template_pattern),this._excluded=Object.assign(this._excluded,l._excluded),this._disabled=Object.assign(this._disabled,l._disabled));var a=new v(i);this.__patterns={handlebars_comment:a.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:a.starting_with(/{{{/).until_after(/}}}/),handlebars:a.starting_with(/{{/).until_after(/}}/),php:a.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:a.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:a.starting_with(/{%/).until_after(/%}/),django_value:a.starting_with(/{{/).until_after(/}}/),django_comment:a.starting_with(/{#/).until_after(/#}/),smarty:a.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:a.starting_with(/{\*/).until_after(/\*}/),smarty_literal:a.starting_with(/{literal}/).until_after(/{\/literal}/)}}s.prototype=new v,s.prototype._create=function(){return new s(this._input,this)},s.prototype._update=function(){this.__set_templated_pattern()},s.prototype.disable=function(i){var l=this._create();return l._disabled[i]=!0,l._update(),l},s.prototype.read_options=function(i){var l=this._create();for(var a in c)l._disabled[a]=i.templating.indexOf(a)===-1;return l._update(),l},s.prototype.exclude=function(i){var l=this._create();return l._excluded[i]=!0,l._update(),l},s.prototype.read=function(){var i="";this._match_pattern?i=this._input.read(this._starting_pattern):i=this._input.read(this._starting_pattern,this.__template_pattern);for(var l=this._read_template();l;)this._match_pattern?l+=this._input.read(this._match_pattern):l+=this._input.readUntil(this.__template_pattern),i+=l,l=this._read_template();return this._until_after&&(i+=this._input.readUntilAfter(this._until_pattern)),i},s.prototype.__set_templated_pattern=function(){var i=[];this._disabled.php||i.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||i.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||i.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(i.push(this.__patterns.django._starting_pattern.source),i.push(this.__patterns.django_value._starting_pattern.source),i.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||i.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&i.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+i.join("|")+")")},s.prototype._read_template=function(){var i="",l=this._input.peek();if(l==="<"){var a=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&a==="?"&&(i=i||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&a==="%"&&(i=i||this.__patterns.erb.read())}else l==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(i=i||this.__patterns.handlebars_comment.read(),i=i||this.__patterns.handlebars_unescaped.read(),i=i||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(i=i||this.__patterns.django_value.read()),this._excluded.django||(i=i||this.__patterns.django_comment.read(),i=i||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(i=i||this.__patterns.smarty_comment.read(),i=i||this.__patterns.smarty_literal.read(),i=i||this.__patterns.smarty.read()));return i},e.exports.TemplatablePattern=s}],R={};function K(e){var C=R[e];if(C!==void 0)return C.exports;var g=R[e]={exports:{}};return P[e](g,g.exports,K),g.exports}var N=K(0);I=N})();var W=I;!(Q=[],H=function(){return{js_beautify:W}}.apply(ne,Q),H!==void 0&&(Ne.exports=H))})()},"6eGT":function(Ne,ne,U){"use strict";function Q(H){return null}ne.a=Q},"746U":function(Ne,ne,U){"use strict";U.d(ne,"f",function(){return Q}),U.d(ne,"l",function(){return H}),U.d(ne,"k",function(){return I}),U.d(ne,"j",function(){return W}),U.d(ne,"g",function(){return P}),U.d(ne,"m",function(){return R}),U.d(ne,"h",function(){return K}),U.d(ne,"n",function(){return N}),U.d(ne,"c",function(){return e}),U.d(ne,"a",function(){return C}),U.d(ne,"i",function(){return g}),U.d(ne,"o",function(){return v}),U.d(ne,"e",function(){return i}),U.d(ne,"d",function(){return l}),U.d(ne,"p",function(){return a}),U.d(ne,"b",function(){return n});function Q(r){return Array.isArray(r)}function H(r){return typeof r=="string"}function I(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)&&!(r instanceof RegExp)&&!(r instanceof Date)}function W(r){return typeof r=="number"&&!isNaN(r)}function P(r){return r===!0||r===!1}function R(r){return typeof r=="undefined"}function K(r){return!N(r)}function N(r){return R(r)||r===null}function e(r,t){if(!r)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function C(r){if(N(r))throw new Error("Assertion Failed: argument is undefined or null");return r}function g(r){return typeof r=="function"}function v(r,t){const E=Math.min(r.length,t.length);for(let y=0;y<E;y++)c(r[y],t[y])}function c(r,t){if(H(t)){if(typeof r!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(g(t)){try{if(r instanceof t)return}catch(E){}if(!N(r)&&r.constructor===t)return;if(t.length===1&&t.call(void 0,r)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function s(r){let t=[],E=Object.getPrototypeOf(r);for(;Object.prototype!==E;)t=t.concat(Object.getOwnPropertyNames(E)),E=Object.getPrototypeOf(E);return t}function i(r){const t=[];for(const E of s(r))typeof r[E]=="function"&&t.push(E);return t}function l(r,t){const E=m=>function(){const T=Array.prototype.slice.call(arguments,0);return t(m,T)};let y={};for(const m of r)y[m]=E(m);return y}function a(r){return r===null?void 0:r}function n(r,t="Unreachable"){throw new Error(t)}},"815F":function(Ne,ne,U){"use strict";U.d(ne,"e",function(){return K}),U.d(ne,"c",function(){return e}),U.d(ne,"d",function(){return C}),U.d(ne,"a",function(){return v}),U.d(ne,"f",function(){return c}),U.d(ne,"b",function(){return s});var Q=U("KQm4"),H=U("VTBJ"),I=U("Ff2n"),W=U("Zm9Q"),P=U("Kwbf"),R=U("OZM5");function K(i,l){return i!=null?i:l}function N(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=new Map;function a(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(n||[]).forEach(function(t){var E=t.key,y=t.children;Object(P.a)(E!=null,"Tree node must have a certain key: [".concat(r).concat(E,"]"));var m=String(E);Object(P.a)(!l.has(m)||E===null||E===void 0,"Same 'key' exist in the Tree: ".concat(m)),l.set(m,!0),a(y,"".concat(r).concat(m," > "))})}a(i)}function e(i){function l(a){var n=Object(W.a)(a);return n.map(function(r){if(!Object(R.i)(r))return Object(P.a)(!r,"Tree/TreeNode can only accept TreeNode as children."),null;var t=r.key,E=r.props,y=E.children,m=Object(I.a)(E,["children"]),T=Object(H.a)({key:t},m),_=l(y);return _.length&&(T.children=_),T}).filter(function(r){return r})}return l(i)}function C(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=new Set(l===!0?[]:l),n=[];function r(t){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return t.map(function(y,m){var T=Object(R.h)(E?E.pos:"0",m),_=K(y.key,T),f=Object(H.a)(Object(H.a)({},y),{},{parent:E,pos:T,children:null,data:y,isStart:[].concat(Object(Q.a)(E?E.isStart:[]),[m===0]),isEnd:[].concat(Object(Q.a)(E?E.isEnd:[]),[m===t.length-1])});return n.push(f),l===!0||a.has(_)?f.children=r(y.children||[],f):f.children=[],f})}return r(i),n}function g(i,l,a){var n;a?typeof a=="string"?n=function(E){return E[a]}:typeof a=="function"&&(n=function(E){return a(E)}):n=function(E,y){return K(E.key,y)};function r(t,E,y){var m=t?t.children:i,T=t?Object(R.h)(y.pos,E):"0";if(t){var _=n(t,T),f={node:t,index:E,pos:T,key:_,parentPos:y.node?y.pos:null,level:y.level+1};l(f)}m&&m.forEach(function(h,o){r(h,o,{node:t,pos:T,level:y?y.level+1:-1})})}r(null)}function v(i){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=l.initWrapper,n=l.processEntity,r=l.onProcessFinished,t=arguments.length>2?arguments[2]:void 0,E={},y={},m={posEntities:E,keyEntities:y};return a&&(m=a(m)||m),g(i,function(T){var _=T.node,f=T.index,h=T.pos,o=T.key,u=T.parentPos,b=T.level,p={node:_,index:f,key:o,pos:h,level:b},d=K(o,h);E[h]=p,y[d]=p,p.parent=E[u],p.parent&&(p.parent.children=p.parent.children||[],p.parent.children.push(p)),n&&n(p,m)},t),r&&r(m),m}function c(i,l){var a=l.expandedKeys,n=l.selectedKeys,r=l.loadedKeys,t=l.loadingKeys,E=l.checkedKeys,y=l.halfCheckedKeys,m=l.dragOverNodeKey,T=l.dropPosition,_=l.keyEntities,f=_[i],h={eventKey:i,expanded:a.indexOf(i)!==-1,selected:n.indexOf(i)!==-1,loaded:r.indexOf(i)!==-1,loading:t.indexOf(i)!==-1,checked:E.indexOf(i)!==-1,halfChecked:y.indexOf(i)!==-1,pos:String(f?f.pos:""),dragOver:m===i&&T===0,dragOverGapTop:m===i&&T===-1,dragOverGapBottom:m===i&&T===1};return h}function s(i){var l=i.data,a=i.expanded,n=i.selected,r=i.checked,t=i.loaded,E=i.loading,y=i.halfChecked,m=i.dragOver,T=i.dragOverGapTop,_=i.dragOverGapBottom,f=i.pos,h=i.active,o=Object(H.a)(Object(H.a)({},l),{},{expanded:a,selected:n,checked:r,loaded:t,loading:E,halfChecked:y,dragOver:m,dragOverGapTop:T,dragOverGapBottom:_,pos:f,active:h});return"props"in o||Object.defineProperty(o,"props",{get:function(){return Object(P.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),i}}),o}},"8HAY":function(Ne,ne,U){"use strict";U.d(ne,"a",function(){return P}),U.d(ne,"b",function(){return R}),U.d(ne,"d",function(){return K}),U.d(ne,"e",function(){return N}),U.d(ne,"c",function(){return e});var Q=U("MI8n"),H=U("pmY6"),I=U("3/fG"),W=function(C,g,v,c){function s(i){return i instanceof v?i:new v(function(l){l(i)})}return new(v||(v=Promise))(function(i,l){function a(t){try{r(c.next(t))}catch(E){l(E)}}function n(t){try{r(c.throw(t))}catch(E){l(E)}}function r(t){t.done?i(t.value):s(t.value).then(a,n)}r((c=c.apply(C,g||[])).next())})};class P extends H.a{constructor(C,g="",v="",c=!0,s){super();this._onDidChange=this._register(new Q.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=C,this._label=g,this._cssClass=v,this._enabled=c,this._actionCallback=s}get id(){return this._id}get label(){return this._label}set label(C){this._setLabel(C)}_setLabel(C){this._label!==C&&(this._label=C,this._onDidChange.fire({label:C}))}get tooltip(){return this._tooltip||""}set tooltip(C){this._setTooltip(C)}_setTooltip(C){this._tooltip!==C&&(this._tooltip=C,this._onDidChange.fire({tooltip:C}))}get class(){return this._cssClass}set class(C){this._setClass(C)}_setClass(C){this._cssClass!==C&&(this._cssClass=C,this._onDidChange.fire({class:C}))}get enabled(){return this._enabled}set enabled(C){this._setEnabled(C)}_setEnabled(C){this._enabled!==C&&(this._enabled=C,this._onDidChange.fire({enabled:C}))}get checked(){return this._checked}set checked(C){this._setChecked(C)}_setChecked(C){this._checked!==C&&(this._checked=C,this._onDidChange.fire({checked:C}))}run(C,g){return W(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(C))})}}class R extends H.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new Q.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new Q.b),this.onDidRun=this._onDidRun.event}run(C,g){return W(this,void 0,void 0,function*(){if(!C.enabled)return;this._onBeforeRun.fire({action:C});let v;try{yield this.runAction(C,g)}catch(c){v=c}this._onDidRun.fire({action:C,error:v})})}runAction(C,g){return W(this,void 0,void 0,function*(){yield C.run(g)})}}class K extends P{constructor(C){super(K.ID,C,C?"separator text":"separator");this.checked=!1,this.enabled=!1}}K.ID="vs.actions.separator";class N{constructor(C,g,v,c){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=C,this.label=g,this.class=c,this._actions=v}get actions(){return this._actions}dispose(){}run(){return W(this,void 0,void 0,function*(){})}}class e extends P{constructor(){super(e.ID,I.a("submenu.empty","(empty)"),void 0,!1)}}e.ID="vs.actions.empty"},"8hTe":function(Ne,ne,U){Ne.exports={button:"button___1wy9m"}},"9Bee":function(Ne,ne,U){"use strict";var Q=U("DYRE"),H=U("zeV3"),I=U("+L6B"),W=U("2/Rp"),P=U("k1fw"),R=U("9og8"),K=U("tJVT"),N=U("WmNS"),e=U.n(N),C=U("q1tI"),g=U.n(C),v=U("vg9a"),c=U("DlQD"),s=U.n(c),i=U("rUJ1");function l(B,x){var w=B.match(/^(\s+)(?:```)/);if(w===null)return x;var k=w[1];return x.split(`
`).map(function(z){var F=z.match(/^\s+/);if(F===null)return z;var ae=Object(K.a)(F,1),Ce=ae[0];return Ce.length>=k.length?z.slice(k.length):z}).join(`
`)}var a=[],n=["<ul>"],r=new s.a.Renderer,t=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function E(){a.length=0,n=["<ul>"]}var y={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function m(B,x,w,k){if(x>=B.length||B[x].level<=w)return x;var z=B[x];k.push("<li><a href='#"+z.anchor+"'>"+z.text+"</a>"),x++;var F=[];return x=m(B,x,z.level,F),F.length>0&&(k.push("<ul>"),F.forEach(function(ae){k.push(ae)}),k.push("</ul>")),k.push("</li>"),x=m(B,x,w,k),x}function T(){return m(a,0,0,n),n.push("</ul>"),n.join("")}var _={heading:function(x){var w=t.exec(x);if(w)return{type:"heading",raw:w[0],depth:w[1].length,text:w[2]}},fences:function(x){var w=this.rules.block.fences.exec(x);if(w){var k=w[0],z=l(k,w[3]||""),F=w[2]?w[2].trim():w[2];if(["latex","katex","math"].indexOf(F)>=0){var ae=o(),Ce=z;z=ae,u[ae]={type:"block",expression:Ce}}return{type:"code",raw:k,lang:F,text:z}}}},f=/(?:\${2})([^\n`]+?)(?:\${2})/gi,h=0,o=function(){return"__special_katext_id_".concat(h++,"__")},u={};function b(){return u}function p(){h=0,u={}}function d(B){return B=B.replace(f,function(x,w){var k=o();return u[k]={type:"inline",expression:w},k}),B}var A=r.listitem;r.listitem=function(B){return A(d(B))};var D=r.paragraph;r.paragraph=function(B){return D(d(B))};var S=r.tablecell;r.tablecell=function(B,x){return S(d(B),x)},r.code=function(B,x,w){var k=(x||"").match(/\S*/)[0];return k?["latex","katex","math"].indexOf(k)>=0?"<p class='editormd-tex'>".concat(B,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(x,'">').concat(w?B:Object(i.escape)(B,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(w?B:Object(i.escape)(B,!0))+"</code></pre>"},r.heading=function(B,x,w){var k=this.options.headerPrefix+w.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return a.push({anchor:k,level:x,text:B}),"<h"+x+' id="'+k+'">'+B+"</h"+x+">"},s.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),s.a.use({tokenizer:_,renderer:r});var L=s.a,M=U("SJMd"),O=U("ulZh"),j=U.n(O),G=U("m3rI"),X=U("Oy/b"),te=U("p5ED"),fe=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 ve=function(B,x){return(ve=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,k){w.__proto__=k}||function(w,k){for(var z in k)Object.prototype.hasOwnProperty.call(k,z)&&(w[z]=k[z])})(B,x)};function he(B,x){function w(){this.constructor=B}ve(B,x),B.prototype=x===null?Object.create(x):(w.prototype=x.prototype,new w)}function xe(B,x,w,k){return new(w||(w=Promise))(function(z,F){function ae($e){try{We(k.next($e))}catch(Ae){F(Ae)}}function Ce($e){try{We(k.throw($e))}catch(Ae){F(Ae)}}function We($e){var Ae;$e.done?z($e.value):(Ae=$e.value,Ae instanceof w?Ae:new w(function(Ze){Ze(Ae)})).then(ae,Ce)}We((k=k.apply(B,x||[])).next())})}function Se(B,x){var w,k,z,F,ae={label:0,sent:function(){if(1&z[0])throw z[1];return z[1]},trys:[],ops:[]};return F={next:Ce(0),throw:Ce(1),return:Ce(2)},typeof Symbol=="function"&&(F[Symbol.iterator]=function(){return this}),F;function Ce(We){return function($e){return function(Ae){if(w)throw new TypeError("Generator is already executing.");for(;ae;)try{if(w=1,k&&(z=2&Ae[0]?k.return:Ae[0]?k.throw||((z=k.return)&&z.call(k),0):k.next)&&!(z=z.call(k,Ae[1])).done)return z;switch(k=0,z&&(Ae=[2&Ae[0],z.value]),Ae[0]){case 0:case 1:z=Ae;break;case 4:return ae.label++,{value:Ae[1],done:!1};case 5:ae.label++,k=Ae[1],Ae=[0];continue;case 7:Ae=ae.ops.pop(),ae.trys.pop();continue;default:if(!(z=ae.trys,(z=z.length>0&&z[z.length-1])||Ae[0]!==6&&Ae[0]!==2)){ae=0;continue}if(Ae[0]===3&&(!z||Ae[1]>z[0]&&Ae[1]<z[3])){ae.label=Ae[1];break}if(Ae[0]===6&&ae.label<z[1]){ae.label=z[1],z=Ae;break}if(z&&ae.label<z[2]){ae.label=z[2],ae.ops.push(Ae);break}z[2]&&ae.ops.pop(),ae.trys.pop();continue}Ae=x.call(B,ae)}catch(Ze){Ae=[6,Ze],k=0}finally{w=z=0}if(5&Ae[0])throw Ae[1];return{value:Ae[0]?Ae[1]:void 0,done:!0}}([We,$e])}}}function de(){for(var B=0,x=0,w=arguments.length;x<w;x++)B+=arguments[x].length;var k=Array(B),z=0;for(x=0;x<w;x++)for(var F=arguments[x],ae=0,Ce=F.length;ae<Ce;ae++,z++)k[z]=F[ae];return k}var ie=function(){function B(){}return B.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},B.setAttributes=function(x,w){for(var k=0,z=w;k<z.length;k++){var F=z[k],ae=F[0],Ce=F[1];x.setAttribute(ae,Ce)}},B.createRect=function(x,w,k){var z=document.createElementNS("http://www.w3.org/2000/svg","rect");return z.setAttribute("width",x.toString()),z.setAttribute("height",w.toString()),k&&B.setAttributes(z,k),z},B.createLine=function(x,w,k,z,F){var ae=document.createElementNS("http://www.w3.org/2000/svg","line");return ae.setAttribute("x1",x.toString()),ae.setAttribute("y1",w.toString()),ae.setAttribute("x2",k.toString()),ae.setAttribute("y2",z.toString()),F&&B.setAttributes(ae,F),ae},B.createPolygon=function(x,w){var k=document.createElementNS("http://www.w3.org/2000/svg","polygon");return k.setAttribute("points",x),w&&B.setAttributes(k,w),k},B.createCircle=function(x,w){var k=document.createElementNS("http://www.w3.org/2000/svg","circle");return k.setAttribute("cx",(x/2).toString()),k.setAttribute("cy",(x/2).toString()),k.setAttribute("r",x.toString()),w&&B.setAttributes(k,w),k},B.createEllipse=function(x,w,k){var z=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return z.setAttribute("cx",(x/2).toString()),z.setAttribute("cy",(w/2).toString()),z.setAttribute("rx",(x/2).toString()),z.setAttribute("ry",(w/2).toString()),k&&B.setAttributes(z,k),z},B.createGroup=function(x){var w=document.createElementNS("http://www.w3.org/2000/svg","g");return x&&B.setAttributes(w,x),w},B.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},B.createMarker=function(x,w,k,z,F,ae,Ce){var We=document.createElementNS("http://www.w3.org/2000/svg","marker");return B.setAttributes(We,[["id",x],["orient",w],["markerWidth",k.toString()],["markerHeight",z.toString()],["refX",F.toString()],["refY",ae.toString()]]),We.appendChild(Ce),We},B.createText=function(x){var w=document.createElementNS("http://www.w3.org/2000/svg","text");return w.setAttribute("x","0"),w.setAttribute("y","0"),x&&B.setAttributes(w,x),w},B.createTSpan=function(x,w){var k=document.createElementNS("http://www.w3.org/2000/svg","tspan");return k.textContent=x,w&&B.setAttributes(k,w),k},B.createImage=function(x){var w=document.createElementNS("http://www.w3.org/2000/svg","image");return x&&B.setAttributes(w,x),w},B.createPoint=function(x,w){var k=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return k.x=x,k.y=w,k},B.createPath=function(x,w){var k=document.createElementNS("http://www.w3.org/2000/svg","path");return k.setAttribute("d",x),w&&B.setAttributes(k,w),k},B}(),Le=function(){function B(){}return B.addKey=function(x){B.key=x},Object.defineProperty(B,"isLicensed",{get:function(){return!!B.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(B.key)},enumerable:!1,configurable:!0}),B}(),Ve=function(){function B(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return B.prototype.rasterize=function(x,w,k){var z=this;return new Promise(function(F){var ae=k!==void 0?k:document.createElement("canvas");x===null&&(z.markersOnly=!0,z.naturalSize=!1);var Ce=document.createElementNS("http://www.w3.org/2000/svg","svg");Ce.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ce.setAttribute("width",w.width.baseVal.valueAsString),Ce.setAttribute("height",w.height.baseVal.valueAsString),Ce.setAttribute("viewBox","0 0 "+w.viewBox.baseVal.width.toString()+" "+w.viewBox.baseVal.height.toString()),Ce.innerHTML=w.innerHTML,z.naturalSize===!0?(Ce.width.baseVal.value=x.naturalWidth,Ce.height.baseVal.value=x.naturalHeight):z.width!==void 0&&z.height!==void 0&&(Ce.width.baseVal.value=z.width,Ce.height.baseVal.value=z.height),ae.width=Ce.width.baseVal.value,ae.height=Ce.height.baseVal.value;var We=Ce.outerHTML,$e=ae.getContext("2d");z.markersOnly!==!0&&$e.drawImage(x,0,0,ae.width,ae.height);var Ae=window.URL,Ze=new Image(ae.width,ae.height);Ze.setAttribute("crossOrigin","anonymous");var qe=new Blob([We],{type:"image/svg+xml"}),ft=Ae.createObjectURL(qe);Ze.onload=function(){$e.drawImage(Ze,0,0),Ae.revokeObjectURL(ft);var Lt=ae.toDataURL(z.imageType,z.imageQuality);F(Lt)},Ze.src=ft})},B}(),Be=function(){},je=function(){function B(x){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+x+"_"}return Object.defineProperty(B.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(B.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(B.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),B.prototype.addClass=function(x){return this.styleSheet===void 0&&this.addStyleSheet(),x.name=""+this.classNamePrefix+x.localName,this.classes.push(x),this.styleSheet.sheet.insertRule("."+x.name+" {"+x.style+"}",this.styleSheet.sheet.cssRules.length),x},B.prototype.addRule=function(x){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(x),this.styleSheet.sheet.insertRule(x.selector+" {"+x.style+"}",this.styleSheet.sheet.cssRules.length)},B.prototype.addStyleSheet=function(){var x;this.styleSheet=document.createElement("style"),((x=this.styleSheetRoot)!==null&&x!==void 0?x: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 Te("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Te("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},B.prototype.removeStyleSheet=function(){var x;this.styleSheet&&(((x=this.styleSheetRoot)!==null&&x!==void 0?x:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},B}(),Ee=function(B,x){this.selector=B,this.style=x},Te=function(B,x){this.localName=B,this.style=x},Re=function(){function B(x,w,k,z,F){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=x,this.displayMode=w,this.markerItems=k,this.uiStyleSettings=z,this.styles=F,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return B.prototype.show=function(x){var w=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=x,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var k=document.createElement("div");k.className=this.toolbarBlockStyleClass.name,k.style.whiteSpace="nowrap",this.uiContainer.appendChild(k),this.addActionButton(k,'<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(k,'<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(k,'<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(k,'<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(k,'<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(k,'<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(k,'<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(k,'<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(F){var ae=document.createElement("div");ae.className=""+w.toolbarButtonStyleClass.name,ae.setAttribute("data-type-name",F.typeName),ae.innerHTML=F.icon,ae.addEventListener("click",function(){w.markerToolbarButtonClicked(ae,F)}),w.buttons.push(ae),w.markerButtons.push(ae)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var z=document.createElement("div");z.className=this.toolbarBlockStyleClass.name,z.style.whiteSpace="nowrap",z.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(z),this.addActionButton(z,'<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(z,'<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()},B.prototype.addButtonClickListener=function(x){this.buttonClickListeners.push(x)},B.prototype.removeButtonClickListener=function(x){this.buttonClickListeners.indexOf(x)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(x),1)},B.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},B.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var x=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var w=0;w<this.markerButtons.length;w++)w<x||w===x&&this.markerButtons.length-1===x?this.markerButtonBlock.appendChild(this.markerButtons[w]):(w===x&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[w]))}},B.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")},B.prototype.resetButtonStyles=function(){var x=this;this.buttons.forEach(function(w){w.className=w.className.replace(x.uiStyleSettings.toolbarButtonStyleColorsClassName?x.uiStyleSettings.toolbarButtonStyleColorsClassName:x.toolbarButtonStyleColorsClass.name,"").trim(),w.className=w.className.replace(x.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?x.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:x.toolbarActiveButtonStyleColorsClass.name,"").trim(),w.className+=" "+(x.uiStyleSettings.toolbarButtonStyleColorsClassName?x.uiStyleSettings.toolbarButtonStyleColorsClassName:x.toolbarButtonStyleColorsClass.name)})},B.prototype.addActionButton=function(x,w,k){var z=this,F=document.createElement("div");switch(F.className=""+this.toolbarButtonStyleClass.name,F.innerHTML=w,F.setAttribute("data-action",k),F.addEventListener("click",function(){z.actionToolbarButtonClicked(F,k)}),k){case"select":F.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":F.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":F.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":F.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":F.style.fill=this.uiStyleSettings.closeButtonColor}x.appendChild(F),this.buttons.push(F)},B.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Te("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 Te("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Te("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Te("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 Te("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var x=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Te("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*x)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*x)+`px;
padding: `+x+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Te("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Te("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+`
`))},B.prototype.markerToolbarButtonClicked=function(x,w){this.setActiveButton(x),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(k){return k("marker",w)}),this.markerButtonOverflowBlock.style.display="none"},B.prototype.actionToolbarButtonClicked=function(x,w){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(k){return k("action",w)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},B.prototype.setActiveButton=function(x){this.resetButtonStyles(),x.className=x.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),x.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},B.prototype.setActiveMarkerButton=function(x){var w=this.markerButtons.find(function(k){return k.getAttribute("data-type-name")===x});w&&this.setActiveButton(w)},B.prototype.setCurrentMarker=function(x){var w=this;this.currentMarker=x,this.buttons.filter(function(k){return/delete|notes/.test(k.getAttribute("data-action"))}).forEach(function(k){w.currentMarker===void 0?(k.style.fillOpacity="0.4",k.style.pointerEvents="none"):(k.style.fillOpacity="1",k.style.pointerEvents="all")})},B}(),Ie=function(){function B(x,w,k,z){this.panels=[],this.panelButtons=[],this.markerjsContainer=x,this.displayMode=w,this.uiStyleSettings=k,this.styles=z,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return B.prototype.addStyles=function(){var x;this.toolboxStyleClass=this.styles.addClass(new Te("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 Te("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var w=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Te("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Te("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Te("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 Te("toolbox-panel-row_colors",`
background-color: `+((x=this.uiStyleSettings.toolboxBackgroundColor)!==null&&x!==void 0?x:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Te("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*w)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*w)+`px;
padding: `+w+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Te("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Te("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;
`))},B.prototype.show=function(x){var w;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=x,this.uiContainer.className=this.toolboxStyleClass.name+" "+((w=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&w!==void 0?w:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},B.prototype.setPanelButtons=function(x){var w,k,z=this;this.panels=x,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((w=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&w!==void 0?w:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((k=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(F){var ae;F.uiStyleSettings=z.uiStyleSettings;var Ce=document.createElement("div");Ce.className=z.toolboxButtonStyleClass.name+" "+((ae=z.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ae!==void 0?ae:z.toolboxButtonStyleColorsClass.name),Ce.innerHTML=F.icon,Ce.title=F.title,Ce.addEventListener("click",function(){z.panelButtonClick(F)}),z.panelButtons.push(Ce),z.buttonRow.appendChild(Ce)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},B.prototype.panelButtonClick=function(x){var w=this,k=-1;if(x!==this.activePanel){k=this.panels.indexOf(x),this.panelRow.innerHTML="";var z=x.getUi();z.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(z),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=x}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){w.displayMode==="inline"?w.panelRow.style.display="none":w.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(F,ae){var Ce,We;F.className=w.toolboxButtonStyleClass.name+" "+(ae===k?""+((Ce=w.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ce!==void 0?Ce:w.toolboxActiveButtonStyleColorsClass.name):""+((We=w.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&We!==void 0?We:w.toolboxButtonStyleColorsClass.name))})},B}(),$=function(B,x){this.title=B,this.icon=x},se=function(B){function x(w,k,z,F){var ae=B.call(this,w,F||'<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 ae.colors=[],ae.addTransparent=!1,ae.colorBoxes=[],ae.colors=k,ae.currentColor=z,ae.setCurrentColor=ae.setCurrentColor.bind(ae),ae.getColorBox=ae.getColorBox.bind(ae),ae}return he(x,B),x.prototype.getUi=function(){var w=this,k=document.createElement("div");return k.style.overflow="hidden",k.style.whiteSpace="nowrap",this.colors.forEach(function(z){var F=w.getColorBox(z);k.appendChild(F),w.colorBoxes.push(F)}),k},x.prototype.getColorBox=function(w){var k=this,z=this.uiStyleSettings.toolbarHeight/4,F=this.uiStyleSettings.toolbarHeight-z,ae=document.createElement("div");ae.style.display="inline-block",ae.style.boxSizing="content-box",ae.style.width=F-2+"px",ae.style.height=F-2+"px",ae.style.padding="1px",ae.style.marginRight="2px",ae.style.marginBottom="2px",ae.style.borderWidth="2px",ae.style.borderStyle="solid",ae.style.borderRadius=(F+2)/2+"px",ae.style.borderColor=w===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ae.addEventListener("click",function(){k.setCurrentColor(w,ae)});var Ce=document.createElement("div");return Ce.style.display="inline-block",Ce.style.width=F-2+"px",Ce.style.height=F-2+"px",Ce.style.backgroundColor=w,Ce.style.borderRadius=F/2+"px",w==="transparent"&&(Ce.style.fill=this.uiStyleSettings.toolboxAccentColor,Ce.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),ae.appendChild(Ce),ae},x.prototype.setCurrentColor=function(w,k){var z=this;this.currentColor=w,this.colorBoxes.forEach(function(F){F.style.borderColor=F===k?z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(w)},x}($),ue=function(){function B(x,w,k){this._state="new",this._isSelected=!1,this._container=x,this._overlayContainer=w,this.globalSettings=k,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(B.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),B.prototype.ownsTarget=function(x){return!1},Object.defineProperty(B.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),B.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},B.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},B.prototype.pointerDown=function(x,w){},B.prototype.dblClick=function(x,w){},B.prototype.manipulate=function(x){},B.prototype.pointerUp=function(x){this.stateChanged()},B.prototype.dispose=function(){},B.prototype.addMarkerVisualToContainer=function(x){this.container.childNodes.length>0?this.container.insertBefore(x,this.container.childNodes[0]):this.container.appendChild(x)},B.prototype.getState=function(){return{typeName:B.typeName,state:this.state,notes:this.notes}},B.prototype.restoreState=function(x){this._state=x.state,this.notes=x.notes},B.prototype.scale=function(x,w){},B.prototype.colorChanged=function(x){this.onColorChanged&&this.onColorChanged(x),this.stateChanged()},B.prototype.fillColorChanged=function(x){this.onFillColorChanged&&this.onFillColorChanged(x),this.stateChanged()},B.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var x=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),x.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(x)&&this.onStateChanged(this)}},B.typeName="MarkerBase",B}(),ce=function(){function B(){this.findGripByVisual=this.findGripByVisual.bind(this)}return B.prototype.findGripByVisual=function(x){return this.topLeft.ownsTarget(x)?this.topLeft:this.topCenter.ownsTarget(x)?this.topCenter:this.topRight.ownsTarget(x)?this.topRight:this.centerLeft.ownsTarget(x)?this.centerLeft:this.centerRight.ownsTarget(x)?this.centerRight:this.bottomLeft.ownsTarget(x)?this.bottomLeft:this.bottomCenter.ownsTarget(x)?this.bottomCenter:this.bottomRight.ownsTarget(x)?this.bottomRight:void 0},B}(),_e=function(){function B(){this.GRIP_SIZE=10,this.visual=ie.createGroup(),this.visual.appendChild(ie.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ie.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return B.prototype.ownsTarget=function(x){return x===this.visual||x===this.visual.childNodes[0]||x===this.visual.childNodes[1]},B}(),De=function(){function B(){}return B.toITransformMatrix=function(x){return{a:x.a,b:x.b,c:x.c,d:x.d,e:x.e,f:x.f}},B.toSVGMatrix=function(x,w){return x.a=w.a,x.b=w.b,x.c=w.c,x.d=w.d,x.e=w.e,x.f=w.f,x},B}(),Pe=function(B){function x(w,k,z){var F=B.call(this,w,k,z)||this;return F.left=0,F.top=0,F.width=0,F.height=0,F.defaultSize={x:50,y:20},F.offsetX=0,F.offsetY=0,F.rotationAngle=0,F.CB_DISTANCE=10,F._suppressMarkerCreateEvent=!1,F.container.transform.baseVal.appendItem(ie.createTransform()),F.setupControlBox(),F}return he(x,B),Object.defineProperty(x.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"visual",{get:function(){return this._visual},set:function(w){this._visual=w;var k=ie.createTransform();this._visual.transform.baseVal.appendItem(k)},enumerable:!1,configurable:!0}),x.prototype.ownsTarget=function(w){return!!B.prototype.ownsTarget.call(this,w)||!!(this.controlGrips.findGripByVisual(w)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(w))},x.prototype.pointerDown=function(w,k){B.prototype.pointerDown.call(this,w,k),this.state==="new"&&(this.left=w.x,this.top=w.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var z=this.unrotatePoint(w);if(this.manipulationStartX=z.x,this.manipulationStartY=z.y,this.offsetX=z.x-this.left,this.offsetY=z.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(k),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(k)){this.activeGrip=this.rotatorGrip;var F=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=F.x-this.width/2,this.top=F.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ae=this.container.transform.baseVal.getItem(0);ae.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ae,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},x.prototype.pointerUp=function(w){var k=this.state;B.prototype.pointerUp.call(this,w),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(w),this._state="select",k==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},x.prototype.moveVisual=function(w){this.visual.style.transform="translate("+w.x+"px, "+w.y+"px)"},x.prototype.manipulate=function(w){var k=this.unrotatePoint(w);this.state==="creating"?this.resize(w):this.state==="move"?(this.left=this.manipulationStartLeft+(k.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(k.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(k):this.state==="rotate"&&this.rotate(w)},x.prototype.resize=function(w){var k=this.manipulationStartLeft,z=this.manipulationStartWidth,F=this.manipulationStartTop,ae=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:k=this.manipulationStartLeft+w.x-this.manipulationStartX,z=this.manipulationStartWidth+this.manipulationStartLeft-k;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:z=this.manipulationStartWidth+w.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:F=this.manipulationStartTop+w.y-this.manipulationStartY,ae=this.manipulationStartHeight+this.manipulationStartTop-F;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ae=this.manipulationStartHeight+w.y-this.manipulationStartY}z>=0?(this.left=k,this.width=z):(this.left=k+z,this.width=-z),ae>=0?(this.top=F,this.height=ae):(this.top=F+ae,this.height=-ae),this.setSize()},x.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},x.prototype.rotate=function(w){if(Math.abs(w.x-this.centerX)>.1){var k=Math.sign(w.x-this.centerX);this.rotationAngle=180*Math.atan((w.y-this.centerY)/(w.x-this.centerX))/Math.PI+90*k,this.applyRotation()}},x.prototype.applyRotation=function(){var w=this.container.transform.baseVal.getItem(0);w.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(w,0)},x.prototype.rotatePoint=function(w){if(this.rotationAngle===0)return w;var k=this.container.getCTM(),z=ie.createPoint(w.x,w.y);return{x:(z=z.matrixTransform(k)).x,y:z.y}},x.prototype.unrotatePoint=function(w){if(this.rotationAngle===0)return w;var k=this.container.getCTM();k=k.inverse();var z=ie.createPoint(w.x,w.y);return{x:(z=z.matrixTransform(k)).x,y:z.y}},x.prototype.select=function(){B.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},x.prototype.deselect=function(){B.prototype.deselect.call(this),this.controlBox.style.display="none"},x.prototype.setupControlBox=function(){this.controlBox=ie.createGroup();var w=ie.createTransform();w.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(w),this.container.appendChild(this.controlBox),this.controlRect=ie.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=ie.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 ce,this.addControlGrips(),this.controlBox.style.display="none"},x.prototype.adjustControlBox=function(){var w=this.controlBox.transform.baseVal.getItem(0);w.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(w,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()},x.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()},x.prototype.createGrip=function(){var w=new _e;return w.visual.transform.baseVal.appendItem(ie.createTransform()),this.controlBox.appendChild(w.visual),w},x.prototype.positionGrips=function(){var w=this.controlGrips.topLeft.GRIP_SIZE,k=-w/2,z=k,F=(this.width+this.CB_DISTANCE)/2-w/2,ae=(this.height+this.CB_DISTANCE)/2-w/2,Ce=this.height+this.CB_DISTANCE-w/2,We=this.width+this.CB_DISTANCE-w/2;this.positionGrip(this.controlGrips.topLeft.visual,k,z),this.positionGrip(this.controlGrips.topCenter.visual,F,z),this.positionGrip(this.controlGrips.topRight.visual,We,z),this.positionGrip(this.controlGrips.centerLeft.visual,k,ae),this.positionGrip(this.controlGrips.centerRight.visual,We,ae),this.positionGrip(this.controlGrips.bottomLeft.visual,k,Ce),this.positionGrip(this.controlGrips.bottomCenter.visual,F,Ce),this.positionGrip(this.controlGrips.bottomRight.visual,We,Ce),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,F,z-3*this.CB_DISTANCE)},x.prototype.positionGrip=function(w,k,z){var F=w.transform.baseVal.getItem(0);F.setTranslate(k,z),w.transform.baseVal.replaceItem(F,0)},x.prototype.hideControlBox=function(){this.controlBox.style.display="none"},x.prototype.showControlBox=function(){this.controlBox.style.display=""},x.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:De.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:De.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},B.prototype.getState.call(this))},x.prototype.restoreState=function(w){B.prototype.restoreState.call(this,w);var k=w;this.left=k.left,this.top=k.top,this.width=k.width,this.height=k.height,this.rotationAngle=k.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(De.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,k.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(De.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,k.containerTransformMatrix))},x.prototype.scale=function(w,k){B.prototype.scale.call(this,w,k);var z=this.rotatePoint({x:this.left,y:this.top}),F=this.unrotatePoint({x:z.x*w,y:z.y*k});this.left=F.x,this.top=F.y,this.width=this.width*w,this.height=this.height*k,this.adjustControlBox()},x}(ue),Me=function(B){function x(w,k,z){var F=B.call(this,w,k,z)||this;return F.fillColor="transparent",F.strokeColor="transparent",F.strokeWidth=0,F.strokeDasharray="",F.opacity=1,F.setStrokeColor=F.setStrokeColor.bind(F),F.setFillColor=F.setFillColor.bind(F),F.setStrokeWidth=F.setStrokeWidth.bind(F),F.setStrokeDasharray=F.setStrokeDasharray.bind(F),F.createVisual=F.createVisual.bind(F),F}return he(x,B),x.prototype.ownsTarget=function(w){return!(!B.prototype.ownsTarget.call(this,w)&&w!==this.visual)},x.prototype.createVisual=function(){this.visual=ie.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)},x.prototype.pointerDown=function(w,k){B.prototype.pointerDown.call(this,w,k),this.state==="new"&&(this.createVisual(),this.moveVisual(w),this._state="creating")},x.prototype.manipulate=function(w){B.prototype.manipulate.call(this,w)},x.prototype.resize=function(w){B.prototype.resize.call(this,w),this.setSize()},x.prototype.setSize=function(){B.prototype.setSize.call(this),ie.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},x.prototype.pointerUp=function(w){B.prototype.pointerUp.call(this,w),this.setSize()},x.prototype.setStrokeColor=function(w){this.strokeColor=w,this.visual&&ie.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(w),this.stateChanged()},x.prototype.setFillColor=function(w){this.fillColor=w,this.visual&&ie.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},x.prototype.setStrokeWidth=function(w){this.strokeWidth=w,this.visual&&ie.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},x.prototype.setStrokeDasharray=function(w){this.strokeDasharray=w,this.visual&&ie.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},x.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},B.prototype.getState.call(this))},x.prototype.restoreState=function(w){var k=w;this.fillColor=k.fillColor,this.strokeColor=k.strokeColor,this.strokeWidth=k.strokeWidth,this.strokeDasharray=k.strokeDasharray,this.opacity=k.opacity,this.createVisual(),B.prototype.restoreState.call(this,w),this.setSize()},x.prototype.scale=function(w,k){B.prototype.scale.call(this,w,k),this.setSize()},x.title="Rectangle marker",x}(Pe),Fe=function(B){function x(w,k,z,F){var ae=B.call(this,w,F||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ae.widths=[],ae.widthBoxes=[],ae.widths=k,ae.currentWidth=z,ae.setCurrentWidth=ae.setCurrentWidth.bind(ae),ae}return he(x,B),x.prototype.getUi=function(){var w=this,k=document.createElement("div");return k.style.display="flex",k.style.overflow="hidden",k.style.flexGrow="2",this.widths.forEach(function(z){var F=document.createElement("div");F.style.display="flex",F.style.flexGrow="2",F.style.alignItems="center",F.style.justifyContent="space-between",F.style.padding="5px",F.style.borderWidth="2px",F.style.borderStyle="solid",F.style.borderColor=z===w.currentWidth?w.uiStyleSettings.toolboxAccentColor:"transparent",F.addEventListener("click",function(){w.setCurrentWidth(z,F)}),k.appendChild(F);var ae=document.createElement("div");ae.innerText=z.toString(),ae.style.marginRight="5px",F.appendChild(ae);var Ce=document.createElement("div");Ce.style.minHeight="20px",Ce.style.flexGrow="2",Ce.style.display="flex",Ce.style.alignItems="center";var We=document.createElement("hr");We.style.minWidth="20px",We.style.border="0px",We.style.borderTop=z+"px solid "+w.uiStyleSettings.toolboxColor,We.style.flexGrow="2",Ce.appendChild(We),F.appendChild(Ce),w.widthBoxes.push(F)}),k},x.prototype.setCurrentWidth=function(w,k){var z=this;this.currentWidth=w,this.widthBoxes.forEach(function(F){F.style.borderColor=F===k?z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},x}($),He=function(B){function x(w,k,z,F){var ae=B.call(this,w,F||'<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 ae.styles=[],ae.styleBoxes=[],ae.styles=k,ae.currentStyle=z,ae.setCurrentStyle=ae.setCurrentStyle.bind(ae),ae}return he(x,B),x.prototype.getUi=function(){var w=this,k=document.createElement("div");return k.style.display="flex",k.style.overflow="hidden",k.style.flexGrow="2",this.styles.forEach(function(z){var F=document.createElement("div");F.style.display="flex",F.style.alignItems="center",F.style.justifyContent="space-between",F.style.padding="5px",F.style.borderWidth="2px",F.style.borderStyle="solid",F.style.overflow="hidden",F.style.maxWidth=100/w.styles.length-5+"%",F.style.borderColor=z===w.currentStyle?w.uiStyleSettings.toolboxAccentColor:"transparent",F.addEventListener("click",function(){w.setCurrentStyle(z,F)}),k.appendChild(F);var ae=document.createElement("div");ae.style.minHeight="20px",ae.style.flexGrow="2",ae.style.overflow="hidden";var Ce=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+w.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(z!==""?'stroke-dasharray="'+z+'"':"")+` />
</svg>`;ae.innerHTML=Ce,F.appendChild(ae),w.styleBoxes.push(F)}),k},x.prototype.setCurrentStyle=function(w,k){var z=this;this.currentStyle=w,this.styleBoxes.forEach(function(F){F.style.borderColor=F===k?z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},x}($),oe=function(B){function x(w,k,z){var F=B.call(this,w,k,z)||this;return F.strokeColor=z.defaultColor,F.strokeWidth=z.defaultStrokeWidth,F.strokeDasharray=z.defaultStrokeDasharray,F.strokePanel=new se("Line color",z.defaultColorSet,z.defaultColor),F.strokePanel.onColorChanged=F.setStrokeColor,F.strokeWidthPanel=new Fe("Line width",z.defaultStrokeWidths,z.defaultStrokeWidth),F.strokeWidthPanel.onWidthChanged=F.setStrokeWidth,F.strokeStylePanel=new He("Line style",z.defaultStrokeDasharrays,z.defaultStrokeDasharray),F.strokeStylePanel.onStyleChanged=F.setStrokeDasharray,F}return he(x,B),Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var w=B.prototype.getState.call(this);return w.typeName=x.typeName,w},x.typeName="FrameMarker",x.title="Frame marker",x.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',x}(Me),me=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},be=function(B){function x(w,k,z){var F=B.call(this,w,k,z)||this;return F.x1=0,F.y1=0,F.x2=0,F.y2=0,F.defaultLength=50,F.manipulationStartX=0,F.manipulationStartY=0,F.manipulationStartX1=0,F.manipulationStartY1=0,F.manipulationStartX2=0,F.manipulationStartY2=0,F.setupControlBox(),F}return he(x,B),x.prototype.ownsTarget=function(w){return!!B.prototype.ownsTarget.call(this,w)||!(!this.grip1.ownsTarget(w)&&!this.grip2.ownsTarget(w))},x.prototype.pointerDown=function(w,k){B.prototype.pointerDown.call(this,w,k),this.manipulationStartX=w.x,this.manipulationStartY=w.y,this.state==="new"&&(this.x1=w.x,this.y1=w.y,this.x2=w.x,this.y2=w.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(k)?this.activeGrip=this.grip1:this.grip2.ownsTarget(k)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},x.prototype.pointerUp=function(w){var k=this.state;B.prototype.pointerUp.call(this,w),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(w),this._state="select",k==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},x.prototype.adjustVisual=function(){},x.prototype.manipulate=function(w){this.state==="creating"?this.resize(w):this.state==="move"?(this.x1=this.manipulationStartX1+w.x-this.manipulationStartX,this.y1=this.manipulationStartY1+w.y-this.manipulationStartY,this.x2=this.manipulationStartX2+w.x-this.manipulationStartX,this.y2=this.manipulationStartY2+w.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(w)},x.prototype.resize=function(w){switch(this.activeGrip){case this.grip1:this.x1=w.x,this.y1=w.y;break;case this.grip2:case void 0:this.x2=w.x,this.y2=w.y}this.adjustVisual(),this.adjustControlBox()},x.prototype.select=function(){B.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},x.prototype.deselect=function(){B.prototype.deselect.call(this),this.controlBox.style.display="none"},x.prototype.setupControlBox=function(){this.controlBox=ie.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},x.prototype.adjustControlBox=function(){this.positionGrips()},x.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},x.prototype.createGrip=function(){var w=new _e;return w.visual.transform.baseVal.appendItem(ie.createTransform()),this.controlBox.appendChild(w.visual),w},x.prototype.positionGrips=function(){var w=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-w/2,this.y1-w/2),this.positionGrip(this.grip2.visual,this.x2-w/2,this.y2-w/2)},x.prototype.positionGrip=function(w,k,z){var F=w.transform.baseVal.getItem(0);F.setTranslate(k,z),w.transform.baseVal.replaceItem(F,0)},x.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},B.prototype.getState.call(this))},x.prototype.restoreState=function(w){B.prototype.restoreState.call(this,w);var k=w;this.x1=k.x1,this.y1=k.y1,this.x2=k.x2,this.y2=k.y2},x.prototype.scale=function(w,k){B.prototype.scale.call(this,w,k),this.x1=this.x1*w,this.y1=this.y1*k,this.x2=this.x2*w,this.y2=this.y2*k,this.adjustVisual(),this.adjustControlBox()},x}(ue),we=function(B){function x(w,k,z){var F=B.call(this,w,k,z)||this;return F.strokeColor="transparent",F.strokeWidth=0,F.strokeDasharray="",F.setStrokeColor=F.setStrokeColor.bind(F),F.setStrokeWidth=F.setStrokeWidth.bind(F),F.setStrokeDasharray=F.setStrokeDasharray.bind(F),F.strokeColor=z.defaultColor,F.strokeWidth=z.defaultStrokeWidth,F.strokeDasharray=z.defaultStrokeDasharray,F.strokePanel=new se("Line color",z.defaultColorSet,z.defaultColor),F.strokePanel.onColorChanged=F.setStrokeColor,F.strokeWidthPanel=new Fe("Line width",z.defaultStrokeWidths,z.defaultStrokeWidth),F.strokeWidthPanel.onWidthChanged=F.setStrokeWidth,F.strokeStylePanel=new He("Line style",z.defaultStrokeDasharrays,z.defaultStrokeDasharray),F.strokeStylePanel.onStyleChanged=F.setStrokeDasharray,F}return he(x,B),x.prototype.ownsTarget=function(w){return!(!B.prototype.ownsTarget.call(this,w)&&w!==this.visual&&w!==this.selectorLine&&w!==this.visibleLine)},x.prototype.createVisual=function(){this.visual=ie.createGroup(),this.selectorLine=ie.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ie.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)},x.prototype.pointerDown=function(w,k){B.prototype.pointerDown.call(this,w,k),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},x.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()),ie.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ie.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ie.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},x.prototype.setStrokeColor=function(w){this.strokeColor=w,this.adjustVisual(),this.colorChanged(w)},x.prototype.setStrokeWidth=function(w){this.strokeWidth=w,this.adjustVisual()},x.prototype.setStrokeDasharray=function(w){this.strokeDasharray=w,this.adjustVisual(),this.stateChanged()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var w=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},B.prototype.getState.call(this));return w.typeName=x.typeName,w},x.prototype.restoreState=function(w){B.prototype.restoreState.call(this,w);var k=w;this.strokeColor=k.strokeColor,this.strokeWidth=k.strokeWidth,this.strokeDasharray=k.strokeDasharray,this.createVisual(),this.adjustVisual()},x.typeName="LineMarker",x.title="Line marker",x.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',x}(be),pe=function(B){function x(w,k,z,F){var ae=B.call(this,w,F||'<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 ae.fonts=[],ae.fontBoxes=[],ae.fonts=k,ae.currentFont=z,ae.setCurrentFont=ae.setCurrentFont.bind(ae),ae}return he(x,B),x.prototype.getUi=function(){var w=this,k=document.createElement("div");return k.style.overflow="hidden",k.style.flexGrow="2",this.fonts.forEach(function(z){var F=document.createElement("div");F.style.display="inline-block",F.style.alignItems="center",F.style.justifyContent="space-between",F.style.padding="5px",F.style.borderWidth="2px",F.style.borderStyle="solid",F.style.overflow="hidden",F.style.maxWidth=100/w.fonts.length-5+"%",F.style.borderColor=z===w.currentFont?w.uiStyleSettings.toolboxAccentColor:"transparent",F.addEventListener("click",function(){w.setCurrentFont(z,F)}),k.appendChild(F);var ae=document.createElement("div");ae.style.display="flex",ae.style.minHeight="20px",ae.style.flexGrow="2",ae.style.fontFamily=z,ae.style.overflow="hidden";var Ce=document.createElement("div");Ce.style.whiteSpace="nowrap",Ce.style.overflow="hidden",Ce.style.textOverflow="ellipsis",Ce.innerHTML="The quick brown fox jumps over the lazy dog",ae.appendChild(Ce),F.appendChild(ae),w.fontBoxes.push(F)}),k},x.prototype.setCurrentFont=function(w,k){var z=this;this.currentFont=w,this.fontBoxes.forEach(function(F){F.style.borderColor=F===k?z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},x}($),ye=function(B){function x(w,k,z){var F=B.call(this,w,k,z)||this;return F.color="transparent",F.padding=5,F.DEFAULT_TEXT="your text here",F.text=F.DEFAULT_TEXT,F.isMoved=!1,F.color=z.defaultColor,F.fontFamily=z.defaultFontFamily,F.defaultSize={x:100,y:30},F.setColor=F.setColor.bind(F),F.setFont=F.setFont.bind(F),F.renderText=F.renderText.bind(F),F.sizeText=F.sizeText.bind(F),F.textEditDivClicked=F.textEditDivClicked.bind(F),F.showTextEditor=F.showTextEditor.bind(F),F.setSize=F.setSize.bind(F),F.positionTextEditor=F.positionTextEditor.bind(F),F.colorPanel=new se("Color",z.defaultColorSet,z.defaultColor),F.colorPanel.onColorChanged=F.setColor,F.fontFamilyPanel=new pe("Font",z.defaultFontFamilies,z.defaultFontFamily),F.fontFamilyPanel.onFontChanged=F.setFont,F}return he(x,B),x.prototype.ownsTarget=function(w){if(B.prototype.ownsTarget.call(this,w)||w===this.visual||w===this.textElement||w===this.bgRectangle)return!0;var k=!1;return this.textElement.childNodes.forEach(function(z){z===w&&(k=!0)}),k},x.prototype.createVisual=function(){this.visual=ie.createGroup(),this.bgRectangle=ie.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ie.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ie.createTransform()),this.textElement.transform.baseVal.appendItem(ie.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},x.prototype.pointerDown=function(w,k){B.prototype.pointerDown.call(this,w,k),this.isMoved=!1,this.pointerDownPoint=w,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(w),this._state="creating")},x.prototype.renderText=function(){var w=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(k){w.textElement.appendChild(ie.createTSpan(k.trim()===""?" ":k.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},x.prototype.getTextScale=function(){var w=this.textElement.getBBox(),k=1;if(w.width>0&&w.height>0){var z=(1*this.width-this.width*this.padding*2/100)/w.width,F=(1*this.height-this.height*this.padding*2/100)/w.height;k=Math.min(z,F)}return k},x.prototype.getTextPosition=function(w){var k=this.textElement.getBBox(),z=0,F=0;return k.width>0&&k.height>0&&(z=(this.width-k.width*w)/2,F=this.height/2-k.height*w/2),{x:z,y:F}},x.prototype.sizeText=function(){var w=this.textElement.getBBox(),k=this.getTextScale(),z=this.getTextPosition(k);z.y-=w.y*k,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+z.x+"px, "+z.y+"px) scale("+k+", "+k+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(z.x,z.y),this.textElement.transform.baseVal.getItem(1).setScale(k,k))},x.prototype.manipulate=function(w){B.prototype.manipulate.call(this,w),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(w.x-this.pointerDownPoint.x)>5||Math.abs(w.y-this.pointerDownPoint.y)>5)},x.prototype.resize=function(w){B.prototype.resize.call(this,w),this.isMoved=!0,this.setSize(),this.sizeText()},x.prototype.setSize=function(){B.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ie.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ie.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},x.prototype.pointerUp=function(w){var k=this.state;k==="creating"&&(this._suppressMarkerCreateEvent=!0),B.prototype.pointerUp.call(this,w),this.setSize(),(k==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},x.prototype.showTextEditor=function(){var w=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(k){k.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var k=Number.parseFloat(w.textEditor.style.fontSize);w.textEditor.clientWidth>=Number.parseInt(w.textEditor.style.maxWidth)&&k>.9;)k-=.1,w.textEditor.style.fontSize=Math.max(k,.9)+"em"}),this.textEditor.addEventListener("keyup",function(k){k.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(k){if(k.clipboardData){var z=k.clipboardData.getData("text"),F=window.getSelection();if(!F.rangeCount)return!1;F.deleteFromDocument(),F.getRangeAt(0).insertNode(document.createTextNode(z)),k.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){w.textEditDivClicked(w.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},x.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var w=this.getTextScale(),k=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),z=this.textElement.getBBox(),F={x:z.width*w,y:z.height*w};k.x-=F.x/2,k.y-=F.y/2,this.textEditor.style.top=k.y+"px",this.textEditor.style.left=k.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-k.x+"px",this.textEditor.style.fontSize=Math.max(16*w,12)+"px",this.textElement.style.display="none"}},x.prototype.textEditDivClicked=function(w){this.text=w.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},x.prototype.select=function(){B.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},x.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),B.prototype.deselect.call(this)},x.prototype.dblClick=function(w,k){B.prototype.dblClick.call(this,w,k),this.showTextEditor()},x.prototype.setColor=function(w){this.textElement&&ie.setAttributes(this.textElement,[["fill",w]]),this.color=w,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(w)},x.prototype.setFont=function(w){this.textElement&&ie.setAttributes(this.textElement,[["font-family",w]]),this.fontFamily=w,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},x.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},x.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var w=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},B.prototype.getState.call(this));return w.typeName=x.typeName,w},x.prototype.restoreState=function(w){var k=w;this.color=k.color,this.fontFamily=k.fontFamily,this.padding=k.padding,this.text=k.text,this.createVisual(),B.prototype.restoreState.call(this,w),this.setSize()},x.prototype.scale=function(w,k){B.prototype.scale.call(this,w,k),this.setSize(),this.sizeText(),this.positionTextEditor()},x.typeName="TextMarker",x.title="Text marker",x.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>',x}(Pe),re=function(B){function x(w,k,z){var F=B.call(this,w,k,z)||this;return F.color="transparent",F.lineWidth=3,F.drawing=!1,F.pixelRatio=1,F.color=z.defaultColor,F.lineWidth=z.defaultStrokeWidth,F.pixelRatio=z.freehandPixelRatio,F.setColor=F.setColor.bind(F),F.addCanvas=F.addCanvas.bind(F),F.finishCreation=F.finishCreation.bind(F),F.setLineWidth=F.setLineWidth.bind(F),F.colorPanel=new se("Color",z.defaultColorSet,z.defaultColor),F.colorPanel.onColorChanged=F.setColor,F.lineWidthPanel=new Fe("Line width",z.defaultStrokeWidths,z.defaultStrokeWidth),F.lineWidthPanel.onWidthChanged=F.setLineWidth,F}return he(x,B),x.prototype.ownsTarget=function(w){return!(!B.prototype.ownsTarget.call(this,w)&&w!==this.visual&&w!==this.drawingImage)},x.prototype.createVisual=function(){this.visual=ie.createGroup(),this.drawingImage=ie.createImage(),this.visual.appendChild(this.drawingImage);var w=ie.createTransform();this.visual.transform.baseVal.appendItem(w),this.addMarkerVisualToContainer(this.visual)},x.prototype.pointerDown=function(w,k){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(w.x,w.y),this.drawing=!0):B.prototype.pointerDown.call(this,w,k)},x.prototype.manipulate=function(w){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(w.x,w.y),this.canvasContext.stroke()):B.prototype.manipulate.call(this,w)},x.prototype.resize=function(w){B.prototype.resize.call(this,w),ie.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ie.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},x.prototype.pointerUp=function(w){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):B.prototype.pointerUp.call(this,w)},x.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)},x.prototype.select=function(){this.state==="creating"&&this.finishCreation(),B.prototype.select.call(this)},x.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),B.prototype.deselect.call(this)},x.prototype.finishCreation=function(){for(var w=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),k=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],z=k[0],F=k[1],ae=k[2],Ce=k[3],We=!1,$e=0;$e<this.canvasElement.height;$e++)for(var Ae=0;Ae<this.canvasElement.width;Ae++)w.data[$e*this.canvasElement.width*4+4*Ae+3]>0&&(We=!0,$e<F&&(F=$e),Ae<z&&(z=Ae),$e>Ce&&(Ce=$e),Ae>ae&&(ae=Ae));if(We){this.left=z/this.pixelRatio,this.top=F/this.pixelRatio,this.width=(ae-z)/this.pixelRatio,this.height=(Ce-F)/this.pixelRatio;var Ze=document.createElement("canvas");Ze.width=ae-z,Ze.height=Ce-F,Ze.getContext("2d").putImageData(this.canvasContext.getImageData(z,F,ae-z,Ce-F),0,0),this.drawingImgUrl=Ze.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},x.prototype.setDrawingImage=function(){ie.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ie.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},x.prototype.setColor=function(w){this.color=w,this.colorChanged(w)},x.prototype.setLineWidth=function(w){this.lineWidth=w},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var w=Object.assign({drawingImgUrl:this.drawingImgUrl},B.prototype.getState.call(this));return w.typeName=x.typeName,w},x.prototype.restoreState=function(w){this.createVisual(),B.prototype.restoreState.call(this,w),this.drawingImgUrl=w.drawingImgUrl,this.setDrawingImage()},x.prototype.scale=function(w,k){B.prototype.scale.call(this,w,k),this.setDrawingImage()},x.typeName="FreehandMarker",x.title="Freehand marker",x.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>',x}(Pe),Z=function(B){function x(w,k,z){var F=B.call(this,w,z||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return F.typeBoxes=[],F.currentType=k,F.setCurrentType=F.setCurrentType.bind(F),F}return he(x,B),x.prototype.getUi=function(){var w=this,k=document.createElement("div");k.style.display="flex",k.style.overflow="hidden",k.style.flexGrow="2";for(var z=function(Ce){var We="both";switch(Ce){case 0:We="both";break;case 1:We="start";break;case 2:We="end";break;case 3:We="none"}var $e=document.createElement("div");if($e.style.display="flex",$e.style.flexGrow="2",$e.style.alignItems="center",$e.style.justifyContent="space-between",$e.style.padding="5px",$e.style.borderWidth="2px",$e.style.borderStyle="solid",$e.style.borderColor=We===F.currentType?F.uiStyleSettings.toolboxAccentColor:"transparent",$e.addEventListener("click",function(){w.setCurrentType(We,$e)}),k.appendChild($e),We==="both"||We==="start"){var Ae=document.createElement("div");Ae.style.display="flex",Ae.style.alignItems="center",Ae.style.minHeight="20px",Ae.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="`+(F.uiStyleSettings!==void 0?F.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Ae.style.marginLeft="5px",$e.appendChild(Ae)}var Ze=document.createElement("div");Ze.style.display="flex",Ze.style.alignItems="center",Ze.style.minHeight="20px",Ze.style.flexGrow="2";var qe=document.createElement("hr");if(qe.style.minWidth="20px",qe.style.border="0px",qe.style.borderTop="3px solid "+(F.uiStyleSettings!==void 0?F.uiStyleSettings.toolboxColor:"#eeeeee"),qe.style.flexGrow="2",Ze.appendChild(qe),$e.appendChild(Ze),We==="both"||We==="end"){var ft=document.createElement("div");ft.style.display="flex",ft.style.alignItems="center",ft.style.minHeight="20px",ft.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(F.uiStyleSettings!==void 0?F.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,ft.style.marginRight="5px",$e.appendChild(ft)}F.typeBoxes.push($e)},F=this,ae=0;ae<4;ae++)z(ae);return k},x.prototype.setCurrentType=function(w,k){var z=this;this.currentType=w,this.typeBoxes.forEach(function(F){F.style.borderColor=F===k?z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},x}($),J=function(B){function x(w,k,z){var F=B.call(this,w,k,z)||this;return F.arrowType="end",F.arrowBaseHeight=10,F.arrowBaseWidth=10,F.getArrowPoints=F.getArrowPoints.bind(F),F.setArrowType=F.setArrowType.bind(F),F.arrowTypePanel=new Z("Arrow type","end"),F.arrowTypePanel.onArrowTypeChanged=F.setArrowType,F}return he(x,B),x.prototype.ownsTarget=function(w){return!(!B.prototype.ownsTarget.call(this,w)&&w!==this.arrow1&&w!==this.arrow2)},x.prototype.getArrowPoints=function(w,k){var z=this.arrowBaseWidth+2*this.strokeWidth,F=this.arrowBaseHeight+2*this.strokeWidth;return w-z/2+","+(k+F/2)+" "+w+","+(k-F/2)+" "+(w+z/2)+","+(k+F/2)},x.prototype.createTips=function(){this.arrow1=ie.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ie.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ie.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ie.createTransform()),this.visual.appendChild(this.arrow2)},x.prototype.pointerDown=function(w,k){B.prototype.pointerDown.call(this,w,k),this.state==="creating"&&this.createTips()},x.prototype.adjustVisual=function(){if(B.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",ie.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ie.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var w=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),k=this.arrow1.transform.baseVal.getItem(0);k.setRotate(w,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(k,0);var z=this.arrow2.transform.baseVal.getItem(0);z.setRotate(w+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(z,0)}},x.prototype.setArrowType=function(w){this.arrowType=w,this.adjustVisual(),this.stateChanged()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var w=Object.assign({arrowType:this.arrowType},B.prototype.getState.call(this));return w.typeName=x.typeName,w},x.prototype.restoreState=function(w){B.prototype.restoreState.call(this,w);var k=w;this.arrowType=k.arrowType,this.createTips(),this.adjustVisual()},x.typeName="ArrowMarker",x.title="Arrow marker",x.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',x}(we),V=function(B){function x(w,k,z){var F=B.call(this,w,k,z)||this;return F.fillColor=z.defaultFillColor,F.strokeWidth=0,F.fillPanel=new se("Color",z.defaultColorSet,z.defaultFillColor),F.fillPanel.onColorChanged=F.setFillColor,F}return he(x,B),Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var w=B.prototype.getState.call(this);return w.typeName=x.typeName,w},x.typeName="CoverMarker",x.title="Cover marker",x.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',x}(Me),Y=function(B){function x(w,k,z,F){var ae=B.call(this,w,F||'<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 ae.opacities=[],ae.opacityBoxes=[],ae.opacities=k,ae.currentOpacity=z,ae.setCurrentOpacity=ae.setCurrentOpacity.bind(ae),ae}return he(x,B),x.prototype.getUi=function(){var w=this,k=document.createElement("div");return k.style.display="flex",k.style.overflow="hidden",k.style.flexGrow="2",k.style.justifyContent="space-between",this.opacities.forEach(function(z){var F=document.createElement("div");F.style.display="flex",F.style.alignItems="center",F.style.justifyContent="center",F.style.padding="5px",F.style.borderWidth="2px",F.style.borderStyle="solid",F.style.borderColor=z===w.currentOpacity?w.uiStyleSettings.toolboxAccentColor:"transparent",F.addEventListener("click",function(){w.setCurrentOpacity(z,F)}),k.appendChild(F);var ae=document.createElement("div");ae.innerText=100*z+"%",F.appendChild(ae),w.opacityBoxes.push(F)}),k},x.prototype.setCurrentOpacity=function(w,k){var z=this;this.currentOpacity=w,this.opacityBoxes.forEach(function(F){F.style.borderColor=F===k?z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},x}($),q=function(B){function x(w,k,z){var F=B.call(this,w,k,z)||this;return F.setOpacity=F.setOpacity.bind(F),F.fillColor=z.defaultHighlightColor,F.strokeWidth=0,F.opacity=z.defaultHighlightOpacity,F.fillPanel=new se("Color",z.defaultColorSet,F.fillColor),F.fillPanel.onColorChanged=F.setFillColor,F.opacityPanel=new Y("Opacity",z.defaultOpacitySteps,F.opacity),F.opacityPanel.onOpacityChanged=F.setOpacity,F}return he(x,B),x.prototype.setOpacity=function(w){this.opacity=w,this.visual&&ie.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var w=B.prototype.getState.call(this);return w.typeName=x.typeName,w},x.typeName="HighlightMarker",x.title="Highlight marker",x.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>',x}(V),ee='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',le=function(B){function x(w,k,z){var F=B.call(this,w,k,z)||this;return F.bgColor="transparent",F.tipPosition={x:0,y:0},F.tipBase1Position={x:0,y:0},F.tipBase2Position={x:0,y:0},F.tipMoving=!1,F.color=z.defaultStrokeColor,F.bgColor=z.defaultFillColor,F.fontFamily=z.defaultFontFamily,F.defaultSize={x:100,y:30},F.setBgColor=F.setBgColor.bind(F),F.getTipPoints=F.getTipPoints.bind(F),F.positionTip=F.positionTip.bind(F),F.setTipPoints=F.setTipPoints.bind(F),F.colorPanel=new se("Text color",z.defaultColorSet,F.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>'),F.colorPanel.onColorChanged=F.setColor,F.bgColorPanel=new se("Fill color",z.defaultColorSet,F.bgColor,ee),F.bgColorPanel.onColorChanged=F.setBgColor,F.fontFamilyPanel=new pe("Font",z.defaultFontFamilies,z.defaultFontFamily),F.fontFamilyPanel.onFontChanged=F.setFont,F.tipGrip=new _e,F.tipGrip.visual.transform.baseVal.appendItem(ie.createTransform()),F.controlBox.appendChild(F.tipGrip.visual),F}return he(x,B),x.prototype.ownsTarget=function(w){return B.prototype.ownsTarget.call(this,w)||this.tipGrip.ownsTarget(w)||this.tip===w},x.prototype.createTip=function(){ie.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ie.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},x.prototype.pointerDown=function(w,k){this.state==="new"&&B.prototype.pointerDown.call(this,w,k),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(k)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):B.prototype.pointerDown.call(this,w,k)},x.prototype.pointerUp=function(w){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,B.prototype.pointerUp.call(this,w);else{var k=this.state==="creating";B.prototype.pointerUp.call(this,w),this.setTipPoints(k),this.positionTip()}},x.prototype.manipulate=function(w){if(this.tipMoving){var k=this.unrotatePoint(w);this.tipPosition={x:k.x-this.manipulationStartLeft,y:k.y-this.manipulationStartTop},this.positionTip()}else B.prototype.manipulate.call(this,w)},x.prototype.setBgColor=function(w){this.bgRectangle&&this.tip&&(ie.setAttributes(this.bgRectangle,[["fill",w]]),ie.setAttributes(this.tip,[["fill",w]])),this.bgColor=w,this.fillColorChanged(w)},x.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},x.prototype.setTipPoints=function(w){w===void 0&&(w=!1);var k=Math.min(this.height/2,15),z=this.height/5;w&&(this.tipPosition={x:k+z/2,y:this.height+20});var F=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?F<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(z=this.width/5,k=Math.min(this.width/2,15),this.tipBase1Position={x:k,y:0},this.tipBase2Position={x:k+z,y:0}):(this.tipBase1Position={x:0,y:k},this.tipBase2Position={x:0,y:k+z}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?F<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(z=this.width/5,k=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-k-z,y:0},this.tipBase2Position={x:this.width-k,y:0}):(this.tipBase1Position={x:this.width,y:k},this.tipBase2Position={x:this.width,y:k+z}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?F<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(z=this.width/5,k=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-k-z,y:this.height},this.tipBase2Position={x:this.width-k,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-k-z},this.tipBase2Position={x:this.width,y:this.height-k}):F<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(z=this.width/5,k=Math.min(this.width/2,15),this.tipBase1Position={x:k,y:this.height},this.tipBase2Position={x:k+z,y:this.height}):(this.tipBase1Position={x:0,y:this.height-k},this.tipBase2Position={x:0,y:this.height-k-z})},x.prototype.resize=function(w){B.prototype.resize.call(this,w),this.positionTip()},x.prototype.positionTip=function(){ie.setAttributes(this.tip,[["points",this.getTipPoints()]]);var w=this.tipGrip.visual.transform.baseVal.getItem(0);w.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(w,0)},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),x.prototype.select=function(){this.positionTip(),B.prototype.select.call(this)},x.prototype.getState=function(){var w=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},B.prototype.getState.call(this));return w.typeName=x.typeName,w},x.prototype.restoreState=function(w){var k=w;this.bgColor=k.bgColor,this.tipPosition=k.tipPosition,B.prototype.restoreState.call(this,w),this.createTip(),this.setTipPoints()},x.prototype.scale=function(w,k){B.prototype.scale.call(this,w,k),this.tipPosition={x:this.tipPosition.x*w,y:this.tipPosition.y*k},this.positionTip()},x.typeName="CalloutMarker",x.title="Callout marker",x.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>',x}(ye),ge=function(B){function x(w,k,z){var F=B.call(this,w,k,z)||this;return F.fillColor="transparent",F.strokeColor="transparent",F.strokeWidth=0,F.strokeDasharray="",F.opacity=1,F.strokeColor=z.defaultColor,F.strokeWidth=z.defaultStrokeWidth,F.strokeDasharray=z.defaultStrokeDasharray,F.fillColor=z.defaultFillColor,F.setStrokeColor=F.setStrokeColor.bind(F),F.setFillColor=F.setFillColor.bind(F),F.setStrokeWidth=F.setStrokeWidth.bind(F),F.setStrokeDasharray=F.setStrokeDasharray.bind(F),F.setOpacity=F.setOpacity.bind(F),F.createVisual=F.createVisual.bind(F),F.strokePanel=new se("Line color",de(z.defaultColorSet,["transparent"]),z.defaultColor),F.strokePanel.onColorChanged=F.setStrokeColor,F.fillPanel=new se("Fill color",de(z.defaultColorSet,["transparent"]),F.fillColor,ee),F.fillPanel.onColorChanged=F.setFillColor,F.strokeWidthPanel=new Fe("Line width",z.defaultStrokeWidths,z.defaultStrokeWidth),F.strokeWidthPanel.onWidthChanged=F.setStrokeWidth,F.strokeStylePanel=new He("Line style",z.defaultStrokeDasharrays,z.defaultStrokeDasharray),F.strokeStylePanel.onStyleChanged=F.setStrokeDasharray,F.opacityPanel=new Y("Opacity",z.defaultOpacitySteps,F.opacity),F.opacityPanel.onOpacityChanged=F.setOpacity,F}return he(x,B),x.prototype.ownsTarget=function(w){return!(!B.prototype.ownsTarget.call(this,w)&&w!==this.visual)},x.prototype.createVisual=function(){this.visual=ie.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)},x.prototype.pointerDown=function(w,k){B.prototype.pointerDown.call(this,w,k),this.state==="new"&&(this.createVisual(),this.moveVisual(w),this._state="creating")},x.prototype.manipulate=function(w){B.prototype.manipulate.call(this,w)},x.prototype.resize=function(w){B.prototype.resize.call(this,w),this.setSize()},x.prototype.setSize=function(){B.prototype.setSize.call(this),ie.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},x.prototype.pointerUp=function(w){B.prototype.pointerUp.call(this,w),this.setSize()},x.prototype.setStrokeColor=function(w){this.strokeColor=w,this.visual&&ie.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(w),this.stateChanged()},x.prototype.setFillColor=function(w){this.fillColor=w,this.visual&&ie.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(w),this.stateChanged()},x.prototype.setStrokeWidth=function(w){this.strokeWidth=w,this.visual&&ie.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},x.prototype.setStrokeDasharray=function(w){this.strokeDasharray=w,this.visual&&ie.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},x.prototype.setOpacity=function(w){this.opacity=w,this.visual&&ie.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var w=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},B.prototype.getState.call(this));return w.typeName=x.typeName,w},x.prototype.restoreState=function(w){var k=w;this.fillColor=k.fillColor,this.strokeColor=k.strokeColor,this.strokeWidth=k.strokeWidth,this.strokeDasharray=k.strokeDasharray,this.opacity=k.opacity,this.createVisual(),B.prototype.restoreState.call(this,w),this.setSize()},x.prototype.scale=function(w,k){B.prototype.scale.call(this,w,k),this.setSize()},x.typeName="EllipseMarker",x.title="Ellipse marker",x.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>',x}(Pe),Oe=function(B){function x(w,k,z){return B.call(this,w,k,z)||this}return he(x,B),Object.defineProperty(x.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),x.prototype.ownsTarget=function(w){return!(!B.prototype.ownsTarget.call(this,w)&&w!==this.tip1&&w!==this.tip2)},x.prototype.createTips=function(){this.tip1=ie.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(ie.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ie.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(ie.createTransform()),this.visual.appendChild(this.tip2)},x.prototype.pointerDown=function(w,k){B.prototype.pointerDown.call(this,w,k),this.state==="creating"&&this.createTips()},x.prototype.adjustVisual=function(){if(B.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ie.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()]]),ie.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 w=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),k=this.tip1.transform.baseVal.getItem(0);k.setRotate(w,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(k,0);var z=this.tip2.transform.baseVal.getItem(0);z.setRotate(w+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(z,0)}},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var w=B.prototype.getState.call(this);return w.typeName=x.typeName,w},x.prototype.restoreState=function(w){B.prototype.restoreState.call(this,w),this.createTips(),this.adjustVisual()},x.typeName="MeasurementMarker",x.title="Measurement marker",x.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>',x}(we),Ke=function(B){function x(w,k,z){var F=B.call(this,w,k,z)||this;return F.strokePanel.colors=z.defaultColorSet,F.fillColor="transparent",F}return he(x,B),Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var w=B.prototype.getState.call(this);return w.typeName=x.typeName,w},x.typeName="EllipseFrameMarker",x.title="Ellipse frame marker",x.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>',x}(ge),ze=function(){function B(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(B.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),B.prototype.addUndoStep=function(x){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(x)||(this.undoStack.push(x),JSON.stringify(this.lastRedoStep)!==JSON.stringify(x)&&this.redoStack.splice(0,this.redoStack.length))},B.prototype.replaceLastUndoStep=function(x){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=x)},B.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},B.prototype.undo=function(){if(this.undoStack.length>1){var x=this.undoStack.pop();return x!==void 0&&this.redoStack.push(x),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},B.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},B}(),ke=function(B){function x(w,k,z){var F=B.call(this,w,k,z)||this;return F.strokeColor="transparent",F.strokeWidth=0,F.strokeDasharray="",F.curveX=0,F.curveY=0,F.manipulationStartCurveX=0,F.manipulationStartCurveY=0,F.setStrokeColor=F.setStrokeColor.bind(F),F.setStrokeWidth=F.setStrokeWidth.bind(F),F.setStrokeDasharray=F.setStrokeDasharray.bind(F),F.positionGrips=F.positionGrips.bind(F),F.addControlGrips=F.addControlGrips.bind(F),F.adjustVisual=F.adjustVisual.bind(F),F.setupControlBox=F.setupControlBox.bind(F),F.resize=F.resize.bind(F),F.strokeColor=z.defaultColor,F.strokeWidth=z.defaultStrokeWidth,F.strokeDasharray=z.defaultStrokeDasharray,F.strokePanel=new se("Line color",z.defaultColorSet,z.defaultColor),F.strokePanel.onColorChanged=F.setStrokeColor,F.strokeWidthPanel=new Fe("Line width",z.defaultStrokeWidths,z.defaultStrokeWidth),F.strokeWidthPanel.onWidthChanged=F.setStrokeWidth,F.strokeStylePanel=new He("Line style",z.defaultStrokeDasharrays,z.defaultStrokeDasharray),F.strokeStylePanel.onStyleChanged=F.setStrokeDasharray,F}return he(x,B),x.prototype.ownsTarget=function(w){return!(!B.prototype.ownsTarget.call(this,w)&&w!==this.visual&&w!==this.selectorCurve&&w!==this.visibleCurve&&!this.curveGrip.ownsTarget(w))},x.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},x.prototype.createVisual=function(){this.visual=ie.createGroup(),this.selectorCurve=ie.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ie.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)},x.prototype.pointerDown=function(w,k){B.prototype.pointerDown.call(this,w,k),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=w.x,this.curveY=w.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(k)&&(this.activeGrip=this.curveGrip,this._state="resize")},x.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ie.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ie.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ie.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},x.prototype.setupControlBox=function(){B.prototype.setupControlBox.call(this),this.curveControlLine1=ie.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ie.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)},x.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,B.prototype.addControlGrips.call(this)},x.prototype.positionGrips=function(){B.prototype.positionGrips.call(this);var w=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-w/2,this.curveY-w/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()))},x.prototype.manipulate=function(w){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+w.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+w.y-this.manipulationStartY),B.prototype.manipulate.call(this,w)},x.prototype.resize=function(w){this.activeGrip===this.curveGrip&&(this.curveX=w.x,this.curveY=w.y),B.prototype.resize.call(this,w),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},x.prototype.setStrokeColor=function(w){this.strokeColor=w,this.adjustVisual(),this.colorChanged(w)},x.prototype.setStrokeWidth=function(w){this.strokeWidth=w,this.adjustVisual()},x.prototype.setStrokeDasharray=function(w){this.strokeDasharray=w,this.adjustVisual()},x.prototype.scale=function(w,k){this.curveX=this.curveX*w,this.curveY=this.curveY*k,B.prototype.scale.call(this,w,k)},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var w=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},B.prototype.getState.call(this));return w.typeName=x.typeName,w},x.prototype.restoreState=function(w){B.prototype.restoreState.call(this,w);var k=w;this.strokeColor=k.strokeColor,this.strokeWidth=k.strokeWidth,this.strokeDasharray=k.strokeDasharray,this.curveX=k.curveX,this.curveY=k.curveY,this.createVisual(),this.adjustVisual()},x.typeName="CurveMarker",x.title="Curve marker",x.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>',x}(be),Je=function(){function B(x,w){w===void 0&&(w=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=x,this.cancelable=w}return Object.defineProperty(B.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),B.prototype.preventDefault=function(){this._defaultPrevented=!0},B}(),Qe=function(B){function x(w,k,z){var F=B.call(this,w,!1)||this;return F.dataUrl=k,F.state=z,F}return he(x,B),x}(Je),Ge=function(B){function x(w,k,z){z===void 0&&(z=!1);var F=B.call(this,w,z)||this;return F.marker=k,F}return he(x,B),x}(Je),at=function(){function B(){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 B.prototype.addEventListener=function(x,w){this[x].push(w)},B.prototype.removeEventListener=function(x,w){var k=this[x].indexOf(w);k>-1&&this[x].splice(k,1)},B}(),nt=function(){function B(x){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new me,this._isOpen=!1,this.undoRedoManager=new ze,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 at,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=B.instanceCounter++,this.styles=new je(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=x,this.targetRoot=document.body,this.width=x.clientWidth,this.height=x.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(B.prototype,"ALL_MARKER_TYPES",{get:function(){return[oe,re,J,ye,Ke,ge,q,le,Oe,V,we,ke]},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[oe,re,J,ye,ge,q,le]},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"BASIC_MARKER_TYPES",{get:function(){return[oe,re,J,ye,q]},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(x){var w=this;this._availableMarkerTypes.splice(0),x.forEach(function(k){if(typeof k=="string"){var z=w.ALL_MARKER_TYPES.find(function(F){return F.typeName===k});z!==void 0&&w._availableMarkerTypes.push(z)}else w._availableMarkerTypes.push(k)})},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(x){this._zoomLevel=x,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(B.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),B.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Le.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},B.prototype.show=function(){var x=this;this.styles.styleSheetRoot===void 0&&Be.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Be.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(w){return w(new Je(x))})},B.prototype.render=function(){return xe(this,void 0,void 0,function(){var x;return Se(this,function(w){switch(w.label){case 0:return this.setCurrentMarker(),(x=new Ve).naturalSize=this.renderAtNaturalSize,x.imageType=this.renderImageType,x.imageQuality=this.renderImageQuality,x.markersOnly=this.renderMarkersOnly,x.width=this.renderWidth,x.height=this.renderHeight,[4,x.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return w.sent(),[4,x.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,w.sent()]}})})},B.prototype.close=function(x){var w=this;if(x===void 0&&(x=!1),this.isOpen){var k=!1;x||this.eventListeners.beforeclose.forEach(function(z){var F=new Je(w,!0);z(F),F.defaultPrevented&&(k=!0)}),k||(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(z){return z(new Je(w))}),this.detachEvents(),this._isOpen=!1)}},B.prototype.addMarkersToToolbar=function(){for(var x,w=[],k=0;k<arguments.length;k++)w[k]=arguments[k];(x=this._availableMarkerTypes).push.apply(x,w)},B.prototype.addRenderEventListener=function(x){this.addEventListener("render",function(w){x(w.dataUrl,w.state)})},B.prototype.removeRenderEventListener=function(x){},B.prototype.addCloseEventListener=function(x){this.addEventListener("close",function(){x()})},B.prototype.removeCloseEventListener=function(x){},B.prototype.setupResizeObserver=function(){var x=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){x.resize(x.target.clientWidth,x.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return x.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},B.prototype.onPopupTargetResize=function(){var x=1*this.target.clientWidth/this.target.clientHeight,w=this.editorCanvas.clientWidth/x>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*x:this.editorCanvas.clientWidth,k=w<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/x;this.resize(w,k)},B.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},B.prototype.resize=function(x,w){this._isResizing=!0;var k=x/this.imageWidth,z=w/this.imageHeight;this.imageWidth=Math.round(x),this.imageHeight=Math.round(w),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(k,z),this._isResizing=!1},B.prototype.scaleMarkers=function(x,w){var k,z=this;this._currentMarker&&this._currentMarker instanceof ye?this._currentMarker.scale(x,w):(k=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(F){F!==z._currentMarker&&F.scale(x,w)}),k!==void 0&&this.setCurrentMarker(k)},B.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},B.prototype.setTopLeft=function(){var x=this.editingTarget.getBoundingClientRect(),w=this.editorCanvas.getBoundingClientRect();this.left=x.left-w.left,this.top=x.top-w.top},B.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)},B.prototype.addDefs=function(){for(var x,w=[],k=0;k<arguments.length;k++)w[k]=arguments[k];this.defs=ie.createDefs(),this.addDefsToImage(),(x=this.defs).append.apply(x,w)},B.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},B.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)},B.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},B.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},B.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)},B.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},B.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)},B.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 x=document.createElement("a");x.href="https://markerjs.com/",x.target="_blank",x.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>',x.title="Powered by marker.js",x.style.display="grid",x.style.alignItems="center",x.style.justifyItems="center",x.style.padding="3px",x.style.width="20px",x.style.height="20px",this.logoUI.appendChild(x),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},B.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")},B.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"},B.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},B.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 x=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=x+"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 Re(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 Ie(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},B.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},B.prototype.removeMarker=function(x){this.markerImage.removeChild(x.container),this.markers.indexOf(x)>-1&&this.markers.splice(this.markers.indexOf(x),1),x.dispose()},B.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())},B.prototype.toolbarButtonClicked=function(x,w){if(x==="marker"&&w!==void 0)this.createNewMarker(w);else if(x==="action")switch(w){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()}},B.prototype.deleteSelectedMarker=function(){var x=this;if(this._currentMarker!==void 0){var w=!1;if(this.eventListeners.markerbeforedelete.forEach(function(z){var F=new Ge(x,x._currentMarker,!0);z(F),F.defaultPrevented&&(w=!0)}),!w){var k=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(z){return z(new Ge(x,k))})}}},B.prototype.clear=function(){var x=this,w=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ae){var Ce=new Ge(x,void 0,!0);ae(Ce),Ce.defaultPrevented&&(w=!0)}),!w)){this.setCurrentMarker();for(var k=function(ae){var Ce=z.markers[ae];z.setCurrentMarker(z.markers[ae]),z._currentMarker.dispose(),z.markerImage.removeChild(z._currentMarker.container),z.markers.splice(z.markers.indexOf(z._currentMarker),1),z.eventListeners.markerdelete.forEach(function(We){return We(new Ge(x,Ce))})},z=this,F=this.markers.length-1;F>=0;F--)k(F);this.addUndoStep()}},Object.defineProperty(B.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),B.prototype.showNotesEditor=function(){var x;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=(x=this._currentMarker.notes)!==null&&x!==void 0?x:"",this.overlayContainer.appendChild(this.notesArea))},B.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)},B.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},B.prototype.addUndoStep=function(){var x=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var w=this.getState(),k=this.undoRedoManager.getLastUndoStep();if(!k||k.width===w.width&&k.height===w.height){var z=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(w),z<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(F){return F(new Je(x))})}else this.undoRedoManager.replaceLastUndoStep(w),this.eventListeners.statechange.forEach(function(F){return F(new Je(x))})}},B.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},B.prototype.undoStep=function(){var x=this,w=this.undoRedoManager.undo();w!==void 0&&(this.restoreState(w),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(k){return k(new Je(x))}))},B.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},B.prototype.redoStep=function(){var x=this,w=this.undoRedoManager.redo();w!==void 0&&(this.restoreState(w),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(k){return k(new Je(x))}))},B.prototype.stepZoom=function(){var x=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=x<this.zoomSteps.length-1?this.zoomSteps[x+1]:this.zoomSteps[0]},B.prototype.panTo=function(x){this.contentDiv.scrollBy({left:this.prevPanPoint.x-x.x,top:this.prevPanPoint.y-x.y}),this.prevPanPoint=x},B.prototype.startRenderAndClose=function(){return xe(this,void 0,void 0,function(){var x,w,k=this;return Se(this,function(z){switch(z.label){case 0:return[4,this.render()];case 1:return x=z.sent(),w=this.getState(),this.eventListeners.render.forEach(function(F){return F(new Qe(k,x,w))}),this.close(!0),[2]}})})},B.prototype.getState=function(x){x===!0&&this.setCurrentMarker();var w={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(k){return w.markers.push(k.getState())}),w},B.prototype.restoreState=function(x){var w=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);x.markers.forEach(function(k){var z=w._availableMarkerTypes.find(function(ae){return ae.typeName===k.typeName});if(z!==void 0){var F=w.addNewMarker(z);F.restoreState(k),w.markers.push(F)}}),x.width&&x.height&&(x.width!==this.imageWidth||x.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/x.width,this.imageHeight/x.height),this.eventListeners.restorestate.forEach(function(k){return k(new Je(w))})},B.prototype.addNewMarker=function(x){var w=ie.createGroup();return this.markerImage.appendChild(w),new x(w,this.overlayContainer,this.settings)},B.prototype.createNewMarker=function(x){var w,k=this;(w=typeof x=="string"?this._availableMarkerTypes.find(function(z){return z.typeName===x}):x)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(w),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(w.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(z){return z(new Ge(k,k._currentMarker))}))},B.prototype.markerCreated=function(x){var w=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(x),this.setCurrentMarker(x),x instanceof re&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(re):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(k){return k(new Ge(w,w._currentMarker))})},B.prototype.colorChanged=function(x){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=x,this.settings.defaultStrokeColor=x)},B.prototype.fillColorChanged=function(x){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=x)},B.prototype.markerStateChanged=function(x){var w=this;this.eventListeners.markerchange.forEach(function(k){return k(new Ge(w,x))})},B.prototype.setCurrentMarker=function(x){var w=this;this._currentMarker!==x&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(k){return k(new Ge(w,w._currentMarker))})),this._currentMarker=x,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(k){return k(new Ge(w,w._currentMarker))}))},B.prototype.onPointerDown=function(x){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||x.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var w=this.markers.find(function(k){return k.ownsTarget(x.target)});w!==void 0?(this.setCurrentMarker(w),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(x.clientX,x.clientY),x.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:x.clientX,y:x.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(x.clientX,x.clientY))},B.prototype.onDblClick=function(x){if(this._isFocused||this.focus(),this.mode==="select"){var w=this.markers.find(function(k){return k.ownsTarget(x.target)});w!==void 0&&w!==this._currentMarker&&this.setCurrentMarker(w),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(x.clientX,x.clientY),x.target):this.setCurrentMarker()}},B.prototype.onPointerMove=function(x){this.touchPoints!==1&&x.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||x.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(x.clientX,x.clientY)):this.zoomLevel>1&&this.panTo({x:x.clientX,y:x.clientY}))},B.prototype.onPointerUp=function(x){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(x.clientX,x.clientY)),this.isDragging=!1,this.addUndoStep()},B.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},B.prototype.onKeyUp=function(x){this._currentMarker===void 0||this.notesArea!==void 0||x.key!=="Delete"&&x.key!=="Backspace"||this.deleteSelectedMarker()},B.prototype.clientToLocalCoordinates=function(x,w){var k=this.markerImage.getBoundingClientRect();return{x:(x-k.left)/this.zoomLevel,y:(w-k.top)/this.zoomLevel}},B.prototype.onWindowResize=function(){this.positionUI()},B.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var x=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=x+"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()},B.prototype.addLicenseKey=function(x){Le.addKey(x)},B.prototype.addEventListener=function(x,w){this.eventListeners.addEventListener(x,w)},B.prototype.removeEventListener=function(x,w){this.eventListeners.removeEventListener(x,w)},B.prototype.renderState=function(x){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(x),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(B.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),B.prototype.focus=function(){var x=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(w){return w(new Je(x))}))},B.prototype.blur=function(){var x=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(w){return w(new Je(x))}))},B.instanceCounter=0,B}();/* **********************************
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 rt=function(B,x){return(rt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,k){w.__proto__=k}||function(w,k){for(var z in k)Object.prototype.hasOwnProperty.call(k,z)&&(w[z]=k[z])})(B,x)};function dt(B,x){if(typeof x!="function"&&x!==null)throw new TypeError("Class extends value "+String(x)+" is not a constructor or null");function w(){this.constructor=B}rt(B,x),B.prototype=x===null?Object.create(x):(w.prototype=x.prototype,new w)}function et(B,x,w,k){return new(w||(w=Promise))(function(z,F){function ae($e){try{We(k.next($e))}catch(Ae){F(Ae)}}function Ce($e){try{We(k.throw($e))}catch(Ae){F(Ae)}}function We($e){var Ae;$e.done?z($e.value):(Ae=$e.value,Ae instanceof w?Ae:new w(function(Ze){Ze(Ae)})).then(ae,Ce)}We((k=k.apply(B,x||[])).next())})}function st(B,x){var w,k,z,F,ae={label:0,sent:function(){if(1&z[0])throw z[1];return z[1]},trys:[],ops:[]};return F={next:Ce(0),throw:Ce(1),return:Ce(2)},typeof Symbol=="function"&&(F[Symbol.iterator]=function(){return this}),F;function Ce(We){return function($e){return function(Ae){if(w)throw new TypeError("Generator is already executing.");for(;ae;)try{if(w=1,k&&(z=2&Ae[0]?k.return:Ae[0]?k.throw||((z=k.return)&&z.call(k),0):k.next)&&!(z=z.call(k,Ae[1])).done)return z;switch(k=0,z&&(Ae=[2&Ae[0],z.value]),Ae[0]){case 0:case 1:z=Ae;break;case 4:return ae.label++,{value:Ae[1],done:!1};case 5:ae.label++,k=Ae[1],Ae=[0];continue;case 7:Ae=ae.ops.pop(),ae.trys.pop();continue;default:if(!(z=ae.trys,(z=z.length>0&&z[z.length-1])||Ae[0]!==6&&Ae[0]!==2)){ae=0;continue}if(Ae[0]===3&&(!z||Ae[1]>z[0]&&Ae[1]<z[3])){ae.label=Ae[1];break}if(Ae[0]===6&&ae.label<z[1]){ae.label=z[1],z=Ae;break}if(z&&ae.label<z[2]){ae.label=z[2],ae.ops.push(Ae);break}z[2]&&ae.ops.pop(),ae.trys.pop();continue}Ae=x.call(B,ae)}catch(Ze){Ae=[6,Ze],k=0}finally{w=z=0}if(5&Ae[0])throw Ae[1];return{value:Ae[0]?Ae[1]:void 0,done:!0}}([We,$e])}}}var ut=function(){function B(){}return B.addKey=function(x){B.key=x},Object.defineProperty(B,"isLicensed",{get:function(){return!!B.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(B.key)},enumerable:!1,configurable:!0}),B}(),Ue=function(){function B(){}return B.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},B.setAttributes=function(x,w){for(var k=0,z=w;k<z.length;k++){var F=z[k],ae=F[0],Ce=F[1];x.setAttribute(ae,Ce)}},B.createRect=function(x,w,k){var z=document.createElementNS("http://www.w3.org/2000/svg","rect");return z.setAttribute("width",x.toString()),z.setAttribute("height",w.toString()),k&&B.setAttributes(z,k),z},B.createLine=function(x,w,k,z,F){var ae=document.createElementNS("http://www.w3.org/2000/svg","line");return ae.setAttribute("x1",x.toString()),ae.setAttribute("y1",w.toString()),ae.setAttribute("x2",k.toString()),ae.setAttribute("y2",z.toString()),F&&B.setAttributes(ae,F),ae},B.createPolygon=function(x,w){var k=document.createElementNS("http://www.w3.org/2000/svg","polygon");return k.setAttribute("points",x),w&&B.setAttributes(k,w),k},B.createCircle=function(x,w){var k=document.createElementNS("http://www.w3.org/2000/svg","circle");return k.setAttribute("cx",(x/2).toString()),k.setAttribute("cy",(x/2).toString()),k.setAttribute("r",x.toString()),w&&B.setAttributes(k,w),k},B.createEllipse=function(x,w,k){var z=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return z.setAttribute("cx",(x/2).toString()),z.setAttribute("cy",(w/2).toString()),z.setAttribute("rx",(x/2).toString()),z.setAttribute("ry",(w/2).toString()),k&&B.setAttributes(z,k),z},B.createGroup=function(x){var w=document.createElementNS("http://www.w3.org/2000/svg","g");return x&&B.setAttributes(w,x),w},B.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},B.createMarker=function(x,w,k,z,F,ae,Ce){var We=document.createElementNS("http://www.w3.org/2000/svg","marker");return B.setAttributes(We,[["id",x],["orient",w],["markerWidth",k.toString()],["markerHeight",z.toString()],["refX",F.toString()],["refY",ae.toString()]]),We.appendChild(Ce),We},B.createText=function(x){var w=document.createElementNS("http://www.w3.org/2000/svg","text");return w.setAttribute("x","0"),w.setAttribute("y","0"),x&&B.setAttributes(w,x),w},B.createTSpan=function(x,w){var k=document.createElementNS("http://www.w3.org/2000/svg","tspan");return k.textContent=x,w&&B.setAttributes(k,w),k},B.createImage=function(x){var w=document.createElementNS("http://www.w3.org/2000/svg","image");return x&&B.setAttributes(w,x),w},B.createPoint=function(x,w){var k=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return k.x=x,k.y=w,k},B.createPath=function(x,w){var k=document.createElementNS("http://www.w3.org/2000/svg","path");return k.setAttribute("d",x),w&&B.setAttributes(k,w),k},B.createElement=function(x,w){var k=document.createElementNS("http://www.w3.org/2000/svg",x);return w&&B.setAttributes(k,w),k},B.getHollowRectanglePath=function(x,w,k,z,F,ae,Ce,We){return"M"+x+","+w+"V"+(w+z)+"H"+(x+k)+"V"+w+"H"+F+"V"+ae+"H"+(F+Ce)+"V"+(ae+We)+"H"+F+"V"+w+"Z"},B}(),pt=function(){function B(x){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+x+"_"}return Object.defineProperty(B.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(B.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(B.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),B.prototype.addClass=function(x){return this.styleSheet===void 0&&this.addStyleSheet(),x.name=""+this.classNamePrefix+x.localName,this.classes.push(x),this.styleSheet.sheet.insertRule("."+x.name+" {"+x.style+"}",this.styleSheet.sheet.cssRules.length),x},B.prototype.addRule=function(x){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(x),this.styleSheet.sheet.insertRule(x.selector+" {"+x.style+"}",this.styleSheet.sheet.cssRules.length)},B.prototype.addStyleSheet=function(){var x;this.styleSheet=document.createElement("style"),((x=this.styleSheetRoot)!==null&&x!==void 0?x:document.head).appendChild(this.styleSheet),this.addRule(new Xe("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Xe("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Xe("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Ye("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Ye("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},B.prototype.removeStyleSheet=function(){var x;this.styleSheet&&(((x=this.styleSheetRoot)!==null&&x!==void 0?x:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},B}(),Xe=function(B,x){this.selector=B,this.style=x},Ye=function(B,x){this.localName=B,this.style=x},tt=function(){function B(){this.blocks=[],this.display=""}return B.prototype.addButtonBlock=function(x){x.className=this.blockClassName,x.buttonClassName=this.buttonClassName,x.buttonColorsClassName=this.buttonColorsClassName,x.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(x)},B.prototype.addElementBlock=function(x){x.className===void 0&&(x.className=this.blockClassName),this.blocks.push(x)},B.prototype.getUI=function(){var x=document.createElement("div");return x.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,x.style.display=this.display,this.blocks.forEach(function(w){return x.appendChild(w.getUI())}),x},B}(),vt=function(){function B(){}return B.prototype.getUI=function(){var x=document.createElement("div");if(x.className=this.className,this.minWidth!==void 0&&(x.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":x.style.justifyContent="flex-start";break;case"center":x.style.justifyContent="center";break;case"end":x.style.justifyContent="flex-end"}return x.style.whiteSpace="nowrap",x},B}(),Et=function(B){function x(){var w=B!==null&&B.apply(this,arguments)||this;return w.buttons=[],w}return dt(x,B),x.prototype.addButton=function(w){w.className=this.buttonClassName,w.colorsClassName=this.buttonColorsClassName,w.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(w)},x.prototype.getUI=function(){var w=B.prototype.getUI.call(this);return this.buttons.forEach(function(k){return w.appendChild(k.getUI())}),w},x}(vt),bt=function(){function B(x,w){this._isActive=!1,this._isHidden=!1,this._icon=x,this.title=w,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(B.prototype,"icon",{get:function(){return this._icon},set:function(x){this._icon=x,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"isActive",{get:function(){return this._isActive},set:function(x){this._isActive=x,this.adjustClassName()},enumerable:!1,configurable:!0}),B.prototype.getUI=function(){var x=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 x.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},B.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,"")))},B.prototype.hide=function(){this._isHidden=!0},B}(),Ot=function(B){function x(){var w=B!==null&&B.apply(this,arguments)||this;return w.elements=[],w}return dt(x,B),x.prototype.addElement=function(w){this.elements.push(w)},x.prototype.getUI=function(){var w=B.prototype.getUI.call(this);return this.elements.forEach(function(k){return w.appendChild(k)}),w},x}(vt),Rt=function(){function B(x,w){this.horizontal=x,this.vertical=w}return Object.defineProperty(B.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),B.prototype.getVerticalLength=function(x){return x/this.ratio},B.prototype.getHorizontalLength=function(x){return x*this.ratio},B}(),ct=function(){function B(){}return B.getIcon=function(x,w){if(x>0&&w>0){var k=new Rt(x,w),z=k.ratio>=1?20:k.getHorizontalLength(20),F=k.ratio<1?20:k.getVerticalLength(20),ae=document.createElementNS("http://www.w3.org/2000/svg","svg");ae.setAttribute("xmlns","http://www.w3.org/2000/svg"),ae.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ae);var Ce=Ue.createDefs();ae.appendChild(Ce);var We=Ue.createElement("clipPath",[["id","text-bg-clip"]]);Ce.appendChild(We);var $e=Ue.createPath(Ue.getHollowRectanglePath((24-z)/2,(24-F)/2,z,F,(24-z)/2+2,(24-F)/2+2,z-4,F-4));ae.appendChild($e);var Ae=Ue.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ae.appendChild(Ue.createTSpan(x+":"+w)),ae.appendChild(Ae);var Ze=Ae.getBBox();Ue.setAttributes(Ae,[["x",((24-Ze.width)/2).toString()],["y",((24-Ze.height)/2-Ze.y).toString()]]);var qe=Ue.createPath(Ue.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Ze.width))/2,(24-Math.ceil(Ze.height))/2,Math.ceil(Ze.width),Math.ceil(Ze.height)));return We.appendChild(qe),Ue.setAttributes($e,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ae),ae.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},B}(),Tt=function(B){function x(w,k,z){var F=B.call(this,w,k)||this;return F.isDropdownOpen=!1,F.onClick=F.dropdownButtonClicked,F.dropdownButtons=z,F}return dt(x,B),x.prototype.setupDropdown=function(){var w=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(k){k.className=w.className,k.colorsClassName=w.colorsClassName,w.dropdownBlock.appendChild(k.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},x.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},x.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},x.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},x.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},x.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},x}(bt),At=function(){function B(x,w){this.GRIP_SIZE=10,this.color=x,this.fillColor=w,this.visual=Ue.createGroup(),this.visual.appendChild(Ue.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ue.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return B.prototype.ownsTarget=function(x){return x===this.visual||x===this.visual.childNodes[0]||x===this.visual.childNodes[1]},B.prototype.setCenter=function(x,w){this.visual.childNodes.forEach(function(k){return Ue.setAttributes(k,[["cx",x.toString()],["cy",w.toString()]])})},B}(),_t=function(){function B(x,w,k,z){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=x,this.canvasHeight=w,this.margin=k,this.container=z,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(B.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(x){this._aspectRatio=x,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(x){this._isGridVisible=x,this.gridContainer&&Ue.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(x){this._zoomFactor=x,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),B.prototype.open=function(){var x=this;this.cropShadeElement=Ue.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Ue.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var w=0;w<this.numberOfGridLines;w++)this.horizontalGridLines.push(Ue.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Ue.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(k){return x.gridContainer.appendChild(k)}),this.verticalGridLines.forEach(function(k){return x.gridContainer.appendChild(k)}),this.cropRectElement=Ue.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new At(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new At(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new At(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new At(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},B.prototype.setCropRectangle=function(x){this.cropRect=x;var w=Object.assign({},this.cropRect);this.zoomFactor!==1&&(w.width=this.cropRect.width*this.zoomFactor,w.height=this.cropRect.height*this.zoomFactor,w.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-w.width/2,w.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-w.height/2),Ue.setAttributes(this.cropRectElement,[["x",w.x.toString()],["y",w.y.toString()],["width",w.width.toString()],["height",w.height.toString()]]);var k=w.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(F,ae){var Ce=w.y+k*(ae+1);Ue.setAttributes(F,[["x1",""+w.x],["y1",""+Ce],["x2",""+(w.x+w.width)],["y2",""+Ce]])});var z=w.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(F,ae){var Ce=w.x+z*(ae+1);Ue.setAttributes(F,[["x1",""+Ce],["y1",""+w.y],["x2",""+Ce],["y2",""+(w.y+w.height)]])}),Ue.setAttributes(this.cropShadeElement,[["d",Ue.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,w.x,w.y,w.width,w.height)]]),this.topLeftGrip.setCenter(w.x,w.y),this.topRightGrip.setCenter(w.x+w.width,w.y),this.bottomLeftGrip.setCenter(w.x,w.y+w.height),this.bottomRightGrip.setCenter(w.x+w.width,w.y+w.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},B.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)},B.prototype.clientToLocalCoordinates=function(x,w){var k=this.container.getBoundingClientRect();return{x:x-k.left+this.margin,y:w-k.top+this.margin}},B.prototype.onPointerDown=function(x){this.container.setPointerCapture(x.pointerId),this.previousPoint=this.clientToLocalCoordinates(x.clientX,x.clientY),this.cropRectElement===x.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(x.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(x.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(x.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(x.target)&&(this.activeGrip=this.bottomRightGrip)},B.prototype.onPointerMove=function(x){if(this.isMoving)this.move(this.clientToLocalCoordinates(x.clientX,x.clientY));else if(this.activeGrip){var w=this.clientToLocalCoordinates(x.clientX,x.clientY);this.resize(w)}x.preventDefault()},B.prototype.onPointerUp=function(x){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(x.pointerId)},B.prototype.move=function(x){var w=x.x-this.previousPoint.x,k=x.y-this.previousPoint.y;this.zoomFactor!==1&&(w=-w/this.zoomFactor,k=-k/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+w),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+k),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=x},B.prototype.resize=function(x){var w=Object.assign({},this.cropRect),k=x.x-this.previousPoint.x,z=x.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:w.x+k<this.margin&&(k=this.margin-w.x),w.x+=k,w.width=this.cropRect.x+this.cropRect.width-w.x;break;case this.bottomRightGrip:case this.topRightGrip:w.width+k>this.canvasWidth*this.zoomFactor&&(k=this.canvasWidth*this.zoomFactor-w.width),w.width+=k}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(w.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(k),w.height=this.aspectRatio.getVerticalLength(w.width)):(w.y+=z,w.height=this.cropRect.y+this.cropRect.height-w.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?w.height=this.aspectRatio.getVerticalLength(w.width):w.height+=z}w.width<10&&(w.x=this.cropRect.x,w.width=10),w.height<10&&(w.y=this.cropRect.y,w.height=10),this.previousPoint=x,w.x>=this.margin&&w.y>=this.margin&&w.x-this.margin+w.width<=this.canvasWidth&&w.y-this.margin+w.height<=this.canvasHeight&&(this.cropRect=w,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},B.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var x=this.cropRect.x+this.cropRect.width/2,w=this.cropRect.y+this.cropRect.height/2,k=this.aspectRatio.getHorizontalLength(this.cropRect.height),z=this.aspectRatio.getVerticalLength(this.cropRect.width);k/this.canvasWidth<z/this.canvasHeight?this.cropRect.width=k:this.cropRect.height=z,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=x-this.cropRect.width/2,this.cropRect.y=w-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)}},B.prototype.getRescaledRect=function(x,w,k,z,F,ae){var Ce=k/x,We=z/w;return{x:(F.x-ae)*Ce+ae,y:(F.y-ae)*We+ae,width:F.width*Ce,height:F.height*We}},B.prototype.scaleCanvas=function(x,w){var k=this.getRescaledRect(this.canvasWidth,this.canvasHeight,x,w,this.cropRect,this.margin);this.canvasWidth=x,this.canvasHeight=w,this.onCropChange&&this.onCropChange(k),this.setCropRectangle(k)},B}(),Pt=function(){function B(x){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=x,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(B.prototype,"angle",{get:function(){return this._angle},set:function(x){this._angle=x,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),B.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},B.prototype.onPointerDown=function(x){this.controlContainer.setPointerCapture(x.pointerId),this.isDragging=!0,this.previousPoint={x:x.clientX,y:x.clientY}},B.prototype.onPointerMove=function(x){this.isDragging&&(this.onAngleChange&&this.onAngleChange((x.clientX-this.previousPoint.x)/5),this.previousPoint.x=x.clientX)},B.prototype.onPointerUp=function(x){this.isDragging&&this.onAngleChange&&this.onAngleChange((x.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(x.pointerId)},B.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var x=this.angleLabelText.getBBox();Ue.setAttributes(this.angleLabelElement,[["x",((this.width-x.width)/2).toString()],["y",(this.height/2).toString()]])}},B.prototype.positionScaleShape=function(){if(this.scaleShape){var x=this.scaleShape.transform.baseVal.getItem(0);x.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(x,0)}},B.prototype.getVisual=function(){var x=document.createElementNS("http://www.w3.org/2000/svg","svg");x.setAttribute("xmlns","http://www.w3.org/2000/svg"),x.setAttribute("width",this.width+"px"),x.setAttribute("height",this.height+"px"),x.setAttribute("viewBox","0 0 "+this.width+" "+this.height),x.style.flexShrink="0",document.body.appendChild(x);for(var w="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,k=1;k<=this.width/5+10;k++){var z=k%5==0?this.height/3:this.height/6;w+="h4v"+-z+"h1v"+z}w+="v1H0Z",this.scaleShape=Ue.createPath(w);var F=Ue.createTransform();this.scaleShape.transform.baseVal.appendItem(F),x.appendChild(this.scaleShape),this.angleLabelElement=Ue.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Ue.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ae=Ue.createTSpan("");return ae.innerHTML="&deg;",this.angleLabelElement.appendChild(ae),x.appendChild(this.angleLabelElement),document.body.removeChild(x),x},B}(),It=function(){function B(){this.naturalSize=!1,this.imageType="image/png"}return B.prototype.rasterize=function(x,w,k,z,F,ae,Ce){var We=this;return new Promise(function($e){var Ae=document.createElement("canvas");Ae.width=x.width.baseVal.value-2*z,Ae.height=x.height.baseVal.value-2*z;var Ze=1,qe=1;We.naturalSize===!0?(Ze=w.naturalWidth/(x.width.baseVal.value-2*z)/ae,qe=w.naturalHeight/(x.height.baseVal.value-2*z)/Ce,Ae.width=w.naturalWidth/ae,Ae.height=w.naturalHeight/Ce):We.width!==void 0&&We.height!==void 0&&(Ze=We.width/k.width,qe=We.height/k.height,Ae.width*=Ze,Ae.height*=qe);var ft=Ae.getContext("2d");ft.translate(Ae.width/2,Ae.height/2),ft.rotate(F*Math.PI/180),ft.scale(ae,Ce),ft.translate(-Ae.width/2,-Ae.height/2),ft.drawImage(w,0,0,Ae.width,Ae.height);var Lt=document.createElement("canvas");Lt.width=k.width*Ze,Lt.height=k.height*qe,Lt.getContext("2d").putImageData(ft.getImageData((k.x-z)*Ze,(k.y-z)*qe,k.width*Ze,k.height*qe),0,0),$e(Lt.toDataURL(We.imageType,We.imageQuality))})},B}(),Bt=function(){function B(x){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=B.instanceCounter++,this.styles=new pt(this.instanceNo),this.target=x,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(B.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(x){this._zoomToCropEnabled=x,x?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(x){this._isGridVisible=x,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"gridLines",{get:function(){return this._gridLines},set:function(x){this._gridLines=x,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(x){this._rotationAngle=x,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"aspectRatio",{get:function(){var x;return(x=this._aspectRatio)!==null&&x!==void 0?x:this.aspectRatios[0]},set:function(x){this._aspectRatio=x},enumerable:!1,configurable:!0}),B.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},B.prototype.show=function(){this.showUI(),this.open()},B.prototype.close=function(x){x===void 0&&(x=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),x||this.closeEventListeners.forEach(function(w){return w()}),this._isOpen=!1)},B.prototype.addRenderEventListener=function(x){this.renderEventListeners.push(x)},B.prototype.removeRenderEventListener=function(x){this.renderEventListeners.indexOf(x)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(x),1)},B.prototype.addCloseEventListener=function(x){this.closeEventListeners.push(x)},B.prototype.removeCloseEventListener=function(x){this.closeEventListeners.indexOf(x)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(x),1)},B.prototype.setupResizeObserver=function(){var x=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){x.resize(x.target.clientWidth,x.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))},B.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var x=1*this.target.clientWidth/this.target.clientHeight,w=this.contentDiv.clientWidth/x>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*x:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,k=w+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/x;this.resize(w,k)}},B.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},B.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",Ue.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},B.prototype.resize=function(x,w){this.imageWidth=Math.round(x),this.imageHeight=Math.round(w),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()},B.prototype.setEditingTarget=function(){var x=document.createElement("canvas");x.width=this.target.naturalWidth,x.height=this.target.naturalHeight,x.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var w=x.toDataURL();Ue.setAttributes(this.editingTarget,[["href",w]]),this.setEditingTargetSize()},B.prototype.setTopLeft=function(){var x=this.target.getBoundingClientRect(),w=this.editorCanvas.getBoundingClientRect();this.left=x.left-w.left-this.CANVAS_MARGIN,this.top=x.top-w.top-this.CANVAS_MARGIN},B.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=Ue.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Ue.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Ue.createGroup(),this.editingTargetRotationScaleContainer=Ue.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var x=Ue.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(x);var w=Ue.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(w),this.editingTargetContainer=Ue.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)},B.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},B.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Ue.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new _t(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()},B.prototype.zoomToCrop=function(){if(this.cropRect){var x=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,w=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=x+"px "+w+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-x+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-w+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},B.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)},B.prototype.cropRectChanged=function(x){this.cropRect=x,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},B.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},B.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"},B.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},B.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 x=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,w=this.target.offsetTop>x+this.CANVAS_MARGIN?this.target.offsetTop-(x+this.CANVAS_MARGIN):0;this.coverDiv.style.top=w+"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},B.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},B.prototype.addTopToolbar=function(){var x=this;this.topToolbar=new tt,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 w=new Et;w.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(w);var k=[];this.aspectRatios.forEach(function(qe){var ft=new bt(ct.getIcon(qe.horizontal,qe.vertical),qe.horizontal===0&&qe.vertical===0?"FREE":qe.horizontal+":"+qe.vertical);ft.onClick=function(){return x.ratioButtonClicked(qe)},k.push(ft)}),this.aspectRatioButton=new Tt(ct.getIcon(0,0),"Aspect ratio",k),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,w.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var z=new bt('<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");z.isActive=this.isGridVisible,z.onClick=function(){x.isGridVisible=!x.isGridVisible,z.isActive=x.isGridVisible},w.addButton(z);var F=new bt('<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(F.isActive=this.zoomToCropEnabled,F.onClick=function(){x.zoomToCropEnabled=!x.zoomToCropEnabled,F.isActive=x.zoomToCropEnabled},w.addButton(F),!ut.isLicensed){var ae=new Ot;this.topToolbar.addElementBlock(ae);var Ce=document.createElement("div");Ce.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var We=document.createElement("a");We.style.color="currentColor",We.href="https://markerjs.com/products/cropro",We.target="_blank",We.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>',Ce.appendChild(We),ae.addElement(Ce)}var $e=new Et;$e.minWidth=3*this.toolbarHeight+"px",$e.contentAlign="end",this.topToolbar.addButtonBlock($e);var Ae=new bt('<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");Ae.onClick=this.startRenderAndClose,$e.addButton(Ae),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ae.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ze=new bt('<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");Ze.onClick=this.close,$e.addButton(Ze),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Ze.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},B.prototype.addBottomToolbar=function(){var x=this;this.bottomToolbar=new tt,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 w=new Et;w.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(w);var k=new bt('<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");k.onClick=this.rotateLeftButtonClicked,w.addButton(k);var z=new bt('<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");z.onClick=this.rotateRightButtonClicked,w.addButton(z);var F=new Ot;F.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(F),this.straightener=new Pt("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($e){x.rotateBy($e),x.straightener.angle=x.rotationAngle},F.addElement(this.straightener.getUI());var ae=new Et;ae.minWidth=2*this.toolbarHeight+"px",ae.contentAlign="end",this.bottomToolbar.addButtonBlock(ae);var Ce=new bt('<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");Ce.onClick=this.flipHorizontallyButtonClicked,ae.addButton(Ce);var We=new bt('<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");We.onClick=this.flipVerticallyButtonClicked,ae.addButton(We)},B.prototype.ratioButtonClicked=function(x){this.aspectRatio=x,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},B.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ct.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},B.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Rt(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},B.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},B.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},B.prototype.restoreState=function(x){if(x){var w=this.cropLayer.getRescaledRect(x.width,x.height,this.imageWidth,this.imageHeight,x.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(w),this.cropRectChanged(w),this.flippedHorizontally=x.flippedHorizontally,this.flippedVertically=x.flippedVertically,this.applyFlip(),this.rotationAngle=x.rotationAngle,this.applyRotation()}},B.prototype.clientToLocalCoordinates=function(x,w){var k=this.cropImage.getBoundingClientRect();return{x:x-k.left,y:w-k.top}},B.prototype.onWindowResize=function(){this.positionUI()},B.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var x=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=x+"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()},B.prototype.rotateLeftButtonClicked=function(){var x=this.rotationAngle-90;this.rotationAngle%90!=0&&(x+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(x)},B.prototype.rotateRightButtonClicked=function(){var x=this.rotationAngle+90;this.rotationAngle%90!=0&&(x-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(x)},B.prototype.rotateTo=function(x){x=(x=x>180?x-360:x)<=-180?x+360:x,this.rotationAngle=x,this.applyRotation()},B.prototype.rotateBy=function(x){this.rotateTo((this.rotationAngle+x)%360)},B.prototype.applyRotation=function(){var x=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var w=this.editingTargetRotationContainer.transform.baseVal.getItem(0);w.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(w,0);var k=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/k.width,this.imageHeight/k.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=x},B.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},B.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},B.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},B.prototype.startRenderAndClose=function(){return et(this,void 0,void 0,function(){var x,w;return st(this,function(k){switch(k.label){case 0:return[4,this.render()];case 1:return x=k.sent(),w=this.getState(),this.renderEventListeners.forEach(function(z){return z(x,w)}),this.close(!0),[2]}})})},B.prototype.render=function(){return et(this,void 0,void 0,function(){var x;return st(this,function(w){switch(w.label){case 0:return(x=new It).naturalSize=this.renderAtNaturalSize,x.imageType=this.renderImageType,x.imageQuality=this.renderImageQuality,x.width=this.renderWidth,x.height=this.renderHeight,this.unzoomFromCrop(),Ue.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,x.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 w.sent(),[4,x.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,w.sent()]}})})},B.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ye("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 Ye("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ye("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var x=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ye("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*x)+`px;
height: `+(this.toolbarHeight-2*x)+`px;
padding: `+x+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ye("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ye("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new Xe("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new Xe("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Ye("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 Ye("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Ye("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 Ye("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*x)+`px;
padding: `+x+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Ye("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},B.instanceCounter=0,B}(),Wt=U("8hTe"),Mt=U.n(Wt),Ft=/<pre[^>]*>/g;function Ht(B){var x=document.createElement("div");return x.innerHTML=B,x.childNodes.length===0?"":x.childNodes[0].nodeValue}var Jt=ne.a=function(B){var x=B.value,w=x===void 0?"":x,k=B.edit,z=k===void 0?!1:k,F=B.className,ae=B.showTextOnly,Ce=B.showLines,We=B.replaces,$e=B.zoomImg,Ae=B.hasMask,Ze=B.style,qe=Ze===void 0?{}:Ze,ft=B.stylesPrev,Lt=ft===void 0?{}:ft,Ut=String(w),yt=Object(C.useRef)(),Nt=Object(C.useRef)(),rr=Object(C.useState)(""),Qt=Object(K.a)(rr,2),Kt=Qt[0],jt=Qt[1],nr=Object(C.useState)("office"),Zt=Object(K.a)(nr,2),lr=Zt[0],Gt=Zt[1],ir=function(){var it=new Bt(Nt.current);it.displayMode="popup",it.addRenderEventListener(function(){var xt=Object(R.a)(e.a.mark(function ot(wt){var mt;return e.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:return yt.current.style.display="none",Ct.next=3,Object(fe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:wt}});case 3:mt=Ct.sent,mt!=null&&mt.id&&We(Nt.current.getAttribute("src").replace(G.a.API_SERVER,""),"/api/attachments/".concat(mt==null?void 0:mt.id,"?type=").concat(mt.content_type));case 5:case"end":return Ct.stop()}},ot)}));return function(ot){return xt.apply(this,arguments)}}()),it.show()},ur=function(){var it=new nt(Nt.current);it.settings.displayMode="popup",it.addEventListener("render",function(){var xt=Object(R.a)(e.a.mark(function ot(wt){var mt;return e.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:if(yt.current.style.display="none",!Nt.current){Ct.next=6;break}return Ct.next=4,Object(fe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:wt.dataUrl}});case 4:mt=Ct.sent,mt!=null&&mt.id&&We(Nt.current.getAttribute("src").replace(G.a.API_SERVER,""),"/api/attachments/".concat(mt==null?void 0:mt.id,"?type=").concat(mt.content_type));case 6:case"end":return Ct.stop()}},ot)}));return function(ot){return xt.apply(this,arguments)}}()),it.show(),window.markerArea=it},zt=Object(C.useMemo)(function(){yt.current&&(yt.current.style.zIndex=-1);try{var gt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,it=/\"\/api\/attachments\/|\"\/attachments\/download\//g,xt=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Ut=Ut.replace(gt,"("+G.a.API_SERVER+"/api/attachments/").replace(it,'"'+G.a.API_SERVER+"/api/attachments/").replace(xt,'"'+G.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`)}catch(qt){}var ot=L(Ut),wt=b();if(Ut.match(/\[TOC\]/)&&(ot=ot.replace("<p>[TOC]</p>",T()),E()),ot=ot.replace(/(__special_katext_id_\d+__)/g,function(qt,Ct){var sr=wt[Ct],er=sr.type,Xt=sr.expression;return Object(X.renderToString)(Ht(Xt)||"",{displayMode:er==="block",throwOnError:!1,output:"html"})}),ot=ot.replace(/▁/g,"\u2581\u2581\u2581"),p(),ae){var mt=document.createElement("div");return mt.innerHTML=ot,mt.innerText}return setTimeout(function(){return ar()},500),ot},[Ut]),kt=Object(C.useRef)();y.WebkitLineClamp=Ce,Ce&&(qe=Object(P.a)(Object(P.a)({},qe),y));function Vt(gt){var it=gt.target;if(it.tagName.toUpperCase()==="IMG"){if($e){var xt=it.getAttribute("src");jt(xt),Gt("image")}}else if(it.tagName.toUpperCase()==="A"){var ot=it.getAttribute("href");if(ot.indexOf("office")>-1)gt.preventDefault(),jt(ot),Gt("office");else if(ot.indexOf("application/pdf")>-1)gt.preventDefault(),jt(ot),Gt("pdf");else if(ot.indexOf("text/html")>-1)gt.preventDefault(),jt(ot),Gt("html");else if(ot.startsWith("#")){gt.preventDefault();var wt=document.getElementById(ot.replace("#",""));wt&&wt.scrollIntoView(!0)}}}var ar=function(){var it,xt=(it=kt.current)===null||it===void 0?void 0:it.querySelectorAll("video");xt==null||xt.forEach(function(ot){if(ot.oncontextmenu=function(){return!1},ot.src.indexOf(".m3u8")>-1&&!ot.canPlayType("application/vnd.apple.mpegurl")){if(j.a.isSupported()){var wt=new j.a;wt.loadSource(ot.src),wt.attachMedia(ot)}}})};Object(C.useEffect)(function(){if(kt.current&&zt&&(zt.match(Ft)&&window.PR.prettyPrint()),kt.current)return kt.current.addEventListener("click",Vt),function(){kt.current.removeEventListener("click",Vt),p(),E()}},[zt,kt.current,Vt]);var Yt=function(it){if(!z)return;it.target.nodeName==="IMG"?(yt.current.style.zIndex=1,yt.current.style.display="flex",yt.current.style.width=it.target.clientWidth+"px",yt.current.style.height=it.target.clientHeight+"px",yt.current.style.top=it.target.offsetTop+"px",yt.current.style.left=it.target.offsetLeft+"px",Nt.current.src=it.target.getAttribute("src")):yt.current.style.display="none"};return g.a.createElement("div",{style:{position:"relative"}},g.a.createElement("div",{ref:kt,style:Object(P.a)({},qe),className:"".concat(F||""," markdown-body ").concat(Mt.a.mdBody),onMouseOver:Yt,dangerouslySetInnerHTML:{__html:zt}}),g.a.createElement("div",{ref:yt,className:Mt.a.button},g.a.createElement(H.a,null,g.a.createElement(W.a,{onClick:function(){return ir()}},"\u88C1\u526A"),g.a.createElement(W.a,{onClick:function(){return ur()}},"\u7F16\u8F91"))),g.a.createElement("img",{ref:Nt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),g.a.createElement(te.a,{close:!0,data:Kt,type:Kt!=null&&Kt.length?lr:"",style:Object(P.a)({},Lt),onClose:function(){return jt("")}}))}},BU3w:function(Ne,ne,U){"use strict";U.d(ne,"a",function(){return R});var Q=U("MNnm"),H="rc-util-key";function I(K){if(K.attachTo)return K.attachTo;var N=document.querySelector("head");return N||document.body}function W(K){var N,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(Q.a)())return null;var C=document.createElement("style");if((N=e.csp)===null||N===void 0?void 0:N.nonce){var g;C.nonce=(g=e.csp)===null||g===void 0?void 0:g.nonce}C.innerHTML=K;var v=I(e),c=v.firstChild;return e.prepend&&v.prepend?v.prepend(C):e.prepend&&c?v.insertBefore(C,c):v.appendChild(C),C}var P=new Map;function R(K,N){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},C=I(e);if(!P.has(C)){var g=W("",e),v=g.parentNode;P.set(C,v),v.removeChild(g)}var c=Array.from(P.get(C).children).find(function(n){return n.tagName==="STYLE"&&n[H]===N});if(c){var s,i;if(((s=e.csp)===null||s===void 0?void 0:s.nonce)&&c.nonce!==((i=e.csp)===null||i===void 0?void 0:i.nonce)){var l;c.nonce=(l=e.csp)===null||l===void 0?void 0:l.nonce}return c.innerHTML!==K&&(c.innerHTML=K),c}var a=W(K,e);return a[H]=N,a}},"C/vA":function(Ne,ne,U){"use strict";U.d(ne,"a",function(){return Q});function Q(H){const I=this;let W=!1,P;return function(){return W||(W=!0,P=H.apply(I,arguments)),P}}},"Cg/j":function(Ne,ne,U){"use strict";U.d(ne,"b",function(){return Q}),U.d(ne,"a",function(){return H}),U.d(ne,"c",function(){return W}),U.d(ne,"d",function(){return P});var Q;(function(R){R.serviceIds=new Map,R.DI_TARGET="$di$target",R.DI_DEPENDENCIES="$di$dependencies";function K(N){return N[R.DI_DEPENDENCIES]||[]}R.getServiceDependencies=K})(Q||(Q={}));const H=W("instantiationService");function I(R,K,N,e){K[Q.DI_TARGET]===K?K[Q.DI_DEPENDENCIES].push({id:R,index:N,optional:e}):(K[Q.DI_DEPENDENCIES]=[{id:R,index:N,optional:e}],K[Q.DI_TARGET]=K)}function W(R){if(Q.serviceIds.has(R))return Q.serviceIds.get(R);const K=function(N,e,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");I(K,N,C,!1)};return K.toString=()=>R,Q.serviceIds.set(R,K),K}function P(R){return function(K,N,e){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");I(R,K,e,!0)}}},DlQD:function(Ne,ne,U){(function(Q,H){Ne.exports=H()})(this,function(){"use strict";function Q(re,Z){for(var J=0;J<Z.length;J++){var V=Z[J];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(re,V.key,V)}}function H(re,Z,J){return Z&&Q(re.prototype,Z),J&&Q(re,J),re}function I(re,Z){if(!re)return;if(typeof re=="string")return W(re,Z);var J=Object.prototype.toString.call(re).slice(8,-1);if(J==="Object"&&re.constructor&&(J=re.constructor.name),J==="Map"||J==="Set")return Array.from(re);if(J==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(J))return W(re,Z)}function W(re,Z){(Z==null||Z>re.length)&&(Z=re.length);for(var J=0,V=new Array(Z);J<Z;J++)V[J]=re[J];return V}function P(re,Z){var J;if(typeof Symbol=="undefined"||re[Symbol.iterator]==null){if(Array.isArray(re)||(J=I(re))||Z&&re&&typeof re.length=="number"){J&&(re=J);var V=0;return function(){return V>=re.length?{done:!0}:{done:!1,value:re[V++]}}}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 J=re[Symbol.iterator](),J.next.bind(J)}function R(re,Z){return Z={exports:{}},re(Z,Z.exports),Z.exports}var K=R(function(re){function Z(){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 J(V){re.exports.defaults=V}re.exports={defaults:Z(),getDefaults:Z,changeDefaults:J}}),N=K.defaults,e=K.getDefaults,C=K.changeDefaults,g=/[&<>"']/,v=/[&<>"']/g,c=/[<>"']|&(?!#?\w+;)/,s=/[<>"']|&(?!#?\w+;)/g,i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},l=function(Z){return i[Z]};function a(re,Z){if(Z){if(g.test(re))return re.replace(v,l)}else if(c.test(re))return re.replace(s,l);return re}var n=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function r(re){return re.replace(n,function(Z,J){return J=J.toLowerCase(),J==="colon"?":":J.charAt(0)==="#"?J.charAt(1)==="x"?String.fromCharCode(parseInt(J.substring(2),16)):String.fromCharCode(+J.substring(1)):""})}var t=/(^|[^\[])\^/g;function E(re,Z){re=re.source||re,Z=Z||"";var J={replace:function(Y,q){return q=q.source||q,q=q.replace(t,"$1"),re=re.replace(Y,q),J},getRegex:function(){return new RegExp(re,Z)}};return J}var y=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function T(re,Z,J){if(re){var V;try{V=decodeURIComponent(r(J)).replace(y,"").toLowerCase()}catch(Y){return null}if(V.indexOf("javascript:")===0||V.indexOf("vbscript:")===0||V.indexOf("data:")===0)return null}Z&&!m.test(J)&&(J=u(Z,J));try{J=encodeURI(J).replace(/%25/g,"%")}catch(Y){return null}return J}var _={},f=/^[^:]+:\/*[^/]*$/,h=/^([^:]+:)[\s\S]*$/,o=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(re,Z){_[" "+re]||(f.test(re)?_[" "+re]=re+"/":_[" "+re]=A(re,"/",!0)),re=_[" "+re];var J=re.indexOf(":")===-1;return Z.substring(0,2)==="//"?J?Z:re.replace(h,"$1")+Z:Z.charAt(0)==="/"?J?Z:re.replace(o,"$1")+Z:re+Z}var b={exec:function(){}};function p(re){for(var Z=1,J,V;Z<arguments.length;Z++){J=arguments[Z];for(V in J)Object.prototype.hasOwnProperty.call(J,V)&&(re[V]=J[V])}return re}function d(re,Z){var J=re.replace(/\|/g,function(q,ee,le){for(var ge=!1,Oe=ee;--Oe>=0&&le[Oe]==="\\";)ge=!ge;return ge?"|":" |"}),V=J.split(/ \|/),Y=0;if(V.length>Z)V.splice(Z);else for(;V.length<Z;)V.push("");for(;Y<V.length;Y++)V[Y]=V[Y].trim().replace(/\\\|/g,"|");return V}function A(re,Z,J){var V=re.length;if(V===0)return"";for(var Y=0;Y<V;){var q=re.charAt(V-Y-1);if(q===Z&&!J)Y++;else if(q!==Z&&J)Y++;else break}return re.substr(0,V-Y)}function D(re,Z){if(re.indexOf(Z[1])===-1)return-1;for(var J=re.length,V=0,Y=0;Y<J;Y++)if(re[Y]==="\\")Y++;else if(re[Y]===Z[0])V++;else if(re[Y]===Z[1]&&(V--,V<0))return Y;return-1}function S(re){re&&re.sanitize&&!re.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var L={escape:a,unescape:r,edit:E,cleanUrl:T,resolveUrl:u,noopTest:b,merge:p,splitCells:d,rtrim:A,findClosingBracket:D,checkSanitizeDeprecation:S},M=K.defaults,O=L.rtrim,j=L.splitCells,G=L.escape,X=L.findClosingBracket;function te(re,Z,J){var V=Z.href,Y=Z.title?G(Z.title):null,q=re[1].replace(/\\([\[\]])/g,"$1");return re[0].charAt(0)!=="!"?{type:"link",raw:J,href:V,title:Y,text:q}:{type:"image",raw:J,href:V,title:Y,text:G(q)}}function fe(re,Z){var J=re.match(/^(\s+)(?:```)/);if(J===null)return Z;var V=J[1];return Z.split(`
`).map(function(Y){var q=Y.match(/^\s+/);if(q===null)return Y;var ee=q[0];return ee.length>=V.length?Y.slice(V.length):Y}).join(`
`)}var ve=function(){function re(J){this.options=J||M}var Z=re.prototype;return Z.space=function(V){var Y=this.rules.block.newline.exec(V);if(Y)return Y[0].length>1?{type:"space",raw:Y[0]}:{raw:`
`}},Z.code=function(V,Y){var q=this.rules.block.code.exec(V);if(q){var ee=Y[Y.length-1];if(ee&&ee.type==="paragraph")return{raw:q[0],text:q[0].trimRight()};var le=q[0].replace(/^ {4}/gm,"");return{type:"code",raw:q[0],codeBlockStyle:"indented",text:this.options.pedantic?le:O(le,`
`)}}},Z.fences=function(V){var Y=this.rules.block.fences.exec(V);if(Y){var q=Y[0],ee=fe(q,Y[3]||"");return{type:"code",raw:q,lang:Y[2]?Y[2].trim():Y[2],text:ee}}},Z.heading=function(V){var Y=this.rules.block.heading.exec(V);if(Y)return{type:"heading",raw:Y[0],depth:Y[1].length,text:Y[2]}},Z.nptable=function(V){var Y=this.rules.block.nptable.exec(V);if(Y){var q={type:"table",header:j(Y[1].replace(/^ *| *\| *$/g,"")),align:Y[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Y[3]?Y[3].replace(/\n$/,"").split(`
`):[],raw:Y[0]};if(q.header.length===q.align.length){var ee=q.align.length,le;for(le=0;le<ee;le++)/^ *-+: *$/.test(q.align[le])?q.align[le]="right":/^ *:-+: *$/.test(q.align[le])?q.align[le]="center":/^ *:-+ *$/.test(q.align[le])?q.align[le]="left":q.align[le]=null;for(ee=q.cells.length,le=0;le<ee;le++)q.cells[le]=j(q.cells[le],q.header.length);return q}}},Z.hr=function(V){var Y=this.rules.block.hr.exec(V);if(Y)return{type:"hr",raw:Y[0]}},Z.blockquote=function(V){var Y=this.rules.block.blockquote.exec(V);if(Y){var q=Y[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Y[0],text:q}}},Z.list=function(V){var Y=this.rules.block.list.exec(V);if(Y){for(var q=Y[0],ee=Y[2],le=ee.length>1,ge=ee[ee.length-1]===")",Oe={type:"list",raw:q,ordered:le,start:le?+ee.slice(0,-1):"",loose:!1,items:[]},Ke=Y[0].match(this.rules.block.item),ze=!1,ke,Je,Qe,Ge,at,nt,rt,dt=Ke.length,et=0;et<dt;et++)ke=Ke[et],q=ke,Je=ke.length,ke=ke.replace(/^ *([*+-]|\d+[.)]) */,""),~ke.indexOf(`
`)&&(Je-=ke.length,ke=this.options.pedantic?ke.replace(/^ {1,4}/gm,""):ke.replace(new RegExp("^ {1,"+Je+"}","gm"),"")),et!==dt-1&&(Qe=this.rules.block.bullet.exec(Ke[et+1])[0],(le?Qe.length===1||!ge&&Qe[Qe.length-1]===")":Qe.length>1||this.options.smartLists&&Qe!==ee)&&(Ge=Ke.slice(et+1).join(`
`),Oe.raw=Oe.raw.substring(0,Oe.raw.length-Ge.length),et=dt-1)),at=ze||/\n\n(?!\s*$)/.test(ke),et!==dt-1&&(ze=ke.charAt(ke.length-1)===`
`,at||(at=ze)),at&&(Oe.loose=!0),nt=/^\[[ xX]\] /.test(ke),rt=void 0,nt&&(rt=ke[1]!==" ",ke=ke.replace(/^\[[ xX]\] +/,"")),Oe.items.push({type:"list_item",raw:q,task:nt,checked:rt,loose:at,text:ke});return Oe}},Z.html=function(V){var Y=this.rules.block.html.exec(V);if(Y)return{type:this.options.sanitize?"paragraph":"html",raw:Y[0],pre:!this.options.sanitizer&&(Y[1]==="pre"||Y[1]==="script"||Y[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Y[0]):G(Y[0]):Y[0]}},Z.def=function(V){var Y=this.rules.block.def.exec(V);if(Y){Y[3]&&(Y[3]=Y[3].substring(1,Y[3].length-1));var q=Y[1].toLowerCase().replace(/\s+/g," ");return{tag:q,raw:Y[0],href:Y[2],title:Y[3]}}},Z.table=function(V){var Y=this.rules.block.table.exec(V);if(Y){var q={type:"table",header:j(Y[1].replace(/^ *| *\| *$/g,"")),align:Y[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Y[3]?Y[3].replace(/\n$/,"").split(`
`):[]};if(q.header.length===q.align.length){q.raw=Y[0];var ee=q.align.length,le;for(le=0;le<ee;le++)/^ *-+: *$/.test(q.align[le])?q.align[le]="right":/^ *:-+: *$/.test(q.align[le])?q.align[le]="center":/^ *:-+ *$/.test(q.align[le])?q.align[le]="left":q.align[le]=null;for(ee=q.cells.length,le=0;le<ee;le++)q.cells[le]=j(q.cells[le].replace(/^ *\| *| *\| *$/g,""),q.header.length);return q}}},Z.lheading=function(V){var Y=this.rules.block.lheading.exec(V);if(Y)return{type:"heading",raw:Y[0],depth:Y[2].charAt(0)==="="?1:2,text:Y[1]}},Z.paragraph=function(V){var Y=this.rules.block.paragraph.exec(V);if(Y)return{type:"paragraph",raw:Y[0],text:Y[1].charAt(Y[1].length-1)===`
`?Y[1].slice(0,-1):Y[1]}},Z.text=function(V,Y){var q=this.rules.block.text.exec(V);if(q){var ee=Y[Y.length-1];return ee&&ee.type==="text"?{raw:q[0],text:q[0]}:{type:"text",raw:q[0],text:q[0]}}},Z.escape=function(V){var Y=this.rules.inline.escape.exec(V);if(Y)return{type:"escape",raw:Y[0],text:G(Y[1])}},Z.tag=function(V,Y,q){var ee=this.rules.inline.tag.exec(V);if(ee)return!Y&&/^<a /i.test(ee[0])?Y=!0:Y&&/^<\/a>/i.test(ee[0])&&(Y=!1),!q&&/^<(pre|code|kbd|script)(\s|>)/i.test(ee[0])?q=!0:q&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ee[0])&&(q=!1),{type:this.options.sanitize?"text":"html",raw:ee[0],inLink:Y,inRawBlock:q,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ee[0]):G(ee[0]):ee[0]}},Z.link=function(V){var Y=this.rules.inline.link.exec(V);if(Y){var q=X(Y[2],"()");if(q>-1){var ee=Y[0].indexOf("!")===0?5:4,le=ee+Y[1].length+q;Y[2]=Y[2].substring(0,q),Y[0]=Y[0].substring(0,le).trim(),Y[3]=""}var ge=Y[2],Oe="";if(this.options.pedantic){var Ke=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ge);Ke?(ge=Ke[1],Oe=Ke[3]):Oe=""}else Oe=Y[3]?Y[3].slice(1,-1):"";ge=ge.trim().replace(/^<([\s\S]*)>$/,"$1");var ze=te(Y,{href:ge&&ge.replace(this.rules.inline._escapes,"$1"),title:Oe&&Oe.replace(this.rules.inline._escapes,"$1")},Y[0]);return ze}},Z.reflink=function(V,Y){var q;if((q=this.rules.inline.reflink.exec(V))||(q=this.rules.inline.nolink.exec(V))){var ee=(q[2]||q[1]).replace(/\s+/g," ");if(ee=Y[ee.toLowerCase()],!ee||!ee.href){var le=q[0].charAt(0);return{type:"text",raw:le,text:le}}var ge=te(q,ee,q[0]);return ge}},Z.strong=function(V,Y,q){q===void 0&&(q="");var ee=this.rules.inline.strong.start.exec(V);if(ee&&(!ee[1]||ee[1]&&(q===""||this.rules.inline.punctuation.exec(q)))){Y=Y.slice(-1*V.length);var le=ee[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;le.lastIndex=0;for(var ge;(ee=le.exec(Y))!=null;)if(ge=this.rules.inline.strong.middle.exec(Y.slice(0,ee.index+3)),ge)return{type:"strong",raw:V.slice(0,ge[0].length),text:V.slice(2,ge[0].length-2)}}},Z.em=function(V,Y,q){q===void 0&&(q="");var ee=this.rules.inline.em.start.exec(V);if(ee&&(!ee[1]||ee[1]&&(q===""||this.rules.inline.punctuation.exec(q)))){Y=Y.slice(-1*V.length);var le=ee[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;le.lastIndex=0;for(var ge;(ee=le.exec(Y))!=null;)if(ge=this.rules.inline.em.middle.exec(Y.slice(0,ee.index+2)),ge)return{type:"em",raw:V.slice(0,ge[0].length),text:V.slice(1,ge[0].length-1)}}},Z.codespan=function(V){var Y=this.rules.inline.code.exec(V);if(Y){var q=Y[2].replace(/\n/g," "),ee=/[^ ]/.test(q),le=q.startsWith(" ")&&q.endsWith(" ");return ee&&le&&(q=q.substring(1,q.length-1)),q=G(q,!0),{type:"codespan",raw:Y[0],text:q}}},Z.br=function(V){var Y=this.rules.inline.br.exec(V);if(Y)return{type:"br",raw:Y[0]}},Z.del=function(V){var Y=this.rules.inline.del.exec(V);if(Y)return{type:"del",raw:Y[0],text:Y[1]}},Z.autolink=function(V,Y){var q=this.rules.inline.autolink.exec(V);if(q){var ee,le;return q[2]==="@"?(ee=G(this.options.mangle?Y(q[1]):q[1]),le="mailto:"+ee):(ee=G(q[1]),le=ee),{type:"link",raw:q[0],text:ee,href:le,tokens:[{type:"text",raw:ee,text:ee}]}}},Z.url=function(V,Y){var q;if(q=this.rules.inline.url.exec(V)){var ee,le;if(q[2]==="@")ee=G(this.options.mangle?Y(q[0]):q[0]),le="mailto:"+ee;else{var ge;do ge=q[0],q[0]=this.rules.inline._backpedal.exec(q[0])[0];while(ge!==q[0]);ee=G(q[0]),q[1]==="www."?le="http://"+ee:le=ee}return{type:"link",raw:q[0],text:ee,href:le,tokens:[{type:"text",raw:ee,text:ee}]}}},Z.inlineText=function(V,Y,q){var ee=this.rules.inline.text.exec(V);if(ee){var le;return Y?le=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ee[0]):G(ee[0]):ee[0]:le=G(this.options.smartypants?q(ee[0]):ee[0]),{type:"text",raw:ee[0],text:le}}},re}(),he=L.noopTest,xe=L.edit,Se=L.merge,de={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:he,table:he,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};de._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,de._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,de.def=xe(de.def).replace("label",de._label).replace("title",de._title).getRegex(),de.bullet=/(?:[*+-]|\d{1,9}[.)])/,de.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,de.item=xe(de.item,"gm").replace(/bull/g,de.bullet).getRegex(),de.list=xe(de.list).replace(/bull/g,de.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+de.def.source+")").getRegex(),de._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",de._comment=/<!--(?!-?>)[\s\S]*?-->/,de.html=xe(de.html,"i").replace("comment",de._comment).replace("tag",de._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),de.paragraph=xe(de._paragraph).replace("hr",de.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",de._tag).getRegex(),de.blockquote=xe(de.blockquote).replace("paragraph",de.paragraph).getRegex(),de.normal=Se({},de),de.gfm=Se({},de.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*|$)"}),de.gfm.nptable=xe(de.gfm.nptable).replace("hr",de.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",de._tag).getRegex(),de.gfm.table=xe(de.gfm.table).replace("hr",de.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",de._tag).getRegex(),de.pedantic=Se({},de.normal,{html:xe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",de._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:he,paragraph:xe(de.normal._paragraph).replace("hr",de.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",de.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ie={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:he,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:he,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ie._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ie.punctuation=xe(ie.punctuation).replace(/punctuation/g,ie._punctuation).getRegex(),ie._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ie._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ie.em.start=xe(ie.em.start).replace(/punctuation/g,ie._punctuation).getRegex(),ie.em.middle=xe(ie.em.middle).replace(/punctuation/g,ie._punctuation).replace(/overlapSkip/g,ie._overlapSkip).getRegex(),ie.em.endAst=xe(ie.em.endAst,"g").replace(/punctuation/g,ie._punctuation).getRegex(),ie.em.endUnd=xe(ie.em.endUnd,"g").replace(/punctuation/g,ie._punctuation).getRegex(),ie.strong.start=xe(ie.strong.start).replace(/punctuation/g,ie._punctuation).getRegex(),ie.strong.middle=xe(ie.strong.middle).replace(/punctuation/g,ie._punctuation).replace(/blockSkip/g,ie._blockSkip).getRegex(),ie.strong.endAst=xe(ie.strong.endAst,"g").replace(/punctuation/g,ie._punctuation).getRegex(),ie.strong.endUnd=xe(ie.strong.endUnd,"g").replace(/punctuation/g,ie._punctuation).getRegex(),ie.blockSkip=xe(ie._blockSkip,"g").getRegex(),ie.overlapSkip=xe(ie._overlapSkip,"g").getRegex(),ie._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ie._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ie._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])?)+(?![-_])/,ie.autolink=xe(ie.autolink).replace("scheme",ie._scheme).replace("email",ie._email).getRegex(),ie._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ie.tag=xe(ie.tag).replace("comment",de._comment).replace("attribute",ie._attribute).getRegex(),ie._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ie._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ie._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ie.link=xe(ie.link).replace("label",ie._label).replace("href",ie._href).replace("title",ie._title).getRegex(),ie.reflink=xe(ie.reflink).replace("label",ie._label).getRegex(),ie.reflinkSearch=xe(ie.reflinkSearch,"g").replace("reflink",ie.reflink).replace("nolink",ie.nolink).getRegex(),ie.normal=Se({},ie),ie.pedantic=Se({},ie.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:xe(/^!?\[(label)\]\((.*?)\)/).replace("label",ie._label).getRegex(),reflink:xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ie._label).getRegex()}),ie.gfm=Se({},ie.normal,{escape:xe(ie.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),ie.gfm.url=xe(ie.gfm.url,"i").replace("email",ie.gfm._extended_email).getRegex(),ie.breaks=Se({},ie.gfm,{br:xe(ie.br).replace("{2,}","*").getRegex(),text:xe(ie.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Le={block:de,inline:ie},Ve=K.defaults,Be=Le.block,je=Le.inline;function Ee(re){return re.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 Te(re){var Z="",J,V,Y=re.length;for(J=0;J<Y;J++)V=re.charCodeAt(J),Math.random()>.5&&(V="x"+V.toString(16)),Z+="&#"+V+";";return Z}var Re=function(){function re(J){this.tokens=[],this.tokens.links=Object.create(null),this.options=J||Ve,this.options.tokenizer=this.options.tokenizer||new ve,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var V={block:Be.normal,inline:je.normal};this.options.pedantic?(V.block=Be.pedantic,V.inline=je.pedantic):this.options.gfm&&(V.block=Be.gfm,this.options.breaks?V.inline=je.breaks:V.inline=je.gfm),this.tokenizer.rules=V}re.lex=function(V,Y){var q=new re(Y);return q.lex(V)};var Z=re.prototype;return Z.lex=function(V){return V=V.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(V,this.tokens,!0),this.inline(this.tokens),this.tokens},Z.blockTokens=function(V,Y,q){Y===void 0&&(Y=[]),q===void 0&&(q=!0),V=V.replace(/^ +$/gm,"");for(var ee,le,ge,Oe;V;){if(ee=this.tokenizer.space(V)){V=V.substring(ee.raw.length),ee.type&&Y.push(ee);continue}if(ee=this.tokenizer.code(V,Y)){V=V.substring(ee.raw.length),ee.type?Y.push(ee):(Oe=Y[Y.length-1],Oe.raw+=`
`+ee.raw,Oe.text+=`
`+ee.text);continue}if(ee=this.tokenizer.fences(V)){V=V.substring(ee.raw.length),Y.push(ee);continue}if(ee=this.tokenizer.heading(V)){V=V.substring(ee.raw.length),Y.push(ee);continue}if(ee=this.tokenizer.nptable(V)){V=V.substring(ee.raw.length),Y.push(ee);continue}if(ee=this.tokenizer.hr(V)){V=V.substring(ee.raw.length),Y.push(ee);continue}if(ee=this.tokenizer.blockquote(V)){V=V.substring(ee.raw.length),ee.tokens=this.blockTokens(ee.text,[],q),Y.push(ee);continue}if(ee=this.tokenizer.list(V)){for(V=V.substring(ee.raw.length),ge=ee.items.length,le=0;le<ge;le++)ee.items[le].tokens=this.blockTokens(ee.items[le].text,[],!1);Y.push(ee);continue}if(ee=this.tokenizer.html(V)){V=V.substring(ee.raw.length),Y.push(ee);continue}if(q&&(ee=this.tokenizer.def(V))){V=V.substring(ee.raw.length),this.tokens.links[ee.tag]||(this.tokens.links[ee.tag]={href:ee.href,title:ee.title});continue}if(ee=this.tokenizer.table(V)){V=V.substring(ee.raw.length),Y.push(ee);continue}if(ee=this.tokenizer.lheading(V)){V=V.substring(ee.raw.length),Y.push(ee);continue}if(q&&(ee=this.tokenizer.paragraph(V))){V=V.substring(ee.raw.length),Y.push(ee);continue}if(ee=this.tokenizer.text(V,Y)){V=V.substring(ee.raw.length),ee.type?Y.push(ee):(Oe=Y[Y.length-1],Oe.raw+=`
`+ee.raw,Oe.text+=`
`+ee.text);continue}if(V){var Ke="Infinite loop on byte: "+V.charCodeAt(0);if(this.options.silent){console.error(Ke);break}else throw new Error(Ke)}}return Y},Z.inline=function(V){var Y,q,ee,le,ge,Oe,Ke=V.length;for(Y=0;Y<Ke;Y++){Oe=V[Y];switch(Oe.type){case"paragraph":case"text":case"heading":{Oe.tokens=[],this.inlineTokens(Oe.text,Oe.tokens);break}case"table":{for(Oe.tokens={header:[],cells:[]},le=Oe.header.length,q=0;q<le;q++)Oe.tokens.header[q]=[],this.inlineTokens(Oe.header[q],Oe.tokens.header[q]);for(le=Oe.cells.length,q=0;q<le;q++)for(ge=Oe.cells[q],Oe.tokens.cells[q]=[],ee=0;ee<ge.length;ee++)Oe.tokens.cells[q][ee]=[],this.inlineTokens(ge[ee],Oe.tokens.cells[q][ee]);break}case"blockquote":{this.inline(Oe.tokens);break}case"list":{for(le=Oe.items.length,q=0;q<le;q++)this.inline(Oe.items[q].tokens);break}}}return V},Z.inlineTokens=function(V,Y,q,ee,le){Y===void 0&&(Y=[]),q===void 0&&(q=!1),ee===void 0&&(ee=!1),le===void 0&&(le="");var ge,Oe=V,Ke;if(this.tokens.links){var ze=Object.keys(this.tokens.links);if(ze.length>0)for(;(Ke=this.tokenizer.rules.inline.reflinkSearch.exec(Oe))!=null;)ze.includes(Ke[0].slice(Ke[0].lastIndexOf("[")+1,-1))&&(Oe=Oe.slice(0,Ke.index)+"["+"a".repeat(Ke[0].length-2)+"]"+Oe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ke=this.tokenizer.rules.inline.blockSkip.exec(Oe))!=null;)Oe=Oe.slice(0,Ke.index)+"["+"a".repeat(Ke[0].length-2)+"]"+Oe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;V;){if(ge=this.tokenizer.escape(V)){V=V.substring(ge.raw.length),Y.push(ge);continue}if(ge=this.tokenizer.tag(V,q,ee)){V=V.substring(ge.raw.length),q=ge.inLink,ee=ge.inRawBlock,Y.push(ge);continue}if(ge=this.tokenizer.link(V)){V=V.substring(ge.raw.length),ge.type==="link"&&(ge.tokens=this.inlineTokens(ge.text,[],!0,ee)),Y.push(ge);continue}if(ge=this.tokenizer.reflink(V,this.tokens.links)){V=V.substring(ge.raw.length),ge.type==="link"&&(ge.tokens=this.inlineTokens(ge.text,[],!0,ee)),Y.push(ge);continue}if(ge=this.tokenizer.strong(V,Oe,le)){V=V.substring(ge.raw.length),ge.tokens=this.inlineTokens(ge.text,[],q,ee),Y.push(ge);continue}if(ge=this.tokenizer.em(V,Oe,le)){V=V.substring(ge.raw.length),ge.tokens=this.inlineTokens(ge.text,[],q,ee),Y.push(ge);continue}if(ge=this.tokenizer.codespan(V)){V=V.substring(ge.raw.length),Y.push(ge);continue}if(ge=this.tokenizer.br(V)){V=V.substring(ge.raw.length),Y.push(ge);continue}if(ge=this.tokenizer.del(V)){V=V.substring(ge.raw.length),ge.tokens=this.inlineTokens(ge.text,[],q,ee),Y.push(ge);continue}if(ge=this.tokenizer.autolink(V,Te)){V=V.substring(ge.raw.length),Y.push(ge);continue}if(!q&&(ge=this.tokenizer.url(V,Te))){V=V.substring(ge.raw.length),Y.push(ge);continue}if(ge=this.tokenizer.inlineText(V,ee,Ee)){V=V.substring(ge.raw.length),le=ge.raw.slice(-1),Y.push(ge);continue}if(V){var ke="Infinite loop on byte: "+V.charCodeAt(0);if(this.options.silent){console.error(ke);break}else throw new Error(ke)}}return Y},H(re,null,[{key:"rules",get:function(){return{block:Be,inline:je}}}]),re}(),Ie=K.defaults,$=L.cleanUrl,se=L.escape,ue=function(){function re(J){this.options=J||Ie}var Z=re.prototype;return Z.code=function(V,Y,q){var ee=(Y||"").match(/\S*/)[0];if(this.options.highlight){var le=this.options.highlight(V,ee);le!=null&&le!==V&&(q=!0,V=le)}return ee?'<pre><code class="'+this.options.langPrefix+se(ee,!0)+'">'+(q?V:se(V,!0))+`</code></pre>
`:"<pre><code>"+(q?V:se(V,!0))+`</code></pre>
`},Z.blockquote=function(V){return`<blockquote>
`+V+`</blockquote>
`},Z.html=function(V){return V},Z.heading=function(V,Y,q,ee){return this.options.headerIds?"<h"+Y+' id="'+this.options.headerPrefix+ee.slug(q)+'">'+V+"</h"+Y+`>
`:"<h"+Y+">"+V+"</h"+Y+`>
`},Z.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},Z.list=function(V,Y,q){var ee=Y?"ol":"ul",le=Y&&q!==1?' start="'+q+'"':"";return"<"+ee+le+`>
`+V+"</"+ee+`>
`},Z.listitem=function(V){return"<li>"+V+`</li>
`},Z.checkbox=function(V){return"<input "+(V?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Z.paragraph=function(V){return"<p>"+V+`</p>
`},Z.table=function(V,Y){return Y&&(Y="<tbody>"+Y+"</tbody>"),`<table>
<thead>
`+V+`</thead>
`+Y+`</table>
`},Z.tablerow=function(V){return`<tr>
`+V+`</tr>
`},Z.tablecell=function(V,Y){var q=Y.header?"th":"td",ee=Y.align?"<"+q+' align="'+Y.align+'">':"<"+q+">";return ee+V+"</"+q+`>
`},Z.strong=function(V){return"<strong>"+V+"</strong>"},Z.em=function(V){return"<em>"+V+"</em>"},Z.codespan=function(V){return"<code>"+V+"</code>"},Z.br=function(){return this.options.xhtml?"<br/>":"<br>"},Z.del=function(V){return"<del>"+V+"</del>"},Z.link=function(V,Y,q){if(V=$(this.options.sanitize,this.options.baseUrl,V),V===null)return q;var ee='<a href="'+se(V)+'"';return Y&&(ee+=' title="'+Y+'"'),ee+=">"+q+"</a>",ee},Z.image=function(V,Y,q){if(V=$(this.options.sanitize,this.options.baseUrl,V),V===null)return q;var ee='<img src="'+V+'" alt="'+q+'"';return Y&&(ee+=' title="'+Y+'"'),ee+=this.options.xhtml?"/>":">",ee},Z.text=function(V){return V},re}(),ce=function(){function re(){}var Z=re.prototype;return Z.strong=function(V){return V},Z.em=function(V){return V},Z.codespan=function(V){return V},Z.del=function(V){return V},Z.html=function(V){return V},Z.text=function(V){return V},Z.link=function(V,Y,q){return""+q},Z.image=function(V,Y,q){return""+q},Z.br=function(){return""},re}(),_e=function(){function re(){this.seen={}}var Z=re.prototype;return Z.slug=function(V){var Y=V.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Y)){var q=Y;do this.seen[q]++,Y=q+"-"+this.seen[q];while(this.seen.hasOwnProperty(Y))}return this.seen[Y]=0,Y},re}(),De=K.defaults,Pe=L.unescape,Me=function(){function re(J){this.options=J||De,this.options.renderer=this.options.renderer||new ue,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ce,this.slugger=new _e}re.parse=function(V,Y){var q=new re(Y);return q.parse(V)};var Z=re.prototype;return Z.parse=function(V,Y){Y===void 0&&(Y=!0);var q="",ee,le,ge,Oe,Ke,ze,ke,Je,Qe,Ge,at,nt,rt,dt,et,st,ut,Ue,pt=V.length;for(ee=0;ee<pt;ee++){Ge=V[ee];switch(Ge.type){case"space":continue;case"hr":{q+=this.renderer.hr();continue}case"heading":{q+=this.renderer.heading(this.parseInline(Ge.tokens),Ge.depth,Pe(this.parseInline(Ge.tokens,this.textRenderer)),this.slugger);continue}case"code":{q+=this.renderer.code(Ge.text,Ge.lang,Ge.escaped);continue}case"table":{for(Je="",ke="",Oe=Ge.header.length,le=0;le<Oe;le++)ke+=this.renderer.tablecell(this.parseInline(Ge.tokens.header[le]),{header:!0,align:Ge.align[le]});for(Je+=this.renderer.tablerow(ke),Qe="",Oe=Ge.cells.length,le=0;le<Oe;le++){for(ze=Ge.tokens.cells[le],ke="",Ke=ze.length,ge=0;ge<Ke;ge++)ke+=this.renderer.tablecell(this.parseInline(ze[ge]),{header:!1,align:Ge.align[ge]});Qe+=this.renderer.tablerow(ke)}q+=this.renderer.table(Je,Qe);continue}case"blockquote":{Qe=this.parse(Ge.tokens),q+=this.renderer.blockquote(Qe);continue}case"list":{for(at=Ge.ordered,nt=Ge.start,rt=Ge.loose,Oe=Ge.items.length,Qe="",le=0;le<Oe;le++)et=Ge.items[le],st=et.checked,ut=et.task,dt="",et.task&&(Ue=this.renderer.checkbox(st),rt?et.tokens.length>0&&et.tokens[0].type==="text"?(et.tokens[0].text=Ue+" "+et.tokens[0].text,et.tokens[0].tokens&&et.tokens[0].tokens.length>0&&et.tokens[0].tokens[0].type==="text"&&(et.tokens[0].tokens[0].text=Ue+" "+et.tokens[0].tokens[0].text)):et.tokens.unshift({type:"text",text:Ue}):dt+=Ue),dt+=this.parse(et.tokens,rt),Qe+=this.renderer.listitem(dt,ut,st);q+=this.renderer.list(Qe,at,nt);continue}case"html":{q+=this.renderer.html(Ge.text);continue}case"paragraph":{q+=this.renderer.paragraph(this.parseInline(Ge.tokens));continue}case"text":{for(Qe=Ge.tokens?this.parseInline(Ge.tokens):Ge.text;ee+1<pt&&V[ee+1].type==="text";)Ge=V[++ee],Qe+=`
`+(Ge.tokens?this.parseInline(Ge.tokens):Ge.text);q+=Y?this.renderer.paragraph(Qe):Qe;continue}default:{var Xe='Token with "'+Ge.type+'" type was not found.';if(this.options.silent){console.error(Xe);return}else throw new Error(Xe)}}}return q},Z.parseInline=function(V,Y){Y=Y||this.renderer;var q="",ee,le,ge=V.length;for(ee=0;ee<ge;ee++){le=V[ee];switch(le.type){case"escape":{q+=Y.text(le.text);break}case"html":{q+=Y.html(le.text);break}case"link":{q+=Y.link(le.href,le.title,this.parseInline(le.tokens,Y));break}case"image":{q+=Y.image(le.href,le.title,le.text);break}case"strong":{q+=Y.strong(this.parseInline(le.tokens,Y));break}case"em":{q+=Y.em(this.parseInline(le.tokens,Y));break}case"codespan":{q+=Y.codespan(le.text);break}case"br":{q+=Y.br();break}case"del":{q+=Y.del(this.parseInline(le.tokens,Y));break}case"text":{q+=Y.text(le.text);break}default:{var Oe='Token with "'+le.type+'" type was not found.';if(this.options.silent){console.error(Oe);return}else throw new Error(Oe)}}}return q},re}(),Fe=L.merge,He=L.checkSanitizeDeprecation,oe=L.escape,me=K.getDefaults,be=K.changeDefaults,we=K.defaults;function pe(re,Z,J){if(typeof re=="undefined"||re===null)throw new Error("marked(): input parameter is undefined or null");if(typeof re!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(re)+", string expected");if(typeof Z=="function"&&(J=Z,Z=null),Z=Fe({},pe.defaults,Z||{}),He(Z),J){var V=Z.highlight,Y;try{Y=Re.lex(re,Z)}catch(ge){return J(ge)}var q=function(Oe){var Ke;if(!Oe)try{Ke=Me.parse(Y,Z)}catch(ze){Oe=ze}return Z.highlight=V,Oe?J(Oe):J(null,Ke)};if(!V||V.length<3)return q();if(delete Z.highlight,!Y.length)return q();var ee=0;pe.walkTokens(Y,function(ge){ge.type==="code"&&(ee++,setTimeout(function(){V(ge.text,ge.lang,function(Oe,Ke){if(Oe)return q(Oe);Ke!=null&&Ke!==ge.text&&(ge.text=Ke,ge.escaped=!0),ee--,ee===0&&q()})},0))}),ee===0&&q();return}try{var le=Re.lex(re,Z);return Z.walkTokens&&pe.walkTokens(le,Z.walkTokens),Me.parse(le,Z)}catch(ge){if(ge.message+=`
Please report this to https://github.com/markedjs/marked.`,Z.silent)return"<p>An error occurred:</p><pre>"+oe(ge.message+"",!0)+"</pre>";throw ge}}pe.options=pe.setOptions=function(re){return Fe(pe.defaults,re),be(pe.defaults),pe},pe.getDefaults=me,pe.defaults=we,pe.use=function(re){var Z=Fe({},re);if(re.renderer&&function(){var V=pe.defaults.renderer||new ue,Y=function(le){var ge=V[le];V[le]=function(){for(var Oe=arguments.length,Ke=new Array(Oe),ze=0;ze<Oe;ze++)Ke[ze]=arguments[ze];var ke=re.renderer[le].apply(V,Ke);return ke===!1&&(ke=ge.apply(V,Ke)),ke}};for(var q in re.renderer)Y(q);Z.renderer=V}(),re.tokenizer&&function(){var V=pe.defaults.tokenizer||new ve,Y=function(le){var ge=V[le];V[le]=function(){for(var Oe=arguments.length,Ke=new Array(Oe),ze=0;ze<Oe;ze++)Ke[ze]=arguments[ze];var ke=re.tokenizer[le].apply(V,Ke);return ke===!1&&(ke=ge.apply(V,Ke)),ke}};for(var q in re.tokenizer)Y(q);Z.tokenizer=V}(),re.walkTokens){var J=pe.defaults.walkTokens;Z.walkTokens=function(V){re.walkTokens(V),J&&J(V)}}pe.setOptions(Z)},pe.walkTokens=function(re,Z){for(var J=P(re),V;!(V=J()).done;){var Y=V.value;Z(Y);switch(Y.type){case"table":{for(var q=P(Y.tokens.header),ee;!(ee=q()).done;){var le=ee.value;pe.walkTokens(le,Z)}for(var ge=P(Y.tokens.cells),Oe;!(Oe=ge()).done;)for(var Ke=Oe.value,ze=P(Ke),ke;!(ke=ze()).done;){var Je=ke.value;pe.walkTokens(Je,Z)}break}case"list":{pe.walkTokens(Y.items,Z);break}default:Y.tokens&&pe.walkTokens(Y.tokens,Z)}}},pe.Parser=Me,pe.parser=Me.parse,pe.Renderer=ue,pe.TextRenderer=ce,pe.Lexer=Re,pe.lexer=Re.lex,pe.Tokenizer=ve,pe.Slugger=_e,pe.parse=pe;var ye=pe;return ye})},F0VM:function(Ne,ne,U){Ne.exports={flex_box_center:"flex_box_center___2fDN3",flex_space_between:"flex_space_between___BHBBv",flex_box_vertical_center:"flex_box_vertical_center___tpxsE",flex_box_center_end:"flex_box_center_end___rP7bQ",flex_box_column:"flex_box_column___1_rF-",md:"md___3SObb",title:"title___HfZ1b"}},FWmy:function(Ne,ne,U){"use strict";U.d(ne,"a",function(){return Q});function Q(H,I){if(!H)throw new Error(I?`Assertion failed (${I})`:"Assertion Failed")}},IBYe:function(Ne,ne,U){"use strict";function Q(H){return null}ne.a=Q},J66h:function(Ne,ne,U){(function(Q){var H,I;(function(W,P){Ne.exports=P(W)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof Q!="undefined"?Q:this,function(W){"use strict";W=W||{};var P=W.Base64,R="2.6.4",K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N=function(d){for(var A={},D=0,S=d.length;D<S;D++)A[d.charAt(D)]=D;return A}(K),e=String.fromCharCode,C=function(d){if(d.length<2){var A=d.charCodeAt(0);return A<128?d:A<2048?e(192|A>>>6)+e(128|A&63):e(224|A>>>12&15)+e(128|A>>>6&63)+e(128|A&63)}else{var A=65536+(d.charCodeAt(0)-55296)*1024+(d.charCodeAt(1)-56320);return e(240|A>>>18&7)+e(128|A>>>12&63)+e(128|A>>>6&63)+e(128|A&63)}},g=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,v=function(d){return d.replace(g,C)},c=function(d){var A=[0,2,1][d.length%3],D=d.charCodeAt(0)<<16|(d.length>1?d.charCodeAt(1):0)<<8|(d.length>2?d.charCodeAt(2):0),S=[K.charAt(D>>>18),K.charAt(D>>>12&63),A>=2?"=":K.charAt(D>>>6&63),A>=1?"=":K.charAt(D&63)];return S.join("")},s=W.btoa&&typeof W.btoa=="function"?function(d){return W.btoa(d)}:function(d){if(d.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return d.replace(/[\s\S]{1,3}/g,c)},i=function(d){return s(v(String(d)))},l=function(d){return d.replace(/[+\/]/g,function(A){return A=="+"?"-":"_"}).replace(/=/g,"")},a=function(d,A){return A?l(i(d)):i(d)},n=function(d){return a(d,!0)},r;W.Uint8Array&&(r=function(d,A){for(var D="",S=0,L=d.length;S<L;S+=3){var M=d[S],O=d[S+1],j=d[S+2],G=M<<16|O<<8|j;D+=K.charAt(G>>>18)+K.charAt(G>>>12&63)+(typeof O!="undefined"?K.charAt(G>>>6&63):"=")+(typeof j!="undefined"?K.charAt(G&63):"=")}return A?l(D):D});var t=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,E=function(d){switch(d.length){case 4:var A=(7&d.charCodeAt(0))<<18|(63&d.charCodeAt(1))<<12|(63&d.charCodeAt(2))<<6|63&d.charCodeAt(3),D=A-65536;return e((D>>>10)+55296)+e((D&1023)+56320);case 3:return e((15&d.charCodeAt(0))<<12|(63&d.charCodeAt(1))<<6|63&d.charCodeAt(2));default:return e((31&d.charCodeAt(0))<<6|63&d.charCodeAt(1))}},y=function(d){return d.replace(t,E)},m=function(d){var A=d.length,D=A%4,S=(A>0?N[d.charAt(0)]<<18:0)|(A>1?N[d.charAt(1)]<<12:0)|(A>2?N[d.charAt(2)]<<6:0)|(A>3?N[d.charAt(3)]:0),L=[e(S>>>16),e(S>>>8&255),e(S&255)];return L.length-=[0,0,2,1][D],L.join("")},T=W.atob&&typeof W.atob=="function"?function(d){return W.atob(d)}:function(d){return d.replace(/\S{1,4}/g,m)},_=function(d){return T(String(d).replace(/[^A-Za-z0-9\+\/]/g,""))},f=function(d){return y(T(d))},h=function(d){return String(d).replace(/[-_]/g,function(A){return A=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},o=function(d){return f(h(d))},u;W.Uint8Array&&(u=function(d){return Uint8Array.from(_(h(d)),function(A){return A.charCodeAt(0)})});var b=function(){var d=W.Base64;return W.Base64=P,d};if(W.Base64={VERSION:R,atob:_,btoa:s,fromBase64:o,toBase64:a,utob:v,encode:a,encodeURI:n,btou:y,decode:o,noConflict:b,fromUint8Array:r,toUint8Array:u},typeof Object.defineProperty=="function"){var p=function(d){return{value:d,enumerable:!1,writable:!0,configurable:!0}};W.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",p(function(){return o(this)})),Object.defineProperty(String.prototype,"toBase64",p(function(d){return a(this,d)})),Object.defineProperty(String.prototype,"toBase64URI",p(function(){return a(this,!0)}))}}return W.Meteor&&(Base64=W.Base64),Ne.exports?Ne.exports.Base64=W.Base64:!(H=[],I=function(){return W.Base64}.apply(ne,H),I!==void 0&&(Ne.exports=I)),{Base64:W.Base64}})}).call(this,U("IyRk"))},JYp7:function(Ne,ne,U){"use strict";U.d(ne,"a",function(){return Q});var Q;(function(H){function I(t){return t&&typeof t=="object"&&typeof t[Symbol.iterator]=="function"}H.is=I;const W=Object.freeze([]);function P(){return W}H.empty=P;function*R(t){yield t}H.single=R;function K(t){return t||W}H.from=K;function N(t){return!t||t[Symbol.iterator]().next().done===!0}H.isEmpty=N;function e(t){return t[Symbol.iterator]().next().value}H.first=e;function C(t,E){for(const y of t)if(E(y))return!0;return!1}H.some=C;function g(t,E){for(const y of t)if(E(y))return y;return}H.find=g;function*v(t,E){for(const y of t)E(y)&&(yield y)}H.filter=v;function*c(t,E){let y=0;for(const m of t)yield E(m,y++)}H.map=c;function*s(...t){for(const E of t)for(const y of E)yield y}H.concat=s;function*i(t){for(const E of t)for(const y of E)yield y}H.concatNested=i;function l(t,E,y){let m=y;for(const T of t)m=E(m,T);return m}H.reduce=l;function*a(t,E,y=t.length){for(E<0&&(E+=t.length),y<0?y+=t.length:y>t.length&&(y=t.length);E<y;E++)yield t[E]}H.slice=a;function n(t,E=Number.POSITIVE_INFINITY){const y=[];if(E===0)return[y,t];const m=t[Symbol.iterator]();for(let T=0;T<E;T++){const _=m.next();if(_.done)return[y,H.empty()];y.push(_.value)}return[y,{[Symbol.iterator](){return m}}]}H.consume=n;function r(t,E,y=(m,T)=>m===T){const m=t[Symbol.iterator](),T=E[Symbol.iterator]();for(;;){const _=m.next(),f=T.next();if(_.done!==f.done)return!1;if(_.done)return!0;if(!y(_.value,f.value))return!1}}H.equals=r})(Q||(Q={}))},LdHM:function(Ne,ne,U){"use strict";U.d(ne,"b",function(){return t}),U.d(ne,"a",function(){return y});var Q=U("1OyB"),H=U("vuIU"),I=U("Ji7U"),W=U("LK+K"),P=U("q1tI"),R=U("rePB"),K=U("Ff2n"),N=U("ODXe"),e=U("4IlW"),C=U("bX4T"),g=U("YrtM"),v=U("TSYQ"),c=U.n(v),s=U("+nKL"),i=U("8OUc"),l=function(j,G){var X=j.prefixCls,te=j.id,fe=j.flattenOptions,ve=j.childrenAsData,he=j.values,xe=j.searchValue,Se=j.multiple,de=j.defaultActiveFirstOption,ie=j.height,Le=j.itemHeight,Ve=j.notFoundContent,Be=j.open,je=j.menuItemSelectedIcon,Ee=j.virtual,Te=j.onSelect,Re=j.onToggleOpen,Ie=j.onActiveValue,$=j.onScroll,se=j.onMouseEnter,ue="".concat(X,"-item"),ce=Object(g.a)(function(){return fe},[Be,fe],function(ye,re){return re[0]&&ye[1]!==re[1]}),_e=P.useRef(null),De=function(re){re.preventDefault()},Pe=function(re){_e.current&&_e.current.scrollTo({index:re})},Me=function(re){for(var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,J=ce.length,V=0;V<J;V+=1){var Y=(re+V*Z+J)%J,q=ce[Y],ee=q.group,le=q.data;if(!ee&&!le.disabled)return Y}return-1},Fe=P.useState(function(){return Me(0)}),He=Object(N.a)(Fe,2),oe=He[0],me=He[1],be=function(re){me(re);var Z=ce[re];if(!Z){Ie(null,-1);return}Ie(Z.data.value,re)};P.useEffect(function(){be(de!==!1?Me(0):-1)},[ce.length,xe]),P.useEffect(function(){var ye=setTimeout(function(){if(!Se&&Be&&he.size===1){var re=Array.from(he)[0],Z=ce.findIndex(function(J){var V=J.data;return V.value===re});be(Z),Pe(Z)}});return function(){return clearTimeout(ye)}},[Be]);var we=function(re){re!==void 0&&Te(re,{selected:!he.has(re)}),Se||Re(!1)};if(P.useImperativeHandle(G,function(){return{onKeyDown:function(re){var Z=re.which;switch(Z){case e.a.UP:case e.a.DOWN:{var J=0;if(Z===e.a.UP?J=-1:Z===e.a.DOWN&&(J=1),J!==0){var V=Me(oe+J,J);Pe(V),be(V)}break}case e.a.ENTER:{var Y=ce[oe];Y&&!Y.data.disabled?we(Y.data.value):we(void 0),Be&&re.preventDefault();break}case e.a.ESC:Re(!1)}},onKeyUp:function(){},scrollTo:function(re){Pe(re)}}}),ce.length===0)return P.createElement("div",{role:"listbox",id:"".concat(te,"_list"),className:"".concat(ue,"-empty"),onMouseDown:De},Ve);function pe(ye){var re=ce[ye];if(!re)return null;var Z=re.data||{},J=Z.value,V=Z.label,Y=Z.children,q=Object(C.a)(Z,!0),ee=ve?Y:V;return re?P.createElement("div",Object.assign({"aria-label":typeof ee=="string"?ee:null},q,{key:ye,role:"option",id:"".concat(te,"_list_").concat(ye),"aria-selected":he.has(J)}),J):null}return P.createElement(P.Fragment,null,P.createElement("div",{role:"listbox",id:"".concat(te,"_list"),style:{height:0,width:0,overflow:"hidden"}},pe(oe-1),pe(oe),pe(oe+1)),P.createElement(s.a,{itemKey:"key",ref:_e,data:ce,height:ie,itemHeight:Le,fullHeight:!1,onMouseDown:De,onScroll:$,virtual:Ee,onMouseEnter:se},function(ye,re){var Z,J=ye.group,V=ye.groupOption,Y=ye.data,q=Y.label,ee=Y.key;if(J)return P.createElement("div",{className:c()(ue,"".concat(ue,"-group"))},q!==void 0?q:ee);var le=Y.disabled,ge=Y.value,Oe=Y.title,Ke=Y.children,ze=Y.style,ke=Y.className,Je=Object(K.a)(Y,["disabled","value","title","children","style","className"]),Qe=he.has(ge),Ge="".concat(ue,"-option"),at=c()(ue,Ge,ke,(Z={},Object(R.a)(Z,"".concat(Ge,"-grouped"),V),Object(R.a)(Z,"".concat(Ge,"-active"),oe===re&&!le),Object(R.a)(Z,"".concat(Ge,"-disabled"),le),Object(R.a)(Z,"".concat(Ge,"-selected"),Qe),Z)),nt=ve?Ke:q,rt=!je||typeof je=="function"||Qe;return P.createElement("div",Object.assign({},Je,{"aria-selected":Qe,className:at,title:Oe,onMouseMove:function(){if(oe===re||le)return;be(re)},onClick:function(){le||we(ge)},style:ze}),P.createElement("div",{className:"".concat(Ge,"-content")},nt||ge),P.isValidElement(je)||Qe,rt&&P.createElement(i.a,{className:"".concat(ue,"-option-state"),customizeIcon:je,customizeIconProps:{isSelected:Qe}},Qe?"\u2713":null))}))},a=P.forwardRef(l);a.displayName="OptionList";var n=a,r=function(){return null};r.isSelectOption=!0;var t=r,E=function(){return null};E.isSelectOptGroup=!0;var y=E,m=U("VTBJ"),T=U("Zm9Q");function _(O){var j=O.key,G=O.props,X=G.children,te=G.value,fe=Object(K.a)(G,["children","value"]);return Object(m.a)({key:j,value:te!==void 0?te:j,children:X},fe)}function f(O){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(T.a)(O).map(function(G,X){if(!P.isValidElement(G)||!G.type)return null;var te=G.type.isSelectOptGroup,fe=G.key,ve=G.props,he=ve.children,xe=Object(K.a)(ve,["children"]);return j||!te?_(G):Object(m.a)(Object(m.a)({key:"__RC_SELECT_GRP__".concat(fe===null?X:fe,"__"),label:fe},xe),{},{options:f(he)})}).filter(function(G){return G})}var h=U("2Qr1"),o=U("qNPg"),u=U("U8pU"),b=U("Kwbf"),p=U("WKfj");function d(O){var j=O.mode,G=O.options,X=O.children,te=O.backfill,fe=O.allowClear,ve=O.placeholder,he=O.getInputElement,xe=O.showSearch,Se=O.onSearch,de=O.defaultOpen,ie=O.autoFocus,Le=O.labelInValue,Ve=O.value,Be=O.inputValue,je=O.optionLabelProp,Ee=j==="multiple"||j==="tags",Te=xe!==void 0?xe:Ee||j==="combobox",Re=G||f(X);if(Object(b.a)(j!=="tags"||Re.every(function(ue){return!ue.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),j==="tags"||j==="combobox"){var Ie=Re.some(function(ue){return ue.options?ue.options.some(function(ce){return typeof("value"in ce?ce.value:ce.key)=="number"}):typeof("value"in ue?ue.value:ue.key)=="number"});Object(b.a)(!Ie,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(b.a)(j!=="combobox"||!je,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(b.a)(j==="combobox"||!te,"`backfill` only works with `combobox` mode."),Object(b.a)(j==="combobox"||!he,"`getInputElement` only work with `combobox` mode."),Object(b.b)(j!=="combobox"||!he||!fe||!ve,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Se&&!Te&&j!=="combobox"&&j!=="tags"&&Object(b.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(b.b)(!de||ie,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ve!=null){var $=Object(p.d)(Ve);Object(b.a)(!Le||$.every(function(ue){return Object(u.a)(ue)==="object"&&("key"in ue||"value"in ue)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(b.a)(!Ee||Array.isArray(Ve),"`value` should be array when `mode` is `multiple` or `tags`")}if(X){var se=null;Object(T.a)(X).some(function(ue){if(!P.isValidElement(ue)||!ue.type)return!1;var ce=ue.type;if(ce.isSelectOption)return!1;if(ce.isSelectOptGroup){var _e=Object(T.a)(ue.props.children).every(function(De){return!P.isValidElement(De)||!ue.type||De.type.isSelectOption?!0:(se=De.type,!1)});return!_e}return se=ce,!0}),se&&Object(b.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(se.displayName||se.name||se,"`.")),Object(b.a)(Be===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var A=d,D=Object(o.a)({prefixCls:"rc-select",components:{optionList:n},convertChildrenToData:f,flattenOptions:h.d,getLabeledValue:h.e,filterOptions:h.b,isValueDisabled:h.g,findValueOption:h.c,warningProps:A,fillOptionsWithMissingValue:h.a}),S=function(O){Object(I.a)(G,O);var j=Object(W.a)(G);function G(){var X;return Object(Q.a)(this,G),X=j.apply(this,arguments),X.selectRef=P.createRef(),X.focus=function(){X.selectRef.current.focus()},X.blur=function(){X.selectRef.current.blur()},X}return Object(H.a)(G,[{key:"render",value:function(){return P.createElement(D,Object.assign({ref:this.selectRef},this.props))}}]),G}(P.Component);S.Option=t,S.OptGroup=y;var L=S,M=ne.c=L},MI8n:function(Ne,ne,U){"use strict";U.d(ne,"c",function(){return P}),U.d(ne,"b",function(){return e}),U.d(ne,"e",function(){return C}),U.d(ne,"a",function(){return g}),U.d(ne,"d",function(){return v}),U.d(ne,"f",function(){return c});var Q=U("/cxE"),H=U("pmY6"),I=U("24hK"),W=U("5Y4S"),P;(function(s){s.None=()=>H.a.None;function i(d){return(A,D=null,S)=>{let L=!1,M;return M=d(O=>L?void 0:(M?M.dispose():L=!0,A.call(D,O)),null,S),L&&M.dispose(),M}}s.once=i;function l(d,A){return y((D,S=null,L)=>d(M=>D.call(S,A(M)),null,L))}s.map=l;function a(d,A){return y((D,S=null,L)=>d(M=>{A(M),D.call(S,M)},null,L))}s.forEach=a;function n(d,A){return y((D,S=null,L)=>d(M=>A(M)&&D.call(S,M),null,L))}s.filter=n;function r(d){return d}s.signal=r;function t(...d){return(A,D=null,S)=>Object(H.e)(...d.map(L=>L(M=>A.call(D,M),null,S)))}s.any=t;function E(d,A,D){let S=D;return l(d,L=>(S=A(S,L),S))}s.reduce=E;function y(d){let A;const D=new e({onFirstListenerAdd(){A=d(D.fire,D)},onLastListenerRemove(){A.dispose()}});return D.event}function m(d,A,D=100,S=!1,L){let M,O,j,G=0;const X=new e({leakWarningThreshold:L,onFirstListenerAdd(){M=d(te=>{G++,O=A(O,te),S&&!j&&(X.fire(O),O=void 0),clearTimeout(j),j=setTimeout(()=>{const fe=O;O=void 0,j=void 0,(!S||G>1)&&X.fire(fe),G=0},D)})},onLastListenerRemove(){M.dispose()}});return X.event}s.debounce=m;function T(d,A=(D,S)=>D===S){let D=!0,S;return n(d,L=>{const M=D||!A(L,S);return D=!1,S=L,M})}s.latch=T;function _(d,A){return[s.filter(d,A),s.filter(d,D=>!A(D))]}s.split=_;function f(d,A=!1,D=[]){let S=D.slice(),L=d(j=>{S?S.push(j):O.fire(j)});const M=()=>{S&&S.forEach(j=>O.fire(j)),S=null},O=new e({onFirstListenerAdd(){L||(L=d(j=>O.fire(j)))},onFirstListenerDidAdd(){S&&(A?setTimeout(M):M())},onLastListenerRemove(){L&&L.dispose(),L=null}});return O.event}s.buffer=f;class h{constructor(d){this.event=d}map(d){return new h(l(this.event,d))}forEach(d){return new h(a(this.event,d))}filter(d){return new h(n(this.event,d))}reduce(d,A){return new h(E(this.event,d,A))}latch(){return new h(T(this.event))}debounce(d,A=100,D=!1,S){return new h(m(this.event,d,A,D,S))}on(d,A,D){return this.event(d,A,D)}once(d,A,D){return i(this.event)(d,A,D)}}function o(d){return new h(d)}s.chain=o;function u(d,A,D=S=>S){const S=(...j)=>O.fire(D(...j)),L=()=>d.on(A,S),M=()=>d.removeListener(A,S),O=new e({onFirstListenerAdd:L,onLastListenerRemove:M});return O.event}s.fromNodeEventEmitter=u;function b(d,A,D=S=>S){const S=(...j)=>O.fire(D(...j)),L=()=>d.addEventListener(A,S),M=()=>d.removeEventListener(A,S),O=new e({onFirstListenerAdd:L,onLastListenerRemove:M});return O.event}s.fromDOMEventEmitter=b;function p(d){return new Promise(A=>i(d)(A))}s.toPromise=p})(P||(P={}));class R{constructor(s){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${s}_${R._idPool++}`}start(s){this._stopWatch=new W.a(!0),this._listenerCount=s}stop(){if(this._stopWatch){const s=this._stopWatch.elapsed();this._elapsedOverall+=s,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${s.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}R._idPool=0;let K=-1;class N{constructor(s,i=Math.random().toString(18).slice(2,5)){this.customThreshold=s,this.name=i,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(s){let i=K;if(typeof this.customThreshold=="number"&&(i=this.customThreshold),i<=0||s<i)return;this._stacks||(this._stacks=new Map);const l=new Error().stack.split(`
`).slice(3).join(`
`),a=this._stacks.get(l)||0;if(this._stacks.set(l,a+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=i*.5;let n,r=0;for(const[t,E]of this._stacks)(!n||r<E)&&(n=t,r=E);console.warn(`[${this.name}] potential listener LEAK detected, having ${s} listeners already. MOST frequent listener (${r}):`),console.warn(n)}return()=>{const n=this._stacks.get(l)||0;this._stacks.set(l,n-1)}}}class e{constructor(s){var i;this._disposed=!1,this._options=s,this._leakageMon=K>0?new N(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((i=this._options)===null||i===void 0?void 0:i._profName)?new R(this._options._profName):void 0}get event(){return this._event||(this._event=(s,i,l)=>{var a;this._listeners||(this._listeners=new I.a);const n=this._listeners.isEmpty();n&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const r=this._listeners.push(i?[s,i]:s);n&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,s,i);const t=(a=this._leakageMon)===null||a===void 0?void 0:a.check(this._listeners.size),E=Object(H.i)(()=>{if(t&&t(),!this._disposed&&(r(),this._options&&this._options.onLastListenerRemove)){const y=this._listeners&&!this._listeners.isEmpty();y||this._options.onLastListenerRemove(this)}});return l instanceof H.b?l.add(E):Array.isArray(l)&&l.push(E),E}),this._event}fire(s){var i,l;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new I.a);for(let a of this._listeners)this._deliveryQueue.push([a,s]);for((i=this._perfMon)===null||i===void 0||i.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[a,n]=this._deliveryQueue.shift();try{typeof a=="function"?a.call(void 0,n):a[0].call(a[1],n)}catch(r){Object(Q.f)(r)}}(l=this._perfMon)===null||l===void 0||l.stop()}}dispose(){var s,i,l,a,n;this._disposed||(this._disposed=!0,(s=this._listeners)===null||s===void 0||s.clear(),(i=this._deliveryQueue)===null||i===void 0||i.clear(),(a=(l=this._options)===null||l===void 0?void 0:l.onLastListenerRemove)===null||a===void 0||a.call(l),(n=this._leakageMon)===null||n===void 0||n.dispose())}}class C extends e{constructor(s){super(s);this._isPaused=0,this._eventQueue=new I.a,this._mergeFn=s==null?void 0:s.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const s=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(s))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(s){this._listeners&&(this._isPaused!==0?this._eventQueue.push(s):super.fire(s))}}class g extends C{constructor(s){var i;super(s);this._delay=(i=s.delay)!==null&&i!==void 0?i:100}fire(s){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(s)}}class v{constructor(){this.buffers=[]}wrapEvent(s){return(i,l,a)=>s(n=>{const r=this.buffers[this.buffers.length-1];r?r.push(()=>i.call(l,n)):i.call(l,n)},void 0,a)}bufferEvents(s){const i=[];this.buffers.push(i);const l=s();return this.buffers.pop(),i.forEach(a=>a()),l}}class c{constructor(){this.listening=!1,this.inputEvent=P.None,this.inputEventListener=H.a.None,this.emitter=new e({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(s){this.inputEvent=s,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=s(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(Ne,ne,U){"use strict";(function(Q,H){U.d(ne,"b",function(){return l}),U.d(ne,"i",function(){return t}),U.d(ne,"f",function(){return E}),U.d(ne,"d",function(){return y}),U.d(ne,"g",function(){return m}),U.d(ne,"h",function(){return T}),U.d(ne,"c",function(){return _}),U.d(ne,"k",function(){return f}),U.d(ne,"j",function(){return h}),U.d(ne,"a",function(){return o}),U.d(ne,"e",function(){return p});var I;const W="en";let P=!1,R=!1,K=!1,N=!1,e=!1,C=!1,g=!1,v,c=W,s,i;const l=typeof self=="object"?self:typeof Q=="object"?Q:{};let a;typeof l.vscode!="undefined"&&typeof l.vscode.process!="undefined"?a=l.vscode.process:typeof H!="undefined"&&(a=H);const n=typeof((I=a==null?void 0:a.versions)===null||I===void 0?void 0:I.electron)=="string"&&a.type==="renderer";if(typeof navigator=="object"&&!n)i=navigator.userAgent,P=i.indexOf("Windows")>=0,R=i.indexOf("Macintosh")>=0,g=(i.indexOf("Macintosh")>=0||i.indexOf("iPad")>=0||i.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,K=i.indexOf("Linux")>=0,C=!0,v=navigator.language,c=v;else if(typeof a=="object"){P=a.platform==="win32",R=a.platform==="darwin",K=a.platform==="linux",N=K&&!!a.env.SNAP&&!!a.env.SNAP_REVISION,v=W,c=W;const d=a.env.VSCODE_NLS_CONFIG;if(d)try{const A=JSON.parse(d),D=A.availableLanguages["*"];v=A.locale,c=D||W,s=A._translationsConfigFile}catch(A){}e=!0}else console.error("Unable to resolve platform.");let r=0;R?r=1:P?r=3:K&&(r=2);const t=P,E=R,y=K,m=e,T=C,_=g,f=i,h=function(){if(l.setImmediate)return l.setImmediate.bind(l);if(typeof l.postMessage=="function"&&!l.importScripts){let D=[];l.addEventListener("message",L=>{if(L.data&&L.data.vscodeSetImmediateId)for(let M=0,O=D.length;M<O;M++){const j=D[M];if(j.id===L.data.vscodeSetImmediateId){D.splice(M,1),j.callback();return}}});let S=0;return L=>{const M=++S;D.push({id:M,callback:L}),l.postMessage({vscodeSetImmediateId:M},"*")}}if(typeof(a==null?void 0:a.nextTick)=="function")return a.nextTick.bind(a);const A=Promise.resolve();return D=>A.then(D)}(),o=R||g?2:P?1:3;let u=!0,b=!1;function p(){if(!b){b=!0;const d=new Uint8Array(2);d[0]=1,d[1]=2;const A=new Uint16Array(d.buffer);u=A[0]===(2<<8)+1}return u}}).call(this,U("IyRk"),U("Q2Ig"))},N0LK:function(Ne,ne,U){"use strict";U.d(ne,"C",function(){return Q}),U.d(ne,"v",function(){return I}),U.d(ne,"s",function(){return W}),U.d(ne,"t",function(){return P}),U.d(ne,"U",function(){return R}),U.d(ne,"J",function(){return K}),U.d(ne,"O",function(){return N}),U.d(ne,"p",function(){return e}),U.d(ne,"T",function(){return C}),U.d(ne,"q",function(){return g}),U.d(ne,"N",function(){return v}),U.d(ne,"M",function(){return c}),U.d(ne,"Q",function(){return s}),U.d(ne,"u",function(){return i}),U.d(ne,"x",function(){return l}),U.d(ne,"I",function(){return a}),U.d(ne,"f",function(){return n}),U.d(ne,"h",function(){return r}),U.d(ne,"g",function(){return t}),U.d(ne,"i",function(){return E}),U.d(ne,"G",function(){return y}),U.d(ne,"H",function(){return m}),U.d(ne,"r",function(){return T}),U.d(ne,"R",function(){return _}),U.d(ne,"d",function(){return f}),U.d(ne,"e",function(){return h}),U.d(ne,"E",function(){return o}),U.d(ne,"F",function(){return u}),U.d(ne,"j",function(){return b}),U.d(ne,"z",function(){return p}),U.d(ne,"K",function(){return A}),U.d(ne,"L",function(){return D}),U.d(ne,"m",function(){return L}),U.d(ne,"k",function(){return O}),U.d(ne,"A",function(){return G}),U.d(ne,"a",function(){return X}),U.d(ne,"n",function(){return te}),U.d(ne,"l",function(){return fe}),U.d(ne,"D",function(){return ve}),U.d(ne,"B",function(){return he}),U.d(ne,"b",function(){return xe}),U.d(ne,"S",function(){return Se}),U.d(ne,"o",function(){return de}),U.d(ne,"P",function(){return ie}),U.d(ne,"w",function(){return Le}),U.d(ne,"c",function(){return Ve}),U.d(ne,"y",function(){return Ee});function Q($){return!$||typeof $!="string"?!0:$.trim().length===0}const H=/{(\d+)}/g;function I($,...se){return se.length===0?$:$.replace(H,function(ue,ce){const _e=parseInt(ce,10);return isNaN(_e)||_e<0||_e>=se.length?ue:se[_e]})}function W($){return $.replace(/[<>&]/g,function(se){switch(se){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return se}})}function P($){return $.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function R($,se=" "){const ue=K($,se);return N(ue,se)}function K($,se){if(!$||!se)return $;const ue=se.length;if(ue===0||$.length===0)return $;let ce=0;for(;$.indexOf(se,ce)===ce;)ce=ce+ue;return $.substring(ce)}function N($,se){if(!$||!se)return $;const ue=se.length,ce=$.length;if(ue===0||ce===0)return $;let _e=ce,De=-1;for(;!(De=$.lastIndexOf(se,_e-1),De===-1||De+ue!==_e);){if(De===0)return"";_e=De}return $.substring(0,_e)}function e($){return $.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function C($){return $.replace(/\*/g,"")}function g($,se,ue={}){if(!$)throw new Error("Cannot create regex from empty string");se||($=P($)),ue.wholeWord&&(/\B/.test($.charAt(0))||($="\\b"+$),/\B/.test($.charAt($.length-1))||($=$+"\\b"));let ce="";return ue.global&&(ce+="g"),ue.matchCase||(ce+="i"),ue.multiline&&(ce+="m"),ue.unicode&&(ce+="u"),new RegExp($,ce)}function v($){if($.source==="^"||$.source==="^$"||$.source==="$"||$.source==="^\\s*$")return!1;const se=$.exec("");return!!(se&&$.lastIndex===0)}function c($){return($.global?"g":"")+($.ignoreCase?"i":"")+($.multiline?"m":"")+($.unicode?"u":"")}function s($){return $.split(/\r\n|\r|\n/)}function i($){for(let se=0,ue=$.length;se<ue;se++){const ce=$.charCodeAt(se);if(ce!==32&&ce!==9)return se}return-1}function l($,se=0,ue=$.length){for(let ce=se;ce<ue;ce++){const _e=$.charCodeAt(ce);if(_e!==32&&_e!==9)return $.substring(se,ce)}return $.substring(se,ue)}function a($,se=$.length-1){for(let ue=se;ue>=0;ue--){const ce=$.charCodeAt(ue);if(ce!==32&&ce!==9)return ue}return-1}function n($,se){return $<se?-1:$>se?1:0}function r($,se,ue=0,ce=$.length,_e=0,De=se.length){for(;ue<ce&&_e<De;ue++,_e++){let Fe=$.charCodeAt(ue),He=se.charCodeAt(_e);if(Fe<He)return-1;if(Fe>He)return 1}const Pe=ce-ue,Me=De-_e;return Pe<Me?-1:Pe>Me?1:0}function t($,se){return E($,se,0,$.length,0,se.length)}function E($,se,ue=0,ce=$.length,_e=0,De=se.length){for(;ue<ce&&_e<De;ue++,_e++){let Fe=$.charCodeAt(ue),He=se.charCodeAt(_e);if(Fe===He)continue;if(Fe>=128||He>=128)return r($.toLowerCase(),se.toLowerCase(),ue,ce,_e,De);y(Fe)&&(Fe-=32),y(He)&&(He-=32);const oe=Fe-He;if(oe===0)continue;return oe}const Pe=ce-ue,Me=De-_e;return Pe<Me?-1:Pe>Me?1:0}function y($){return $>=97&&$<=122}function m($){return $>=65&&$<=90}function T($,se){return $.length===se.length&&E($,se)===0}function _($,se){const ue=se.length;return se.length>$.length?!1:E($,se,0,ue)===0}function f($,se){let ue,ce=Math.min($.length,se.length);for(ue=0;ue<ce;ue++)if($.charCodeAt(ue)!==se.charCodeAt(ue))return ue;return ce}function h($,se){let ue,ce=Math.min($.length,se.length);const _e=$.length-1,De=se.length-1;for(ue=0;ue<ce;ue++)if($.charCodeAt(_e-ue)!==se.charCodeAt(De-ue))return ue;return ce}function o($){return 55296<=$&&$<=56319}function u($){return 56320<=$&&$<=57343}function b($,se){return($-55296<<10)+(se-56320)+65536}function p($,se,ue){const ce=$.charCodeAt(ue);if(o(ce)&&ue+1<se){const _e=$.charCodeAt(ue+1);if(u(_e))return b(ce,_e)}return ce}function d($,se){const ue=$.charCodeAt(se-1);if(u(ue)&&se>1){const ce=$.charCodeAt(se-2);if(o(ce))return b(ce,ue)}return ue}function A($,se){const ue=Be.getInstance(),ce=se,_e=$.length,De=p($,_e,se);se+=De>=65536?2:1;let Pe=ue.getGraphemeBreakType(De);for(;se<_e;){const Me=p($,_e,se),Fe=ue.getGraphemeBreakType(Me);if(Ve(Pe,Fe))break;se+=Me>=65536?2:1,Pe=Fe}return se-ce}function D($,se){const ue=Be.getInstance(),ce=se,_e=d($,se);se-=_e>=65536?2:1;let De=ue.getGraphemeBreakType(_e);for(;se>0;){const Pe=d($,se),Me=ue.getGraphemeBreakType(Pe);if(Ve(Me,De))break;se-=Pe>=65536?2:1,De=Me}return ce-se}const S=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function L($){return S.test($)}const M=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function O($){return M.test($)}const j=/^[\t\n\r\x20-\x7E]*$/;function G($){return j.test($)}const X=/[\u2028\u2029]/;function te($){return X.test($)}function fe($){for(let se=0,ue=$.length;se<ue;se++)if(ve($.charCodeAt(se)))return!0;return!1}function ve($){return $=+$,$>=11904&&$<=55215||$>=63744&&$<=64255||$>=65281&&$<=65374}function he($){return $>=127462&&$<=127487||$===8986||$===8987||$===9200||$===9203||$>=9728&&$<=10175||$===11088||$===11093||$>=127744&&$<=128591||$>=128640&&$<=128764||$>=128992&&$<=129003||$>=129280&&$<=129535||$>=129648&&$<=129750}const xe=String.fromCharCode(65279);function Se($){return!!($&&$.length>0&&$.charCodeAt(0)===65279)}function de($,se=!1){return $?(se&&($=$.replace(/\\./g,"")),$.toLowerCase()!==$):!1}function ie($){const se=90-65+1;return $=$%(2*se),$<se?String.fromCharCode(97+$):String.fromCharCode(65+$-se)}function Le($){const se=Be.getInstance();return se.getGraphemeBreakType($)}function Ve($,se){return $===0?se!==5&&se!==7:$===2&&se===3?!1:$===4||$===2||$===3||(se===4||se===2||se===3)?!0:$===8&&(se===8||se===9||se===11||se===12)||(($===11||$===9)&&(se===9||se===10)||(($===12||$===10)&&se===10||(se===5||se===13||(se===7||($===1||$===13&&se===14)))))?!1:!($===6&&se===6)}class Be{constructor(){this._data=je()}static getInstance(){return Be._INSTANCE||(Be._INSTANCE=new Be),Be._INSTANCE}getGraphemeBreakType($){if($<32)return $===10?3:$===13?2:4;if($<127)return 0;const se=this._data,ue=se.length/3;let ce=1;for(;ce<=ue;)if($<se[3*ce])ce=2*ce;else if($>se[3*ce+1])ce=2*ce+1;else return se[3*ce+2];return 0}}Be._INSTANCE=null;function je(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function Ee($,se){if($===0)return 0;const ue=Te($,se);if(ue!==void 0)return ue;const ce=d(se,$);return $-=Re(ce),$}function Te($,se){let ue=d(se,$);for($-=Re(ue);Ie(ue)||ue===65039||ue===8419;){if($===0)return;ue=d(se,$),$-=Re(ue)}if(!he(ue))return;if($>=0){const ce=d(se,$);ce===8205&&($-=Re(ce))}return $}function Re($){return $>=65536?2:1}function Ie($){return 127995<=$&&$<=127999}},NvD2:function(Ne,ne,U){"use strict";U.d(ne,"a",function(){return R});var Q=U("Kwbf");function H(K,N){var e=new Set;return K.forEach(function(C){N.has(C)||e.add(C)}),e}function I(K){var N=K||{},e=N.disabled,C=N.disableCheckbox,g=N.checkable;return!!(e||C)||g===!1}function W(K,N,e,C){for(var g=new Set(K),v=new Set,c=0;c<=e;c+=1){var s=N.get(c)||new Set;s.forEach(function(n){var r=n.key,t=n.node,E=n.children,y=E===void 0?[]:E;g.has(r)&&!C(t)&&y.filter(function(m){return!C(m.node)}).forEach(function(m){g.add(m.key)})})}for(var i=new Set,l=e;l>=0;l-=1){var a=N.get(l)||new Set;a.forEach(function(n){var r=n.parent,t=n.node;if(C(t)||!n.parent||i.has(n.parent.key))return;if(C(n.parent.node)){i.add(r.key);return}var E=!0,y=!1;(r.children||[]).filter(function(m){return!C(m.node)}).forEach(function(m){var T=m.key,_=g.has(T);E&&!_&&(E=!1),!y&&(_||v.has(T))&&(y=!0)}),E&&g.add(r.key),y&&v.add(r.key),i.add(r.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(H(v,g))}}function P(K,N,e,C,g){for(var v=new Set(K),c=new Set(N),s=0;s<=C;s+=1){var i=e.get(s)||new Set;i.forEach(function(r){var t=r.key,E=r.node,y=r.children,m=y===void 0?[]:y;!v.has(t)&&!c.has(t)&&!g(E)&&m.filter(function(T){return!g(T.node)}).forEach(function(T){v.delete(T.key)})})}c=new Set;for(var l=new Set,a=C;a>=0;a-=1){var n=e.get(a)||new Set;n.forEach(function(r){var t=r.parent,E=r.node;if(g(E)||!r.parent||l.has(r.parent.key))return;if(g(r.parent.node)){l.add(t.key);return}var y=!0,m=!1;(t.children||[]).filter(function(T){return!g(T.node)}).forEach(function(T){var _=T.key,f=v.has(_);y&&!f&&(y=!1),!m&&(f||c.has(_))&&(m=!0)}),y||v.delete(t.key),m&&c.add(t.key),l.add(t.key)})}return{checkedKeys:Array.from(v),halfCheckedKeys:Array.from(H(c,v))}}function R(K,N,e,C){var g=[],v;C?v=C:v=I;var c=new Set(K.filter(function(a){var n=!!e[a];return n||g.push(a),n})),s=new Map,i=0;Object.keys(e).forEach(function(a){var n=e[a],r=n.level,t=s.get(r);t||(t=new Set,s.set(r,t)),t.add(n),i=Math.max(i,r)}),Object(Q.a)(!g.length,"Tree missing follow keys: ".concat(g.slice(0,100).map(function(a){return"'".concat(a,"'")}).join(", ")));var l;return N===!0?l=W(c,s,i,v):l=P(c,N.halfCheckedKeys,s,i,v),l}},OZM5:function(Ne,ne,U){"use strict";U.d(ne,"b",function(){return C}),U.d(ne,"a",function(){return g}),U.d(ne,"k",function(){return v}),U.d(ne,"h",function(){return c}),U.d(ne,"i",function(){return s}),U.d(ne,"g",function(){return i}),U.d(ne,"c",function(){return l}),U.d(ne,"d",function(){return a}),U.d(ne,"j",function(){return t}),U.d(ne,"e",function(){return E}),U.d(ne,"f",function(){return y});var Q=U("KQm4"),H=U("U8pU"),I=U("Ff2n"),W=U("q1tI"),P=U.n(W),R=U("Kwbf"),K=U("WaYH"),N=.25,e=2;function C(m,T){var _=m.slice(),f=_.indexOf(T);return f>=0&&_.splice(f,1),_}function g(m,T){var _=m.slice();return _.indexOf(T)===-1&&_.push(T),_}function v(m){return m.split("-")}function c(m,T){return"".concat(m,"-").concat(T)}function s(m){return m&&m.type&&m.type.isTreeNode}function i(m,T){var _=[m],f=T[m];function h(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];o.forEach(function(u){var b=u.key,p=u.children;_.push(b),h(p)})}return h(f.children),_}function l(m,T){var _=m.clientY,f=T.selectHandle.getBoundingClientRect(),h=f.top,o=f.bottom,u=f.height,b=Math.max(u*N,e);return _<=h+b?-1:_>=o-b?1:0}function a(m,T){if(!m)return;var _=T.multiple;return _?m.slice():m.length?[m[0]]:m}var n=function(T){return T};function r(m,T){if(!m)return[];var _=T||{},f=_.processProps,h=f===void 0?n:f,o=Array.isArray(m)?m:[m];return o.map(function(u){var b=u.children,p=Object(I.a)(u,["children"]),d=r(b,T);return P.a.createElement(K.a,Object.assign({},h(p)),d)})}function t(m){if(!m)return null;var T;if(Array.isArray(m))T={checkedKeys:m,halfCheckedKeys:void 0};else if(Object(H.a)(m)==="object")T={checkedKeys:m.checked||void 0,halfCheckedKeys:m.halfChecked||void 0};else return Object(R.a)(!1,"`checkedKeys` is not an array or an object"),null;return T}function E(m,T){var _=new Set;function f(h){if(_.has(h))return;var o=T[h];if(!o)return;_.add(h);var u=o.parent,b=o.node;if(b.disabled)return;u&&f(u.key)}return(m||[]).forEach(function(h){f(h)}),Object(Q.a)(_)}function y(m){var T={};return Object.keys(m).forEach(function(_){(_.startsWith("data-")||_.startsWith("aria-"))&&(T[_]=m[_])}),T}},"SA+Z":function(Ne,ne,U){var Q=U("wTVA"),H=U("EbDI"),I=U("ZhPi"),W=U("wkBT");function P(R){return Q(R)||H(R)||I(R)||W()}Ne.exports=P,Ne.exports.__esModule=!0,Ne.exports.default=Ne.exports},SJMd:function(Ne,ne){/**
* @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,Q,H,I=!1,W,P;window.PR_SHOULD_USE_CONTINUATION=!0;var R,K;(function(){var N=window,e=["break,continue,do,else,for,if,return,while"],C=[e,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],g=[C,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],v=[g,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],c=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],s=[g,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],i="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",l=[g,"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",n=[e,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],r=[e,"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"],t=[e,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],E=[v,s,c,l,a,n,r,t],y=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,m="str",T="kwd",_="com",f="typ",h="lit",o="pun",u="pln",b="tag",p="dec",d="src",A="atn",D="atv",S="nocode",L="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function M(Te){for(var Re=0,Ie=!1,$=!1,se=0,ue=Te.length;se<ue;++se){var ce=Te[se];if(ce.ignoreCase)$=!0;else if(/[a-z]/i.test(ce.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ie=!0,$=!1;break}}var _e={b:8,t:9,n:10,v:11,f:12,r:13};function De(oe){var me=oe.charCodeAt(0);if(me!==92)return me;var be=oe.charAt(1);return me=_e[be],me||("0"<=be&&be<="7"?parseInt(oe.substring(1),8):be==="u"||be==="x"?parseInt(oe.substring(2),16):oe.charCodeAt(1))}function Pe(oe){if(oe<32)return(oe<16?"\\x0":"\\x")+oe.toString(16);var me=String.fromCharCode(oe);return me==="\\"||me==="-"||me==="]"||me==="^"?"\\"+me:me}function Me(oe){var me=oe.substring(1,oe.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")),be=[],we=me[0]==="^",pe=["["];we&&pe.push("^");for(var ye=we?1:0,re=me.length;ye<re;++ye){var Z=me[ye];if(/\\[bdsw]/i.test(Z))pe.push(Z);else{var J=De(Z),V;ye+2<re&&me[ye+1]==="-"?(V=De(me[ye+2]),ye+=2):V=J,be.push([J,V]),V<65||J>122||(V<65||J>90||be.push([Math.max(65,J)|32,Math.min(V,90)|32]),V<97||J>122||be.push([Math.max(97,J)&~32,Math.min(V,122)&~32]))}}be.sort(function(le,ge){return le[0]-ge[0]||ge[1]-le[1]});for(var Y=[],q=[],ye=0;ye<be.length;++ye){var ee=be[ye];ee[0]<=q[1]+1?q[1]=Math.max(q[1],ee[1]):Y.push(q=ee)}for(var ye=0;ye<Y.length;++ye){var ee=Y[ye];pe.push(Pe(ee[0])),ee[1]>ee[0]&&(ee[1]+1>ee[0]&&pe.push("-"),pe.push(Pe(ee[1])))}return pe.push("]"),pe.join("")}function Fe(oe){for(var me=oe.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")),be=me.length,we=[],pe=0,ye=0;pe<be;++pe){var re=me[pe];if(re==="(")++ye;else if(re.charAt(0)==="\\"){var Z=+re.substring(1);Z&&(Z<=ye?we[Z]=-1:me[pe]=Pe(Z))}}for(var pe=1;pe<we.length;++pe)we[pe]===-1&&(we[pe]=++Re);for(var pe=0,ye=0;pe<be;++pe){var re=me[pe];if(re==="(")++ye,we[ye]||(me[pe]="(?:");else if(re.charAt(0)==="\\"){var Z=+re.substring(1);Z&&Z<=ye&&(me[pe]="\\"+we[Z])}}for(var pe=0;pe<be;++pe)me[pe]==="^"&&me[pe+1]!=="^"&&(me[pe]="");if(oe.ignoreCase&&Ie)for(var pe=0;pe<be;++pe){var re=me[pe],J=re.charAt(0);re.length>=2&&J==="["?me[pe]=Me(re):J!=="\\"&&(me[pe]=re.replace(/[a-zA-Z]/g,function(q){var ee=q.charCodeAt(0);return"["+String.fromCharCode(ee&~32,ee|32)+"]"}))}return me.join("")}for(var He=[],se=0,ue=Te.length;se<ue;++se){var ce=Te[se];if(ce.global||ce.multiline)throw new Error(""+ce);He.push("(?:"+Fe(ce)+")")}return new RegExp(He.join("|"),$?"gi":"g")}function O(Te,Re){var Ie=/(?:^|\s)nocode(?:\s|$)/,$=[],se=0,ue=[],ce=0;function _e(De){var Pe=De.nodeType;if(Pe==1){if(Ie.test(De.className))return;for(var Me=De.firstChild;Me;Me=Me.nextSibling)_e(Me);var Fe=De.nodeName.toLowerCase();(Fe==="br"||Fe==="li")&&($[ce]=`
`,ue[ce<<1]=se++,ue[ce++<<1|1]=De)}else if(Pe==3||Pe==4){var He=De.nodeValue;He.length&&(Re?He=He.replace(/\r\n?/g,`
`):He=He.replace(/[ \t\r\n]+/g," "),$[ce]=He,ue[ce<<1]=se,se+=He.length,ue[ce++<<1|1]=De)}}return _e(Te),{sourceCode:$.join("").replace(/\n$/,""),spans:ue}}function j(Te,Re,Ie,$,se){if(!Ie)return;var ue={sourceNode:Te,pre:1,langExtension:null,numberLines:null,sourceCode:Ie,spans:null,basePos:Re,decorations:null};$(ue),se.push.apply(se,ue.decorations)}var G=/\S/;function X(Te){for(var Re=void 0,Ie=Te.firstChild;Ie;Ie=Ie.nextSibling){var $=Ie.nodeType;Re=$===1?Re?Te:Ie:$===3&&G.test(Ie.nodeValue)?Te:Re}return Re===Te?void 0:Re}function te(Te,Re){var Ie={},$;(function(){for(var ce=Te.concat(Re),_e=[],De={},Pe=0,Me=ce.length;Pe<Me;++Pe){var Fe=ce[Pe],He=Fe[3];if(He)for(var oe=He.length;--oe>=0;)Ie[He.charAt(oe)]=Fe;var me=Fe[1],be=""+me;De.hasOwnProperty(be)||(_e.push(me),De[be]=null)}_e.push(/[\0-\uffff]/),$=M(_e)})();var se=Re.length,ue=function(ce){for(var _e=ce.sourceCode,De=ce.basePos,Pe=ce.sourceNode,Me=[De,u],Fe=0,He=_e.match($)||[],oe={},me=0,be=He.length;me<be;++me){var we=He[me],pe=oe[we],ye=void 0,re;if(typeof pe=="string")re=!1;else{var Z=Ie[we.charAt(0)];if(Z)ye=we.match(Z[1]),pe=Z[0];else{for(var J=0;J<se;++J)if(Z=Re[J],ye=we.match(Z[1]),ye){pe=Z[0];break}ye||(pe=u)}re=pe.length>=5&&pe.substring(0,5)==="lang-",re&&!(ye&&typeof ye[1]=="string")&&(re=!1,pe=d),re||(oe[we]=pe)}var V=Fe;if(Fe+=we.length,!re)Me.push(De+V,pe);else{var Y=ye[1],q=we.indexOf(Y),ee=q+Y.length;ye[2]&&(ee=we.length-ye[2].length,q=ee-Y.length);var le=pe.substring(5);j(Pe,De+V,we.substring(0,q),ue,Me),j(Pe,De+V+q,Y,ie(le,Y),Me),j(Pe,De+V+ee,we.substring(ee),ue,Me)}}ce.decorations=Me};return ue}function fe(Te){var Re=[],Ie=[];Te.tripleQuotedStrings?Re.push([m,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Te.multiLineStrings?Re.push([m,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Re.push([m,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Te.verbatimStrings&&Ie.push([m,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var $=Te.hashComments;$&&(Te.cStyleComments?($>1?Re.push([_,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Re.push([_,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ie.push([m,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Re.push([_,/^#[^\r\n]*/,null,"#"])),Te.cStyleComments&&(Ie.push([_,/^\/\/[^\r\n]*/,null]),Ie.push([_,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var se=Te.regexLiterals;if(se){var ue=se>1?"":`
\r`,ce=ue?".":"[\\S\\s]",_e="/(?=[^/*"+ue+"])(?:[^/\\x5B\\x5C"+ue+"]|\\x5C"+ce+"|\\x5B(?:[^\\x5C\\x5D"+ue+"]|\\x5C"+ce+")*(?:\\x5D|$))+/";Ie.push(["lang-regex",RegExp("^"+L+"("+_e+")")])}var De=Te.types;De&&Ie.push([f,De]);var Pe=(""+Te.keywords).replace(/^ | $/g,"");Pe.length&&Ie.push([T,new RegExp("^(?:"+Pe.replace(/[\s,]+/g,"|")+")\\b"),null]),Re.push([u,/^\s+/,null,` \r
\xA0`]);var Me="^.[^\\s\\w.$@'\"`/\\\\]*";return Te.regexLiterals&&(Me+="(?!s*/)"),Ie.push([h,/^@[a-z_$][a-z_$@0-9]*/i,null],[f,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[u,/^[a-z_$][a-z_$@0-9]*/i,null],[h,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[u,/^\\[\s\S]?/,null],[o,new RegExp(Me),null]),te(Re,Ie)}var ve=fe({keywords:E,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function he(Te,Re,Ie){for(var $=/(?:^|\s)nocode(?:\s|$)/,se=/\r\n?|\n/,ue=Te.ownerDocument,ce=ue.createElement("li");Te.firstChild;)ce.appendChild(Te.firstChild);var _e=[ce];function De(me){var be=me.nodeType;if(be==1&&!$.test(me.className))if(me.nodeName==="br")Pe(me),me.parentNode&&me.parentNode.removeChild(me);else for(var we=me.firstChild;we;we=we.nextSibling)De(we);else if((be==3||be==4)&&Ie){var pe=me.nodeValue,ye=pe.match(se);if(ye){var re=pe.substring(0,ye.index);me.nodeValue=re;var Z=pe.substring(ye.index+ye[0].length);if(Z){var J=me.parentNode;J.insertBefore(ue.createTextNode(Z),me.nextSibling)}Pe(me),re||me.parentNode.removeChild(me)}}}function Pe(me){for(;!me.nextSibling;)if(me=me.parentNode,!me)return;function be(ye,re){var Z=re?ye.cloneNode(!1):ye,J=ye.parentNode;if(J){var V=be(J,1),Y=ye.nextSibling;V.appendChild(Z);for(var q=Y;q;q=Y)Y=q.nextSibling,V.appendChild(q)}return Z}for(var we=be(me.nextSibling,0),pe;(pe=we.parentNode)&&pe.nodeType===1;)we=pe;_e.push(we)}for(var Me=0;Me<_e.length;++Me)De(_e[Me]);Re===(Re|0)&&_e[0].setAttribute("value",Re);var Fe=ue.createElement("ol");Fe.className="linenums";for(var He=Math.max(0,Re-1|0)||0,Me=0,oe=_e.length;Me<oe;++Me)ce=_e[Me],ce.className="L"+(Me+He)%10,ce.firstChild||ce.appendChild(ue.createTextNode("\xA0")),Fe.appendChild(ce);Te.appendChild(Fe)}function xe(Te){var Re=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Re=Re&&+Re[1]<=8;var Ie=/\n/g,$=Te.sourceCode,se=$.length,ue=0,ce=Te.spans,_e=ce.length,De=0,Pe=Te.decorations,Me=Pe.length,Fe=0;Pe[Me]=se;var He,oe;for(oe=He=0;oe<Me;)Pe[oe]!==Pe[oe+2]?(Pe[He++]=Pe[oe++],Pe[He++]=Pe[oe++]):oe+=2;for(Me=He,oe=He=0;oe<Me;){for(var me=Pe[oe],be=Pe[oe+1],we=oe+2;we+2<=Me&&Pe[we+1]===be;)we+=2;Pe[He++]=me,Pe[He++]=be,oe=we}Me=Pe.length=He;var pe=Te.sourceNode,ye="";pe&&(ye=pe.style.display,pe.style.display="none");try{for(var re=null;De<_e;){var Z=ce[De],J=ce[De+2]||se,V=Pe[Fe+2]||se,we=Math.min(J,V),Y=ce[De+1],q;if(Y.nodeType!==1&&(q=$.substring(ue,we))){Re&&(q=q.replace(Ie,"\r")),Y.nodeValue=q;var ee=Y.ownerDocument,le=ee.createElement("span");le.className=Pe[Fe+1];var ge=Y.parentNode;ge.replaceChild(le,Y),le.appendChild(Y),ue<J&&(ce[De+1]=Y=ee.createTextNode($.substring(we,J)),ge.insertBefore(Y,le.nextSibling))}ue=we,ue>=J&&(De+=2),ue>=V&&(Fe+=2)}}finally{pe&&(pe.style.display=ye)}}var Se={};function de(Te,Re){for(var Ie=Re.length;--Ie>=0;){var $=Re[Ie];Se.hasOwnProperty($)?N.console&&console.warn("cannot override language handler %s",$):Se[$]=Te}}function ie(Te,Re){return Te&&Se.hasOwnProperty(Te)||(Te=/^\s*</.test(Re)?"default-markup":"default-code"),Se[Te]}de(ve,["default-code"]),de(te([],[[u,/^[^<?]+/],[p,/^<!\w[^>]*(?:>|$)/],[_,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[o,/^(?:<[%?]|[%?]>)/],["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"]),de(te([[u,/^[\s]+/,null,` \r
`],[D,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[b,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[A,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[o,/^[=<>\/]+/],["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"]),de(te([],[[D,/^[\s\S]+/]]),["uq.val"]),de(fe({keywords:v,hashComments:!0,cStyleComments:!0,types:y}),["c","cc","cpp","cxx","cyc","m"]),de(fe({keywords:"null,true,false"}),["json"]),de(fe({keywords:s,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:y}),["cs"]),de(fe({keywords:c,cStyleComments:!0}),["java"]),de(fe({keywords:t,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),de(fe({keywords:n,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),de(fe({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),de(fe({keywords:r,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),de(fe({keywords:l,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),de(fe({keywords:i,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),de(te([],[[m,/^[\s\S]+/]]),["regex"]);function Le(Te){var Re=Te.langExtension;try{var Ie=O(Te.sourceNode,Te.pre),$=Ie.sourceCode;Te.sourceCode=$,Te.spans=Ie.spans,Te.basePos=0,ie(Re,$)(Te),xe(Te)}catch(se){N.console&&console.log(se&&se.stack||se)}}function Ve(Te,Re,Ie){var $=Ie||!1,se=Re||null,ue=document.createElement("div");ue.innerHTML="<pre>"+Te+"</pre>",ue=ue.firstChild,$&&he(ue,$,!0);var ce={langExtension:se,numberLines:$,sourceNode:ue,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Le(ce),ue.innerHTML}function Be(Te,Re){var Ie=Re||document.body,$=Ie.ownerDocument||document;function se(Z){return Ie.getElementsByTagName(Z)}for(var ue=[se("pre"),se("code"),se("xmp")],ce=[],_e=0;_e<ue.length;++_e)for(var De=0,Pe=ue[_e].length;De<Pe;++De)ce.push(ue[_e][De]);ue=null;var Me=Date;Me.now||(Me={now:function(){return+new Date}});var Fe=0,He=/\blang(?:uage)?-([\w.]+)(?!\S)/,oe=/\bprettyprint\b/,me=/\bprettyprinted\b/,be=/pre|xmp/i,we=/^code$/i,pe=/^(?:pre|code|xmp)$/i,ye={};function re(){for(var Z=N.PR_SHOULD_USE_CONTINUATION?Me.now()+250:Infinity;Fe<ce.length&&Me.now()<Z;Fe++){for(var J=ce[Fe],V=ye,Y=J;Y=Y.previousSibling;){var q=Y.nodeType,ee=(q===7||q===8)&&Y.nodeValue;if(ee?!/^\??prettify\b/.test(ee):q!==3||/\S/.test(Y.nodeValue))break;if(ee){V={},ee.replace(/\b(\w+)=([\w:.%+-]+)/g,function(dt,et,st){V[et]=st});break}}var le=J.className;if((V!==ye||oe.test(le))&&!me.test(le)){for(var ge=!1,Oe=J.parentNode;Oe;Oe=Oe.parentNode){var Ke=Oe.tagName;if(pe.test(Ke)&&Oe.className&&oe.test(Oe.className)){ge=!0;break}}if(!ge){J.className+=" prettyprinted";var ze=V.lang;if(!ze){ze=le.match(He);var ke;!ze&&(ke=X(J))&&we.test(ke.tagName)&&(ze=ke.className.match(He)),ze&&(ze=ze[1])}var Je;if(be.test(J.tagName))Je=1;else{var Qe=J.currentStyle,Ge=$.defaultView,at=Qe?Qe.whiteSpace:Ge&&Ge.getComputedStyle?Ge.getComputedStyle(J,null).getPropertyValue("white-space"):0;Je=at&&at.substring(0,3)==="pre"}var nt=V.linenums;(nt=nt==="true"||+nt)||(nt=le.match(/\blinenums\b(?::(\d+))?/),nt=nt?nt[1]&&nt[1].length?+nt[1]:!0:!1),nt&&he(J,nt,Je);var rt={langExtension:ze,sourceNode:J,numberLines:nt,pre:Je,sourceCode:null,basePos:null,spans:null,decorations:null};Le(rt)}}}Fe<ce.length?N.setTimeout(re,250):typeof Te=="function"&&Te()}re()}var je=N.PR={createSimpleLexer:te,registerLangHandler:de,sourceDecorator:fe,PR_ATTRIB_NAME:A,PR_ATTRIB_VALUE:D,PR_COMMENT:_,PR_DECLARATION:p,PR_KEYWORD:T,PR_LITERAL:h,PR_NOCODE:S,PR_PLAIN:u,PR_PUNCTUATION:o,PR_SOURCE:d,PR_STRING:m,PR_TAG:b,PR_TYPE:f,prettyPrintOne:I?N.prettyPrintOne=Ve:R=Ve,prettyPrint:K=I?N.prettyPrint=Be:K=Be},Ee=N.define;typeof Ee=="function"&&Ee.amd&&Ee("google-code-prettify",[],function(){return je})})()},T8No:function(Ne,ne,U){"use strict";U.d(ne,"a",function(){return K}),U.d(ne,"e",function(){return N}),U.d(ne,"c",function(){return o}),U.d(ne,"b",function(){return u}),U.d(ne,"d",function(){return b}),U.d(ne,"f",function(){return A});var Q=U("MNsG"),H=U("N0LK"),I=U("Cg/j");let W=Q.k||"";const P=new Map;P.set("false",!1),P.set("true",!0),P.set("isMac",Q.f),P.set("isLinux",Q.d),P.set("isWindows",Q.i),P.set("isWeb",Q.h),P.set("isMacNative",Q.f&&!Q.h),P.set("isEdge",W.indexOf("Edg/")>=0),P.set("isFirefox",W.indexOf("Firefox")>=0),P.set("isChrome",W.indexOf("Chrome")>=0),P.set("isSafari",W.indexOf("Safari")>=0);const R=Object.prototype.hasOwnProperty;class K{static has(S){return v.create(S)}static equals(S,L){return c.create(S,L)}static regex(S,L){return m.create(S,L)}static not(S){return a.create(S)}static and(...S){return f.create(S,null)}static or(...S){return h.create(S,null,!0)}static deserialize(S,L=!1){return S?this._deserializeOrExpression(S,L):void 0}static _deserializeOrExpression(S,L){let M=S.split("||");return h.create(M.map(O=>this._deserializeAndExpression(O,L)),null,!0)}static _deserializeAndExpression(S,L){let M=S.split("&&");return f.create(M.map(O=>this._deserializeOne(O,L)),null)}static _deserializeOne(S,L){if(S=S.trim(),S.indexOf("!=")>=0){let M=S.split("!=");return l.create(M[0].trim(),this._deserializeValue(M[1],L))}if(S.indexOf("==")>=0){let M=S.split("==");return c.create(M[0].trim(),this._deserializeValue(M[1],L))}if(S.indexOf("=~")>=0){let M=S.split("=~");return m.create(M[0].trim(),this._deserializeRegexValue(M[1],L))}if(S.indexOf(" in ")>=0){let M=S.split(" in ");return s.create(M[0].trim(),M[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(S)){const M=S.split(">=");return t.create(M[0].trim(),M[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(S)){const M=S.split(">");return r.create(M[0].trim(),M[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(S)){const M=S.split("<=");return y.create(M[0].trim(),M[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(S)){const M=S.split("<");return E.create(M[0].trim(),M[1].trim())}return/^\!\s*/.test(S)?a.create(S.substr(1).trim()):v.create(S)}static _deserializeValue(S,L){if(S=S.trim(),S==="true")return!0;if(S==="false")return!1;let M=/^'([^']*)'$/.exec(S);return M?M[1].trim():S}static _deserializeRegexValue(S,L){if(Object(H.C)(S)){if(L)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let M=S.indexOf("/"),O=S.lastIndexOf("/");if(M===O||M<0){if(L)throw new Error(`bad regexp-value '${S}', missing /-enclosure`);return console.warn(`bad regexp-value '${S}', missing /-enclosure`),null}let j=S.slice(M+1,O),G=S[O+1]==="i"?"i":"";try{return new RegExp(j,G)}catch(X){if(L)throw new Error(`bad regexp-value '${S}', parse error: ${X}`);return console.warn(`bad regexp-value '${S}', parse error: ${X}`),null}}}function N(S,L){const M=S?S.substituteConstants():void 0,O=L?L.substituteConstants():void 0;return!M&&!O?!0:!M||!O?!1:M.equals(O)}function e(S,L){return S.cmp(L)}class C{constructor(){this.type=0}cmp(S){return this.type-S.type}equals(S){return S.type===this.type}substituteConstants(){return this}evaluate(S){return!1}serialize(){return"false"}keys(){return[]}negate(){return g.INSTANCE}}C.INSTANCE=new C;class g{constructor(){this.type=1}cmp(S){return this.type-S.type}equals(S){return S.type===this.type}substituteConstants(){return this}evaluate(S){return!0}serialize(){return"true"}keys(){return[]}negate(){return C.INSTANCE}}g.INSTANCE=new g;class v{constructor(S,L){this.key=S,this.negated=L,this.type=2}static create(S,L=null){const M=P.get(S);return typeof M=="boolean"?M?g.INSTANCE:C.INSTANCE:new v(S,L)}cmp(S){return S.type!==this.type?this.type-S.type:p(this.key,S.key)}equals(S){return S.type===this.type?this.key===S.key:!1}substituteConstants(){const S=P.get(this.key);return typeof S=="boolean"?S?g.INSTANCE:C.INSTANCE:this}evaluate(S){return!!S.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=a.create(this.key,this)),this.negated}}class c{constructor(S,L,M){this.key=S,this.value=L,this.negated=M,this.type=4}static create(S,L,M=null){if(typeof L=="boolean")return L?v.create(S,M):a.create(S,M);const O=P.get(S);if(typeof O=="boolean"){const j=O?"true":"false";return L===j?g.INSTANCE:C.INSTANCE}return new c(S,L,M)}cmp(S){return S.type!==this.type?this.type-S.type:d(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){const S=P.get(this.key);if(typeof S=="boolean"){const L=S?"true":"false";return this.value===L?g.INSTANCE:C.INSTANCE}return this}evaluate(S){return S.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=l.create(this.key,this.value,this)),this.negated}}class s{constructor(S,L){this.key=S,this.valueKey=L,this.type=10,this.negated=null}static create(S,L){return new s(S,L)}cmp(S){return S.type!==this.type?this.type-S.type:d(this.key,this.valueKey,S.key,S.valueKey)}equals(S){return S.type===this.type?this.key===S.key&&this.valueKey===S.valueKey:!1}substituteConstants(){return this}evaluate(S){const L=S.getValue(this.valueKey),M=S.getValue(this.key);return Array.isArray(L)?L.indexOf(M)>=0:typeof M=="string"&&typeof L=="object"&&L!==null?R.call(L,M):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=i.create(this)),this.negated}}class i{constructor(S){this._actual=S,this.type=11}static create(S){return new i(S)}cmp(S){return S.type!==this.type?this.type-S.type:this._actual.cmp(S._actual)}equals(S){return S.type===this.type?this._actual.equals(S._actual):!1}substituteConstants(){return this}evaluate(S){return!this._actual.evaluate(S)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class l{constructor(S,L,M){this.key=S,this.value=L,this.negated=M,this.type=5}static create(S,L,M=null){if(typeof L=="boolean")return L?a.create(S,M):v.create(S,M);const O=P.get(S);if(typeof O=="boolean"){const j=O?"true":"false";return L===j?C.INSTANCE:g.INSTANCE}return new l(S,L,M)}cmp(S){return S.type!==this.type?this.type-S.type:d(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){const S=P.get(this.key);if(typeof S=="boolean"){const L=S?"true":"false";return this.value===L?C.INSTANCE:g.INSTANCE}return this}evaluate(S){return S.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=c.create(this.key,this.value,this)),this.negated}}class a{constructor(S,L){this.key=S,this.negated=L,this.type=3}static create(S,L=null){const M=P.get(S);return typeof M=="boolean"?M?C.INSTANCE:g.INSTANCE:new a(S,L)}cmp(S){return S.type!==this.type?this.type-S.type:p(this.key,S.key)}equals(S){return S.type===this.type?this.key===S.key:!1}substituteConstants(){const S=P.get(this.key);return typeof S=="boolean"?S?C.INSTANCE:g.INSTANCE:this}evaluate(S){return!S.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=v.create(this.key,this)),this.negated}}function n(S,L){if(typeof S=="string"){const M=parseFloat(S);isNaN(M)||(S=M)}return typeof S=="string"||typeof S=="number"?L(S):C.INSTANCE}class r{constructor(S,L,M){this.key=S,this.value=L,this.negated=M,this.type=12}static create(S,L,M=null){return n(L,O=>new r(S,O,M))}cmp(S){return S.type!==this.type?this.type-S.type:d(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=y.create(this.key,this.value,this)),this.negated}}class t{constructor(S,L,M){this.key=S,this.value=L,this.negated=M,this.type=13}static create(S,L,M=null){return n(L,O=>new t(S,O,M))}cmp(S){return S.type!==this.type?this.type-S.type:d(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=E.create(this.key,this.value,this)),this.negated}}class E{constructor(S,L,M){this.key=S,this.value=L,this.negated=M,this.type=14}static create(S,L,M=null){return n(L,O=>new E(S,O,M))}cmp(S){return S.type!==this.type?this.type-S.type:d(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=t.create(this.key,this.value,this)),this.negated}}class y{constructor(S,L,M){this.key=S,this.value=L,this.negated=M,this.type=15}static create(S,L,M=null){return n(L,O=>new y(S,O,M))}cmp(S){return S.type!==this.type?this.type-S.type:d(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=r.create(this.key,this.value,this)),this.negated}}class m{constructor(S,L){this.key=S,this.regexp=L,this.type=7,this.negated=null}static create(S,L){return new m(S,L)}cmp(S){if(S.type!==this.type)return this.type-S.type;if(this.key<S.key)return-1;if(this.key>S.key)return 1;const L=this.regexp?this.regexp.source:"",M=S.regexp?S.regexp.source:"";return L<M?-1:L>M?1:0}equals(S){if(S.type===this.type){const L=this.regexp?this.regexp.source:"",M=S.regexp?S.regexp.source:"";return this.key===S.key&&L===M}return!1}substituteConstants(){return this}evaluate(S){let L=S.getValue(this.key);return this.regexp?this.regexp.test(L):!1}serialize(){const S=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${S}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=T.create(this)),this.negated}}class T{constructor(S){this._actual=S,this.type=8}static create(S){return new T(S)}cmp(S){return S.type!==this.type?this.type-S.type:this._actual.cmp(S._actual)}equals(S){return S.type===this.type?this._actual.equals(S._actual):!1}substituteConstants(){return this}evaluate(S){return!this._actual.evaluate(S)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function _(S){let L=null;for(let M=0,O=S.length;M<O;M++){const j=S[M].substituteConstants();if(S[M]!==j&&L===null){L=[];for(let G=0;G<M;G++)L[G]=S[G]}L!==null&&(L[M]=j)}return L===null?S:L}class f{constructor(S,L){this.expr=S,this.negated=L,this.type=6}static create(S,L){return f._normalizeArr(S,L)}cmp(S){if(S.type!==this.type)return this.type-S.type;if(this.expr.length<S.expr.length)return-1;if(this.expr.length>S.expr.length)return 1;for(let L=0,M=this.expr.length;L<M;L++){const O=e(this.expr[L],S.expr[L]);if(O!==0)return O}return 0}equals(S){if(S.type===this.type){if(this.expr.length!==S.expr.length)return!1;for(let L=0,M=this.expr.length;L<M;L++)if(!this.expr[L].equals(S.expr[L]))return!1;return!0}return!1}substituteConstants(){const S=_(this.expr);return S===this.expr?this:f.create(S,this.negated)}evaluate(S){for(let L=0,M=this.expr.length;L<M;L++)if(!this.expr[L].evaluate(S))return!1;return!0}static _normalizeArr(S,L){const M=[];let O=!1;for(const j of S){if(!j)continue;if(j.type===1){O=!0;continue}if(j.type===0)return C.INSTANCE;if(j.type===6){M.push(...j.expr);continue}M.push(j)}if(M.length===0&&O)return g.INSTANCE;if(M.length===0)return;if(M.length===1)return M[0];M.sort(e);for(let j=1;j<M.length;j++)M[j-1].equals(M[j])&&(M.splice(j,1),j--);if(M.length===1)return M[0];for(;M.length>1;){const j=M[M.length-1];if(j.type!==9)break;M.pop();const G=M.pop(),X=M.length===0,te=h.create(j.expr.map(fe=>f.create([fe,G],null)),null,X);te&&(M.push(te),M.sort(e))}return M.length===1?M[0]:new f(M,L)}serialize(){return this.expr.map(S=>S.serialize()).join(" && ")}keys(){const S=[];for(let L of this.expr)S.push(...L.keys());return S}negate(){if(!this.negated){const S=[];for(let L of this.expr)S.push(L.negate());this.negated=h.create(S,this,!0)}return this.negated}}class h{constructor(S,L){this.expr=S,this.negated=L,this.type=9}static create(S,L,M){return h._normalizeArr(S,L,M)}cmp(S){if(S.type!==this.type)return this.type-S.type;if(this.expr.length<S.expr.length)return-1;if(this.expr.length>S.expr.length)return 1;for(let L=0,M=this.expr.length;L<M;L++){const O=e(this.expr[L],S.expr[L]);if(O!==0)return O}return 0}equals(S){if(S.type===this.type){if(this.expr.length!==S.expr.length)return!1;for(let L=0,M=this.expr.length;L<M;L++)if(!this.expr[L].equals(S.expr[L]))return!1;return!0}return!1}substituteConstants(){const S=_(this.expr);return S===this.expr?this:h.create(S,this.negated,!1)}evaluate(S){for(let L=0,M=this.expr.length;L<M;L++)if(this.expr[L].evaluate(S))return!0;return!1}static _normalizeArr(S,L,M){let O=[],j=!1;if(S){for(let G=0,X=S.length;G<X;G++){const te=S[G];if(!te)continue;if(te.type===0){j=!0;continue}if(te.type===1)return g.INSTANCE;if(te.type===9){O=O.concat(te.expr);continue}O.push(te)}if(O.length===0&&j)return C.INSTANCE;O.sort(e)}if(O.length===0)return;if(O.length===1)return O[0];for(let G=1;G<O.length;G++)O[G-1].equals(O[G])&&(O.splice(G,1),G--);if(O.length===1)return O[0];if(M){for(let G=0;G<O.length;G++)for(let X=G+1;X<O.length;X++)A(O[G],O[X])&&(O.splice(X,1),X--);if(O.length===1)return O[0]}return new h(O,L)}serialize(){return this.expr.map(S=>S.serialize()).join(" || ")}keys(){const S=[];for(let L of this.expr)S.push(...L.keys());return S}negate(){if(!this.negated){let S=[];for(let L of this.expr)S.push(L.negate());for(;S.length>1;){const L=S.shift(),M=S.shift(),O=[];for(const G of D(L))for(const X of D(M))O.push(f.create([G,X],null));const j=S.length===0;S.unshift(h.create(O,null,j))}this.negated=S[0]}return this.negated}}class o extends v{constructor(S,L,M){super(S,null);this._defaultValue=L,typeof M=="object"?o._info.push(Object.assign(Object.assign({},M),{key:S})):M!==!0&&o._info.push({key:S,description:M,type:L!=null?typeof L:void 0})}static all(){return o._info.values()}bindTo(S){return S.createKey(this.key,this._defaultValue)}getValue(S){return S.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(S){return c.create(this.key,S)}}o._info=[];const u=Object(I.c)("contextKeyService"),b="setContext";function p(S,L){return S<L?-1:S>L?1:0}function d(S,L,M,O){return S<M?-1:S>M?1:L<O?-1:L>O?1:0}function A(S,L){if(L.type===6&&S.type!==9&&S.type!==6){for(const j of L.expr)if(S.equals(j))return!0}const M=S.negate(),O=D(M).concat(D(L));O.sort(e);for(let j=0;j<O.length;j++){const G=O[j],X=G.negate();for(let te=j+1;te<O.length;te++){const fe=O[te];if(X.equals(fe))return!0}}return!1}function D(S){return S.type===9?S.expr:[S]}},TXwP:function(Ne,ne,U){var Q,H;(function(){var I;(function(){"use strict";var P=[,,function(e){function C(c){this.__parent=c,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}C.prototype.clone_empty=function(){var c=new C(this.__parent);return c.set_indent(this.__indent_count,this.__alignment_count),c},C.prototype.item=function(c){return c<0?this.__items[this.__items.length+c]:this.__items[c]},C.prototype.has_match=function(c){for(var s=this.__items.length-1;s>=0;s--)if(this.__items[s].match(c))return!0;return!1},C.prototype.set_indent=function(c,s){this.is_empty()&&(this.__indent_count=c||0,this.__alignment_count=s||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},C.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},C.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},C.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var c=this.__parent.current_line;return c.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),c.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),c.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,c.__items[0]===" "&&(c.__items.splice(0,1),c.__character_count-=1),!0}return!1},C.prototype.is_empty=function(){return this.__items.length===0},C.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},C.prototype.push=function(c){this.__items.push(c);var s=c.lastIndexOf(`
`);s!==-1?this.__character_count=c.length-s:this.__character_count+=c.length},C.prototype.pop=function(){var c=null;return this.is_empty()||(c=this.__items.pop(),this.__character_count-=c.length),c},C.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},C.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},C.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},C.prototype.toString=function(){var c="";return this.is_empty()?this.__parent.indent_empty_lines&&(c=this.__parent.get_indent_string(this.__indent_count)):(c=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),c+=this.__items.join("")),c};function g(c,s){this.__cache=[""],this.__indent_size=c.indent_size,this.__indent_string=c.indent_char,c.indent_with_tabs||(this.__indent_string=new Array(c.indent_size+1).join(c.indent_char)),s=s||"",c.indent_level>0&&(s=new Array(c.indent_level+1).join(this.__indent_string)),this.__base_string=s,this.__base_string_length=s.length}g.prototype.get_indent_size=function(c,s){var i=this.__base_string_length;return s=s||0,c<0&&(i=0),i+=c*this.__indent_size,i+=s,i},g.prototype.get_indent_string=function(c,s){var i=this.__base_string;return s=s||0,c<0&&(c=0,i=""),s+=c*this.__indent_size,this.__ensure_cache(s),i+=this.__cache[s],i},g.prototype.__ensure_cache=function(c){for(;c>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var c=this.__cache.length,s=0,i="";this.__indent_size&&c>=this.__indent_size&&(s=Math.floor(c/this.__indent_size),c-=s*this.__indent_size,i=new Array(s+1).join(this.__indent_string)),c&&(i+=new Array(c+1).join(" ")),this.__cache.push(i)};function v(c,s){this.__indent_cache=new g(c,s),this.raw=!1,this._end_with_newline=c.end_with_newline,this.indent_size=c.indent_size,this.wrap_line_length=c.wrap_line_length,this.indent_empty_lines=c.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new C(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}v.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},v.prototype.get_line_number=function(){return this.__lines.length},v.prototype.get_indent_string=function(c,s){return this.__indent_cache.get_indent_string(c,s)},v.prototype.get_indent_size=function(c,s){return this.__indent_cache.get_indent_size(c,s)},v.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},v.prototype.add_new_line=function(c){return this.is_empty()||!c&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},v.prototype.get_code=function(c){this.trim(!0);var s=this.current_line.pop();s&&(s[s.length-1]===`
`&&(s=s.replace(/\n+$/g,"")),this.current_line.push(s)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join(`
`);return c!==`
`&&(i=i.replace(/[\n]/g,c)),i},v.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},v.prototype.set_indent=function(c,s){return c=c||0,s=s||0,this.next_line.set_indent(c,s),this.__lines.length>1?(this.current_line.set_indent(c,s),!0):(this.current_line.set_indent(),!1)},v.prototype.add_raw_token=function(c){for(var s=0;s<c.newlines;s++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(c.whitespace_before),this.current_line.push(c.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},v.prototype.add_token=function(c){this.__add_space_before_token(),this.current_line.push(c),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},v.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},v.prototype.remove_indent=function(c){for(var s=this.__lines.length;c<s;)this.__lines[c]._remove_indent(),c++;this.current_line._remove_wrap_indent()},v.prototype.trim=function(c){for(c=c===void 0?!1:c,this.current_line.trim();c&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},v.prototype.just_added_newline=function(){return this.current_line.is_empty()},v.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},v.prototype.ensure_empty_line_above=function(c,s){for(var i=this.__lines.length-2;i>=0;){var l=this.__lines[i];if(l.is_empty())break;if(l.item(0).indexOf(c)!==0&&l.item(-1)!==s){this.__lines.splice(i+1,0,new C(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},e.exports.Output=v},,,,function(e){function C(c,s){this.raw_options=g(c,s),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}C.prototype._get_array=function(c,s){var i=this.raw_options[c],l=s||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(l=i.concat()):typeof i=="string"&&(l=i.split(/[^a-zA-Z0-9_\/\-]+/)),l},C.prototype._get_boolean=function(c,s){var i=this.raw_options[c],l=i===void 0?!!s:!!i;return l},C.prototype._get_characters=function(c,s){var i=this.raw_options[c],l=s||"";return typeof i=="string"&&(l=i.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),l},C.prototype._get_number=function(c,s){var i=this.raw_options[c];s=parseInt(s,10),isNaN(s)&&(s=0);var l=parseInt(i,10);return isNaN(l)&&(l=s),l},C.prototype._get_selection=function(c,s,i){var l=this._get_selection_list(c,s,i);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+c+`' can only be one of the following values:
`+s+`
You passed in: '`+this.raw_options[c]+"'");return l[0]},C.prototype._get_selection_list=function(c,s,i){if(!s||s.length===0)throw new Error("Selection list cannot be empty.");if(i=i||[s[0]],!this._is_valid_selection(i,s))throw new Error("Invalid Default Value!");var l=this._get_array(c,i);if(!this._is_valid_selection(l,s))throw new Error("Invalid Option Value: The option '"+c+`' can contain only the following values:
`+s+`
You passed in: '`+this.raw_options[c]+"'");return l},C.prototype._is_valid_selection=function(c,s){return c.length&&s.length&&!c.some(function(i){return s.indexOf(i)===-1})};function g(c,s){var i={};c=v(c);var l;for(l in c)l!==s&&(i[l]=c[l]);if(s&&c[s])for(l in c[s])i[l]=c[s][l];return i}function v(c){var s={},i;for(i in c){var l=i.replace(/-/g,"_");s[l]=c[i]}return s}e.exports.Options=C,e.exports.normalizeOpts=v,e.exports.mergeOpts=g},,function(e){var C=RegExp.prototype.hasOwnProperty("sticky");function g(v){this.__input=v||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var v=null;return this.hasNext()&&(v=this.__input.charAt(this.__position),this.__position+=1),v},g.prototype.peek=function(v){var c=null;return v=v||0,v+=this.__position,v>=0&&v<this.__input_length&&(c=this.__input.charAt(v)),c},g.prototype.__match=function(v,c){v.lastIndex=c;var s=v.exec(this.__input);return s&&!(C&&v.sticky)&&(s.index!==c&&(s=null)),s},g.prototype.test=function(v,c){return c=c||0,c+=this.__position,c>=0&&c<this.__input_length?!!this.__match(v,c):!1},g.prototype.testChar=function(v,c){var s=this.peek(c);return v.lastIndex=0,s!==null&&v.test(s)},g.prototype.match=function(v){var c=this.__match(v,this.__position);return c?this.__position+=c[0].length:c=null,c},g.prototype.read=function(v,c,s){var i="",l;return v&&(l=this.match(v),l&&(i+=l[0])),c&&(l||!v)&&(i+=this.readUntil(c,s)),i},g.prototype.readUntil=function(v,c){var s="",i=this.__position;v.lastIndex=this.__position;var l=v.exec(this.__input);return l?(i=l.index,c&&(i+=l[0].length)):i=this.__input_length,s=this.__input.substring(this.__position,i),this.__position=i,s},g.prototype.readUntilAfter=function(v){return this.readUntil(v,!0)},g.prototype.get_regexp=function(v,c){var s=null,i="g";return c&&C&&(i="y"),typeof v=="string"&&v!==""?s=new RegExp(v,i):v&&(s=new RegExp(v.source,i)),s},g.prototype.get_literal_regexp=function(v){return RegExp(v.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(v){var c=this.__position,s=this.readUntilAfter(v);return this.__position=c,s},g.prototype.lookBack=function(v){var c=this.__position-1;return c>=v.length&&this.__input.substring(c-v.length,c).toLowerCase()===v},e.exports.InputScanner=g},,,,,function(e){function C(g,v){g=typeof g=="string"?g:g.source,v=typeof v=="string"?v:v.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+v,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+v,"g")}C.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var v={};this.__directive_pattern.lastIndex=0;for(var c=this.__directive_pattern.exec(g);c;)v[c[1]]=c[2],c=this.__directive_pattern.exec(g);return v},C.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=C},,function(e,C,g){var v=g(16).Beautifier,c=g(17).Options;function s(i,l){var a=new v(i,l);return a.beautify()}e.exports=s,e.exports.defaultOptions=function(){return new c}},function(e,C,g){var v=g(17).Options,c=g(2).Output,s=g(8).InputScanner,i=g(13).Directives,l=new i(/\/\*/,/\*\//),a=/\r\n|[\r\n]/,n=/\r\n|[\r\n]/g,r=/\s/,t=/(?:\s|\n)+/g,E=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,y=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function m(T,_){this._source_text=T||"",this._options=new v(_),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}m.prototype.eatString=function(T){var _="";for(this._ch=this._input.next();this._ch;){if(_+=this._ch,this._ch==="\\")_+=this._input.next();else if(T.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return _},m.prototype.eatWhitespace=function(T){for(var _=r.test(this._input.peek()),f=0;r.test(this._input.peek());)this._ch=this._input.next(),T&&this._ch===`
`&&((f===0||f<this._options.max_preserve_newlines)&&(f++,this._output.add_new_line(!0)));return _},m.prototype.foundNestedPseudoClass=function(){for(var T=0,_=1,f=this._input.peek(_);f;){if(f==="{")return!0;if(f==="(")T+=1;else if(f===")"){if(T===0)return!1;T-=1}else if(f===";"||f==="}")return!1;_++,f=this._input.peek(_)}return!1},m.prototype.print_string=function(T){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(T)},m.prototype.preserveSingleSpace=function(T){T&&(this._output.space_before_token=!0)},m.prototype.indent=function(){this._indentLevel++},m.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},m.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var T=this._source_text,_=this._options.eol;_==="auto"&&(_=`
`,T&&a.test(T||"")&&(_=T.match(a)[0])),T=T.replace(n,`
`);var f=T.match(/^[\t ]*/)[0];this._output=new c(this._options,f),this._input=new s(T),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var h=0,o=!1,u=!1,b=!1,p=!1,d=!1,A=!1,D=this._ch,S=!1,L,M,O;L=this._input.read(t),M=L!=="",O=D,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),D=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var j=this._input.read(E),G=l.get_directives(j);G&&G.ignore==="start"&&(j+=l.readIgnored(this._input)),this.print_string(j),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(y)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(M),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var X=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);X.match(/[ :]$/)&&(X=this.eatString(": ").replace(/\s$/,""),this.print_string(X),this._output.space_before_token=!0),X=X.replace(/\s$/,""),X==="extend"?p=!0:X==="import"&&(d=!0),X in this.NESTED_AT_RULE?(this._nestedLevel+=1,X in this.CONDITIONAL_GROUP_RULE&&(b=!0)):!o&&h===0&&X.indexOf(":")!==-1&&(u=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(M),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")u&&(u=!1,this.outdent()),b?(b=!1,o=this._indentLevel>=this._nestedLevel):o=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&o&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(O==="("?this._output.space_before_token=!1:O!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),O==="{"&&this._output.trim(!0),d=!1,p=!1,u&&(this.outdent(),u=!1),this.print_string(this._ch),o=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var te=0;te<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;te++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[te])){S=!0;break}(o||b)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!p&&h===0?(this.print_string(":"),u||(u=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var fe=O==='"'||O==="'";this.preserveSingleSpace(fe||M),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")S=!1,h===0?(u&&(this.outdent(),u=!1),p=!1,d=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),h++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),h&&(h--,this.outdent()));else{var ve=!1;this._input.lookBack("with")&&(ve=!0),this.preserveSingleSpace(M||ve),this.print_string(this._ch),u&&O==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),A=!0):(this.eatWhitespace(),h++,this.indent())}else if(this._ch===")")h&&(h--,this.outdent()),A&&this._input.peek()===";"&&this._options.selector_separator_newline&&(A=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!u||A)&&h===0&&!d&&!p?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!u&&h===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&r.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(M),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),r.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var he=O==='"'||O==="'";this.preserveSingleSpace(he||M),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&S&&this._output.add_new_line()}var xe=this._output.get_code(_);return xe},e.exports.Beautifier=m},function(e,C,g){var v=g(6).Options;function c(s){v.call(this,s,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var i=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||i;var l=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var a=0;a<l.length;a++)l[a]!=="expand"?this.brace_style="collapse":this.brace_style=l[a]}c.prototype=new v,e.exports.Options=c}],R={};function K(e){var C=R[e];if(C!==void 0)return C.exports;var g=R[e]={exports:{}};return P[e](g,g.exports,K),g.exports}var N=K(15);I=N})();var W=I;!(Q=[],H=function(){return{css_beautify:W}}.apply(ne,Q),H!==void 0&&(Ne.exports=H))})()},Vhoy:function(Ne,ne,U){"use strict";U.d(ne,"d",function(){return W}),U.d(ne,"e",function(){return P}),U.d(ne,"c",function(){return R}),U.d(ne,"b",function(){return K}),U.d(ne,"a",function(){return N});var Q=U("MI8n");class H{constructor(){this._icons=new Map,this._onDidRegister=new Q.b}add(e){const C=this._icons.get(e.id);C?e.description?C.description=e.description:console.error(`Duplicate registration of codicon ${e.id}`):(this._icons.set(e.id,e),this._onDidRegister.fire(e))}get(e){return this._icons.get(e)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const I=new H,W=I;function P(e,C){return new K(e,C)}function R(e){return e?e.replace(/\$\((.*?)\)/g,(C,g)=>` ${g} `).trim():""}class K{constructor(e,C,g){this.id=e,this.definition=C,this.description=g,I.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var N;(function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9\\-]+",e.iconModifierExpression="~[A-Za-z]+";const C=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function g(s){if(s instanceof K)return["codicon","codicon-"+s.id];const i=C.exec(s.id);if(!i)return g(K.error);let[,l,a]=i;const n=["codicon","codicon-"+l];return a&&n.push("codicon-modifier-"+a.substr(1)),n}e.asClassNameArray=g;function v(s){return g(s).join(" ")}e.asClassName=v;function c(s){return"."+g(s).join(".")}e.asCSSSelector=c})(N||(N={})),function(e){e.add=new e("add",{fontCharacter:"\\ea60"}),e.plus=new e("plus",e.add.definition),e.gistNew=new e("gist-new",e.add.definition),e.repoCreate=new e("repo-create",e.add.definition),e.lightbulb=new e("lightbulb",{fontCharacter:"\\ea61"}),e.lightBulb=new e("light-bulb",{fontCharacter:"\\ea61"}),e.repo=new e("repo",{fontCharacter:"\\ea62"}),e.repoDelete=new e("repo-delete",{fontCharacter:"\\ea62"}),e.gistFork=new e("gist-fork",{fontCharacter:"\\ea63"}),e.repoForked=new e("repo-forked",{fontCharacter:"\\ea63"}),e.gitPullRequest=new e("git-pull-request",{fontCharacter:"\\ea64"}),e.gitPullRequestAbandoned=new e("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),e.recordKeys=new e("record-keys",{fontCharacter:"\\ea65"}),e.keyboard=new e("keyboard",{fontCharacter:"\\ea65"}),e.tag=new e("tag",{fontCharacter:"\\ea66"}),e.tagAdd=new e("tag-add",{fontCharacter:"\\ea66"}),e.tagRemove=new e("tag-remove",{fontCharacter:"\\ea66"}),e.person=new e("person",{fontCharacter:"\\ea67"}),e.personFollow=new e("person-follow",{fontCharacter:"\\ea67"}),e.personOutline=new e("person-outline",{fontCharacter:"\\ea67"}),e.personFilled=new e("person-filled",{fontCharacter:"\\ea67"}),e.gitBranch=new e("git-branch",{fontCharacter:"\\ea68"}),e.gitBranchCreate=new e("git-branch-create",{fontCharacter:"\\ea68"}),e.gitBranchDelete=new e("git-branch-delete",{fontCharacter:"\\ea68"}),e.sourceControl=new e("source-control",{fontCharacter:"\\ea68"}),e.mirror=new e("mirror",{fontCharacter:"\\ea69"}),e.mirrorPublic=new e("mirror-public",{fontCharacter:"\\ea69"}),e.star=new e("star",{fontCharacter:"\\ea6a"}),e.starAdd=new e("star-add",{fontCharacter:"\\ea6a"}),e.starDelete=new e("star-delete",{fontCharacter:"\\ea6a"}),e.starEmpty=new e("star-empty",{fontCharacter:"\\ea6a"}),e.comment=new e("comment",{fontCharacter:"\\ea6b"}),e.commentAdd=new e("comment-add",{fontCharacter:"\\ea6b"}),e.alert=new e("alert",{fontCharacter:"\\ea6c"}),e.warning=new e("warning",{fontCharacter:"\\ea6c"}),e.search=new e("search",{fontCharacter:"\\ea6d"}),e.searchSave=new e("search-save",{fontCharacter:"\\ea6d"}),e.logOut=new e("log-out",{fontCharacter:"\\ea6e"}),e.signOut=new e("sign-out",{fontCharacter:"\\ea6e"}),e.logIn=new e("log-in",{fontCharacter:"\\ea6f"}),e.signIn=new e("sign-in",{fontCharacter:"\\ea6f"}),e.eye=new e("eye",{fontCharacter:"\\ea70"}),e.eyeUnwatch=new e("eye-unwatch",{fontCharacter:"\\ea70"}),e.eyeWatch=new e("eye-watch",{fontCharacter:"\\ea70"}),e.circleFilled=new e("circle-filled",{fontCharacter:"\\ea71"}),e.primitiveDot=new e("primitive-dot",{fontCharacter:"\\ea71"}),e.closeDirty=new e("close-dirty",{fontCharacter:"\\ea71"}),e.debugBreakpoint=new e("debug-breakpoint",{fontCharacter:"\\ea71"}),e.debugBreakpointDisabled=new e("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),e.debugHint=new e("debug-hint",{fontCharacter:"\\ea71"}),e.primitiveSquare=new e("primitive-square",{fontCharacter:"\\ea72"}),e.edit=new e("edit",{fontCharacter:"\\ea73"}),e.pencil=new e("pencil",{fontCharacter:"\\ea73"}),e.info=new e("info",{fontCharacter:"\\ea74"}),e.issueOpened=new e("issue-opened",{fontCharacter:"\\ea74"}),e.gistPrivate=new e("gist-private",{fontCharacter:"\\ea75"}),e.gitForkPrivate=new e("git-fork-private",{fontCharacter:"\\ea75"}),e.lock=new e("lock",{fontCharacter:"\\ea75"}),e.mirrorPrivate=new e("mirror-private",{fontCharacter:"\\ea75"}),e.close=new e("close",{fontCharacter:"\\ea76"}),e.removeClose=new e("remove-close",{fontCharacter:"\\ea76"}),e.x=new e("x",{fontCharacter:"\\ea76"}),e.repoSync=new e("repo-sync",{fontCharacter:"\\ea77"}),e.sync=new e("sync",{fontCharacter:"\\ea77"}),e.clone=new e("clone",{fontCharacter:"\\ea78"}),e.desktopDownload=new e("desktop-download",{fontCharacter:"\\ea78"}),e.beaker=new e("beaker",{fontCharacter:"\\ea79"}),e.microscope=new e("microscope",{fontCharacter:"\\ea79"}),e.vm=new e("vm",{fontCharacter:"\\ea7a"}),e.deviceDesktop=new e("device-desktop",{fontCharacter:"\\ea7a"}),e.file=new e("file",{fontCharacter:"\\ea7b"}),e.fileText=new e("file-text",{fontCharacter:"\\ea7b"}),e.more=new e("more",{fontCharacter:"\\ea7c"}),e.ellipsis=new e("ellipsis",{fontCharacter:"\\ea7c"}),e.kebabHorizontal=new e("kebab-horizontal",{fontCharacter:"\\ea7c"}),e.mailReply=new e("mail-reply",{fontCharacter:"\\ea7d"}),e.reply=new e("reply",{fontCharacter:"\\ea7d"}),e.organization=new e("organization",{fontCharacter:"\\ea7e"}),e.organizationFilled=new e("organization-filled",{fontCharacter:"\\ea7e"}),e.organizationOutline=new e("organization-outline",{fontCharacter:"\\ea7e"}),e.newFile=new e("new-file",{fontCharacter:"\\ea7f"}),e.fileAdd=new e("file-add",{fontCharacter:"\\ea7f"}),e.newFolder=new e("new-folder",{fontCharacter:"\\ea80"}),e.fileDirectoryCreate=new e("file-directory-create",{fontCharacter:"\\ea80"}),e.trash=new e("trash",{fontCharacter:"\\ea81"}),e.trashcan=new e("trashcan",{fontCharacter:"\\ea81"}),e.history=new e("history",{fontCharacter:"\\ea82"}),e.clock=new e("clock",{fontCharacter:"\\ea82"}),e.folder=new e("folder",{fontCharacter:"\\ea83"}),e.fileDirectory=new e("file-directory",{fontCharacter:"\\ea83"}),e.symbolFolder=new e("symbol-folder",{fontCharacter:"\\ea83"}),e.logoGithub=new e("logo-github",{fontCharacter:"\\ea84"}),e.markGithub=new e("mark-github",{fontCharacter:"\\ea84"}),e.github=new e("github",{fontCharacter:"\\ea84"}),e.terminal=new e("terminal",{fontCharacter:"\\ea85"}),e.console=new e("console",{fontCharacter:"\\ea85"}),e.repl=new e("repl",{fontCharacter:"\\ea85"}),e.zap=new e("zap",{fontCharacter:"\\ea86"}),e.symbolEvent=new e("symbol-event",{fontCharacter:"\\ea86"}),e.error=new e("error",{fontCharacter:"\\ea87"}),e.stop=new e("stop",{fontCharacter:"\\ea87"}),e.variable=new e("variable",{fontCharacter:"\\ea88"}),e.symbolVariable=new e("symbol-variable",{fontCharacter:"\\ea88"}),e.array=new e("array",{fontCharacter:"\\ea8a"}),e.symbolArray=new e("symbol-array",{fontCharacter:"\\ea8a"}),e.symbolModule=new e("symbol-module",{fontCharacter:"\\ea8b"}),e.symbolPackage=new e("symbol-package",{fontCharacter:"\\ea8b"}),e.symbolNamespace=new e("symbol-namespace",{fontCharacter:"\\ea8b"}),e.symbolObject=new e("symbol-object",{fontCharacter:"\\ea8b"}),e.symbolMethod=new e("symbol-method",{fontCharacter:"\\ea8c"}),e.symbolFunction=new e("symbol-function",{fontCharacter:"\\ea8c"}),e.symbolConstructor=new e("symbol-constructor",{fontCharacter:"\\ea8c"}),e.symbolBoolean=new e("symbol-boolean",{fontCharacter:"\\ea8f"}),e.symbolNull=new e("symbol-null",{fontCharacter:"\\ea8f"}),e.symbolNumeric=new e("symbol-numeric",{fontCharacter:"\\ea90"}),e.symbolNumber=new e("symbol-number",{fontCharacter:"\\ea90"}),e.symbolStructure=new e("symbol-structure",{fontCharacter:"\\ea91"}),e.symbolStruct=new e("symbol-struct",{fontCharacter:"\\ea91"}),e.symbolParameter=new e("symbol-parameter",{fontCharacter:"\\ea92"}),e.symbolTypeParameter=new e("symbol-type-parameter",{fontCharacter:"\\ea92"}),e.symbolKey=new e("symbol-key",{fontCharacter:"\\ea93"}),e.symbolText=new e("symbol-text",{fontCharacter:"\\ea93"}),e.symbolReference=new e("symbol-reference",{fontCharacter:"\\ea94"}),e.goToFile=new e("go-to-file",{fontCharacter:"\\ea94"}),e.symbolEnum=new e("symbol-enum",{fontCharacter:"\\ea95"}),e.symbolValue=new e("symbol-value",{fontCharacter:"\\ea95"}),e.symbolRuler=new e("symbol-ruler",{fontCharacter:"\\ea96"}),e.symbolUnit=new e("symbol-unit",{fontCharacter:"\\ea96"}),e.activateBreakpoints=new e("activate-breakpoints",{fontCharacter:"\\ea97"}),e.archive=new e("archive",{fontCharacter:"\\ea98"}),e.arrowBoth=new e("arrow-both",{fontCharacter:"\\ea99"}),e.arrowDown=new e("arrow-down",{fontCharacter:"\\ea9a"}),e.arrowLeft=new e("arrow-left",{fontCharacter:"\\ea9b"}),e.arrowRight=new e("arrow-right",{fontCharacter:"\\ea9c"}),e.arrowSmallDown=new e("arrow-small-down",{fontCharacter:"\\ea9d"}),e.arrowSmallLeft=new e("arrow-small-left",{fontCharacter:"\\ea9e"}),e.arrowSmallRight=new e("arrow-small-right",{fontCharacter:"\\ea9f"}),e.arrowSmallUp=new e("arrow-small-up",{fontCharacter:"\\eaa0"}),e.arrowUp=new e("arrow-up",{fontCharacter:"\\eaa1"}),e.bell=new e("bell",{fontCharacter:"\\eaa2"}),e.bold=new e("bold",{fontCharacter:"\\eaa3"}),e.book=new e("book",{fontCharacter:"\\eaa4"}),e.bookmark=new e("bookmark",{fontCharacter:"\\eaa5"}),e.debugBreakpointConditionalUnverified=new e("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),e.debugBreakpointConditional=new e("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),e.debugBreakpointConditionalDisabled=new e("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),e.debugBreakpointDataUnverified=new e("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),e.debugBreakpointData=new e("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),e.debugBreakpointDataDisabled=new e("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),e.debugBreakpointLogUnverified=new e("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),e.debugBreakpointLog=new e("debug-breakpoint-log",{fontCharacter:"\\eaab"}),e.debugBreakpointLogDisabled=new e("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),e.briefcase=new e("briefcase",{fontCharacter:"\\eaac"}),e.broadcast=new e("broadcast",{fontCharacter:"\\eaad"}),e.browser=new e("browser",{fontCharacter:"\\eaae"}),e.bug=new e("bug",{fontCharacter:"\\eaaf"}),e.calendar=new e("calendar",{fontCharacter:"\\eab0"}),e.caseSensitive=new e("case-sensitive",{fontCharacter:"\\eab1"}),e.check=new e("check",{fontCharacter:"\\eab2"}),e.checklist=new e("checklist",{fontCharacter:"\\eab3"}),e.chevronDown=new e("chevron-down",{fontCharacter:"\\eab4"}),e.dropDownButton=new e("drop-down-button",e.chevronDown.definition),e.chevronLeft=new e("chevron-left",{fontCharacter:"\\eab5"}),e.chevronRight=new e("chevron-right",{fontCharacter:"\\eab6"}),e.chevronUp=new e("chevron-up",{fontCharacter:"\\eab7"}),e.chromeClose=new e("chrome-close",{fontCharacter:"\\eab8"}),e.chromeMaximize=new e("chrome-maximize",{fontCharacter:"\\eab9"}),e.chromeMinimize=new e("chrome-minimize",{fontCharacter:"\\eaba"}),e.chromeRestore=new e("chrome-restore",{fontCharacter:"\\eabb"}),e.circleOutline=new e("circle-outline",{fontCharacter:"\\eabc"}),e.debugBreakpointUnverified=new e("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),e.circleSlash=new e("circle-slash",{fontCharacter:"\\eabd"}),e.circuitBoard=new e("circuit-board",{fontCharacter:"\\eabe"}),e.clearAll=new e("clear-all",{fontCharacter:"\\eabf"}),e.clippy=new e("clippy",{fontCharacter:"\\eac0"}),e.closeAll=new e("close-all",{fontCharacter:"\\eac1"}),e.cloudDownload=new e("cloud-download",{fontCharacter:"\\eac2"}),e.cloudUpload=new e("cloud-upload",{fontCharacter:"\\eac3"}),e.code=new e("code",{fontCharacter:"\\eac4"}),e.collapseAll=new e("collapse-all",{fontCharacter:"\\eac5"}),e.colorMode=new e("color-mode",{fontCharacter:"\\eac6"}),e.commentDiscussion=new e("comment-discussion",{fontCharacter:"\\eac7"}),e.compareChanges=new e("compare-changes",{fontCharacter:"\\eafd"}),e.creditCard=new e("credit-card",{fontCharacter:"\\eac9"}),e.dash=new e("dash",{fontCharacter:"\\eacc"}),e.dashboard=new e("dashboard",{fontCharacter:"\\eacd"}),e.database=new e("database",{fontCharacter:"\\eace"}),e.debugContinue=new e("debug-continue",{fontCharacter:"\\eacf"}),e.debugDisconnect=new e("debug-disconnect",{fontCharacter:"\\ead0"}),e.debugPause=new e("debug-pause",{fontCharacter:"\\ead1"}),e.debugRestart=new e("debug-restart",{fontCharacter:"\\ead2"}),e.debugStart=new e("debug-start",{fontCharacter:"\\ead3"}),e.debugStepInto=new e("debug-step-into",{fontCharacter:"\\ead4"}),e.debugStepOut=new e("debug-step-out",{fontCharacter:"\\ead5"}),e.debugStepOver=new e("debug-step-over",{fontCharacter:"\\ead6"}),e.debugStop=new e("debug-stop",{fontCharacter:"\\ead7"}),e.debug=new e("debug",{fontCharacter:"\\ead8"}),e.deviceCameraVideo=new e("device-camera-video",{fontCharacter:"\\ead9"}),e.deviceCamera=new e("device-camera",{fontCharacter:"\\eada"}),e.deviceMobile=new e("device-mobile",{fontCharacter:"\\eadb"}),e.diffAdded=new e("diff-added",{fontCharacter:"\\eadc"}),e.diffIgnored=new e("diff-ignored",{fontCharacter:"\\eadd"}),e.diffModified=new e("diff-modified",{fontCharacter:"\\eade"}),e.diffRemoved=new e("diff-removed",{fontCharacter:"\\eadf"}),e.diffRenamed=new e("diff-renamed",{fontCharacter:"\\eae0"}),e.diff=new e("diff",{fontCharacter:"\\eae1"}),e.discard=new e("discard",{fontCharacter:"\\eae2"}),e.editorLayout=new e("editor-layout",{fontCharacter:"\\eae3"}),e.emptyWindow=new e("empty-window",{fontCharacter:"\\eae4"}),e.exclude=new e("exclude",{fontCharacter:"\\eae5"}),e.extensions=new e("extensions",{fontCharacter:"\\eae6"}),e.eyeClosed=new e("eye-closed",{fontCharacter:"\\eae7"}),e.fileBinary=new e("file-binary",{fontCharacter:"\\eae8"}),e.fileCode=new e("file-code",{fontCharacter:"\\eae9"}),e.fileMedia=new e("file-media",{fontCharacter:"\\eaea"}),e.filePdf=new e("file-pdf",{fontCharacter:"\\eaeb"}),e.fileSubmodule=new e("file-submodule",{fontCharacter:"\\eaec"}),e.fileSymlinkDirectory=new e("file-symlink-directory",{fontCharacter:"\\eaed"}),e.fileSymlinkFile=new e("file-symlink-file",{fontCharacter:"\\eaee"}),e.fileZip=new e("file-zip",{fontCharacter:"\\eaef"}),e.files=new e("files",{fontCharacter:"\\eaf0"}),e.filter=new e("filter",{fontCharacter:"\\eaf1"}),e.flame=new e("flame",{fontCharacter:"\\eaf2"}),e.foldDown=new e("fold-down",{fontCharacter:"\\eaf3"}),e.foldUp=new e("fold-up",{fontCharacter:"\\eaf4"}),e.fold=new e("fold",{fontCharacter:"\\eaf5"}),e.folderActive=new e("folder-active",{fontCharacter:"\\eaf6"}),e.folderOpened=new e("folder-opened",{fontCharacter:"\\eaf7"}),e.gear=new e("gear",{fontCharacter:"\\eaf8"}),e.gift=new e("gift",{fontCharacter:"\\eaf9"}),e.gistSecret=new e("gist-secret",{fontCharacter:"\\eafa"}),e.gist=new e("gist",{fontCharacter:"\\eafb"}),e.gitCommit=new e("git-commit",{fontCharacter:"\\eafc"}),e.gitCompare=new e("git-compare",{fontCharacter:"\\eafd"}),e.gitMerge=new e("git-merge",{fontCharacter:"\\eafe"}),e.githubAction=new e("github-action",{fontCharacter:"\\eaff"}),e.githubAlt=new e("github-alt",{fontCharacter:"\\eb00"}),e.globe=new e("globe",{fontCharacter:"\\eb01"}),e.grabber=new e("grabber",{fontCharacter:"\\eb02"}),e.graph=new e("graph",{fontCharacter:"\\eb03"}),e.gripper=new e("gripper",{fontCharacter:"\\eb04"}),e.heart=new e("heart",{fontCharacter:"\\eb05"}),e.home=new e("home",{fontCharacter:"\\eb06"}),e.horizontalRule=new e("horizontal-rule",{fontCharacter:"\\eb07"}),e.hubot=new e("hubot",{fontCharacter:"\\eb08"}),e.inbox=new e("inbox",{fontCharacter:"\\eb09"}),e.issueClosed=new e("issue-closed",{fontCharacter:"\\eba4"}),e.issueReopened=new e("issue-reopened",{fontCharacter:"\\eb0b"}),e.issues=new e("issues",{fontCharacter:"\\eb0c"}),e.italic=new e("italic",{fontCharacter:"\\eb0d"}),e.jersey=new e("jersey",{fontCharacter:"\\eb0e"}),e.json=new e("json",{fontCharacter:"\\eb0f"}),e.kebabVertical=new e("kebab-vertical",{fontCharacter:"\\eb10"}),e.key=new e("key",{fontCharacter:"\\eb11"}),e.law=new e("law",{fontCharacter:"\\eb12"}),e.lightbulbAutofix=new e("lightbulb-autofix",{fontCharacter:"\\eb13"}),e.linkExternal=new e("link-external",{fontCharacter:"\\eb14"}),e.link=new e("link",{fontCharacter:"\\eb15"}),e.listOrdered=new e("list-ordered",{fontCharacter:"\\eb16"}),e.listUnordered=new e("list-unordered",{fontCharacter:"\\eb17"}),e.liveShare=new e("live-share",{fontCharacter:"\\eb18"}),e.loading=new e("loading",{fontCharacter:"\\eb19"}),e.location=new e("location",{fontCharacter:"\\eb1a"}),e.mailRead=new e("mail-read",{fontCharacter:"\\eb1b"}),e.mail=new e("mail",{fontCharacter:"\\eb1c"}),e.markdown=new e("markdown",{fontCharacter:"\\eb1d"}),e.megaphone=new e("megaphone",{fontCharacter:"\\eb1e"}),e.mention=new e("mention",{fontCharacter:"\\eb1f"}),e.milestone=new e("milestone",{fontCharacter:"\\eb20"}),e.mortarBoard=new e("mortar-board",{fontCharacter:"\\eb21"}),e.move=new e("move",{fontCharacter:"\\eb22"}),e.multipleWindows=new e("multiple-windows",{fontCharacter:"\\eb23"}),e.mute=new e("mute",{fontCharacter:"\\eb24"}),e.noNewline=new e("no-newline",{fontCharacter:"\\eb25"}),e.note=new e("note",{fontCharacter:"\\eb26"}),e.octoface=new e("octoface",{fontCharacter:"\\eb27"}),e.openPreview=new e("open-preview",{fontCharacter:"\\eb28"}),e.package_=new e("package",{fontCharacter:"\\eb29"}),e.paintcan=new e("paintcan",{fontCharacter:"\\eb2a"}),e.pin=new e("pin",{fontCharacter:"\\eb2b"}),e.play=new e("play",{fontCharacter:"\\eb2c"}),e.run=new e("run",{fontCharacter:"\\eb2c"}),e.plug=new e("plug",{fontCharacter:"\\eb2d"}),e.preserveCase=new e("preserve-case",{fontCharacter:"\\eb2e"}),e.preview=new e("preview",{fontCharacter:"\\eb2f"}),e.project=new e("project",{fontCharacter:"\\eb30"}),e.pulse=new e("pulse",{fontCharacter:"\\eb31"}),e.question=new e("question",{fontCharacter:"\\eb32"}),e.quote=new e("quote",{fontCharacter:"\\eb33"}),e.radioTower=new e("radio-tower",{fontCharacter:"\\eb34"}),e.reactions=new e("reactions",{fontCharacter:"\\eb35"}),e.references=new e("references",{fontCharacter:"\\eb36"}),e.refresh=new e("refresh",{fontCharacter:"\\eb37"}),e.regex=new e("regex",{fontCharacter:"\\eb38"}),e.remoteExplorer=new e("remote-explorer",{fontCharacter:"\\eb39"}),e.remote=new e("remote",{fontCharacter:"\\eb3a"}),e.remove=new e("remove",{fontCharacter:"\\eb3b"}),e.replaceAll=new e("replace-all",{fontCharacter:"\\eb3c"}),e.replace=new e("replace",{fontCharacter:"\\eb3d"}),e.repoClone=new e("repo-clone",{fontCharacter:"\\eb3e"}),e.repoForcePush=new e("repo-force-push",{fontCharacter:"\\eb3f"}),e.repoPull=new e("repo-pull",{fontCharacter:"\\eb40"}),e.repoPush=new e("repo-push",{fontCharacter:"\\eb41"}),e.report=new e("report",{fontCharacter:"\\eb42"}),e.requestChanges=new e("request-changes",{fontCharacter:"\\eb43"}),e.rocket=new e("rocket",{fontCharacter:"\\eb44"}),e.rootFolderOpened=new e("root-folder-opened",{fontCharacter:"\\eb45"}),e.rootFolder=new e("root-folder",{fontCharacter:"\\eb46"}),e.rss=new e("rss",{fontCharacter:"\\eb47"}),e.ruby=new e("ruby",{fontCharacter:"\\eb48"}),e.saveAll=new e("save-all",{fontCharacter:"\\eb49"}),e.saveAs=new e("save-as",{fontCharacter:"\\eb4a"}),e.save=new e("save",{fontCharacter:"\\eb4b"}),e.screenFull=new e("screen-full",{fontCharacter:"\\eb4c"}),e.screenNormal=new e("screen-normal",{fontCharacter:"\\eb4d"}),e.searchStop=new e("search-stop",{fontCharacter:"\\eb4e"}),e.server=new e("server",{fontCharacter:"\\eb50"}),e.settingsGear=new e("settings-gear",{fontCharacter:"\\eb51"}),e.settings=new e("settings",{fontCharacter:"\\eb52"}),e.shield=new e("shield",{fontCharacter:"\\eb53"}),e.smiley=new e("smiley",{fontCharacter:"\\eb54"}),e.sortPrecedence=new e("sort-precedence",{fontCharacter:"\\eb55"}),e.splitHorizontal=new e("split-horizontal",{fontCharacter:"\\eb56"}),e.splitVertical=new e("split-vertical",{fontCharacter:"\\eb57"}),e.squirrel=new e("squirrel",{fontCharacter:"\\eb58"}),e.starFull=new e("star-full",{fontCharacter:"\\eb59"}),e.starHalf=new e("star-half",{fontCharacter:"\\eb5a"}),e.symbolClass=new e("symbol-class",{fontCharacter:"\\eb5b"}),e.symbolColor=new e("symbol-color",{fontCharacter:"\\eb5c"}),e.symbolConstant=new e("symbol-constant",{fontCharacter:"\\eb5d"}),e.symbolEnumMember=new e("symbol-enum-member",{fontCharacter:"\\eb5e"}),e.symbolField=new e("symbol-field",{fontCharacter:"\\eb5f"}),e.symbolFile=new e("symbol-file",{fontCharacter:"\\eb60"}),e.symbolInterface=new e("symbol-interface",{fontCharacter:"\\eb61"}),e.symbolKeyword=new e("symbol-keyword",{fontCharacter:"\\eb62"}),e.symbolMisc=new e("symbol-misc",{fontCharacter:"\\eb63"}),e.symbolOperator=new e("symbol-operator",{fontCharacter:"\\eb64"}),e.symbolProperty=new e("symbol-property",{fontCharacter:"\\eb65"}),e.wrench=new e("wrench",{fontCharacter:"\\eb65"}),e.wrenchSubaction=new e("wrench-subaction",{fontCharacter:"\\eb65"}),e.symbolSnippet=new e("symbol-snippet",{fontCharacter:"\\eb66"}),e.tasklist=new e("tasklist",{fontCharacter:"\\eb67"}),e.telescope=new e("telescope",{fontCharacter:"\\eb68"}),e.textSize=new e("text-size",{fontCharacter:"\\eb69"}),e.threeBars=new e("three-bars",{fontCharacter:"\\eb6a"}),e.thumbsdown=new e("thumbsdown",{fontCharacter:"\\eb6b"}),e.thumbsup=new e("thumbsup",{fontCharacter:"\\eb6c"}),e.tools=new e("tools",{fontCharacter:"\\eb6d"}),e.triangleDown=new e("triangle-down",{fontCharacter:"\\eb6e"}),e.triangleLeft=new e("triangle-left",{fontCharacter:"\\eb6f"}),e.triangleRight=new e("triangle-right",{fontCharacter:"\\eb70"}),e.triangleUp=new e("triangle-up",{fontCharacter:"\\eb71"}),e.twitter=new e("twitter",{fontCharacter:"\\eb72"}),e.unfold=new e("unfold",{fontCharacter:"\\eb73"}),e.unlock=new e("unlock",{fontCharacter:"\\eb74"}),e.unmute=new e("unmute",{fontCharacter:"\\eb75"}),e.unverified=new e("unverified",{fontCharacter:"\\eb76"}),e.verified=new e("verified",{fontCharacter:"\\eb77"}),e.versions=new e("versions",{fontCharacter:"\\eb78"}),e.vmActive=new e("vm-active",{fontCharacter:"\\eb79"}),e.vmOutline=new e("vm-outline",{fontCharacter:"\\eb7a"}),e.vmRunning=new e("vm-running",{fontCharacter:"\\eb7b"}),e.watch=new e("watch",{fontCharacter:"\\eb7c"}),e.whitespace=new e("whitespace",{fontCharacter:"\\eb7d"}),e.wholeWord=new e("whole-word",{fontCharacter:"\\eb7e"}),e.window=new e("window",{fontCharacter:"\\eb7f"}),e.wordWrap=new e("word-wrap",{fontCharacter:"\\eb80"}),e.zoomIn=new e("zoom-in",{fontCharacter:"\\eb81"}),e.zoomOut=new e("zoom-out",{fontCharacter:"\\eb82"}),e.listFilter=new e("list-filter",{fontCharacter:"\\eb83"}),e.listFlat=new e("list-flat",{fontCharacter:"\\eb84"}),e.listSelection=new e("list-selection",{fontCharacter:"\\eb85"}),e.selection=new e("selection",{fontCharacter:"\\eb85"}),e.listTree=new e("list-tree",{fontCharacter:"\\eb86"}),e.debugBreakpointFunctionUnverified=new e("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),e.debugBreakpointFunction=new e("debug-breakpoint-function",{fontCharacter:"\\eb88"}),e.debugBreakpointFunctionDisabled=new e("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),e.debugStackframeActive=new e("debug-stackframe-active",{fontCharacter:"\\eb89"}),e.debugStackframeDot=new e("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),e.debugStackframe=new e("debug-stackframe",{fontCharacter:"\\eb8b"}),e.debugStackframeFocused=new e("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),e.debugBreakpointUnsupported=new e("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),e.symbolString=new e("symbol-string",{fontCharacter:"\\eb8d"}),e.debugReverseContinue=new e("debug-reverse-continue",{fontCharacter:"\\eb8e"}),e.debugStepBack=new e("debug-step-back",{fontCharacter:"\\eb8f"}),e.debugRestartFrame=new e("debug-restart-frame",{fontCharacter:"\\eb90"}),e.callIncoming=new e("call-incoming",{fontCharacter:"\\eb92"}),e.callOutgoing=new e("call-outgoing",{fontCharacter:"\\eb93"}),e.menu=new e("menu",{fontCharacter:"\\eb94"}),e.expandAll=new e("expand-all",{fontCharacter:"\\eb95"}),e.feedback=new e("feedback",{fontCharacter:"\\eb96"}),e.groupByRefType=new e("group-by-ref-type",{fontCharacter:"\\eb97"}),e.ungroupByRefType=new e("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),e.account=new e("account",{fontCharacter:"\\eb99"}),e.bellDot=new e("bell-dot",{fontCharacter:"\\eb9a"}),e.debugConsole=new e("debug-console",{fontCharacter:"\\eb9b"}),e.library=new e("library",{fontCharacter:"\\eb9c"}),e.output=new e("output",{fontCharacter:"\\eb9d"}),e.runAll=new e("run-all",{fontCharacter:"\\eb9e"}),e.syncIgnored=new e("sync-ignored",{fontCharacter:"\\eb9f"}),e.pinned=new e("pinned",{fontCharacter:"\\eba0"}),e.githubInverted=new e("github-inverted",{fontCharacter:"\\eba1"}),e.debugAlt=new e("debug-alt",{fontCharacter:"\\eb91"}),e.serverProcess=new e("server-process",{fontCharacter:"\\eba2"}),e.serverEnvironment=new e("server-environment",{fontCharacter:"\\eba3"}),e.pass=new e("pass",{fontCharacter:"\\eba4"}),e.stopCircle=new e("stop-circle",{fontCharacter:"\\eba5"}),e.playCircle=new e("play-circle",{fontCharacter:"\\eba6"}),e.record=new e("record",{fontCharacter:"\\eba7"}),e.debugAltSmall=new e("debug-alt-small",{fontCharacter:"\\eba8"}),e.vmConnect=new e("vm-connect",{fontCharacter:"\\eba9"}),e.cloud=new e("cloud",{fontCharacter:"\\ebaa"}),e.merge=new e("merge",{fontCharacter:"\\ebab"}),e.exportIcon=new e("export",{fontCharacter:"\\ebac"}),e.graphLeft=new e("graph-left",{fontCharacter:"\\ebad"}),e.magnet=new e("magnet",{fontCharacter:"\\ebae"}),e.notebook=new e("notebook",{fontCharacter:"\\ebaf"}),e.redo=new e("redo",{fontCharacter:"\\ebb0"}),e.checkAll=new e("check-all",{fontCharacter:"\\ebb1"}),e.pinnedDirty=new e("pinned-dirty",{fontCharacter:"\\ebb2"}),e.passFilled=new e("pass-filled",{fontCharacter:"\\ebb3"}),e.circleLargeFilled=new e("circle-large-filled",{fontCharacter:"\\ebb4"}),e.circleLargeOutline=new e("circle-large-outline",{fontCharacter:"\\ebb5"}),e.combine=new e("combine",{fontCharacter:"\\ebb6"}),e.gather=new e("gather",{fontCharacter:"\\ebb6"}),e.table=new e("table",{fontCharacter:"\\ebb7"}),e.variableGroup=new e("variable-group",{fontCharacter:"\\ebb8"}),e.typeHierarchy=new e("type-hierarchy",{fontCharacter:"\\ebb9"}),e.typeHierarchySub=new e("type-hierarchy-sub",{fontCharacter:"\\ebba"}),e.typeHierarchySuper=new e("type-hierarchy-super",{fontCharacter:"\\ebbb"}),e.gitPullRequestCreate=new e("git-pull-request-create",{fontCharacter:"\\ebbc"}),e.runAbove=new e("run-above",{fontCharacter:"\\ebbd"}),e.runBelow=new e("run-below",{fontCharacter:"\\ebbe"}),e.notebookTemplate=new e("notebook-template",{fontCharacter:"\\ebbf"}),e.debugRerun=new e("debug-rerun",{fontCharacter:"\\ebc0"}),e.workspaceTrusted=new e("workspace-trusted",{fontCharacter:"\\ebc1"}),e.workspaceUntrusted=new e("workspace-untrusted",{fontCharacter:"\\ebc2"}),e.workspaceUnspecified=new e("workspace-unspecified",{fontCharacter:"\\ebc3"}),e.terminalCmd=new e("terminal-cmd",{fontCharacter:"\\ebc4"}),e.terminalDebian=new e("terminal-debian",{fontCharacter:"\\ebc5"}),e.terminalLinux=new e("terminal-linux",{fontCharacter:"\\ebc6"}),e.terminalPowershell=new e("terminal-powershell",{fontCharacter:"\\ebc7"}),e.terminalTmux=new e("terminal-tmux",{fontCharacter:"\\ebc8"}),e.terminalUbuntu=new e("terminal-ubuntu",{fontCharacter:"\\ebc9"}),e.terminalBash=new e("terminal-bash",{fontCharacter:"\\ebca"}),e.arrowSwap=new e("arrow-swap",{fontCharacter:"\\ebcb"}),e.copy=new e("copy",{fontCharacter:"\\ebcc"}),e.personAdd=new e("person-add",{fontCharacter:"\\ebcd"}),e.filterFilled=new e("filter-filled",{fontCharacter:"\\ebce"}),e.wand=new e("wand",{fontCharacter:"\\ebcf"}),e.debugLineByLine=new e("debug-line-by-line",{fontCharacter:"\\ebd0"}),e.inspect=new e("inspect",{fontCharacter:"\\ebd1"}),e.layers=new e("layers",{fontCharacter:"\\ebd2"}),e.layersDot=new e("layers-dot",{fontCharacter:"\\ebd3"}),e.layersActive=new e("layers-active",{fontCharacter:"\\ebd4"}),e.compass=new e("compass",{fontCharacter:"\\ebd5"}),e.compassDot=new e("compass-dot",{fontCharacter:"\\ebd6"}),e.compassActive=new e("compass-active",{fontCharacter:"\\ebd7"}),e.azure=new e("azure",{fontCharacter:"\\ebd8"}),e.issueDraft=new e("issue-draft",{fontCharacter:"\\ebd9"}),e.gitPullRequestClosed=new e("git-pull-request-closed",{fontCharacter:"\\ebda"}),e.gitPullRequestDraft=new e("git-pull-request-draft",{fontCharacter:"\\ebdb"}),e.debugAll=new e("debug-all",{fontCharacter:"\\ebdc"}),e.debugCoverage=new e("debug-coverage",{fontCharacter:"\\ebdd"}),e.runErrors=new e("run-errors",{fontCharacter:"\\ebde"}),e.folderLibrary=new e("folder-library",{fontCharacter:"\\ebdf"}),e.debugContinueSmall=new e("debug-continue-small",{fontCharacter:"\\ebe0"}),e.beakerStop=new e("beaker-stop",{fontCharacter:"\\ebe1"}),e.graphLine=new e("graph-line",{fontCharacter:"\\ebe2"}),e.graphScatter=new e("graph-scatter",{fontCharacter:"\\ebe3"}),e.pieChart=new e("pie-chart",{fontCharacter:"\\ebe4"}),e.bracket=new e("bracket",e.json.definition),e.bracketDot=new e("bracket-dot",{fontCharacter:"\\ebe5"}),e.bracketError=new e("bracket-error",{fontCharacter:"\\ebe6"}),e.lockSmall=new e("lock-small",{fontCharacter:"\\ebe7"}),e.azureDevops=new e("azure-devops",{fontCharacter:"\\ebe8"}),e.verifiedFilled=new e("verified-filled",{fontCharacter:"\\ebe9"})}(K||(K={}))},WaYH:function(Ne,ne,U){"use strict";var Q=U("rePB"),H=U("Ff2n"),I=U("VTBJ"),W=U("1OyB"),P=U("vuIU"),R=U("JX7q"),K=U("Ji7U"),N=U("LK+K"),e=U("q1tI"),C=U("TSYQ"),g=U.n(C),v=U("sboe"),c=U("OZM5"),s=function(T){var _=T.prefixCls,f=T.level,h=T.isStart,o=T.isEnd;if(!f)return null;for(var u="".concat(_,"-indent-unit"),b=[],p=0;p<f;p+=1){var d;b.push(e.createElement("span",{key:p,className:g()(u,(d={},Object(Q.a)(d,"".concat(u,"-start"),h[p+1]),Object(Q.a)(d,"".concat(u,"-end"),o[p+1]),Object(Q.a)(d,"".concat(u,"-end-first-level"),!p&&o[0]),d))}))}return e.createElement("span",{"aria-hidden":"true",className:"".concat(_,"-indent")},b)},i=s,l=U("815F"),a="open",n="close",r="---",t=function(m){Object(K.a)(_,m);var T=Object(N.a)(_);function _(){var f;return Object(W.a)(this,_),f=T.apply(this,arguments),f.state={dragNodeHighlight:!1},f.onSelectorClick=function(h){var o=f.props.context.onNodeClick;o(h,Object(l.b)(f.props)),f.isSelectable()?f.onSelect(h):f.onCheck(h)},f.onSelectorDoubleClick=function(h){var o=f.props.context.onNodeDoubleClick;o(h,Object(l.b)(f.props))},f.onSelect=function(h){if(f.isDisabled())return;var o=f.props.context.onNodeSelect;h.preventDefault(),o(h,Object(l.b)(f.props))},f.onCheck=function(h){if(f.isDisabled())return;var o=f.props,u=o.disableCheckbox,b=o.checked,p=f.props.context.onNodeCheck;if(!f.isCheckable()||u)return;h.preventDefault();var d=!b;p(h,Object(l.b)(f.props),d)},f.onMouseEnter=function(h){var o=f.props.context.onNodeMouseEnter;o(h,Object(l.b)(f.props))},f.onMouseLeave=function(h){var o=f.props.context.onNodeMouseLeave;o(h,Object(l.b)(f.props))},f.onContextMenu=function(h){var o=f.props.context.onNodeContextMenu;o(h,Object(l.b)(f.props))},f.onDragStart=function(h){var o=f.props.context.onNodeDragStart;h.stopPropagation(),f.setState({dragNodeHighlight:!0}),o(h,Object(R.a)(f));try{h.dataTransfer.setData("text/plain","")}catch(u){}},f.onDragEnter=function(h){var o=f.props.context.onNodeDragEnter;h.preventDefault(),h.stopPropagation(),o(h,Object(R.a)(f))},f.onDragOver=function(h){var o=f.props.context.onNodeDragOver;h.preventDefault(),h.stopPropagation(),o(h,Object(R.a)(f))},f.onDragLeave=function(h){var o=f.props.context.onNodeDragLeave;h.stopPropagation(),o(h,Object(R.a)(f))},f.onDragEnd=function(h){var o=f.props.context.onNodeDragEnd;h.stopPropagation(),f.setState({dragNodeHighlight:!1}),o(h,Object(R.a)(f))},f.onDrop=function(h){var o=f.props.context.onNodeDrop;h.preventDefault(),h.stopPropagation(),f.setState({dragNodeHighlight:!1}),o(h,Object(R.a)(f))},f.onExpand=function(h){var o=f.props.context.onNodeExpand;o(h,Object(l.b)(f.props))},f.setSelectHandle=function(h){f.selectHandle=h},f.getNodeState=function(){var h=f.props.expanded;return f.isLeaf()?null:h?a:n},f.hasChildren=function(){var h=f.props.eventKey,o=f.props.context.keyEntities,u=o[h]||{},b=u.children;return!!(b||[]).length},f.isLeaf=function(){var h=f.props,o=h.isLeaf,u=h.loaded,b=f.props.context.loadData,p=f.hasChildren();return o===!1?!1:o||!b&&!p||b&&u&&!p},f.isDisabled=function(){var h=f.props.disabled,o=f.props.context.disabled;return!!(o||h)},f.isCheckable=function(){var h=f.props.checkable,o=f.props.context.checkable;return!o||h===!1?!1:o},f.syncLoadData=function(h){var o=h.expanded,u=h.loading,b=h.loaded,p=f.props.context,d=p.loadData,A=p.onNodeLoad;if(u)return;d&&o&&!f.isLeaf()&&(!f.hasChildren()&&!b&&A(Object(l.b)(f.props)))},f.renderSwitcher=function(){var h=f.props,o=h.expanded,u=h.switcherIcon,b=f.props.context,p=b.prefixCls,d=b.switcherIcon,A=u||d;if(f.isLeaf())return e.createElement("span",{className:g()("".concat(p,"-switcher"),"".concat(p,"-switcher-noop"))},typeof A=="function"?A(Object(I.a)(Object(I.a)({},f.props),{},{isLeaf:!0})):A);var D=g()("".concat(p,"-switcher"),"".concat(p,"-switcher_").concat(o?a:n));return e.createElement("span",{onClick:f.onExpand,className:D},typeof A=="function"?A(Object(I.a)(Object(I.a)({},f.props),{},{isLeaf:!1})):A)},f.renderCheckbox=function(){var h=f.props,o=h.checked,u=h.halfChecked,b=h.disableCheckbox,p=f.props.context.prefixCls,d=f.isDisabled(),A=f.isCheckable();if(!A)return null;var D=typeof A!="boolean"?A:null;return e.createElement("span",{className:g()("".concat(p,"-checkbox"),o&&"".concat(p,"-checkbox-checked"),!o&&u&&"".concat(p,"-checkbox-indeterminate"),(d||b)&&"".concat(p,"-checkbox-disabled")),onClick:f.onCheck},D)},f.renderIcon=function(){var h=f.props.loading,o=f.props.context.prefixCls;return e.createElement("span",{className:g()("".concat(o,"-iconEle"),"".concat(o,"-icon__").concat(f.getNodeState()||"docu"),h&&"".concat(o,"-icon_loading"))})},f.renderSelector=function(){var h=f.state.dragNodeHighlight,o=f.props,u=o.title,b=o.selected,p=o.icon,d=o.loading,A=o.data,D=f.props.context,S=D.prefixCls,L=D.showIcon,M=D.icon,O=D.draggable,j=D.loadData,G=D.titleRender,X=f.isDisabled(),te="".concat(S,"-node-content-wrapper"),fe;if(L){var ve=p||M;fe=ve?e.createElement("span",{className:g()("".concat(S,"-iconEle"),"".concat(S,"-icon__customize"))},typeof ve=="function"?ve(f.props):ve):f.renderIcon()}else j&&d&&(fe=f.renderIcon());var he;typeof u=="function"?he=u(A):G?he=G(A):he=u;var xe=e.createElement("span",{className:"".concat(S,"-title")},he);return e.createElement("span",{ref:f.setSelectHandle,title:typeof u=="string"?u:"",className:g()("".concat(te),"".concat(te,"-").concat(f.getNodeState()||"normal"),!X&&(b||h)&&"".concat(S,"-node-selected"),!X&&O&&"draggable"),draggable:!X&&O||void 0,"aria-grabbed":!X&&O||void 0,onMouseEnter:f.onMouseEnter,onMouseLeave:f.onMouseLeave,onContextMenu:f.onContextMenu,onClick:f.onSelectorClick,onDoubleClick:f.onSelectorDoubleClick,onDragStart:O?f.onDragStart:void 0},fe,xe)},f}return Object(P.a)(_,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var h=this.props.selectable,o=this.props.context.selectable;return typeof h=="boolean"?h:o}},{key:"render",value:function(){var h,o=this.props,u=o.eventKey,b=o.className,p=o.style,d=o.dragOver,A=o.dragOverGapTop,D=o.dragOverGapBottom,S=o.isLeaf,L=o.isStart,M=o.isEnd,O=o.expanded,j=o.selected,G=o.checked,X=o.halfChecked,te=o.loading,fe=o.domRef,ve=o.active,he=o.onMouseMove,xe=Object(H.a)(o,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Se=this.props.context,de=Se.prefixCls,ie=Se.filterTreeNode,Le=Se.draggable,Ve=Se.keyEntities,Be=this.isDisabled(),je=Object(c.f)(xe),Ee=Ve[u]||{},Te=Ee.level,Re=M[M.length-1];return e.createElement("div",Object.assign({ref:fe,className:g()(b,"".concat(de,"-treenode"),(h={},Object(Q.a)(h,"".concat(de,"-treenode-disabled"),Be),Object(Q.a)(h,"".concat(de,"-treenode-switcher-").concat(O?"open":"close"),!S),Object(Q.a)(h,"".concat(de,"-treenode-checkbox-checked"),G),Object(Q.a)(h,"".concat(de,"-treenode-checkbox-indeterminate"),X),Object(Q.a)(h,"".concat(de,"-treenode-selected"),j),Object(Q.a)(h,"".concat(de,"-treenode-loading"),te),Object(Q.a)(h,"".concat(de,"-treenode-active"),ve),Object(Q.a)(h,"".concat(de,"-treenode-leaf-last"),Re),Object(Q.a)(h,"drag-over",!Be&&d),Object(Q.a)(h,"drag-over-gap-top",!Be&&A),Object(Q.a)(h,"drag-over-gap-bottom",!Be&&D),Object(Q.a)(h,"filter-node",ie&&ie(Object(l.b)(this.props))),h)),style:p,onDragEnter:Le?this.onDragEnter:void 0,onDragOver:Le?this.onDragOver:void 0,onDragLeave:Le?this.onDragLeave:void 0,onDrop:Le?this.onDrop:void 0,onDragEnd:Le?this.onDragEnd:void 0,onMouseMove:he},je),e.createElement(i,{prefixCls:de,level:Te,isStart:L,isEnd:M}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),_}(e.Component),E=function(T){return e.createElement(v.a.Consumer,null,function(_){return e.createElement(t,Object.assign({},T,{context:_}))})};E.displayName="TreeNode",E.defaultProps={title:r},E.isTreeNode=1;var y=ne.a=E},ZW9T:function(Ne,ne,U){"use strict";U.d(ne,"a",function(){return M});var Q=U("k1fw"),H=U("oBTY"),I=U("miYZ"),W=U("tsqr"),P=U("rAM+"),R=U("tJVT"),K=U("PpiC"),N=U("q1tI"),e=U.n(N),C=U("bdgK"),g=U("9og8"),v=U("WmNS"),c=U.n(v),s={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},i={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},l={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"if",content:["if () {"," $0","}"].join(`
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"include <vector>",content:["#include <vector>"].join(`
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
`)},{label:"include <map>",content:["#include <map>"].join(`
`)},{label:"include <string>",content:["#include <string>"].join(`
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
`)}]},a={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
`)}]},n=U("5VLF"),r=U.n(n),t={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},E=function(j,G){return G.map(function(X){return{label:X,kind:j.languages.CompletionItemKind.Keyword,insertText:X}})},y=function(j){return Object.keys(t.tables).map(function(G){return{label:G,kind:j.languages.CompletionItemKind.Variable,insertText:G}})},m=function(j,G){var X=t.tables[j];return X?X.map(function(te){return{label:te,kind:G.languages.CompletionItemKind.Field,insertText:te}}):[]};function T(O,j,G,X,te){var fe=j.getWordUntilPosition(G),ve={startLineNumber:G.lineNumber,endLineNumber:G.lineNumber,startColumn:fe.startColumn,endColumn:fe.endColumn},he=X.map(function(xe){return{label:xe,kind:O.languages.CompletionItemKind.Keyword,insertText:xe,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ve}});return te.map(function(xe){he.push(Object(Q.a)(Object(Q.a)({},xe),{},{range:ve}))}),he}var _=function(O){t.languages.map(function(te){return O.languages.registerDocumentFormattingEditProvider(te,{provideDocumentFormattingEdits:function(ve,he,xe){return Object(g.a)(c.a.mark(function Se(){var de;return c.a.wrap(function(Le){for(;;)switch(Le.prev=Le.next){case 0:return de=r()(ve.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),Le.abrupt("return",[{range:ve.getFullModelRange(),text:de}]);case 2:case"end":return Le.stop()}},Se)}))()}}),te});var j=l.quickKey.map(function(te){return{label:te.label,kind:O.languages.CompletionItemKind.Method,insertText:te.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),G=a.quickKey.map(function(te){return{label:te.label,kind:O.languages.CompletionItemKind.Method,insertText:te.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),X=i.quickKey.map(function(te){return{label:te.label,kind:O.languages.CompletionItemKind.Method,insertText:te.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet}});O.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(fe,ve){var he=fe.getWordUntilPosition(ve),xe={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:he.startColumn,endColumn:he.endColumn},Se=fe.getLineContent(ve.lineNumber).substring(he.startColumn-2,he.endColumn);return{suggestions:[].concat(Object(H.a)(l.keywords.map(function(de){return{label:de,kind:O.languages.CompletionItemKind.Function,documentation:de,insertText:de,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}})),Object(H.a)(l.quickKey.map(function(de){return{label:de.label,kind:O.languages.CompletionItemKind.Function,documentation:de.content,insertText:Se.startsWith("#")?de.content.replace(/#/,""):de.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}})))}}}),O.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(fe,ve){var he=fe.getWordUntilPosition(ve),xe={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:he.startColumn,endColumn:he.endColumn};return{suggestions:Object(H.a)(s.keywords.map(function(Se){return{label:Se,kind:O.languages.CompletionItemKind.Function,documentation:Se,insertText:Se,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}}))}}}),O.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(fe,ve){var he=fe.getWordUntilPosition(ve),xe={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:he.startColumn,endColumn:he.endColumn},Se=fe.getLineContent(ve.lineNumber).substring(he.startColumn-2,he.endColumn);return{suggestions:[].concat(Object(H.a)(i.keywords.map(function(de){return{label:de,kind:O.languages.CompletionItemKind.Function,documentation:de,insertText:de,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}})),Object(H.a)(i.quickKey.map(function(de){return{label:de.label,kind:O.languages.CompletionItemKind.Function,documentation:de.content,insertText:Se.startsWith("#")?de.content.replace(/#/,""):de.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}})))}}}),O.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(fe,ve){var he=fe.getWordUntilPosition(ve),xe={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:he.startColumn,endColumn:he.endColumn},Se=fe.getLineContent(ve.lineNumber).substring(he.startColumn-2,he.endColumn);return{suggestions:[].concat(Object(H.a)(a.keywords.map(function(de){return{label:de,kind:O.languages.CompletionItemKind.Function,documentation:de,insertText:de,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}})),Object(H.a)(a.quickKey.map(function(de){return{label:de.label,kind:O.languages.CompletionItemKind.Function,documentation:de.content,insertText:Se.startsWith("#")?de.content.replace(/#/,""):de.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}})))}}})},f="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",h=U("fjLI"),o=U("LvDl"),u=U("+ua5");function b(O){return/^\d+$/.test(O)?"".concat(O,"px"):O}function p(){}var d=!1,A={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function D(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],j=O;if(Array.isArray(O)){for(var G=0;G<O.length;G++){var X=A[O[G]];if(X)return X}return j[0]}return A[j]||j}var S=null,L=ne.b=function(O){var j=O.width,G=j===void 0?"100%":j,X=O.height,te=X===void 0?"100%":X,fe=O.value,ve=O.language,he=ve===void 0?"javascript":ve,xe=O.style,Se=xe===void 0?{}:xe,de=O.options,ie=de===void 0?{}:de,Le=O.overrideServices,Ve=Le===void 0?{}:Le,Be=O.theme,je=Be===void 0?"vs-dark":Be,Ee=O.onEditBlur,Te=O.onSave,Re=O.autoHeight,Ie=Re===void 0?!1:Re,$=O.forbidCopy,se=$===void 0?!1:$,ue=O.onChange,ce=ue===void 0?p:ue,_e=O.editorDidMount,De=_e===void 0?p:_e,Pe=O.onFocus,Me=Pe===void 0?p:Pe,Fe=O.filename,He=Fe===void 0?"educoder.txt":Fe,oe=O.errorLine,me=O.errorContent,be=me===void 0?"":me,we=Object(K.a)(O,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),pe=Object(N.useRef)(),ye=Object(N.useRef)({}),re=Object(N.useRef)(),Z=Object(N.useRef)(),J=Object(N.useRef)(!1),V=Object(N.useRef)(),Y=Object(N.useState)(!1),q=Object(R.a)(Y,2),ee=q[0],le=q[1];function ge(){var Xe;return pe.current&&(Xe=new C.default(function(Ye){var tt=Object(P.a)(Ye),vt;try{for(tt.s();!(vt=tt.n()).done;){var Et=vt.value;(Et.target.offsetHeight>0||Et.target.offsetWidth>0)&&ye.current.instance.layout()}}catch(bt){tt.e(bt)}finally{tt.f()}}),Xe.observe(pe.current)),Xe}function Oe(){W.b.warn(decodeURIComponent(f))}var Ke=function(){var Ye=ye.current.instance;if(fe!=null&&Ye&&ee){var tt=Ye.getModel();tt&&fe!==tt.getValue()&&(d=!0,tt.setValue(fe),Ye.layout(),d=!1)}};Object(N.useEffect)(function(){Z.current&&clearTimeout(Z.current),Z.current=setTimeout(function(){Ke()},500)},[fe,ee,ye.current]),Object(N.useEffect)(function(){if(oe&&ye.current&&ye.current.instance){var Xe=ye.current.instance;Xe.changeViewZones(function(tt){var vt=document.createElement("div");vt.style.padding="10px 20px",vt.style.width="calc(100% - 20px)",vt.className="my-error-line-wrp",vt.innerHTML=be,tt.addZone({afterLineNumber:oe||11,heightInLines:3,domNode:vt})});var Ye={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}};Xe.addOverlayWidget(Ye),Xe.revealPositionInCenter({lineNumber:20,column:1})}},[oe,ye.current,ee]);function ze(){var Xe=ye.current.instance;if(Xe){var Ye=Xe.getSelection(),tt=ye.current.pastePos||{},vt=new S.Range(tt.startLineNumber||Ye.endLineNumber,tt.startColumn||Ye.endColumn,tt.endLineNumber||Ye.endLineNumber,tt.endColumn||Ye.endColumn);setTimeout(function(){Xe.executeEdits("",[{range:vt,text:""}])},300)}}function ke(Xe){(window.navigator.platform.match("Mac")?Xe.metaKey:Xe.ctrlKey)&&Xe.keyCode==83&&(Xe.preventDefault(),Te())}var Je=function(){if(Ie&&ye.current.instance){var Ye=ye.current.instance.getContentHeight();Ue(Ye<te?te:Ye)}else Ue(te)};function Qe(Xe){var Ye=document.createEvent("MouseEvents");Ye.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Xe.dispatchEvent(Ye)}function Ge(Xe,Ye){var tt=window.URL||window.webkitURL||window,vt=new Blob([Ye]),Et=document.createElementNS("http://www.w3.org/1999/xhtml","a");Et.href=tt.createObjectURL(vt),Et.download=Xe,Qe(Et)}Object(N.useEffect)(function(){Je()},[Je]),Object(N.useEffect)(function(){pe.current&&!ee&&Promise.all([U.e(16),U.e(28)]).then(U.t.bind(null,"M/lh",7)).then(function(Xe){try{S=Xe,ye.current.instance=S.editor.create(pe.current,{value:fe,language:D(he),theme:je,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},Ve);var Ye=ye.current.instance,tt=h.d._menuItems,vt=Object(H.a)(tt).find(function(ct){return ct[0]._debugName=="EditorContext"}),Et=vt[1],bt=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Ot=function(Tt,At){var _t=Tt._first;do{var Pt,It,Bt=At.includes((Pt=_t.element)===null||Pt===void 0||((It=Pt.command)===null||It===void 0)?void 0:It.id);Bt&&Tt._remove(_t)}while(_t=_t.next)};if(De(Ye,S),setTimeout(function(){Je(),ye.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Ge(He||"educoder.txt",Ye.getValue())}}),Ye.getDomNode().addEventListener("input",function(){re.current.autoFormat&&Ye.getAction("editor.action.formatDocument").run()})},500),ye.current.subscription=Ye.onDidChangeModelContent(function(ct){J.current?clearTimeout(V.current):(Je(),ce(Ye.getValue(),ct)),V.current=setTimeout(function(){J.current=!1},500)}),window.Monaco||_(S,D(he)),se&&(Ot(Et,bt),pe.current.classList.add("noCopyPaste"),Ye.onKeyDown(function(ct){var Tt=ct.keyCode,At=ct.ctrlKey,_t=ct.metaKey;(Tt===33||Tt===52)&&(_t||At)&&(Oe(),ct.preventDefault())})),window.Monaco=S,Ee&&Ye.onDidBlurEditorWidget(function(){Ee(Ye.getValue())}),Me&&Ye.onDidFocusEditorText(function(){Me(Ye.getValue())}),se){Ye.addCommand(S.KeyMod.CtrlCmd|S.KeyCode.KEY_V,function(){return Oe(),null}),Ye.onDidPaste(function(ct){ye.current.pastePos=ct});try{window.addEventListener("paste",ze)}catch(ct){}}var Rt=ge();return le(!0),function(){var ct=ye.current.instance;ct.dispose();var Tt=ct.getModel();Tt&&Tt.dispose(),ye.current.subscription&&ye.current.subscription.dispose(),se&&window.removeEventListener("paste",ze),Rt.unobserve(pe.current)}}catch(ct){}})},[]),Object(N.useEffect)(function(){var Xe=ye.current.instance;if(Xe&&ee)return document.addEventListener("keydown",ke,!1),function(){document.removeEventListener("keydown",ke)}},[Te,ee]),Object(N.useEffect)(function(){var Xe=ye.current.instance;if(Xe&&ee){var Ye=D(he);S.editor.setModelLanguage(Xe.getModel(),Ye),console.log("language:",he,Xe.getModel(),Ye)}},[he,ee]),Object(N.useEffect)(function(){var Xe=ye.current.instance;Xe&&ee&&S.editor.setTheme(je)},[je,ee]),Object(N.useEffect)(function(){var Xe=ye.current.instance;re.current=ie,Xe&&ee&&(Xe.updateOptions(Object(Q.a)({},ie)),setTimeout(function(){Xe.getModel().updateOptions(Object(Q.a)({},ie))},200))},[JSON.stringify(ie),ee]),Object(N.useEffect)(function(){var Xe=ye.current.instance;Xe&&ee&&Xe.layout()},[G,te,ee]);var at=Object(N.useState)(b(G)),nt=Object(R.a)(at,2),rt=nt[0],dt=nt[1],et=Object(N.useState)(b(te)),st=Object(R.a)(et,2),ut=st[0],Ue=st[1],pt=Object(Q.a)(Object(Q.a)({},Se),{},{width:rt,height:ut});return e.a.createElement("div",{className:"my-monaco-editor",ref:pe,style:pt})};function M(O){var j=O.width,G=j===void 0?"100%":j,X=O.height,te=X===void 0?"100%":X,fe=O.original,ve=O.modified,he=O.language,xe=O.options,Se=xe===void 0?{}:xe,de=Object(N.useRef)(),ie=Object(N.useState)(null),Le=Object(R.a)(ie,2),Ve=Le[0],Be=Le[1];function je(Ie){var $;return de.current&&($=new C.default(function(se){var ue=Object(P.a)(se),ce;try{for(ue.s();!(ce=ue.n()).done;){var _e=ce.value;(_e.target.offsetHeight>0||_e.target.offsetWidth>0)&&Ie.layout()}}catch(De){ue.e(De)}finally{ue.f()}}),$.observe(de.current)),$}Object(N.useEffect)(function(){de.current&&Promise.all([U.e(16),U.e(28)]).then(U.t.bind(null,"M/lh",7)).then(function(Ie){S=Ie;var $=S.editor.createDiffEditor(de.current,Object(Q.a)(Object(Q.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Se),{},{wordWrap:!0}));Be($);var se=je($);return function(){$.dispose();var ue=$.getModel();ue&&ue.dispose(),se.unobserve(de.current)}})},[]),Object(N.useEffect)(function(){Ve&&Ve.setModel({original:S.editor.createModel(fe,he),modified:S.editor.createModel(ve,he)})},[fe,ve,he,Ve]);var Ee=b(G),Te=b(te),Re={width:Ee,height:Te};return e.a.createElement("div",{className:"my-diff-editor",ref:de,style:Re})}},bTeP:function(Ne,ne,U){Ne.exports={flex_box_center:"flex_box_center___14Ki3",flex_space_between:"flex_space_between___3TSad",flex_box_vertical_center:"flex_box_vertical_center___3pQXk",flex_box_center_end:"flex_box_center_end___29_cn",flex_box_column:"flex_box_column___16am0",title:"title___2mVJs",workListTabWrap:"workListTabWrap___1JlOB",workListTabButton:"workListTabButton___3umfp",tables:"tables___hLy6a",checkboxgroup:"checkboxgroup___2xMgu"}},biw7:function(Ne,ne,U){"use strict";var Q=U("q1tI"),H=U.n(Q),I=Q.createContext(null);ne.a=I},deN7:function(Ne,ne,U){"use strict";var Q=U("/zsF"),H=U("PArb"),I=U("14J3"),W=U("BMrR"),P=U("jCWc"),R=U("kPKH"),K=U("+L6B"),N=U("2/Rp"),e=U("miYZ"),C=U("tsqr"),g=U("9og8"),v=U("giR+"),c=U("fyUT"),s=U("2qtc"),i=U("kLXV"),l=U("7Kak"),a=U("9yH6"),n=U("tJVT"),r=U("k1fw"),t=U("OaEy"),E=U("2fM7"),y=U("WmNS"),m=U.n(y),T=U("q1tI"),_=U.n(T),f=U("ZW9T"),h=U("F0VM"),o=U.n(h),u=U("xKgJ"),b=U("J66h"),p=U.n(b),d=U("ErOA"),A=U("Ty5D"),D=U("9Bee"),S=U("XYT7"),L=U("RCxd"),M=U("/MfK"),O=E.a.Option,j={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,enableSplitViewResizing:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1},G;(function(te){te[te.SET_PATH=0]="SET_PATH",te[te.GET_PASSED_CONTENT=1]="GET_PASSED_CONTENT"})(G||(G={}));function X(te,fe){switch(fe.type){case G.SET_PATH:return Object(r.a)(Object(r.a)({},te),{},{selectedPath:fe.payload});case G.GET_PASSED_CONTENT:return Object(r.a)(Object(r.a)({},te),{},{passedContent:fe.payload});default:throw new Error}}ne.a=function(te){var fe=te.language,ve=te.dispatch,he=te.shixunWorkReport,xe=te.v,Se=te.languages,de=te.onPathChange,ie=te.autoHeight,Le=te.diff_code_count,Ve=te.data,Be=Object(T.useState)(Se==null?void 0:Se[0]),je=Object(n.a)(Be,2),Ee=je[0],Te=je[1],Re=he!="shixunWorkReport"&&Object(A.i)();return Object(T.useEffect)(function(){Te(Se==null?void 0:Se[0])},[]),Object(T.useEffect)(function(){var Ie;Te(Se==null||((Ie=Se.filter(function($){return $.language===(Ee==null?void 0:Ee.language)}))===null||Ie===void 0)?void 0:Ie[0])},[Se]),_.a.createElement(_.a.Fragment,null,_.a.createElement("h2",null," ",_.a.createElement("span",null,_.a.createElement("span",null,"\u6700\u540E\u901A\u5173\u7684\u4EE3\u7801"),(Se==null?void 0:Se.length)>1&&_.a.createElement(a.a.Group,{defaultValue:fe,style:{marginLeft:10},onChange:function($){var se;Te(Se==null||((se=Se.filter(function(ue){return ue.language===$.target.value}))===null||se===void 0)?void 0:se[0])}},Se==null?void 0:Se.map(function(Ie){return _.a.createElement(a.a,{value:Ie==null?void 0:Ie.language},Ie==null?void 0:Ie.language)}))),Object(u.c)()&&he!="shixunWorkReport"&&_.a.createElement("span",null,_.a.createElement("span",null,"\u5F97\u5206 ",Ee==null?void 0:Ee.score,"/",Ee==null?void 0:Ee.total_score),_.a.createElement(N.a,{style:{margin:"0px 10px"},onClick:function(){var $=Ee==null?void 0:Ee.score;i.a.confirm({title:"\u8C03\u5206",content:_.a.createElement("div",null,_.a.createElement("p",null,"\u5F97\u5206\uFF1A",Ee==null?void 0:Ee.score,"/",Ee==null?void 0:Ee.total_score),_.a.createElement("p",null,"\u8C03\u5206\uFF1A",_.a.createElement(c.a,{min:0,max:Ee==null?void 0:Ee.total_score,defaultValue:Ee==null?void 0:Ee.score,onChange:function(ue){$=ue}}))),okText:"\u786E\u8BA4",onOk:function(){var se=Object(g.a)(m.a.mark(function ce(){var _e;return m.a.wrap(function(Pe){for(;;)switch(Pe.prev=Pe.next){case 0:return Pe.next=2,Object(d.a)("/api/courses/".concat(Re==null?void 0:Re.coursesId,"/homework_commons/update_hack_score"),{method:"put",body:{course_id:Re==null?void 0:Re.coursesId,hack_user_code_id:Ee==null?void 0:Ee.hack_user_id,score:$}});case 2:_e=Pe.sent,_e.status===0&&(C.b.success("\u8C03\u5206\u6210\u529F"),ve({type:"shixunHomeworks/setActionTabs",payload:{}}),ve({type:"shixunHomeworks/getShixunWorkReports",payload:Object(r.a)({},Re)}));case 4:case"end":return Pe.stop()}},ce)}));function ue(){return se.apply(this,arguments)}return ue}(),cancelText:"\u53D6\u6D88"})},type:"primary"},"\u8C03\u5206"),Object(u.c)()&&he!="shixunWorkReport"&&_.a.createElement(N.a,{onClick:function(){ve({type:"shixunHomeworks/setActionTabs",payload:{key:"\u66F4\u6539\u70B9\u8BC4",selectArrs:{myshixun_identifier:he.user_id,type:"1",language:Ee==null?void 0:Ee.language,v:xe,data:Object(r.a)({},he)}}})}},"\u70B9\u8BC4\u4EE3\u7801"))),_.a.createElement(f.b,{height:300,language:Ee==null?void 0:Ee.language,value:b.Base64.decode(Ee==null?void 0:Ee.code),autoHeight:ie,theme:"default",options:j}),((Ee==null?void 0:Ee.comment)||(Ee==null?void 0:Ee.hidden_comment))&&_.a.createElement("div",null,_.a.createElement(W.a,{align:"middle",style:{borderTop:"1px solid #eee"}},_.a.createElement(R.a,{flex:1},_.a.createElement("h1",{className:o.a.title},"\u70B9\u8BC4\u5185\u5BB9")),_.a.createElement(R.a,{className:"pr30"},Object(u.c)()&&_.a.createElement(N.a,{onClick:Object(g.a)(m.a.mark(function Ie(){return m.a.wrap(function(se){for(;;)switch(se.prev=se.next){case 0:i.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",icon:_.a.createElement(L.a,null),content:"\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F",onOk:function(){return Object(g.a)(m.a.mark(function ce(){var _e;return m.a.wrap(function(Pe){for(;;)switch(Pe.prev=Pe.next){case 0:return Pe.next=2,Object(S.m)({comment_id:Ee==null?void 0:Ee.comment_id,homeworkId:Re.homeworkId,type:"hack"});case 2:_e=Pe.sent,_e.status===0&&(C.b.success("\u5220\u9664\u6210\u529F"),ve({type:"shixunHomeworks/getShixunWorkReports",payload:Object(r.a)({},Re)}));case 4:case"end":return Pe.stop()}},ce)}))()}});case 1:case"end":return se.stop()}},Ie)}))},_.a.createElement(M.a,null),"\u5220\u9664"))),_.a.createElement(H.a,{style:{margin:0}}),(Ee==null?void 0:Ee.comment)&&_.a.createElement("aside",{className:"pl30 pr30 mt20"},_.a.createElement("span",{className:"c-light-black font12"},"# \u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),_.a.createElement("br",null),_.a.createElement(D.a,{value:Ee==null?void 0:Ee.comment})),(Ee==null?void 0:Ee.hidden_comment)&&_.a.createElement("aside",{className:"pl30 pr30 mt20"},_.a.createElement("span",{className:"c-light-black font12"},"# \u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),_.a.createElement("br",null),_.a.createElement(D.a,{value:Ee==null?void 0:Ee.hidden_comment}))))}},dmUQ:function(Ne,ne,U){"use strict";var Q=U("Ff2n"),H=U("rePB"),I=U("1OyB"),W=U("vuIU"),P=U("Ji7U"),R=U("md7G"),K=U("foSv"),N=U("q1tI"),e=U.n(N),C=U("TSYQ"),g=U.n(C),v=U("4IlW");function c(o,u){var b=Object.keys(o);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(o);u&&(p=p.filter(function(d){return Object.getOwnPropertyDescriptor(o,d).enumerable})),b.push.apply(b,p)}return b}function s(o){for(var u=1;u<arguments.length;u++){var b=arguments[u]!=null?arguments[u]:{};u%2?c(Object(b),!0).forEach(function(p){Object(H.a)(o,p,b[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(b)):c(Object(b)).forEach(function(p){Object.defineProperty(o,p,Object.getOwnPropertyDescriptor(b,p))})}return o}function i(o){var u=l();return function(){var p=Object(K.a)(o),d;if(u){var A=Object(K.a)(this).constructor;d=Reflect.construct(p,arguments,A)}else d=p.apply(this,arguments);return Object(R.a)(this,d)}}function l(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(o){return!1}}function a(){}function n(o){o.preventDefault()}var r=function(u){return u.replace(/[^\w.-]+/g,"")},t=200,E=600,y=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,m=function(u){return u!=null},T=function(u,b){return b===u||typeof b=="number"&&typeof u=="number"&&isNaN(b)&&isNaN(u)},_=function(o){Object(P.a)(b,o);var u=i(b);function b(p){var d;Object(I.a)(this,b),d=u.call(this,p),d.onKeyDown=function(S){var L=d.props,M=L.onKeyDown,O=L.onPressEnter;if(S.keyCode===v.a.UP){var j=d.getRatio(S);d.up(S,j,null),d.stop()}else if(S.keyCode===v.a.DOWN){var G=d.getRatio(S);d.down(S,G,null),d.stop()}else S.keyCode===v.a.ENTER&&O&&O(S);if(d.recordCursorPosition(),d.lastKeyCode=S.keyCode,M){for(var X=arguments.length,te=new Array(X>1?X-1:0),fe=1;fe<X;fe++)te[fe-1]=arguments[fe];M.apply(void 0,[S].concat(te))}},d.onKeyUp=function(S){var L=d.props.onKeyUp;if(d.stop(),d.recordCursorPosition(),L){for(var M=arguments.length,O=new Array(M>1?M-1:0),j=1;j<M;j++)O[j-1]=arguments[j];L.apply(void 0,[S].concat(O))}},d.onChange=function(S){var L=d.props.onChange;d.state.focused&&(d.inputting=!0),d.rawInput=d.props.parser(d.getValueFromEvent(S)),d.setState({inputValue:d.rawInput}),L(d.toNumber(d.rawInput))},d.onMouseUp=function(){var S=d.props.onMouseUp;d.recordCursorPosition(),S&&S.apply(void 0,arguments)},d.onFocus=function(){var S;d.setState({focused:!0}),(S=d.props).onFocus.apply(S,arguments)},d.onBlur=function(){var S=d.props.onBlur;d.inputting=!1,d.setState({focused:!1});var L=d.getCurrentValidValue(d.state.inputValue),M=d.setValue(L,a);if(S){var O=d.input.value,j=d.getInputDisplayValue({focus:!1,value:M});d.input.value=j&&Number(j),S.apply(void 0,arguments),d.input.value=O}},d.getRatio=function(S){var L=1;return S.metaKey||S.ctrlKey?L=.1:S.shiftKey&&(L=10),L},d.getFullNum=function(S){return isNaN(S)?S:/e/i.test(String(S))?Number(S).toFixed(18).replace(/\.?0+$/,""):S},d.getPrecision=function(S){if(m(d.props.precision))return d.props.precision;var L=String(S);if(L.indexOf("e-")>=0)return parseInt(L.slice(L.indexOf("e-")+2),10);var M=0;return L.indexOf(".")>=0&&(M=L.length-L.indexOf(".")-1),M},d.getInputDisplayValue=function(S){var L=S||d.state,M=L.focused,O=L.inputValue,j=L.value,G;M?G=O:G=d.toPrecisionAsStep(j),G==null&&(G="");var X=d.formatWrapper(G);return m(d.props.decimalSeparator)&&(X=X.toString().replace(".",d.props.decimalSeparator)),X},d.recordCursorPosition=function(){try{d.cursorStart=d.input.selectionStart,d.cursorEnd=d.input.selectionEnd,d.currentValue=d.input.value,d.cursorBefore=d.input.value.substring(0,d.cursorStart),d.cursorAfter=d.input.value.substring(d.cursorEnd)}catch(S){}},d.restoreByAfter=function(S){if(S===void 0)return!1;var L=d.input.value,M=L.lastIndexOf(S);if(M===-1)return!1;var O=d.cursorBefore.length;return d.lastKeyCode===v.a.DELETE&&d.cursorBefore.charAt(O-1)===S[0]?(d.fixCaret(O,O),!0):M+S.length===L.length?(d.fixCaret(M,M),!0):!1},d.partRestoreByAfter=function(S){return S===void 0?!1:Array.prototype.some.call(S,function(L,M){var O=S.substring(M);return d.restoreByAfter(O)})},d.isNotCompleteNumber=function(S){return isNaN(S)||S===""||S===null||S&&S.toString().indexOf(".")===S.toString().length-1},d.stop=function(){d.autoStepTimer&&clearTimeout(d.autoStepTimer)},d.down=function(S,L,M){d.pressingUpOrDown=!0,d.step("down",S,L,M)},d.up=function(S,L,M){d.pressingUpOrDown=!0,d.step("up",S,L,M)},d.saveInput=function(S){d.input=S};var A=p.value;A===void 0&&(A=p.defaultValue),d.state={focused:p.autoFocus};var D=d.getValidValue(d.toNumber(A));return d.state=s(s({},d.state),{},{inputValue:d.toPrecisionAsStep(D),value:D}),d}return Object(W.a)(b,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(d){var A=this.props,D=A.value,S=A.onChange,L=A.max,M=A.min,O=this.state.focused;if(d){if(!T(d.value,D)||!T(d.max,L)||!T(d.min,M)){var j=O?D:this.getValidValue(D),G;this.pressingUpOrDown?G=j:this.inputting?G=this.rawInput:G=this.toPrecisionAsStep(j),this.setState({value:j,inputValue:G})}var X="value"in this.props?D:this.state.value;"max"in this.props&&d.max!==L&&typeof X=="number"&&X>L&&S&&S(L),"min"in this.props&&d.min!==M&&typeof X=="number"&&X<M&&S&&S(M)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var te=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===v.a.BACKSPACE?te=this.cursorStart-1:this.lastKeyCode===v.a.DELETE&&(te=this.cursorStart):te=this.input.value.length,this.fixCaret(te,te)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case v.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case v.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(fe){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(d){var A=d;return A===""?A="":this.isNotCompleteNumber(parseFloat(A))?A=this.state.value:A=this.getValidValue(A),this.toNumber(A)}},{key:"getValueFromEvent",value:function(d){var A=d.target.value.trim().replace(/。/g,".");return m(this.props.decimalSeparator)&&(A=A.replace(this.props.decimalSeparator,".")),A}},{key:"getValidValue",value:function(d){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,S=parseFloat(d);return isNaN(S)?d:(S<A&&(S=A),S>D&&(S=D),S)}},{key:"setValue",value:function(d,A){var D=this.props.precision,S=this.isNotCompleteNumber(parseFloat(d))?null:parseFloat(d),L=this.state.value,M=L===void 0?null:L,O=this.state.inputValue,j=O===void 0?null:O,G=typeof S=="number"?S.toFixed(D):"".concat(S),X=S!==M||G!=="".concat(j);return"value"in this.props?(j=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:j},A)):this.setState({value:S,inputValue:this.toPrecisionAsStep(d)},A),X&&this.props.onChange(S),S}},{key:"getMaxPrecision",value:function(d){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,D=this.props,S=D.precision,L=D.step;if(m(S))return S;var M=this.getPrecision(A),O=this.getPrecision(L),j=this.getPrecision(d);return d?Math.max(j,M+O):M+O}},{key:"getPrecisionFactor",value:function(d){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,D=this.getMaxPrecision(d,A);return Math.pow(10,D)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(d){return this.props.formatter?this.props.formatter(d):d}},{key:"toPrecisionAsStep",value:function(d){if(this.isNotCompleteNumber(d)||d==="")return d;var A=Math.abs(this.getMaxPrecision(d));return isNaN(A)?d.toString():Number(d).toFixed(A)}},{key:"toNumber",value:function(d){var A=this.props.precision,D=this.state.focused,S=d&&d.length>16&&D;return this.isNotCompleteNumber(d)||S?d:m(A)?Math.round(d*Math.pow(10,A))/Math.pow(10,A):Number(d)}},{key:"upStep",value:function(d,A){var D=this.props.step,S=this.getPrecisionFactor(d,A),L=Math.abs(this.getMaxPrecision(d,A)),M=((S*d+S*D*A)/S).toFixed(L);return this.toNumber(M)}},{key:"downStep",value:function(d,A){var D=this.props.step,S=this.getPrecisionFactor(d,A),L=Math.abs(this.getMaxPrecision(d,A)),M=((S*d-S*D*A)/S).toFixed(L);return this.toNumber(M)}},{key:"step",value:function(d,A){var D=this,S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,L=arguments.length>3?arguments[3]:void 0;this.stop(),A&&(A.persist(),A.preventDefault());var M=this.props;if(M.disabled)return;var O=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(O))return;var j=this["".concat(d,"Step")](O,S),G=j>M.max||j<M.min;if(j>M.max?j=M.max:j<M.min&&(j=M.min),this.setValue(j,null),this.setState({focused:!0},function(){D.pressingUpOrDown=!1}),G)return;this.autoStepTimer=setTimeout(function(){D[d](A,S,!0)},L?t:E)}},{key:"fixCaret",value:function(d,A){if(d===void 0||A===void 0||!this.input||!this.input.value)return;try{var D=this.input.selectionStart,S=this.input.selectionEnd;(d!==D||A!==S)&&this.input.setSelectionRange(d,A)}catch(L){}}},{key:"render",value:function(){var d,A=this.props,D=A.prefixCls,S=A.disabled,L=A.readOnly,M=A.useTouch,O=A.autoComplete,j=A.upHandler,G=A.downHandler,X=A.className,te=A.max,fe=A.min,ve=A.style,he=A.title,xe=A.onMouseEnter,Se=A.onMouseLeave,de=A.onMouseOver,ie=A.onMouseOut,Le=A.required,Ve=A.onClick,Be=A.tabIndex,je=A.type,Ee=A.placeholder,Te=A.id,Re=A.inputMode,Ie=A.pattern,$=A.step,se=A.maxLength,ue=A.autoFocus,ce=A.name,_e=A.onPaste,De=A.onInput,Pe=Object(Q.a)(A,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),Me=this.state,Fe=Me.value,He=Me.focused,oe=g()(D,(d={},Object(H.a)(d,X,!!X),Object(H.a)(d,"".concat(D,"-disabled"),S),Object(H.a)(d,"".concat(D,"-focused"),He),d)),me={};Object.keys(Pe).forEach(function(ee){(ee.substr(0,5)==="data-"||ee.substr(0,5)==="aria-"||ee==="role")&&(me[ee]=Pe[ee])});var be=!L&&!S,we=this.getInputDisplayValue(null),pe=(Fe||Fe===0)&&(isNaN(Fe)||Number(Fe)>=te),ye=(Fe||Fe===0)&&(isNaN(Fe)||Number(Fe)<=fe),re=pe||S||L,Z=ye||S||L,J=g()("".concat(D,"-handler"),"".concat(D,"-handler-up"),Object(H.a)({},"".concat(D,"-handler-up-disabled"),re)),V=g()("".concat(D,"-handler"),"".concat(D,"-handler-down"),Object(H.a)({},"".concat(D,"-handler-down-disabled"),Z)),Y=M?{onTouchStart:re?a:this.up,onTouchEnd:this.stop}:{onMouseDown:re?a:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},q=M?{onTouchStart:Z?a:this.down,onTouchEnd:this.stop}:{onMouseDown:Z?a:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return e.a.createElement("div",{className:oe,style:ve,title:he,onMouseEnter:xe,onMouseLeave:Se,onMouseOver:de,onMouseOut:ie,onFocus:function(){return null},onBlur:function(){return null}},e.a.createElement("div",{className:"".concat(D,"-handler-wrap")},e.a.createElement("span",Object.assign({unselectable:"on"},Y,{role:"button","aria-label":"Increase Value","aria-disabled":re,className:J}),j||e.a.createElement("span",{unselectable:"on",className:"".concat(D,"-handler-up-inner"),onClick:n})),e.a.createElement("span",Object.assign({unselectable:"on"},q,{role:"button","aria-label":"Decrease Value","aria-disabled":Z,className:V}),G||e.a.createElement("span",{unselectable:"on",className:"".concat(D,"-handler-down-inner"),onClick:n}))),e.a.createElement("div",{className:"".concat(D,"-input-wrap")},e.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":fe,"aria-valuemax":te,"aria-valuenow":Fe,required:Le,type:je,placeholder:Ee,onPaste:_e,onClick:Ve,onMouseUp:this.onMouseUp,className:"".concat(D,"-input"),tabIndex:Be,autoComplete:O,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:be?this.onKeyDown:a,onKeyUp:be?this.onKeyUp:a,autoFocus:ue,maxLength:se,readOnly:L,disabled:S,max:te,min:fe,step:$,name:ce,title:he,id:Te,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(we),pattern:Ie,inputMode:Re,onInput:De},me))))}}]),b}(e.a.Component);_.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:y,min:-y,step:1,style:{},onChange:a,onKeyDown:a,onPressEnter:a,onFocus:a,onBlur:a,parser:r,required:!1,autoComplete:"off"};var f=_,h=ne.a=f},fjLI:function(Ne,ne,U){"use strict";U.d(ne,"f",function(){return c}),U.d(ne,"b",function(){return s}),U.d(ne,"a",function(){return i}),U.d(ne,"d",function(){return l}),U.d(ne,"e",function(){return a}),U.d(ne,"c",function(){return n});var Q=U("8HAY"),H=U("Vhoy"),I=U("MI8n"),W=U("JYp7"),P=U("pmY6"),R=U("24hK"),K=U("nnTU"),N=U("T8No"),e=U("Cg/j"),C=U("t9D7"),g=function(r,t,E,y){var m=arguments.length,T=m<3?t:y===null?y=Object.getOwnPropertyDescriptor(t,E):y,_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(r,t,E,y);else for(var f=r.length-1;f>=0;f--)(_=r[f])&&(T=(m<3?_(T):m>3?_(t,E,T):_(t,E))||T);return m>3&&T&&Object.defineProperty(t,E,T),T},v=function(r,t){return function(E,y){t(E,y,r)}};function c(r){return r.command!==void 0}class s{constructor(r){this.id=s._idPool++,this._debugName=r}}s._idPool=0,s.CommandPalette=new s("CommandPalette"),s.EditorContext=new s("EditorContext"),s.SimpleEditorContext=new s("SimpleEditorContext"),s.EditorContextCopy=new s("EditorContextCopy"),s.EditorContextPeek=new s("EditorContextPeek"),s.MenubarEditMenu=new s("MenubarEditMenu"),s.MenubarCopy=new s("MenubarCopy"),s.MenubarGoMenu=new s("MenubarGoMenu"),s.MenubarSelectionMenu=new s("MenubarSelectionMenu"),s.InlineCompletionsActions=new s("InlineCompletionsActions");const i=Object(e.c)("menuService"),l=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new I.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:r=>r===s.CommandPalette}}addCommand(r){return this.addCommands(W.a.single(r))}addCommands(r){for(const t of r)this._commands.set(t.id,t);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(P.i)(()=>{let t=!1;for(const E of r)t=this._commands.delete(E.id)||t;t&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(r){return this._commands.get(r)}getCommands(){const r=new Map;return this._commands.forEach((t,E)=>r.set(E,t)),r}appendMenuItem(r,t){return this.appendMenuItems(W.a.single({id:r,item:t}))}appendMenuItems(r){const t=new Set,E=new R.a;for(const{id:y,item:m}of r){let T=this._menuItems.get(y);T||(T=new R.a,this._menuItems.set(y,T)),E.push(T.push(m)),t.add(y)}return this._onDidChangeMenu.fire(t),Object(P.i)(()=>{if(E.size>0){for(let y of E)y();this._onDidChangeMenu.fire(t),E.clear()}})}getMenuItems(r){let t;return this._menuItems.has(r)?t=[...this._menuItems.get(r)]:t=[],r===s.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(r){const t=new Set;for(const E of r)c(E)&&(t.add(E.command.id),E.alt&&t.add(E.alt.id));this._commands.forEach((E,y)=>{t.has(y)||r.push({command:E})})}};class a extends Q.e{constructor(r,t,E,y){super(`submenuitem.${r.submenu.id}`,typeof r.title=="string"?r.title:r.title.value,[],"submenu");this.item=r,this._menuService=t,this._contextKeyService=E,this._options=y}get actions(){const r=[],t=this._menuService.createMenu(this.item.submenu,this._contextKeyService),E=t.getActions(this._options);t.dispose();for(const[,y]of E)y.length>0&&(r.push(...y),r.push(new Q.d));return r.length&&r.pop(),r}}let n=class r{constructor(t,E,y,m,T){var _,f;if(this._commandService=T,this.id=t.id,this.label=(y==null?void 0:y.renderShortTitle)&&t.shortTitle?typeof t.shortTitle=="string"?t.shortTitle:t.shortTitle.value:typeof t.title=="string"?t.title:t.title.value,this.tooltip=(f=typeof t.tooltip=="string"?t.tooltip:(_=t.tooltip)===null||_===void 0?void 0:_.value)!==null&&f!==void 0?f:"",this.enabled=!t.precondition||m.contextMatchesRules(t.precondition),this.checked=void 0,t.toggled){const h=t.toggled.condition?t.toggled:{condition:t.toggled};this.checked=m.contextMatchesRules(h.condition),this.checked&&h.tooltip&&(this.tooltip=typeof h.tooltip=="string"?h.tooltip:h.tooltip.value),h.title&&(this.label=typeof h.title=="string"?h.title:h.title.value)}this.item=t,this.alt=E?new r(E,void 0,y,m,T):void 0,this._options=y,C.d.isThemeIcon(t.icon)&&(this.class=H.a.asClassName(t.icon))}dispose(){}run(...t){var E,y;let m=[];return((E=this._options)===null||E===void 0?void 0:E.arg)&&(m=[...m,this._options.arg]),((y=this._options)===null||y===void 0?void 0:y.shouldForwardArgs)&&(m=[...m,...t]),this._commandService.executeCommand(this.id,...m)}};n=g([v(3,N.b),v(4,K.b)],n)},fyJ8:function(Ne,ne,U){"use strict";var Q=U("rePB"),H=U("VTBJ"),I=U("Ff2n"),W=U("U8pU"),P=U("q1tI"),R=U.n(P),K=U("TSYQ"),N=U.n(K),e=U("c+Xe"),C=U("sR1s");function g(l){return l&&Object(W.a)(l)==="object"&&!Array.isArray(l)&&!P.isValidElement(l)}function v(l){return typeof l=="string"?!0:Object(e.c)(l)}function c(l,a){var n,r=l.prefixCls,t=l.className,E=l.record,y=l.index,m=l.dataIndex,T=l.render,_=l.children,f=l.component,h=f===void 0?"td":f,o=l.colSpan,u=l.rowSpan,b=l.fixLeft,p=l.fixRight,d=l.firstFixLeft,A=l.lastFixLeft,D=l.firstFixRight,S=l.lastFixRight,L=l.appendNode,M=l.additionalProps,O=M===void 0?{}:M,j=l.ellipsis,G=l.align,X=l.rowType,te=l.isSticky,fe="".concat(r,"-cell"),ve,he;if(_)he=_;else{var xe=Object(C.b)(E,m);if(he=xe,T){var Se=T(xe,E,y);g(Se)?(he=Se.children,ve=Se.props):he=Se}}Object(W.a)(he)==="object"&&!Array.isArray(he)&&!P.isValidElement(he)&&(he=null),j&&(A||D)&&(he=P.createElement("span",{className:"".concat(fe,"-content")},he));var de=ve||{},ie=de.colSpan,Le=de.rowSpan,Ve=de.style,Be=de.className,je=Object(I.a)(de,["colSpan","rowSpan","style","className"]),Ee=ie!==void 0?ie:o,Te=Le!==void 0?Le:u;if(Ee===0||Te===0)return null;var Re={},Ie=typeof b=="number",$=typeof p=="number";Ie&&(Re.position="sticky",Re.left=b),$&&(Re.position="sticky",Re.right=p);var se={};G&&(se.textAlign=G);var ue,ce=j===!0?{showTitle:!0}:j;ce&&(ce.showTitle||X==="header")&&(typeof he=="string"||typeof he=="number"?ue=he.toString():P.isValidElement(he)&&typeof he.props.children=="string"&&(ue=he.props.children));var _e=Object(H.a)(Object(H.a)(Object(H.a)({title:ue},je),O),{},{colSpan:Ee&&Ee!==1?Ee:null,rowSpan:Te&&Te!==1?Te:null,className:N()(fe,t,(n={},Object(Q.a)(n,"".concat(fe,"-fix-left"),Ie),Object(Q.a)(n,"".concat(fe,"-fix-left-first"),d),Object(Q.a)(n,"".concat(fe,"-fix-left-last"),A),Object(Q.a)(n,"".concat(fe,"-fix-right"),$),Object(Q.a)(n,"".concat(fe,"-fix-right-first"),D),Object(Q.a)(n,"".concat(fe,"-fix-right-last"),S),Object(Q.a)(n,"".concat(fe,"-ellipsis"),j),Object(Q.a)(n,"".concat(fe,"-with-append"),L),Object(Q.a)(n,"".concat(fe,"-fix-sticky"),(Ie||$)&&te),n),O.className,Be),style:Object(H.a)(Object(H.a)(Object(H.a)(Object(H.a)({},O.style),se),Re),Ve),ref:v(h)?a:null});return P.createElement(h,Object.assign({},_e),L,he)}var s=P.forwardRef(c);s.displayName="Cell";var i=P.memo(s,function(l,a){return a.shouldCellUpdate?!a.shouldCellUpdate(a.record,l.record):!1});ne.a=i},hW8S:function(Ne,ne,U){"use strict";U.d(ne,"a",function(){return W}),U.d(ne,"c",function(){return P}),U.d(ne,"b",function(){return R});var Q=U("VTBJ"),H=U("Ff2n"),I=U("Kwbf"),W="RC_TABLE_INTERNAL_COL_DEFINE";function P(K){var N=K.expandable,e=Object(H.a)(K,["expandable"]);return"expandable"in K?Object(Q.a)(Object(Q.a)({},e),N):e}function R(K){return Object.keys(K).reduce(function(N,e){return(e.substr(0,5)==="data-"||e.substr(0,5)==="aria-")&&(N[e]=K[e]),N},{})}},ic2d:function(Ne,ne,U){"use strict";U.d(ne,"a",function(){return W});var Q=U("FWmy"),H=U("746U");class I{constructor(){this.data=new Map}add(P,R){Q.a(H.l(P)),Q.a(H.k(R)),Q.a(!this.data.has(P),"There is already an extension with this id"),this.data.set(P,R)}as(P){return this.data.get(P)||null}}const W=new I},mauG:function(Ne,ne,U){"use strict";U.r(ne);var Q=U("DjyN"),H=U("NUBc"),I=U("g9YV"),W=U("wCAj"),P=U("2qtc"),R=U("kLXV"),K=U("miYZ"),N=U("tsqr"),e=U("7Kak"),C=U("9yH6"),g=U("sRBo"),v=U("kaz8"),c=U("oBTY"),s=U("/zsF"),i=U("PArb"),l=U("+L6B"),a=U("2/Rp"),n=U("9og8"),r=U("k1fw"),t=U("tJVT"),E=U("WmNS"),y=U.n(E),m=U("q1tI"),T=U.n(m),_=U("Ty5D"),f=U("55Ip"),h=U("9kvl"),o=U("xKgJ"),u=U("bTeP"),b=U.n(u),p=U("ErOA"),d=U("jhfD"),A=U("m3rI"),D=U("deN7"),S=U("J66h"),L=U.n(S),M=U("mgmH"),O=U("sZk2"),j=U.n(O),G=U("+92d"),X=U.n(G),te=U("wwSX"),fe=U.n(te),ve=U("zlzj"),he=U.n(ve),xe=[X.a,fe.a,he.a],Se=function(ie){var Le,Ve,Be,je,Ee,Te=ie.user,Re=Object(m.useState)(Object(r.a)(Object(r.a)({},Object(_.i)()),{},{page:1,per_page:10,rank_type:2,course_group:Object(o.s)()?[Te.userInfo.course.course_group_id]:[]})),Ie=Object(t.a)(Re,2),$=Ie[0],se=Ie[1],ue=Object(m.useState)([]),ce=Object(t.a)(ue,2),_e=ce[0],De=ce[1],Pe=Object(m.useState)([]),Me=Object(t.a)(Pe,2),Fe=Me[0],He=Me[1],oe=Object(m.useState)([]),me=Object(t.a)(oe,2),be=me[0],we=me[1];Object(m.useEffect)(function(){var re;Te!=null&&(re=Te.userInfo)!==null&&re!==void 0&&re.course&&(Object(o.s)()&&($.course_group=Object(o.s)()?[Te.userInfo.course.course_group_id]:[],se(Object(r.a)({},$))),pe(1))},[Te==null?void 0:Te.userInfo]);function pe(re){return ye.apply(this,arguments)}function ye(){return ye=Object(n.a)(y.a.mark(function re(Z){var J,V,Y;return y.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return ee.next=2,Object(p.a)("/api/courses/question_rank_list.json",{method:"get",params:Object(r.a)(Object(r.a)({},$),{},{id:$.coursesId,identifier:$.homeworkId})});case 2:J=ee.sent,De(J),Object(o.s)()?(Z===1&&He([J==null||((V=J.course_group)===null||V===void 0||((Y=V[0])===null||Y===void 0))?void 0:Y.id]),J!=null&&J.my_rank?we([J==null?void 0:J.my_rank].concat(Object(c.a)(J==null?void 0:J.rank_list))):we(Object(c.a)(J==null?void 0:J.rank_list))):we(Object(c.a)(J==null?void 0:J.rank_list));case 5:case"end":return ee.stop()}},re)})),ye.apply(this,arguments)}return T.a.createElement("div",{style:{width:1200,margin:"0px auto"}},T.a.createElement("aside",{className:[b.a.title,"mt20"].join(" ")},T.a.createElement(f.a,{to:"/classrooms/".concat($.coursesId,"/program_homework/").concat($.categoryId,"/detail")},T.a.createElement(d.a,{className:"font16 c-black"})),T.a.createElement("strong",{className:"font20 ml5"},"\u6392\u884C\u699C"," ",T.a.createElement("span",{style:{fontSize:14,color:"#B1BACD"}},"\u6392\u884C\u89C4\u5219\uFF1A\u5728\u8FD0\u884C\u65F6\u95F4\u76F8\u540C\u65F6\uFF0C\u5C06\u6839\u636E\u8FD0\u884C\u5185\u5B58\u3001\u63D0\u4EA4\u65F6\u95F4\u4F9D\u6B21\u8FDB\u884C\u6392\u5E8F")),T.a.createElement("span",{style:{color:"#0152d9",textAlign:"end",flex:1,cursor:"pointer"}},T.a.createElement(a.a,{style:{marginRight:10},onClick:Object(n.a)(y.a.mark(function re(){var Z;return y.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,Object(p.a)("/api/problems/".concat($.homeworkId,"/start.json"),{method:"get"});case 2:Z=V.sent,Z&&(window.open("/myproblems/".concat(Z==null?void 0:Z.identifier,"?type=1")),localStorage.setItem("program_homework",[$.coursesId,$.categoryId]));case 4:case"end":return V.stop()}},re)}))},"\u67E5\u770B\u9898\u76EE"),Object(o.c)()&&T.a.createElement(a.a,{onClick:function(){Object(M.u)(Object(r.a)(Object(r.a)({},$),{},{id:$.coursesId,identifier:$.homeworkId}))}},"\u5BFC\u51FA"))),T.a.createElement("div",{style:{background:"#fff",marginTop:10,padding:40}},T.a.createElement("div",null,T.a.createElement("p",{style:{color:"#165DFF",fontSize:18,fontWeight:400}},T.a.createElement("img",{width:20,src:j.a,style:{marginRight:5}})," \u9898\u76EE\u6392\u884C\u699C")),T.a.createElement(i.a,null),T.a.createElement("div",{style:{display:"inline-flex"}},T.a.createElement("label",null,"\u5206\u73ED\u60C5\u51B5\uFF1A"),Object(o.c)()&&T.a.createElement("div",{style:{flex:1}},T.a.createElement(v.a.Group,{className:b.a.checkboxgroup,value:Fe,onChange:function(Z){if($.type===1)He([]),$.course_group=[],$.page=1,se(Object(r.a)({},$)),pe();else if($.type===2){var J;He(["\u5168\u90E8"].concat()),$.course_group=_e==null||((J=_e.course_group)===null||J===void 0)?void 0:J.map(function(V){return V.id}),$.page=1,se(Object(r.a)({},$)),pe()}else He(Object(c.a)(Z.filter(function(V){return V!="\u5168\u90E8"}))),$.course_group=Z.filter(function(V){return V!="\u5168\u90E8"}),$.page=1,se(Object(r.a)({},$)),pe()}},T.a.createElement(v.a,{value:"\u5168\u90E8",onChange:function(Z){Z.target.checked?$.type=2:$.type=1}},"\u5168\u90E8\u5206\u73ED"),_e==null||((Le=_e.course_group)===null||Le===void 0)?void 0:Le.map(function(re,Z){return T.a.createElement(v.a,{onChange:function(V){$.type=3},value:re.id},re==null?void 0:re.name)}))),Object(o.s)()&&T.a.createElement(C.a.Group,{style:{flex:1,display:"flex",alignItems:"center"},onChange:function(Z){Z.target.value==="\u5168\u90E8"?($.course_group=[],$.page=1,se(Object(r.a)({},$)),pe()):($.course_group=[Z.target.value],$.page=1,se(Object(r.a)({},$)),pe())},defaultValue:Te.userInfo.course.course_group_id},T.a.createElement(C.a,{value:"\u5168\u90E8"},"\u5168\u90E8\u5206\u73ED"),_e==null||((Ve=_e.course_group)===null||Ve===void 0)?void 0:Ve.map(function(re,Z){return T.a.createElement(C.a,{value:re.id},re.name)}))),(_e==null||((Be=_e.all_language)===null||Be===void 0)?void 0:Be.length)>1&&T.a.createElement("div",{style:{marginTop:10}},T.a.createElement("label",null,"\u7F16\u8BD1\u8BED\u8A00\uFF1A"),T.a.createElement(C.a.Group,{className:b.a.checkboxgroup,style:{width:"90%"},onChange:function(Z){$.language=encodeURIComponent(Z.target.value),$.page=1,se(Object(r.a)({},$)),pe()},defaultValue:_e==null||((je=_e.all_language)===null||je===void 0)?void 0:je[0]},_e==null||((Ee=_e.all_language)===null||Ee===void 0)?void 0:Ee.map(function(re,Z){return T.a.createElement(C.a,{value:re},re)}))),T.a.createElement(W.a,{style:{marginTop:10},pagination:!1,dataSource:be,rowClassName:function(Z,J){return J===0&&Object(o.s)()&&b.a.tables},columns:[{title:"\u6392\u884C",dataIndex:"rank",render:function(Z,J,V){return Z<4?T.a.createElement("img",{src:xe[Z-1]}):Z}},{title:"\u7528\u6237",dataIndex:"user_name",key:"user_name",render:function(Z,J,V){return T.a.createElement("div",null,T.a.createElement("img",{style:{width:30,height:30,borderRadius:"50%",marginRight:10},src:A.a.IMG_SERVER+"/images/"+(J==null?void 0:J.image_url)}),Z)}},{title:"\u5B66\u53F7",dataIndex:"student_id",key:"student_id",render:function(Z){return Z||"- -"}},{title:"\u5206\u73ED",dataIndex:"course_group",key:"course_group"},{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"submit_time",key:"submit_time"},{title:"\u8FD0\u7528\u65F6\u95F4\uFF08ms\uFF09",dataIndex:"run_time",key:"run_time"},{title:"\u5185\u5B58\uFF08kb\uFF09",dataIndex:"memory",key:"memory"},{title:"\u7F16\u8BD1\u8BED\u8A00",dataIndex:"language",key:"language"},(_e==null?void 0:_e.open_code)&&{title:"\u64CD\u4F5C",dataIndex:"passed_rate",key:"passed_rate",render:function(Z,J){return T.a.createElement("div",{style:{cursor:"pointer",color:"rgb(22, 93, 255)"},onClick:Object(n.a)(y.a.mark(function V(){var Y;return y.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:if(!((J==null?void 0:J.code)==="-")){ee.next=3;break}return N.b.info("\u6682\u65E0\u4EE3\u7801"),ee.abrupt("return");case 3:return ee.next=5,Object(p.a)("/api/courses/view_code.json",{method:"get",params:Object(r.a)(Object(r.a)({},$),{},{id:$.coursesId,homework_common_id:$.homeworkId,hack_user_code_id:J==null?void 0:J.hack_user_code_id})});case 5:Y=ee.sent,R.a.warning({icon:null,title:"\u67E5\u770B\u4EE3\u7801",content:T.a.createElement(D.a,{languages:[{language:J.language,code:Y.code}],v:J,shixunWorkReport:"shixunWorkReport",dispatch:"dispatch",autoHeight:!1,language:J.language,game_id:J.id,data:S.Base64.decode(Y.code),diff_code_count:J.diff_code_count})});case 7:case"end":return ee.stop()}},V)}))},"\u67E5\u770B\u4EE3\u7801")}}].filter(function(re){return!!re})}),T.a.createElement("div",{style:{width:"100%",textAlign:"center",marginTop:10}},T.a.createElement(H.a,{current:$.page,pageSize:$.per_page,total:_e==null?void 0:_e.count,hideOnSinglePage:!0,onChange:function(Z,J){$.page=Z,$.per_page=J,se(Object(r.a)({},$)),pe()}}))))};ne.default=Object(h.a)(function(de){var ie=de.user;return{user:ie}})(Se)},mgmH:function(Ne,ne,U){"use strict";U.d(ne,"d",function(){return c}),U.d(ne,"b",function(){return s}),U.d(ne,"e",function(){return i}),U.d(ne,"c",function(){return l}),U.d(ne,"n",function(){return a}),U.d(ne,"g",function(){return n}),U.d(ne,"h",function(){return r}),U.d(ne,"j",function(){return E}),U.d(ne,"a",function(){return y}),U.d(ne,"l",function(){return m}),U.d(ne,"f",function(){return T}),U.d(ne,"k",function(){return _}),U.d(ne,"m",function(){return f}),U.d(ne,"i",function(){return h}),U.d(ne,"o",function(){return o}),U.d(ne,"t",function(){return u}),U.d(ne,"s",function(){return b}),U.d(ne,"p",function(){return p}),U.d(ne,"q",function(){return d}),U.d(ne,"r",function(){return A}),U.d(ne,"v",function(){return D}),U.d(ne,"u",function(){return S});var Q=U("miYZ"),H=U("tsqr"),I=U("k1fw"),W=U("9og8"),P=U("WmNS"),R=U.n(P),K=U("oUNq"),N=U("9kvl"),e=U("1vsH"),C=U("m3rI"),g=function(){Object(N.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..."}})},v=function(){Object(N.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}})},c=function(){var L=Object(W.a)(R.a.mark(function M(O){var j;return R.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return g(),X.next=3,Object(K.t)(Object(I.a)({},O));case 3:if(j=X.sent,!(j.status===0)){X.next=7;break}return X.next=7,Object(e.w)("",Object(e.Y)({url:C.a.API_SERVER+"/api/courses/".concat(O.coursesId,"/export_couser_info.json"),query:O}));case 7:v();case 8:case"end":return X.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),s=function(){var L=Object(W.a)(R.a.mark(function M(O){var j;return R.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(K.r)(Object(I.a)({},O));case 2:if(j=X.sent,!(j.status===0)){X.next=8;break}H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_member_act_score")),X.next=13;break;case 8:if(!(j.status===-2)){X.next=12;break}return X.abrupt("return",j);case 12:j.status===-3&&(Object(N.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_member_act_score")));case 13:case"end":return X.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),i=function(){var L=Object(W.a)(R.a.mark(function M(O){var j;return R.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(K.u)(Object(I.a)({},O));case 2:if(j=X.sent,!(j.status===0)){X.next=8;break}H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_total_score")),X.next=13;break;case 8:if(!(j.status===-2)){X.next=12;break}return X.abrupt("return",j);case 12:j.status===-3&&(Object(N.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_total_score")));case 13:case"end":return X.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),l=function(){var L=Object(W.a)(R.a.mark(function M(O){var j;return R.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(K.s)(Object(I.a)({},O));case 2:if(j=X.sent,!(j.status===0)){X.next=8;break}H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_total_exercise_and_other")),X.next=13;break;case 8:if(!(j.status===-2)){X.next=12;break}return X.abrupt("return",j);case 12:j.status===-3&&(Object(N.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return X.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),a=function(){var L=Object(W.a)(R.a.mark(function M(O){var j;return R.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(K.z)(Object(I.a)({},O));case 2:if(j=X.sent,!(j.status===0)){X.next=8;break}H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_total_exercise_and_other")),X.next=13;break;case 8:if(!(j.status===-2)){X.next=12;break}return X.abrupt("return",j);case 12:j.status===-3&&(Object(N.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return X.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),n=function(){var L=Object(W.a)(R.a.mark(function M(O){var j;return R.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(K.v)(Object(I.a)({},O));case 2:if(j=X.sent,!(j.status===0)){X.next=8;break}H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_total_homework")),X.next=13;break;case 8:if(!(j.status===-2)){X.next=12;break}return X.abrupt("return",j);case 12:j.status===-3&&(Object(N.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_total_homework")));case 13:case"end":return X.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),r=function(){var L=Object(W.a)(R.a.mark(function M(O,j){var G;return R.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.next=2,Object(K.x)(Object(I.a)({},O));case 2:G=te.sent,G.status===0?(H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/").concat(j))):G.status===-3&&(Object(N.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/").concat(j)));case 4:case"end":return te.stop()}},M)}));return function(O,j){return L.apply(this,arguments)}}(),t=function(){var L=Object(W.a)(R.a.mark(function M(O){var j;return R.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return g(),X.next=3,Object(K.w)(Object(I.a)({},O));case 3:if(j=X.sent,!(j.status===0)){X.next=7;break}return X.next=7,Object(e.w)("",Object(e.Y)({url:C.a.API_SERVER+"/api/homework_commons/".concat(O.categoryId,"/works_list.zip"),query:O}));case 7:v();case 8:case"end":return X.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),E=function(){var L=Object(W.a)(R.a.mark(function M(O){var j;return R.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return g(),X.next=3,Object(K.A)(Object(I.a)({},O));case 3:if(j=X.sent,!(j.status===0)){X.next=7;break}return X.next=7,Object(e.w)("",Object(e.Y)({url:C.a.API_SERVER+"/api/polls/".concat(O.categoryId,"/commit_result.xlsx"),query:O}));case 7:v();case 8:case"end":return X.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),y=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(e.v)("",Object(e.Y)({url:C.a.API_SERVER+"/api/courses/".concat(O.coursesId,"/attendances/export_xlsx_data.xlsx"),query:O}));case 2:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),m=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(e.v)("",Object(e.Y)({url:C.a.API_SERVER+"/api/courses/".concat(O.coursesId,"/video_study_statics.xlsx"),query:O}));case 2:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),T=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(e.v)("",Object(e.Y)({url:C.a.API_SERVER+"/api/courses/".concat(O.coursesId,"/export_course_students_info.xlsx"),query:O}));case 2:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),_=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(e.v)("",Object(e.Y)({url:C.a.API_SERVER+"/api/item_banks/export.xlsx",query:O}));case 2:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),f=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(e.v)("",Object(e.Y)({url:C.a.API_SERVER+"/api/competitions/region_reports.xlsx",query:O}));case 2:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),h=function(){var L=Object(W.a)(R.a.mark(function M(O){var j;return R.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(K.y)(Object(I.a)({},O));case 2:j=X.sent,j.status===0?(H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/exercise_score"))):j.status===-3&&(Object(N.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/exercise_score")));case 4:case"end":return X.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),o=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return console.log("----------","\u8C03\u7528\u4E0B\u8F7D"),G.next=3,Object(e.v)("",Object(e.Y)({url:C.a.API_SERVER+"/api/export_records/".concat(O.id,".xlsx"),query:O}));case 3:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),u=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(e.v)("",Object(e.Y)({url:C.a.API_SERVER+"/api/ec_major_schools/0/ec_years.xlsx",query:O}));case 2:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),b=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(e.v)("",Object(e.Y)({url:C.a.API_SERVER+"/api/ec_years/".concat(O==null?void 0:O.ec_year_id,"/ec_training_objectives.xlsx"),query:O}));case 2:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),p=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(e.v)(O==null?void 0:O.name,Object(e.Y)({url:C.a.API_SERVER+"/api/attachments/get_ecs_attachment.docx",query:O}));case 2:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),d=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(e.v)("",Object(e.Y)({url:C.a.API_SERVER+"/api/ec_years/".concat(O==null?void 0:O.ec_year_id,"/ec_courses.xlsx"),query:O}));case 2:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),A=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(e.v)("",Object(e.Y)({url:C.a.API_SERVER+"/api/ec_years/".concat(O==null?void 0:O.ec_year_id,"/ec_graduation_requirements.xlsx"),query:O}));case 2:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),D=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(e.v)("",Object(e.Y)({url:C.a.API_SERVER+"/api/courses/rank_list.xlsx",query:O}));case 2:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),S=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(e.v)("",Object(e.Y)({url:C.a.API_SERVER+"/api/courses/question_rank_list.xlsx",query:O}));case 2:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}()},n6Qo:function(Ne,ne,U){"use strict";U.d(ne,"a",function(){return N});var Q=U("q1tI"),H=U("biw7"),I=U("fyJ8");function W(e){var C=e.className,g=e.index,v=e.children,c=e.colSpan,s=e.rowSpan,i=Q.useContext(H.a),l=i.prefixCls,a=i.fixedInfoList,n=a[g];return Q.createElement(I.a,Object.assign({className:C,index:g,component:"td",prefixCls:l,record:null,dataIndex:null,render:function(){return{children:v,props:{colSpan:c,rowSpan:s}}}},n))}function P(e){return Q.createElement("tr",Object.assign({},e))}function R(e){var C=e.children,g=Q.useContext(H.a),v=g.prefixCls;return Q.createElement("tfoot",{className:"".concat(v,"-summary")},C)}var K=ne.b=R,N={Cell:W,Row:P}},nEHx:function(Ne,ne,U){"use strict";U.d(ne,"a",function(){return Q});var Q;(function(H){H.DARK="dark",H.LIGHT="light",H.HIGH_CONTRAST="hc"})(Q||(Q={}))},nnTU:function(Ne,ne,U){"use strict";U.d(ne,"b",function(){return K}),U.d(ne,"a",function(){return N});var Q=U("MI8n"),H=U("JYp7"),I=U("pmY6"),W=U("24hK"),P=U("746U"),R=U("Cg/j");const K=Object(R.c)("commandService"),N=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Q.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,C){if(!e)throw new Error("invalid command");if(typeof e=="string"){if(!C)throw new Error("invalid command");return this.registerCommand({id:e,handler:C})}if(e.description){const i=[];for(let a of e.description.args)i.push(a.constraint);const l=e.handler;e.handler=function(a,...n){return Object(P.o)(n,i),l(a,...n)}}const{id:g}=e;let v=this._commands.get(g);v||(v=new W.a,this._commands.set(g,v));let c=v.unshift(e),s=Object(I.i)(()=>{c();const i=this._commands.get(g);(i==null?void 0:i.isEmpty())&&this._commands.delete(g)});return this._onDidRegisterCommand.fire(g),s}registerCommandAlias(e,C){return N.registerCommand(e,(g,...v)=>g.get(K).executeCommand(C,...v))}getCommand(e){const C=this._commands.get(e);return!C||C.isEmpty()?void 0:H.a.first(C)}getCommands(){const e=new Map;for(const C of this._commands.keys()){const g=this.getCommand(C);g&&e.set(C,g)}return e}};N.registerCommand("noop",()=>{})},p5ED:function(Ne,ne,U){"use strict";var Q=U("+L6B"),H=U("2/Rp"),I=U("5Dmo"),W=U("3S7+"),P=U("k1fw"),R=U("9og8"),K=U("tJVT"),N=U("WmNS"),e=U.n(N),C=U("q1tI"),g=U.n(C),v=U("vHTk"),c=U.n(v),s=U("yEEn"),i=U("ZW9T"),l=U("1vsH"),a=U("V0Rq"),n=U("m3rI");ne.a=function(r){var t,E,y,m,T,_,f,h=r.editOffice,o=h===void 0?"view":h,u=r.data,b=r.theme,p=r.type,d=r.filename,A=r.monacoEditor,D=r.className,S=r.style,L=r.close,M=r.onClose,O=r.hasMask,j=r.disabledDownload,G=Object(C.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),X=Object(K.a)(G,2),te=X[0],fe=X[1],ve=Object(C.useState)(""),he=Object(K.a)(ve,2),xe=he[0],Se=he[1],de=Object(C.useState)(),ie=Object(K.a)(de,2),Le=ie[0],Ve=ie[1],Be=window.ENV==="build"?"/react/build":"",je=n.a.PROXY_SERVER||location.origin,Ee,Te=1024*1024,Re=10*Te,Ie=Object(C.useRef)();(t=u)!==null&&t!==void 0&&t.startsWith("/api")&&p!=="txt"&&(u=n.a.API_SERVER+u),p==="office"&&(Ee=Object(l.T)(u).filesize,Ee>Re&&(p="other")),d&&A&&(A.filename=d),Object(C.useEffect)(function(){var ce,_e,De=(ce=document.cookie)===null||ce===void 0||((_e=ce.replace(/\s/g,""))===null||_e===void 0)?void 0:_e.split(";");De==null||De.map(function(Pe){var Me=Pe.split("=");Me[0]==="_educoder_session"&&Se(Me[1])})},[]),Object(C.useEffect)(function(){p==="office"&&$()},[p,u]);var $=function(){var ce=Object(R.a)(e.a.mark(function _e(){var De,Pe,Me;return e.a.wrap(function(He){for(;;)switch(He.prev=He.next){case 0:return console.log("data:",u),De=u,u.startsWith("http")||(De=location.origin+De),Pe=new URL(De).pathname.split("/").pop(),He.next=6,Object(a.V)({attachment_id:Pe});case 6:Me=He.sent,Ve(Me);case 8:case"end":return He.stop()}},_e)}));return function(){return ce.apply(this,arguments)}}(),se=function(){if(u.startsWith("http")||u.startsWith("blob:")){ue();return}Object(l.z)(d||"educoder",u,d)},ue=function(){Object(l.x)(d||"educoder",decodeURIComponent(u))};return g.a.createElement("div",{style:Object(P.a)({},S||{}),className:"".concat(O&&c.a.bgBlack," ").concat(p?c.a.wrp:"hide")},L&&g.a.createElement("div",{className:c.a.close,ref:Ie},!j&&g.a.createElement(W.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ie.current}},g.a.createElement("span",{onClick:ue},g.a.createElement("i",{className:"icon-quxiaozhiding"}))),g.a.createElement(W.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ie.current}},g.a.createElement("span",{className:"",onClick:M},g.a.createElement("i",{className:"icon-guanbi1"})))),g.a.createElement("div",{className:"".concat(c.a[D]," ").concat(D," ").concat(c.a.monaco," ").concat(p==="txt"?"show":"hide")},p==="txt"&&g.a.createElement(i.b,A)),p==="audio"&&g.a.createElement("audio",{src:"".concat(((E=u)===null||E===void 0?void 0:E.indexOf("http://"))>-1||((y=u)===null||y===void 0?void 0:y.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(u),autoPlay:!0}),p==="video"&&g.a.createElement(g.a.Fragment,null,((m=u)===null||m===void 0?void 0:m.indexOf("http"))>-1?g.a.createElement("video",{controls:!0,src:"".concat(u),autoPlay:!0}):g.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(u),autoPlay:!0})),p==="office"&&Le&&g.a.createElement("iframe",{src:"".concat(Be,"/office.html?key=").concat(Le.key,"&url=").concat(je+Le.url,"&callbackUrl=").concat(je+Le.callbackUrl,"&fileType=").concat(Le.fileType,"&title=").concat(Le.title,"&model=").concat(o,"&officeServer=").concat(n.a.OFFICE_SERVER,"&disabledDownload=").concat(!!j)}),p==="html"&&g.a.createElement("iframe",{src:u+"&disposition=inline"}),p==="pdf"&&g.a.createElement("iframe",{src:"".concat(Be,"/js/pdfview/index.html?url=").concat(u,"&disabledDownload=").concat(!!j)}),p==="image"&&g.a.createElement("img",{src:"".concat(((T=u)===null||T===void 0?void 0:T.indexOf("http://"))>-1||((_=u)===null||_===void 0?void 0:_.indexOf("https://"))>-1||(f=u)!==null&&f!==void 0&&f.startsWith("/api")?"":"data:image/png;base64,").concat(u)}),p==="other"&&g.a.createElement("div",null,g.a.createElement(H.a,{type:"primary",size:"large",onClick:se},g.a.createElement(s.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),p==="download"&&g.a.createElement(H.a,{type:"primary",size:"large",onClick:se},g.a.createElement(s.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},pmY6:function(Ne,ne,U){"use strict";U.d(ne,"h",function(){return C}),U.d(ne,"g",function(){return v}),U.d(ne,"f",function(){return c}),U.d(ne,"e",function(){return s}),U.d(ne,"i",function(){return i}),U.d(ne,"b",function(){return l}),U.d(ne,"a",function(){return a}),U.d(ne,"d",function(){return n}),U.d(ne,"c",function(){return r});var Q=U("C/vA"),H=U("JYp7");const I=!1;let W=null;function P(t){W=t}if(I){const t="__is_disposable_tracked__";P(new class{trackDisposable(E){const y=new Error("Potentially leaked disposable").stack;setTimeout(()=>{E[t]||console.log(y)},3e3)}setParent(E,y){if(E&&E!==a.None)try{E[t]=!0}catch(m){}}markAsDisposed(E){if(E&&E!==a.None)try{E[t]=!0}catch(y){}}markAsSingleton(E){}})}function R(t){return W==null||W.trackDisposable(t),t}function K(t){W==null||W.markAsDisposed(t)}function N(t,E){W==null||W.setParent(t,E)}function e(t,E){if(!W)return;for(const y of t)W.setParent(y,E)}function C(t){return W==null||W.markAsSingleton(t),t}class g extends Error{constructor(t){super(`Encountered errors while disposing of store. Errors: [${t.join(", ")}]`);this.errors=t}}function v(t){return typeof t.dispose=="function"&&t.dispose.length===0}function c(t){if(H.a.is(t)){let E=[];for(const y of t)if(y)try{y.dispose()}catch(m){E.push(m)}if(E.length===1)throw E[0];if(E.length>1)throw new g(E);return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function s(...t){const E=i(()=>c(t));return e(t,E),E}function i(t){const E=R({dispose:Object(Q.a)(()=>{K(E),t()})});return E}class l{constructor(){this._toDispose=new Set,this._isDisposed=!1,R(this)}dispose(){if(this._isDisposed)return;K(this),this._isDisposed=!0,this.clear()}clear(){try{c(this._toDispose.values())}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return N(t,this),this._isDisposed?l.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}}l.DISABLE_DISPOSED_WARNING=!1;class a{constructor(){this._store=new l,R(this),N(this._store,this)}dispose(){K(this),this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}}a.None=Object.freeze({dispose(){}});class n{constructor(){this._isDisposed=!1,R(this)}get value(){return this._isDisposed?void 0:this._value}set value(t){var E;if(this._isDisposed||t===this._value)return;(E=this._value)===null||E===void 0||E.dispose(),t&&N(t,this),this._value=t}clear(){this.value=void 0}dispose(){var t;this._isDisposed=!0,K(this),(t=this._value)===null||t===void 0||t.dispose(),this._value=void 0}clearAndLeak(){const t=this._value;return this._value=void 0,t&&N(t,null),t}}class r{constructor(t){this.object=t}dispose(){}}},psGv:function(Ne,ne,U){var Q,H;(function(){var I;(function(){"use strict";var K=[,,function(g){function v(i){this.__parent=i,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}v.prototype.clone_empty=function(){var i=new v(this.__parent);return i.set_indent(this.__indent_count,this.__alignment_count),i},v.prototype.item=function(i){return i<0?this.__items[this.__items.length+i]:this.__items[i]},v.prototype.has_match=function(i){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(i))return!0;return!1},v.prototype.set_indent=function(i,l){this.is_empty()&&(this.__indent_count=i||0,this.__alignment_count=l||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},v.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},v.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},v.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var i=this.__parent.current_line;return i.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),i.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),i.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,i.__items[0]===" "&&(i.__items.splice(0,1),i.__character_count-=1),!0}return!1},v.prototype.is_empty=function(){return this.__items.length===0},v.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},v.prototype.push=function(i){this.__items.push(i);var l=i.lastIndexOf(`
`);l!==-1?this.__character_count=i.length-l:this.__character_count+=i.length},v.prototype.pop=function(){var i=null;return this.is_empty()||(i=this.__items.pop(),this.__character_count-=i.length),i},v.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},v.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},v.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},v.prototype.toString=function(){var i="";return this.is_empty()?this.__parent.indent_empty_lines&&(i=this.__parent.get_indent_string(this.__indent_count)):(i=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),i+=this.__items.join("")),i};function c(i,l){this.__cache=[""],this.__indent_size=i.indent_size,this.__indent_string=i.indent_char,i.indent_with_tabs||(this.__indent_string=new Array(i.indent_size+1).join(i.indent_char)),l=l||"",i.indent_level>0&&(l=new Array(i.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}c.prototype.get_indent_size=function(i,l){var a=this.__base_string_length;return l=l||0,i<0&&(a=0),a+=i*this.__indent_size,a+=l,a},c.prototype.get_indent_string=function(i,l){var a=this.__base_string;return l=l||0,i<0&&(i=0,a=""),l+=i*this.__indent_size,this.__ensure_cache(l),a+=this.__cache[l],a},c.prototype.__ensure_cache=function(i){for(;i>=this.__cache.length;)this.__add_column()},c.prototype.__add_column=function(){var i=this.__cache.length,l=0,a="";this.__indent_size&&i>=this.__indent_size&&(l=Math.floor(i/this.__indent_size),i-=l*this.__indent_size,a=new Array(l+1).join(this.__indent_string)),i&&(a+=new Array(i+1).join(" ")),this.__cache.push(a)};function s(i,l){this.__indent_cache=new c(i,l),this.raw=!1,this._end_with_newline=i.end_with_newline,this.indent_size=i.indent_size,this.wrap_line_length=i.wrap_line_length,this.indent_empty_lines=i.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new v(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}s.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},s.prototype.get_line_number=function(){return this.__lines.length},s.prototype.get_indent_string=function(i,l){return this.__indent_cache.get_indent_string(i,l)},s.prototype.get_indent_size=function(i,l){return this.__indent_cache.get_indent_size(i,l)},s.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},s.prototype.add_new_line=function(i){return this.is_empty()||!i&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},s.prototype.get_code=function(i){this.trim(!0);var l=this.current_line.pop();l&&(l[l.length-1]===`
`&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
`);return i!==`
`&&(a=a.replace(/[\n]/g,i)),a},s.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},s.prototype.set_indent=function(i,l){return i=i||0,l=l||0,this.next_line.set_indent(i,l),this.__lines.length>1?(this.current_line.set_indent(i,l),!0):(this.current_line.set_indent(),!1)},s.prototype.add_raw_token=function(i){for(var l=0;l<i.newlines;l++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(i.whitespace_before),this.current_line.push(i.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},s.prototype.add_token=function(i){this.__add_space_before_token(),this.current_line.push(i),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},s.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},s.prototype.remove_indent=function(i){for(var l=this.__lines.length;i<l;)this.__lines[i]._remove_indent(),i++;this.current_line._remove_wrap_indent()},s.prototype.trim=function(i){for(i=i===void 0?!1:i,this.current_line.trim();i&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},s.prototype.just_added_newline=function(){return this.current_line.is_empty()},s.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},s.prototype.ensure_empty_line_above=function(i,l){for(var a=this.__lines.length-2;a>=0;){var n=this.__lines[a];if(n.is_empty())break;if(n.item(0).indexOf(i)!==0&&n.item(-1)!==l){this.__lines.splice(a+1,0,new v(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},g.exports.Output=s},function(g){function v(c,s,i,l){this.type=c,this.text=s,this.comments_before=null,this.newlines=i||0,this.whitespace_before=l||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}g.exports.Token=v},,,function(g){function v(i,l){this.raw_options=c(i,l),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}v.prototype._get_array=function(i,l){var a=this.raw_options[i],n=l||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(n=a.concat()):typeof a=="string"&&(n=a.split(/[^a-zA-Z0-9_\/\-]+/)),n},v.prototype._get_boolean=function(i,l){var a=this.raw_options[i],n=a===void 0?!!l:!!a;return n},v.prototype._get_characters=function(i,l){var a=this.raw_options[i],n=l||"";return typeof a=="string"&&(n=a.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),n},v.prototype._get_number=function(i,l){var a=this.raw_options[i];l=parseInt(l,10),isNaN(l)&&(l=0);var n=parseInt(a,10);return isNaN(n)&&(n=l),n},v.prototype._get_selection=function(i,l,a){var n=this._get_selection_list(i,l,a);if(n.length!==1)throw new Error("Invalid Option Value: The option '"+i+`' can only be one of the following values:
`+l+`
You passed in: '`+this.raw_options[i]+"'");return n[0]},v.prototype._get_selection_list=function(i,l,a){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[l[0]],!this._is_valid_selection(a,l))throw new Error("Invalid Default Value!");var n=this._get_array(i,a);if(!this._is_valid_selection(n,l))throw new Error("Invalid Option Value: The option '"+i+`' can contain only the following values:
`+l+`
You passed in: '`+this.raw_options[i]+"'");return n},v.prototype._is_valid_selection=function(i,l){return i.length&&l.length&&!i.some(function(a){return l.indexOf(a)===-1})};function c(i,l){var a={};i=s(i);var n;for(n in i)n!==l&&(a[n]=i[n]);if(l&&i[l])for(n in i[l])a[n]=i[l][n];return a}function s(i){var l={},a;for(a in i){var n=a.replace(/-/g,"_");l[n]=i[a]}return l}g.exports.Options=v,g.exports.normalizeOpts=s,g.exports.mergeOpts=c},,function(g){var v=RegExp.prototype.hasOwnProperty("sticky");function c(s){this.__input=s||"",this.__input_length=this.__input.length,this.__position=0}c.prototype.restart=function(){this.__position=0},c.prototype.back=function(){this.__position>0&&(this.__position-=1)},c.prototype.hasNext=function(){return this.__position<this.__input_length},c.prototype.next=function(){var s=null;return this.hasNext()&&(s=this.__input.charAt(this.__position),this.__position+=1),s},c.prototype.peek=function(s){var i=null;return s=s||0,s+=this.__position,s>=0&&s<this.__input_length&&(i=this.__input.charAt(s)),i},c.prototype.__match=function(s,i){s.lastIndex=i;var l=s.exec(this.__input);return l&&!(v&&s.sticky)&&(l.index!==i&&(l=null)),l},c.prototype.test=function(s,i){return i=i||0,i+=this.__position,i>=0&&i<this.__input_length?!!this.__match(s,i):!1},c.prototype.testChar=function(s,i){var l=this.peek(i);return s.lastIndex=0,l!==null&&s.test(l)},c.prototype.match=function(s){var i=this.__match(s,this.__position);return i?this.__position+=i[0].length:i=null,i},c.prototype.read=function(s,i,l){var a="",n;return s&&(n=this.match(s),n&&(a+=n[0])),i&&(n||!s)&&(a+=this.readUntil(i,l)),a},c.prototype.readUntil=function(s,i){var l="",a=this.__position;s.lastIndex=this.__position;var n=s.exec(this.__input);return n?(a=n.index,i&&(a+=n[0].length)):a=this.__input_length,l=this.__input.substring(this.__position,a),this.__position=a,l},c.prototype.readUntilAfter=function(s){return this.readUntil(s,!0)},c.prototype.get_regexp=function(s,i){var l=null,a="g";return i&&v&&(a="y"),typeof s=="string"&&s!==""?l=new RegExp(s,a):s&&(l=new RegExp(s.source,a)),l},c.prototype.get_literal_regexp=function(s){return RegExp(s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},c.prototype.peekUntilAfter=function(s){var i=this.__position,l=this.readUntilAfter(s);return this.__position=i,l},c.prototype.lookBack=function(s){var i=this.__position-1;return i>=s.length&&this.__input.substring(i-s.length,i).toLowerCase()===s},g.exports.InputScanner=c},function(g,v,c){var s=c(8).InputScanner,i=c(3).Token,l=c(10).TokenStream,a=c(11).WhitespacePattern,n={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},r=function(t,E){this._input=new s(t),this._options=E||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new a(this._input)};r.prototype.tokenize=function(){this._input.restart(),this.__tokens=new l,this._reset();for(var t,E=new i(n.START,""),y=null,m=[],T=new l;E.type!==n.EOF;){for(t=this._get_next_token(E,y);this._is_comment(t);)T.add(t),t=this._get_next_token(E,y);T.isEmpty()||(t.comments_before=T,T=new l),t.parent=y,this._is_opening(t)?(m.push(y),y=t):y&&this._is_closing(t,y)&&(t.opened=y,y.closed=t,y=m.pop(),t.parent=y),t.previous=E,E.next=t,this.__tokens.add(t),E=t}return this.__tokens},r.prototype._is_first_token=function(){return this.__tokens.isEmpty()},r.prototype._reset=function(){},r.prototype._get_next_token=function(t,E){this._readWhitespace();var y=this._input.read(/.+/g);return y?this._create_token(n.RAW,y):this._create_token(n.EOF,"")},r.prototype._is_comment=function(t){return!1},r.prototype._is_opening=function(t){return!1},r.prototype._is_closing=function(t,E){return!1},r.prototype._create_token=function(t,E){var y=new i(t,E,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return y},r.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},g.exports.Tokenizer=r,g.exports.TOKEN=n},function(g){function v(c){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=c}v.prototype.restart=function(){this.__position=0},v.prototype.isEmpty=function(){return this.__tokens_length===0},v.prototype.hasNext=function(){return this.__position<this.__tokens_length},v.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__tokens[this.__position],this.__position+=1),c},v.prototype.peek=function(c){var s=null;return c=c||0,c+=this.__position,c>=0&&c<this.__tokens_length&&(s=this.__tokens[c]),s},v.prototype.add=function(c){this.__parent_token&&(c.parent=this.__parent_token),this.__tokens.push(c),this.__tokens_length+=1},g.exports.TokenStream=v},function(g,v,c){var s=c(12).Pattern;function i(l,a){s.call(this,l,a),a?this._line_regexp=this._input.get_regexp(a._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}i.prototype=new s,i.prototype.__set_whitespace_patterns=function(l,a){l+="\\t ",a+="\\n\\r",this._match_pattern=this._input.get_regexp("["+l+a+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+a+"]")},i.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var l=this._input.read(this._match_pattern);if(l===" ")this.whitespace_before_token=" ";else if(l){var a=this.__split(this._newline_regexp,l);this.newline_count=a.length-1,this.whitespace_before_token=a[this.newline_count]}return l},i.prototype.matching=function(l,a){var n=this._create();return n.__set_whitespace_patterns(l,a),n._update(),n},i.prototype._create=function(){return new i(this._input,this)},i.prototype.__split=function(l,a){l.lastIndex=0;for(var n=0,r=[],t=l.exec(a);t;)r.push(a.substring(n,t.index)),n=t.index+t[0].length,t=l.exec(a);return n<a.length?r.push(a.substring(n,a.length)):r.push(""),r},g.exports.WhitespacePattern=i},function(g){function v(c,s){this._input=c,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,s&&(this._starting_pattern=this._input.get_regexp(s._starting_pattern,!0),this._match_pattern=this._input.get_regexp(s._match_pattern,!0),this._until_pattern=this._input.get_regexp(s._until_pattern),this._until_after=s._until_after)}v.prototype.read=function(){var c=this._input.read(this._starting_pattern);return(!this._starting_pattern||c)&&(c+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),c},v.prototype.read_match=function(){return this._input.match(this._match_pattern)},v.prototype.until_after=function(c){var s=this._create();return s._until_after=!0,s._until_pattern=this._input.get_regexp(c),s._update(),s},v.prototype.until=function(c){var s=this._create();return s._until_after=!1,s._until_pattern=this._input.get_regexp(c),s._update(),s},v.prototype.starting_with=function(c){var s=this._create();return s._starting_pattern=this._input.get_regexp(c,!0),s._update(),s},v.prototype.matching=function(c){var s=this._create();return s._match_pattern=this._input.get_regexp(c,!0),s._update(),s},v.prototype._create=function(){return new v(this._input,this)},v.prototype._update=function(){},g.exports.Pattern=v},function(g){function v(c,s){c=typeof c=="string"?c:c.source,s=typeof s=="string"?s:s.source,this.__directives_block_pattern=new RegExp(c+/ beautify( \w+[:]\w+)+ /.source+s,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(c+/\sbeautify\signore:end\s/.source+s,"g")}v.prototype.get_directives=function(c){if(!c.match(this.__directives_block_pattern))return null;var s={};this.__directive_pattern.lastIndex=0;for(var i=this.__directive_pattern.exec(c);i;)s[i[1]]=i[2],i=this.__directive_pattern.exec(c);return s},v.prototype.readIgnored=function(c){return c.readUntilAfter(this.__directives_end_ignore_pattern)},g.exports.Directives=v},function(g,v,c){var s=c(12).Pattern,i={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function l(a,n){s.call(this,a,n),this.__template_pattern=null,this._disabled=Object.assign({},i),this._excluded=Object.assign({},i),n&&(this.__template_pattern=this._input.get_regexp(n.__template_pattern),this._excluded=Object.assign(this._excluded,n._excluded),this._disabled=Object.assign(this._disabled,n._disabled));var r=new s(a);this.__patterns={handlebars_comment:r.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:r.starting_with(/{{{/).until_after(/}}}/),handlebars:r.starting_with(/{{/).until_after(/}}/),php:r.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:r.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:r.starting_with(/{%/).until_after(/%}/),django_value:r.starting_with(/{{/).until_after(/}}/),django_comment:r.starting_with(/{#/).until_after(/#}/),smarty:r.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:r.starting_with(/{\*/).until_after(/\*}/),smarty_literal:r.starting_with(/{literal}/).until_after(/{\/literal}/)}}l.prototype=new s,l.prototype._create=function(){return new l(this._input,this)},l.prototype._update=function(){this.__set_templated_pattern()},l.prototype.disable=function(a){var n=this._create();return n._disabled[a]=!0,n._update(),n},l.prototype.read_options=function(a){var n=this._create();for(var r in i)n._disabled[r]=a.templating.indexOf(r)===-1;return n._update(),n},l.prototype.exclude=function(a){var n=this._create();return n._excluded[a]=!0,n._update(),n},l.prototype.read=function(){var a="";this._match_pattern?a=this._input.read(this._starting_pattern):a=this._input.read(this._starting_pattern,this.__template_pattern);for(var n=this._read_template();n;)this._match_pattern?n+=this._input.read(this._match_pattern):n+=this._input.readUntil(this.__template_pattern),a+=n,n=this._read_template();return this._until_after&&(a+=this._input.readUntilAfter(this._until_pattern)),a},l.prototype.__set_templated_pattern=function(){var a=[];this._disabled.php||a.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||a.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||a.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(a.push(this.__patterns.django._starting_pattern.source),a.push(this.__patterns.django_value._starting_pattern.source),a.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||a.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&a.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+a.join("|")+")")},l.prototype._read_template=function(){var a="",n=this._input.peek();if(n==="<"){var r=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&r==="?"&&(a=a||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&r==="%"&&(a=a||this.__patterns.erb.read())}else n==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(a=a||this.__patterns.handlebars_comment.read(),a=a||this.__patterns.handlebars_unescaped.read(),a=a||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(a=a||this.__patterns.django_value.read()),this._excluded.django||(a=a||this.__patterns.django_comment.read(),a=a||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(a=a||this.__patterns.smarty_comment.read(),a=a||this.__patterns.smarty_literal.read(),a=a||this.__patterns.smarty.read()));return a},g.exports.TemplatablePattern=l},,,,function(g,v,c){var s=c(19).Beautifier,i=c(20).Options;function l(a,n,r,t){var E=new s(a,n,r,t);return E.beautify()}g.exports=l,g.exports.defaultOptions=function(){return new i}},function(g,v,c){var s=c(20).Options,i=c(2).Output,l=c(21).Tokenizer,a=c(21).TOKEN,n=/\r\n|[\r\n]/,r=/\r\n|[\r\n]/g,t=function(b,p){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=b.max_preserve_newlines,this.preserve_newlines=b.preserve_newlines,this._output=new i(b,p)};t.prototype.current_line_has_match=function(b){return this._output.current_line.has_match(b)},t.prototype.set_space_before_token=function(b,p){this._output.space_before_token=b,this._output.non_breaking_space=p},t.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},t.prototype.add_raw_token=function(b){this._output.add_raw_token(b)},t.prototype.print_preserved_newlines=function(b){var p=0;b.type!==a.TEXT&&b.previous.type!==a.TEXT&&(p=b.newlines?1:0),this.preserve_newlines&&(p=b.newlines<this.max_preserve_newlines+1?b.newlines:this.max_preserve_newlines+1);for(var d=0;d<p;d++)this.print_newline(d>0);return p!==0},t.prototype.traverse_whitespace=function(b){return b.whitespace_before||b.newlines?(this.print_preserved_newlines(b)||(this._output.space_before_token=!0),!0):!1},t.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},t.prototype.print_newline=function(b){this._output.add_new_line(b)},t.prototype.print_token=function(b){b.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(b.text))},t.prototype.indent=function(){this.indent_level++},t.prototype.get_full_indent=function(b){return b=this.indent_level+(b||0),b<1?"":this._output.get_indent_string(b)};var E=function(b){for(var p=null,d=b.next;d.type!==a.EOF&&b.closed!==d;){if(d.type===a.ATTRIBUTE&&d.text==="type"){d.next&&d.next.type===a.EQUALS&&d.next.next&&d.next.next.type===a.VALUE&&(p=d.next.next.text);break}d=d.next}return p},y=function(b,p){var d=null,A=null;return p.closed?(b==="script"?d="text/javascript":b==="style"&&(d="text/css"),d=E(p)||d,d.search("text/css")>-1?A="css":d.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?A="javascript":d.search(/(text|application|dojo)\/(x-)?(html)/)>-1?A="html":d.search(/test\/null/)>-1&&(A="null"),A):null};function m(b,p){return p.indexOf(b)!==-1}function T(b,p,d){this.parent=b||null,this.tag=p?p.tag_name:"",this.indent_level=d||0,this.parser_token=p||null}function _(b){this._printer=b,this._current_frame=null}_.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},_.prototype.record_tag=function(b){var p=new T(this._current_frame,b,this._printer.indent_level);this._current_frame=p},_.prototype._try_pop_frame=function(b){var p=null;return b&&(p=b.parser_token,this._printer.indent_level=b.indent_level,this._current_frame=b.parent),p},_.prototype._get_frame=function(b,p){for(var d=this._current_frame;d&&!(b.indexOf(d.tag)!==-1);){if(p&&p.indexOf(d.tag)!==-1){d=null;break}d=d.parent}return d},_.prototype.try_pop=function(b,p){var d=this._get_frame([b],p);return this._try_pop_frame(d)},_.prototype.indent_to_tag=function(b){var p=this._get_frame(b);p&&(this._printer.indent_level=p.indent_level)};function f(b,p,d,A){this._source_text=b||"",p=p||{},this._js_beautify=d,this._css_beautify=A,this._tag_stack=null;var D=new s(p,"html");this._options=D,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}f.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var b=this._source_text,p=this._options.eol;this._options.eol==="auto"&&(p=`
`,b&&n.test(b)&&(p=b.match(n)[0])),b=b.replace(r,`
`);var d=b.match(/^[\t ]*/)[0],A={text:"",type:""},D=new h,S=new t(this._options,d),L=new l(b,this._options).tokenize();this._tag_stack=new _(S);for(var M=null,O=L.next();O.type!==a.EOF;)O.type===a.TAG_OPEN||O.type===a.COMMENT?(M=this._handle_tag_open(S,O,D,A),D=M):O.type===a.ATTRIBUTE||O.type===a.EQUALS||O.type===a.VALUE||O.type===a.TEXT&&!D.tag_complete?M=this._handle_inside_tag(S,O,D,L):O.type===a.TAG_CLOSE?M=this._handle_tag_close(S,O,D):O.type===a.TEXT?M=this._handle_text(S,O,D):S.add_raw_token(O),A=M,O=L.next();var j=S._output.get_code(p);return j},f.prototype._handle_tag_close=function(b,p,d){var A={text:p.text,type:p.type};return b.alignment_size=0,d.tag_complete=!0,b.set_space_before_token(p.newlines||p.whitespace_before!=="",!0),d.is_unformatted?b.add_raw_token(p):(d.tag_start_char==="<"&&(b.set_space_before_token(p.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&d.has_wrapped_attrs&&b.print_newline(!1)),b.print_token(p)),d.indent_content&&!(d.is_unformatted||d.is_content_unformatted)&&(b.indent(),d.indent_content=!1),!d.is_inline_element&&!(d.is_unformatted||d.is_content_unformatted)&&b.set_wrap_point(),A},f.prototype._handle_inside_tag=function(b,p,d,A){var D=d.has_wrapped_attrs,S={text:p.text,type:p.type};if(b.set_space_before_token(p.newlines||p.whitespace_before!=="",!0),d.is_unformatted)b.add_raw_token(p);else if(d.tag_start_char==="{"&&p.type===a.TEXT)b.print_preserved_newlines(p)?(p.newlines=0,b.add_raw_token(p)):b.print_token(p);else{if(p.type===a.ATTRIBUTE?(b.set_space_before_token(!0),d.attr_count+=1):(p.type===a.EQUALS||p.type===a.VALUE&&p.previous.type===a.EQUALS)&&b.set_space_before_token(!1),p.type===a.ATTRIBUTE&&d.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(b.traverse_whitespace(p),D=D||p.newlines!==0),this._is_wrap_attributes_force)){var L=d.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&d.attr_count===1){var M=!0,O=0,j;do{if(j=A.peek(O),j.type===a.ATTRIBUTE){M=!1;break}O+=1}while(O<4&&j.type!==a.EOF&&j.type!==a.TAG_CLOSE);L=!M}L&&(b.print_newline(!1),D=!0)}b.print_token(p),D=D||b.previous_token_wrapped(),d.has_wrapped_attrs=D}return S},f.prototype._handle_text=function(b,p,d){var A={text:p.text,type:"TK_CONTENT"};return d.custom_beautifier_name?this._print_custom_beatifier_text(b,p,d):d.is_unformatted||d.is_content_unformatted?b.add_raw_token(p):(b.traverse_whitespace(p),b.print_token(p)),A},f.prototype._print_custom_beatifier_text=function(b,p,d){var A=this;if(p.text!==""){var D=p.text,S,L=1,M="",O="";d.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?S=this._js_beautify:d.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?S=this._css_beautify:d.custom_beautifier_name==="html"&&(S=function(ve,he){var xe=new f(ve,he,A._js_beautify,A._css_beautify);return xe.beautify()}),this._options.indent_scripts==="keep"?L=0:this._options.indent_scripts==="separate"&&(L=-b.indent_level);var j=b.get_full_indent(L);if(D=D.replace(/\n[ \t]*$/,""),d.custom_beautifier_name!=="html"&&D[0]==="<"&&D.match(/^(<!--|<!\[CDATA\[)/)){var G=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(D);if(!G){b.add_raw_token(p);return}M=j+G[1]+`
`,D=G[4],G[5]&&(O=j+G[5]),D=D.replace(/\n[ \t]*$/,""),(G[2]||G[3].indexOf(`
`)!==-1)&&(G=G[3].match(/[ \t]+$/),G&&(p.whitespace_before=G[0]))}if(D)if(S){var X=function(){this.eol=`
`};X.prototype=this._options.raw_options;var te=new X;D=S(j+D,te)}else{var fe=p.whitespace_before;fe&&(D=D.replace(new RegExp(`
(`+fe+")?","g"),`
`)),D=j+D.replace(/\n/g,`
`+j)}M&&(D?D=M+D+`
`+O:D=M+O),b.print_newline(!1),D&&(p.text=D,p.whitespace_before="",p.newlines=0,b.add_raw_token(p),b.print_newline(!0))}},f.prototype._handle_tag_open=function(b,p,d,A){var D=this._get_tag_open_token(p);return(d.is_unformatted||d.is_content_unformatted)&&!d.is_empty_element&&p.type===a.TAG_OPEN&&p.text.indexOf("</")===0?(b.add_raw_token(p),D.start_tag_token=this._tag_stack.try_pop(D.tag_name)):(b.traverse_whitespace(p),this._set_tag_position(b,p,D,d,A),D.is_inline_element||b.set_wrap_point(),b.print_token(p)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(D.alignment_size=p.text.length+1),!D.tag_complete&&!D.is_unformatted&&(b.alignment_size=D.alignment_size),D};var h=function(b,p){if(this.parent=b||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!p)this.tag_complete=!0;else{var d;this.tag_start_char=p.text[0],this.text=p.text,this.tag_start_char==="<"?(d=p.text.match(/^<([^\s>]*)/),this.tag_check=d?d[1]:""):(d=p.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=d?d[1]:"",(p.text.startsWith("{{#>")||p.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&p.next!==null?this.tag_check=p.next.text.split(" ")[0]:this.tag_check=p.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),p.type===a.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||p.closed&&p.closed.text==="/>";var A=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(A=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(A)))}};f.prototype._get_tag_open_token=function(b){var p=new h(this._tag_stack.get_parser_token(),b);return p.alignment_size=this._options.wrap_attributes_indent_size,p.is_end_tag=p.is_end_tag||m(p.tag_check,this._options.void_elements),p.is_empty_element=p.tag_complete||p.is_start_tag&&p.is_end_tag,p.is_unformatted=!p.tag_complete&&m(p.tag_check,this._options.unformatted),p.is_content_unformatted=!p.is_empty_element&&m(p.tag_check,this._options.content_unformatted),p.is_inline_element=m(p.tag_name,this._options.inline)||p.tag_name.includes("-")||p.tag_start_char==="{",p},f.prototype._set_tag_position=function(b,p,d,A,D){if(d.is_empty_element||(d.is_end_tag?d.start_tag_token=this._tag_stack.try_pop(d.tag_name):(this._do_optional_end_element(d)&&(d.is_inline_element||b.print_newline(!1)),this._tag_stack.record_tag(d),(d.tag_name==="script"||d.tag_name==="style")&&!(d.is_unformatted||d.is_content_unformatted)&&(d.custom_beautifier_name=y(d.tag_check,p)))),m(d.tag_check,this._options.extra_liners)&&(b.print_newline(!1),b._output.just_added_blankline()||b.print_newline(!0)),d.is_empty_element){if(d.tag_start_char==="{"&&d.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),d.indent_content=!0;var S=b.current_line_has_match(/{{#if/);S||b.print_newline(!1)}d.tag_name==="!--"&&D.type===a.TAG_CLOSE&&A.is_end_tag&&d.text.indexOf(`
`)===-1||(d.is_inline_element||d.is_unformatted||b.print_newline(!1),this._calcluate_parent_multiline(b,d))}else if(d.is_end_tag){var L=!1;L=d.start_tag_token&&d.start_tag_token.multiline_content,L=L||!d.is_inline_element&&!(A.is_inline_element||A.is_unformatted)&&!(D.type===a.TAG_CLOSE&&d.start_tag_token===A)&&D.type!=="TK_CONTENT",(d.is_content_unformatted||d.is_unformatted)&&(L=!1),L&&b.print_newline(!1)}else d.indent_content=!d.custom_beautifier_name,d.tag_start_char==="<"&&(d.tag_name==="html"?d.indent_content=this._options.indent_inner_html:d.tag_name==="head"?d.indent_content=this._options.indent_head_inner_html:d.tag_name==="body"&&(d.indent_content=this._options.indent_body_inner_html)),!(d.is_inline_element||d.is_unformatted)&&(D.type!=="TK_CONTENT"||d.is_content_unformatted)&&b.print_newline(!1),this._calcluate_parent_multiline(b,d)},f.prototype._calcluate_parent_multiline=function(b,p){p.parent&&b._output.just_added_newline()&&!((p.is_inline_element||p.is_unformatted)&&p.parent.is_inline_element)&&(p.parent.multiline_content=!0)};var o=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],u=["a","audio","del","ins","map","noscript","video"];f.prototype._do_optional_end_element=function(b){var p=null;if(b.is_empty_element||!b.is_start_tag||!b.parent)return;if(b.tag_name==="body")p=p||this._tag_stack.try_pop("head");else if(b.tag_name==="li")p=p||this._tag_stack.try_pop("li",["ol","ul"]);else if(b.tag_name==="dd"||b.tag_name==="dt")p=p||this._tag_stack.try_pop("dt",["dl"]),p=p||this._tag_stack.try_pop("dd",["dl"]);else if(b.parent.tag_name==="p"&&o.indexOf(b.tag_name)!==-1){var d=b.parent.parent;(!d||u.indexOf(d.tag_name)===-1)&&(p=p||this._tag_stack.try_pop("p"))}else b.tag_name==="rp"||b.tag_name==="rt"?(p=p||this._tag_stack.try_pop("rt",["ruby","rtc"]),p=p||this._tag_stack.try_pop("rp",["ruby","rtc"])):b.tag_name==="optgroup"?p=p||this._tag_stack.try_pop("optgroup",["select"]):b.tag_name==="option"?p=p||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):b.tag_name==="colgroup"?p=p||this._tag_stack.try_pop("caption",["table"]):b.tag_name==="thead"?(p=p||this._tag_stack.try_pop("caption",["table"]),p=p||this._tag_stack.try_pop("colgroup",["table"])):b.tag_name==="tbody"||b.tag_name==="tfoot"?(p=p||this._tag_stack.try_pop("caption",["table"]),p=p||this._tag_stack.try_pop("colgroup",["table"]),p=p||this._tag_stack.try_pop("thead",["table"]),p=p||this._tag_stack.try_pop("tbody",["table"])):b.tag_name==="tr"?(p=p||this._tag_stack.try_pop("caption",["table"]),p=p||this._tag_stack.try_pop("colgroup",["table"]),p=p||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(b.tag_name==="th"||b.tag_name==="td")&&(p=p||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),p=p||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return b.parent=this._tag_stack.get_parser_token(),p},g.exports.Beautifier=f},function(g,v,c){var s=c(6).Options;function i(l){s.call(this,l,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}i.prototype=new s,g.exports.Options=i},function(g,v,c){var s=c(9).Tokenizer,i=c(9).TOKEN,l=c(13).Directives,a=c(14).TemplatablePattern,n=c(12).Pattern,r={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:i.START,RAW:i.RAW,EOF:i.EOF},t=new l(/<\!--/,/-->/),E=function(y,m){s.call(this,y,m),this._current_tag_name="";var T=new a(this._input).read_options(this._options),_=new n(this._input);if(this.__patterns={word:T.until(/[\n\r\t <]/),single_quote:T.until_after(/'/),double_quote:T.until_after(/"/),attribute:T.until(/[\n\r\t =>]|\/>/),element_name:T.until(/[\n\r\t >\/]/),handlebars_comment:_.starting_with(/{{!--/).until_after(/--}}/),handlebars:_.starting_with(/{{/).until_after(/}}/),handlebars_open:_.until(/[\n\r\t }]/),handlebars_raw_close:_.until(/}}/),comment:_.starting_with(/<!--/).until_after(/-->/),cdata:_.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:_.starting_with(/<!\[/).until_after(/]>/),processing:_.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var f=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=_.matching(f).until_after(f)}};E.prototype=new s,E.prototype._is_comment=function(y){return!1},E.prototype._is_opening=function(y){return y.type===r.TAG_OPEN},E.prototype._is_closing=function(y,m){return y.type===r.TAG_CLOSE&&m&&((y.text===">"||y.text==="/>")&&m.text[0]==="<"||y.text==="}}"&&m.text[0]==="{"&&m.text[1]==="{")},E.prototype._reset=function(){this._current_tag_name=""},E.prototype._get_next_token=function(y,m){var T=null;this._readWhitespace();var _=this._input.peek();return _===null?this._create_token(r.EOF,""):(T=T||this._read_open_handlebars(_,m),T=T||this._read_attribute(_,y,m),T=T||this._read_close(_,m),T=T||this._read_raw_content(_,y,m),T=T||this._read_content_word(_),T=T||this._read_comment_or_cdata(_),T=T||this._read_processing(_),T=T||this._read_open(_,m),T=T||this._create_token(r.UNKNOWN,this._input.next()),T)},E.prototype._read_comment_or_cdata=function(y){var m=null,T=null,_=null;if(y==="<"){var f=this._input.peek(1);f==="!"&&(T=this.__patterns.comment.read(),T?(_=t.get_directives(T),_&&_.ignore==="start"&&(T+=t.readIgnored(this._input))):T=this.__patterns.cdata.read()),T&&(m=this._create_token(r.COMMENT,T),m.directives=_)}return m},E.prototype._read_processing=function(y){var m=null,T=null,_=null;if(y==="<"){var f=this._input.peek(1);(f==="!"||f==="?")&&(T=this.__patterns.conditional_comment.read(),T=T||this.__patterns.processing.read()),T&&(m=this._create_token(r.COMMENT,T),m.directives=_)}return m},E.prototype._read_open=function(y,m){var T=null,_=null;return m||y==="<"&&(T=this._input.next(),this._input.peek()==="/"&&(T+=this._input.next()),T+=this.__patterns.element_name.read(),_=this._create_token(r.TAG_OPEN,T)),_},E.prototype._read_open_handlebars=function(y,m){var T=null,_=null;return m||this._options.indent_handlebars&&y==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(T=this.__patterns.handlebars_comment.read(),T=T||this.__patterns.handlebars.read(),_=this._create_token(r.COMMENT,T)):(T=this.__patterns.handlebars_open.read(),_=this._create_token(r.TAG_OPEN,T))),_},E.prototype._read_close=function(y,m){var T=null,_=null;return m&&(m.text[0]==="<"&&(y===">"||y==="/"&&this._input.peek(1)===">")?(T=this._input.next(),y==="/"&&(T+=this._input.next()),_=this._create_token(r.TAG_CLOSE,T)):m.text[0]==="{"&&y==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),_=this._create_token(r.TAG_CLOSE,"}}"))),_},E.prototype._read_attribute=function(y,m,T){var _=null,f="";if(T&&T.text[0]==="<")if(y==="=")_=this._create_token(r.EQUALS,this._input.next());else if(y==='"'||y==="'"){var h=this._input.next();y==='"'?h+=this.__patterns.double_quote.read():h+=this.__patterns.single_quote.read(),_=this._create_token(r.VALUE,h)}else f=this.__patterns.attribute.read(),f&&(m.type===r.EQUALS?_=this._create_token(r.VALUE,f):_=this._create_token(r.ATTRIBUTE,f));return _},E.prototype._is_content_unformatted=function(y){return this._options.void_elements.indexOf(y)===-1&&(this._options.content_unformatted.indexOf(y)!==-1||this._options.unformatted.indexOf(y)!==-1)},E.prototype._read_raw_content=function(y,m,T){var _="";if(T&&T.text[0]==="{")_=this.__patterns.handlebars_raw_close.read();else if(m.type===r.TAG_CLOSE&&m.opened.text[0]==="<"&&m.text[0]!=="/"){var f=m.opened.text.substr(1).toLowerCase();if(f==="script"||f==="style"){var h=this._read_comment_or_cdata(y);if(h)return h.type=r.TEXT,h;_=this._input.readUntil(new RegExp("</"+f+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(f)&&(_=this._input.readUntil(new RegExp("</"+f+"[\\n\\r\\t ]*?>","ig")))}return _?this._create_token(r.TEXT,_):null},E.prototype._read_content_word=function(y){var m="";if(this._options.unformatted_content_delimiter&&(y===this._options.unformatted_content_delimiter[0]&&(m=this.__patterns.unformatted_content_delimiter.read())),m||(m=this.__patterns.word.read()),m)return this._create_token(r.TEXT,m)},g.exports.Tokenizer=E,g.exports.TOKEN=r}],N={};function e(g){var v=N[g];if(v!==void 0)return v.exports;var c=N[g]={exports:{}};return K[g](c,c.exports,e),c.exports}var C=e(18);I=C})();var W=I;if(!0)!(Q=[U,U("6UM0"),U("TXwP")],H=function(K){var N=U("6UM0"),e=U("TXwP");return{html_beautify:function(C,g){return W(C,g,N.js_beautify,e.css_beautify)}}}.apply(ne,Q),H!==void 0&&(Ne.exports=H));else var P,R})()},"rAM+":function(Ne,ne,U){"use strict";U.d(ne,"a",function(){return H});var Q=U("Qw5x");function H(I,W){var P;if(typeof Symbol=="undefined"||I[Symbol.iterator]==null){if(Array.isArray(I)||(P=Object(Q.a)(I))||W&&I&&typeof I.length=="number"){P&&(I=P);var R=0,K=function(){};return{s:K,n:function(){return R>=I.length?{done:!0}:{done:!1,value:I[R++]}},e:function(v){throw v},f:K}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var N=!0,e=!1,C;return{s:function(){P=I[Symbol.iterator]()},n:function(){var v=P.next();return N=v.done,v},e:function(v){e=!0,C=v},f:function(){try{!N&&P.return!=null&&P.return()}finally{if(e)throw C}}}}},rUJ1:function(Ne,ne){const U=/[&<>"']/,Q=/[&<>"']/g,H=/[<>"']|&(?!#?\w+;)/,I=/[<>"']|&(?!#?\w+;)/g,W={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},P=_=>W[_];function R(_,f){if(f){if(U.test(_))return _.replace(Q,P)}else if(H.test(_))return _.replace(I,P);return _}const K=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function N(_){return _.replace(K,(f,h)=>(h=h.toLowerCase(),h==="colon"?":":h.charAt(0)==="#"?h.charAt(1)==="x"?String.fromCharCode(parseInt(h.substring(2),16)):String.fromCharCode(+h.substring(1)):""))}const e=/(^|[^\[])\^/g;function C(_,f){_=_.source||_,f=f||"";const h={replace:(o,u)=>(u=u.source||u,u=u.replace(e,"$1"),_=_.replace(o,u),h),getRegex:()=>new RegExp(_,f)};return h}const g=/[^\w:]/g,v=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function c(_,f,h){if(_){let o;try{o=decodeURIComponent(N(h)).replace(g,"").toLowerCase()}catch(u){return null}if(o.indexOf("javascript:")===0||o.indexOf("vbscript:")===0||o.indexOf("data:")===0)return null}f&&!v.test(h)&&(h=n(f,h));try{h=encodeURI(h).replace(/%25/g,"%")}catch(o){return null}return h}const s={},i=/^[^:]+:\/*[^/]*$/,l=/^([^:]+:)[\s\S]*$/,a=/^([^:]+:\/*[^/]*)[\s\S]*$/;function n(_,f){s[" "+_]||(i.test(_)?s[" "+_]=_+"/":s[" "+_]=y(_,"/",!0)),_=s[" "+_];const h=_.indexOf(":")===-1;return f.substring(0,2)==="//"?h?f:_.replace(l,"$1")+f:f.charAt(0)==="/"?h?f:_.replace(a,"$1")+f:_+f}const r={exec:function(){}};function t(_){let f=1,h,o;for(;f<arguments.length;f++){h=arguments[f];for(o in h)Object.prototype.hasOwnProperty.call(h,o)&&(_[o]=h[o])}return _}function E(_,f){const h=_.replace(/\|/g,(b,p,d)=>{let A=!1,D=p;for(;--D>=0&&d[D]==="\\";)A=!A;return A?"|":" |"}),o=h.split(/ \|/);let u=0;if(o.length>f)o.splice(f);else for(;o.length<f;)o.push("");for(;u<o.length;u++)o[u]=o[u].trim().replace(/\\\|/g,"|");return o}function y(_,f,h){const o=_.length;if(o===0)return"";let u=0;for(;u<o;){const b=_.charAt(o-u-1);if(b===f&&!h)u++;else if(b!==f&&h)u++;else break}return _.substr(0,o-u)}function m(_,f){if(_.indexOf(f[1])===-1)return-1;const h=_.length;let o=0,u=0;for(;u<h;u++)if(_[u]==="\\")u++;else if(_[u]===f[0])o++;else if(_[u]===f[1]&&(o--,o<0))return u;return-1}function T(_){_&&_.sanitize&&!_.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")}Ne.exports={escape:R,unescape:N,edit:C,cleanUrl:c,resolveUrl:n,noopTest:r,merge:t,splitCells:E,rtrim:y,findClosingBracket:m,checkSanitizeDeprecation:T}},sR1s:function(Ne,ne,U){"use strict";U.d(ne,"b",function(){return W}),U.d(ne,"a",function(){return P}),U.d(ne,"c",function(){return R}),U.d(ne,"d",function(){return K});var Q=U("U8pU"),H="RC_TABLE_KEY";function I(N){return N==null?[]:Array.isArray(N)?N:[N]}function W(N,e){if(!e&&typeof e!="number")return N;for(var C=I(e),g=N,v=0;v<C.length;v+=1){if(!g)return null;var c=C[v];g=g[c]}return g}function P(N){var e=[],C={};return N.forEach(function(g){for(var v=g||{},c=v.key,s=v.dataIndex,i=c||I(s).join("-")||H;C[i];)i="".concat(i,"_next");C[i]=!0,e.push(i)}),e}function R(){var N={};function e(c,s){s&&Object.keys(s).forEach(function(i){var l=s[i];l&&Object(Q.a)(l)==="object"?(c[i]=c[i]||{},e(c[i],l)):c[i]=l})}for(var C=arguments.length,g=new Array(C),v=0;v<C;v++)g[v]=arguments[v];return g.forEach(function(c){e(N,c)}),N}function K(N){return N!=null}},sZk2:function(Ne,ne,U){Ne.exports=U.p+"static/paix.41effcff.svg"},sboe:function(Ne,ne,U){"use strict";U.d(ne,"a",function(){return I});var Q=U("q1tI"),H=U.n(Q),I=Q.createContext(null)},t23M:function(Ne,ne,U){"use strict";var Q=U("VTBJ"),H=U("1OyB"),I=U("vuIU"),W=U("Ji7U"),P=U("LK+K"),R=U("q1tI"),K=U.n(R),N=U("m+aA"),e=U("Zm9Q"),C=U("Kwbf"),g=U("c+Xe"),v=U("bdgK"),c="rc-observer-key",s=function(i){Object(W.a)(a,i);var l=Object(P.a)(a);function a(){var n;return Object(H.a)(this,a),n=l.apply(this,arguments),n.resizeObserver=null,n.childNode=null,n.currentElement=null,n.state={width:0,height:0,offsetHeight:0,offsetWidth:0},n.onResize=function(r){var t=n.props.onResize,E=r[0].target,y=E.getBoundingClientRect(),m=y.width,T=y.height,_=E.offsetWidth,f=E.offsetHeight,h=Math.floor(m),o=Math.floor(T);if(n.state.width!==h||n.state.height!==o||n.state.offsetWidth!==_||n.state.offsetHeight!==f){var u={width:h,height:o,offsetWidth:_,offsetHeight:f};n.setState(u),t&&Promise.resolve().then(function(){t(Object(Q.a)(Object(Q.a)({},u),{},{offsetWidth:_,offsetHeight:f}))})}},n.setChildNode=function(r){n.childNode=r},n}return Object(I.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 r=this.props.disabled;if(r){this.destroyObserver();return}var t=Object(N.a)(this.childNode||this),E=t!==this.currentElement;E&&(this.destroyObserver(),this.currentElement=t),!this.resizeObserver&&t&&(this.resizeObserver=new v.default(this.onResize),this.resizeObserver.observe(t))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var r=this.props.children,t=Object(e.a)(r);if(t.length>1)Object(C.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(t.length===0)return Object(C.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var E=t[0];if(R.isValidElement(E)&&Object(g.c)(E)){var y=E.ref;t[0]=R.cloneElement(E,{ref:Object(g.a)(y,this.setChildNode)})}return t.length===1?t[0]:t.map(function(m,T){return!R.isValidElement(m)||"key"in m&&m.key!==null?m:R.cloneElement(m,{key:"".concat(c,"-").concat(T)})})}}]),a}(R.Component);s.displayName="ResizeObserver",ne.a=s},t9D7:function(Ne,ne,U){"use strict";U.d(ne,"b",function(){return K}),U.d(ne,"g",function(){return e}),U.d(ne,"d",function(){return C}),U.d(ne,"e",function(){return g}),U.d(ne,"a",function(){return v}),U.d(ne,"f",function(){return i}),U.d(ne,"c",function(){return l});var Q=U("Vhoy"),H=U("MI8n"),I=U("pmY6"),W=U("Cg/j"),P=U("ic2d"),R=U("nEHx");const K=Object(W.c)("themeService");var N;(function(a){function n(r){return r&&typeof r=="object"&&typeof r.id=="string"}a.isThemeColor=n})(N||(N={}));function e(a){return{id:a}}var C;(function(a){function n(T){return T&&typeof T=="object"&&typeof T.id=="string"&&(typeof T.color=="undefined"||N.isThemeColor(T.color))}a.isThemeIcon=n;const r=new RegExp(`^\\$\\((${Q.a.iconNameExpression}(?:${Q.a.iconModifierExpression})?)\\)$`);function t(T){const _=r.exec(T);if(!_)return;let[,f]=_;return{id:f}}a.fromString=t;function E(T,_){let f=T.id;const h=f.lastIndexOf("~");return h!==-1&&(f=f.substring(0,h)),_&&(f=`${f}~${_}`),{id:f}}a.modify=E;function y(T,_){var f,h;return T.id===_.id&&((f=T.color)===null||f===void 0?void 0:f.id)===((h=_.color)===null||h===void 0?void 0:h.id)}a.isEqual=y;function m(T,_){return{id:T.id,color:_?e(_):void 0}}a.asThemeIcon=m,a.asClassNameArray=Q.a.asClassNameArray,a.asClassName=Q.a.asClassName,a.asCSSSelector=Q.a.asCSSSelector})(C||(C={}));function g(a){switch(a){case R.a.DARK:return"vs-dark";case R.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const v={ThemingContribution:"base.contributions.theming"};class c{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new H.b}onColorThemeChange(a){return this.themingParticipants.push(a),this.onThemingParticipantAddedEmitter.fire(a),Object(I.i)(()=>{const n=this.themingParticipants.indexOf(a);this.themingParticipants.splice(n,1)})}getThemingParticipants(){return this.themingParticipants}}let s=new c;P.a.add(v.ThemingContribution,s);function i(a){return s.onColorThemeChange(a)}class l extends I.a{constructor(a){super();this.themeService=a,this.theme=a.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(n=>this.onThemeChange(n)))}onThemeChange(a){this.theme=a,this.updateStyles()}updateStyles(){}}},ulZh:function(Ne,ne,U){typeof window!="undefined"&&function(H,I){Ne.exports=I()}(this,function(){return function(Q){var H={};function I(W){if(H[W])return H[W].exports;var P=H[W]={i:W,l:!1,exports:{}};return Q[W].call(P.exports,P,P.exports,I),P.l=!0,P.exports}return I.m=Q,I.c=H,I.d=function(W,P,R){I.o(W,P)||Object.defineProperty(W,P,{enumerable:!0,get:R})},I.r=function(W){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(W,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(W,"__esModule",{value:!0})},I.t=function(W,P){if(P&1&&(W=I(W)),P&8)return W;if(P&4&&typeof W=="object"&&W&&W.__esModule)return W;var R=Object.create(null);if(I.r(R),Object.defineProperty(R,"default",{enumerable:!0,value:W}),P&2&&typeof W!="string")for(var K in W)I.d(R,K,function(N){return W[N]}.bind(null,K));return R},I.n=function(W){var P=W&&W.__esModule?function(){return W.default}:function(){return W};return I.d(P,"a",P),P},I.o=function(W,P){return Object.prototype.hasOwnProperty.call(W,P)},I.p="/dist/",I(I.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(Q,H,I){"use strict";var W=Object.prototype.hasOwnProperty,P="~";function R(){}Object.create&&(R.prototype=Object.create(null),new R().__proto__||(P=!1));function K(g,v,c){this.fn=g,this.context=v,this.once=c||!1}function N(g,v,c,s,i){if(typeof c!="function")throw new TypeError("The listener must be a function");var l=new K(c,s||g,i),a=P?P+v:v;return g._events[a]?g._events[a].fn?g._events[a]=[g._events[a],l]:g._events[a].push(l):(g._events[a]=l,g._eventsCount++),g}function e(g,v){--g._eventsCount===0?g._events=new R:delete g._events[v]}function C(){this._events=new R,this._eventsCount=0}C.prototype.eventNames=function(){var v=[],c,s;if(this._eventsCount===0)return v;for(s in c=this._events)W.call(c,s)&&v.push(P?s.slice(1):s);return Object.getOwnPropertySymbols?v.concat(Object.getOwnPropertySymbols(c)):v},C.prototype.listeners=function(v){var c=P?P+v:v,s=this._events[c];if(!s)return[];if(s.fn)return[s.fn];for(var i=0,l=s.length,a=new Array(l);i<l;i++)a[i]=s[i].fn;return a},C.prototype.listenerCount=function(v){var c=P?P+v:v,s=this._events[c];return s?s.fn?1:s.length:0},C.prototype.emit=function(v,c,s,i,l,a){var n=P?P+v:v;if(!this._events[n])return!1;var r=this._events[n],t=arguments.length,E,y;if(r.fn){r.once&&this.removeListener(v,r.fn,void 0,!0);switch(t){case 1:return r.fn.call(r.context),!0;case 2:return r.fn.call(r.context,c),!0;case 3:return r.fn.call(r.context,c,s),!0;case 4:return r.fn.call(r.context,c,s,i),!0;case 5:return r.fn.call(r.context,c,s,i,l),!0;case 6:return r.fn.call(r.context,c,s,i,l,a),!0}for(y=1,E=new Array(t-1);y<t;y++)E[y-1]=arguments[y];r.fn.apply(r.context,E)}else{var m=r.length,T;for(y=0;y<m;y++){r[y].once&&this.removeListener(v,r[y].fn,void 0,!0);switch(t){case 1:r[y].fn.call(r[y].context);break;case 2:r[y].fn.call(r[y].context,c);break;case 3:r[y].fn.call(r[y].context,c,s);break;case 4:r[y].fn.call(r[y].context,c,s,i);break;default:if(!E)for(T=1,E=new Array(t-1);T<t;T++)E[T-1]=arguments[T];r[y].fn.apply(r[y].context,E)}}}return!0},C.prototype.on=function(v,c,s){return N(this,v,c,s,!1)},C.prototype.once=function(v,c,s){return N(this,v,c,s,!0)},C.prototype.removeListener=function(v,c,s,i){var l=P?P+v:v;if(!this._events[l])return this;if(!c)return e(this,l),this;var a=this._events[l];if(a.fn)a.fn===c&&(!i||a.once)&&(!s||a.context===s)&&e(this,l);else{for(var n=0,r=[],t=a.length;n<t;n++)(a[n].fn!==c||i&&!a[n].once||s&&a[n].context!==s)&&r.push(a[n]);r.length?this._events[l]=r.length===1?r[0]:r:e(this,l)}return this},C.prototype.removeAllListeners=function(v){var c;return v?(c=P?P+v:v,this._events[c]&&e(this,c)):(this._events=new R,this._eventsCount=0),this},C.prototype.off=C.prototype.removeListener,C.prototype.addListener=C.prototype.on,C.prefixed=P,C.EventEmitter=C,Q.exports=C},"./node_modules/url-toolkit/src/url-toolkit.js":function(Q,H,I){(function(W){var P=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,R=/^([^\/?#]*)([^]*)$/,K=/(?:\/|^)\.(?=\/)/g,N=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,e={buildAbsoluteURL:function(C,g,v){if(v=v||{},C=C.trim(),g=g.trim(),!g){if(!v.alwaysNormalize)return C;var c=e.parseURL(C);if(!c)throw new Error("Error trying to parse base URL.");return c.path=e.normalizePath(c.path),e.buildURLFromParts(c)}var s=e.parseURL(g);if(!s)throw new Error("Error trying to parse relative URL.");if(s.scheme)return v.alwaysNormalize?(s.path=e.normalizePath(s.path),e.buildURLFromParts(s)):g;var i=e.parseURL(C);if(!i)throw new Error("Error trying to parse base URL.");if(!i.netLoc&&i.path&&i.path[0]!=="/"){var l=R.exec(i.path);i.netLoc=l[1],i.path=l[2]}i.netLoc&&!i.path&&(i.path="/");var a={scheme:i.scheme,netLoc:s.netLoc,path:null,params:s.params,query:s.query,fragment:s.fragment};if(!s.netLoc&&(a.netLoc=i.netLoc,s.path[0]!=="/"))if(!s.path)a.path=i.path,s.params||(a.params=i.params,s.query||(a.query=i.query));else{var n=i.path,r=n.substring(0,n.lastIndexOf("/")+1)+s.path;a.path=e.normalizePath(r)}return a.path===null&&(a.path=v.alwaysNormalize?e.normalizePath(s.path):s.path),e.buildURLFromParts(a)},parseURL:function(C){var g=P.exec(C);return g?{scheme:g[1]||"",netLoc:g[2]||"",path:g[3]||"",params:g[4]||"",query:g[5]||"",fragment:g[6]||""}:null},normalizePath:function(C){for(C=C.split("").reverse().join("").replace(K,"");C.length!==(C=C.replace(N,"")).length;);return C.split("").reverse().join("")},buildURLFromParts:function(C){return C.scheme+C.netLoc+C.path+C.params+C.query+C.fragment}};Q.exports=e})(this)},"./node_modules/webworkify-webpack/index.js":function(Q,H,I){function W(v){var c={};function s(l){if(c[l])return c[l].exports;var a=c[l]={i:l,l:!1,exports:{}};return v[l].call(a.exports,a,a.exports,s),a.l=!0,a.exports}s.m=v,s.c=c,s.i=function(l){return l},s.d=function(l,a,n){s.o(l,a)||Object.defineProperty(l,a,{configurable:!1,enumerable:!0,get:n})},s.r=function(l){Object.defineProperty(l,"__esModule",{value:!0})},s.n=function(l){var a=l&&l.__esModule?function(){return l.default}:function(){return l};return s.d(a,"a",a),a},s.o=function(l,a){return Object.prototype.hasOwnProperty.call(l,a)},s.p="/",s.oe=function(l){throw console.error(l),l};var i=s(s.s=ENTRY_MODULE);return i.default||i}var P="[\\.|\\-|\\+|\\w|/|@]+",R="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+P+").*?\\)";function K(v){return(v+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function N(v){return!isNaN(1*v)}function e(v,c,s){var i={};i[s]=[];var l=c.toString(),a=l.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!a)return i;for(var n=a[1],r=new RegExp("(\\\\n|\\W)"+K(n)+R,"g"),t;t=r.exec(l);){if(t[3]==="dll-reference")continue;i[s].push(t[3])}for(r=new RegExp("\\("+K(n)+'\\("(dll-reference\\s('+P+'))"\\)\\)'+R,"g");t=r.exec(l);)v[t[2]]||(i[s].push(t[1]),v[t[2]]=I(t[1]).m),i[t[2]]=i[t[2]]||[],i[t[2]].push(t[4]);for(var E=Object.keys(i),y=0;y<E.length;y++)for(var m=0;m<i[E[y]].length;m++)N(i[E[y]][m])&&(i[E[y]][m]=1*i[E[y]][m]);return i}function C(v){var c=Object.keys(v);return c.reduce(function(s,i){return s||v[i].length>0},!1)}function g(v,c){for(var s={main:[c]},i={main:[]},l={main:{}};C(s);)for(var a=Object.keys(s),n=0;n<a.length;n++){var r=a[n],t=s[r],E=t.pop();if(l[r]=l[r]||{},l[r][E]||!v[r][E])continue;l[r][E]=!0,i[r]=i[r]||[],i[r].push(E);for(var y=e(v,v[r][E],r),m=Object.keys(y),T=0;T<m.length;T++)s[m[T]]=s[m[T]]||[],s[m[T]]=s[m[T]].concat(y[m[T]])}return i}Q.exports=function(v,c){c=c||{};var s={main:I.m},i=c.all?{main:Object.keys(s.main)}:g(s,v),l="";Object.keys(i).filter(function(E){return E!=="main"}).forEach(function(E){for(var y=0;i[E][y];)y++;i[E].push(y),s[E][y]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",l=l+"var "+E+" = ("+W.toString().replace("ENTRY_MODULE",JSON.stringify(y))+")({"+i[E].map(function(m){return""+JSON.stringify(m)+": "+s[E][m].toString()}).join(",")+`});
`}),l=l+"new (("+W.toString().replace("ENTRY_MODULE",JSON.stringify(v))+")({"+i.main.map(function(E){return""+JSON.stringify(E)+": "+s.main[E].toString()}).join(",")+"}))(self);";var a=new window.Blob([l],{type:"text/javascript"});if(c.bare)return a;var n=window.URL||window.webkitURL||window.mozURL||window.msURL,r=n.createObjectURL(a),t=new window.Worker(r);return t.objectURL=r,t}},"./src/config.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"hlsDefaultConfig",function(){return T}),I.d(H,"mergeConfig",function(){return f}),I.d(H,"enableStreamingMode",function(){return h});var W=I("./src/controller/abr-controller.ts"),P=I("./src/controller/audio-stream-controller.ts"),R=I("./src/controller/audio-track-controller.ts"),K=I("./src/controller/subtitle-stream-controller.ts"),N=I("./src/controller/subtitle-track-controller.ts"),e=I("./src/controller/buffer-controller.ts"),C=I("./src/controller/timeline-controller.ts"),g=I("./src/controller/cap-level-controller.ts"),v=I("./src/controller/fps-controller.ts"),c=I("./src/controller/eme-controller.ts"),s=I("./src/controller/cmcd-controller.ts"),i=I("./src/utils/xhr-loader.ts"),l=I("./src/utils/fetch-loader.ts"),a=I("./src/utils/cues.ts"),n=I("./src/utils/mediakeys-helper.ts"),r=I("./src/utils/logger.ts");function t(){return t=Object.assign||function(o){for(var u=1;u<arguments.length;u++){var b=arguments[u];for(var p in b)Object.prototype.hasOwnProperty.call(b,p)&&(o[p]=b[p])}return o},t.apply(this,arguments)}function E(o,u){var b=Object.keys(o);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(o);u&&(p=p.filter(function(d){return Object.getOwnPropertyDescriptor(o,d).enumerable})),b.push.apply(b,p)}return b}function y(o){for(var u=1;u<arguments.length;u++){var b=arguments[u]!=null?arguments[u]:{};u%2?E(Object(b),!0).forEach(function(p){m(o,p,b[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(b)):E(Object(b)).forEach(function(p){Object.defineProperty(o,p,Object.getOwnPropertyDescriptor(b,p))})}return o}function m(o,u,b){return u in o?Object.defineProperty(o,u,{value:b,enumerable:!0,configurable:!0,writable:!0}):o[u]=b,o}var T=y(y({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:i.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:W.default,bufferController:e.default,capLevelController:g.default,fpsController:v.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:n.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},_()),{},{subtitleStreamController:K.SubtitleStreamController,subtitleTrackController:N.default,timelineController:C.TimelineController,audioStreamController:P.default,audioTrackController:R.default,emeController:c.default,cmcdController:s.default});function _(){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 f(o,u){if((u.liveSyncDurationCount||u.liveMaxLatencyDurationCount)&&(u.liveSyncDuration||u.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(u.liveMaxLatencyDurationCount!==void 0&&(u.liveSyncDurationCount===void 0||u.liveMaxLatencyDurationCount<=u.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(u.liveMaxLatencyDuration!==void 0&&(u.liveSyncDuration===void 0||u.liveMaxLatencyDuration<=u.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return t({},o,u)}function h(o){var u=o.loader;if(u!==l.default&&u!==i.default)r.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),o.progressive=!1;else{var b=Object(l.fetchSupported)();b&&(o.loader=l.default,o.progressive=!0,o.enableSoftwareAES=!0,r.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/polyfills/number.ts"),P=I("./src/utils/ewma-bandwidth-estimator.ts"),R=I("./src/events.ts"),K=I("./src/utils/buffer-helper.ts"),N=I("./src/errors.ts"),e=I("./src/types/loader.ts"),C=I("./src/utils/logger.ts");function g(s,i){for(var l=0;l<i.length;l++){var a=i[l];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(s,a.key,a)}}function v(s,i,l){return i&&g(s.prototype,i),l&&g(s,l),s}var c=function(){function s(l){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=l;var a=l.config;this.bwEstimator=new P.default(a.abrEwmaSlowVoD,a.abrEwmaFastVoD,a.abrEwmaDefaultEstimate),this.registerListeners()}var i=s.prototype;return i.registerListeners=function(){var a=this.hls;a.on(R.Events.FRAG_LOADING,this.onFragLoading,this),a.on(R.Events.FRAG_LOADED,this.onFragLoaded,this),a.on(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.on(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.on(R.Events.ERROR,this.onError,this)},i.unregisterListeners=function(){var a=this.hls;a.off(R.Events.FRAG_LOADING,this.onFragLoading,this),a.off(R.Events.FRAG_LOADED,this.onFragLoaded,this),a.off(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.off(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.off(R.Events.ERROR,this.onError,this)},i.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},i.onFragLoading=function(a,n){var r=n.frag;if(r.type===e.PlaylistLevelType.MAIN&&!this.timer){var t;this.fragCurrent=r,this.partCurrent=(t=n.part)!=null?t:null,this.timer=self.setInterval(this.onCheck,100)}},i.onLevelLoaded=function(a,n){var r=this.hls.config;n.details.live?this.bwEstimator.update(r.abrEwmaSlowLive,r.abrEwmaFastLive):this.bwEstimator.update(r.abrEwmaSlowVoD,r.abrEwmaFastVoD)},i._abandonRulesCheck=function(){var a=this.fragCurrent,n=this.partCurrent,r=this.hls,t=r.autoLevelEnabled,E=r.config,y=r.media;if(!a||!y)return;var m=n?n.stats:a.stats,T=n?n.duration:a.duration;if(m.aborted){C.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!t||y.paused||!y.playbackRate||!y.readyState)return;var _=performance.now()-m.loading.start,f=Math.abs(y.playbackRate);if(_<=500*T/f)return;var h=r.levels,o=r.minAutoLevel,u=h[a.level],b=m.total||Math.max(m.loaded,Math.round(T*u.maxBitrate/8)),p=Math.max(1,m.bwEstimate?m.bwEstimate/8:m.loaded*1e3/_),d=(b-m.loaded)/p,A=y.currentTime,D=(K.BufferHelper.bufferInfo(y,A,E.maxBufferHole).end-A)/f;if(D>=2*T/f||d<=D)return;var S=Number.POSITIVE_INFINITY,L;for(L=a.level-1;L>o;L--){var M=h[L].maxBitrate;if(S=T*M/(8*.8*p),S<D)break}if(S>=d)return;var O=this.bwEstimator.getEstimate();C.logger.warn("Fragment "+a.sn+(n?" part "+n.index:"")+" of level "+a.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+L+`
Current BW estimate: `+(Object(W.isFiniteNumber)(O)?(O/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+d.toFixed(3)+` s
Estimated load time for the next fragment: `+S.toFixed(3)+` s
Time to underbuffer: `+D.toFixed(3)+" s"),r.nextLoadLevel=L,this.bwEstimator.sample(_,m.loaded),this.clearTimer(),a.loader&&(this.fragCurrent=this.partCurrent=null,a.loader.abort()),r.trigger(R.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:a,part:n,stats:m})},i.onFragLoaded=function(a,n){var r=n.frag,t=n.part;if(r.type===e.PlaylistLevelType.MAIN&&Object(W.isFiniteNumber)(r.sn)){var E=t?t.stats:r.stats,y=t?t.duration:r.duration;if(this.clearTimer(),this.lastLoadedFragLevel=r.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var m=this.hls.levels[r.level],T=(m.loaded?m.loaded.bytes:0)+E.loaded,_=(m.loaded?m.loaded.duration:0)+y;m.loaded={bytes:T,duration:_},m.realBitrate=Math.round(8*T/_)}if(r.bitrateTest){var f={stats:E,frag:r,part:t,id:r.type};this.onFragBuffered(R.Events.FRAG_BUFFERED,f),r.bitrateTest=!1}}},i.onFragBuffered=function(a,n){var r=n.frag,t=n.part,E=t?t.stats:r.stats;if(E.aborted)return;if(r.type!==e.PlaylistLevelType.MAIN||r.sn==="initSegment")return;var y=E.parsing.end-E.loading.start;this.bwEstimator.sample(y,E.loaded),E.bwEstimate=this.bwEstimator.getEstimate(),r.bitrateTest?this.bitrateTestDelay=y/1e3:this.bitrateTestDelay=0},i.onError=function(a,n){switch(n.details){case N.ErrorDetails.FRAG_LOAD_ERROR:case N.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},i.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},i.getNextABRAutoLevel=function(){var a=this.fragCurrent,n=this.partCurrent,r=this.hls,t=r.maxAutoLevel,E=r.config,y=r.minAutoLevel,m=r.media,T=n?n.duration:a?a.duration:0,_=m?m.currentTime:0,f=m&&m.playbackRate!==0?Math.abs(m.playbackRate):1,h=this.bwEstimator?this.bwEstimator.getEstimate():E.abrEwmaDefaultEstimate,o=(K.BufferHelper.bufferInfo(m,_,E.maxBufferHole).end-_)/f,u=this.findBestLevel(h,y,t,o,E.abrBandWidthFactor,E.abrBandWidthUpFactor);if(u>=0)return u;C.logger.trace((o?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var b=T?Math.min(T,E.maxStarvationDelay):E.maxStarvationDelay,p=E.abrBandWidthFactor,d=E.abrBandWidthUpFactor;if(!o){var A=this.bitrateTestDelay;if(A){var D=T?Math.min(T,E.maxLoadingDelay):E.maxLoadingDelay;b=D-A,C.logger.trace("bitrate test took "+Math.round(1e3*A)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*b)+" ms"),p=d=1}}return u=this.findBestLevel(h,y,t,o+b,p,d),Math.max(u,0)},i.findBestLevel=function(a,n,r,t,E,y){for(var m,T=this.fragCurrent,_=this.partCurrent,f=this.lastLoadedFragLevel,h=this.hls.levels,o=h[f],u=!!(o!=null&&(m=o.details)!==null&&m!==void 0&&m.live),b=o==null?void 0:o.codecSet,p=_?_.duration:T?T.duration:0,d=r;d>=n;d--){var A=h[d];if(!A||b&&A.codecSet!==b)continue;var D=A.details,S=(_?D==null?void 0:D.partTarget:D==null?void 0:D.averagetargetduration)||p,L=void 0;d<=f?L=E*a:L=y*a;var M=h[d].maxBitrate,O=M*S/L;if(C.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+d+"/"+Math.round(L)+"/"+M+"/"+S+"/"+t+"/"+O),L>M&&(!O||u&&!this.bitrateTestDelay||O<t))return d}return-1},v(s,[{key:"nextAutoLevel",get:function(){var a=this._nextAutoLevel,n=this.bwEstimator;if(a!==-1&&(!n||!n.canEstimate()))return a;var r=this.getNextABRAutoLevel();return a!==-1&&(r=Math.min(a,r)),r},set:function(a){this._nextAutoLevel=a}}]),s}();H.default=c},"./src/controller/audio-stream-controller.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/polyfills/number.ts"),P=I("./src/controller/base-stream-controller.ts"),R=I("./src/events.ts"),K=I("./src/utils/buffer-helper.ts"),N=I("./src/controller/fragment-tracker.ts"),e=I("./src/types/level.ts"),C=I("./src/types/loader.ts"),g=I("./src/loader/fragment.ts"),v=I("./src/demux/chunk-cache.ts"),c=I("./src/demux/transmuxer-interface.ts"),s=I("./src/types/transmuxer.ts"),i=I("./src/controller/fragment-finders.ts"),l=I("./src/utils/discontinuities.ts"),a=I("./src/errors.ts"),n=I("./src/utils/logger.ts");function r(){return r=Object.assign||function(T){for(var _=1;_<arguments.length;_++){var f=arguments[_];for(var h in f)Object.prototype.hasOwnProperty.call(f,h)&&(T[h]=f[h])}return T},r.apply(this,arguments)}function t(T,_){T.prototype=Object.create(_.prototype),T.prototype.constructor=T,E(T,_)}function E(T,_){return E=Object.setPrototypeOf||function(h,o){return h.__proto__=o,h},E(T,_)}var y=100,m=function(T){t(_,T);function _(h,o){var u;return u=T.call(this,h,o,"[audio-stream-controller]")||this,u.videoBuffer=null,u.videoTrackCC=-1,u.waitingVideoCC=-1,u.audioSwitch=!1,u.trackId=-1,u.waitingData=null,u.mainDetails=null,u.bufferFlushed=!1,u._registerListeners(),u}var f=_.prototype;return f.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},f._registerListeners=function(){var o=this.hls;o.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.on(R.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),o.on(R.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),o.on(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.on(R.Events.ERROR,this.onError,this),o.on(R.Events.BUFFER_RESET,this.onBufferReset,this),o.on(R.Events.BUFFER_CREATED,this.onBufferCreated,this),o.on(R.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),o.on(R.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),o.on(R.Events.FRAG_BUFFERED,this.onFragBuffered,this)},f._unregisterListeners=function(){var o=this.hls;o.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.off(R.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),o.off(R.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),o.off(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.off(R.Events.ERROR,this.onError,this),o.off(R.Events.BUFFER_RESET,this.onBufferReset,this),o.off(R.Events.BUFFER_CREATED,this.onBufferCreated,this),o.off(R.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),o.off(R.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),o.off(R.Events.FRAG_BUFFERED,this.onFragBuffered,this)},f.onInitPtsFound=function(o,u){var b=u.frag,p=u.id,d=u.initPTS;if(p==="main"){var A=b.cc;this.initPTS[b.cc]=d,this.log("InitPTS for cc: "+A+" found from main: "+d),this.videoTrackCC=A,this.state===P.State.WAITING_INIT_PTS&&this.tick()}},f.startLoad=function(o){if(!this.levels){this.startPosition=o,this.state=P.State.STOPPED;return}var u=this.lastCurrentTime;this.stopLoad(),this.setInterval(y),this.fragLoadError=0,u>0&&o===-1?(this.log("Override startPosition with lastCurrentTime @"+u.toFixed(3)),this.state=P.State.IDLE):(this.loadedmetadata=!1,this.state=P.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=o,this.tick()},f.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_TRACK:{var o,u=this.levels,b=this.trackId,p=u==null||((o=u[b])===null||o===void 0)?void 0:o.details;if(p){if(this.waitForCdnTuneIn(p))break;this.state=P.State.WAITING_INIT_PTS}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var d,A=performance.now(),D=this.retryDate;(!D||A>=D||(d=this.media)!==null&&d!==void 0&&d.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=P.State.IDLE);break}case P.State.WAITING_INIT_PTS:{var S=this.waitingData;if(S){var L=S.frag,M=S.part,O=S.cache,j=S.complete;if(this.initPTS[L.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.FRAG_LOADING;var G=O.flush(),X={frag:L,part:M,payload:G,networkDetails:null};this._handleFragmentLoadProgress(X),j&&T.prototype._handleFragmentLoadComplete.call(this,X)}else if(this.videoTrackCC!==this.waitingVideoCC)n.logger.log("Waiting fragment cc ("+L.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var te=this.getLoadPosition(),fe=K.BufferHelper.bufferInfo(this.mediaBuffer,te,this.config.maxBufferHole),ve=Object(i.fragmentWithinToleranceTest)(fe.end,this.config.maxFragLookUpTolerance,L);ve<0&&(n.logger.log("Waiting fragment cc ("+L.cc+") @ "+L.start+" cancelled because another fragment at "+fe.end+" is needed"),this.clearWaitingFragment())}}else this.state=P.State.IDLE}}this.onTickEnd()},f.clearWaitingFragment=function(){var o=this.waitingData;o&&(this.fragmentTracker.removeFragment(o.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.IDLE)},f.onTickEnd=function(){var o=this.media;if(!o||!o.readyState)return;var u=this.mediaBuffer?this.mediaBuffer:o,b=u.buffered;!this.loadedmetadata&&b.length&&(this.loadedmetadata=!0),this.lastCurrentTime=o.currentTime},f.doTickIdle=function(){var o,u,b=this.hls,p=this.levels,d=this.media,A=this.trackId,D=b.config;if(!p||!p[A])return;if(!d&&(this.startFragRequested||!D.startFragPrefetch))return;var S=p[A],L=S.details;if(!L||L.live&&this.levelLastLoaded!==A||this.waitForCdnTuneIn(L)){this.state=P.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,g.ElementaryStreamTypes.AUDIO,C.PlaylistLevelType.AUDIO));var M=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,C.PlaylistLevelType.AUDIO);if(M===null)return;var O=M.len,j=this.getMaxBufferLength(),G=this.audioSwitch;if(O>=j&&!G)return;if(!G&&this._streamEnded(M,L)){b.trigger(R.Events.BUFFER_EOS,{type:"audio"}),this.state=P.State.ENDED;return}var X=L.fragments,te=X[0].start,fe=M.end;if(G){var ve=this.getLoadPosition();fe=ve,L.PTSKnown&&ve<te&&((M.end>te||M.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),d.currentTime=te+.05))}var he=this.getNextFragment(fe,L);if(!he){this.bufferFlushed=!0;return}((o=he.decryptdata)===null||o===void 0?void 0:o.keyFormat)==="identity"&&!((u=he.decryptdata)!==null&&u!==void 0&&u.key)?this.loadKey(he,L):this.loadFragment(he,L,fe)},f.getMaxBufferLength=function(){var o=T.prototype.getMaxBufferLength.call(this),u=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,C.PlaylistLevelType.MAIN);return u===null?o:Math.max(o,u.len)},f.onMediaDetaching=function(){this.videoBuffer=null,T.prototype.onMediaDetaching.call(this)},f.onAudioTracksUpdated=function(o,u){var b=u.audioTracks;this.resetTransmuxer(),this.levels=b.map(function(p){return new e.Level(p)})},f.onAudioTrackSwitching=function(o,u){var b=!!u.url;this.trackId=u.id;var p=this.fragCurrent;p!=null&&p.loader&&p.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),b?this.setInterval(y):this.resetTransmuxer(),b?(this.audioSwitch=!0,this.state=P.State.IDLE):this.state=P.State.STOPPED,this.tick()},f.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},f.onLevelLoaded=function(o,u){this.mainDetails=u.details},f.onAudioTrackLoaded=function(o,u){var b,p=this.levels,d=u.details,A=u.id;if(!p){this.warn("Audio tracks were reset while loading level "+A);return}this.log("Track "+A+" loaded ["+d.startSN+","+d.endSN+"],duration:"+d.totalduration);var D=p[A],S=0;if(d.live||(b=D.details)!==null&&b!==void 0&&b.live){var L=this.mainDetails;if(d.fragments[0]||(d.deltaUpdateFailed=!0),d.deltaUpdateFailed||!L)return;!D.details&&d.hasProgramDateTime&&L.hasProgramDateTime?(Object(l.alignMediaPlaylistByPDT)(d,L),S=d.fragments[0].start):S=this.alignPlaylists(d,D.details)}D.details=d,this.levelLastLoaded=A,!this.startFragRequested&&(this.mainDetails||!d.live)&&this.setStartPosition(D.details,S),this.state===P.State.WAITING_TRACK&&!this.waitForCdnTuneIn(d)&&(this.state=P.State.IDLE),this.tick()},f._handleFragmentLoadProgress=function(o){var u,b=o.frag,p=o.part,d=o.payload,A=this.config,D=this.trackId,S=this.levels;if(!S){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+b.sn+" of level "+b.level+" will not be buffered");return}var L=S[D];console.assert(L,"Audio track is defined on fragment load progress");var M=L.details;console.assert(M,"Audio track details are defined on fragment load progress");var O=A.defaultAudioCodec||L.audioCodec||"mp4a.40.2",j=this.transmuxer;j||(j=this.transmuxer=new c.default(this.hls,C.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var G=this.initPTS[b.cc],X=(u=b.initSegment)===null||u===void 0?void 0:u.data;if(G!==void 0){var te=!1,fe=p?p.index:-1,ve=fe!==-1,he=new s.ChunkMetadata(b.level,b.sn,b.stats.chunkCount,d.byteLength,fe,ve);j.push(d,X,O,"",b,p,M.totalduration,te,he,G)}else{n.logger.log("Unknown video PTS for cc "+b.cc+", waiting for video PTS before demuxing audio frag "+b.sn+" of ["+M.startSN+" ,"+M.endSN+"],track "+D);var xe=this.waitingData=this.waitingData||{frag:b,part:p,cache:new v.default,complete:!1},Se=xe.cache;Se.push(new Uint8Array(d)),this.waitingVideoCC=this.videoTrackCC,this.state=P.State.WAITING_INIT_PTS}},f._handleFragmentLoadComplete=function(o){if(this.waitingData){this.waitingData.complete=!0;return}T.prototype._handleFragmentLoadComplete.call(this,o)},f.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},f.onBufferCreated=function(o,u){var b=u.tracks.audio;b&&(this.mediaBuffer=b.buffer),u.tracks.video&&(this.videoBuffer=u.tracks.video.buffer)},f.onFragBuffered=function(o,u){var b=u.frag,p=u.part;if(b.type!==C.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(b)){this.warn("Fragment "+b.sn+(p?" p: "+p.index:"")+" of level "+b.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}b.sn!=="initSegment"&&(this.fragPrevious=b,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(R.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(b,p)},f.onError=function(o,u){switch(u.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(C.PlaylistLevelType.AUDIO,u);break;case a.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case a.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==P.State.ERROR&&this.state!==P.State.STOPPED&&(this.state=u.fatal?P.State.ERROR:P.State.IDLE,this.warn(u.details+" while loading frag, switching to "+this.state+" state"));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(u.parent==="audio"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var b=!0,p=this.getFwdBufferInfo(this.mediaBuffer,C.PlaylistLevelType.AUDIO);p&&p.len>.5&&(b=!this.reduceMaxBufferLength(p.len)),b&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,T.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},f.onBufferFlushed=function(o,u){var b=u.type;b===g.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},f._handleTransmuxComplete=function(o){var u,b="audio",p=this.hls,d=o.remuxResult,A=o.chunkMeta,D=this.getCurrentContext(A);if(!D){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 S=D.frag,L=D.part,M=d.audio,O=d.text,j=d.id3,G=d.initSegment;if(this.fragContextChanged(S))return;if(this.state=P.State.PARSING,this.audioSwitch&&M&&this.completeAudioSwitch(),G!=null&&G.tracks&&(this._bufferInitSegment(G.tracks,S,A),p.trigger(R.Events.FRAG_PARSING_INIT_SEGMENT,{frag:S,id:b,tracks:G.tracks})),M){var X=M.startPTS,te=M.endPTS,fe=M.startDTS,ve=M.endDTS;L&&(L.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:X,endPTS:te,startDTS:fe,endDTS:ve}),S.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,X,te,fe,ve),this.bufferFragmentData(M,S,L,A)}if(j!=null&&(u=j.samples)!==null&&u!==void 0&&u.length){var he=r({frag:S,id:b},j);p.trigger(R.Events.FRAG_PARSING_METADATA,he)}if(O){var xe=r({frag:S,id:b},O);p.trigger(R.Events.FRAG_PARSING_USERDATA,xe)}},f._bufferInitSegment=function(o,u,b){if(this.state!==P.State.PARSING)return;o.video&&delete o.video;var p=o.audio;if(!p)return;p.levelCodec=p.codec,p.id="audio",this.log("Init audio buffer, container:"+p.container+", codecs[parsed]=["+p.codec+"]"),this.hls.trigger(R.Events.BUFFER_CODECS,o);var d=p.initSegment;if(d!=null&&d.byteLength){var A={type:"audio",frag:u,part:null,chunkMeta:b,parent:u.type,data:d};this.hls.trigger(R.Events.BUFFER_APPENDING,A)}this.tick()},f.loadFragment=function(o,u,b){var p=this.fragmentTracker.getState(o);this.fragCurrent=o,(this.audioSwitch||p===N.FragmentState.NOT_LOADED||p===N.FragmentState.PARTIAL)&&(o.sn==="initSegment"?this._loadInitSegment(o):u.live&&!Object(W.isFiniteNumber)(this.initPTS[o.cc])?(this.log("Waiting for video PTS in continuity counter "+o.cc+" of live stream before loading audio fragment "+o.sn+" of level "+this.trackId),this.state=P.State.WAITING_INIT_PTS):(this.startFragRequested=!0,T.prototype.loadFragment.call(this,o,u,b)))},f.completeAudioSwitch=function(){var o=this.hls,u=this.media,b=this.trackId;u&&(this.log("Switching audio track : flushing all audio"),T.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,o.trigger(R.Events.AUDIO_TRACK_SWITCHED,{id:b})},_}(P.default);H.default=m},"./src/controller/audio-track-controller.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/events.ts"),P=I("./src/errors.ts"),R=I("./src/controller/base-playlist-controller.ts"),K=I("./src/types/loader.ts");function N(c,s){for(var i=0;i<s.length;i++){var l=s[i];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(c,l.key,l)}}function e(c,s,i){return s&&N(c.prototype,s),i&&N(c,i),c}function C(c,s){c.prototype=Object.create(s.prototype),c.prototype.constructor=c,g(c,s)}function g(c,s){return g=Object.setPrototypeOf||function(l,a){return l.__proto__=a,l},g(c,s)}var v=function(c){C(s,c);function s(l){var a;return a=c.call(this,l,"[audio-track-controller]")||this,a.tracks=[],a.groupId=null,a.tracksInGroup=[],a.trackId=-1,a.trackName="",a.selectDefaultTrack=!0,a.registerListeners(),a}var i=s.prototype;return i.registerListeners=function(){var a=this.hls;a.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(W.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.on(W.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.on(W.Events.ERROR,this.onError,this)},i.unregisterListeners=function(){var a=this.hls;a.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(W.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(W.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.off(W.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.off(W.Events.ERROR,this.onError,this)},i.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,c.prototype.destroy.call(this)},i.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},i.onManifestParsed=function(a,n){this.tracks=n.audioTracks||[]},i.onAudioTrackLoaded=function(a,n){var r=n.id,t=n.details,E=this.tracksInGroup[r];if(!E){this.warn("Invalid audio track id "+r);return}var y=E.details;E.details=n.details,this.log("audioTrack "+r+" loaded ["+t.startSN+"-"+t.endSN+"]"),r===this.trackId&&(this.retryCount=0,this.playlistLoaded(r,n,y))},i.onLevelLoading=function(a,n){this.switchLevel(n.level)},i.onLevelSwitching=function(a,n){this.switchLevel(n.level)},i.switchLevel=function(a){var n=this.hls.levels[a];if(!(n!=null&&n.audioGroupIds))return;var r=n.audioGroupIds[n.urlId];if(this.groupId!==r){this.groupId=r;var t=this.tracks.filter(function(y){return!r||y.groupId===r});this.selectDefaultTrack&&!t.some(function(y){return y.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=t;var E={audioTracks:t};this.log("Updating audio tracks, "+t.length+' track(s) found in "'+r+'" group-id'),this.hls.trigger(W.Events.AUDIO_TRACKS_UPDATED,E),this.selectInitialTrack()}},i.onError=function(a,n){if(c.prototype.onError.call(this,a,n),n.fatal||!n.context)return;n.context.type===K.PlaylistContextType.AUDIO_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},i.setAudioTrack=function(a){var n=this.tracksInGroup;if(a<0||a>=n.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var r=n[this.trackId];this.log("Now switching to audio-track index "+a);var t=n[a],E=t.id,y=t.groupId,m=y===void 0?"":y,T=t.name,_=t.type,f=t.url;if(this.trackId=a,this.trackName=T,this.selectDefaultTrack=!1,this.hls.trigger(W.Events.AUDIO_TRACK_SWITCHING,{id:E,groupId:m,name:T,type:_,url:f}),t.details&&!t.details.live)return;var h=this.switchParams(t.url,r==null?void 0:r.details);this.loadPlaylist(h)},i.selectInitialTrack=function(){var a=this.tracksInGroup;console.assert(a.length,"Initial audio track should be selected when tracks are known");var n=this.trackName,r=this.findTrackId(n)||this.findTrackId();r!==-1?this.setAudioTrack(r):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},i.findTrackId=function(a){for(var n=this.tracksInGroup,r=0;r<n.length;r++){var t=n[r];if((!this.selectDefaultTrack||t.default)&&(!a||a===t.name))return t.id}return-1},i.loadPlaylist=function(a){var n=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(n)){var r=n.id,t=n.groupId,E=n.url;if(a)try{E=a.addDirectives(E)}catch(y){this.warn("Could not construct new URL with HLS Delivery Directives: "+y)}this.log("loading audio-track playlist for id: "+r),this.clearTimer(),this.hls.trigger(W.Events.AUDIO_TRACK_LOADING,{url:E,id:r,groupId:t,deliveryDirectives:a||null})}},e(s,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(a){this.selectDefaultTrack=!1,this.setAudioTrack(a)}}]),s}(R.default);H.default=v},"./src/controller/base-playlist-controller.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return e});var W=I("./src/polyfills/number.ts"),P=I("./src/types/level.ts"),R=I("./src/controller/level-helper.ts"),K=I("./src/utils/logger.ts"),N=I("./src/errors.ts"),e=function(){function C(v,c){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=K.logger.log.bind(K.logger,c+":"),this.warn=K.logger.warn.bind(K.logger,c+":"),this.hls=v}var g=C.prototype;return g.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},g.onError=function(c,s){s.fatal&&s.type===N.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},g.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},g.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},g.stopLoad=function(){this.canLoad=!1,this.clearTimer()},g.switchParams=function(c,s){var i=s==null?void 0:s.renditionReports;if(i)for(var l=0;l<i.length;l++){var a=i[l],n=""+a.URI;if(n===c.substr(-n.length)){var r=parseInt(a["LAST-MSN"]),t=parseInt(a["LAST-PART"]);if(s&&this.hls.config.lowLatencyMode){var E=Math.min(s.age-s.partTarget,s.targetduration);t!==void 0&&E>s.partTarget&&(t+=1)}if(Object(W.isFiniteNumber)(r))return new P.HlsUrlParameters(r,Object(W.isFiniteNumber)(t)?t:void 0,P.HlsSkip.No)}}},g.loadPlaylist=function(c){},g.shouldLoadTrack=function(c){return this.canLoad&&c&&!!c.url&&(!c.details||c.details.live)},g.playlistLoaded=function(c,s,i){var l=this,a=s.details,n=s.stats,r=n.loading.end?Math.max(0,self.performance.now()-n.loading.end):0;if(a.advancedDateTime=Date.now()-r,a.live||i!=null&&i.live){if(a.reloaded(i),i&&this.log("live playlist "+c+" "+(a.advanced?"REFRESHED "+a.lastPartSn+"-"+a.lastPartIndex:"MISSED")),i&&a.fragments.length>0&&Object(R.mergeDetails)(i,a),!this.canLoad||!a.live)return;var t,E=void 0,y=void 0;if(a.canBlockReload&&a.endSN&&a.advanced){var m=this.hls.config.lowLatencyMode,T=a.lastPartSn,_=a.endSN,f=a.lastPartIndex,h=f!==-1,o=T===_,u=m?0:f;h?(E=o?_+1:T,y=o?u:f+1):E=_+1;var b=a.age,p=b+a.ageHeader,d=Math.min(p-a.partTarget,a.targetduration*1.5);if(d>0){if(i&&d>i.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+i.tuneInGoal+" to: "+d+" with playlist age: "+a.age),d=0;else{var A=Math.floor(d/a.targetduration);if(E+=A,y!==void 0){var D=Math.round(d%a.targetduration/a.partTarget);y+=D}this.log("CDN Tune-in age: "+a.ageHeader+"s last advanced "+b.toFixed(2)+"s goal: "+d+" skip sn "+A+" to part "+y)}a.tuneInGoal=d}if(t=this.getDeliveryDirectives(a,s.deliveryDirectives,E,y),m||!o){this.loadPlaylist(t);return}}else t=this.getDeliveryDirectives(a,s.deliveryDirectives,E,y);var S=Object(R.computeReloadInterval)(a,n);E!==void 0&&a.canBlockReload&&(S-=a.partTarget||1),this.log("reload live playlist "+c+" in "+Math.round(S)+" ms"),this.timer=self.setTimeout(function(){return l.loadPlaylist(t)},S)}else this.clearTimer()},g.getDeliveryDirectives=function(c,s,i,l){var a=Object(P.getSkipValue)(c,i);return s!=null&&s.skip&&c.deltaUpdateFailed&&(i=s.msn,l=s.part,a=P.HlsSkip.No),new P.HlsUrlParameters(i,l,a)},g.retryLoadingOrFail=function(c){var s=this,i=this.hls.config,l=this.retryCount<i.levelLoadingMaxRetry;if(l){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 n=Math.min(Math.pow(2,this.retryCount)*i.levelLoadingRetryDelay,i.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return s.loadPlaylist()},n),this.warn("retry playlist loading #"+this.retryCount+" in "+n+' ms after "'+c.details+'"')}}else this.warn('cannot recover from error "'+c.details+'"'),this.clearTimer(),c.fatal=!0;return l},C}()},"./src/controller/base-stream-controller.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"State",function(){return _}),I.d(H,"default",function(){return f});var W=I("./src/polyfills/number.ts"),P=I("./src/task-loop.ts"),R=I("./src/controller/fragment-tracker.ts"),K=I("./src/utils/buffer-helper.ts"),N=I("./src/utils/logger.ts"),e=I("./src/events.ts"),C=I("./src/errors.ts"),g=I("./src/types/transmuxer.ts"),v=I("./src/utils/mp4-tools.ts"),c=I("./src/utils/discontinuities.ts"),s=I("./src/controller/fragment-finders.ts"),i=I("./src/controller/level-helper.ts"),l=I("./src/loader/fragment-loader.ts"),a=I("./src/crypt/decrypter.ts"),n=I("./src/utils/time-ranges.ts"),r=I("./src/types/loader.ts");function t(h,o){for(var u=0;u<o.length;u++){var b=o[u];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(h,b.key,b)}}function E(h,o,u){return o&&t(h.prototype,o),u&&t(h,u),h}function y(h){if(h===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h}function m(h,o){h.prototype=Object.create(o.prototype),h.prototype.constructor=h,T(h,o)}function T(h,o){return T=Object.setPrototypeOf||function(b,p){return b.__proto__=p,b},T(h,o)}var _={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"},f=function(h){m(o,h);function o(b,p,d){var A;return A=h.call(this)||this,A.hls=void 0,A.fragPrevious=null,A.fragCurrent=null,A.fragmentTracker=void 0,A.transmuxer=null,A._state=_.STOPPED,A.media=void 0,A.mediaBuffer=void 0,A.config=void 0,A.bitrateTest=!1,A.lastCurrentTime=0,A.nextLoadPosition=0,A.startPosition=0,A.loadedmetadata=!1,A.fragLoadError=0,A.retryDate=0,A.levels=null,A.fragmentLoader=void 0,A.levelLastLoaded=null,A.startFragRequested=!1,A.decrypter=void 0,A.initPTS=[],A.onvseeking=null,A.onvended=null,A.logPrefix="",A.log=void 0,A.warn=void 0,A.logPrefix=d,A.log=N.logger.log.bind(N.logger,d+":"),A.warn=N.logger.warn.bind(N.logger,d+":"),A.hls=b,A.fragmentLoader=new l.default(b.config),A.fragmentTracker=p,A.config=b.config,A.decrypter=new a.default(b,b.config),b.on(e.Events.KEY_LOADED,A.onKeyLoaded,y(A)),A}var u=o.prototype;return u.doTick=function(){this.onTickEnd()},u.onTickEnd=function(){},u.startLoad=function(p){},u.stopLoad=function(){this.fragmentLoader.abort();var p=this.fragCurrent;p&&this.fragmentTracker.removeFragment(p),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=_.STOPPED},u._streamEnded=function(p,d){var A=this.fragCurrent,D=this.fragmentTracker;if(!d.live&&A&&A.sn===d.endSN&&!p.nextStart){var S=D.getState(A);return S===R.FragmentState.PARTIAL||S===R.FragmentState.OK}return!1},u.onMediaAttached=function(p,d){var A=this.media=this.mediaBuffer=d.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),A.addEventListener("seeking",this.onvseeking),A.addEventListener("ended",this.onvended);var D=this.config;this.levels&&D.autoStartLoad&&this.state===_.STOPPED&&this.startLoad(D.startPosition)},u.onMediaDetaching=function(){var p=this.media;p!=null&&p.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),p&&(p.removeEventListener("seeking",this.onvseeking),p.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},u.onMediaSeeking=function(){var p=this.config,d=this.fragCurrent,A=this.media,D=this.mediaBuffer,S=this.state,L=A?A.currentTime:0,M=K.BufferHelper.bufferInfo(D||A,L,p.maxBufferHole);if(this.log("media seeking to "+(Object(W.isFiniteNumber)(L)?L.toFixed(3):L)+", state: "+S),S===_.ENDED)this.resetLoadingState();else if(d&&!M.len){var O=p.maxFragLookUpTolerance,j=d.start-O,G=d.start+d.duration+O,X=L>G;(L<j||X)&&(X&&d.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),d.loader.abort()),this.resetLoadingState())}A&&(this.lastCurrentTime=L),!this.loadedmetadata&&!M.len&&(this.nextLoadPosition=this.startPosition=L),this.tickImmediate()},u.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},u.onKeyLoaded=function(p,d){if(this.state!==_.KEY_LOADING||d.frag!==this.fragCurrent||!this.levels)return;this.state=_.IDLE;var A=this.levels[d.frag.level].details;A&&this.loadFragment(d.frag,A,d.frag.start)},u.onHandlerDestroying=function(){this.stopLoad(),h.prototype.onHandlerDestroying.call(this)},u.onHandlerDestroyed=function(){this.state=_.STOPPED,this.hls.off(e.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,h.prototype.onHandlerDestroyed.call(this)},u.loadKey=function(p,d){this.log("Loading key for "+p.sn+" of ["+d.startSN+"-"+d.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+p.level),this.state=_.KEY_LOADING,this.fragCurrent=p,this.hls.trigger(e.Events.KEY_LOADING,{frag:p})},u.loadFragment=function(p,d,A){this._loadFragForPlayback(p,d,A)},u._loadFragForPlayback=function(p,d,A){var D=this,S=function(M){if(D.fragContextChanged(p)){D.warn("Fragment "+p.sn+(M.part?" p: "+M.part.index:"")+" of level "+p.level+" was dropped during download."),D.fragmentTracker.removeFragment(p);return}p.stats.chunkCount++,D._handleFragmentLoadProgress(M)};this._doFragLoad(p,d,A,S).then(function(L){if(!L)return;D.fragLoadError=0;var M=D.state;if(D.fragContextChanged(p)){(M===_.FRAG_LOADING||M===_.BACKTRACKING||!D.fragCurrent&&M===_.PARSING)&&(D.fragmentTracker.removeFragment(p),D.state=_.IDLE);return}if("payload"in L&&(D.log("Loaded fragment "+p.sn+" of level "+p.level),D.hls.trigger(e.Events.FRAG_LOADED,L),D.state===_.BACKTRACKING)){D.fragmentTracker.backtrack(p,L),D.resetFragmentLoading(p);return}D._handleFragmentLoadComplete(L)}).catch(function(L){D.warn(L),D.resetFragmentLoading(p)})},u.flushMainBuffer=function(p,d,A){if(A===void 0&&(A=null),!(p-d))return;var D={startOffset:p,endOffset:d,type:A};this.fragLoadError=0,this.hls.trigger(e.Events.BUFFER_FLUSHING,D)},u._loadInitSegment=function(p){var d=this;this._doFragLoad(p).then(function(A){if(!A||d.fragContextChanged(p)||!d.levels)throw new Error("init load aborted");return A}).then(function(A){var D=d.hls,S=A.payload,L=p.decryptdata;if(S&&S.byteLength>0&&L&&L.key&&L.iv&&L.method==="AES-128"){var M=self.performance.now();return d.decrypter.webCryptoDecrypt(new Uint8Array(S),L.key.buffer,L.iv.buffer).then(function(O){var j=self.performance.now();return D.trigger(e.Events.FRAG_DECRYPTED,{frag:p,payload:O,stats:{tstart:M,tdecrypt:j}}),A.payload=O,A})}return A}).then(function(A){var D=d.fragCurrent,S=d.hls,L=d.levels;if(!L)throw new Error("init load aborted, missing levels");var M=L[p.level].details;console.assert(M,"Level details are defined when init segment is loaded");var O=p.stats;d.state=_.IDLE,d.fragLoadError=0,p.data=new Uint8Array(A.payload),O.parsing.start=O.buffering.start=self.performance.now(),O.parsing.end=O.buffering.end=self.performance.now(),A.frag===D&&S.trigger(e.Events.FRAG_BUFFERED,{stats:O,frag:D,part:null,id:p.type}),d.tick()}).catch(function(A){d.warn(A),d.resetFragmentLoading(p)})},u.fragContextChanged=function(p){var d=this.fragCurrent;return!p||!d||p.level!==d.level||p.sn!==d.sn||p.urlId!==d.urlId},u.fragBufferedComplete=function(p,d){var A=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+p.type+" sn: "+p.sn+(d?" part: "+d.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+p.level+" "+n.default.toString(K.BufferHelper.getBuffered(A))),this.state=_.IDLE,this.tick()},u._handleFragmentLoadComplete=function(p){var d=this.transmuxer;if(!d)return;var A=p.frag,D=p.part,S=p.partsLoaded,L=!S||S.length===0||S.some(function(O){return!O}),M=new g.ChunkMetadata(A.level,A.sn,A.stats.chunkCount+1,0,D?D.index:-1,!L);d.flush(M)},u._handleFragmentLoadProgress=function(p){},u._doFragLoad=function(p,d,A,D){var S=this;if(A===void 0&&(A=null),!this.levels)throw new Error("frag load aborted, missing levels");if(A=Math.max(p.start,A||0),this.config.lowLatencyMode&&d){var L=d.partList;if(L&&D){A>p.end&&d.fragmentHint&&(p=d.fragmentHint);var M=this.getNextPart(L,p,A);if(M>-1){var O=L[M];return this.log("Loading part sn: "+p.sn+" p: "+O.index+" cc: "+p.cc+" of playlist ["+d.startSN+"-"+d.endSN+"] parts [0-"+M+"-"+(L.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+p.level+", target: "+parseFloat(A.toFixed(3))),this.nextLoadPosition=O.start+O.duration,this.state=_.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:p,part:L[M],targetBufferTime:A}),this.doFragPartsLoad(p,L,M,D).catch(function(j){return S.handleFragLoadError(j)})}else if(!p.url||this.loadedEndOfParts(L,A))return Promise.resolve(null)}}return this.log("Loading fragment "+p.sn+" cc: "+p.cc+" "+(d?"of ["+d.startSN+"-"+d.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+p.level+", target: "+parseFloat(A.toFixed(3))),Object(W.isFiniteNumber)(p.sn)&&!this.bitrateTest&&(this.nextLoadPosition=p.start+p.duration),this.state=_.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:p,targetBufferTime:A}),this.fragmentLoader.load(p,D).catch(function(j){return S.handleFragLoadError(j)})},u.doFragPartsLoad=function(p,d,A,D){var S=this;return new Promise(function(L,M){var O=[],j=function G(X){var te=d[X];S.fragmentLoader.loadPart(p,te,D).then(function(fe){O[te.index]=fe;var ve=fe.part;S.hls.trigger(e.Events.FRAG_LOADED,fe);var he=d[X+1];if(he&&he.fragment===p)G(X+1);else return L({frag:p,part:ve,partsLoaded:O})}).catch(M)};j(A)})},u.handleFragLoadError=function(p){var d=p.data;return d&&d.details===C.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(d.frag,d.part):this.hls.trigger(e.Events.ERROR,d),null},u._handleTransmuxerFlush=function(p){var d=this.getCurrentContext(p);if(!d||this.state!==_.PARSING){this.fragCurrent||(this.state=_.IDLE);return}var A=d.frag,D=d.part,S=d.level,L=self.performance.now();A.stats.parsing.end=L,D&&(D.stats.parsing.end=L),this.updateLevelTiming(A,D,S,p.partial)},u.getCurrentContext=function(p){var d=this.levels,A=p.level,D=p.sn,S=p.part;if(!d||!d[A])return this.warn("Levels object was unset while buffering fragment "+D+" of level "+A+". The current chunk will not be buffered."),null;var L=d[A],M=S>-1?Object(i.getPartWith)(L,D,S):null,O=M?M.fragment:Object(i.getFragmentWithSN)(L,D,this.fragCurrent);return O?{frag:O,part:M,level:L}:null},u.bufferFragmentData=function(p,d,A,D){if(!p||this.state!==_.PARSING)return;var S=p.data1,L=p.data2,M=S;if(S&&L&&(M=Object(v.appendUint8Array)(S,L)),!M||!M.length)return;var O={type:p.type,frag:d,part:A,chunkMeta:D,parent:d.type,data:M};this.hls.trigger(e.Events.BUFFER_APPENDING,O),p.dropped&&p.independent&&!A&&this.flushBufferGap(d)},u.flushBufferGap=function(p){var d=this.media;if(!d)return;if(!K.BufferHelper.isBuffered(d,d.currentTime)){this.flushMainBuffer(0,p.start);return}var A=d.currentTime,D=K.BufferHelper.bufferInfo(d,A,0),S=p.duration,L=Math.min(this.config.maxFragLookUpTolerance*2,S*.25),M=Math.max(Math.min(p.start-L,D.end-L),A+L);p.start-M>L&&this.flushMainBuffer(M,p.start)},u.getFwdBufferInfo=function(p,d){var A=this.config,D=this.getLoadPosition();if(!Object(W.isFiniteNumber)(D))return null;var S=K.BufferHelper.bufferInfo(p,D,A.maxBufferHole);if(S.len===0&&S.nextStart!==void 0){var L=this.fragmentTracker.getBufferedFrag(D,d);if(L&&S.nextStart<L.end)return K.BufferHelper.bufferInfo(p,D,Math.max(S.nextStart,A.maxBufferHole))}return S},u.getMaxBufferLength=function(p){var d=this.config,A;return p?A=Math.max(8*d.maxBufferSize/p,d.maxBufferLength):A=d.maxBufferLength,Math.min(A,d.maxMaxBufferLength)},u.reduceMaxBufferLength=function(p){var d=this.config,A=p||d.maxBufferLength;return d.maxMaxBufferLength>=A?(d.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+d.maxMaxBufferLength+"s"),!0):!1},u.getNextFragment=function(p,d){var A,D,S=d.fragments,L=S.length;if(!L)return null;var M=this.config,O=S[0].start,j;if(d.live){var G=M.initialLiveManifestSize;if(L<G)return this.warn("Not enough fragments to start playback (have: "+L+", need: "+G+")"),null;!d.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(j=this.getInitialLiveFragment(d,S),this.startPosition=j?this.hls.liveSyncPosition||j.start:p)}else p<=O&&(j=S[0]);if(!j){var X=M.lowLatencyMode?d.partEnd:d.fragmentEnd;j=this.getFragmentAtPosition(p,X,d)}return(A=j)!==null&&A!==void 0&&A.initSegment&&!((D=j)!==null&&D!==void 0&&D.initSegment.data)&&!this.bitrateTest&&(j=j.initSegment),j},u.getNextPart=function(p,d,A){for(var D=-1,S=!1,L=!0,M=0,O=p.length;M<O;M++){var j=p[M];if(L=L&&!j.independent,D>-1&&A<j.start)break;var G=j.loaded;!G&&(S||j.independent||L)&&j.fragment===d&&(D=M),S=G}return D},u.loadedEndOfParts=function(p,d){var A=p[p.length-1];return A&&d>A.start&&A.loaded},u.getInitialLiveFragment=function(p,d){var A=this.fragPrevious,D=null;if(A){if(p.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+A.programDateTime),D=Object(s.findFragmentByPDT)(d,A.endProgramDateTime,this.config.maxFragLookUpTolerance)),!D){var S=A.sn+1;if(S>=p.startSN&&S<=p.endSN){var L=d[S-p.startSN];A.cc===L.cc&&(D=L,this.log("Live playlist, switching playlist, load frag with next SN: "+D.sn))}D||(D=Object(s.findFragWithCC)(d,A.cc),D&&this.log("Live playlist, switching playlist, load frag with same CC: "+D.sn))}}else{var M=this.hls.liveSyncPosition;M!==null&&(D=this.getFragmentAtPosition(M,this.bitrateTest?p.fragmentEnd:p.edge,p))}return D},u.getFragmentAtPosition=function(p,d,A){var D=this.config,S=this.fragPrevious,L=A.fragments,M=A.endSN,O=A.fragmentHint,j=D.maxFragLookUpTolerance,G=!!(D.lowLatencyMode&&A.partList&&O);G&&O&&!this.bitrateTest&&(L=L.concat(O),M=O.sn);var X;if(p<d){var te=p>d-j?0:j;X=Object(s.findFragmentByPTS)(S,L,p,te)}else X=L[L.length-1];if(X){var fe=X.sn-A.startSN,ve=S&&X.level===S.level,he=L[fe+1],xe=this.fragmentTracker.getState(X);if(xe===R.FragmentState.BACKTRACKED){X=null;for(var Se=fe;L[Se]&&this.fragmentTracker.getState(L[Se])===R.FragmentState.BACKTRACKED;)S?X=L[Se--]:X=L[--Se];X||(X=he)}else S&&X.sn===S.sn&&!G&&(ve&&(X.sn<M&&this.fragmentTracker.getState(he)!==R.FragmentState.OK?(this.log("SN "+X.sn+" just loaded, load next one: "+he.sn),X=he):X=null))}return X},u.synchronizeToLiveEdge=function(p){var d=this.config,A=this.media;if(!A)return;var D=this.hls.liveSyncPosition,S=A.currentTime,L=p.fragments[0].start,M=p.edge,O=S>=L-d.maxFragLookUpTolerance&&S<=M;if(D!==null&&A.duration>D&&(S<D||!O)){var j=d.liveMaxLatencyDuration!==void 0?d.liveMaxLatencyDuration:d.liveMaxLatencyDurationCount*p.targetduration;(!O&&A.readyState<4||S<M-j)&&(this.loadedmetadata||(this.nextLoadPosition=D),A.readyState&&(this.warn("Playback: "+S.toFixed(3)+" is located too far from the end of live sliding playlist: "+M+", reset currentTime to : "+D.toFixed(3)),A.currentTime=D))}},u.alignPlaylists=function(p,d){var A=this.levels,D=this.levelLastLoaded,S=this.fragPrevious,L=D!==null?A[D]:null,M=p.fragments.length;if(!M)return this.warn("No fragments in live playlist"),0;var O=p.fragments[0].start,j=!d,G=p.alignedSliding&&Object(W.isFiniteNumber)(O);if(j||!G&&!O){Object(c.alignStream)(S,L,p);var X=p.fragments[0].start;return this.log("Live playlist sliding: "+X.toFixed(2)+" start-sn: "+(d?d.startSN:"na")+"->"+p.startSN+" prev-sn: "+(S?S.sn:"na")+" fragments: "+M),X}return O},u.waitForCdnTuneIn=function(p){var d=3;return p.live&&p.canBlockReload&&p.tuneInGoal>Math.max(p.partHoldBack,p.partTarget*d)},u.setStartPosition=function(p,d){var A=this.startPosition;if(A<d&&(A=-1),A===-1||this.lastCurrentTime===-1){var D=p.startTimeOffset;Object(W.isFiniteNumber)(D)?(A=d+D,D<0&&(A+=p.totalduration),A=Math.min(Math.max(d,A),d+p.totalduration),this.log("Start time offset "+D+" found in playlist, adjust startPosition to "+A),this.startPosition=A):p.live?A=this.hls.liveSyncPosition||d:this.startPosition=A=0,this.lastCurrentTime=A}this.nextLoadPosition=A},u.getLoadPosition=function(){var p=this.media,d=0;return this.loadedmetadata&&p?d=p.currentTime:this.nextLoadPosition&&(d=this.nextLoadPosition),d},u.handleFragLoadAborted=function(p,d){this.transmuxer&&p.sn!=="initSegment"&&p.stats.aborted&&(this.warn("Fragment "+p.sn+(d?" part"+d.index:"")+" of level "+p.level+" was aborted"),this.resetFragmentLoading(p))},u.resetFragmentLoading=function(p){(!this.fragCurrent||!this.fragContextChanged(p))&&(this.state=_.IDLE)},u.onFragmentOrKeyLoadError=function(p,d){if(d.fatal)return;var A=d.frag;if(!A||A.type!==p)return;var D=this.fragCurrent;console.assert(D&&A.sn===D.sn&&A.level===D.level&&A.urlId===D.urlId,"Frag load error must match current frag to retry");var S=this.config;if(this.fragLoadError+1<=S.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(A.level))return;var L=Math.min(Math.pow(2,this.fragLoadError)*S.fragLoadingRetryDelay,S.fragLoadingMaxRetryTimeout);this.warn("Fragment "+A.sn+" of "+p+" "+A.level+" failed to load, retrying in "+L+"ms"),this.retryDate=self.performance.now()+L,this.fragLoadError++,this.state=_.FRAG_LOADING_WAITING_RETRY}else d.levelRetry?(p===r.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=_.IDLE):(N.logger.error(d.details+" reaches max retry, redispatch as fatal ..."),d.fatal=!0,this.hls.stopLoad(),this.state=_.ERROR)},u.afterBufferFlushed=function(p,d,A){if(!p)return;var D=K.BufferHelper.getBuffered(p);this.fragmentTracker.detectEvictedFragments(d,D,A),this.state===_.ENDED&&this.resetLoadingState()},u.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=_.IDLE},u.resetLiveStartWhenNotLoaded=function(p){if(!this.loadedmetadata){this.startFragRequested=!1;var d=this.levels?this.levels[p].details:null;if(d!=null&&d.live)return this.startPosition=-1,this.setStartPosition(d,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},u.updateLevelTiming=function(p,d,A,D){var S=this,L=A.details;console.assert(!!L,"level.details must be defined");var M=Object.keys(p.elementaryStreams).reduce(function(O,j){var G=p.elementaryStreams[j];if(G){var X=G.endPTS-G.startPTS;if(X<=0)return S.warn("Could not parse fragment "+p.sn+" "+j+" duration reliably ("+X+") resetting transmuxer to fallback to playlist timing"),S.resetTransmuxer(),O||!1;var te=D?0:Object(i.updateFragPTSDTS)(L,p,G.startPTS,G.endPTS,G.startDTS,G.endDTS);return S.hls.trigger(e.Events.LEVEL_PTS_UPDATED,{details:L,level:A,drift:te,type:j,frag:p,start:G.startPTS,end:G.endPTS}),!0}return O},!1);M?(this.state=_.PARSED,this.hls.trigger(e.Events.FRAG_PARSED,{frag:p,part:d})):this.resetLoadingState()},u.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},E(o,[{key:"state",get:function(){return this._state},set:function(p){var d=this._state;d!==p&&(this._state=p,this.log(d+"->"+p))}}]),o}(P.default)},"./src/controller/buffer-controller.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return s});var W=I("./src/polyfills/number.ts"),P=I("./src/events.ts"),R=I("./src/utils/logger.ts"),K=I("./src/errors.ts"),N=I("./src/utils/buffer-helper.ts"),e=I("./src/utils/mediasource-helper.ts"),C=I("./src/loader/fragment.ts"),g=I("./src/controller/buffer-operation-queue.ts"),v=Object(e.getMediaSource)(),c=/([ha]vc.)(?:\.[^.,]+)+/,s=function(){function i(a){var n=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var r=n.hls,t=n.media,E=n.mediaSource;R.logger.log("[buffer-controller]: Media source opened"),t&&(n.updateMediaElementDuration(),r.trigger(P.Events.MEDIA_ATTACHED,{media:t})),E&&E.removeEventListener("sourceopen",n._onMediaSourceOpen),n.checkPendingTracks()},this._onMediaSourceClose=function(){R.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){R.logger.log("[buffer-controller]: Media source ended")},this.hls=a,this._initSourceBuffer(),this.registerListeners()}var l=i.prototype;return l.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},l.destroy=function(){this.unregisterListeners(),this.details=null},l.registerListeners=function(){var n=this.hls;n.on(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(P.Events.BUFFER_RESET,this.onBufferReset,this),n.on(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.on(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.on(P.Events.BUFFER_EOS,this.onBufferEos,this),n.on(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.on(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.on(P.Events.FRAG_PARSED,this.onFragParsed,this),n.on(P.Events.FRAG_CHANGED,this.onFragChanged,this)},l.unregisterListeners=function(){var n=this.hls;n.off(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(P.Events.BUFFER_RESET,this.onBufferReset,this),n.off(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.off(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.off(P.Events.BUFFER_EOS,this.onBufferEos,this),n.off(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.off(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.off(P.Events.FRAG_PARSED,this.onFragParsed,this),n.off(P.Events.FRAG_CHANGED,this.onFragChanged,this)},l._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new g.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},l.onManifestParsed=function(n,r){var t=2;(r.audio&&!r.video||!r.altAudio)&&(t=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=t,this.details=null,R.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},l.onMediaAttaching=function(n,r){var t=this.media=r.media;if(t&&v){var E=this.mediaSource=new v;E.addEventListener("sourceopen",this._onMediaSourceOpen),E.addEventListener("sourceended",this._onMediaSourceEnded),E.addEventListener("sourceclose",this._onMediaSourceClose),t.src=self.URL.createObjectURL(E),this._objectUrl=t.src}},l.onMediaDetaching=function(){var n=this.media,r=this.mediaSource,t=this._objectUrl;if(r){if(R.logger.log("[buffer-controller]: media source detaching"),r.readyState==="open")try{r.endOfStream()}catch(E){R.logger.warn("[buffer-controller]: onMediaDetaching: "+E.message+" while calling endOfStream")}this.onBufferReset(),r.removeEventListener("sourceopen",this._onMediaSourceOpen),r.removeEventListener("sourceended",this._onMediaSourceEnded),r.removeEventListener("sourceclose",this._onMediaSourceClose),n&&(t&&self.URL.revokeObjectURL(t),n.src===t?(n.removeAttribute("src"),n.load()):R.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(P.Events.MEDIA_DETACHED,void 0)},l.onBufferReset=function(){var n=this;this.getSourceBufferTypes().forEach(function(r){var t=n.sourceBuffer[r];try{t&&(n.removeBufferListeners(r),n.mediaSource&&n.mediaSource.removeSourceBuffer(t),n.sourceBuffer[r]=void 0)}catch(E){R.logger.warn("[buffer-controller]: Failed to reset the "+r+" buffer",E)}}),this._initSourceBuffer()},l.onBufferCodecs=function(n,r){var t=this,E=this.getSourceBufferTypes().length;if(Object.keys(r).forEach(function(y){if(E){var m=t.tracks[y];if(m&&typeof m.buffer.changeType=="function"){var T=r[y],_=T.codec,f=T.levelCodec,h=T.container,o=(m.levelCodec||m.codec).replace(c,"$1"),u=(f||_).replace(c,"$1");if(o!==u){var b=h+";codecs="+(f||_);t.appendChangeType(y,b)}}}else t.pendingTracks[y]=r[y]}),E)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},l.appendChangeType=function(n,r){var t=this,E=this.operationQueue,y={execute:function(){var T=t.sourceBuffer[n];T&&(R.logger.log("[buffer-controller]: changing "+n+" sourceBuffer type to "+r),T.changeType(r)),E.shiftAndExecuteNext(n)},onStart:function(){},onComplete:function(){},onError:function(T){R.logger.warn("[buffer-controller]: Failed to change "+n+" SourceBuffer type",T)}};E.append(y,n)},l.onBufferAppending=function(n,r){var t=this,E=this.hls,y=this.operationQueue,m=this.tracks,T=r.data,_=r.type,f=r.frag,h=r.part,o=r.chunkMeta,u=o.buffering[_],b=self.performance.now();u.start=b;var p=f.stats.buffering,d=h?h.stats.buffering:null;p.start===0&&(p.start=b),d&&d.start===0&&(d.start=b);var A=m.audio,D=_==="audio"&&o.id===1&&(A==null?void 0:A.container)==="audio/mpeg",S={execute:function(){if(u.executeStart=self.performance.now(),D){var M=t.sourceBuffer[_];if(M){var O=f.start-M.timestampOffset;Math.abs(O)>=.1&&(R.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+f.start+" (delta: "+O+") sn: "+f.sn+")"),M.timestampOffset=f.start)}}t.appendExecutor(T,_)},onStart:function(){},onComplete:function(){var M=self.performance.now();u.executeEnd=u.end=M,p.first===0&&(p.first=M),d&&d.first===0&&(d.first=M);var O=t.sourceBuffer,j={};for(var G in O)j[G]=N.BufferHelper.getBuffered(O[G]);t.appendError=0,t.hls.trigger(P.Events.BUFFER_APPENDED,{type:_,frag:f,part:h,chunkMeta:o,parent:f.type,timeRanges:j})},onError:function(M){R.logger.error("[buffer-controller]: Error encountered while trying to append to the "+_+" SourceBuffer",M);var O={type:K.ErrorTypes.MEDIA_ERROR,parent:f.type,details:K.ErrorDetails.BUFFER_APPEND_ERROR,err:M,fatal:!1};M.code===DOMException.QUOTA_EXCEEDED_ERR?O.details=K.ErrorDetails.BUFFER_FULL_ERROR:(t.appendError++,O.details=K.ErrorDetails.BUFFER_APPEND_ERROR,t.appendError>E.config.appendErrorMaxRetry&&(R.logger.error("[buffer-controller]: Failed "+E.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),O.fatal=!0)),E.trigger(P.Events.ERROR,O)}};y.append(S,_)},l.onBufferFlushing=function(n,r){var t=this,E=this.operationQueue,y=function(T){return{execute:t.removeExecutor.bind(t,T,r.startOffset,r.endOffset),onStart:function(){},onComplete:function(){t.hls.trigger(P.Events.BUFFER_FLUSHED,{type:T})},onError:function(f){R.logger.warn("[buffer-controller]: Failed to remove from "+T+" SourceBuffer",f)}}};r.type?E.append(y(r.type),r.type):this.getSourceBufferTypes().forEach(function(m){E.append(y(m),m)})},l.onFragParsed=function(n,r){var t=this,E=r.frag,y=r.part,m=[],T=y?y.elementaryStreams:E.elementaryStreams;T[C.ElementaryStreamTypes.AUDIOVIDEO]?m.push("audiovideo"):(T[C.ElementaryStreamTypes.AUDIO]&&m.push("audio"),T[C.ElementaryStreamTypes.VIDEO]&&m.push("video"));var _=function(){var h=self.performance.now();E.stats.buffering.end=h,y&&(y.stats.buffering.end=h);var o=y?y.stats:E.stats;t.hls.trigger(P.Events.FRAG_BUFFERED,{frag:E,part:y,stats:o,id:E.type})};m.length===0&&R.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+E.type+" level: "+E.level+" sn: "+E.sn),this.blockBuffers(_,m)},l.onFragChanged=function(n,r){this.flushBackBuffer()},l.onBufferEos=function(n,r){var t=this,E=this.getSourceBufferTypes().reduce(function(y,m){var T=t.sourceBuffer[m];return(!r.type||r.type===m)&&(T&&!T.ended&&(T.ended=!0,R.logger.log("[buffer-controller]: "+m+" sourceBuffer now EOS"))),y&&!!(!T||T.ended)},!0);E&&this.blockBuffers(function(){var y=t.mediaSource;if(!y||y.readyState!=="open")return;y.endOfStream()})},l.onLevelUpdated=function(n,r){var t=r.details;if(!t.fragments.length)return;this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},l.flushBackBuffer=function(){var n=this.hls,r=this.details,t=this.media,E=this.sourceBuffer;if(!t||r===null)return;var y=this.getSourceBufferTypes();if(!y.length)return;var m=r.live&&n.config.liveBackBufferLength!==null?n.config.liveBackBufferLength:n.config.backBufferLength;if(!Object(W.isFiniteNumber)(m)||m<0)return;var T=t.currentTime,_=r.levelTargetDuration,f=Math.max(m,_),h=Math.floor(T/_)*_-f;y.forEach(function(o){var u=E[o];if(u){var b=N.BufferHelper.getBuffered(u);b.length>0&&h>b.start(0)&&(n.trigger(P.Events.BACK_BUFFER_REACHED,{bufferEnd:h}),r.live&&n.trigger(P.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:h}),n.trigger(P.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:h,type:o}))}})},l.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var n=this.details,r=this.hls,t=this.media,E=this.mediaSource,y=n.fragments[0].start+n.totalduration,m=t.duration,T=Object(W.isFiniteNumber)(E.duration)?E.duration:0;n.live&&r.config.liveDurationInfinity?(R.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),E.duration=Infinity,this.updateSeekableRange(n)):(y>T&&y>m||!Object(W.isFiniteNumber)(m))&&(R.logger.log("[buffer-controller]: Updating Media Source duration to "+y.toFixed(3)),E.duration=y)},l.updateSeekableRange=function(n){var r=this.mediaSource,t=n.fragments,E=t.length;if(E&&n.live&&r!==null&&r!==void 0&&r.setLiveSeekableRange){var y=Math.max(0,t[0].start),m=Math.max(y,y+n.totalduration);r.setLiveSeekableRange(y,m)}},l.checkPendingTracks=function(){var n=this.bufferCodecEventsExpected,r=this.operationQueue,t=this.pendingTracks,E=Object.keys(t).length;if(E&&!n||E===2){this.createSourceBuffers(t),this.pendingTracks={};var y=this.getSourceBufferTypes();if(y.length===0){this.hls.trigger(P.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}y.forEach(function(m){r.executeNext(m)})}},l.createSourceBuffers=function(n){var r=this.sourceBuffer,t=this.mediaSource;if(!t)throw Error("createSourceBuffers called when mediaSource was null");var E=0;for(var y in n)if(!r[y]){var m=n[y];if(!m)throw Error("source buffer exists for track "+y+", however track does not");var T=m.levelCodec||m.codec,_=m.container+";codecs="+T;R.logger.log("[buffer-controller]: creating sourceBuffer("+_+")");try{var f=r[y]=t.addSourceBuffer(_),h=y;this.addBufferListener(h,"updatestart",this._onSBUpdateStart),this.addBufferListener(h,"updateend",this._onSBUpdateEnd),this.addBufferListener(h,"error",this._onSBUpdateError),this.tracks[y]={buffer:f,codec:T,container:m.container,levelCodec:m.levelCodec,id:m.id},E++}catch(o){R.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+o.message),this.hls.trigger(P.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:o,mimeType:_})}}E&&this.hls.trigger(P.Events.BUFFER_CREATED,{tracks:this.tracks})},l._onSBUpdateStart=function(n){var r=this.operationQueue,t=r.current(n);t.onStart()},l._onSBUpdateEnd=function(n){var r=this.operationQueue,t=r.current(n);t.onComplete(),r.shiftAndExecuteNext(n)},l._onSBUpdateError=function(n,r){R.logger.error("[buffer-controller]: "+n+" SourceBuffer error",r),this.hls.trigger(P.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var t=this.operationQueue.current(n);t&&t.onError(r)},l.removeExecutor=function(n,r,t){var E=this.media,y=this.mediaSource,m=this.operationQueue,T=this.sourceBuffer,_=T[n];if(!E||!y||!_){R.logger.warn("[buffer-controller]: Attempting to remove from the "+n+" SourceBuffer, but it does not exist"),m.shiftAndExecuteNext(n);return}var f=Object(W.isFiniteNumber)(E.duration)?E.duration:Infinity,h=Object(W.isFiniteNumber)(y.duration)?y.duration:Infinity,o=Math.max(0,r),u=Math.min(t,f,h);u>o?(R.logger.log("[buffer-controller]: Removing ["+o+","+u+"] from the "+n+" SourceBuffer"),console.assert(!_.updating,n+" sourceBuffer must not be updating"),_.remove(o,u)):m.shiftAndExecuteNext(n)},l.appendExecutor=function(n,r){var t=this.operationQueue,E=this.sourceBuffer,y=E[r];if(!y){R.logger.warn("[buffer-controller]: Attempting to append to the "+r+" SourceBuffer, but it does not exist"),t.shiftAndExecuteNext(r);return}y.ended=!1,console.assert(!y.updating,r+" sourceBuffer must not be updating"),y.appendBuffer(n)},l.blockBuffers=function(n,r){var t=this;if(r===void 0&&(r=this.getSourceBufferTypes()),!r.length){R.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(n);return}var E=this.operationQueue,y=r.map(function(m){return E.appendBlocker(m)});Promise.all(y).then(function(){n(),r.forEach(function(m){var T=t.sourceBuffer[m];(!T||!T.updating)&&E.shiftAndExecuteNext(m)})})},l.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},l.addBufferListener=function(n,r,t){var E=this.sourceBuffer[n];if(!E)return;var y=t.bind(this,n);this.listeners[n].push({event:r,listener:y}),E.addEventListener(r,y)},l.removeBufferListeners=function(n){var r=this.sourceBuffer[n];if(!r)return;this.listeners[n].forEach(function(t){r.removeEventListener(t.event,t.listener)})},i}()},"./src/controller/buffer-operation-queue.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return P});var W=I("./src/utils/logger.ts"),P=function(){function R(N){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=N}var K=R.prototype;return K.append=function(e,C){var g=this.queues[C];g.push(e),g.length===1&&this.buffers[C]&&this.executeNext(C)},K.insertAbort=function(e,C){var g=this.queues[C];g.unshift(e),this.executeNext(C)},K.appendBlocker=function(e){var C,g=new Promise(function(c){C=c}),v={execute:C,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(v,e),g},K.executeNext=function(e){var C=this.buffers,g=this.queues,v=C[e],c=g[e];if(c.length){var s=c[0];try{s.execute()}catch(i){W.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),s.onError(i),(!v||!v.updating)&&(c.shift(),this.executeNext(e))}}},K.shiftAndExecuteNext=function(e){this.queues[e].shift(),this.executeNext(e)},K.current=function(e){return this.queues[e][0]},R}()},"./src/controller/cap-level-controller.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/events.ts");function P(N,e){for(var C=0;C<e.length;C++){var g=e[C];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(N,g.key,g)}}function R(N,e,C){return e&&P(N.prototype,e),C&&P(N,C),N}var K=function(){function N(C){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=C,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var e=N.prototype;return e.setStreamController=function(g){this.streamController=g},e.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},e.registerListeners=function(){var g=this.hls;g.on(W.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.on(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.on(W.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.unregisterListener=function(){var g=this.hls;g.off(W.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.off(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.off(W.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.onFpsDropLevelCapping=function(g,v){N.isLevelAllowed(v.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(v.droppedLevel)},e.onMediaAttaching=function(g,v){this.media=v.media instanceof HTMLVideoElement?v.media:null},e.onManifestParsed=function(g,v){var c=this.hls;this.restrictedLevels=[],this.firstLevel=v.firstLevel,c.config.capLevelToPlayerSize&&v.video&&this.startCapping()},e.onBufferCodecs=function(g,v){var c=this.hls;c.config.capLevelToPlayerSize&&v.video&&this.startCapping()},e.onMediaDetaching=function(){this.stopCapping()},e.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var g=this.hls.levels;if(g.length){var v=this.hls;v.autoLevelCapping=this.getMaxLevel(g.length-1),v.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=v.autoLevelCapping}}},e.getMaxLevel=function(g){var v=this,c=this.hls.levels;if(!c.length)return-1;var s=c.filter(function(i,l){return N.isLevelAllowed(l,v.restrictedLevels)&&l<=g});return this.clientRect=null,N.getMaxLevelByMediaSize(s,this.mediaWidth,this.mediaHeight)},e.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()},e.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},e.getDimensions=function(){if(this.clientRect)return this.clientRect;var g=this.media,v={width:0,height:0};if(g){var c=g.getBoundingClientRect();v.width=c.width,v.height=c.height,!v.width&&!v.height&&(v.width=c.right-c.left||g.width||0,v.height=c.bottom-c.top||g.height||0)}return this.clientRect=v,v},N.isLevelAllowed=function(g,v){return v===void 0&&(v=[]),v.indexOf(g)===-1},N.getMaxLevelByMediaSize=function(g,v,c){if(!g||!g.length)return-1;for(var s=function(r,t){return t?r.width!==t.width||r.height!==t.height:!0},i=g.length-1,l=0;l<g.length;l+=1){var a=g[l];if((a.width>=v||a.height>=c)&&s(a,g[l+1])){i=l;break}}return i},R(N,[{key:"mediaWidth",get:function(){return this.getDimensions().width*N.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*N.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var g=1;try{g=self.devicePixelRatio}catch(v){}return g}}]),N}();H.default=K},"./src/controller/cmcd-controller.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return s});var W=I("./src/events.ts"),P=I("./src/types/cmcd.ts"),R=I("./src/utils/buffer-helper.ts"),K=I("./src/utils/logger.ts");function N(i,l){for(var a=0;a<l.length;a++){var n=l[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(i,n.key,n)}}function e(i,l,a){return l&&N(i.prototype,l),a&&N(i,a),i}function C(i,l){var a=typeof Symbol!="undefined"&&i[Symbol.iterator]||i["@@iterator"];if(a)return(a=a.call(i)).next.bind(a);if(Array.isArray(i)||(a=g(i))||l&&i&&typeof i.length=="number"){a&&(i=a);var n=0;return function(){return n>=i.length?{done:!0}:{done:!1,value:i[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function g(i,l){if(!i)return;if(typeof i=="string")return v(i,l);var a=Object.prototype.toString.call(i).slice(8,-1);if(a==="Object"&&i.constructor&&(a=i.constructor.name),a==="Map"||a==="Set")return Array.from(i);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return v(i,l)}function v(i,l){(l==null||l>i.length)&&(l=i.length);for(var a=0,n=new Array(l);a<l;a++)n[a]=i[a];return n}function c(){return c=Object.assign||function(i){for(var l=1;l<arguments.length;l++){var a=arguments[l];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(i[n]=a[n])}return i},c.apply(this,arguments)}var s=function(){function i(a){var n=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(){n.initialized&&(n.starved=!0),n.buffering=!0},this.onPlaying=function(){n.initialized||(n.initialized=!0),n.buffering=!1},this.applyPlaylistData=function(E){try{n.apply(E,{ot:P.CMCDObjectType.MANIFEST,su:!n.initialized})}catch(y){K.logger.warn("Could not generate manifest CMCD data.",y)}},this.applyFragmentData=function(E){try{var y=E.frag,m=n.hls.levels[y.level],T=n.getObjectType(y),_={d:y.duration*1e3,ot:T};(T===P.CMCDObjectType.VIDEO||T===P.CMCDObjectType.AUDIO||T==P.CMCDObjectType.MUXED)&&(_.br=m.bitrate/1e3,_.tb=n.getTopBandwidth(T),_.bl=n.getBufferLength(T)),n.apply(E,_)}catch(f){K.logger.warn("Could not generate segment CMCD data.",f)}},this.hls=a;var r=this.config=a.config,t=r.cmcd;t!=null&&(r.pLoader=this.createPlaylistLoader(),r.fLoader=this.createFragmentLoader(),this.sid=t.sessionId||i.uuid(),this.cid=t.contentId,this.useHeaders=t.useHeaders===!0,this.registerListeners())}var l=i.prototype;return l.registerListeners=function(){var n=this.hls;n.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(W.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.on(W.Events.BUFFER_CREATED,this.onBufferCreated,this)},l.unregisterListeners=function(){var n=this.hls;n.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(W.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.off(W.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},l.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},l.onMediaAttached=function(n,r){this.media=r.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},l.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},l.onBufferCreated=function(n,r){var t,E;this.audioBuffer=(t=r.tracks.audio)===null||t===void 0?void 0:t.buffer,this.videoBuffer=(E=r.tracks.video)===null||E===void 0?void 0:E.buffer},l.createData=function(){var n;return{v:P.CMCDVersion,sf:P.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(n=this.media)===null||n===void 0?void 0:n.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},l.apply=function(n,r){r===void 0&&(r={}),c(r,this.createData());var t=r.ot===P.CMCDObjectType.INIT||r.ot===P.CMCDObjectType.VIDEO||r.ot===P.CMCDObjectType.MUXED;if(this.starved&&t&&(r.bs=!0,r.su=!0,this.starved=!1),r.su==null&&(r.su=this.buffering),this.useHeaders){var E=i.toHeaders(r);if(!Object.keys(E).length)return;n.headers||(n.headers={}),c(n.headers,E)}else{var y=i.toQuery(r);if(!y)return;n.url=i.appendQueryToUri(n.url,y)}},l.getObjectType=function(n){var r=n.type;return r==="subtitle"?P.CMCDObjectType.TIMED_TEXT:n.sn==="initSegment"?P.CMCDObjectType.INIT:r==="audio"?P.CMCDObjectType.AUDIO:r==="main"?this.hls.audioTracks.length?P.CMCDObjectType.VIDEO:P.CMCDObjectType.MUXED:void 0},l.getTopBandwidth=function(n){for(var r=0,t=n===P.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,E=C(t),y;!(y=E()).done;){var m=y.value;m.bitrate>r&&(r=m.bitrate)}return r>0?r:NaN},l.getBufferLength=function(n){var r=this.hls.media,t=n===P.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!t||!r)return NaN;var E=R.BufferHelper.bufferInfo(t,r.currentTime,this.config.maxBufferHole);return E.len*1e3},l.createPlaylistLoader=function(){var n=this.config.pLoader,r=this.applyPlaylistData,t=n||this.config.loader;return function(){function E(m){this.loader=void 0,this.loader=new t(m)}var y=E.prototype;return y.destroy=function(){this.loader.destroy()},y.abort=function(){this.loader.abort()},y.load=function(T,_,f){r(T),this.loader.load(T,_,f)},e(E,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),E}()},l.createFragmentLoader=function(){var n=this.config.fLoader,r=this.applyFragmentData,t=n||this.config.loader;return function(){function E(m){this.loader=void 0,this.loader=new t(m)}var y=E.prototype;return y.destroy=function(){this.loader.destroy()},y.abort=function(){this.loader.abort()},y.load=function(T,_,f){r(T),this.loader.load(T,_,f)},e(E,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),E}()},i.uuid=function(){var n=URL.createObjectURL(new Blob),r=n.toString();return URL.revokeObjectURL(n),r.substr(r.lastIndexOf("/")+1)},i.serialize=function(n){for(var r=[],t=function(D){return!Number.isNaN(D)&&D!=null&&D!==""&&D!==!1},E=function(D){return Math.round(D)},y=function(D){return E(D/100)*100},m=function(D){return encodeURIComponent(D)},T={br:E,d:E,bl:y,dl:y,mtp:y,nor:m,rtp:y,tb:E},_=Object.keys(n||{}).sort(),f=C(_),h;!(h=f()).done;){var o=h.value,u=n[o];if(!t(u))continue;if(o==="v"&&u===1)continue;if(o=="pr"&&u===1)continue;var b=T[o];b&&(u=b(u));var p=typeof u,d=void 0;o==="ot"||o==="sf"||o==="st"?d=o+"="+u:p==="boolean"?d=o:p==="number"?d=o+"="+u:d=o+"="+JSON.stringify(u),r.push(d)}return r.join(",")},i.toHeaders=function(n){for(var r=Object.keys(n),t={},E=["Object","Request","Session","Status"],y=[{},{},{},{}],m={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},T=0,_=r;T<_.length;T++){var f=_[T],h=m[f]!=null?m[f]:1;y[h][f]=n[f]}for(var o=0;o<y.length;o++){var u=i.serialize(y[o]);u&&(t["CMCD-"+E[o]]=u)}return t},i.toQuery=function(n){return"CMCD="+encodeURIComponent(i.serialize(n))},i.appendQueryToUri=function(n,r){if(!r)return n;var t=n.includes("?")?"&":"?";return""+n+t+r},i}()},"./src/controller/eme-controller.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/events.ts"),P=I("./src/errors.ts"),R=I("./src/utils/logger.ts"),K=I("./src/utils/mediakeys-helper.ts");function N(s,i){for(var l=0;l<i.length;l++){var a=i[l];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(s,a.key,a)}}function e(s,i,l){return i&&N(s.prototype,i),l&&N(s,l),s}var C=3,g=function(i,l,a){var n={audioCapabilities:[],videoCapabilities:[]};return i.forEach(function(r){n.audioCapabilities.push({contentType:'audio/mp4; codecs="'+r+'"',robustness:a.audioRobustness||""})}),l.forEach(function(r){n.videoCapabilities.push({contentType:'video/mp4; codecs="'+r+'"',robustness:a.videoRobustness||""})}),[n]},v=function(i,l,a,n){switch(i){case K.KeySystems.WIDEVINE:return g(l,a,n);default:throw new Error("Unknown key-system: "+i)}},c=function(){function s(l){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=l,this._config=l.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 i=s.prototype;return i.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},i._registerListeners=function(){this.hls.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(W.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this)},i._unregisterListeners=function(){this.hls.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(W.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this)},i.getLicenseServerUrl=function(a){switch(a){case K.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+a+'"')},i._attemptKeySystemAccess=function(a,n,r){var t=this,E=v(a,n,r,this._drmSystemOptions);R.logger.log("Requesting encrypted media key-system access");var y=this.requestMediaKeySystemAccess(a,E);this.mediaKeysPromise=y.then(function(m){return t._onMediaKeySystemAccessObtained(a,m)}),y.catch(function(m){R.logger.error('Failed to obtain key-system "'+a+'" access:',m)})},i._onMediaKeySystemAccessObtained=function(a,n){var r=this;R.logger.log('Access for key-system "'+a+'" obtained');var t={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:n,mediaKeySystemDomain:a};this._mediaKeysList.push(t);var E=Promise.resolve().then(function(){return n.createMediaKeys()}).then(function(y){return t.mediaKeys=y,R.logger.log('Media-keys created for key-system "'+a+'"'),r._onMediaKeysCreated(),y});return E.catch(function(y){R.logger.error("Failed to create media-keys:",y)}),E},i._onMediaKeysCreated=function(){var a=this;this._mediaKeysList.forEach(function(n){n.mediaKeysSession||(n.mediaKeysSession=n.mediaKeys.createSession(),a._onNewMediaKeySession(n.mediaKeysSession))})},i._onNewMediaKeySession=function(a){var n=this;R.logger.log("New key-system session "+a.sessionId),a.addEventListener("message",function(r){n._onKeySessionMessage(a,r.message)},!1)},i._onKeySessionMessage=function(a,n){R.logger.log("Got EME message event, creating license request"),this._requestLicense(n,function(r){R.logger.log("Received license data (length: "+(r&&r.byteLength)+"), updating key-session"),a.update(r)})},i.onMediaEncrypted=function(a){var n=this;if(R.logger.log('Media is encrypted using "'+a.initDataType+'" init data type'),!this.mediaKeysPromise){R.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var r=function(E){if(!n._media)return;n._attemptSetMediaKeys(E),n._generateRequestWithPreferredKeySession(a.initDataType,a.initData)};this.mediaKeysPromise.then(r).catch(r)},i._attemptSetMediaKeys=function(a){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var n=this._mediaKeysList[0];if(!n||!n.mediaKeys){R.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}R.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(n.mediaKeys),this._hasSetMediaKeys=!0}},i._generateRequestWithPreferredKeySession=function(a,n){var r=this,t=this._mediaKeysList[0];if(!t){R.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(t.mediaKeysSessionInitialized){R.logger.warn("Key-Session already initialized but requested again");return}var E=t.mediaKeysSession;if(!E){R.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!n){R.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}R.logger.log('Generating key-session request for "'+a+'" init data type'),t.mediaKeysSessionInitialized=!0,E.generateRequest(a,n).then(function(){R.logger.debug("Key-session generation succeeded")}).catch(function(y){R.logger.error("Error generating key-session request:",y),r.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},i._createLicenseXhr=function(a,n,r){var t=new XMLHttpRequest;t.responseType="arraybuffer",t.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,t,a,n,r);var E=this._licenseXhrSetup;if(E)try{E.call(this.hls,t,a),E=void 0}catch(y){R.logger.error(y)}try{t.readyState||t.open("POST",a,!0),E&&E.call(this.hls,t,a)}catch(y){throw new Error("issue setting up KeySystem license XHR "+y)}return t},i._onLicenseRequestReadyStageChange=function(a,n,r,t){switch(a.readyState){case 4:if(a.status===200){this._requestLicenseFailureCount=0,R.logger.log("License request succeeded");var E=a.response,y=this._licenseResponseCallback;if(y)try{E=y.call(this.hls,a,n)}catch(T){R.logger.error(T)}t(E)}else{if(R.logger.error("License Request XHR failed ("+n+"). Status: "+a.status+" ("+a.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>C){this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var m=C-this._requestLicenseFailureCount+1;R.logger.warn("Retrying license request, "+m+" attempts left"),this._requestLicense(r,t)}break}},i._generateLicenseRequestChallenge=function(a,n){switch(a.mediaKeySystemDomain){case K.KeySystems.WIDEVINE:return n}throw new Error("unsupported key-system: "+a.mediaKeySystemDomain)},i._requestLicense=function(a,n){R.logger.log("Requesting content license for key-system");var r=this._mediaKeysList[0];if(!r){R.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var t=this.getLicenseServerUrl(r.mediaKeySystemDomain),E=this._createLicenseXhr(t,a,n);R.logger.log("Sending license request to URL: "+t);var y=this._generateLicenseRequestChallenge(r,a);E.send(y)}catch(m){R.logger.error("Failure requesting DRM license: "+m),this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},i.onMediaAttached=function(a,n){if(!this._emeEnabled)return;var r=n.media;this._media=r,r.addEventListener("encrypted",this._onMediaEncrypted)},i.onMediaDetached=function(){var a=this._media,n=this._mediaKeysList;if(!a)return;a.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(n.map(function(r){if(r.mediaKeysSession)return r.mediaKeysSession.close().catch(function(){})})).then(function(){return a.setMediaKeys(null)}).catch(function(){})},i.onManifestParsed=function(a,n){if(!this._emeEnabled)return;var r=n.levels.map(function(E){return E.audioCodec}).filter(function(E){return!!E}),t=n.levels.map(function(E){return E.videoCodec}).filter(function(E){return!!E});this._attemptKeySystemAccess(K.KeySystems.WIDEVINE,r,t)},e(s,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),s}();H.default=c},"./src/controller/fps-controller.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/events.ts"),P=I("./src/utils/logger.ts"),R=function(){function K(e){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=e,this.registerListeners()}var N=K.prototype;return N.setStreamController=function(C){this.streamController=C},N.registerListeners=function(){this.hls.on(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},N.unregisterListeners=function(){this.hls.off(W.Events.MEDIA_ATTACHING,this.onMediaAttaching)},N.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},N.onMediaAttaching=function(C,g){var v=this.hls.config;if(v.capLevelOnFPSDrop){var c=g.media instanceof self.HTMLVideoElement?g.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),v.fpsDroppedMonitoringPeriod)}},N.checkFPS=function(C,g,v){var c=performance.now();if(g){if(this.lastTime){var s=c-this.lastTime,i=v-this.lastDroppedFrames,l=g-this.lastDecodedFrames,a=1e3*i/s,n=this.hls;if(n.trigger(W.Events.FPS_DROP,{currentDropped:i,currentDecoded:l,totalDroppedFrames:v}),a>0&&i>n.config.fpsDroppedMonitoringThreshold*l){var r=n.currentLevel;P.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+r),r>0&&(n.autoLevelCapping===-1||n.autoLevelCapping>=r)&&(r=r-1,n.trigger(W.Events.FPS_DROP_LEVEL_CAPPING,{level:r,droppedLevel:n.currentLevel}),n.autoLevelCapping=r,this.streamController.nextLevelSwitch())}}this.lastTime=c,this.lastDroppedFrames=v,this.lastDecodedFrames=g}},N.checkFPSInterval=function(){var C=this.media;if(C)if(this.isVideoPlaybackQualityAvailable){var g=C.getVideoPlaybackQuality();this.checkFPS(C,g.totalVideoFrames,g.droppedVideoFrames)}else this.checkFPS(C,C.webkitDecodedFrameCount,C.webkitDroppedFrameCount)},K}();H.default=R},"./src/controller/fragment-finders.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"findFragmentByPDT",function(){return R}),I.d(H,"findFragmentByPTS",function(){return K}),I.d(H,"fragmentWithinToleranceTest",function(){return N}),I.d(H,"pdtWithinToleranceTest",function(){return e}),I.d(H,"findFragWithCC",function(){return C});var W=I("./src/polyfills/number.ts"),P=I("./src/utils/binary-search.ts");function R(g,v,c){if(v===null||!Array.isArray(g)||!g.length||!Object(W.isFiniteNumber)(v))return null;var s=g[0].programDateTime;if(v<(s||0))return null;var i=g[g.length-1].endProgramDateTime;if(v>=(i||0))return null;c=c||0;for(var l=0;l<g.length;++l){var a=g[l];if(e(v,c,a))return a}return null}function K(g,v,c,s){c===void 0&&(c=0),s===void 0&&(s=0);var i=null;if(g?i=v[g.sn-v[0].sn+1]||null:c===0&&v[0].start===0&&(i=v[0]),i&&N(c,s,i)===0)return i;var l=P.default.search(v,N.bind(null,c,s));return l||i}function N(g,v,c){g===void 0&&(g=0),v===void 0&&(v=0);var s=Math.min(v,c.duration+(c.deltaPTS?c.deltaPTS:0));return c.start+c.duration-s<=g?1:c.start-s>g&&c.start?-1:0}function e(g,v,c){var s=Math.min(v,c.duration+(c.deltaPTS?c.deltaPTS:0))*1e3,i=c.endProgramDateTime||0;return i-s>g}function C(g,v){return P.default.search(g,function(c){return c.cc<v?1:c.cc>v?-1:0})}},"./src/controller/fragment-tracker.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"FragmentState",function(){return R}),I.d(H,"FragmentTracker",function(){return K});var W=I("./src/events.ts"),P=I("./src/types/loader.ts"),R;(function(C){C.NOT_LOADED="NOT_LOADED",C.BACKTRACKED="BACKTRACKED",C.APPENDING="APPENDING",C.PARTIAL="PARTIAL",C.OK="OK"})(R||(R={}));var K=function(){function C(v){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=v,this._registerListeners()}var g=C.prototype;return g._registerListeners=function(){var c=this.hls;c.on(W.Events.BUFFER_APPENDED,this.onBufferAppended,this),c.on(W.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.on(W.Events.FRAG_LOADED,this.onFragLoaded,this)},g._unregisterListeners=function(){var c=this.hls;c.off(W.Events.BUFFER_APPENDED,this.onBufferAppended,this),c.off(W.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.off(W.Events.FRAG_LOADED,this.onFragLoaded,this)},g.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},g.getAppendedFrag=function(c,s){if(s===P.PlaylistLevelType.MAIN){var i=this.activeFragment,l=this.activeParts;if(!i)return null;if(l)for(var a=l.length;a--;){var n=l[a],r=n?n.end:i.appendedPTS;if(n.start<=c&&r!==void 0&&c<=r)return a>9&&(this.activeParts=l.slice(a-9)),n}else if(i.start<=c&&i.appendedPTS!==void 0&&c<=i.appendedPTS)return i}return this.getBufferedFrag(c,s)},g.getBufferedFrag=function(c,s){for(var i=this.fragments,l=Object.keys(i),a=l.length;a--;){var n=i[l[a]];if((n==null?void 0:n.body.type)===s&&n.buffered){var r=n.body;if(r.start<=c&&c<=r.end)return r}}return null},g.detectEvictedFragments=function(c,s,i){var l=this;Object.keys(this.fragments).forEach(function(a){var n=l.fragments[a];if(!n)return;if(!n.buffered){n.body.type===i&&l.removeFragment(n.body);return}var r=n.range[c];if(!r)return;r.time.some(function(t){var E=!l.isTimeBuffered(t.startPTS,t.endPTS,s);return E&&l.removeFragment(n.body),E})})},g.detectPartialFragments=function(c){var s=this,i=this.timeRanges,l=c.frag,a=c.part;if(!i||l.sn==="initSegment")return;var n=e(l),r=this.fragments[n];if(!r)return;Object.keys(i).forEach(function(t){var E=l.elementaryStreams[t];if(!E)return;var y=i[t],m=a!==null||E.partial===!0;r.range[t]=s.getBufferedTimes(l,a,m,y)}),r.backtrack=r.loaded=null,Object.keys(r.range).length?r.buffered=!0:this.removeFragment(r.body)},g.fragBuffered=function(c){var s=e(c),i=this.fragments[s];i&&(i.backtrack=i.loaded=null,i.buffered=!0)},g.getBufferedTimes=function(c,s,i,l){for(var a={time:[],partial:i},n=s?s.start:c.start,r=s?s.end:c.end,t=c.minEndPTS||r,E=c.maxStartPTS||n,y=0;y<l.length;y++){var m=l.start(y)-this.bufferPadding,T=l.end(y)+this.bufferPadding;if(E>=m&&t<=T){a.time.push({startPTS:Math.max(n,l.start(y)),endPTS:Math.min(r,l.end(y))});break}else if(n<T&&r>m)a.partial=!0,a.time.push({startPTS:Math.max(n,l.start(y)),endPTS:Math.min(r,l.end(y))});else if(r<=m)break}return a},g.getPartialFragment=function(c){var s=null,i,l,a,n=0,r=this.bufferPadding,t=this.fragments;return Object.keys(t).forEach(function(E){var y=t[E];if(!y)return;N(y)&&(l=y.body.start-r,a=y.body.end+r,c>=l&&c<=a&&(i=Math.min(c-l,a-c),n<=i&&(s=y.body,n=i)))}),s},g.getState=function(c){var s=e(c),i=this.fragments[s];return i?i.buffered?N(i)?R.PARTIAL:R.OK:i.backtrack?R.BACKTRACKED:R.APPENDING:R.NOT_LOADED},g.backtrack=function(c,s){var i=e(c),l=this.fragments[i];if(!l||l.backtrack)return null;var a=l.backtrack=s||l.loaded;return l.loaded=null,a},g.getBacktrackData=function(c){var s=e(c),i=this.fragments[s];if(i){var l,a=i.backtrack;if(a!=null&&(l=a.payload)!==null&&l!==void 0&&l.byteLength)return a;this.removeFragment(c)}return null},g.isTimeBuffered=function(c,s,i){for(var l,a,n=0;n<i.length;n++){if(l=i.start(n)-this.bufferPadding,a=i.end(n)+this.bufferPadding,c>=l&&s<=a)return!0;if(s<=l)return!1}return!1},g.onFragLoaded=function(c,s){var i=s.frag,l=s.part;if(i.sn==="initSegment"||i.bitrateTest||l)return;var a=e(i);this.fragments[a]={body:i,loaded:s,backtrack:null,buffered:!1,range:Object.create(null)}},g.onBufferAppended=function(c,s){var i=this,l=s.frag,a=s.part,n=s.timeRanges;if(l.type===P.PlaylistLevelType.MAIN)if(this.activeFragment=l,a){var r=this.activeParts;r||(this.activeParts=r=[]),r.push(a)}else this.activeParts=null;this.timeRanges=n,Object.keys(n).forEach(function(t){var E=n[t];if(i.detectEvictedFragments(t,E),!a)for(var y=0;y<E.length;y++)l.appendedPTS=Math.max(E.end(y),l.appendedPTS||0)})},g.onFragBuffered=function(c,s){this.detectPartialFragments(s)},g.hasFragment=function(c){var s=e(c);return!!this.fragments[s]},g.removeFragmentsInRange=function(c,s,i){var l=this;Object.keys(this.fragments).forEach(function(a){var n=l.fragments[a];if(!n)return;if(n.buffered){var r=n.body;r.type===i&&r.start<s&&r.end>c&&l.removeFragment(r)}})},g.removeFragment=function(c){var s=e(c);c.stats.loaded=0,c.clearElementaryStreamInfo(),delete this.fragments[s]},g.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},C}();function N(C){var g,v;return C.buffered&&(((g=C.range.video)===null||g===void 0?void 0:g.partial)||((v=C.range.audio)===null||v===void 0?void 0:v.partial))}function e(C){return C.type+"_"+C.level+"_"+C.urlId+"_"+C.sn}},"./src/controller/gap-controller.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"STALL_MINIMUM_DURATION_MS",function(){return N}),I.d(H,"MAX_START_GAP_JUMP",function(){return e}),I.d(H,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return C}),I.d(H,"SKIP_BUFFER_RANGE_START",function(){return g}),I.d(H,"default",function(){return v});var W=I("./src/utils/buffer-helper.ts"),P=I("./src/errors.ts"),R=I("./src/events.ts"),K=I("./src/utils/logger.ts"),N=250,e=2,C=.1,g=.05,v=function(){function c(i,l,a,n){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=i,this.media=l,this.fragmentTracker=a,this.hls=n}var s=c.prototype;return s.destroy=function(){this.hls=this.fragmentTracker=this.media=null},s.poll=function(l){var a=this.config,n=this.media,r=this.stalled,t=n.currentTime,E=n.seeking,y=this.seeking&&!E,m=!this.seeking&&E;if(this.seeking=E,t!==l){if(this.moved=!0,r!==null){if(this.stallReported){var T=self.performance.now()-r;K.logger.warn("playback not stuck anymore @"+t+", after "+Math.round(T)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((m||y)&&(this.stalled=null),n.paused||n.ended||n.playbackRate===0||!W.BufferHelper.getBuffered(n).length)return;var _=W.BufferHelper.bufferInfo(n,t,0),f=_.len>0,h=_.nextStart||0;if(!f&&!h)return;if(E){var o=_.len>e,u=!h||h-t>e&&!this.fragmentTracker.getPartialFragment(t);if(o||u)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var b,p=Math.max(h,_.start||0)-t,d=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,A=d==null||((b=d.details)===null||b===void 0)?void 0:b.live,D=A?d.details.targetduration*2:e;if(p>0&&p<=D){this._trySkipBufferHole(null);return}}var S=self.performance.now();if(r===null){this.stalled=S;return}var L=S-r;!E&&L>=N&&this._reportStall(_.len);var M=W.BufferHelper.bufferInfo(n,t,a.maxBufferHole);this._tryFixBufferStall(M,L)},s._tryFixBufferStall=function(l,a){var n=this.config,r=this.fragmentTracker,t=this.media,E=t.currentTime,y=r.getPartialFragment(E);if(y){var m=this._trySkipBufferHole(y);if(m)return}l.len>n.maxBufferHole&&a>n.highBufferWatchdogPeriod*1e3&&(K.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},s._reportStall=function(l){var a=this.hls,n=this.media,r=this.stallReported;r||(this.stallReported=!0,K.logger.warn("Playback stalling at @"+n.currentTime+" due to low buffer (buffer="+l+")"),a.trigger(R.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:l}))},s._trySkipBufferHole=function(l){for(var a=this.config,n=this.hls,r=this.media,t=r.currentTime,E=0,y=W.BufferHelper.getBuffered(r),m=0;m<y.length;m++){var T=y.start(m);if(t+a.maxBufferHole>=E&&t<T){var _=Math.max(T+g,r.currentTime+C);return K.logger.warn("skipping hole, adjusting currentTime from "+t+" to "+_),this.moved=!0,this.stalled=null,r.currentTime=_,l&&n.trigger(R.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+t+" to "+_,frag:l}),_}E=y.end(m)}return 0},s._tryNudgeBuffer=function(){var l=this.config,a=this.hls,n=this.media,r=n.currentTime,t=(this.nudgeRetry||0)+1;if(this.nudgeRetry=t,t<l.nudgeMaxRetry){var E=r+t*l.nudgeOffset;K.logger.warn("Nudging 'currentTime' from "+r+" to "+E),n.currentTime=E,a.trigger(R.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else K.logger.error("Playhead still not moving while enough data buffered @"+r+" after "+l.nudgeMaxRetry+" nudges"),a.trigger(R.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},c}()},"./src/controller/id3-track-controller.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/events.ts"),P=I("./src/utils/texttrack-utils.ts"),R=I("./src/demux/id3.ts"),K=.25,N=function(){function e(g){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=g,this._registerListeners()}var C=e.prototype;return C.destroy=function(){this._unregisterListeners()},C._registerListeners=function(){var v=this.hls;v.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.on(W.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),v.on(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},C._unregisterListeners=function(){var v=this.hls;v.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.off(W.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),v.off(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},C.onMediaAttached=function(v,c){this.media=c.media},C.onMediaDetaching=function(){if(!this.id3Track)return;Object(P.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},C.getID3Track=function(v){if(!this.media)return;for(var c=0;c<v.length;c++){var s=v[c];if(s.kind==="metadata"&&s.label==="id3")return Object(P.sendAddTrackEvent)(s,this.media),s}return this.media.addTextTrack("metadata","id3")},C.onFragParsingMetadata=function(v,c){if(!this.media)return;var s=c.frag,i=c.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var l=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,a=0;a<i.length;a++){var n=R.getID3Frames(i[a].data);if(n){var r=i[a].pts,t=a<i.length-1?i[a+1].pts:s.end,E=t-r;E<=0&&(t=r+K);for(var y=0;y<n.length;y++){var m=n[y];if(!R.isTimeStampFrame(m)){var T=new l(r,t,"");T.value=m,this.id3Track.addCue(T)}}}}},C.onBufferFlushing=function(v,c){var s=c.startOffset,i=c.endOffset,l=c.type;if(!l||l==="audio"){var a=this.id3Track;a&&Object(P.removeCuesInRange)(a,s,i)}},e}();H.default=N},"./src/controller/latency-controller.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return e});var W=I("./src/errors.ts"),P=I("./src/events.ts"),R=I("./src/utils/logger.ts");function K(C,g){for(var v=0;v<g.length;v++){var c=g[v];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(C,c.key,c)}}function N(C,g,v){return g&&K(C.prototype,g),v&&K(C,v),C}var e=function(){function C(v){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=v,this.config=v.config,this.registerListeners()}var g=C.prototype;return g.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},g.registerListeners=function(){this.hls.on(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(P.Events.ERROR,this.onError,this)},g.unregisterListeners=function(){this.hls.off(P.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(P.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(P.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(P.Events.ERROR,this.onError)},g.onMediaAttached=function(c,s){this.media=s.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},g.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},g.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},g.onLevelUpdated=function(c,s){var i=s.details;this.levelDetails=i,i.advanced&&this.timeupdate(),!i.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},g.onError=function(c,s){if(s.details!==W.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,R.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},g.timeupdate=function(){var c=this.media,s=this.levelDetails;if(!c||!s)return;this.currentTime=c.currentTime;var i=this.computeLatency();if(i===null)return;this._latency=i;var l=this.config,a=l.lowLatencyMode,n=l.maxLiveSyncPlaybackRate;if(!a||n===1)return;var r=this.targetLatency;if(r===null)return;var t=i-r,E=Math.min(this.maxLatency,r+s.targetduration),y=t<E;if(s.live&&y&&t>.05&&this.forwardBufferLength>1){var m=Math.min(2,Math.max(1,n)),T=Math.round(2/(1+Math.exp(-.75*t-this.edgeStalled))*20)/20;c.playbackRate=Math.min(m,Math.max(1,T))}else c.playbackRate!==1&&c.playbackRate!==0&&(c.playbackRate=1)},g.estimateLiveEdge=function(){var c=this.levelDetails;return c===null?null:c.edge+c.age},g.computeLatency=function(){var c=this.estimateLiveEdge();return c===null?null:c-this.currentTime},N(C,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var c=this.config,s=this.levelDetails;return c.liveMaxLatencyDuration!==void 0?c.liveMaxLatencyDuration:s?c.liveMaxLatencyDurationCount*s.targetduration:0}},{key:"targetLatency",get:function(){var c=this.levelDetails;if(c===null)return null;var s=c.holdBack,i=c.partHoldBack,l=c.targetduration,a=this.config,n=a.liveSyncDuration,r=a.liveSyncDurationCount,t=a.lowLatencyMode,E=this.hls.userConfig,y=t&&i||s;(E.liveSyncDuration||E.liveSyncDurationCount||y===0)&&(y=n!==void 0?n:r*l);var m=l,T=1;return y+Math.min(this.stallCount*T,m)}},{key:"liveSyncPosition",get:function(){var c=this.estimateLiveEdge(),s=this.targetLatency,i=this.levelDetails;if(c===null||s===null||i===null)return null;var l=i.edge,a=c-s-this.edgeStalled,n=l-i.totalduration,r=l-(this.config.lowLatencyMode&&i.partTarget||i.targetduration);return Math.min(Math.max(n,a),r)}},{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 s=(this.config.lowLatencyMode&&c.partTarget||c.targetduration)*3;return Math.max(c.age-s,0)}},{key:"forwardBufferLength",get:function(){var c=this.media,s=this.levelDetails;if(!c||!s)return 0;var i=c.buffered.length;return i?c.buffered.end(i-1):s.edge-this.currentTime}}]),C}()},"./src/controller/level-controller.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return a});var W=I("./src/types/level.ts"),P=I("./src/events.ts"),R=I("./src/errors.ts"),K=I("./src/utils/codecs.ts"),N=I("./src/controller/level-helper.ts"),e=I("./src/controller/base-playlist-controller.ts"),C=I("./src/types/loader.ts");function g(){return g=Object.assign||function(n){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var E in t)Object.prototype.hasOwnProperty.call(t,E)&&(n[E]=t[E])}return n},g.apply(this,arguments)}function v(n,r){for(var t=0;t<r.length;t++){var E=r[t];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(n,E.key,E)}}function c(n,r,t){return r&&v(n.prototype,r),t&&v(n,t),n}function s(n,r){n.prototype=Object.create(r.prototype),n.prototype.constructor=n,i(n,r)}function i(n,r){return i=Object.setPrototypeOf||function(E,y){return E.__proto__=y,E},i(n,r)}var l=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),a=function(n){s(r,n);function r(E){var y;return y=n.call(this,E,"[level-controller]")||this,y._levels=[],y._firstLevel=-1,y._startLevel=void 0,y.currentLevelIndex=-1,y.manualLevelIndex=-1,y.onParsedComplete=void 0,y._registerListeners(),y}var t=r.prototype;return t._registerListeners=function(){var y=this.hls;y.on(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),y.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),y.on(P.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),y.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),y.on(P.Events.ERROR,this.onError,this)},t._unregisterListeners=function(){var y=this.hls;y.off(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),y.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),y.off(P.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),y.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),y.off(P.Events.ERROR,this.onError,this)},t.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,n.prototype.destroy.call(this)},t.startLoad=function(){var y=this._levels;y.forEach(function(m){m.loadError=0}),n.prototype.startLoad.call(this)},t.onManifestLoaded=function(y,m){var T=[],_=[],f=[],h,o={},u,b=!1,p=!1,d=!1;if(m.levels.forEach(function(L){var M=L.attrs;b=b||!!(L.width&&L.height),p=p||!!L.videoCodec,d=d||!!L.audioCodec,l&&L.audioCodec&&L.audioCodec.indexOf("mp4a.40.34")!==-1&&(L.audioCodec=void 0);var O=L.bitrate+"-"+L.attrs.RESOLUTION+"-"+L.attrs.CODECS;u=o[O],u?u.url.push(L.url):(u=new W.Level(L),o[O]=u,T.push(u)),M&&(M.AUDIO&&Object(N.addGroupId)(u,"audio",M.AUDIO),M.SUBTITLES&&Object(N.addGroupId)(u,"text",M.SUBTITLES))}),(b||p)&&d&&(T=T.filter(function(L){var M=L.videoCodec,O=L.width,j=L.height;return!!M||!!(O&&j)})),T=T.filter(function(L){var M=L.audioCodec,O=L.videoCodec;return(!M||Object(K.isCodecSupportedInMp4)(M,"audio"))&&(!O||Object(K.isCodecSupportedInMp4)(O,"video"))}),m.audioTracks&&(_=m.audioTracks.filter(function(L){return!L.audioCodec||Object(K.isCodecSupportedInMp4)(L.audioCodec,"audio")}),Object(N.assignTrackIdsByGroup)(_)),m.subtitles&&(f=m.subtitles,Object(N.assignTrackIdsByGroup)(f)),T.length>0){h=T[0].bitrate,T.sort(function(L,M){return L.bitrate-M.bitrate}),this._levels=T;for(var A=0;A<T.length;A++)if(T[A].bitrate===h){this._firstLevel=A,this.log("manifest loaded, "+T.length+" level(s) found, first bitrate: "+h);break}var D=d&&!p,S={levels:T,audioTracks:_,subtitleTracks:f,firstLevel:this._firstLevel,stats:m.stats,audio:d,video:p,altAudio:!D&&_.some(function(L){return!!L.url})};this.hls.trigger(P.Events.MANIFEST_PARSED,S),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(P.Events.ERROR,{type:R.ErrorTypes.MEDIA_ERROR,details:R.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:m.url,reason:"no level with compatible codecs found in manifest"})},t.onError=function(y,m){if(n.prototype.onError.call(this,y,m),m.fatal)return;var T=m.context,_=this._levels[this.currentLevelIndex];if(T&&(T.type===C.PlaylistContextType.AUDIO_TRACK&&_.audioGroupIds&&T.groupId===_.audioGroupIds[_.urlId]||T.type===C.PlaylistContextType.SUBTITLE_TRACK&&_.textGroupIds&&T.groupId===_.textGroupIds[_.urlId])){this.redundantFailover(this.currentLevelIndex);return}var f=!1,h=!0,o;switch(m.details){case R.ErrorDetails.FRAG_LOAD_ERROR:case R.ErrorDetails.FRAG_LOAD_TIMEOUT:case R.ErrorDetails.KEY_LOAD_ERROR:case R.ErrorDetails.KEY_LOAD_TIMEOUT:if(m.frag){var u=this._levels[m.frag.level];u?(u.fragmentError++,u.fragmentError>this.hls.config.fragLoadingMaxRetry&&(o=m.frag.level)):o=m.frag.level}break;case R.ErrorDetails.LEVEL_LOAD_ERROR:case R.ErrorDetails.LEVEL_LOAD_TIMEOUT:T&&(T.deliveryDirectives&&(h=!1),o=T.level),f=!0;break;case R.ErrorDetails.REMUX_ALLOC_ERROR:o=m.level,f=!0;break}o!==void 0&&this.recoverLevel(m,o,f,h)},t.recoverLevel=function(y,m,T,_){var f=y.details,h=this._levels[m];if(h.loadError++,T){var o=this.retryLoadingOrFail(y);if(o)y.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(_){var u=h.url.length;if(u>1&&h.loadError<u)y.levelRetry=!0,this.redundantFailover(m);else if(this.manualLevelIndex===-1){var b=m===0?this._levels.length-1:m-1;this.currentLevelIndex!==b&&this._levels[b].loadError===0&&(this.warn(f+": switch to "+b),y.levelRetry=!0,this.hls.nextAutoLevel=b)}}},t.redundantFailover=function(y){var m=this._levels[y],T=m.url.length;if(T>1){var _=(m.urlId+1)%T;this.warn("Switching to redundant URL-id "+_),this._levels.forEach(function(f){f.urlId=_}),this.level=y}},t.onFragLoaded=function(y,m){var T=m.frag;if(T!==void 0&&T.type===C.PlaylistLevelType.MAIN){var _=this._levels[T.level];_!==void 0&&(_.fragmentError=0,_.loadError=0)}},t.onLevelLoaded=function(y,m){var T,_=m.level,f=m.details,h=this._levels[_];if(!h){var o;this.warn("Invalid level index "+_),(o=m.deliveryDirectives)!==null&&o!==void 0&&o.skip&&(f.deltaUpdateFailed=!0);return}_===this.currentLevelIndex?(h.fragmentError===0&&(h.loadError=0,this.retryCount=0),this.playlistLoaded(_,m,h.details)):(T=m.deliveryDirectives)!==null&&T!==void 0&&T.skip&&(f.deltaUpdateFailed=!0)},t.onAudioTrackSwitched=function(y,m){var T=this.hls.levels[this.currentLevelIndex];if(!T)return;if(T.audioGroupIds){for(var _=-1,f=this.hls.audioTracks[m.id].groupId,h=0;h<T.audioGroupIds.length;h++)if(T.audioGroupIds[h]===f){_=h;break}_!==T.urlId&&(T.urlId=_,this.startLoad())}},t.loadPlaylist=function(y){var m=this.currentLevelIndex,T=this._levels[m];if(this.canLoad&&T&&T.url.length>0){var _=T.urlId,f=T.url[_];if(y)try{f=y.addDirectives(f)}catch(h){this.warn("Could not construct new URL with HLS Delivery Directives: "+h)}this.log("Attempt loading level index "+m+(y?" at sn "+y.msn+" part "+y.part:"")+" with URL-id "+_+" "+f),this.clearTimer(),this.hls.trigger(P.Events.LEVEL_LOADING,{url:f,level:m,id:_,deliveryDirectives:y||null})}},t.removeLevel=function(y,m){var T=function(h,o){return o!==m},_=this._levels.filter(function(f,h){return h!==y?!0:f.url.length>1&&m!==void 0?(f.url=f.url.filter(T),f.audioGroupIds&&(f.audioGroupIds=f.audioGroupIds.filter(T)),f.textGroupIds&&(f.textGroupIds=f.textGroupIds.filter(T)),f.urlId=0,!0):!1}).map(function(f,h){var o=f.details;return o!=null&&o.fragments&&o.fragments.forEach(function(u){u.level=h}),f});this._levels=_,this.hls.trigger(P.Events.LEVELS_UPDATED,{levels:_})},c(r,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(y){var m,T=this._levels;if(T.length===0)return;if(this.currentLevelIndex===y&&(m=T[y])!==null&&m!==void 0&&m.details)return;if(y<0||y>=T.length){var _=y<0;if(this.hls.trigger(P.Events.ERROR,{type:R.ErrorTypes.OTHER_ERROR,details:R.ErrorDetails.LEVEL_SWITCH_ERROR,level:y,fatal:_,reason:"invalid level idx"}),_)return;y=Math.min(y,T.length-1)}this.clearTimer();var f=this.currentLevelIndex,h=T[f],o=T[y];this.log("switching to level "+y+" from "+f),this.currentLevelIndex=y;var u=g({},o,{level:y,maxBitrate:o.maxBitrate,uri:o.uri,urlId:o.urlId});delete u._urlId,this.hls.trigger(P.Events.LEVEL_SWITCHING,u);var b=o.details;if(!b||b.live){var p=this.switchParams(o.uri,h==null?void 0:h.details);this.loadPlaylist(p)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(y){this.manualLevelIndex=y,this._startLevel===void 0&&(this._startLevel=y),y!==-1&&(this.level=y)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(y){this._firstLevel=y}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var y=this.hls.config.startLevel;return y!==void 0?y:this._firstLevel}else return this._startLevel},set:function(y){this._startLevel=y}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(y){this.level=y,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=y)}}]),r}(e.default)},"./src/controller/level-helper.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"addGroupId",function(){return R}),I.d(H,"assignTrackIdsByGroup",function(){return K}),I.d(H,"updatePTS",function(){return N}),I.d(H,"updateFragPTSDTS",function(){return C}),I.d(H,"mergeDetails",function(){return g}),I.d(H,"mapPartIntersection",function(){return v}),I.d(H,"mapFragmentIntersection",function(){return c}),I.d(H,"adjustSliding",function(){return s}),I.d(H,"addSliding",function(){return i}),I.d(H,"computeReloadInterval",function(){return l}),I.d(H,"getFragmentWithSN",function(){return a}),I.d(H,"getPartWith",function(){return n});var W=I("./src/polyfills/number.ts"),P=I("./src/utils/logger.ts");function R(r,t,E){switch(t){case"audio":r.audioGroupIds||(r.audioGroupIds=[]),r.audioGroupIds.push(E);break;case"text":r.textGroupIds||(r.textGroupIds=[]),r.textGroupIds.push(E);break}}function K(r){var t={};r.forEach(function(E){var y=E.groupId||"";E.id=t[y]=t[y]||0,t[y]++})}function N(r,t,E){var y=r[t],m=r[E];e(y,m)}function e(r,t){var E=t.startPTS;if(Object(W.isFiniteNumber)(E)){var y=0,m;t.sn>r.sn?(y=E-r.start,m=r):(y=r.start-E,m=t),m.duration!==y&&(m.duration=y)}else if(t.sn>r.sn){var T=r.cc===t.cc;T&&r.minEndPTS?t.start=r.start+(r.minEndPTS-r.start):t.start=r.start+r.duration}else t.start=Math.max(r.start-t.duration,0)}function C(r,t,E,y,m,T){var _=y-E;_<=0&&(P.logger.warn("Fragment should have a positive duration",t),y=E+t.duration,T=m+t.duration);var f=E,h=y,o=t.startPTS,u=t.endPTS;if(Object(W.isFiniteNumber)(o)){var b=Math.abs(o-E);Object(W.isFiniteNumber)(t.deltaPTS)?t.deltaPTS=Math.max(b,t.deltaPTS):t.deltaPTS=b,f=Math.max(E,o),E=Math.min(E,o),m=Math.min(m,t.startDTS),h=Math.min(y,u),y=Math.max(y,u),T=Math.max(T,t.endDTS)}t.duration=y-E;var p=E-t.start;t.appendedPTS=y,t.start=t.startPTS=E,t.maxStartPTS=f,t.startDTS=m,t.endPTS=y,t.minEndPTS=h,t.endDTS=T;var d=t.sn;if(!r||d<r.startSN||d>r.endSN)return 0;var A,D=d-r.startSN,S=r.fragments;for(S[D]=t,A=D;A>0;A--)e(S[A],S[A-1]);for(A=D;A<S.length-1;A++)e(S[A],S[A+1]);return r.fragmentHint&&e(S[S.length-1],r.fragmentHint),r.PTSKnown=r.alignedSliding=!0,p}function g(r,t){for(var E=null,y=r.fragments,m=y.length-1;m>=0;m--){var T=y[m].initSegment;if(T){E=T;break}}r.fragmentHint&&delete r.fragmentHint.endPTS;var _=0,f;if(c(r,t,function(A,D){A.relurl&&(_=A.cc-D.cc),Object(W.isFiniteNumber)(A.startPTS)&&Object(W.isFiniteNumber)(A.endPTS)&&(D.start=D.startPTS=A.startPTS,D.startDTS=A.startDTS,D.appendedPTS=A.appendedPTS,D.maxStartPTS=A.maxStartPTS,D.endPTS=A.endPTS,D.endDTS=A.endDTS,D.minEndPTS=A.minEndPTS,D.duration=A.endPTS-A.startPTS,D.duration&&(f=D),t.PTSKnown=t.alignedSliding=!0),D.elementaryStreams=A.elementaryStreams,D.loader=A.loader,D.stats=A.stats,D.urlId=A.urlId,A.initSegment&&(D.initSegment=A.initSegment,E=A.initSegment)}),E){var h=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments;h.forEach(function(A){var D;(!A.initSegment||A.initSegment.relurl===((D=E)===null||D===void 0?void 0:D.relurl))&&(A.initSegment=E)})}if(t.skippedSegments&&(t.deltaUpdateFailed=t.fragments.some(function(A){return!A}),t.deltaUpdateFailed)){P.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var o=t.skippedSegments;o--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}var u=t.fragments;if(_){P.logger.warn("discontinuity sliding from playlist, take drift into account");for(var b=0;b<u.length;b++)u[b].cc+=_}t.skippedSegments&&(t.startCC=t.fragments[0].cc),v(r.partList,t.partList,function(A,D){D.elementaryStreams=A.elementaryStreams,D.stats=A.stats}),f?C(t,f,f.startPTS,f.endPTS,f.startDTS,f.endDTS):s(r,t),u.length&&(t.totalduration=t.edge-u[0].start),t.driftStartTime=r.driftStartTime,t.driftStart=r.driftStart;var p=t.advancedDateTime;if(t.advanced&&p){var d=t.edge;t.driftStart||(t.driftStartTime=p,t.driftStart=d),t.driftEndTime=p,t.driftEnd=d}else t.driftEndTime=r.driftEndTime,t.driftEnd=r.driftEnd,t.advancedDateTime=r.advancedDateTime}function v(r,t,E){if(r&&t)for(var y=0,m=0,T=r.length;m<=T;m++){var _=r[m],f=t[m+y];_&&f&&_.index===f.index&&_.fragment.sn===f.fragment.sn?E(_,f):y--}}function c(r,t,E){for(var y=t.skippedSegments,m=Math.max(r.startSN,t.startSN)-t.startSN,T=(r.fragmentHint?1:0)+(y?t.endSN:Math.min(r.endSN,t.endSN))-t.startSN,_=t.startSN-r.startSN,f=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,h=r.fragmentHint?r.fragments.concat(r.fragmentHint):r.fragments,o=m;o<=T;o++){var u=h[_+o],b=f[o];y&&!b&&o<y&&(b=t.fragments[o]=u),u&&b&&E(u,b)}}function s(r,t){var E=t.startSN+t.skippedSegments-r.startSN,y=r.fragments;if(E<0||E>=y.length)return;i(t,y[E].start)}function i(r,t){if(t){for(var E=r.fragments,y=r.skippedSegments;y<E.length;y++)E[y].start+=t;r.fragmentHint&&(r.fragmentHint.start+=t)}}function l(r,t){var E=1e3*r.levelTargetDuration,y=E/2,m=r.age,T=m>0&&m<E*3,_=t.loading.end-t.loading.start,f,h=r.availabilityDelay;if(r.updated===!1)if(T){var o=333*r.misses;f=Math.max(Math.min(y,_*2),o),r.availabilityDelay=(r.availabilityDelay||0)+f}else f=y;else T?(h=Math.min(h||E/2,m),r.availabilityDelay=h,f=h+E-m):f=E-_;return Math.round(f)}function a(r,t,E){if(!r||!r.details)return null;var y=r.details,m=y.fragments[t-y.startSN];return m||(m=y.fragmentHint,m&&m.sn===t?m:t<y.startSN&&E&&E.sn===t?E:null)}function n(r,t,E){if(!r||!r.details)return null;var y=r.details.partList;if(y)for(var m=y.length;m--;){var T=y[m];if(T.index===E&&T.fragment.sn===t)return T}return null}},"./src/controller/stream-controller.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return y});var W=I("./src/polyfills/number.ts"),P=I("./src/controller/base-stream-controller.ts"),R=I("./src/is-supported.ts"),K=I("./src/events.ts"),N=I("./src/utils/buffer-helper.ts"),e=I("./src/controller/fragment-tracker.ts"),C=I("./src/types/loader.ts"),g=I("./src/loader/fragment.ts"),v=I("./src/demux/transmuxer-interface.ts"),c=I("./src/types/transmuxer.ts"),s=I("./src/controller/gap-controller.ts"),i=I("./src/errors.ts"),l=I("./src/utils/logger.ts");function a(m,T){for(var _=0;_<T.length;_++){var f=T[_];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(m,f.key,f)}}function n(m,T,_){return T&&a(m.prototype,T),_&&a(m,_),m}function r(m,T){m.prototype=Object.create(T.prototype),m.prototype.constructor=m,t(m,T)}function t(m,T){return t=Object.setPrototypeOf||function(f,h){return f.__proto__=h,f},t(m,T)}var E=100,y=function(m){r(T,m);function T(f,h){var o;return o=m.call(this,f,h,"[stream-controller]")||this,o.audioCodecSwap=!1,o.gapController=null,o.level=-1,o._forceStartLoad=!1,o.altAudio=!1,o.audioOnly=!1,o.fragPlaying=null,o.onvplaying=null,o.onvseeked=null,o.fragLastKbps=0,o.stalled=!1,o.couldBacktrack=!1,o.audioCodecSwitch=!1,o.videoBuffer=null,o._registerListeners(),o}var _=T.prototype;return _._registerListeners=function(){var h=this.hls;h.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),h.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.on(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),h.on(K.Events.ERROR,this.onError,this),h.on(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.on(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),h.on(K.Events.BUFFER_CREATED,this.onBufferCreated,this),h.on(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.on(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),h.on(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_._unregisterListeners=function(){var h=this.hls;h.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.off(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),h.off(K.Events.ERROR,this.onError,this),h.off(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.off(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),h.off(K.Events.BUFFER_CREATED,this.onBufferCreated,this),h.off(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.off(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),h.off(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},_.startLoad=function(h){if(this.levels){var o=this.lastCurrentTime,u=this.hls;if(this.stopLoad(),this.setInterval(E),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var b=u.startLevel;b===-1&&(u.config.testBandwidth?(b=0,this.bitrateTest=!0):b=u.nextAutoLevel),this.level=u.nextLoadLevel=b,this.loadedmetadata=!1}o>0&&h===-1&&(this.log("Override startPosition with lastCurrentTime @"+o.toFixed(3)),h=o),this.state=P.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=h,this.tick()}else this._forceStartLoad=!0,this.state=P.State.STOPPED},_.stopLoad=function(){this._forceStartLoad=!1,m.prototype.stopLoad.call(this)},_.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_LEVEL:{var h,o=this.levels,u=this.level,b=o==null||((h=o[u])===null||h===void 0)?void 0:h.details;if(b&&(!b.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(b))break;this.state=P.State.IDLE;break}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var p,d=self.performance.now(),A=this.retryDate;(!A||d>=A||(p=this.media)!==null&&p!==void 0&&p.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=P.State.IDLE)}break;default:break}this.onTickEnd()},_.onTickEnd=function(){m.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},_.doTickIdle=function(){var h,o,u=this.hls,b=this.levelLastLoaded,p=this.levels,d=this.media,A=u.config,D=u.nextLoadLevel;if(b===null||!d&&(this.startFragRequested||!A.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!p||!p[D])return;var S=p[D];this.level=u.nextLoadLevel=D;var L=S.details;if(!L||this.state===P.State.WAITING_LEVEL||L.live&&this.levelLastLoaded!==D){this.state=P.State.WAITING_LEVEL;return}var M=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:d,C.PlaylistLevelType.MAIN);if(M===null)return;var O=M.len,j=this.getMaxBufferLength(S.maxBitrate);if(O>=j)return;if(this._streamEnded(M,L)){var G={};this.altAudio&&(G.type="video"),this.hls.trigger(K.Events.BUFFER_EOS,G),this.state=P.State.ENDED;return}var X=M.end,te=this.getNextFragment(X,L);if(this.couldBacktrack&&!this.fragPrevious&&te&&te.sn!=="initSegment"){var fe=te.sn-L.startSN;fe>1&&(te=L.fragments[fe-1],this.fragmentTracker.removeFragment(te))}if(te&&this.fragmentTracker.getState(te)===e.FragmentState.OK&&this.nextLoadPosition>X){var ve=this.audioOnly&&!this.altAudio?g.ElementaryStreamTypes.AUDIO:g.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(d,ve,C.PlaylistLevelType.MAIN),te=this.getNextFragment(this.nextLoadPosition,L)}if(!te)return;te.initSegment&&!te.initSegment.data&&!this.bitrateTest&&(te=te.initSegment),((h=te.decryptdata)===null||h===void 0?void 0:h.keyFormat)==="identity"&&!((o=te.decryptdata)!==null&&o!==void 0&&o.key)?this.loadKey(te,L):this.loadFragment(te,L,X)},_.loadFragment=function(h,o,u){var b,p=this.fragmentTracker.getState(h);if(this.fragCurrent=h,p===e.FragmentState.BACKTRACKED){var d=this.fragmentTracker.getBacktrackData(h);if(d){this._handleFragmentLoadProgress(d),this._handleFragmentLoadComplete(d);return}else p=e.FragmentState.NOT_LOADED}p===e.FragmentState.NOT_LOADED||p===e.FragmentState.PARTIAL?h.sn==="initSegment"?this._loadInitSegment(h):this.bitrateTest?(h.bitrateTest=!0,this.log("Fragment "+h.sn+" of level "+h.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(h)):(this.startFragRequested=!0,m.prototype.loadFragment.call(this,h,o,u)):p===e.FragmentState.APPENDING?this.reduceMaxBufferLength(h.duration)&&this.fragmentTracker.removeFragment(h):((b=this.media)===null||b===void 0?void 0:b.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},_.getAppendedFrag=function(h){var o=this.fragmentTracker.getAppendedFrag(h,C.PlaylistLevelType.MAIN);return o&&"fragment"in o?o.fragment:o},_.getBufferedFrag=function(h){return this.fragmentTracker.getBufferedFrag(h,C.PlaylistLevelType.MAIN)},_.followingBufferedFrag=function(h){return h?this.getBufferedFrag(h.end+.5):null},_.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},_.nextLevelSwitch=function(){var h=this.levels,o=this.media;if(o!=null&&o.readyState){var u,b=this.getAppendedFrag(o.currentTime);if(b&&b.start>1&&this.flushMainBuffer(0,b.start-1),!o.paused&&h){var p=this.hls.nextLoadLevel,d=h[p],A=this.fragLastKbps;A&&this.fragCurrent?u=this.fragCurrent.duration*d.maxBitrate/(1e3*A)+1:u=0}else u=0;var D=this.getBufferedFrag(o.currentTime+u);if(D){var S=this.followingBufferedFrag(D);if(S){this.abortCurrentFrag();var L=S.maxStartPTS?S.maxStartPTS:S.start,M=S.duration,O=Math.max(D.end,L+Math.min(Math.max(M-this.config.maxFragLookUpTolerance,M*.5),M*.75));this.flushMainBuffer(O,Number.POSITIVE_INFINITY)}}}},_.abortCurrentFrag=function(){var h=this.fragCurrent;this.fragCurrent=null,h!=null&&h.loader&&h.loader.abort(),this.state===P.State.KEY_LOADING&&(this.state=P.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},_.flushMainBuffer=function(h,o){m.prototype.flushMainBuffer.call(this,h,o,this.altAudio?"video":null)},_.onMediaAttached=function(h,o){m.prototype.onMediaAttached.call(this,h,o);var u=o.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),u.addEventListener("playing",this.onvplaying),u.addEventListener("seeked",this.onvseeked),this.gapController=new s.default(this.config,u,this.fragmentTracker,this.hls)},_.onMediaDetaching=function(){var h=this.media;h&&(h.removeEventListener("playing",this.onvplaying),h.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),m.prototype.onMediaDetaching.call(this)},_.onMediaPlaying=function(){this.tick()},_.onMediaSeeked=function(){var h=this.media,o=h?h.currentTime:null;Object(W.isFiniteNumber)(o)&&this.log("Media seeked to "+o.toFixed(3)),this.tick()},_.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(K.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},_.onManifestParsed=function(h,o){var u=!1,b=!1,p;o.levels.forEach(function(d){p=d.audioCodec,p&&(p.indexOf("mp4a.40.2")!==-1&&(u=!0),p.indexOf("mp4a.40.5")!==-1&&(b=!0))}),this.audioCodecSwitch=u&&b&&!Object(R.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=o.levels,this.startFragRequested=!1},_.onLevelLoading=function(h,o){var u=this.levels;if(!u||this.state!==P.State.IDLE)return;var b=u[o.level];(!b.details||b.details.live&&this.levelLastLoaded!==o.level||this.waitForCdnTuneIn(b.details))&&(this.state=P.State.WAITING_LEVEL)},_.onLevelLoaded=function(h,o){var u,b=this.levels,p=o.level,d=o.details,A=d.totalduration;if(!b){this.warn("Levels were reset while loading level "+p);return}this.log("Level "+p+" loaded ["+d.startSN+","+d.endSN+"], cc ["+d.startCC+", "+d.endCC+"] duration:"+A);var D=this.fragCurrent;D&&(this.state===P.State.FRAG_LOADING||this.state===P.State.FRAG_LOADING_WAITING_RETRY)&&(D.level!==o.level&&D.loader&&(this.state=P.State.IDLE,D.loader.abort()));var S=b[p],L=0;if(d.live||(u=S.details)!==null&&u!==void 0&&u.live){if(d.fragments[0]||(d.deltaUpdateFailed=!0),d.deltaUpdateFailed)return;L=this.alignPlaylists(d,S.details)}if(S.details=d,this.levelLastLoaded=p,this.hls.trigger(K.Events.LEVEL_UPDATED,{details:d,level:p}),this.state===P.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(d))return;this.state=P.State.IDLE}this.startFragRequested?d.live&&this.synchronizeToLiveEdge(d):this.setStartPosition(d,L),this.tick()},_._handleFragmentLoadProgress=function(h){var o,u=h.frag,b=h.part,p=h.payload,d=this.levels;if(!d){this.warn("Levels were reset while fragment load was in progress. Fragment "+u.sn+" of level "+u.level+" will not be buffered");return}var A=d[u.level],D=A.details;if(!D){this.warn("Dropping fragment "+u.sn+" of level "+u.level+" after level details were reset");return}var S=A.videoCodec,L=D.PTSKnown||!D.live,M=(o=u.initSegment)===null||o===void 0?void 0:o.data,O=this._getAudioCodec(A),j=this.transmuxer=this.transmuxer||new v.default(this.hls,C.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),G=b?b.index:-1,X=G!==-1,te=new c.ChunkMetadata(u.level,u.sn,u.stats.chunkCount,p.byteLength,G,X),fe=this.initPTS[u.cc];j.push(p,M,O,S,u,b,D.totalduration,L,te,fe)},_.onAudioTrackSwitching=function(h,o){var u=this.altAudio,b=!!o.url,p=o.id;if(!b){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var d=this.fragCurrent;d!=null&&d.loader&&(this.log("Switching to main audio track, cancel main fragment load"),d.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var A=this.hls;u&&A.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),A.trigger(K.Events.AUDIO_TRACK_SWITCHED,{id:p})}},_.onAudioTrackSwitched=function(h,o){var u=o.id,b=!!this.hls.audioTracks[u].url;if(b){var p=this.videoBuffer;p&&this.mediaBuffer!==p&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=p)}this.altAudio=b,this.tick()},_.onBufferCreated=function(h,o){var u=o.tracks,b,p,d=!1;for(var A in u){var D=u[A];if(D.id==="main"){if(p=A,b=D,A==="video"){var S=u[A];S&&(this.videoBuffer=S.buffer)}}else d=!0}d&&b?(this.log("Alternate track found, use "+p+".buffered to schedule main fragment loading"),this.mediaBuffer=b.buffer):this.mediaBuffer=this.media},_.onFragBuffered=function(h,o){var u=o.frag,b=o.part;if(u&&u.type!==C.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(u)){this.warn("Fragment "+u.sn+(b?" p: "+b.index:"")+" of level "+u.level+" finished buffering, but was aborted. state: "+this.state),this.state===P.State.PARSED&&(this.state=P.State.IDLE);return}var p=b?b.stats:u.stats;this.fragLastKbps=Math.round(8*p.total/(p.buffering.end-p.loading.first)),u.sn!=="initSegment"&&(this.fragPrevious=u),this.fragBufferedComplete(u,b)},_.onError=function(h,o){switch(o.details){case i.ErrorDetails.FRAG_LOAD_ERROR:case i.ErrorDetails.FRAG_LOAD_TIMEOUT:case i.ErrorDetails.KEY_LOAD_ERROR:case i.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(C.PlaylistLevelType.MAIN,o);break;case i.ErrorDetails.LEVEL_LOAD_ERROR:case i.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==P.State.ERROR&&(o.fatal?(this.warn(""+o.details),this.state=P.State.ERROR):!o.levelRetry&&this.state===P.State.WAITING_LEVEL&&(this.state=P.State.IDLE));break;case i.ErrorDetails.BUFFER_FULL_ERROR:if(o.parent==="main"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var u=!0,b=this.getFwdBufferInfo(this.media,C.PlaylistLevelType.MAIN);b&&b.len>.5&&(u=!this.reduceMaxBufferLength(b.len)),u&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},_.checkBuffer=function(){var h=this.media,o=this.gapController;if(!h||!o||!h.readyState)return;var u=N.BufferHelper.getBuffered(h);!this.loadedmetadata&&u.length?(this.loadedmetadata=!0,this.seekToStartPos()):o.poll(this.lastCurrentTime),this.lastCurrentTime=h.currentTime},_.onFragLoadEmergencyAborted=function(){this.state=P.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},_.onBufferFlushed=function(h,o){var u=o.type;if(u!==g.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var b=(u===g.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(b,u,C.PlaylistLevelType.MAIN)}},_.onLevelsUpdated=function(h,o){this.levels=o.levels},_.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},_.seekToStartPos=function(){var h=this.media,o=h.currentTime,u=this.startPosition;if(u>=0&&o<u){if(h.seeking){l.logger.log("could not seek to "+u+", already seeking at "+o);return}var b=N.BufferHelper.getBuffered(h),p=b.length?b.start(0):0,d=p-u;d>0&&(d<this.config.maxBufferHole||d<this.config.maxFragLookUpTolerance)&&(l.logger.log("adjusting start position by "+d+" to match buffer start"),u+=d,this.startPosition=u),this.log("seek to target start position "+u+" from current time "+o),h.currentTime=u}},_._getAudioCodec=function(h){var o=this.config.defaultAudioCodec||h.audioCodec;return this.audioCodecSwap&&o&&(this.log("Swapping audio codec"),o.indexOf("mp4a.40.5")!==-1?o="mp4a.40.2":o="mp4a.40.5"),o},_._loadBitrateTestFrag=function(h){var o=this;this._doFragLoad(h).then(function(u){var b=o.hls;if(!u||b.nextLoadLevel||o.fragContextChanged(h))return;o.fragLoadError=0,o.state=P.State.IDLE,o.startFragRequested=!1,o.bitrateTest=!1;var p=h.stats;p.parsing.start=p.parsing.end=p.buffering.start=p.buffering.end=self.performance.now(),b.trigger(K.Events.FRAG_LOADED,u)})},_._handleTransmuxComplete=function(h){var o,u="main",b=this.hls,p=h.remuxResult,d=h.chunkMeta,A=this.getCurrentContext(d);if(!A){this.warn("The loading context changed while buffering fragment "+d.sn+" of level "+d.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(d.level);return}var D=A.frag,S=A.part,L=A.level,M=p.video,O=p.text,j=p.id3,G=p.initSegment,X=this.altAudio?void 0:p.audio;if(this.fragContextChanged(D))return;if(this.state=P.State.PARSING,G){G.tracks&&(this._bufferInitSegment(L,G.tracks,D,d),b.trigger(K.Events.FRAG_PARSING_INIT_SEGMENT,{frag:D,id:u,tracks:G.tracks}));var te=G.initPTS,fe=G.timescale;Object(W.isFiniteNumber)(te)&&(this.initPTS[D.cc]=te,b.trigger(K.Events.INIT_PTS_FOUND,{frag:D,id:u,initPTS:te,timescale:fe}))}if(M&&p.independent!==!1){if(L.details){var ve=M.startPTS,he=M.endPTS,xe=M.startDTS,Se=M.endDTS;if(S)S.elementaryStreams[M.type]={startPTS:ve,endPTS:he,startDTS:xe,endDTS:Se};else if(M.firstKeyFrame&&M.independent&&(this.couldBacktrack=!0),M.dropped&&M.independent){var de=this.getLoadPosition()+this.config.maxBufferHole;if(de<ve){this.backtrack(D);return}D.setElementaryStreamInfo(M.type,D.start,he,D.start,Se,!0)}D.setElementaryStreamInfo(M.type,ve,he,xe,Se),this.bufferFragmentData(M,D,S,d)}}else if(p.independent===!1){this.backtrack(D);return}if(X){var ie=X.startPTS,Le=X.endPTS,Ve=X.startDTS,Be=X.endDTS;S&&(S.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:ie,endPTS:Le,startDTS:Ve,endDTS:Be}),D.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,ie,Le,Ve,Be),this.bufferFragmentData(X,D,S,d)}if(j!=null&&(o=j.samples)!==null&&o!==void 0&&o.length){var je={frag:D,id:u,samples:j.samples};b.trigger(K.Events.FRAG_PARSING_METADATA,je)}if(O){var Ee={frag:D,id:u,samples:O.samples};b.trigger(K.Events.FRAG_PARSING_USERDATA,Ee)}},_._bufferInitSegment=function(h,o,u,b){var p=this;if(this.state!==P.State.PARSING)return;this.audioOnly=!!o.audio&&!o.video,this.altAudio&&!this.audioOnly&&delete o.audio;var d=o.audio,A=o.video,D=o.audiovideo;if(d){var S=h.audioCodec,L=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(S&&(S.indexOf("mp4a.40.5")!==-1?S="mp4a.40.2":S="mp4a.40.5"),d.metadata.channelCount!==1&&L.indexOf("firefox")===-1&&(S="mp4a.40.5")),L.indexOf("android")!==-1&&d.container!=="audio/mpeg"&&(S="mp4a.40.2",this.log("Android: force audio codec to "+S)),h.audioCodec&&h.audioCodec!==S&&this.log('Swapping manifest audio codec "'+h.audioCodec+'" for "'+S+'"'),d.levelCodec=S,d.id="main",this.log("Init audio buffer, container:"+d.container+", codecs[selected/level/parsed]=["+(S||"")+"/"+(h.audioCodec||"")+"/"+d.codec+"]")}A&&(A.levelCodec=h.videoCodec,A.id="main",this.log("Init video buffer, container:"+A.container+", codecs[level/parsed]=["+(h.videoCodec||"")+"/"+A.codec+"]")),D&&this.log("Init audiovideo buffer, container:"+D.container+", codecs[level/parsed]=["+(h.attrs.CODECS||"")+"/"+D.codec+"]"),this.hls.trigger(K.Events.BUFFER_CODECS,o),Object.keys(o).forEach(function(M){var O=o[M],j=O.initSegment;j!=null&&j.byteLength&&p.hls.trigger(K.Events.BUFFER_APPENDING,{type:M,data:j,frag:u,part:null,chunkMeta:b,parent:u.type})}),this.tick()},_.backtrack=function(h){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(h);var o=this.fragmentTracker.backtrack(h);this.fragPrevious=null,this.nextLoadPosition=h.start,o?this.resetFragmentLoading(h):this.state=P.State.BACKTRACKING},_.checkFragmentChanged=function(){var h=this.media,o=null;if(h&&h.readyState>1&&h.seeking===!1){var u=h.currentTime;if(N.BufferHelper.isBuffered(h,u)?o=this.getAppendedFrag(u):N.BufferHelper.isBuffered(h,u+.1)&&(o=this.getAppendedFrag(u+.1)),o){var b=this.fragPlaying,p=o.level;(!b||o.sn!==b.sn||b.level!==p||o.urlId!==b.urlId)&&(this.hls.trigger(K.Events.FRAG_CHANGED,{frag:o}),(!b||b.level!==p)&&this.hls.trigger(K.Events.LEVEL_SWITCHED,{level:p}),this.fragPlaying=o)}}},n(T,[{key:"nextLevel",get:function(){var h=this.nextBufferedFrag;return h?h.level:-1}},{key:"currentLevel",get:function(){var h=this.media;if(h){var o=this.getAppendedFrag(h.currentTime);if(o)return o.level}return-1}},{key:"nextBufferedFrag",get:function(){var h=this.media;if(h){var o=this.getAppendedFrag(h.currentTime);return this.followingBufferedFrag(o)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),T}(P.default)},"./src/controller/subtitle-stream-controller.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"SubtitleStreamController",function(){return r});var W=I("./src/events.ts"),P=I("./src/utils/logger.ts"),R=I("./src/utils/buffer-helper.ts"),K=I("./src/controller/fragment-finders.ts"),N=I("./src/utils/discontinuities.ts"),e=I("./src/controller/level-helper.ts"),C=I("./src/controller/fragment-tracker.ts"),g=I("./src/controller/base-stream-controller.ts"),v=I("./src/types/loader.ts"),c=I("./src/types/level.ts");function s(t,E){for(var y=0;y<E.length;y++){var m=E[y];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(t,m.key,m)}}function i(t,E,y){return E&&s(t.prototype,E),y&&s(t,y),t}function l(t,E){t.prototype=Object.create(E.prototype),t.prototype.constructor=t,a(t,E)}function a(t,E){return a=Object.setPrototypeOf||function(m,T){return m.__proto__=T,m},a(t,E)}var n=500,r=function(t){l(E,t);function E(m,T){var _;return _=t.call(this,m,T,"[subtitle-stream-controller]")||this,_.levels=[],_.currentTrackId=-1,_.tracksBuffered=[],_.mainDetails=null,_._registerListeners(),_}var y=E.prototype;return y.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},y._registerListeners=function(){var T=this.hls;T.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.on(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.on(W.Events.ERROR,this.onError,this),T.on(W.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),T.on(W.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),T.on(W.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),T.on(W.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),T.on(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},y._unregisterListeners=function(){var T=this.hls;T.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.off(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.off(W.Events.ERROR,this.onError,this),T.off(W.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),T.off(W.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),T.off(W.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),T.off(W.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),T.off(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},y.startLoad=function(){this.stopLoad(),this.state=g.State.IDLE,this.setInterval(n),this.tick()},y.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},y.onLevelLoaded=function(T,_){this.mainDetails=_.details},y.onSubtitleFragProcessed=function(T,_){var f=_.frag,h=_.success;if(this.fragPrevious=f,this.state=g.State.IDLE,!h)return;var o=this.tracksBuffered[this.currentTrackId];if(!o)return;for(var u,b=f.start,p=0;p<o.length;p++)if(b>=o[p].start&&b<=o[p].end){u=o[p];break}var d=f.start+f.duration;u?u.end=d:(u={start:b,end:d},o.push(u)),this.fragmentTracker.fragBuffered(f)},y.onBufferFlushing=function(T,_){var f=_.startOffset,h=_.endOffset;if(f===0&&h!==Number.POSITIVE_INFINITY){var o=this.currentTrackId,u=this.levels;if(!u.length||!u[o]||!u[o].details)return;var b=u[o].details,p=b.targetduration,d=h-p;if(d<=0)return;_.endOffsetSubtitles=Math.max(0,d),this.tracksBuffered.forEach(function(A){for(var D=0;D<A.length;){if(A[D].end<=d){A.shift();continue}else if(A[D].start<d)A[D].start=d;else break;D++}}),this.fragmentTracker.removeFragmentsInRange(f,d,v.PlaylistLevelType.SUBTITLE)}},y.onError=function(T,_){var f,h=_.frag;if(!h||h.type!==v.PlaylistLevelType.SUBTITLE)return;(f=this.fragCurrent)!==null&&f!==void 0&&f.loader&&this.fragCurrent.loader.abort(),this.state=g.State.IDLE},y.onSubtitleTracksUpdated=function(T,_){var f=this,h=_.subtitleTracks;this.tracksBuffered=[],this.levels=h.map(function(o){return new c.Level(o)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(o){f.tracksBuffered[o.id]=[]}),this.mediaBuffer=null},y.onSubtitleTrackSwitch=function(T,_){if(this.currentTrackId=_.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var f=this.levels[this.currentTrackId];f!=null&&f.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,f&&this.setInterval(n)},y.onSubtitleTrackLoaded=function(T,_){var f,h=_.details,o=_.id,u=this.currentTrackId,b=this.levels;if(!b.length)return;var p=b[u];if(o>=b.length||o!==u||!p)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,h.live||(f=p.details)!==null&&f!==void 0&&f.live){var d=this.mainDetails;if(h.deltaUpdateFailed||!d)return;var A=d.fragments[0];if(!p.details)h.hasProgramDateTime&&d.hasProgramDateTime?Object(N.alignMediaPlaylistByPDT)(h,d):A&&Object(e.addSliding)(h,A.start);else{var D=this.alignPlaylists(h,p.details);D===0&&A&&Object(e.addSliding)(h,A.start)}}if(p.details=h,this.levelLastLoaded=o,this.tick(),h.live&&!this.fragCurrent&&this.media&&this.state===g.State.IDLE){var S=Object(K.findFragmentByPTS)(null,h.fragments,this.media.currentTime,0);S||(this.warn("Subtitle playlist not aligned with playback"),p.details=void 0)}},y._handleFragmentLoadComplete=function(T){var _=T.frag,f=T.payload,h=_.decryptdata,o=this.hls;if(this.fragContextChanged(_))return;if(f&&f.byteLength>0&&h&&h.key&&h.iv&&h.method==="AES-128"){var u=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(f),h.key.buffer,h.iv.buffer).then(function(b){var p=performance.now();o.trigger(W.Events.FRAG_DECRYPTED,{frag:_,payload:b,stats:{tstart:u,tdecrypt:p}})})}},y.doTick=function(){if(!this.media){this.state=g.State.IDLE;return}if(this.state===g.State.IDLE){var T,_=this.currentTrackId,f=this.levels;if(!f.length||!f[_]||!f[_].details)return;var h=f[_].details,o=h.targetduration,u=this.config,b=this.media,p=R.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,b.currentTime-o,u.maxBufferHole),d=p.end,A=p.len,D=this.getMaxBufferLength()+o;if(A>D)return;console.assert(h,"Subtitle track details are defined on idle subtitle stream controller tick");var S=h.fragments,L=S.length,M=h.edge,O,j=this.fragPrevious;if(d<M){var G=u.maxFragLookUpTolerance;j&&h.hasProgramDateTime&&(O=Object(K.findFragmentByPDT)(S,j.endProgramDateTime,G)),O||(O=Object(K.findFragmentByPTS)(j,S,d,G),!O&&j&&j.start<S[0].start&&(O=S[0]))}else O=S[L-1];(T=O)!==null&&T!==void 0&&T.encrypted?(P.logger.log("Loading key for "+O.sn),this.state=g.State.KEY_LOADING,this.hls.trigger(W.Events.KEY_LOADING,{frag:O})):O&&this.fragmentTracker.getState(O)===C.FragmentState.NOT_LOADED&&this.loadFragment(O,h,d)}},y.loadFragment=function(T,_,f){this.fragCurrent=T,t.prototype.loadFragment.call(this,T,_,f)},i(E,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),E}(g.default)},"./src/controller/subtitle-track-controller.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/events.ts"),P=I("./src/utils/texttrack-utils.ts"),R=I("./src/controller/base-playlist-controller.ts"),K=I("./src/types/loader.ts");function N(s,i){for(var l=0;l<i.length;l++){var a=i[l];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(s,a.key,a)}}function e(s,i,l){return i&&N(s.prototype,i),l&&N(s,l),s}function C(s,i){s.prototype=Object.create(i.prototype),s.prototype.constructor=s,g(s,i)}function g(s,i){return g=Object.setPrototypeOf||function(a,n){return a.__proto__=n,a},g(s,i)}var v=function(s){C(i,s);function i(a){var n;return n=s.call(this,a,"[subtitle-track-controller]")||this,n.media=null,n.tracks=[],n.groupId=null,n.tracksInGroup=[],n.trackId=-1,n.selectDefaultTrack=!0,n.queuedDefaultTrack=-1,n.trackChangeListener=function(){return n.onTextTracksChanged()},n.asyncPollTrackChange=function(){return n.pollTrackChange(0)},n.useTextTrackPolling=!1,n.subtitlePollingInterval=-1,n.subtitleDisplay=!0,n.registerListeners(),n}var l=i.prototype;return l.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,s.prototype.destroy.call(this)},l.registerListeners=function(){var n=this.hls;n.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(W.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.on(W.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.on(W.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){var n=this.hls;n.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(W.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(W.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.off(W.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.off(W.Events.ERROR,this.onError,this)},l.onMediaAttached=function(n,r){if(this.media=r.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},l.pollTrackChange=function(n){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,n)},l.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 n=c(this.media.textTracks);n.forEach(function(r){Object(P.clearCurrentCues)(r)}),this.subtitleTrack=-1,this.media=null},l.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},l.onManifestParsed=function(n,r){this.tracks=r.subtitleTracks},l.onSubtitleTrackLoaded=function(n,r){var t=r.id,E=r.details,y=this.trackId,m=this.tracksInGroup[y];if(!m){this.warn("Invalid subtitle track id "+t);return}var T=m.details;m.details=r.details,this.log("subtitle track "+t+" loaded ["+E.startSN+"-"+E.endSN+"]"),t===this.trackId&&(this.retryCount=0,this.playlistLoaded(t,r,T))},l.onLevelLoading=function(n,r){this.switchLevel(r.level)},l.onLevelSwitching=function(n,r){this.switchLevel(r.level)},l.switchLevel=function(n){var r=this.hls.levels[n];if(!(r!=null&&r.textGroupIds))return;var t=r.textGroupIds[r.urlId];if(this.groupId!==t){var E=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,y=this.tracks.filter(function(_){return!t||_.groupId===t});this.tracksInGroup=y;var m=this.findTrackId(E==null?void 0:E.name)||this.findTrackId();this.groupId=t;var T={subtitleTracks:y};this.log("Updating subtitle tracks, "+y.length+' track(s) found in "'+t+'" group-id'),this.hls.trigger(W.Events.SUBTITLE_TRACKS_UPDATED,T),m!==-1&&this.setSubtitleTrack(m,E)}},l.findTrackId=function(n){for(var r=this.tracksInGroup,t=0;t<r.length;t++){var E=r[t];if((!this.selectDefaultTrack||E.default)&&(!n||n===E.name))return E.id}return-1},l.onError=function(n,r){if(s.prototype.onError.call(this,n,r),r.fatal||!r.context)return;r.context.type===K.PlaylistContextType.SUBTITLE_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},l.loadPlaylist=function(n){var r=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(r)){var t=r.id,E=r.groupId,y=r.url;if(n)try{y=n.addDirectives(y)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("Loading subtitle playlist for id "+t),this.hls.trigger(W.Events.SUBTITLE_TRACK_LOADING,{url:y,id:t,groupId:E,deliveryDirectives:n||null})}},l.toggleTrackModes=function(n){var r=this,t=this.media,E=this.subtitleDisplay,y=this.trackId;if(!t)return;var m=c(t.textTracks),T=m.filter(function(h){return h.groupId===r.groupId});if(n===-1)[].slice.call(m).forEach(function(h){h.mode="disabled"});else{var _=T[y];_&&(_.mode="disabled")}var f=T[n];f&&(f.mode=E?"showing":"hidden")},l.setSubtitleTrack=function(n,r){var t,E=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=n;return}if(this.trackId!==n&&this.toggleTrackModes(n),this.trackId===n&&(n===-1||(t=E[n])!==null&&t!==void 0&&t.details)||n<-1||n>=E.length)return;this.clearTimer();var y=E[n];if(this.log("Switching to subtitle track "+n),this.trackId=n,y){var m=y.id,T=y.groupId,_=T===void 0?"":T,f=y.name,h=y.type,o=y.url;this.hls.trigger(W.Events.SUBTITLE_TRACK_SWITCH,{id:m,groupId:_,name:f,type:h,url:o});var u=this.switchParams(y.url,r==null?void 0:r.details);this.loadPlaylist(u)}else this.hls.trigger(W.Events.SUBTITLE_TRACK_SWITCH,{id:n})},l.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var n=-1,r=c(this.media.textTracks),t=0;t<r.length;t++)if(r[t].mode==="hidden")n=t;else if(r[t].mode==="showing"){n=t;break}this.subtitleTrack!==n&&(this.subtitleTrack=n)},e(i,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(n){this.selectDefaultTrack=!1;var r=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(n,r)}}]),i}(R.default);function c(s){for(var i=[],l=0;l<s.length;l++){var a=s[l];a.kind==="subtitles"&&a.label&&i.push(s[l])}return i}H.default=v},"./src/controller/timeline-controller.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"TimelineController",function(){return c});var W=I("./src/polyfills/number.ts"),P=I("./src/events.ts"),R=I("./src/utils/cea-608-parser.ts"),K=I("./src/utils/output-filter.ts"),N=I("./src/utils/webvtt-parser.ts"),e=I("./src/utils/texttrack-utils.ts"),C=I("./src/utils/imsc1-ttml-parser.ts"),g=I("./src/types/loader.ts"),v=I("./src/utils/logger.ts"),c=function(){function a(r){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=l(),this.captionsProperties=void 0,this.hls=r,this.config=r.config,this.Cues=r.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var t=new K.default(this,"textTrack1"),E=new K.default(this,"textTrack2"),y=new K.default(this,"textTrack3"),m=new K.default(this,"textTrack4");this.cea608Parser1=new R.default(1,t,E),this.cea608Parser2=new R.default(3,y,m)}r.on(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),r.on(P.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),r.on(P.Events.FRAG_LOADING,this.onFragLoading,this),r.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),r.on(P.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),r.on(P.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),r.on(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),r.on(P.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),r.on(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var n=a.prototype;return n.destroy=function(){var t=this.hls;t.off(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(P.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(P.Events.FRAG_LOADING,this.onFragLoading,this),t.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),t.off(P.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(P.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(P.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},n.addCues=function(t,E,y,m,T){for(var _=!1,f=T.length;f--;){var h=T[f],o=i(h[0],h[1],E,y);if(o>=0&&(h[0]=Math.min(h[0],E),h[1]=Math.max(h[1],y),_=!0,o/(y-E)>.5))return}if(_||T.push([E,y]),this.config.renderTextTracksNatively){var u=this.captionsTracks[t];this.Cues.newCue(u,E,y,m)}else{var b=this.Cues.newCue(null,E,y,m);this.hls.trigger(P.Events.CUES_PARSED,{type:"captions",cues:b,track:t})}},n.onInitPtsFound=function(t,E){var y=this,m=E.frag,T=E.id,_=E.initPTS,f=E.timescale,h=this.unparsedVttFrags;T==="main"&&(this.initPTS[m.cc]=_,this.timescale[m.cc]=f),h.length&&(this.unparsedVttFrags=[],h.forEach(function(o){y.onFragLoaded(P.Events.FRAG_LOADED,o)}))},n.getExistingTrack=function(t){var E=this.media;if(E)for(var y=0;y<E.textTracks.length;y++){var m=E.textTracks[y];if(m[t])return m}return null},n.createCaptionsTrack=function(t){this.config.renderTextTracksNatively?this.createNativeTrack(t):this.createNonNativeTrack(t)},n.createNativeTrack=function(t){if(this.captionsTracks[t])return;var E=this.captionsProperties,y=this.captionsTracks,m=this.media,T=E[t],_=T.label,f=T.languageCode,h=this.getExistingTrack(t);if(h)y[t]=h,Object(e.clearCurrentCues)(y[t]),Object(e.sendAddTrackEvent)(y[t],m);else{var o=this.createTextTrack("captions",_,f);o&&(o[t]=!0,y[t]=o)}},n.createNonNativeTrack=function(t){if(this.nonNativeCaptionsTracks[t])return;var E=this.captionsProperties[t];if(!E)return;var y=E.label,m={_id:t,label:y,kind:"captions",default:E.media?!!E.media.default:!1,closedCaptions:E.media};this.nonNativeCaptionsTracks[t]=m,this.hls.trigger(P.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[m]})},n.createTextTrack=function(t,E,y){var m=this.media;return m?m.addTextTrack(t,E,y):void 0},n.onMediaAttaching=function(t,E){this.media=E.media,this._cleanTracks()},n.onMediaDetaching=function(){var t=this.captionsTracks;Object.keys(t).forEach(function(E){Object(e.clearCurrentCues)(t[E]),delete t[E]}),this.nonNativeCaptionsTracks={}},n.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=l(),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())},n._cleanTracks=function(){var t=this.media;if(!t)return;var E=t.textTracks;if(E)for(var y=0;y<E.length;y++)Object(e.clearCurrentCues)(E[y])},n.onSubtitleTracksUpdated=function(t,E){var y=this;this.textTracks=[];var m=E.subtitleTracks||[],T=m.some(function(o){return o.textCodec===C.IMSC1_CODEC});if(this.config.enableWebVTT||T&&this.config.enableIMSC1){var _=this.tracks&&m&&this.tracks.length===m.length;if(this.tracks=m||[],this.config.renderTextTracksNatively){var f=this.media?this.media.textTracks:[];this.tracks.forEach(function(o,u){var b;if(u<f.length){for(var p=null,d=0;d<f.length;d++)if(s(f[d],o)){p=f[d];break}p&&(b=p)}b?Object(e.clearCurrentCues)(b):(b=y.createTextTrack("subtitles",o.name,o.lang),b&&(b.mode="disabled")),b&&(b.groupId=o.groupId,y.textTracks.push(b))})}else if(!_&&this.tracks&&this.tracks.length){var h=this.tracks.map(function(o){return{label:o.name,kind:o.type.toLowerCase(),default:o.default,subtitleTrack:o}});this.hls.trigger(P.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:h})}}},n.onManifestLoaded=function(t,E){var y=this;this.config.enableCEA708Captions&&E.captions&&E.captions.forEach(function(m){var T=/(?:CC|SERVICE)([1-4])/.exec(m.instreamId);if(!T)return;var _="textTrack"+T[1],f=y.captionsProperties[_];if(!f)return;f.label=m.name,m.lang&&(f.languageCode=m.lang),f.media=m})},n.onFragLoading=function(t,E){var y=this.cea608Parser1,m=this.cea608Parser2,T=this.lastSn,_=this.lastPartIndex;if(!this.enabled||!(y&&m))return;if(E.frag.type===g.PlaylistLevelType.MAIN){var f,h,o=E.frag.sn,u=(f=E==null||((h=E.part)===null||h===void 0)?void 0:h.index)!=null?f:-1;o===T+1||o===T&&u===_+1||(y.reset(),m.reset()),this.lastSn=o,this.lastPartIndex=u}},n.onFragLoaded=function(t,E){var y=E.frag,m=E.payload,T=this.initPTS,_=this.unparsedVttFrags;if(y.type===g.PlaylistLevelType.SUBTITLE)if(m.byteLength){if(!Object(W.isFiniteNumber)(T[y.cc])){_.push(E),T.length&&this.hls.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:y,error:new Error("Missing initial subtitle PTS")});return}var f=y.decryptdata;if(f==null||f.key==null||f.method!=="AES-128"){var h=this.tracks[y.level],o=this.vttCCs;o[y.cc]||(o[y.cc]={start:y.start,prevCC:this.prevCC,new:!0},this.prevCC=y.cc),h&&h.textCodec===C.IMSC1_CODEC?this._parseIMSC1(y,m):this._parseVTTs(y,m,o)}}else this.hls.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:y,error:new Error("Empty subtitle payload")})},n._parseIMSC1=function(t,E){var y=this,m=this.hls;Object(C.parseIMSC1)(E,this.initPTS[t.cc],this.timescale[t.cc],function(T){y._appendCues(T,t.level),m.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(T){v.logger.log("Failed to parse IMSC1: "+T),m.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:T})})},n._parseVTTs=function(t,E,y){var m=this,T=this.hls;Object(N.parseWebVTT)(E,this.initPTS[t.cc],this.timescale[t.cc],y,t.cc,t.start,function(_){m._appendCues(_,t.level),T.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(_){m._fallbackToIMSC1(t,E),v.logger.log("Failed to parse VTT cue: "+_),T.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:_})})},n._fallbackToIMSC1=function(t,E){var y=this,m=this.tracks[t.level];m.textCodec||Object(C.parseIMSC1)(E,this.initPTS[t.cc],this.timescale[t.cc],function(){m.textCodec=C.IMSC1_CODEC,y._parseIMSC1(t,E)},function(){m.textCodec="wvtt"})},n._appendCues=function(t,E){var y=this.hls;if(this.config.renderTextTracksNatively){var m=this.textTracks[E];if(m.mode==="disabled")return;t.forEach(function(f){return Object(e.addCueToTrack)(m,f)})}else{var T=this.tracks[E],_=T.default?"default":"subtitles"+E;y.trigger(P.Events.CUES_PARSED,{type:"subtitles",cues:t,track:_})}},n.onFragDecrypted=function(t,E){var y=E.frag;if(y.type===g.PlaylistLevelType.SUBTITLE){if(!Object(W.isFiniteNumber)(this.initPTS[y.cc])){this.unparsedVttFrags.push(E);return}this.onFragLoaded(P.Events.FRAG_LOADED,E)}},n.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},n.onFragParsingUserdata=function(t,E){var y=this.cea608Parser1,m=this.cea608Parser2;if(!this.enabled||!(y&&m))return;for(var T=0;T<E.samples.length;T++){var _=E.samples[T].bytes;if(_){var f=this.extractCea608Data(_);y.addData(E.samples[T].pts,f[0]),m.addData(E.samples[T].pts,f[1])}}},n.onBufferFlushing=function(t,E){var y=E.startOffset,m=E.endOffset,T=E.endOffsetSubtitles,_=E.type,f=this.media;if(!f||f.currentTime<m)return;if(!_||_==="video"){var h=this.captionsTracks;Object.keys(h).forEach(function(u){return Object(e.removeCuesInRange)(h[u],y,m)})}if(this.config.renderTextTracksNatively&&(y===0&&T!==void 0)){var o=this.textTracks;Object.keys(o).forEach(function(u){return Object(e.removeCuesInRange)(o[u],y,T)})}},n.extractCea608Data=function(t){for(var E=t[0]&31,y=2,m=[[],[]],T=0;T<E;T++){var _=t[y++],f=127&t[y++],h=127&t[y++],o=(4&_)!==0,u=3&_;if(f===0&&h===0)continue;o&&((u===0||u===1)&&(m[u].push(f),m[u].push(h)))}return m},a}();function s(a,n){return a&&a.label===n.name&&!(a.textTrack1||a.textTrack2)}function i(a,n,r,t){return Math.min(n,t)-Math.max(a,r)}function l(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return W});var W=function(){function P(K,N){this.subtle=void 0,this.aesIV=void 0,this.subtle=K,this.aesIV=N}var R=P.prototype;return R.decrypt=function(N,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,N)},P}()},"./src/crypt/aes-decryptor.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"removePadding",function(){return P}),I.d(H,"default",function(){return R});var W=I("./src/utils/typed-array.ts");function P(K){var N=K.byteLength,e=N&&new DataView(K.buffer).getUint8(N-1);return e?Object(W.sliceUint8)(K,0,N-e):K}var R=function(){function K(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var N=K.prototype;return N.uint8ArrayToUint32Array_=function(C){for(var g=new DataView(C),v=new Uint32Array(4),c=0;c<4;c++)v[c]=g.getUint32(c*4);return v},N.initTable=function(){var C=this.sBox,g=this.invSBox,v=this.subMix,c=v[0],s=v[1],i=v[2],l=v[3],a=this.invSubMix,n=a[0],r=a[1],t=a[2],E=a[3],y=new Uint32Array(256),m=0,T=0,_=0;for(_=0;_<256;_++)_<128?y[_]=_<<1:y[_]=_<<1^283;for(_=0;_<256;_++){var f=T^T<<1^T<<2^T<<3^T<<4;f=f>>>8^f&255^99,C[m]=f,g[f]=m;var h=y[m],o=y[h],u=y[o],b=y[f]*257^f*16843008;c[m]=b<<24|b>>>8,s[m]=b<<16|b>>>16,i[m]=b<<8|b>>>24,l[m]=b,b=u*16843009^o*65537^h*257^m*16843008,n[f]=b<<24|b>>>8,r[f]=b<<16|b>>>16,t[f]=b<<8|b>>>24,E[f]=b,m?(m=h^y[y[y[u^h]]],T^=y[y[T]]):m=T=1}},N.expandKey=function(C){for(var g=this.uint8ArrayToUint32Array_(C),v=!0,c=0;c<g.length&&v;)v=g[c]===this.key[c],c++;if(v)return;this.key=g;var s=this.keySize=g.length;if(s!==4&&s!==6&&s!==8)throw new Error("Invalid aes key size="+s);var i=this.ksRows=(s+6+1)*4,l,a,n=this.keySchedule=new Uint32Array(i),r=this.invKeySchedule=new Uint32Array(i),t=this.sBox,E=this.rcon,y=this.invSubMix,m=y[0],T=y[1],_=y[2],f=y[3],h,o;for(l=0;l<i;l++){if(l<s){h=n[l]=g[l];continue}o=h,l%s===0?(o=o<<8|o>>>24,o=t[o>>>24]<<24|t[o>>>16&255]<<16|t[o>>>8&255]<<8|t[o&255],o^=E[l/s|0]<<24):s>6&&l%s===4&&(o=t[o>>>24]<<24|t[o>>>16&255]<<16|t[o>>>8&255]<<8|t[o&255]),n[l]=h=(n[l-s]^o)>>>0}for(a=0;a<i;a++)l=i-a,a&3?o=n[l]:o=n[l-4],a<4||l<=4?r[a]=o:r[a]=m[t[o>>>24]]^T[t[o>>>16&255]]^_[t[o>>>8&255]]^f[t[o&255]],r[a]=r[a]>>>0},N.networkToHostOrderSwap=function(C){return C<<24|(C&65280)<<8|(C&16711680)>>8|C>>>24},N.decrypt=function(C,g,v){for(var c=this.keySize+6,s=this.invKeySchedule,i=this.invSBox,l=this.invSubMix,a=l[0],n=l[1],r=l[2],t=l[3],E=this.uint8ArrayToUint32Array_(v),y=E[0],m=E[1],T=E[2],_=E[3],f=new Int32Array(C),h=new Int32Array(f.length),o,u,b,p,d,A,D,S,L,M,O,j,G,X,te=this.networkToHostOrderSwap;g<f.length;){for(L=te(f[g]),M=te(f[g+1]),O=te(f[g+2]),j=te(f[g+3]),d=L^s[0],A=j^s[1],D=O^s[2],S=M^s[3],G=4,X=1;X<c;X++)o=a[d>>>24]^n[A>>16&255]^r[D>>8&255]^t[S&255]^s[G],u=a[A>>>24]^n[D>>16&255]^r[S>>8&255]^t[d&255]^s[G+1],b=a[D>>>24]^n[S>>16&255]^r[d>>8&255]^t[A&255]^s[G+2],p=a[S>>>24]^n[d>>16&255]^r[A>>8&255]^t[D&255]^s[G+3],d=o,A=u,D=b,S=p,G=G+4;o=i[d>>>24]<<24^i[A>>16&255]<<16^i[D>>8&255]<<8^i[S&255]^s[G],u=i[A>>>24]<<24^i[D>>16&255]<<16^i[S>>8&255]<<8^i[d&255]^s[G+1],b=i[D>>>24]<<24^i[S>>16&255]<<16^i[d>>8&255]<<8^i[A&255]^s[G+2],p=i[S>>>24]<<24^i[d>>16&255]<<16^i[A>>8&255]<<8^i[D&255]^s[G+3],h[g]=te(o^y),h[g+1]=te(p^m),h[g+2]=te(b^T),h[g+3]=te(u^_),y=L,m=M,T=O,_=j,g=g+4}return h.buffer},K}()},"./src/crypt/decrypter.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return g});var W=I("./src/crypt/aes-crypto.ts"),P=I("./src/crypt/fast-aes-key.ts"),R=I("./src/crypt/aes-decryptor.ts"),K=I("./src/utils/logger.ts"),N=I("./src/utils/mp4-tools.ts"),e=I("./src/utils/typed-array.ts"),C=16,g=function(){function v(s,i,l){var a=l===void 0?{}:l,n=a.removePKCS7Padding,r=n===void 0?!0:n;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=s,this.config=i,this.removePKCS7Padding=r,r)try{var t=self.crypto;t&&(this.subtle=t.subtle||t.webkitSubtle)}catch(E){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var c=v.prototype;return c.destroy=function(){this.observer=null},c.isSync=function(){return this.config.enableSoftwareAES},c.flush=function(){var i=this.currentResult;if(!i){this.reset();return}var l=new Uint8Array(i);return this.reset(),this.removePKCS7Padding?Object(R.removePadding)(l):l},c.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},c.decrypt=function(i,l,a,n){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(i),l,a);var r=this.flush();r&&n(r.buffer)}else this.webCryptoDecrypt(new Uint8Array(i),l,a).then(n)},c.softwareDecrypt=function(i,l,a){var n=this.currentIV,r=this.currentResult,t=this.remainderData;this.logOnce("JS AES decrypt"),t&&(i=Object(N.appendUint8Array)(t,i),this.remainderData=null);var E=this.getValidChunk(i);if(!E.length)return null;n&&(a=n);var y=this.softwareDecrypter;y||(y=this.softwareDecrypter=new R.default),y.expandKey(l);var m=r;return this.currentResult=y.decrypt(E.buffer,0,a),this.currentIV=Object(e.sliceUint8)(E,-16).buffer,m||null},c.webCryptoDecrypt=function(i,l,a){var n=this,r=this.subtle;return(this.key!==l||!this.fastAesKey)&&(this.key=l,this.fastAesKey=new P.default(r,l)),this.fastAesKey.expandKey().then(function(t){if(!r)return Promise.reject(new Error("web crypto not initialized"));var E=new W.default(r,a);return E.decrypt(i.buffer,t)}).catch(function(t){return n.onWebCryptoError(t,i,l,a)})},c.onWebCryptoError=function(i,l,a,n){return K.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",i),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(l,a,n)},c.getValidChunk=function(i){var l=i,a=i.length-i.length%C;return a!==i.length&&(l=Object(e.sliceUint8)(i,0,a),this.remainderData=Object(e.sliceUint8)(i,a)),l},c.logOnce=function(i){if(!this.logEnabled)return;K.logger.log("[decrypter.ts]: "+i),this.logEnabled=!1},v}()},"./src/crypt/fast-aes-key.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return W});var W=function(){function P(K,N){this.subtle=void 0,this.key=void 0,this.subtle=K,this.key=N}var R=P.prototype;return R.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},P}()},"./src/demux/aacdemuxer.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/demux/base-audio-demuxer.ts"),P=I("./src/demux/adts.ts"),R=I("./src/utils/logger.ts"),K=I("./src/demux/id3.ts");function N(g,v){g.prototype=Object.create(v.prototype),g.prototype.constructor=g,e(g,v)}function e(g,v){return e=Object.setPrototypeOf||function(s,i){return s.__proto__=i,s},e(g,v)}var C=function(g){N(v,g);function v(s,i){var l;return l=g.call(this)||this,l.observer=void 0,l.config=void 0,l.observer=s,l.config=i,l}var c=v.prototype;return c.resetInitSegment=function(i,l,a){g.prototype.resetInitSegment.call(this,i,l,a),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:i,duration:a,inputTimeScale:9e4,dropped:0}},v.probe=function(i){if(!i)return!1;for(var l=K.getID3Data(i,0)||[],a=l.length,n=i.length;a<n;a++)if(P.probe(i,a))return R.logger.log("ADTS sync word found !"),!0;return!1},c.canParse=function(i,l){return P.canParse(i,l)},c.appendFrame=function(i,l,a){P.initTrackConfig(i,this.observer,l,a,i.manifestCodec);var n=P.appendFrame(i,l,a,this.initPTS,this.frameIndex);if(n&&n.missing===0)return n},v}(W.default);C.minProbeByteLength=9,H.default=C},"./src/demux/adts.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"getAudioConfig",function(){return K}),I.d(H,"isHeaderPattern",function(){return N}),I.d(H,"getHeaderLength",function(){return e}),I.d(H,"getFullFrameLength",function(){return C}),I.d(H,"canGetFrameLength",function(){return g}),I.d(H,"isHeader",function(){return v}),I.d(H,"canParse",function(){return c}),I.d(H,"probe",function(){return s}),I.d(H,"initTrackConfig",function(){return i}),I.d(H,"getFrameDuration",function(){return l}),I.d(H,"parseFrameHeader",function(){return a}),I.d(H,"appendFrame",function(){return n});var W=I("./src/utils/logger.ts"),P=I("./src/errors.ts"),R=I("./src/events.ts");function K(r,t,E,y){var m,T,_,f,h=navigator.userAgent.toLowerCase(),o=y,u=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];m=((t[E+2]&192)>>>6)+1;var b=(t[E+2]&60)>>>2;if(b>u.length-1){r.trigger(R.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+b});return}return _=(t[E+2]&1)<<2,_|=(t[E+3]&192)>>>6,W.logger.log("manifest codec:"+y+", ADTS type:"+m+", samplingIndex:"+b),/firefox/i.test(h)?b>=6?(m=5,f=new Array(4),T=b-3):(m=2,f=new Array(2),T=b):h.indexOf("android")!==-1?(m=2,f=new Array(2),T=b):(m=5,f=new Array(4),y&&(y.indexOf("mp4a.40.29")!==-1||y.indexOf("mp4a.40.5")!==-1)||!y&&b>=6?T=b-3:((y&&y.indexOf("mp4a.40.2")!==-1&&(b>=6&&_===1||/vivaldi/i.test(h))||!y&&_===1)&&(m=2,f=new Array(2)),T=b)),f[0]=m<<3,f[0]|=(b&14)>>1,f[1]|=(b&1)<<7,f[1]|=_<<3,m===5&&(f[1]|=(T&14)>>1,f[2]=(T&1)<<7,f[2]|=2<<2,f[3]=0),{config:f,samplerate:u[b],channelCount:_,codec:"mp4a.40."+m,manifestCodec:o}}function N(r,t){return r[t]===255&&(r[t+1]&246)===240}function e(r,t){return r[t+1]&1?7:9}function C(r,t){return(r[t+3]&3)<<11|r[t+4]<<3|(r[t+5]&224)>>>5}function g(r,t){return t+5<r.length}function v(r,t){return t+1<r.length&&N(r,t)}function c(r,t){return g(r,t)&&N(r,t)&&C(r,t)<=r.length-t}function s(r,t){if(v(r,t)){var E=e(r,t);if(t+E>=r.length)return!1;var y=C(r,t);if(y<=E)return!1;var m=t+y;return m===r.length||v(r,m)}return!1}function i(r,t,E,y,m){if(!r.samplerate){var T=K(t,E,y,m);if(!T)return;r.config=T.config,r.samplerate=T.samplerate,r.channelCount=T.channelCount,r.codec=T.codec,r.manifestCodec=T.manifestCodec,W.logger.log("parsed codec:"+r.codec+", rate:"+T.samplerate+", channels:"+T.channelCount)}}function l(r){return 1024*9e4/r}function a(r,t,E,y,m){var T=e(r,t),_=C(r,t);if(_-=T,_>0){var f=E+y*m;return{headerLength:T,frameLength:_,stamp:f}}}function n(r,t,E,y,m){var T=l(r.samplerate),_=a(t,E,y,m,T);if(_){var f=_.frameLength,h=_.headerLength,o=_.stamp,u=h+f,b=Math.max(0,E+u-t.length),p;b?(p=new Uint8Array(u-h),p.set(t.subarray(E+h,t.length),0)):p=t.subarray(E+h,E+u);var d={unit:p,pts:o};return b||r.samples.push(d),{sample:d,length:u,missing:b}}}},"./src/demux/base-audio-demuxer.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"initPTSFn",function(){return C});var W=I("./src/polyfills/number.ts"),P=I("./src/demux/id3.ts"),R=I("./src/demux/dummy-demuxed-track.ts"),K=I("./src/utils/mp4-tools.ts"),N=I("./src/utils/typed-array.ts"),e=function(){function g(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var v=g.prototype;return v.resetInitSegment=function(s,i,l){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},v.resetTimeStamp=function(){},v.resetContiguity=function(){},v.canParse=function(s,i){return!1},v.appendFrame=function(s,i,l){},v.demux=function(s,i){this.cachedData&&(s=Object(K.appendUint8Array)(this.cachedData,s),this.cachedData=null);var l=P.getID3Data(s,0),a=l?l.length:0,n,r,t=this._audioTrack,E=this._id3Track,y=l?P.getTimeStamp(l):void 0,m=s.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=C(y,i)),l&&l.length>0&&E.samples.push({pts:this.initPTS,dts:this.initPTS,data:l}),r=this.initPTS;a<m;){if(this.canParse(s,a)){var T=this.appendFrame(t,s,a);T?(this.frameIndex++,r=T.sample.pts,a+=T.length,n=a):a=m}else P.canParse(s,a)?(l=P.getID3Data(s,a),E.samples.push({pts:r,dts:r,data:l}),a+=l.length,n=a):a++;if(a===m&&n!==m){var _=Object(N.sliceUint8)(s,n);this.cachedData?this.cachedData=Object(K.appendUint8Array)(this.cachedData,_):this.cachedData=_}}return{audioTrack:t,avcTrack:Object(R.dummyTrack)(),id3Track:E,textTrack:Object(R.dummyTrack)()}},v.demuxSampleAes=function(s,i,l){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},v.flush=function(s){var i=this.cachedData;return i&&(this.cachedData=null,this.demux(i,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(R.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(R.dummyTrack)()}},v.destroy=function(){},g}(),C=function(v,c){return Object(W.isFiniteNumber)(v)?v*90:c*9e4};H.default=e},"./src/demux/chunk-cache.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return W});var W=function(){function R(){this.chunks=[],this.dataLength=0}var K=R.prototype;return K.push=function(e){this.chunks.push(e),this.dataLength+=e.length},K.flush=function(){var e=this.chunks,C=this.dataLength,g;if(e.length)e.length===1?g=e[0]:g=P(e,C);else return new Uint8Array(0);return this.reset(),g},K.reset=function(){this.chunks.length=0,this.dataLength=0},R}();function P(R,K){for(var N=new Uint8Array(K),e=0,C=0;C<R.length;C++){var g=R[C];N.set(g,e),e+=g.length}return N}},"./src/demux/dummy-demuxed-track.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"dummyTrack",function(){return W});function W(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/utils/logger.ts"),P=function(){function R(N){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=N,this.bytesAvailable=N.byteLength,this.word=0,this.bitsAvailable=0}var K=R.prototype;return K.loadWord=function(){var e=this.data,C=this.bytesAvailable,g=e.byteLength-C,v=new Uint8Array(4),c=Math.min(4,C);if(c===0)throw new Error("no bytes available");v.set(e.subarray(g,g+c)),this.word=new DataView(v.buffer).getUint32(0),this.bitsAvailable=c*8,this.bytesAvailable-=c},K.skipBits=function(e){var C;this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,C=e>>3,e-=C>>3,this.bytesAvailable-=C,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)},K.readBits=function(e){var C=Math.min(this.bitsAvailable,e),g=this.word>>>32-C;return e>32&&W.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=C,this.bitsAvailable>0?this.word<<=C:this.bytesAvailable>0&&this.loadWord(),C=e-C,C>0&&this.bitsAvailable?g<<C|this.readBits(C):g},K.skipLZ=function(){var e;for(e=0;e<this.bitsAvailable;++e)if((this.word&2147483648>>>e)!==0)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()},K.skipUEG=function(){this.skipBits(1+this.skipLZ())},K.skipEG=function(){this.skipBits(1+this.skipLZ())},K.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},K.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},K.readBoolean=function(){return this.readBits(1)===1},K.readUByte=function(){return this.readBits(8)},K.readUShort=function(){return this.readBits(16)},K.readUInt=function(){return this.readBits(32)},K.skipScalingList=function(e){for(var C=8,g=8,v,c=0;c<e;c++)g!==0&&(v=this.readEG(),g=(C+v+256)%256),C=g===0?C:g},K.readSPS=function(){var e=0,C=0,g=0,v=0,c,s,i,l=this.readUByte.bind(this),a=this.readBits.bind(this),n=this.readUEG.bind(this),r=this.readBoolean.bind(this),t=this.skipBits.bind(this),E=this.skipEG.bind(this),y=this.skipUEG.bind(this),m=this.skipScalingList.bind(this);l();var T=l();if(a(5),t(3),l(),y(),T===100||T===110||T===122||T===244||T===44||T===83||T===86||T===118||T===128){var _=n();if(_===3&&t(1),y(),y(),t(1),r())for(s=_!==3?8:12,i=0;i<s;i++)r()&&(i<6?m(16):m(64))}y();var f=n();if(f===0)n();else if(f===1)for(t(1),E(),E(),c=n(),i=0;i<c;i++)E();y(),t(1);var h=n(),o=n(),u=a(1);u===0&&t(1),t(1),r()&&(e=n(),C=n(),g=n(),v=n());var b=[1,1];if(r()&&r()){var p=l();switch(p){case 1:b=[1,1];break;case 2:b=[12,11];break;case 3:b=[10,11];break;case 4:b=[16,11];break;case 5:b=[40,33];break;case 6:b=[24,11];break;case 7:b=[20,11];break;case 8:b=[32,11];break;case 9:b=[80,33];break;case 10:b=[18,11];break;case 11:b=[15,11];break;case 12:b=[64,33];break;case 13:b=[160,99];break;case 14:b=[4,3];break;case 15:b=[3,2];break;case 16:b=[2,1];break;case 255:{b=[l()<<8|l(),l()<<8|l()];break}}}return{width:Math.ceil((h+1)*16-e*2-C*2),height:(2-u)*(o+1)*16-(u?2:4)*(g+v),pixelRatio:b}},K.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},R}();H.default=P},"./src/demux/id3.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"isHeader",function(){return W}),I.d(H,"isFooter",function(){return P}),I.d(H,"getID3Data",function(){return R}),I.d(H,"canParse",function(){return N}),I.d(H,"getTimeStamp",function(){return e}),I.d(H,"isTimeStampFrame",function(){return C}),I.d(H,"getID3Frames",function(){return v}),I.d(H,"decodeFrame",function(){return c}),I.d(H,"utf8ArrayToStr",function(){return n}),I.d(H,"testables",function(){return r});var W=function(m,T){return T+10<=m.length&&(m[T]===73&&m[T+1]===68&&m[T+2]===51&&(m[T+3]<255&&m[T+4]<255&&(m[T+6]<128&&m[T+7]<128&&m[T+8]<128&&m[T+9]<128)))},P=function(m,T){return T+10<=m.length&&(m[T]===51&&m[T+1]===68&&m[T+2]===73&&(m[T+3]<255&&m[T+4]<255&&(m[T+6]<128&&m[T+7]<128&&m[T+8]<128&&m[T+9]<128)))},R=function(m,T){for(var _=T,f=0;W(m,T);){f+=10;var h=K(m,T+6);f+=h,P(m,T+10)&&(f+=10),T+=f}return f>0?m.subarray(_,_+f):void 0},K=function(m,T){var _=0;return _=(m[T]&127)<<21,_|=(m[T+1]&127)<<14,_|=(m[T+2]&127)<<7,_|=m[T+3]&127,_},N=function(m,T){return W(m,T)&&K(m,T+6)+10<=m.length-T},e=function(m){for(var T=v(m),_=0;_<T.length;_++){var f=T[_];if(C(f))return a(f)}return},C=function(m){return m&&m.key==="PRIV"&&m.info==="com.apple.streaming.transportStreamTimestamp"},g=function(m){var T=String.fromCharCode(m[0],m[1],m[2],m[3]),_=K(m,4),f=10;return{type:T,size:_,data:m.subarray(f,f+_)}},v=function(m){for(var T=0,_=[];W(m,T);){var f=K(m,T+6);T+=10;for(var h=T+f;T+8<h;){var o=g(m.subarray(T)),u=c(o);u&&_.push(u),T+=o.size+10}P(m,T)&&(T+=10)}return _},c=function(m){return m.type==="PRIV"?s(m):m.type[0]==="W"?l(m):i(m)},s=function(m){if(m.size<2)return;var T=n(m.data,!0),_=new Uint8Array(m.data.subarray(T.length+1));return{key:m.type,info:T,data:_.buffer}},i=function(m){if(m.size<2)return;if(m.type==="TXXX"){var T=1,_=n(m.data.subarray(T),!0);T+=_.length+1;var f=n(m.data.subarray(T));return{key:m.type,info:_,data:f}}var h=n(m.data.subarray(1));return{key:m.type,data:h}},l=function(m){if(m.type==="WXXX"){if(m.size<2)return;var T=1,_=n(m.data.subarray(T),!0);T+=_.length+1;var f=n(m.data.subarray(T));return{key:m.type,info:_,data:f}}var h=n(m.data);return{key:m.type,data:h}},a=function(m){if(m.data.byteLength===8){var T=new Uint8Array(m.data),_=T[3]&1,f=(T[4]<<23)+(T[5]<<15)+(T[6]<<7)+T[7];return f/=45,_&&(f+=4772185884e-2),Math.round(f)}return},n=function(m,T){T===void 0&&(T=!1);var _=E();if(_){var f=_.decode(m);if(T){var h=f.indexOf("\0");return h!==-1?f.substring(0,h):f}return f.replace(/\0/g,"")}for(var o=m.length,u,b,p,d="",A=0;A<o;){if(u=m[A++],u===0&&T)return d;if(u===0||u===3)continue;switch(u>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:d+=String.fromCharCode(u);break;case 12:case 13:b=m[A++],d+=String.fromCharCode((u&31)<<6|b&63);break;case 14:b=m[A++],p=m[A++],d+=String.fromCharCode((u&15)<<12|(b&63)<<6|(p&63)<<0);break;default:}}return d},r={decodeTextFrame:i},t;function E(){return!t&&typeof self.TextDecoder!="undefined"&&(t=new self.TextDecoder("utf-8")),t}},"./src/demux/mp3demuxer.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/demux/base-audio-demuxer.ts"),P=I("./src/demux/id3.ts"),R=I("./src/utils/logger.ts"),K=I("./src/demux/mpegaudio.ts");function N(g,v){g.prototype=Object.create(v.prototype),g.prototype.constructor=g,e(g,v)}function e(g,v){return e=Object.setPrototypeOf||function(s,i){return s.__proto__=i,s},e(g,v)}var C=function(g){N(v,g);function v(){return g.apply(this,arguments)||this}var c=v.prototype;return c.resetInitSegment=function(i,l,a){g.prototype.resetInitSegment.call(this,i,l,a),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:i,duration:a,inputTimeScale:9e4,dropped:0}},v.probe=function(i){if(!i)return!1;for(var l=P.getID3Data(i,0)||[],a=l.length,n=i.length;a<n;a++)if(K.probe(i,a))return R.logger.log("MPEG Audio sync word found !"),!0;return!1},c.canParse=function(i,l){return K.canParse(i,l)},c.appendFrame=function(i,l,a){return this.initPTS===null?void 0:K.appendFrame(i,l,a,this.initPTS,this.frameIndex)},v}(W.default);C.minProbeByteLength=4,H.default=C},"./src/demux/mp4demuxer.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/utils/mp4-tools.ts"),P=I("./src/demux/dummy-demuxed-track.ts"),R=function(){function K(e,C){this.remainderData=null,this.config=void 0,this.config=C}var N=K.prototype;return N.resetTimeStamp=function(){},N.resetInitSegment=function(){},N.resetContiguity=function(){},K.probe=function(C){return Object(W.findBox)({data:C,start:0,end:Math.min(C.length,16384)},["moof"]).length>0},N.demux=function(C){var g=C,v=Object(P.dummyTrack)();if(this.config.progressive){this.remainderData&&(g=Object(W.appendUint8Array)(this.remainderData,C));var c=Object(W.segmentValidRange)(g);this.remainderData=c.remainder,v.samples=c.valid||new Uint8Array}else v.samples=g;return{audioTrack:Object(P.dummyTrack)(),avcTrack:v,id3Track:Object(P.dummyTrack)(),textTrack:Object(P.dummyTrack)()}},N.flush=function(){var C=Object(P.dummyTrack)();return C.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(P.dummyTrack)(),avcTrack:C,id3Track:Object(P.dummyTrack)(),textTrack:Object(P.dummyTrack)()}},N.demuxSampleAes=function(C,g,v){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},N.destroy=function(){},K}();R.minProbeByteLength=1024,H.default=R},"./src/demux/mpegaudio.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"appendFrame",function(){return e}),I.d(H,"parseHeader",function(){return C}),I.d(H,"isHeaderPattern",function(){return g}),I.d(H,"isHeader",function(){return v}),I.d(H,"canParse",function(){return c}),I.d(H,"probe",function(){return s});var W=null,P=[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],R=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],K=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],N=[0,1,1,4];function e(i,l,a,n,r){if(a+24>l.length)return;var t=C(l,a);if(t&&a+t.frameLength<=l.length){var E=t.samplesPerFrame*9e4/t.sampleRate,y=n+r*E,m={unit:l.subarray(a,a+t.frameLength),pts:y,dts:y};return i.config=[],i.channelCount=t.channelCount,i.samplerate=t.sampleRate,i.samples.push(m),{sample:m,length:t.frameLength,missing:0}}}function C(i,l){var a=i[l+1]>>3&3,n=i[l+1]>>1&3,r=i[l+2]>>4&15,t=i[l+2]>>2&3;if(a!==1&&r!==0&&r!==15&&t!==3){var E=i[l+2]>>1&1,y=i[l+3]>>6,m=a===3?3-n:n===3?3:4,T=P[m*14+r-1]*1e3,_=a===3?0:a===2?1:2,f=R[_*3+t],h=y===3?1:2,o=K[a][n],u=N[n],b=o*8*u,p=Math.floor(o*T/f+E)*u;if(W===null){var d=navigator.userAgent||"",A=d.match(/Chrome\/(\d+)/i);W=A?parseInt(A[1]):0}var D=!!W&&W<=87;return D&&n===2&&T>=224e3&&y===0&&(i[l+3]=i[l+3]|128),{sampleRate:f,channelCount:h,frameLength:p,samplesPerFrame:b}}}function g(i,l){return i[l]===255&&(i[l+1]&224)===224&&(i[l+1]&6)!==0}function v(i,l){return l+1<i.length&&g(i,l)}function c(i,l){var a=4;return g(i,l)&&a<=i.length-l}function s(i,l){if(l+1<i.length&&g(i,l)){var a=4,n=C(i,l),r=a;n!=null&&n.frameLength&&(r=n.frameLength);var t=l+r;return t===i.length||v(i,t)}return!1}},"./src/demux/sample-aes.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/crypt/decrypter.ts"),P=I("./src/demux/tsdemuxer.ts"),R=function(){function K(e,C,g){this.keyData=void 0,this.decrypter=void 0,this.keyData=g,this.decrypter=new W.default(e,C,{removePKCS7Padding:!1})}var N=K.prototype;return N.decryptBuffer=function(C,g){this.decrypter.decrypt(C,this.keyData.key.buffer,this.keyData.iv.buffer,g)},N.decryptAacSample=function(C,g,v,c){var s=C[g].unit,i=s.subarray(16,s.length-s.length%16),l=i.buffer.slice(i.byteOffset,i.byteOffset+i.length),a=this;this.decryptBuffer(l,function(n){var r=new Uint8Array(n);s.set(r,16),c||a.decryptAacSamples(C,g+1,v)})},N.decryptAacSamples=function(C,g,v){for(;;g++){if(g>=C.length){v();return}if(C[g].unit.length<32)continue;var c=this.decrypter.isSync();if(this.decryptAacSample(C,g,v,c),!c)return}},N.getAvcEncryptedData=function(C){for(var g=Math.floor((C.length-48)/160)*16+16,v=new Int8Array(g),c=0,s=32;s<=C.length-16;s+=160,c+=16)v.set(C.subarray(s,s+16),c);return v},N.getAvcDecryptedUnit=function(C,g){for(var v=new Uint8Array(g),c=0,s=32;s<=C.length-16;s+=160,c+=16)C.set(v.subarray(c,c+16),s);return C},N.decryptAvcSample=function(C,g,v,c,s,i){var l=Object(P.discardEPB)(s.data),a=this.getAvcEncryptedData(l),n=this;this.decryptBuffer(a.buffer,function(r){s.data=n.getAvcDecryptedUnit(l,r),i||n.decryptAvcSamples(C,g,v+1,c)})},N.decryptAvcSamples=function(C,g,v,c){if(C instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;g++,v=0){if(g>=C.length){c();return}for(var s=C[g].units;!(v>=s.length);v++){var i=s[v];if(i.data.length<=48||i.type!==1&&i.type!==5)continue;var l=this.decrypter.isSync();if(this.decryptAvcSample(C,g,v,c,i,l),!l)return}}},K}();H.default=R},"./src/demux/transmuxer-interface.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return s});var W=I("./node_modules/webworkify-webpack/index.js"),P=I.n(W),R=I("./src/events.ts"),K=I("./src/demux/transmuxer.ts"),N=I("./src/utils/logger.ts"),e=I("./src/errors.ts"),C=I("./src/utils/mediasource-helper.ts"),g=I("./node_modules/eventemitter3/index.js"),v=I.n(g),c=Object(C.getMediaSource)()||{isTypeSupported:function(){return!1}},s=function(){function i(a,n,r,t){var E=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=n,this.onTransmuxComplete=r,this.onFlush=t;var y=a.config,m=function(o,u){u=u||{},u.frag=E.frag,u.id=E.id,a.trigger(o,u)};this.observer=new g.EventEmitter,this.observer.on(R.Events.FRAG_DECRYPTED,m),this.observer.on(R.Events.ERROR,m);var T={mp4:c.isTypeSupported("video/mp4"),mpeg:c.isTypeSupported("audio/mpeg"),mp3:c.isTypeSupported('audio/mp4; codecs="mp3"')},_=navigator.vendor;if(y.enableWorker&&typeof Worker!="undefined"){N.logger.log("demuxing in webworker");var f;try{f=this.worker=W("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),f.addEventListener("message",this.onwmsg),f.onerror=function(h){a.trigger(R.Events.ERROR,{type:e.ErrorTypes.OTHER_ERROR,details:e.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(h.message+" ("+h.filename+":"+h.lineno+")")})},f.postMessage({cmd:"init",typeSupported:T,vendor:_,id:n,config:JSON.stringify(y)})}catch(h){N.logger.warn("Error in worker:",h),N.logger.error("Error while initializing DemuxerWorker, fallback to inline"),f&&self.URL.revokeObjectURL(f.objectURL),this.transmuxer=new K.default(this.observer,T,y,_,n),this.worker=null}}else this.transmuxer=new K.default(this.observer,T,y,_,n)}var l=i.prototype;return l.destroy=function(){var n=this.worker;if(n)n.removeEventListener("message",this.onwmsg),n.terminate(),this.worker=null;else{var r=this.transmuxer;r&&(r.destroy(),this.transmuxer=null)}var t=this.observer;t&&t.removeAllListeners(),this.observer=null},l.push=function(n,r,t,E,y,m,T,_,f,h){var o=this;f.transmuxing.start=self.performance.now();var u=this.transmuxer,b=this.worker,p=m?m.start:y.start,d=y.decryptdata,A=this.frag,D=!(A&&y.cc===A.cc),S=!(A&&f.level===A.level),L=A?f.sn-A.sn:-1,M=this.part?f.part-this.part.index:1,O=!S&&(L===1||L===0&&M===1),j=self.performance.now();(S||L||y.stats.parsing.start===0)&&(y.stats.parsing.start=j),m&&(M||!O)&&(m.stats.parsing.start=j);var G=new K.TransmuxState(D,O,_,S,p);if(!O||D){N.logger.log("[transmuxer-interface, "+y.type+"]: Starting new transmux session for sn: "+f.sn+" p: "+f.part+" level: "+f.level+" id: "+f.id+`
discontinuity: `+D+`
trackSwitch: `+S+`
contiguous: `+O+`
accurateTimeOffset: `+_+`
timeOffset: `+p);var X=new K.TransmuxConfig(t,E,r,T,h);this.configureTransmuxer(X)}if(this.frag=y,this.part=m,b)b.postMessage({cmd:"demux",data:n,decryptdata:d,chunkMeta:f,state:G},n instanceof ArrayBuffer?[n]:[]);else if(u){var te=u.push(n,d,f,G);Object(K.isPromise)(te)?te.then(function(fe){o.handleTransmuxComplete(fe)}):this.handleTransmuxComplete(te)}},l.flush=function(n){var r=this;n.transmuxing.start=self.performance.now();var t=this.transmuxer,E=this.worker;if(E)E.postMessage({cmd:"flush",chunkMeta:n});else if(t){var y=t.flush(n);Object(K.isPromise)(y)?y.then(function(m){r.handleFlushResult(m,n)}):this.handleFlushResult(y,n)}},l.handleFlushResult=function(n,r){var t=this;n.forEach(function(E){t.handleTransmuxComplete(E)}),this.onFlush(r)},l.onWorkerMessage=function(n){var r=n.data,t=this.hls;switch(r.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(r.data);break}case"flush":{this.onFlush(r.data);break}default:{r.data=r.data||{},r.data.frag=this.frag,r.data.id=this.id,t.trigger(r.event,r.data);break}}},l.configureTransmuxer=function(n){var r=this.worker,t=this.transmuxer;r?r.postMessage({cmd:"configure",config:n}):t&&t.configure(n)},l.handleTransmuxComplete=function(n){n.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(n)},i}()},"./src/demux/transmuxer-worker.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return e});var W=I("./src/demux/transmuxer.ts"),P=I("./src/events.ts"),R=I("./src/utils/logger.ts"),K=I("./node_modules/eventemitter3/index.js"),N=I.n(K);function e(s){var i=new K.EventEmitter,l=function(n,r){s.postMessage({event:n,data:r})};i.on(P.Events.FRAG_DECRYPTED,l),i.on(P.Events.ERROR,l),s.addEventListener("message",function(a){var n=a.data;switch(n.cmd){case"init":{var r=JSON.parse(n.config);s.transmuxer=new W.default(i,n.typeSupported,r,n.vendor,n.id),Object(R.enableLogs)(r.debug),l("init",null);break}case"configure":{s.transmuxer.configure(n.config);break}case"demux":{var t=s.transmuxer.push(n.data,n.decryptdata,n.chunkMeta,n.state);Object(W.isPromise)(t)?t.then(function(m){C(s,m)}):C(s,t);break}case"flush":{var E=n.chunkMeta,y=s.transmuxer.flush(E);Object(W.isPromise)(y)?y.then(function(m){v(s,m,E)}):v(s,y,E);break}default:break}})}function C(s,i){if(c(i.remuxResult))return;var l=[],a=i.remuxResult,n=a.audio,r=a.video;n&&g(l,n),r&&g(l,r),s.postMessage({event:"transmuxComplete",data:i},l)}function g(s,i){i.data1&&s.push(i.data1.buffer),i.data2&&s.push(i.data2.buffer)}function v(s,i,l){i.forEach(function(a){C(s,a)}),s.postMessage({event:"flush",data:l})}function c(s){return!s.audio&&!s.video&&!s.text&&!s.id3&&!s.initSegment}},"./src/demux/transmuxer.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return r}),I.d(H,"isPromise",function(){return y}),I.d(H,"TransmuxConfig",function(){return m}),I.d(H,"TransmuxState",function(){return T});var W=I("./src/events.ts"),P=I("./src/errors.ts"),R=I("./src/crypt/decrypter.ts"),K=I("./src/demux/aacdemuxer.ts"),N=I("./src/demux/mp4demuxer.ts"),e=I("./src/demux/tsdemuxer.ts"),C=I("./src/demux/mp3demuxer.ts"),g=I("./src/remux/mp4-remuxer.ts"),v=I("./src/remux/passthrough-remuxer.ts"),c=I("./src/demux/chunk-cache.ts"),s=I("./src/utils/mp4-tools.ts"),i=I("./src/utils/logger.ts"),l;try{l=self.performance.now.bind(self.performance)}catch(_){i.logger.debug("Unable to use Performance API on this environment"),l=self.Date.now}var a=[{demux:e.default,remux:g.default},{demux:N.default,remux:v.default},{demux:K.default,remux:g.default},{demux:C.default,remux:g.default}],n=1024;a.forEach(function(_){var f=_.demux;n=Math.max(n,f.minProbeByteLength)});var r=function(){function _(h,o,u,b,p){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=h,this.typeSupported=o,this.config=u,this.vendor=b,this.id=p}var f=_.prototype;return f.configure=function(o){this.transmuxConfig=o,this.decrypter&&this.decrypter.reset()},f.push=function(o,u,b,p){var d=this,A=b.transmuxing;A.executeStart=l();var D=new Uint8Array(o),S=this.cache,L=this.config,M=this.currentTransmuxState,O=this.transmuxConfig;p&&(this.currentTransmuxState=p);var j=t(D,u);if(j&&j.method==="AES-128"){var G=this.getDecrypter();if(L.enableSoftwareAES){var X=G.softwareDecrypt(D,j.key.buffer,j.iv.buffer);if(!X)return A.executeEnd=l(),E(b);D=new Uint8Array(X)}else return this.decryptionPromise=G.webCryptoDecrypt(D,j.key.buffer,j.iv.buffer).then(function(Re){var Ie=d.push(Re,null,b);return d.decryptionPromise=null,Ie}),this.decryptionPromise}var te=p||M,fe=te.contiguous,ve=te.discontinuity,he=te.trackSwitch,xe=te.accurateTimeOffset,Se=te.timeOffset,de=O.audioCodec,ie=O.videoCodec,Le=O.defaultInitPts,Ve=O.duration,Be=O.initSegmentData;if((ve||he)&&this.resetInitSegment(Be,de,ie,Ve),ve&&this.resetInitialTimestamp(Le),fe||this.resetContiguity(),this.needsProbing(D,ve,he)){if(S.dataLength){var je=S.flush();D=Object(s.appendUint8Array)(je,D)}this.configureTransmuxer(D,O)}var Ee=this.transmux(D,j,Se,xe,b),Te=this.currentTransmuxState;return Te.contiguous=!0,Te.discontinuity=!1,Te.trackSwitch=!1,A.executeEnd=l(),Ee},f.flush=function(o){var u=this,b=o.transmuxing;b.executeStart=l();var p=this.decrypter,d=this.cache,A=this.currentTransmuxState,D=this.decryptionPromise;if(D)return D.then(function(){return u.flush(o)});var S=[],L=A.timeOffset;if(p){var M=p.flush();M&&S.push(this.push(M,null,o))}var O=d.dataLength;d.reset();var j=this.demuxer,G=this.remuxer;if(!j||!G)return O>=n&&this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),b.executeEnd=l(),[E(o)];var X=j.flush(L);return y(X)?X.then(function(te){return u.flushRemux(S,te,o),S}):(this.flushRemux(S,X,o),S)},f.flushRemux=function(o,u,b){var p=u.audioTrack,d=u.avcTrack,A=u.id3Track,D=u.textTrack,S=this.currentTransmuxState,L=S.accurateTimeOffset,M=S.timeOffset;i.logger.log("[transmuxer.ts]: Flushed fragment "+b.sn+(b.part>-1?" p: "+b.part:"")+" of level "+b.level);var O=this.remuxer.remux(p,d,A,D,M,L,!0,this.id);o.push({remuxResult:O,chunkMeta:b}),b.transmuxing.executeEnd=l()},f.resetInitialTimestamp=function(o){var u=this.demuxer,b=this.remuxer;if(!u||!b)return;u.resetTimeStamp(o),b.resetTimeStamp(o)},f.resetContiguity=function(){var o=this.demuxer,u=this.remuxer;if(!o||!u)return;o.resetContiguity(),u.resetNextTimestamp()},f.resetInitSegment=function(o,u,b,p){var d=this.demuxer,A=this.remuxer;if(!d||!A)return;d.resetInitSegment(u,b,p),A.resetInitSegment(o,u,b)},f.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},f.transmux=function(o,u,b,p,d){var A;return u&&u.method==="SAMPLE-AES"?A=this.transmuxSampleAes(o,u,b,p,d):A=this.transmuxUnencrypted(o,b,p,d),A},f.transmuxUnencrypted=function(o,u,b,p){var d=this.demuxer.demux(o,u,!1,!this.config.progressive),A=d.audioTrack,D=d.avcTrack,S=d.id3Track,L=d.textTrack,M=this.remuxer.remux(A,D,S,L,u,b,!1,this.id);return{remuxResult:M,chunkMeta:p}},f.transmuxSampleAes=function(o,u,b,p,d){var A=this;return this.demuxer.demuxSampleAes(o,u,b).then(function(D){var S=A.remuxer.remux(D.audioTrack,D.avcTrack,D.id3Track,D.textTrack,b,p,!1,A.id);return{remuxResult:S,chunkMeta:d}})},f.configureTransmuxer=function(o,u){for(var b=this.config,p=this.observer,d=this.typeSupported,A=this.vendor,D=u.audioCodec,S=u.defaultInitPts,L=u.duration,M=u.initSegmentData,O=u.videoCodec,j,G=0,X=a.length;G<X;G++)if(a[G].demux.probe(o)){j=a[G];break}j||(i.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),j={demux:N.default,remux:v.default});var te=this.demuxer,fe=this.remuxer,ve=j.remux,he=j.demux;(!fe||!(fe instanceof ve))&&(this.remuxer=new ve(p,b,d,A)),(!te||!(te instanceof he))&&(this.demuxer=new he(p,b,d),this.probe=he.probe),this.resetInitSegment(M,D,O,L),this.resetInitialTimestamp(S)},f.needsProbing=function(o,u,b){return!this.demuxer||!this.remuxer||u||b},f.getDecrypter=function(){var o=this.decrypter;return o||(o=this.decrypter=new R.default(this.observer,this.config)),o},_}();function t(_,f){var h=null;return _.byteLength>0&&f!=null&&f.key!=null&&f.iv!==null&&f.method!=null&&(h=f),h}var E=function(f){return{remuxResult:{},chunkMeta:f}};function y(_){return"then"in _&&_.then instanceof Function}var m=function(f,h,o,u,b){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=f,this.videoCodec=h,this.initSegmentData=o,this.duration=u,this.defaultInitPts=b},T=function(f,h,o,u,b){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=f,this.contiguous=h,this.accurateTimeOffset=o,this.trackSwitch=u,this.timeOffset=b}},"./src/demux/tsdemuxer.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"discardEPB",function(){return E});var W=I("./src/demux/adts.ts"),P=I("./src/demux/mpegaudio.ts"),R=I("./src/demux/exp-golomb.ts"),K=I("./src/demux/id3.ts"),N=I("./src/demux/sample-aes.ts"),e=I("./src/events.ts"),C=I("./src/utils/mp4-tools.ts"),g=I("./src/utils/logger.ts"),v=I("./src/errors.ts"),c={video:1,audio:2,id3:3,text:4},s=function(){function y(T,_,f){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=T,this.config=_,this.typeSupported=f}y.probe=function(_){var f=y.syncOffset(_);return f<0?!1:(f&&g.logger.warn("MPEG2-TS detected but first sync word found @ offset "+f+", junk ahead ?"),!0)},y.syncOffset=function(_){for(var f=Math.min(1e3,_.length-3*188),h=0;h<f;){if(_[h]===71&&_[h+188]===71&&_[h+2*188]===71)return h;h++}return-1},y.createTrack=function(_,f){return{container:_==="video"||_==="audio"?"video/mp2t":void 0,type:_,id:c[_],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:_==="audio"?f:void 0}};var m=y.prototype;return m.resetInitSegment=function(_,f,h){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=y.createTrack("video",h),this._audioTrack=y.createTrack("audio",h),this._id3Track=y.createTrack("id3",h),this._txtTrack=y.createTrack("text",h),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=_,this.videoCodec=f,this._duration=h},m.resetTimeStamp=function(){},m.resetContiguity=function(){var _=this._audioTrack,f=this._avcTrack,h=this._id3Track;_&&(_.pesData=null),f&&(f.pesData=null),h&&(h.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},m.demux=function(_,f,h,o){h===void 0&&(h=!1),o===void 0&&(o=!1),h||(this.sampleAes=null);var u,b=this._avcTrack,p=this._audioTrack,d=this._id3Track,A=b.pid,D=b.pesData,S=p.pid,L=d.pid,M=p.pesData,O=d.pesData,j=!1,G=this.pmtParsed,X=this._pmtId,te=_.length;if(this.remainderData&&(_=Object(C.appendUint8Array)(this.remainderData,_),te=_.length,this.remainderData=null),te<188&&!o)return this.remainderData=_,{audioTrack:p,avcTrack:b,id3Track:d,textTrack:this._txtTrack};var fe=Math.max(0,y.syncOffset(_));te-=(te+fe)%188,te<_.byteLength&&!o&&(this.remainderData=new Uint8Array(_.buffer,te,_.buffer.byteLength-te));for(var ve=fe;ve<te;ve+=188)if(_[ve]===71){var he=!!(_[ve+1]&64),xe=((_[ve+1]&31)<<8)+_[ve+2],Se=(_[ve+3]&48)>>4,de=void 0;if(Se>1){if(de=ve+5+_[ve+4],de===ve+188)continue}else de=ve+4;switch(xe){case A:he&&(D&&(u=n(D))&&this.parseAVCPES(u,!1),D={data:[],size:0}),D&&(D.data.push(_.subarray(de,ve+188)),D.size+=ve+188-de);break;case S:he&&(M&&(u=n(M))&&(p.isAAC?this.parseAACPES(u):this.parseMPEGPES(u)),M={data:[],size:0}),M&&(M.data.push(_.subarray(de,ve+188)),M.size+=ve+188-de);break;case L:he&&(O&&(u=n(O))&&this.parseID3PES(u),O={data:[],size:0}),O&&(O.data.push(_.subarray(de,ve+188)),O.size+=ve+188-de);break;case 0:he&&(de+=_[de]+1),X=this._pmtId=l(_,de);break;case X:{he&&(de+=_[de]+1);var ie=a(_,de,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,h);A=ie.avc,A>0&&(b.pid=A),S=ie.audio,S>0&&(p.pid=S,p.isAAC=ie.isAAC),L=ie.id3,L>0&&(d.pid=L),j&&!G&&(g.logger.log("reparse from beginning"),j=!1,ve=fe-188),G=this.pmtParsed=!0;break}case 17:case 8191:break;default:j=!0;break}}else this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});b.pesData=D,p.pesData=M,d.pesData=O;var Le={audioTrack:p,avcTrack:b,id3Track:d,textTrack:this._txtTrack};return o&&this.extractRemainingSamples(Le),Le},m.flush=function(){var _=this.remainderData;this.remainderData=null;var f;return _?f=this.demux(_,-1,!1,!0):f={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(f),this.sampleAes?this.decrypt(f,this.sampleAes):f},m.extractRemainingSamples=function(_){var f=_.audioTrack,h=_.avcTrack,o=_.id3Track,u=h.pesData,b=f.pesData,p=o.pesData,d;u&&(d=n(u))?(this.parseAVCPES(d,!0),h.pesData=null):h.pesData=u,b&&(d=n(b))?(f.isAAC?this.parseAACPES(d):this.parseMPEGPES(d),f.pesData=null):(b!=null&&b.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),f.pesData=b),p&&(d=n(p))?(this.parseID3PES(d),o.pesData=null):o.pesData=p},m.demuxSampleAes=function(_,f,h){var o=this.demux(_,h,!0,!this.config.progressive),u=this.sampleAes=new N.default(this.observer,this.config,f);return this.decrypt(o,u)},m.decrypt=function(_,f){return new Promise(function(h){var o=_.audioTrack,u=_.avcTrack;o.samples&&o.isAAC?f.decryptAacSamples(o.samples,0,function(){u.samples?f.decryptAvcSamples(u.samples,0,0,function(){h(_)}):h(_)}):u.samples&&f.decryptAvcSamples(u.samples,0,0,function(){h(_)})})},m.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},m.parseAVCPES=function(_,f){var h=this,o=this._avcTrack,u=this.parseAVCNALu(_.data),b=!1,p=this.avcSample,d,A=!1;_.data=null,p&&u.length&&!o.audFound&&(r(p,o),p=this.avcSample=i(!1,_.pts,_.dts,"")),u.forEach(function(D){switch(D.type){case 1:{d=!0,p||(p=h.avcSample=i(!0,_.pts,_.dts,"")),b&&(p.debug+="NDR "),p.frame=!0;var S=D.data;if(A&&S.length>4){var L=new R.default(S).readSliceType();(L===2||L===4||L===7||L===9)&&(p.key=!0)}break}case 5:d=!0,p||(p=h.avcSample=i(!0,_.pts,_.dts,"")),b&&(p.debug+="IDR "),p.key=!0,p.frame=!0;break;case 6:{d=!0,b&&p&&(p.debug+="SEI ");var M=new R.default(E(D.data));M.readUByte();for(var O=0,j=0,G=!1,X=0;!G&&M.bytesAvailable>1;){O=0;do X=M.readUByte(),O+=X;while(X===255);j=0;do X=M.readUByte(),j+=X;while(X===255);if(O===4&&M.bytesAvailable!==0){G=!0;var te=M.readUByte();if(te===181){var fe=M.readUShort();if(fe===49){var ve=M.readUInt();if(ve===1195456820){var he=M.readUByte();if(he===3){for(var xe=M.readUByte(),Se=M.readUByte(),de=31&xe,ie=[xe,Se],Le=0;Le<de;Le++)ie.push(M.readUByte()),ie.push(M.readUByte()),ie.push(M.readUByte());t(h._txtTrack.samples,{type:3,pts:_.pts,bytes:ie})}}}}}else if(O===5&&M.bytesAvailable!==0){if(G=!0,j>16){for(var Ve=[],Be=0;Be<16;Be++)Ve.push(M.readUByte().toString(16)),(Be===3||Be===5||Be===7||Be===9)&&Ve.push("-");for(var je=j-16,Ee=new Uint8Array(je),Te=0;Te<je;Te++)Ee[Te]=M.readUByte();t(h._txtTrack.samples,{pts:_.pts,payloadType:O,uuid:Ve.join(""),userData:Object(K.utf8ArrayToStr)(Ee),userDataBytes:Ee})}}else if(j<M.bytesAvailable)for(var Re=0;Re<j;Re++)M.readUByte()}break}case 7:if(d=!0,A=!0,b&&p&&(p.debug+="SPS "),!o.sps){var Ie=new R.default(D.data),$=Ie.readSPS();o.width=$.width,o.height=$.height,o.pixelRatio=$.pixelRatio,o.sps=[D.data],o.duration=h._duration;for(var se=D.data.subarray(1,4),ue="avc1.",ce=0;ce<3;ce++){var _e=se[ce].toString(16);_e.length<2&&(_e="0"+_e),ue+=_e}o.codec=ue}break;case 8:d=!0,b&&p&&(p.debug+="PPS "),o.pps||(o.pps=[D.data]);break;case 9:d=!1,o.audFound=!0,p&&r(p,o),p=h.avcSample=i(!1,_.pts,_.dts,b?"AUD ":"");break;case 12:d=!1;break;default:d=!1,p&&(p.debug+="unknown NAL "+D.type+" ");break}if(p&&d){var De=p.units;De.push(D)}}),f&&p&&(r(p,o),this.avcSample=null)},m.getLastNalUnit=function(){var _,f=this.avcSample,h;if(!f||f.units.length===0){var o=this._avcTrack.samples;f=o[o.length-1]}if((_=f)!==null&&_!==void 0&&_.units){var u=f.units;h=u[u.length-1]}return h},m.parseAVCNALu=function(_){var f=_.byteLength,h=this._avcTrack,o=h.naluState||0,u=o,b=[],p=0,d,A,D,S=-1,L=0;for(o===-1&&(S=0,L=_[0]&31,o=0,p=1);p<f;){if(d=_[p++],!o){o=d?0:1;continue}if(o===1){o=d?0:2;continue}if(!d)o=3;else if(d===1){if(S>=0){var M={data:_.subarray(S,p-o-1),type:L};b.push(M)}else{var O=this.getLastNalUnit();if(O&&(u&&p<=4-u&&(O.state&&(O.data=O.data.subarray(0,O.data.byteLength-u))),A=p-o-1,A>0)){var j=new Uint8Array(O.data.byteLength+A);j.set(O.data,0),j.set(_.subarray(0,A),O.data.byteLength),O.data=j,O.state=0}}p<f?(D=_[p]&31,S=p,L=D,o=0):o=-1}else o=0}if(S>=0&&o>=0){var G={data:_.subarray(S,f),type:L,state:o};b.push(G)}if(b.length===0){var X=this.getLastNalUnit();if(X){var te=new Uint8Array(X.data.byteLength+_.byteLength);te.set(X.data,0),te.set(_,X.data.byteLength),X.data=te}}return h.naluState=o,b},m.parseAACPES=function(_){var f=0,h=this._audioTrack,o=this.aacOverFlow,u=_.data;if(o){this.aacOverFlow=null;var b=o.sample.unit.byteLength,p=Math.min(o.missing,b),d=b-p;o.sample.unit.set(u.subarray(0,p),d),h.samples.push(o.sample),f=o.missing}var A,D;for(A=f,D=u.length;A<D-1&&!W.isHeader(u,A);A++);if(A!==f){var S,L;if(A<D-1?(S="AAC PES did not start with ADTS header,offset:"+A,L=!1):(S="no ADTS header found in AAC PES",L=!0),g.logger.warn("parsing error:"+S),this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.FRAG_PARSING_ERROR,fatal:L,reason:S}),L)return}W.initTrackConfig(h,this.observer,u,A,this.audioCodec);var M;if(_.pts!==void 0)M=_.pts;else if(o){var O=W.getFrameDuration(h.samplerate);M=o.sample.pts+O}else{g.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var j=0;A<D;)if(W.isHeader(u,A)){if(A+5<D){var G=W.appendFrame(h,u,A,M,j);if(G)if(G.missing)this.aacOverFlow=G;else{A+=G.length,j++;continue}}break}else A++},m.parseMPEGPES=function(_){var f=_.data,h=f.length,o=0,u=0,b=_.pts;if(b===void 0){g.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;u<h;)if(P.isHeader(f,u)){var p=P.appendFrame(this._audioTrack,f,u,b,o);if(p)u+=p.length,o++;else break}else u++},m.parseID3PES=function(_){if(_.pts===void 0){g.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(_)},y}();s.minProbeByteLength=188;function i(y,m,T,_){return{key:y,frame:!1,pts:m,dts:T,units:[],debug:_,length:0}}function l(y,m){return(y[m+10]&31)<<8|y[m+11]}function a(y,m,T,_){var f={audio:-1,avc:-1,id3:-1,isAAC:!0},h=(y[m+1]&15)<<8|y[m+2],o=m+3+h-4,u=(y[m+10]&15)<<8|y[m+11];for(m+=12+u;m<o;){var b=(y[m+1]&31)<<8|y[m+2];switch(y[m]){case 207:if(!_){g.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:f.audio===-1&&(f.audio=b);break;case 21:f.id3===-1&&(f.id3=b);break;case 219:if(!_){g.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:f.avc===-1&&(f.avc=b);break;case 3:case 4:T?f.audio===-1&&(f.audio=b,f.isAAC=!1):g.logger.log("MPEG audio found, not supported in this browser");break;case 36:g.logger.warn("Unsupported HEVC stream type found");break;default:break}m+=((y[m+3]&15)<<8|y[m+4])+5}return f}function n(y){var m=0,T,_,f,h,o,u=y.data;if(!y||y.size===0)return null;for(;u[0].length<19&&u.length>1;){var b=new Uint8Array(u[0].length+u[1].length);b.set(u[0]),b.set(u[1],u[0].length),u[0]=b,u.splice(1,1)}T=u[0];var p=(T[0]<<16)+(T[1]<<8)+T[2];if(p===1){if(_=(T[4]<<8)+T[5],_&&_>y.size-6)return null;var d=T[7];d&192&&(h=(T[9]&14)*536870912+(T[10]&255)*4194304+(T[11]&254)*16384+(T[12]&255)*128+(T[13]&254)/2,d&64?(o=(T[14]&14)*536870912+(T[15]&255)*4194304+(T[16]&254)*16384+(T[17]&255)*128+(T[18]&254)/2,h-o>60*9e4&&(g.logger.warn(Math.round((h-o)/9e4)+"s delta between PTS and DTS, align them"),h=o)):o=h),f=T[8];var A=f+9;if(y.size<=A)return null;y.size-=A;for(var D=new Uint8Array(y.size),S=0,L=u.length;S<L;S++){T=u[S];var M=T.byteLength;if(A)if(A>M){A-=M;continue}else T=T.subarray(A),M-=A,A=0;D.set(T,m),m+=M}return _&&(_-=f+3),{data:D,pts:h,dts:o,len:_}}return null}function r(y,m){if(y.units.length&&y.frame){if(y.pts===void 0){var T=m.samples,_=T.length;if(_){var f=T[_-1];y.pts=f.pts,y.dts=f.dts}else{m.dropped++;return}}m.samples.push(y)}y.debug.length&&g.logger.log(y.pts+"/"+y.dts+":"+y.debug)}function t(y,m){var T=y.length;if(T>0){if(m.pts>=y[T-1].pts)y.push(m);else for(var _=T-1;_>=0;_--)if(m.pts<y[_].pts){y.splice(_,0,m);break}}else y.push(m)}function E(y){for(var m=y.byteLength,T=[],_=1;_<m-2;)y[_]===0&&y[_+1]===0&&y[_+2]===3?(T.push(_+2),_+=2):_++;if(T.length===0)return y;var f=m-T.length,h=new Uint8Array(f),o=0;for(_=0;_<f;o++,_++)o===T[0]&&(o++,T.shift()),h[_]=y[o];return h}H.default=s},"./src/errors.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"ErrorTypes",function(){return W}),I.d(H,"ErrorDetails",function(){return P});var W;(function(R){R.NETWORK_ERROR="networkError",R.MEDIA_ERROR="mediaError",R.KEY_SYSTEM_ERROR="keySystemError",R.MUX_ERROR="muxError",R.OTHER_ERROR="otherError"})(W||(W={}));var P;(function(R){R.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",R.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",R.KEY_SYSTEM_NO_SESSION="keySystemNoSession",R.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",R.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",R.MANIFEST_LOAD_ERROR="manifestLoadError",R.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",R.MANIFEST_PARSING_ERROR="manifestParsingError",R.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",R.LEVEL_EMPTY_ERROR="levelEmptyError",R.LEVEL_LOAD_ERROR="levelLoadError",R.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",R.LEVEL_SWITCH_ERROR="levelSwitchError",R.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",R.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",R.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",R.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",R.FRAG_LOAD_ERROR="fragLoadError",R.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",R.FRAG_DECRYPT_ERROR="fragDecryptError",R.FRAG_PARSING_ERROR="fragParsingError",R.REMUX_ALLOC_ERROR="remuxAllocError",R.KEY_LOAD_ERROR="keyLoadError",R.KEY_LOAD_TIMEOUT="keyLoadTimeOut",R.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",R.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",R.BUFFER_APPEND_ERROR="bufferAppendError",R.BUFFER_APPENDING_ERROR="bufferAppendingError",R.BUFFER_STALLED_ERROR="bufferStalledError",R.BUFFER_FULL_ERROR="bufferFullError",R.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",R.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",R.INTERNAL_EXCEPTION="internalException",R.INTERNAL_ABORTED="aborted",R.UNKNOWN="unknown"})(P||(P={}))},"./src/events.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"Events",function(){return W});var W;(function(P){P.MEDIA_ATTACHING="hlsMediaAttaching",P.MEDIA_ATTACHED="hlsMediaAttached",P.MEDIA_DETACHING="hlsMediaDetaching",P.MEDIA_DETACHED="hlsMediaDetached",P.BUFFER_RESET="hlsBufferReset",P.BUFFER_CODECS="hlsBufferCodecs",P.BUFFER_CREATED="hlsBufferCreated",P.BUFFER_APPENDING="hlsBufferAppending",P.BUFFER_APPENDED="hlsBufferAppended",P.BUFFER_EOS="hlsBufferEos",P.BUFFER_FLUSHING="hlsBufferFlushing",P.BUFFER_FLUSHED="hlsBufferFlushed",P.MANIFEST_LOADING="hlsManifestLoading",P.MANIFEST_LOADED="hlsManifestLoaded",P.MANIFEST_PARSED="hlsManifestParsed",P.LEVEL_SWITCHING="hlsLevelSwitching",P.LEVEL_SWITCHED="hlsLevelSwitched",P.LEVEL_LOADING="hlsLevelLoading",P.LEVEL_LOADED="hlsLevelLoaded",P.LEVEL_UPDATED="hlsLevelUpdated",P.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",P.LEVELS_UPDATED="hlsLevelsUpdated",P.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",P.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",P.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",P.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",P.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",P.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",P.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",P.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",P.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",P.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",P.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",P.CUES_PARSED="hlsCuesParsed",P.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",P.INIT_PTS_FOUND="hlsInitPtsFound",P.FRAG_LOADING="hlsFragLoading",P.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",P.FRAG_LOADED="hlsFragLoaded",P.FRAG_DECRYPTED="hlsFragDecrypted",P.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",P.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",P.FRAG_PARSING_METADATA="hlsFragParsingMetadata",P.FRAG_PARSED="hlsFragParsed",P.FRAG_BUFFERED="hlsFragBuffered",P.FRAG_CHANGED="hlsFragChanged",P.FPS_DROP="hlsFpsDrop",P.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",P.ERROR="hlsError",P.DESTROYING="hlsDestroying",P.KEY_LOADING="hlsKeyLoading",P.KEY_LOADED="hlsKeyLoaded",P.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",P.BACK_BUFFER_REACHED="hlsBackBufferReached"})(W||(W={}))},"./src/hls.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return y});var W=I("./node_modules/url-toolkit/src/url-toolkit.js"),P=I.n(W),R=I("./src/loader/playlist-loader.ts"),K=I("./src/loader/key-loader.ts"),N=I("./src/controller/id3-track-controller.ts"),e=I("./src/controller/latency-controller.ts"),C=I("./src/controller/level-controller.ts"),g=I("./src/controller/fragment-tracker.ts"),v=I("./src/controller/stream-controller.ts"),c=I("./src/is-supported.ts"),s=I("./src/utils/logger.ts"),i=I("./src/config.ts"),l=I("./node_modules/eventemitter3/index.js"),a=I.n(l),n=I("./src/events.ts"),r=I("./src/errors.ts");function t(m,T){for(var _=0;_<T.length;_++){var f=T[_];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(m,f.key,f)}}function E(m,T,_){return T&&t(m.prototype,T),_&&t(m,_),m}var y=function(){m.isSupported=function(){return Object(c.isSupported)()};function m(_){_===void 0&&(_={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new l.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 f=this.config=Object(i.mergeConfig)(m.DefaultConfig,_);this.userConfig=_,Object(s.enableLogs)(f.debug),this._autoLevelCapping=-1,f.progressive&&Object(i.enableStreamingMode)(f);var h=f.abrController,o=f.bufferController,u=f.capLevelController,b=f.fpsController,p=this.abrController=new h(this),d=this.bufferController=new o(this),A=this.capLevelController=new u(this),D=new b(this),S=new R.default(this),L=new K.default(this),M=new N.default(this),O=this.levelController=new C.default(this),j=new g.FragmentTracker(this),G=this.streamController=new v.default(this,j);A.setStreamController(G),D.setStreamController(G);var X=[O,G];this.networkControllers=X;var te=[S,L,p,d,A,D,M,j];this.audioTrackController=this.createController(f.audioTrackController,null,X),this.createController(f.audioStreamController,j,X),this.subtitleTrackController=this.createController(f.subtitleTrackController,null,X),this.createController(f.subtitleStreamController,j,X),this.createController(f.timelineController,null,te),this.emeController=this.createController(f.emeController,null,te),this.cmcdController=this.createController(f.cmcdController,null,te),this.latencyController=this.createController(e.default,null,te),this.coreComponents=te}var T=m.prototype;return T.createController=function(f,h,o){if(f){var u=h?new f(this,h):new f(this);return o&&o.push(u),u}return null},T.on=function(f,h,o){o===void 0&&(o=this),this._emitter.on(f,h,o)},T.once=function(f,h,o){o===void 0&&(o=this),this._emitter.once(f,h,o)},T.removeAllListeners=function(f){this._emitter.removeAllListeners(f)},T.off=function(f,h,o,u){o===void 0&&(o=this),this._emitter.off(f,h,o,u)},T.listeners=function(f){return this._emitter.listeners(f)},T.emit=function(f,h,o){return this._emitter.emit(f,h,o)},T.trigger=function(f,h){if(this.config.debug)return this.emit(f,f,h);try{return this.emit(f,f,h)}catch(o){s.logger.error("An internal error happened while handling event "+f+'. Error message: "'+o.message+'". Here is a stacktrace:',o),this.trigger(n.Events.ERROR,{type:r.ErrorTypes.OTHER_ERROR,details:r.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:f,error:o})}return!1},T.listenerCount=function(f){return this._emitter.listenerCount(f)},T.destroy=function(){s.logger.log("destroy"),this.trigger(n.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(f){return f.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(f){return f.destroy()}),this.coreComponents.length=0},T.attachMedia=function(f){s.logger.log("attachMedia"),this._media=f,this.trigger(n.Events.MEDIA_ATTACHING,{media:f})},T.detachMedia=function(){s.logger.log("detachMedia"),this.trigger(n.Events.MEDIA_DETACHING,void 0),this._media=null},T.loadSource=function(f){this.stopLoad();var h=this.media,o=this.url,u=this.url=W.buildAbsoluteURL(self.location.href,f,{alwaysNormalize:!0});s.logger.log("loadSource:"+u),h&&o&&o!==u&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(h)),this.trigger(n.Events.MANIFEST_LOADING,{url:f})},T.startLoad=function(f){f===void 0&&(f=-1),s.logger.log("startLoad("+f+")"),this.networkControllers.forEach(function(h){h.startLoad(f)})},T.stopLoad=function(){s.logger.log("stopLoad"),this.networkControllers.forEach(function(f){f.stopLoad()})},T.swapAudioCodec=function(){s.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},T.recoverMediaError=function(){s.logger.log("recoverMediaError");var f=this._media;this.detachMedia(),f&&this.attachMedia(f)},T.removeLevel=function(f,h){h===void 0&&(h=0),this.levelController.removeLevel(f,h)},E(m,[{key:"levels",get:function(){var f=this.levelController.levels;return f||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(f){s.logger.log("set currentLevel:"+f),this.loadLevel=f,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(f){s.logger.log("set nextLevel:"+f),this.levelController.manualLevel=f,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(f){s.logger.log("set loadLevel:"+f),this.levelController.manualLevel=f}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(f){this.levelController.nextLoadLevel=f}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(f){s.logger.log("set firstLevel:"+f),this.levelController.firstLevel=f}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(f){s.logger.log("set startLevel:"+f),f!==-1&&(f=Math.max(f,this.minAutoLevel)),this.levelController.startLevel=f}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(f){var h=!!f;h!==this.config.capLevelToPlayerSize&&(h?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=h)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(f){this._autoLevelCapping!==f&&(s.logger.log("set autoLevelCapping:"+f),this._autoLevelCapping=f)}},{key:"bandwidthEstimate",get:function(){var f=this.abrController.bwEstimator;return f?f.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var f=this.levels,h=this.config.minAutoBitrate;if(!f)return 0;for(var o=f.length,u=0;u<o;u++)if(f[u].maxBitrate>h)return u;return 0}},{key:"maxAutoLevel",get:function(){var f=this.levels,h=this.autoLevelCapping,o;return h===-1&&f&&f.length?o=f.length-1:o=h,o}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(f){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,f)}},{key:"audioTracks",get:function(){var f=this.audioTrackController;return f?f.audioTracks:[]}},{key:"audioTrack",get:function(){var f=this.audioTrackController;return f?f.audioTrack:-1},set:function(f){var h=this.audioTrackController;h&&(h.audioTrack=f)}},{key:"subtitleTracks",get:function(){var f=this.subtitleTrackController;return f?f.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var f=this.subtitleTrackController;return f?f.subtitleTrack:-1},set:function(f){var h=this.subtitleTrackController;h&&(h.subtitleTrack=f)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var f=this.subtitleTrackController;return f?f.subtitleDisplay:!1},set:function(f){var h=this.subtitleTrackController;h&&(h.subtitleDisplay=f)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(f){this.config.lowLatencyMode=f}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return n.Events}},{key:"ErrorTypes",get:function(){return r.ErrorTypes}},{key:"ErrorDetails",get:function(){return r.ErrorDetails}},{key:"DefaultConfig",get:function(){return m.defaultConfig?m.defaultConfig:i.hlsDefaultConfig},set:function(f){m.defaultConfig=f}}]),m}();y.defaultConfig=void 0},"./src/is-supported.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"isSupported",function(){return R}),I.d(H,"changeTypeSupported",function(){return K});var W=I("./src/utils/mediasource-helper.ts");function P(){return self.SourceBuffer||self.WebKitSourceBuffer}function R(){var N=Object(W.getMediaSource)();if(!N)return!1;var e=P(),C=N&&typeof N.isTypeSupported=="function"&&N.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),g=!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function";return!!C&&!!g}function K(){var N,e=P();return typeof(e==null||((N=e.prototype)===null||N===void 0)?void 0:N.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return s}),I.d(H,"LoadError",function(){return l});var W=I("./src/polyfills/number.ts"),P=I("./src/errors.ts");function R(a,n){a.prototype=Object.create(n.prototype),a.prototype.constructor=a,g(a,n)}function K(a){var n=typeof Map=="function"?new Map:void 0;return K=function(t){if(t===null||!C(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n!="undefined"){if(n.has(t))return n.get(t);n.set(t,E)}function E(){return N(t,arguments,v(this).constructor)}return E.prototype=Object.create(t.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),g(E,t)},K(a)}function N(a,n,r){return e()?N=Reflect.construct:N=function(E,y,m){var T=[null];T.push.apply(T,y);var _=Function.bind.apply(E,T),f=new _;return m&&g(f,m.prototype),f},N.apply(null,arguments)}function e(){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 C(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function g(a,n){return g=Object.setPrototypeOf||function(t,E){return t.__proto__=E,t},g(a,n)}function v(a){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},v(a)}var c=Math.pow(2,17),s=function(){function a(r){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=r}var n=a.prototype;return n.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},n.abort=function(){this.loader&&this.loader.abort()},n.load=function(t,E){var y=this,m=t.url;if(!m)return Promise.reject(new l({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,networkDetails:null},"Fragment does not have a "+(m?"part list":"url")));this.abort();var T=this.config,_=T.fLoader,f=T.loader;return new Promise(function(h,o){y.loader&&y.loader.destroy();var u=y.loader=t.loader=_?new _(T):new f(T),b=i(t),p={timeout:T.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:T.fragLoadingMaxRetryTimeout,highWaterMark:c};t.stats=u.stats,u.load(b,p,{onSuccess:function(A,D,S,L){y.resetLoader(t,u),h({frag:t,part:null,payload:A.data,networkDetails:L})},onError:function(A,D,S){y.resetLoader(t,u),o(new l({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:A,networkDetails:S}))},onAbort:function(A,D,S){y.resetLoader(t,u),o(new l({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,networkDetails:S}))},onTimeout:function(A,D,S){y.resetLoader(t,u),o(new l({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,networkDetails:S}))},onProgress:function(A,D,S,L){E&&E({frag:t,part:null,payload:S,networkDetails:L})}})})},n.loadPart=function(t,E,y){var m=this;this.abort();var T=this.config,_=T.fLoader,f=T.loader;return new Promise(function(h,o){m.loader&&m.loader.destroy();var u=m.loader=t.loader=_?new _(T):new f(T),b=i(t,E),p={timeout:T.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:T.fragLoadingMaxRetryTimeout,highWaterMark:c};E.stats=u.stats,u.load(b,p,{onSuccess:function(A,D,S,L){m.resetLoader(t,u),m.updateStatsFromPart(t,E);var M={frag:t,part:E,payload:A.data,networkDetails:L};y(M),h(M)},onError:function(A,D,S){m.resetLoader(t,u),o(new l({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:E,response:A,networkDetails:S}))},onAbort:function(A,D,S){t.stats.aborted=E.stats.aborted,m.resetLoader(t,u),o(new l({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,part:E,networkDetails:S}))},onTimeout:function(A,D,S){m.resetLoader(t,u),o(new l({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:E,networkDetails:S}))}})})},n.updateStatsFromPart=function(t,E){var y=t.stats,m=E.stats,T=m.total;if(y.loaded+=m.loaded,T){var _=Math.round(t.duration/E.duration),f=Math.min(Math.round(y.loaded/T),_),h=_-f,o=h*Math.round(y.loaded/f);y.total=y.loaded+o}else y.total=Math.max(y.loaded,y.total);var u=y.loading,b=m.loading;u.start?u.first+=b.first-b.start:(u.start=b.start,u.first=b.first),u.end=b.end},n.resetLoader=function(t,E){t.loader=null,this.loader===E&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),E.destroy()},a}();function i(a,n){n===void 0&&(n=null);var r=n||a,t={frag:a,part:n,responseType:"arraybuffer",url:r.url,headers:{},rangeStart:0,rangeEnd:0},E=r.byteRangeStartOffset,y=r.byteRangeEndOffset;return Object(W.isFiniteNumber)(E)&&Object(W.isFiniteNumber)(y)&&(t.rangeStart=E,t.rangeEnd=y),t}var l=function(a){R(n,a);function n(r){for(var t,E=arguments.length,y=new Array(E>1?E-1:0),m=1;m<E;m++)y[m-1]=arguments[m];return t=a.call.apply(a,[this].concat(y))||this,t.data=void 0,t.data=r,t}return n}(K(Error))},"./src/loader/fragment.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"ElementaryStreamTypes",function(){return s}),I.d(H,"BaseSegment",function(){return i}),I.d(H,"Fragment",function(){return l}),I.d(H,"Part",function(){return a});var W=I("./src/polyfills/number.ts"),P=I("./node_modules/url-toolkit/src/url-toolkit.js"),R=I.n(P),K=I("./src/utils/logger.ts"),N=I("./src/loader/level-key.ts"),e=I("./src/loader/load-stats.ts");function C(n,r){n.prototype=Object.create(r.prototype),n.prototype.constructor=n,g(n,r)}function g(n,r){return g=Object.setPrototypeOf||function(E,y){return E.__proto__=y,E},g(n,r)}function v(n,r){for(var t=0;t<r.length;t++){var E=r[t];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(n,E.key,E)}}function c(n,r,t){return r&&v(n.prototype,r),t&&v(n,t),n}var s;(function(n){n.AUDIO="audio",n.VIDEO="video",n.AUDIOVIDEO="audiovideo"})(s||(s={}));var i=function(){function n(t){var E;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(E={},E[s.AUDIO]=null,E[s.VIDEO]=null,E[s.AUDIOVIDEO]=null,E),this.baseurl=t}var r=n.prototype;return r.setByteRange=function(E,y){var m=E.split("@",2),T=[];m.length===1?T[0]=y?y.byteRangeEndOffset:0:T[0]=parseInt(m[1]),T[1]=parseInt(m[0])+T[0],this._byteRange=T},c(n,[{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(P.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(E){this._url=E}}]),n}(),l=function(n){C(r,n);function r(E,y){var m;return m=n.call(this,y)||this,m._decryptdata=null,m.rawProgramDateTime=null,m.programDateTime=null,m.tagList=[],m.duration=0,m.sn=0,m.levelkey=void 0,m.type=void 0,m.loader=null,m.level=-1,m.cc=0,m.startPTS=void 0,m.endPTS=void 0,m.appendedPTS=void 0,m.startDTS=void 0,m.endDTS=void 0,m.start=0,m.deltaPTS=void 0,m.maxStartPTS=void 0,m.minEndPTS=void 0,m.stats=new e.LoadStats,m.urlId=0,m.data=void 0,m.bitrateTest=!1,m.title=null,m.initSegment=null,m.type=E,m}var t=r.prototype;return t.createInitializationVector=function(y){for(var m=new Uint8Array(16),T=12;T<16;T++)m[T]=y>>8*(15-T)&255;return m},t.setDecryptDataFromLevelKey=function(y,m){var T=y;return(y==null?void 0:y.method)==="AES-128"&&y.uri&&!y.iv&&(T=N.LevelKey.fromURI(y.uri),T.method=y.method,T.iv=this.createInitializationVector(m),T.keyFormat="identity"),T},t.setElementaryStreamInfo=function(y,m,T,_,f,h){h===void 0&&(h=!1);var o=this.elementaryStreams,u=o[y];if(!u){o[y]={startPTS:m,endPTS:T,startDTS:_,endDTS:f,partial:h};return}u.startPTS=Math.min(u.startPTS,m),u.endPTS=Math.max(u.endPTS,T),u.startDTS=Math.min(u.startDTS,_),u.endDTS=Math.max(u.endDTS,f)},t.clearElementaryStreamInfo=function(){var y=this.elementaryStreams;y[s.AUDIO]=null,y[s.VIDEO]=null,y[s.AUDIOVIDEO]=null},c(r,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var y=this.sn;typeof y!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&K.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),y=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,y)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(W.isFiniteNumber)(this.programDateTime))return null;var y=Object(W.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+y*1e3}},{key:"encrypted",get:function(){var y;return!!((y=this.decryptdata)!==null&&y!==void 0&&y.keyFormat&&this.decryptdata.uri)}}]),r}(i),a=function(n){C(r,n);function r(t,E,y,m,T){var _;_=n.call(this,y)||this,_.fragOffset=0,_.duration=0,_.gap=!1,_.independent=!1,_.relurl=void 0,_.fragment=void 0,_.index=void 0,_.stats=new e.LoadStats,_.duration=t.decimalFloatingPoint("DURATION"),_.gap=t.bool("GAP"),_.independent=t.bool("INDEPENDENT"),_.relurl=t.enumeratedString("URI"),_.fragment=E,_.index=m;var f=t.enumeratedString("BYTERANGE");return f&&_.setByteRange(f,T),T&&(_.fragOffset=T.fragOffset+T.duration),_}return c(r,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var E=this.elementaryStreams;return!!(E.audio||E.video||E.audiovideo)}}]),r}(i)},"./src/loader/key-loader.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return K});var W=I("./src/events.ts"),P=I("./src/errors.ts"),R=I("./src/utils/logger.ts"),K=function(){function N(C){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=C,this._registerListeners()}var e=N.prototype;return e._registerListeners=function(){this.hls.on(W.Events.KEY_LOADING,this.onKeyLoading,this)},e._unregisterListeners=function(){this.hls.off(W.Events.KEY_LOADING,this.onKeyLoading)},e.destroy=function(){this._unregisterListeners();for(var g in this.loaders){var v=this.loaders[g];v&&v.destroy()}this.loaders={}},e.onKeyLoading=function(g,v){var c=v.frag,s=c.type,i=this.loaders[s];if(!c.decryptdata){R.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var l=c.decryptdata.uri;if(l!==this.decrypturl||this.decryptkey===null){var a=this.hls.config;if(i&&(R.logger.warn("abort previous key loader for type:"+s),i.abort()),!l){R.logger.warn("key uri is falsy");return}var n=a.loader,r=c.loader=this.loaders[s]=new n(a);this.decrypturl=l,this.decryptkey=null;var t={url:l,frag:c,responseType:"arraybuffer"},E={timeout:a.fragLoadingTimeOut,maxRetry:0,retryDelay:a.fragLoadingRetryDelay,maxRetryDelay:a.fragLoadingMaxRetryTimeout,highWaterMark:0},y={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};r.load(t,E,y)}else this.decryptkey&&(c.decryptdata.key=this.decryptkey,this.hls.trigger(W.Events.KEY_LOADED,{frag:c}))},e.loadsuccess=function(g,v,c){var s=c.frag;if(!s.decryptdata){R.logger.error("after key load, decryptdata unset");return}this.decryptkey=s.decryptdata.key=new Uint8Array(g.data),s.loader=null,delete this.loaders[s.type],this.hls.trigger(W.Events.KEY_LOADED,{frag:s})},e.loaderror=function(g,v){var c=v.frag,s=c.loader;s&&s.abort(),delete this.loaders[c.type],this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:c,response:g})},e.loadtimeout=function(g,v){var c=v.frag,s=c.loader;s&&s.abort(),delete this.loaders[c.type],this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:c})},N}()},"./src/loader/level-details.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"LevelDetails",function(){return N});var W=I("./src/polyfills/number.ts");function P(e,C){for(var g=0;g<C.length;g++){var v=C[g];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(e,v.key,v)}}function R(e,C,g){return C&&P(e.prototype,C),g&&P(e,g),e}var K=10,N=function(){function e(g){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=g}var C=e.prototype;return C.reloaded=function(v){if(!v){this.advanced=!0,this.updated=!0;return}var c=this.lastPartSn-v.lastPartSn,s=this.lastPartIndex-v.lastPartIndex;this.updated=this.endSN!==v.endSN||!!s||!!c,this.advanced=this.endSN>v.endSN||c>0||c===0&&s>0,this.updated||this.advanced?this.misses=Math.floor(v.misses*.6):this.misses=v.misses+1,this.availabilityDelay=v.availabilityDelay},R(e,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(W.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||K}},{key:"drift",get:function(){var v=this.driftEndTime-this.driftStartTime;if(v>0){var c=this.driftEnd-this.driftStart;return c*1e3/v}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var v;return(v=this.partList)!==null&&v!==void 0&&v.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var v;return(v=this.fragments)!==null&&v!==void 0&&v.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 v;return(v=this.partList)!==null&&v!==void 0&&v.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var v;return(v=this.partList)!==null&&v!==void 0&&v.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),e}()},"./src/loader/level-key.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"LevelKey",function(){return N});var W=I("./node_modules/url-toolkit/src/url-toolkit.js"),P=I.n(W);function R(e,C){for(var g=0;g<C.length;g++){var v=C[g];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(e,v.key,v)}}function K(e,C,g){return C&&R(e.prototype,C),g&&R(e,g),e}var N=function(){e.fromURL=function(g,v){return new e(g,v)},e.fromURI=function(g){return new e(g)};function e(C,g){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,g?this._uri=Object(W.buildAbsoluteURL)(C,g,{alwaysNormalize:!0}):this._uri=C}return K(e,[{key:"uri",get:function(){return this._uri}}]),e}()},"./src/loader/load-stats.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"LoadStats",function(){return W});var W=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return r});var W=I("./src/polyfills/number.ts"),P=I("./node_modules/url-toolkit/src/url-toolkit.js"),R=I.n(P),K=I("./src/loader/fragment.ts"),N=I("./src/loader/level-details.ts"),e=I("./src/loader/level-key.ts"),C=I("./src/utils/attr-list.ts"),g=I("./src/utils/logger.ts"),v=I("./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,s=/#EXT-X-MEDIA:(.*)/g,i=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),l=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 n(T){var _,f;return a.test((_=(f=P.parseURL(T))===null||f===void 0?void 0:f.path)!=null?_:"")}var r=function(){function T(){}return T.findGroup=function(f,h){for(var o=0;o<f.length;o++){var u=f[o];if(u.id===h)return u}},T.convertAVC1ToAVCOTI=function(f){var h=f.split(".");if(h.length>2){var o=h.shift()+".";return o+=parseInt(h.shift()).toString(16),o+=("000"+parseInt(h.shift()).toString(16)).substr(-4),o}return f},T.resolve=function(f,h){return P.buildAbsoluteURL(h,f,{alwaysNormalize:!0})},T.parseMasterPlaylist=function(f,h){var o=[],u={},b=!1;c.lastIndex=0;for(var p;(p=c.exec(f))!=null;)if(p[1]){var d=new C.AttrList(p[1]),A={attrs:d,bitrate:d.decimalInteger("AVERAGE-BANDWIDTH")||d.decimalInteger("BANDWIDTH"),name:d.NAME,url:T.resolve(p[2],h)},D=d.decimalResolution("RESOLUTION");D&&(A.width=D.width,A.height=D.height),t((d.CODECS||"").split(/[ ,]+/).filter(function(L){return L}),A),A.videoCodec&&A.videoCodec.indexOf("avc1")!==-1&&(A.videoCodec=T.convertAVC1ToAVCOTI(A.videoCodec)),o.push(A)}else if(p[3]){var S=new C.AttrList(p[3]);S["DATA-ID"]&&(b=!0,u[S["DATA-ID"]]=S)}return{levels:o,sessionData:b?u:null}},T.parseMasterPlaylistMedia=function(f,h,o,u){u===void 0&&(u=[]);var b,p=[],d=0;for(s.lastIndex=0;(b=s.exec(f))!==null;){var A=new C.AttrList(b[1]);if(A.TYPE===o){var D={attrs:A,bitrate:0,id:d++,groupId:A["GROUP-ID"],instreamId:A["INSTREAM-ID"],name:A.NAME||A.LANGUAGE||"",type:o,default:A.bool("DEFAULT"),autoselect:A.bool("AUTOSELECT"),forced:A.bool("FORCED"),lang:A.LANGUAGE,url:A.URI?T.resolve(A.URI,h):""};if(u.length){var S=T.findGroup(u,D.groupId)||u[0];E(D,S,"audioCodec"),E(D,S,"textCodec")}p.push(D)}}return p},T.parseLevelPlaylist=function(f,h,o,u,b){var p=new N.LevelDetails(h),d=p.fragments,A=null,D=0,S=0,L=0,M=0,O=null,j=new K.Fragment(u,h),G,X,te,fe=-1,ve=!1;for(i.lastIndex=0,p.m3u8=f;(G=i.exec(f))!==null;){ve&&(ve=!1,j=new K.Fragment(u,h),j.start=L,j.sn=D,j.cc=M,j.level=o,A&&(j.initSegment=A,j.rawProgramDateTime=A.rawProgramDateTime));var he=G[1];if(he){j.duration=parseFloat(he);var xe=(" "+G[2]).slice(1);j.title=xe||null,j.tagList.push(xe?["INF",he,xe]:["INF",he])}else if(G[3])Object(W.isFiniteNumber)(j.duration)&&(j.start=L,te&&(j.levelkey=te),j.sn=D,j.level=o,j.cc=M,j.urlId=b,d.push(j),j.relurl=(" "+G[3]).slice(1),m(j,O),O=j,L+=j.duration,D++,S=0,ve=!0);else if(G[4]){var Se=(" "+G[4]).slice(1);O?j.setByteRange(Se,O):j.setByteRange(Se)}else if(G[5])j.rawProgramDateTime=(" "+G[5]).slice(1),j.tagList.push(["PROGRAM-DATE-TIME",j.rawProgramDateTime]),fe===-1&&(fe=d.length);else{if(G=G[0].match(l),!G){g.logger.warn("No matches on slow regex match for level playlist!");continue}for(X=1;X<G.length&&!(typeof G[X]!="undefined");X++);var de=(" "+G[X]).slice(1),ie=(" "+G[X+1]).slice(1),Le=G[X+2]?(" "+G[X+2]).slice(1):"";switch(de){case"PLAYLIST-TYPE":p.type=ie.toUpperCase();break;case"MEDIA-SEQUENCE":D=p.startSN=parseInt(ie);break;case"SKIP":{var Ve=new C.AttrList(ie),Be=Ve.decimalInteger("SKIPPED-SEGMENTS");if(Object(W.isFiniteNumber)(Be)){p.skippedSegments=Be;for(var je=Be;je--;)d.unshift(null);D+=Be}var Ee=Ve.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ee&&(p.recentlyRemovedDateranges=Ee.split(" "));break}case"TARGETDURATION":p.targetduration=parseFloat(ie);break;case"VERSION":p.version=parseInt(ie);break;case"EXTM3U":break;case"ENDLIST":p.live=!1;break;case"#":(ie||Le)&&j.tagList.push(Le?[ie,Le]:[ie]);break;case"DIS":M++;case"GAP":j.tagList.push([de]);break;case"BITRATE":j.tagList.push([de,ie]);break;case"DISCONTINUITY-SEQ":M=parseInt(ie);break;case"KEY":{var Te,Re=new C.AttrList(ie),Ie=Re.enumeratedString("METHOD"),$=Re.URI,se=Re.hexadecimalInteger("IV"),ue=Re.enumeratedString("KEYFORMATVERSIONS"),ce=Re.enumeratedString("KEYID"),_e=(Te=Re.enumeratedString("KEYFORMAT"))!=null?Te:"identity",De=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(De.indexOf(_e)>-1){g.logger.warn("Keyformat "+_e+" is not supported from the manifest");continue}else if(_e!=="identity")continue;Ie&&(te=e.LevelKey.fromURL(h,$),$&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ie)>=0&&(te.method=Ie,te.keyFormat=_e,ce&&(te.keyID=ce),ue&&(te.keyFormatVersions=ue),te.iv=se));break}case"START":{var Pe=new C.AttrList(ie),Me=Pe.decimalFloatingPoint("TIME-OFFSET");Object(W.isFiniteNumber)(Me)&&(p.startTimeOffset=Me);break}case"MAP":{var Fe=new C.AttrList(ie);j.relurl=Fe.URI,Fe.BYTERANGE&&j.setByteRange(Fe.BYTERANGE),j.level=o,j.sn="initSegment",te&&(j.levelkey=te),j.initSegment=null,A=j,ve=!0;break}case"SERVER-CONTROL":{var He=new C.AttrList(ie);p.canBlockReload=He.bool("CAN-BLOCK-RELOAD"),p.canSkipUntil=He.optionalFloat("CAN-SKIP-UNTIL",0),p.canSkipDateRanges=p.canSkipUntil>0&&He.bool("CAN-SKIP-DATERANGES"),p.partHoldBack=He.optionalFloat("PART-HOLD-BACK",0),p.holdBack=He.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var oe=new C.AttrList(ie);p.partTarget=oe.decimalFloatingPoint("PART-TARGET");break}case"PART":{var me=p.partList;me||(me=p.partList=[]);var be=S>0?me[me.length-1]:void 0,we=S++,pe=new K.Part(new C.AttrList(ie),j,h,we,be);me.push(pe),j.duration+=pe.duration;break}case"PRELOAD-HINT":{var ye=new C.AttrList(ie);p.preloadHint=ye;break}case"RENDITION-REPORT":{var re=new C.AttrList(ie);p.renditionReports=p.renditionReports||[],p.renditionReports.push(re);break}default:g.logger.warn("line parsed but not handled: "+G);break}}}O&&!O.relurl?(d.pop(),L-=O.duration,p.partList&&(p.fragmentHint=O)):p.partList&&(m(j,O),j.cc=M,p.fragmentHint=j);var Z=d.length,J=d[0],V=d[Z-1];if(L+=p.skippedSegments*p.targetduration,L>0&&Z&&V){p.averagetargetduration=L/Z;var Y=V.sn;p.endSN=Y!=="initSegment"?Y:0,J&&(p.startCC=J.cc,J.initSegment||p.fragments.every(function(q){return q.relurl&&n(q.relurl)})&&(g.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),j=new K.Fragment(u,h),j.relurl=V.relurl,j.level=o,j.sn="initSegment",J.initSegment=j,p.needSidxRanges=!0))}else p.endSN=0,p.startCC=0;return p.fragmentHint&&(L+=p.fragmentHint.duration),p.totalduration=L,p.endCC=M,fe>0&&y(d,fe),p},T}();function t(T,_){["video","audio","text"].forEach(function(f){var h=T.filter(function(u){return Object(v.isCodecType)(u,f)});if(h.length){var o=h.filter(function(u){return u.lastIndexOf("avc1",0)===0||u.lastIndexOf("mp4a",0)===0});_[f+"Codec"]=o.length>0?o[0]:h[0],T=T.filter(function(u){return h.indexOf(u)===-1})}}),_.unknownCodecs=T}function E(T,_,f){var h=_[f];h&&(T[f]=h)}function y(T,_){for(var f=T[_],h=_;h--;){var o=T[h];if(!o)return;o.programDateTime=f.programDateTime-o.duration*1e3,f=o}}function m(T,_){T.rawProgramDateTime?T.programDateTime=Date.parse(T.rawProgramDateTime):_!=null&&_.programDateTime&&(T.programDateTime=_.endProgramDateTime),Object(W.isFiniteNumber)(T.programDateTime)||(T.programDateTime=null,T.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/polyfills/number.ts"),P=I("./src/events.ts"),R=I("./src/errors.ts"),K=I("./src/utils/logger.ts"),N=I("./src/utils/mp4-tools.ts"),e=I("./src/loader/m3u8-parser.ts"),C=I("./src/types/loader.ts"),g=I("./src/utils/attr-list.ts");function v(i){var l=i.type;switch(l){case C.PlaylistContextType.AUDIO_TRACK:return C.PlaylistLevelType.AUDIO;case C.PlaylistContextType.SUBTITLE_TRACK:return C.PlaylistLevelType.SUBTITLE;default:return C.PlaylistLevelType.MAIN}}function c(i,l){var a=i.url;return(a===void 0||a.indexOf("data:")===0)&&(a=l.url),a}var s=function(){function i(a){this.hls=void 0,this.loaders=Object.create(null),this.hls=a,this.registerListeners()}var l=i.prototype;return l.registerListeners=function(){var n=this.hls;n.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(P.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(P.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.on(P.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},l.unregisterListeners=function(){var n=this.hls;n.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(P.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(P.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.off(P.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},l.createInternalLoader=function(n){var r=this.hls.config,t=r.pLoader,E=r.loader,y=t||E,m=new y(r);return n.loader=m,this.loaders[n.type]=m,m},l.getInternalLoader=function(n){return this.loaders[n.type]},l.resetInternalLoader=function(n){this.loaders[n]&&delete this.loaders[n]},l.destroyInternalLoaders=function(){for(var n in this.loaders){var r=this.loaders[n];r&&r.destroy(),this.resetInternalLoader(n)}},l.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},l.onManifestLoading=function(n,r){var t=r.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:C.PlaylistContextType.MANIFEST,url:t,deliveryDirectives:null})},l.onLevelLoading=function(n,r){var t=r.id,E=r.level,y=r.url,m=r.deliveryDirectives;this.load({id:t,groupId:null,level:E,responseType:"text",type:C.PlaylistContextType.LEVEL,url:y,deliveryDirectives:m})},l.onAudioTrackLoading=function(n,r){var t=r.id,E=r.groupId,y=r.url,m=r.deliveryDirectives;this.load({id:t,groupId:E,level:null,responseType:"text",type:C.PlaylistContextType.AUDIO_TRACK,url:y,deliveryDirectives:m})},l.onSubtitleTrackLoading=function(n,r){var t=r.id,E=r.groupId,y=r.url,m=r.deliveryDirectives;this.load({id:t,groupId:E,level:null,responseType:"text",type:C.PlaylistContextType.SUBTITLE_TRACK,url:y,deliveryDirectives:m})},l.load=function(n){var r,t=this.hls.config,E=this.getInternalLoader(n);if(E){var y=E.context;if(y&&y.url===n.url){K.logger.trace("[playlist-loader]: playlist request ongoing");return}K.logger.log("[playlist-loader]: aborting previous loader for type: "+n.type),E.abort()}var m,T,_,f;switch(n.type){case C.PlaylistContextType.MANIFEST:m=t.manifestLoadingMaxRetry,T=t.manifestLoadingTimeOut,_=t.manifestLoadingRetryDelay,f=t.manifestLoadingMaxRetryTimeout;break;case C.PlaylistContextType.LEVEL:case C.PlaylistContextType.AUDIO_TRACK:case C.PlaylistContextType.SUBTITLE_TRACK:m=0,T=t.levelLoadingTimeOut;break;default:m=t.levelLoadingMaxRetry,T=t.levelLoadingTimeOut,_=t.levelLoadingRetryDelay,f=t.levelLoadingMaxRetryTimeout;break}if(E=this.createInternalLoader(n),(r=n.deliveryDirectives)!==null&&r!==void 0&&r.part){var h;if(n.type===C.PlaylistContextType.LEVEL&&n.level!==null?h=this.hls.levels[n.level].details:n.type===C.PlaylistContextType.AUDIO_TRACK&&n.id!==null?h=this.hls.audioTracks[n.id].details:n.type===C.PlaylistContextType.SUBTITLE_TRACK&&n.id!==null&&(h=this.hls.subtitleTracks[n.id].details),h){var o=h.partTarget,u=h.targetduration;o&&u&&(T=Math.min(Math.max(o*3,u*.8)*1e3,T))}}var b={timeout:T,maxRetry:m,retryDelay:_,maxRetryDelay:f,highWaterMark:0},p={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};E.load(n,b,p)},l.loadsuccess=function(n,r,t,E){if(E===void 0&&(E=null),t.isSidxRequest){this.handleSidxRequest(n,t),this.handlePlaylistLoaded(n,r,t,E);return}this.resetInternalLoader(t.type);var y=n.data;if(y.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(n,t,"no EXTM3U delimiter",E);return}r.parsing.start=performance.now(),y.indexOf("#EXTINF:")>0||y.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(n,r,t,E):this.handleMasterPlaylist(n,r,t,E)},l.loaderror=function(n,r,t){t===void 0&&(t=null),this.handleNetworkError(r,t,!1,n)},l.loadtimeout=function(n,r,t){t===void 0&&(t=null),this.handleNetworkError(r,t,!0)},l.handleMasterPlaylist=function(n,r,t,E){var y=this.hls,m=n.data,T=c(n,t),_=e.default.parseMasterPlaylist(m,T),f=_.levels,h=_.sessionData;if(!f.length){this.handleManifestParsingError(n,t,"no level found in manifest",E);return}var o=f.map(function(D){return{id:D.attrs.AUDIO,audioCodec:D.audioCodec}}),u=f.map(function(D){return{id:D.attrs.SUBTITLES,textCodec:D.textCodec}}),b=e.default.parseMasterPlaylistMedia(m,T,"AUDIO",o),p=e.default.parseMasterPlaylistMedia(m,T,"SUBTITLES",u),d=e.default.parseMasterPlaylistMedia(m,T,"CLOSED-CAPTIONS");if(b.length){var A=b.some(function(D){return!D.url});!A&&f[0].audioCodec&&!f[0].attrs.AUDIO&&(K.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),b.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new g.AttrList({}),bitrate:0,url:""}))}y.trigger(P.Events.MANIFEST_LOADED,{levels:f,audioTracks:b,subtitles:p,captions:d,url:T,stats:r,networkDetails:E,sessionData:h})},l.handleTrackOrLevelPlaylist=function(n,r,t,E){var y=this.hls,m=t.id,T=t.level,_=t.type,f=c(n,t),h=Object(W.isFiniteNumber)(m)?m:0,o=Object(W.isFiniteNumber)(T)?T:h,u=v(t),b=e.default.parseLevelPlaylist(n.data,f,o,u,h);if(!b.fragments.length){y.trigger(P.Events.ERROR,{type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:f,reason:"no fragments found in level",level:typeof t.level=="number"?t.level:void 0});return}if(_===C.PlaylistContextType.MANIFEST){var p={attrs:new g.AttrList({}),bitrate:0,details:b,name:"",url:f};y.trigger(P.Events.MANIFEST_LOADED,{levels:[p],audioTracks:[],url:f,stats:r,networkDetails:E,sessionData:null})}if(r.parsing.end=performance.now(),b.needSidxRanges){var d,A=(d=b.fragments[0].initSegment)===null||d===void 0?void 0:d.url;this.load({url:A,isSidxRequest:!0,type:_,level:T,levelDetails:b,id:m,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}t.levelDetails=b,this.handlePlaylistLoaded(n,r,t,E)},l.handleSidxRequest=function(n,r){var t=Object(N.parseSegmentIndex)(new Uint8Array(n.data));if(!t)return;var E=t.references,y=r.levelDetails;E.forEach(function(m,T){var _=m.info,f=y.fragments[T];f.byteRange.length===0&&f.setByteRange(String(1+_.end-_.start)+"@"+String(_.start)),f.initSegment&&f.initSegment.setByteRange(String(t.moovEndOffset)+"@0")})},l.handleManifestParsingError=function(n,r,t,E){this.hls.trigger(P.Events.ERROR,{type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:r.type===C.PlaylistContextType.MANIFEST,url:n.url,reason:t,response:n,context:r,networkDetails:E})},l.handleNetworkError=function(n,r,t,E){t===void 0&&(t=!1),K.logger.warn("[playlist-loader]: A network "+(t?"timeout":"error")+" occurred while loading "+n.type+" level: "+n.level+" id: "+n.id+' group-id: "'+n.groupId+'"');var y=R.ErrorDetails.UNKNOWN,m=!1,T=this.getInternalLoader(n);switch(n.type){case C.PlaylistContextType.MANIFEST:y=t?R.ErrorDetails.MANIFEST_LOAD_TIMEOUT:R.ErrorDetails.MANIFEST_LOAD_ERROR,m=!0;break;case C.PlaylistContextType.LEVEL:y=t?R.ErrorDetails.LEVEL_LOAD_TIMEOUT:R.ErrorDetails.LEVEL_LOAD_ERROR,m=!1;break;case C.PlaylistContextType.AUDIO_TRACK:y=t?R.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:R.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,m=!1;break;case C.PlaylistContextType.SUBTITLE_TRACK:y=t?R.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:R.ErrorDetails.SUBTITLE_LOAD_ERROR,m=!1;break}T&&this.resetInternalLoader(n.type);var _={type:R.ErrorTypes.NETWORK_ERROR,details:y,fatal:m,url:n.url,loader:T,context:n,networkDetails:r};E&&(_.response=E),this.hls.trigger(P.Events.ERROR,_)},l.handlePlaylistLoaded=function(n,r,t,E){var y=t.type,m=t.level,T=t.id,_=t.groupId,f=t.loader,h=t.levelDetails,o=t.deliveryDirectives;if(!(h!=null&&h.targetduration)){this.handleManifestParsingError(n,t,"invalid target duration",E);return}if(!f)return;h.live&&(f.getCacheAge&&(h.ageHeader=f.getCacheAge()||0),(!f.getCacheAge||isNaN(h.ageHeader))&&(h.ageHeader=0));switch(y){case C.PlaylistContextType.MANIFEST:case C.PlaylistContextType.LEVEL:this.hls.trigger(P.Events.LEVEL_LOADED,{details:h,level:m||0,id:T||0,stats:r,networkDetails:E,deliveryDirectives:o});break;case C.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(P.Events.AUDIO_TRACK_LOADED,{details:h,id:T||0,groupId:_||"",stats:r,networkDetails:E,deliveryDirectives:o});break;case C.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(P.Events.SUBTITLE_TRACK_LOADED,{details:h,id:T||0,groupId:_||"",stats:r,networkDetails:E,deliveryDirectives:o});break}},i}();H.default=s},"./src/polyfills/number.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"isFiniteNumber",function(){return W}),I.d(H,"MAX_SAFE_INTEGER",function(){return P});var W=Number.isFinite||function(R){return typeof R=="number"&&isFinite(R)},P=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(Q,H,I){"use strict";I.r(H);var W=function(){function P(){}return P.getSilentFrame=function(K,N){switch(K){case"mp4a.40.2":if(N===1)return new Uint8Array([0,200,0,128,35,128]);if(N===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(N===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(N===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(N===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(N===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(N===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(N===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(N===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},P}();H.default=W},"./src/remux/mp4-generator.ts":function(Q,H,I){"use strict";I.r(H);var W=Math.pow(2,32)-1,P=function(){function R(){}return R.init=function(){R.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var N;for(N in R.types)R.types.hasOwnProperty(N)&&(R.types[N]=[N.charCodeAt(0),N.charCodeAt(1),N.charCodeAt(2),N.charCodeAt(3)]);var e=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]),C=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]);R.HDLR_TYPES={video:e,audio:C};var g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),v=new Uint8Array([0,0,0,0,0,0,0,0]);R.STTS=R.STSC=R.STCO=v,R.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),R.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),R.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),R.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var c=new Uint8Array([105,115,111,109]),s=new Uint8Array([97,118,99,49]),i=new Uint8Array([0,0,0,1]);R.FTYP=R.box(R.types.ftyp,c,i,c,s),R.DINF=R.box(R.types.dinf,R.box(R.types.dref,g))},R.box=function(N){for(var e=8,C=arguments.length,g=new Array(C>1?C-1:0),v=1;v<C;v++)g[v-1]=arguments[v];for(var c=g.length,s=c;c--;)e+=g[c].byteLength;var i=new Uint8Array(e);for(i[0]=e>>24&255,i[1]=e>>16&255,i[2]=e>>8&255,i[3]=e&255,i.set(N,4),c=0,e=8;c<s;c++)i.set(g[c],e),e+=g[c].byteLength;return i},R.hdlr=function(N){return R.box(R.types.hdlr,R.HDLR_TYPES[N])},R.mdat=function(N){return R.box(R.types.mdat,N)},R.mdhd=function(N,e){e*=N;var C=Math.floor(e/(W+1)),g=Math.floor(e%(W+1));return R.box(R.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,N>>24&255,N>>16&255,N>>8&255,N&255,C>>24,C>>16&255,C>>8&255,C&255,g>>24,g>>16&255,g>>8&255,g&255,85,196,0,0]))},R.mdia=function(N){return R.box(R.types.mdia,R.mdhd(N.timescale,N.duration),R.hdlr(N.type),R.minf(N))},R.mfhd=function(N){return R.box(R.types.mfhd,new Uint8Array([0,0,0,0,N>>24,N>>16&255,N>>8&255,N&255]))},R.minf=function(N){return N.type==="audio"?R.box(R.types.minf,R.box(R.types.smhd,R.SMHD),R.DINF,R.stbl(N)):R.box(R.types.minf,R.box(R.types.vmhd,R.VMHD),R.DINF,R.stbl(N))},R.moof=function(N,e,C){return R.box(R.types.moof,R.mfhd(N),R.traf(C,e))},R.moov=function(N){for(var e=N.length,C=[];e--;)C[e]=R.trak(N[e]);return R.box.apply(null,[R.types.moov,R.mvhd(N[0].timescale,N[0].duration)].concat(C).concat(R.mvex(N)))},R.mvex=function(N){for(var e=N.length,C=[];e--;)C[e]=R.trex(N[e]);return R.box.apply(null,[R.types.mvex].concat(C))},R.mvhd=function(N,e){e*=N;var C=Math.floor(e/(W+1)),g=Math.floor(e%(W+1)),v=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,N>>24&255,N>>16&255,N>>8&255,N&255,C>>24,C>>16&255,C>>8&255,C&255,g>>24,g>>16&255,g>>8&255,g&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return R.box(R.types.mvhd,v)},R.sdtp=function(N){var e=N.samples||[],C=new Uint8Array(4+e.length),g,v;for(g=0;g<e.length;g++)v=e[g].flags,C[g+4]=v.dependsOn<<4|v.isDependedOn<<2|v.hasRedundancy;return R.box(R.types.sdtp,C)},R.stbl=function(N){return R.box(R.types.stbl,R.stsd(N),R.box(R.types.stts,R.STTS),R.box(R.types.stsc,R.STSC),R.box(R.types.stsz,R.STSZ),R.box(R.types.stco,R.STCO))},R.avc1=function(N){var e=[],C=[],g,v,c;for(g=0;g<N.sps.length;g++)v=N.sps[g],c=v.byteLength,e.push(c>>>8&255),e.push(c&255),e=e.concat(Array.prototype.slice.call(v));for(g=0;g<N.pps.length;g++)v=N.pps[g],c=v.byteLength,C.push(c>>>8&255),C.push(c&255),C=C.concat(Array.prototype.slice.call(v));var s=R.box(R.types.avcC,new Uint8Array([1,e[3],e[4],e[5],252|3,224|N.sps.length].concat(e).concat([N.pps.length]).concat(C))),i=N.width,l=N.height,a=N.pixelRatio[0],n=N.pixelRatio[1];return R.box(R.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,i>>8&255,i&255,l>>8&255,l&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]),s,R.box(R.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),R.box(R.types.pasp,new Uint8Array([a>>24,a>>16&255,a>>8&255,a&255,n>>24,n>>16&255,n>>8&255,n&255])))},R.esds=function(N){var e=N.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(N.config).concat([6,1,2]))},R.mp4a=function(N){var e=N.samplerate;return R.box(R.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,N.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]),R.box(R.types.esds,R.esds(N)))},R.mp3=function(N){var e=N.samplerate;return R.box(R.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,N.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]))},R.stsd=function(N){return N.type==="audio"?!N.isAAC&&N.codec==="mp3"?R.box(R.types.stsd,R.STSD,R.mp3(N)):R.box(R.types.stsd,R.STSD,R.mp4a(N)):R.box(R.types.stsd,R.STSD,R.avc1(N))},R.tkhd=function(N){var e=N.id,C=N.duration*N.timescale,g=N.width,v=N.height,c=Math.floor(C/(W+1)),s=Math.floor(C%(W+1));return R.box(R.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,0,0,0,0,c>>24,c>>16&255,c>>8&255,c&255,s>>24,s>>16&255,s>>8&255,s&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,g>>8&255,g&255,0,0,v>>8&255,v&255,0,0]))},R.traf=function(N,e){var C=R.sdtp(N),g=N.id,v=Math.floor(e/(W+1)),c=Math.floor(e%(W+1));return R.box(R.types.traf,R.box(R.types.tfhd,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255])),R.box(R.types.tfdt,new Uint8Array([1,0,0,0,v>>24,v>>16&255,v>>8&255,v&255,c>>24,c>>16&255,c>>8&255,c&255])),R.trun(N,C.length+16+20+8+16+8+8),C)},R.trak=function(N){return N.duration=N.duration||4294967295,R.box(R.types.trak,R.tkhd(N),R.mdia(N))},R.trex=function(N){var e=N.id;return R.box(R.types.trex,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},R.trun=function(N,e){var C=N.samples||[],g=C.length,v=12+16*g,c=new Uint8Array(v),s,i,l,a,n,r;for(e+=8+v,c.set([0,0,15,1,g>>>24&255,g>>>16&255,g>>>8&255,g&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255],0),s=0;s<g;s++)i=C[s],l=i.duration,a=i.size,n=i.flags,r=i.cts,c.set([l>>>24&255,l>>>16&255,l>>>8&255,l&255,a>>>24&255,a>>>16&255,a>>>8&255,a&255,n.isLeading<<2|n.dependsOn,n.isDependedOn<<6|n.hasRedundancy<<4|n.paddingValue<<1|n.isNonSync,n.degradPrio&240<<8,n.degradPrio&15,r>>>24&255,r>>>16&255,r>>>8&255,r&255],12+16*s);return R.box(R.types.trun,c)},R.initSegment=function(N){R.types||R.init();var e=R.moov(N),C=new Uint8Array(R.FTYP.byteLength+e.byteLength);return C.set(R.FTYP),C.set(e,R.FTYP.byteLength),C},R}();P.types=void 0,P.HDLR_TYPES=void 0,P.STTS=void 0,P.STSC=void 0,P.STCO=void 0,P.STSZ=void 0,P.VMHD=void 0,P.SMHD=void 0,P.STSD=void 0,P.FTYP=void 0,P.DINF=void 0,H.default=P},"./src/remux/mp4-remuxer.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return r}),I.d(H,"normalizePts",function(){return t});var W=I("./src/polyfills/number.ts"),P=I("./src/remux/aac-helper.ts"),R=I("./src/remux/mp4-generator.ts"),K=I("./src/events.ts"),N=I("./src/errors.ts"),e=I("./src/utils/logger.ts"),C=I("./src/types/loader.ts"),g=I("./src/utils/timescale-conversion.ts");function v(){return v=Object.assign||function(T){for(var _=1;_<arguments.length;_++){var f=arguments[_];for(var h in f)Object.prototype.hasOwnProperty.call(f,h)&&(T[h]=f[h])}return T},v.apply(this,arguments)}var c=10*1e3,s=1024,i=1152,l=null,a=null,n=!1,r=function(){function T(f,h,o,u){if(u===void 0&&(u=""),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=f,this.config=h,this.typeSupported=o,this.ISGenerated=!1,l===null){var b=navigator.userAgent||"",p=b.match(/Chrome\/(\d+)/i);l=p?parseInt(p[1]):0}if(a===null){var d=navigator.userAgent.match(/Safari\/(\d+)/i);a=d?parseInt(d[1]):0}n=!!l&&l<75||!!a&&a<600}var _=T.prototype;return _.destroy=function(){},_.resetTimeStamp=function(h){e.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=h},_.resetNextTimestamp=function(){e.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},_.resetInitSegment=function(){e.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},_.getVideoStartPts=function(h){var o=!1,u=h.reduce(function(b,p){var d=p.pts-b;return d<-4294967296?(o=!0,t(b,p.pts)):d>0?b:p.pts},h[0].pts);return o&&e.logger.debug("PTS rollover detected"),u},_.remux=function(h,o,u,b,p,d,A,D){var S,L,M,O,j,G,X=p,te=p,fe=h.pid>-1,ve=o.pid>-1,he=o.samples.length,xe=h.samples.length>0,Se=he>1,de=(!fe||xe)&&(!ve||Se)||this.ISGenerated||A;if(de){this.ISGenerated||(M=this.generateIS(h,o,p));var ie=this.isVideoContiguous,Le=-1;if(Se&&(Le=E(o.samples),!ie&&this.config.forceKeyFrameOnDiscontinuity))if(G=!0,Le>0){e.logger.warn("[mp4-remuxer]: Dropped "+Le+" out of "+he+" video samples due to a missing keyframe");var Ve=this.getVideoStartPts(o.samples);o.samples=o.samples.slice(Le),o.dropped+=Le,te+=(o.samples[0].pts-Ve)/(o.timescale||9e4)}else Le===-1&&(e.logger.warn("[mp4-remuxer]: No keyframe found out of "+he+" video samples"),G=!1);if(this.ISGenerated){if(xe&&Se){var Be=this.getVideoStartPts(o.samples),je=t(h.samples[0].pts,Be)-Be,Ee=je/o.inputTimeScale;X+=Math.max(0,Ee),te+=Math.max(0,-Ee)}if(xe){if(h.samplerate||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),M=this.generateIS(h,o,p)),L=this.remuxAudio(h,X,this.isAudioContiguous,d,ve||Se||D===C.PlaylistLevelType.AUDIO?te:void 0),Se){var Te=L?L.endPTS-L.startPTS:0;o.inputTimeScale||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),M=this.generateIS(h,o,p)),S=this.remuxVideo(o,te,ie,Te)}}else Se&&(S=this.remuxVideo(o,te,ie,0));S&&(S.firstKeyFrame=Le,S.independent=Le!==-1)}}return this.ISGenerated&&(u.samples.length&&(j=this.remuxID3(u,p)),b.samples.length&&(O=this.remuxText(b,p))),{audio:L,video:S,initSegment:M,independent:G,text:O,id3:j}},_.generateIS=function(h,o,u){var b=h.samples,p=o.samples,d=this.typeSupported,A={},D=!Object(W.isFiniteNumber)(this._initPTS),S="audio/mp4",L,M,O;if(D&&(L=M=Infinity),h.config&&b.length&&(h.timescale=h.samplerate,h.isAAC||(d.mpeg?(S="audio/mpeg",h.codec=""):d.mp3&&(h.codec="mp3")),A.audio={id:"audio",container:S,codec:h.codec,initSegment:!h.isAAC&&d.mpeg?new Uint8Array(0):R.default.initSegment([h]),metadata:{channelCount:h.channelCount}},D&&(O=h.inputTimeScale,L=M=b[0].pts-Math.round(O*u))),o.sps&&o.pps&&p.length&&(o.timescale=o.inputTimeScale,A.video={id:"main",container:"video/mp4",codec:o.codec,initSegment:R.default.initSegment([o]),metadata:{width:o.width,height:o.height}},D)){O=o.inputTimeScale;var j=this.getVideoStartPts(p),G=Math.round(O*u);M=Math.min(M,t(p[0].dts,j)-G),L=Math.min(L,j-G)}if(Object.keys(A).length)return this.ISGenerated=!0,D&&(this._initPTS=L,this._initDTS=M),{tracks:A,initPTS:L,timescale:O}},_.remuxVideo=function(h,o,u,b){var p=h.inputTimeScale,d=h.samples,A=[],D=d.length,S=this._initPTS,L=this.nextAvcDts,M=8,O,j,G,X=Number.POSITIVE_INFINITY,te=Number.NEGATIVE_INFINITY,fe=0,ve=!1;if(!u||L===null){var he=o*p,xe=d[0].pts-t(d[0].dts,d[0].pts);L=he-xe}for(var Se=0;Se<D;Se++){var de=d[Se];if(de.pts=t(de.pts-S,L),de.dts=t(de.dts-S,L),de.dts>de.pts){var ie=9e4*.2;fe=Math.max(Math.min(fe,de.pts-de.dts),-1*ie)}de.dts<d[Se>0?Se-1:Se].dts&&(ve=!0)}ve&&d.sort(function(Je,Qe){var Ge=Je.dts-Qe.dts,at=Je.pts-Qe.pts;return Ge||at}),j=d[0].dts,G=d[d.length-1].dts;var Le=Math.round((G-j)/(D-1));if(fe<0){if(fe<Le*-2){e.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(g.toMsFromMpegTsClock)(-Le,!0)+" ms");for(var Ve=fe,Be=0;Be<D;Be++)d[Be].dts=Ve=Math.max(Ve,d[Be].pts-Le),d[Be].pts=Math.max(Ve,d[Be].pts)}else{e.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(g.toMsFromMpegTsClock)(fe,!0)+" ms to overcome this issue");for(var je=0;je<D;je++)d[je].dts=d[je].dts+fe}j=d[0].dts}if(u){var Ee=j-L,Te=Ee>Le,Re=Ee<-1;if(Te||Re){Te?e.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(Ee,!0)+" ms ("+Ee+"dts) hole between fragments detected, filling it"):e.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(-Ee,!0)+" ms ("+Ee+"dts) overlapping between fragments detected"),j=L;var Ie=d[0].pts-Ee;d[0].dts=j,d[0].pts=Ie,e.logger.log("Video: First PTS/DTS adjusted: "+Object(g.toMsFromMpegTsClock)(Ie,!0)+"/"+Object(g.toMsFromMpegTsClock)(j,!0)+", delta: "+Object(g.toMsFromMpegTsClock)(Ee,!0)+" ms")}}n&&(j=Math.max(0,j));for(var $=0,se=0,ue=0;ue<D;ue++){for(var ce=d[ue],_e=ce.units,De=_e.length,Pe=0,Me=0;Me<De;Me++)Pe+=_e[Me].data.length;se+=Pe,$+=De,ce.length=Pe,ce.dts=Math.max(ce.dts,j),ce.pts=Math.max(ce.pts,ce.dts,0),X=Math.min(ce.pts,X),te=Math.max(ce.pts,te)}G=d[D-1].dts;var Fe=se+4*$+8,He;try{He=new Uint8Array(Fe)}catch(Je){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:N.ErrorTypes.MUX_ERROR,details:N.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Fe,reason:"fail allocating video mdat "+Fe});return}var oe=new DataView(He.buffer);oe.setUint32(0,Fe),He.set(R.default.types.mdat,4);for(var me=0;me<D;me++){for(var be=d[me],we=be.units,pe=0,ye=0,re=we.length;ye<re;ye++){var Z=we[ye],J=Z.data,V=Z.data.byteLength;oe.setUint32(M,V),M+=4,He.set(J,M),M+=V,pe+=4+V}if(me<D-1)O=d[me+1].dts-be.dts;else{var Y=this.config,q=be.dts-d[me>0?me-1:me].dts;if(Y.stretchShortVideoTrack&&this.nextAudioPts!==null){var ee=Math.floor(Y.maxBufferHole*p),le=(b?X+b*p:this.nextAudioPts)-be.pts;le>ee?(O=le-q,O<0&&(O=q),e.logger.log("[mp4-remuxer]: It is approximately "+le/90+" ms to the next segment; using duration "+O/90+" ms for the last video frame.")):O=q}else O=q}var ge=Math.round(be.pts-be.dts);A.push(new y(be.key,O,pe,ge))}if(A.length&&l&&l<70){var Oe=A[0].flags;Oe.dependsOn=2,Oe.isNonSync=0}console.assert(O!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=L=G+O,this.isVideoContiguous=!0;var Ke=R.default.moof(h.sequenceNumber++,j,v({},h,{samples:A})),ze="video",ke={data1:Ke,data2:He,startPTS:X/p,endPTS:(te+O)/p,startDTS:j/p,endDTS:L/p,type:ze,hasAudio:!1,hasVideo:!0,nb:A.length,dropped:h.dropped};return h.samples=[],h.dropped=0,console.assert(He.length,"MDAT length must not be zero"),ke},_.remuxAudio=function(h,o,u,b,p){var d=h.inputTimeScale,A=h.samplerate?h.samplerate:d,D=d/A,S=h.isAAC?s:i,L=S*D,M=this._initPTS,O=!h.isAAC&&this.typeSupported.mpeg,j=[],G=h.samples,X=O?0:8,te=this.nextAudioPts||-1,fe=o*d;if(this.isAudioContiguous=u=u||G.length&&te>0&&(b&&Math.abs(fe-te)<9e3||Math.abs(t(G[0].pts-M,fe)-te)<20*L),G.forEach(function(J){J.pts=t(J.pts-M,fe)}),!u||te<0){if(G=G.filter(function(J){return J.pts>=0}),!G.length)return;p===0?te=0:b?te=Math.max(0,fe):te=G[0].pts}if(h.isAAC)for(var ve=p!==void 0,he=this.config.maxAudioFramesDrift,xe=0,Se=te;xe<G.length;xe++){var de=G[xe],ie=de.pts,Le=ie-Se,Ve=Math.abs(1e3*Le/d);if(Le<=-he*L&&ve)xe===0&&(e.logger.warn("Audio frame @ "+(ie/d).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Le/d)+" ms."),this.nextAudioPts=te=Se=ie);else if(Le>=he*L&&Ve<c&&ve){var Be=Math.round(Le/L);Se=ie-Be*L,Se<0&&(Be--,Se+=L),xe===0&&(this.nextAudioPts=te=Se),e.logger.warn("[mp4-remuxer]: Injecting "+Be+" audio frame @ "+(Se/d).toFixed(3)+"s due to "+Math.round(1e3*Le/d)+" ms gap.");for(var je=0;je<Be;je++){var Ee=Math.max(Se,0),Te=P.default.getSilentFrame(h.manifestCodec||h.codec,h.channelCount);Te||(e.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Te=de.unit.subarray()),G.splice(xe,0,{unit:Te,pts:Ee}),Se+=L,xe++}}de.pts=Se,Se+=L}for(var Re=null,Ie=null,$,se=0,ue=G.length;ue--;)se+=G[ue].unit.byteLength;for(var ce=0,_e=G.length;ce<_e;ce++){var De=G[ce],Pe=De.unit,Me=De.pts;if(Ie!==null){var Fe=j[ce-1];Fe.duration=Math.round((Me-Ie)/D)}else if(u&&h.isAAC&&(Me=te),Re=Me,se>0){se+=X;try{$=new Uint8Array(se)}catch(J){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:N.ErrorTypes.MUX_ERROR,details:N.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:se,reason:"fail allocating audio mdat "+se});return}if(!O){var He=new DataView($.buffer);He.setUint32(0,se),$.set(R.default.types.mdat,4)}}else return;$.set(Pe,X);var oe=Pe.byteLength;X+=oe,j.push(new y(!0,S,oe,0)),Ie=Me}var me=j.length;if(!me)return;var be=j[j.length-1];this.nextAudioPts=te=Ie+D*be.duration;var we=O?new Uint8Array(0):R.default.moof(h.sequenceNumber++,Re/D,v({},h,{samples:j}));h.samples=[];var pe=Re/d,ye=te/d,re="audio",Z={data1:we,data2:$,startPTS:pe,endPTS:ye,startDTS:pe,endDTS:ye,type:re,hasAudio:!0,hasVideo:!1,nb:me};return this.isAudioContiguous=!0,console.assert($.length,"MDAT length must not be zero"),Z},_.remuxEmptyAudio=function(h,o,u,b){var p=h.inputTimeScale,d=h.samplerate?h.samplerate:p,A=p/d,D=this.nextAudioPts,S=(D!==null?D:b.startDTS*p)+this._initDTS,L=b.endDTS*p+this._initDTS,M=A*s,O=Math.ceil((L-S)/M),j=P.default.getSilentFrame(h.manifestCodec||h.codec,h.channelCount);if(e.logger.warn("[mp4-remuxer]: remux empty Audio"),!j){e.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var G=[],X=0;X<O;X++){var te=S+X*M;G.push({unit:j,pts:te,dts:te})}return h.samples=G,this.remuxAudio(h,o,u,!1)},_.remuxID3=function(h,o){var u=h.samples.length;if(!u)return;for(var b=h.inputTimeScale,p=this._initPTS,d=this._initDTS,A=0;A<u;A++){var D=h.samples[A];D.pts=t(D.pts-p,o*b)/b,D.dts=t(D.dts-d,o*b)/b}var S=h.samples;return h.samples=[],{samples:S}},_.remuxText=function(h,o){var u=h.samples.length;if(!u)return;for(var b=h.inputTimeScale,p=this._initPTS,d=0;d<u;d++){var A=h.samples[d];A.pts=t(A.pts-p,o*b)/b}h.samples.sort(function(S,L){return S.pts-L.pts});var D=h.samples;return h.samples=[],{samples:D}},T}();function t(T,_){var f;if(_===null)return T;for(_<T?f=-8589934592:f=8589934592;Math.abs(T-_)>4294967296;)T+=f;return T}function E(T){for(var _=0;_<T.length;_++)if(T[_].key)return _;return-1}var y=function(_,f,h,o){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=f,this.size=h,this.cts=o,this.flags=new m(_)},m=function(_){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=_?2:1,this.isNonSync=_?0:1}},"./src/remux/passthrough-remuxer.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/polyfills/number.ts"),P=I("./src/utils/mp4-tools.ts"),R=I("./src/loader/fragment.ts"),K=I("./src/utils/logger.ts"),N=function(){function g(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var v=g.prototype;return v.destroy=function(){},v.resetTimeStamp=function(s){this.initPTS=s,this.lastEndDTS=null},v.resetNextTimestamp=function(){this.lastEndDTS=null},v.resetInitSegment=function(s,i,l){this.audioCodec=i,this.videoCodec=l,this.generateInitSegment(s),this.emitInitSegment=!0},v.generateInitSegment=function(s){var i=this.audioCodec,l=this.videoCodec;if(!s||!s.byteLength){this.initTracks=void 0,this.initData=void 0;return}var a=this.initData=Object(P.parseInitSegment)(s);i||(i=C(a.audio,R.ElementaryStreamTypes.AUDIO)),l||(l=C(a.video,R.ElementaryStreamTypes.VIDEO));var n={};a.audio&&a.video?n.audiovideo={container:"video/mp4",codec:i+","+l,initSegment:s,id:"main"}:a.audio?n.audio={container:"audio/mp4",codec:i,initSegment:s,id:"audio"}:a.video?n.video={container:"video/mp4",codec:l,initSegment:s,id:"main"}:K.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=n},v.remux=function(s,i,l,a,n){var r=this.initPTS,t=this.lastEndDTS,E={audio:void 0,video:void 0,text:a,id3:l,initSegment:void 0};Object(W.isFiniteNumber)(t)||(t=this.lastEndDTS=n||0);var y=i.samples;if(!y||!y.length)return E;var m={initPTS:void 0,timescale:1},T=this.initData;if((!T||!T.length)&&(this.generateInitSegment(y),T=this.initData),!T||!T.length)return K.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),E;this.emitInitSegment&&(m.tracks=this.initTracks,this.emitInitSegment=!1),Object(W.isFiniteNumber)(r)||(this.initPTS=m.initPTS=r=e(T,y,t));var _=Object(P.getDuration)(y,T),f=t,h=_+f;Object(P.offsetStartDTS)(T,y,r),_>0?this.lastEndDTS=h:(K.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var o=!!T.audio,u=!!T.video,b="";o&&(b+="audio"),u&&(b+="video");var p={data1:y,startPTS:f,startDTS:f,endPTS:h,endDTS:h,type:b,hasAudio:o,hasVideo:u,nb:1,dropped:0};return E.audio=p.type==="audio"?p:void 0,E.video=p.type!=="audio"?p:void 0,E.text=a,E.id3=l,E.initSegment=m,E},g}(),e=function(v,c,s){return Object(P.getStartDTS)(v,c)-s};function C(g,v){var c=g==null?void 0:g.codec;return c&&c.length>4?c:c==="hvc1"?"hvc1.1.c.L120.90":c==="av01"?"av01.0.04M.08":c==="avc1"||v===R.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}H.default=N},"./src/task-loop.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return W});var W=function(){function P(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var R=P.prototype;return R.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},R.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},R.onHandlerDestroyed=function(){},R.hasInterval=function(){return!!this._tickInterval},R.hasNextTick=function(){return!!this._tickTimer},R.setInterval=function(N){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,N),!0)},R.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},R.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},R.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},R.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},R.doTick=function(){},P}()},"./src/types/cmcd.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"CMCDVersion",function(){return W}),I.d(H,"CMCDObjectType",function(){return P}),I.d(H,"CMCDStreamingFormat",function(){return R}),I.d(H,"CMCDStreamType",function(){return K});var W=1,P;(function(N){N.MANIFEST="m",N.AUDIO="a",N.VIDEO="v",N.MUXED="av",N.INIT="i",N.CAPTION="c",N.TIMED_TEXT="tt",N.KEY="k",N.OTHER="o"})(P||(P={}));var R;(function(N){N.DASH="d",N.HLS="h",N.SMOOTH="s",N.OTHER="o"})(R||(R={}));var K;(function(N){N.VOD="v",N.LIVE="l"})(K||(K={}))},"./src/types/level.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"HlsSkip",function(){return R}),I.d(H,"getSkipValue",function(){return K}),I.d(H,"HlsUrlParameters",function(){return N}),I.d(H,"Level",function(){return e});function W(C,g){for(var v=0;v<g.length;v++){var c=g[v];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(C,c.key,c)}}function P(C,g,v){return g&&W(C.prototype,g),v&&W(C,v),C}var R;(function(C){C.No="",C.Yes="YES",C.v2="v2"})(R||(R={}));function K(C,g){var v=C.canSkipUntil,c=C.canSkipDateRanges,s=C.endSN,i=g!==void 0?g-s:0;return v&&i<v?c?R.v2:R.Yes:R.No}var N=function(){function C(v,c,s){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=v,this.part=c,this.skip=s}var g=C.prototype;return g.addDirectives=function(c){var s=new self.URL(c);return this.msn!==void 0&&s.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&s.searchParams.set("_HLS_part",this.part.toString()),this.skip&&s.searchParams.set("_HLS_skip",this.skip),s.toString()},C}(),e=function(){function C(g){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[g.url],this.attrs=g.attrs,this.bitrate=g.bitrate,g.details&&(this.details=g.details),this.id=g.id||0,this.name=g.name,this.width=g.width||0,this.height=g.height||0,this.audioCodec=g.audioCodec,this.videoCodec=g.videoCodec,this.unknownCodecs=g.unknownCodecs,this.codecSet=[g.videoCodec,g.audioCodec].filter(function(v){return v}).join(",").replace(/\.[^.,]+/g,"")}return P(C,[{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(v){var c=v%this.url.length;this._urlId!==c&&(this.details=void 0,this._urlId=c)}}]),C}()},"./src/types/loader.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"PlaylistContextType",function(){return W}),I.d(H,"PlaylistLevelType",function(){return P});var W;(function(R){R.MANIFEST="manifest",R.LEVEL="level",R.AUDIO_TRACK="audioTrack",R.SUBTITLE_TRACK="subtitleTrack"})(W||(W={}));var P;(function(R){R.MAIN="main",R.AUDIO="audio",R.SUBTITLE="subtitle"})(P||(P={}))},"./src/types/transmuxer.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"ChunkMetadata",function(){return W});var W=function(K,N,e,C,g,v){C===void 0&&(C=0),g===void 0&&(g=-1),v===void 0&&(v=!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=P(),this.buffering={audio:P(),video:P(),audiovideo:P()},this.level=K,this.sn=N,this.id=e,this.size=C,this.part=g,this.partial=v};function P(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"AttrList",function(){return R});var W=/^(\d+)x(\d+)$/,P=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,R=function(){function K(e){typeof e=="string"&&(e=K.parseAttrList(e));for(var C in e)e.hasOwnProperty(C)&&(this[C]=e[C])}var N=K.prototype;return N.decimalInteger=function(C){var g=parseInt(this[C],10);return g>Number.MAX_SAFE_INTEGER?Infinity:g},N.hexadecimalInteger=function(C){if(this[C]){var g=(this[C]||"0x").slice(2);g=(g.length&1?"0":"")+g;for(var v=new Uint8Array(g.length/2),c=0;c<g.length/2;c++)v[c]=parseInt(g.slice(c*2,c*2+2),16);return v}else return null},N.hexadecimalIntegerAsNumber=function(C){var g=parseInt(this[C],16);return g>Number.MAX_SAFE_INTEGER?Infinity:g},N.decimalFloatingPoint=function(C){return parseFloat(this[C])},N.optionalFloat=function(C,g){var v=this[C];return v?parseFloat(v):g},N.enumeratedString=function(C){return this[C]},N.bool=function(C){return this[C]==="YES"},N.decimalResolution=function(C){var g=W.exec(this[C]);return g===null?void 0:{width:parseInt(g[1],10),height:parseInt(g[2],10)}},K.parseAttrList=function(C){var g,v={},c='"';for(P.lastIndex=0;(g=P.exec(C))!==null;){var s=g[2];s.indexOf(c)===0&&s.lastIndexOf(c)===s.length-1&&(s=s.slice(1,-1)),v[g[1]]=s}return v},K}()},"./src/utils/binary-search.ts":function(Q,H,I){"use strict";I.r(H);var W={search:function(R,K){for(var N=0,e=R.length-1,C=null,g=null;N<=e;){C=(N+e)/2|0,g=R[C];var v=K(g);if(v>0)N=C+1;else if(v<0)e=C-1;else return g}return null}};H.default=W},"./src/utils/buffer-helper.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"BufferHelper",function(){return R});var W=I("./src/utils/logger.ts"),P={length:0,start:function(){return 0},end:function(){return 0}},R=function(){function K(){}return K.isBuffered=function(e,C){try{if(e){for(var g=K.getBuffered(e),v=0;v<g.length;v++)if(C>=g.start(v)&&C<=g.end(v))return!0}}catch(c){}return!1},K.bufferInfo=function(e,C,g){try{if(e){var v=K.getBuffered(e),c=[],s;for(s=0;s<v.length;s++)c.push({start:v.start(s),end:v.end(s)});return this.bufferedInfo(c,C,g)}}catch(i){}return{len:0,start:C,end:C,nextStart:void 0}},K.bufferedInfo=function(e,C,g){C=Math.max(0,C),e.sort(function(m,T){var _=m.start-T.start;return _||T.end-m.end});var v=[];if(g)for(var c=0;c<e.length;c++){var s=v.length;if(s){var i=v[s-1].end;e[c].start-i<g?e[c].end>i&&(v[s-1].end=e[c].end):v.push(e[c])}else v.push(e[c])}else v=e;for(var l=0,a,n=C,r=C,t=0;t<v.length;t++){var E=v[t].start,y=v[t].end;if(C+g>=E&&C<y)n=E,r=y,l=r-C;else if(C+g<E){a=E;break}}return{len:l,start:n||0,end:r||0,nextStart:a}},K.getBuffered=function(e){try{return e.buffered}catch(C){return W.logger.log("failed to get media.buffered",C),P}},K}()},"./src/utils/cea-608-parser.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"Row",function(){return r}),I.d(H,"CaptionScreen",function(){return t});var W=I("./src/utils/logger.ts"),P={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},R=function(h){var o=h;return P.hasOwnProperty(h)&&(o=P[h]),String.fromCharCode(o)},K=15,N=100,e={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},C={17:2,18:4,21:6,22:8,23:10,19:13,20:15},g={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},v={25:2,26:4,29:6,30:8,31:10,27:13,28:15},c=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],s;(function(f){f[f.ERROR=0]="ERROR",f[f.TEXT=1]="TEXT",f[f.WARNING=2]="WARNING",f[f.INFO=2]="INFO",f[f.DEBUG=3]="DEBUG",f[f.DATA=3]="DATA"})(s||(s={}));var i=function(){function f(){this.time=null,this.verboseLevel=s.ERROR}var h=f.prototype;return h.log=function(u,b){this.verboseLevel>=u&&W.logger.log(this.time+" ["+u+"] "+b)},f}(),l=function(h){for(var o=[],u=0;u<h.length;u++)o.push(h[u].toString(16));return o},a=function(){function f(o,u,b,p,d){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=o||"white",this.underline=u||!1,this.italics=b||!1,this.background=p||"black",this.flash=d||!1}var h=f.prototype;return h.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},h.setStyles=function(u){for(var b=["foreground","underline","italics","background","flash"],p=0;p<b.length;p++){var d=b[p];u.hasOwnProperty(d)&&(this[d]=u[d])}},h.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},h.equals=function(u){return this.foreground===u.foreground&&this.underline===u.underline&&this.italics===u.italics&&this.background===u.background&&this.flash===u.flash},h.copy=function(u){this.foreground=u.foreground,this.underline=u.underline,this.italics=u.italics,this.background=u.background,this.flash=u.flash},h.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},f}(),n=function(){function f(o,u,b,p,d,A){this.uchar=void 0,this.penState=void 0,this.uchar=o||" ",this.penState=new a(u,b,p,d,A)}var h=f.prototype;return h.reset=function(){this.uchar=" ",this.penState.reset()},h.setChar=function(u,b){this.uchar=u,this.penState.copy(b)},h.setPenState=function(u){this.penState.copy(u)},h.equals=function(u){return this.uchar===u.uchar&&this.penState.equals(u.penState)},h.copy=function(u){this.uchar=u.uchar,this.penState.copy(u.penState)},h.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},f}(),r=function(){function f(o){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var u=0;u<N;u++)this.chars.push(new n);this.logger=o,this.pos=0,this.currPenState=new a}var h=f.prototype;return h.equals=function(u){for(var b=!0,p=0;p<N;p++)if(!this.chars[p].equals(u.chars[p])){b=!1;break}return b},h.copy=function(u){for(var b=0;b<N;b++)this.chars[b].copy(u.chars[b])},h.isEmpty=function(){for(var u=!0,b=0;b<N;b++)if(!this.chars[b].isEmpty()){u=!1;break}return u},h.setCursor=function(u){this.pos!==u&&(this.pos=u),this.pos<0?(this.logger.log(s.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>N&&(this.logger.log(s.DEBUG,"Too large cursor position "+this.pos),this.pos=N)},h.moveCursor=function(u){var b=this.pos+u;if(u>1)for(var p=this.pos+1;p<b+1;p++)this.chars[p].setPenState(this.currPenState);this.setCursor(b)},h.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},h.insertChar=function(u){u>=144&&this.backSpace();var b=R(u);if(this.pos>=N){this.logger.log(s.ERROR,"Cannot insert "+u.toString(16)+" ("+b+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(b,this.currPenState),this.moveCursor(1)},h.clearFromPos=function(u){var b;for(b=u;b<N;b++)this.chars[b].reset()},h.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},h.clearToEndOfRow=function(){this.clearFromPos(this.pos)},h.getTextString=function(){for(var u=[],b=!0,p=0;p<N;p++){var d=this.chars[p].uchar;d!==" "&&(b=!1),u.push(d)}return b?"":u.join("")},h.setPenStyles=function(u){this.currPenState.setStyles(u);var b=this.chars[this.pos];b.setPenState(this.currPenState)},f}(),t=function(){function f(o){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var u=0;u<K;u++)this.rows.push(new r(o));this.logger=o,this.currRow=K-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var h=f.prototype;return h.reset=function(){for(var u=0;u<K;u++)this.rows[u].clear();this.currRow=K-1},h.equals=function(u){for(var b=!0,p=0;p<K;p++)if(!this.rows[p].equals(u.rows[p])){b=!1;break}return b},h.copy=function(u){for(var b=0;b<K;b++)this.rows[b].copy(u.rows[b])},h.isEmpty=function(){for(var u=!0,b=0;b<K;b++)if(!this.rows[b].isEmpty()){u=!1;break}return u},h.backSpace=function(){var u=this.rows[this.currRow];u.backSpace()},h.clearToEndOfRow=function(){var u=this.rows[this.currRow];u.clearToEndOfRow()},h.insertChar=function(u){var b=this.rows[this.currRow];b.insertChar(u)},h.setPen=function(u){var b=this.rows[this.currRow];b.setPenStyles(u)},h.moveCursor=function(u){var b=this.rows[this.currRow];b.moveCursor(u)},h.setCursor=function(u){this.logger.log(s.INFO,"setCursor: "+u);var b=this.rows[this.currRow];b.setCursor(u)},h.setPAC=function(u){this.logger.log(s.INFO,"pacData = "+JSON.stringify(u));var b=u.row-1;if(this.nrRollUpRows&&b<this.nrRollUpRows-1&&(b=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==b){for(var p=0;p<K;p++)this.rows[p].clear();var d=this.currRow+1-this.nrRollUpRows,A=this.lastOutputScreen;if(A){var D=A.rows[d].cueStartTime,S=this.logger.time;if(D&&S!==null&&D<S)for(var L=0;L<this.nrRollUpRows;L++)this.rows[b-this.nrRollUpRows+L+1].copy(A.rows[d+L])}}this.currRow=b;var M=this.rows[this.currRow];if(u.indent!==null){var O=u.indent,j=Math.max(O-1,0);M.setCursor(u.indent),u.color=M.chars[j].penState.foreground}var G={foreground:u.color,underline:u.underline,italics:u.italics,background:"black",flash:!1};this.setPen(G)},h.setBkgData=function(u){this.logger.log(s.INFO,"bkgData = "+JSON.stringify(u)),this.backSpace(),this.setPen(u),this.insertChar(32)},h.setRollUpRows=function(u){this.nrRollUpRows=u},h.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(s.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(s.TEXT,this.getDisplayText());var u=this.currRow+1-this.nrRollUpRows,b=this.rows.splice(u,1)[0];b.clear(),this.rows.splice(this.currRow,0,b),this.logger.log(s.INFO,"Rolling up")},h.getDisplayText=function(u){u=u||!1;for(var b=[],p="",d=-1,A=0;A<K;A++){var D=this.rows[A].getTextString();D&&(d=A+1,u?b.push("Row "+d+": '"+D+"'"):b.push(D.trim()))}return b.length>0&&(u?p="["+b.join(" | ")+"]":p=b.join(`
`)),p},h.getTextAndFormat=function(){return this.rows},f}(),E=function(){function f(o,u,b){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=o,this.outputFilter=u,this.mode=null,this.verbose=0,this.displayedMemory=new t(b),this.nonDisplayedMemory=new t(b),this.lastOutputScreen=new t(b),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=b}var h=f.prototype;return h.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},h.getHandler=function(){return this.outputFilter},h.setHandler=function(u){this.outputFilter=u},h.setPAC=function(u){this.writeScreen.setPAC(u)},h.setBkgData=function(u){this.writeScreen.setBkgData(u)},h.setMode=function(u){if(u===this.mode)return;this.mode=u,this.logger.log(s.INFO,"MODE="+u),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=u},h.insertChars=function(u){for(var b=0;b<u.length;b++)this.writeScreen.insertChar(u[b]);var p=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(s.INFO,p+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(s.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},h.ccRCL=function(){this.logger.log(s.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},h.ccBS=function(){if(this.logger.log(s.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},h.ccAOF=function(){},h.ccAON=function(){},h.ccDER=function(){this.logger.log(s.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},h.ccRU=function(u){this.logger.log(s.INFO,"RU("+u+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(u)},h.ccFON=function(){this.logger.log(s.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},h.ccRDC=function(){this.logger.log(s.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},h.ccTR=function(){this.logger.log(s.INFO,"TR"),this.setMode("MODE_TEXT")},h.ccRTD=function(){this.logger.log(s.INFO,"RTD"),this.setMode("MODE_TEXT")},h.ccEDM=function(){this.logger.log(s.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},h.ccCR=function(){this.logger.log(s.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},h.ccENM=function(){this.logger.log(s.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},h.ccEOC=function(){if(this.logger.log(s.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var u=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=u,this.writeScreen=this.nonDisplayedMemory,this.logger.log(s.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},h.ccTO=function(u){this.logger.log(s.INFO,"TO("+u+") - Tab Offset"),this.writeScreen.moveCursor(u)},h.ccMIDROW=function(u){var b={flash:!1};if(b.underline=u%2===1,b.italics=u>=46,b.italics)b.foreground="white";else{var p=Math.floor(u/2)-16,d=["white","green","blue","cyan","red","yellow","magenta"];b.foreground=d[p]}this.logger.log(s.INFO,"MIDROW: "+JSON.stringify(b)),this.writeScreen.setPen(b)},h.outputDataUpdate=function(u){u===void 0&&(u=!1);var b=this.logger.time;if(b===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=b:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,b,this.lastOutputScreen),u&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:b),this.lastOutputScreen.copy(this.displayedMemory))},h.cueSplitAtTime=function(u){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,u,this.displayedMemory),this.cueStartTime=u))},f}(),y=function(){function f(o,u,b){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var p=new i;this.channels=[null,new E(o,u,p),new E(o+1,b,p)],this.cmdHistory=_(),this.logger=p}var h=f.prototype;return h.getHandler=function(u){return this.channels[u].getHandler()},h.setHandler=function(u,b){this.channels[u].setHandler(b)},h.addData=function(u,b){var p,d,A,D=!1;this.logger.time=u;for(var S=0;S<b.length;S+=2){if(d=b[S]&127,A=b[S+1]&127,d===0&&A===0)continue;if(this.logger.log(s.DATA,"["+l([b[S],b[S+1]])+"] -> ("+l([d,A])+")"),p=this.parseCmd(d,A),p||(p=this.parseMidrow(d,A)),p||(p=this.parsePAC(d,A)),p||(p=this.parseBackgroundAttributes(d,A)),!p&&(D=this.parseChars(d,A),D)){var L=this.currentChannel;if(L&&L>0){var M=this.channels[L];M.insertChars(D)}else this.logger.log(s.WARNING,"No channel found yet. TEXT-MODE?")}!p&&!D&&this.logger.log(s.WARNING,"Couldn't parse cleaned data "+l([d,A])+" orig: "+l([b[S],b[S+1]]))}},h.parseCmd=function(u,b){var p=this.cmdHistory,d=(u===20||u===28||u===21||u===29)&&b>=32&&b<=47,A=(u===23||u===31)&&b>=33&&b<=35;if(!(d||A))return!1;if(T(u,b,p))return m(null,null,p),this.logger.log(s.DEBUG,"Repeated command ("+l([u,b])+") is dropped"),!0;var D=u===20||u===21||u===23?1:2,S=this.channels[D];return u===20||u===21||u===28||u===29?b===32?S.ccRCL():b===33?S.ccBS():b===34?S.ccAOF():b===35?S.ccAON():b===36?S.ccDER():b===37?S.ccRU(2):b===38?S.ccRU(3):b===39?S.ccRU(4):b===40?S.ccFON():b===41?S.ccRDC():b===42?S.ccTR():b===43?S.ccRTD():b===44?S.ccEDM():b===45?S.ccCR():b===46?S.ccENM():b===47&&S.ccEOC():S.ccTO(b-32),m(u,b,p),this.currentChannel=D,!0},h.parseMidrow=function(u,b){var p=0;if((u===17||u===25)&&b>=32&&b<=47){if(u===17?p=1:p=2,p!==this.currentChannel)return this.logger.log(s.ERROR,"Mismatch channel in midrow parsing"),!1;var d=this.channels[p];return d?(d.ccMIDROW(b),this.logger.log(s.DEBUG,"MIDROW ("+l([u,b])+")"),!0):!1}return!1},h.parsePAC=function(u,b){var p,d=this.cmdHistory,A=(u>=17&&u<=23||u>=25&&u<=31)&&b>=64&&b<=127,D=(u===16||u===24)&&b>=64&&b<=95;if(!(A||D))return!1;if(T(u,b,d))return m(null,null,d),!0;var S=u<=23?1:2;b>=64&&b<=95?p=S===1?e[u]:g[u]:p=S===1?C[u]:v[u];var L=this.channels[S];return L?(L.setPAC(this.interpretPAC(p,b)),m(u,b,d),this.currentChannel=S,!0):!1},h.interpretPAC=function(u,b){var p,d={color:null,italics:!1,indent:null,underline:!1,row:u};return b>95?p=b-96:p=b-64,d.underline=(p&1)===1,p<=13?d.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(p/2)]:p<=15?(d.italics=!0,d.color="white"):d.indent=Math.floor((p-16)/2)*4,d},h.parseChars=function(u,b){var p,d=null,A=null;if(u>=25?(p=2,A=u-8):(p=1,A=u),A>=17&&A<=19){var D;A===17?D=b+80:A===18?D=b+112:D=b+144,this.logger.log(s.INFO,"Special char '"+R(D)+"' in channel "+p),d=[D]}else u>=32&&u<=127&&(d=b===0?[u]:[u,b]);if(d){var S=l(d);this.logger.log(s.DEBUG,"Char codes = "+S.join(",")),m(u,b,this.cmdHistory)}return d},h.parseBackgroundAttributes=function(u,b){var p=(u===16||u===24)&&b>=32&&b<=47,d=(u===23||u===31)&&b>=45&&b<=47;if(!(p||d))return!1;var A,D={};u===16||u===24?(A=Math.floor((b-32)/2),D.background=c[A],b%2===1&&(D.background=D.background+"_semi")):b===45?D.background="transparent":(D.foreground="black",b===47&&(D.underline=!0));var S=u<=23?1:2,L=this.channels[S];return L.setBkgData(D),m(u,b,this.cmdHistory),!0},h.reset=function(){for(var u=0;u<Object.keys(this.channels).length;u++){var b=this.channels[u];b&&b.reset()}this.cmdHistory=_()},h.cueSplitAtTime=function(u){for(var b=0;b<this.channels.length;b++){var p=this.channels[b];p&&p.cueSplitAtTime(u)}},f}();function m(f,h,o){o.a=f,o.b=h}function T(f,h,o){return o.a===f&&o.b===h}function _(){return{a:null,b:null}}H.default=y},"./src/utils/codecs.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"isCodecType",function(){return P}),I.d(H,"isCodecSupportedInMp4",function(){return R});var W={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 P(K,N){var e=W[N];return!!e&&e[K.slice(0,4)]===!0}function R(K,N){return MediaSource.isTypeSupported((N||"video")+'/mp4;codecs="'+K+'"')}},"./src/utils/cues.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/utils/vttparser.ts"),P=I("./src/utils/webvtt-parser.ts"),R=I("./src/utils/texttrack-utils.ts"),K=/\s/,N={newCue:function(C,g,v,c){for(var s=[],i,l,a,n,r,t=self.VTTCue||self.TextTrackCue,E=0;E<c.rows.length;E++)if(i=c.rows[E],a=!0,n=0,r="",!i.isEmpty()){for(var y=0;y<i.chars.length;y++)K.test(i.chars[y].uchar)&&a?n++:(r+=i.chars[y].uchar,a=!1);i.cueStartTime=g,g===v&&(v+=1e-4),n>=16?n--:n++;var m=Object(W.fixLineBreaks)(r.trim()),T=Object(P.generateCueId)(g,v,m);(!C||!C.cues||!C.cues.getCueById(T))&&(l=new t(g,v,m),l.id=T,l.line=E+1,l.align="left",l.position=10+Math.min(80,Math.floor(n*8/32)*10),s.push(l))}return C&&s.length&&(s.sort(function(_,f){return _.line==="auto"||f.line==="auto"?0:_.line>8&&f.line>8?f.line-_.line:_.line-f.line}),s.forEach(function(_){return Object(R.addCueToTrack)(C,_)})),s}};H.default=N},"./src/utils/discontinuities.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"findFirstFragWithCC",function(){return K}),I.d(H,"shouldAlignOnDiscontinuities",function(){return N}),I.d(H,"findDiscontinuousReferenceFrag",function(){return e}),I.d(H,"adjustSlidingStart",function(){return g}),I.d(H,"alignStream",function(){return v}),I.d(H,"alignPDT",function(){return s}),I.d(H,"alignFragmentByPDTDelta",function(){return i}),I.d(H,"alignMediaPlaylistByPDT",function(){return l});var W=I("./src/polyfills/number.ts"),P=I("./src/utils/logger.ts"),R=I("./src/controller/level-helper.ts");function K(a,n){for(var r=null,t=0,E=a.length;t<E;t++){var y=a[t];if(y&&y.cc===n){r=y;break}}return r}function N(a,n,r){return!!(n.details&&(r.endCC>r.startCC||a&&a.cc<r.startCC))}function e(a,n){var r=a.fragments,t=n.fragments;if(!t.length||!r.length){P.logger.log("No fragments to align");return}var E=K(r,t[0].cc);if(!E||E&&!E.startPTS){P.logger.log("No frag in previous level to align on");return}return E}function C(a,n){if(a){var r=a.start+n;a.start=a.startPTS=r,a.endPTS=r+a.duration}}function g(a,n){for(var r=n.fragments,t=0,E=r.length;t<E;t++)C(r[t],a);n.fragmentHint&&C(n.fragmentHint,a),n.alignedSliding=!0}function v(a,n,r){if(!n)return;c(a,r,n),!r.alignedSliding&&n.details&&s(r,n.details),!r.alignedSliding&&n.details&&!r.skippedSegments&&Object(R.adjustSliding)(n.details,r)}function c(a,n,r){if(N(a,r,n)){var t=e(r.details,n);t&&Object(W.isFiniteNumber)(t.start)&&(P.logger.log("Adjusting PTS using last level due to CC increase within current level "+n.url),g(t.start,n))}}function s(a,n){if(!n.fragments.length||!a.hasProgramDateTime||!n.hasProgramDateTime)return;var r=n.fragments[0].programDateTime,t=a.fragments[0].programDateTime,E=(t-r)/1e3+n.fragments[0].start;E&&Object(W.isFiniteNumber)(E)&&(P.logger.log("Adjusting PTS using programDateTime delta "+(t-r)+"ms, sliding:"+E.toFixed(3)+" "+a.url+" "),g(E,a))}function i(a,n){var r=a.programDateTime;if(!r)return;var t=(r-n)/1e3;a.start=a.startPTS=t,a.endPTS=t+a.duration}function l(a,n){if(!n.fragments.length||!a.hasProgramDateTime||!n.hasProgramDateTime)return;var r=n.fragments[0].programDateTime,t=n.fragments[0].start,E=r-t*1e3;a.fragments.forEach(function(y){i(y,E)}),a.fragmentHint&&i(a.fragmentHint,E),a.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/utils/ewma.ts"),P=function(){function R(N,e,C){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=C,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new W.default(N),this.fast_=new W.default(e)}var K=R.prototype;return K.update=function(e,C){var g=this.slow_,v=this.fast_;this.slow_.halfLife!==e&&(this.slow_=new W.default(e,g.getEstimate(),g.getTotalWeight())),this.fast_.halfLife!==C&&(this.fast_=new W.default(C,v.getEstimate(),v.getTotalWeight()))},K.sample=function(e,C){e=Math.max(e,this.minDelayMs_);var g=8*C,v=e/1e3,c=g/v;this.fast_.sample(v,c),this.slow_.sample(v,c)},K.canEstimate=function(){var e=this.fast_;return e&&e.getTotalWeight()>=this.minWeight_},K.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},K.destroy=function(){},R}();H.default=P},"./src/utils/ewma.ts":function(Q,H,I){"use strict";I.r(H);var W=function(){function P(K,N,e){N===void 0&&(N=0),e===void 0&&(e=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=K,this.alpha_=K?Math.exp(Math.log(.5)/K):0,this.estimate_=N,this.totalWeight_=e}var R=P.prototype;return R.sample=function(N,e){var C=Math.pow(this.alpha_,N);this.estimate_=e*(1-C)+C*this.estimate_,this.totalWeight_+=N},R.getTotalWeight=function(){return this.totalWeight_},R.getEstimate=function(){if(this.alpha_){var N=1-Math.pow(this.alpha_,this.totalWeight_);if(N)return this.estimate_/N}return this.estimate_},P}();H.default=W},"./src/utils/fetch-loader.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"fetchSupported",function(){return i});var W=I("./src/polyfills/number.ts"),P=I("./src/loader/load-stats.ts"),R=I("./src/demux/chunk-cache.ts");function K(t,E){t.prototype=Object.create(E.prototype),t.prototype.constructor=t,v(t,E)}function N(t){var E=typeof Map=="function"?new Map:void 0;return N=function(m){if(m===null||!g(m))return m;if(typeof m!="function")throw new TypeError("Super expression must either be null or a function");if(typeof E!="undefined"){if(E.has(m))return E.get(m);E.set(m,T)}function T(){return e(m,arguments,c(this).constructor)}return T.prototype=Object.create(m.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),v(T,m)},N(t)}function e(t,E,y){return C()?e=Reflect.construct:e=function(T,_,f){var h=[null];h.push.apply(h,_);var o=Function.bind.apply(T,h),u=new o;return f&&v(u,f.prototype),u},e.apply(null,arguments)}function C(){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(t){return!1}}function g(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function v(t,E){return v=Object.setPrototypeOf||function(m,T){return m.__proto__=T,m},v(t,E)}function c(t){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(y){return y.__proto__||Object.getPrototypeOf(y)},c(t)}function s(){return s=Object.assign||function(t){for(var E=1;E<arguments.length;E++){var y=arguments[E];for(var m in y)Object.prototype.hasOwnProperty.call(y,m)&&(t[m]=y[m])}return t},s.apply(this,arguments)}function i(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(t){}return!1}var l=function(){function t(y){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=y.fetchSetup||n,this.controller=new self.AbortController,this.stats=new P.LoadStats}var E=t.prototype;return E.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},E.abortInternal=function(){var m=this.response;(!m||!m.ok)&&(this.stats.aborted=!0,this.controller.abort())},E.abort=function(){var m;this.abortInternal(),(m=this.callbacks)!==null&&m!==void 0&&m.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},E.load=function(m,T,_){var f=this,h=this.stats;if(h.loading.start)throw new Error("Loader can only be used once.");h.loading.start=self.performance.now();var o=a(m,this.controller.signal),u=_.onProgress,b=m.responseType==="arraybuffer",p=b?"byteLength":"length";this.context=m,this.config=T,this.callbacks=_,this.request=this.fetchSetup(m,o),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){f.abortInternal(),_.onTimeout(h,m,f.response)},T.timeout),self.fetch(this.request).then(function(d){if(f.response=f.loader=d,!d.ok){var A=d.status,D=d.statusText;throw new r(D||"fetch, bad network response",A,d)}return h.loading.first=Math.max(self.performance.now(),h.loading.start),h.total=parseInt(d.headers.get("Content-Length")||"0"),u&&Object(W.isFiniteNumber)(T.highWaterMark)?f.loadProgressively(d,h,m,T.highWaterMark,u):b?d.arrayBuffer():d.text()}).then(function(d){var A=f.response;self.clearTimeout(f.requestTimeout),h.loading.end=Math.max(self.performance.now(),h.loading.first),h.loaded=h.total=d[p];var D={url:A.url,data:d};u&&!Object(W.isFiniteNumber)(T.highWaterMark)&&u(h,m,d,A),_.onSuccess(D,h,m,A)}).catch(function(d){if(self.clearTimeout(f.requestTimeout),h.aborted)return;var A=d.code||0;_.onError({code:A,text:d.message},m,d.details)})},E.getCacheAge=function(){var m=null;if(this.response){var T=this.response.headers.get("age");m=T?parseFloat(T):null}return m},E.loadProgressively=function(m,T,_,f,h){f===void 0&&(f=0);var o=new R.default,u=m.body.getReader(),b=function p(){return u.read().then(function(d){if(d.done)return o.dataLength&&h(T,_,o.flush(),m),Promise.resolve(new ArrayBuffer(0));var A=d.value,D=A.length;return T.loaded+=D,D<f||o.dataLength?(o.push(A),o.dataLength>=f&&h(T,_,o.flush(),m)):h(T,_,A,m),p()}).catch(function(){return Promise.reject()})};return b()},t}();function a(t,E){var y={method:"GET",mode:"cors",credentials:"same-origin",signal:E,headers:new self.Headers(s({},t.headers))};return t.rangeEnd&&y.headers.set("Range","bytes="+t.rangeStart+"-"+String(t.rangeEnd-1)),y}function n(t,E){return new self.Request(t.url,E)}var r=function(t){K(E,t);function E(y,m,T){var _;return _=t.call(this,y)||this,_.code=void 0,_.details=void 0,_.code=m,_.details=T,_}return E}(N(Error));H.default=l},"./src/utils/imsc1-ttml-parser.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"IMSC1_CODEC",function(){return g}),I.d(H,"parseIMSC1",function(){return i});var W=I("./src/utils/mp4-tools.ts"),P=I("./src/utils/vttparser.ts"),R=I("./src/utils/vttcue.ts"),K=I("./src/demux/id3.ts"),N=I("./src/utils/timescale-conversion.ts"),e=I("./src/utils/webvtt-parser.ts");function C(){return C=Object.assign||function(f){for(var h=1;h<arguments.length;h++){var o=arguments[h];for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&(f[u]=o[u])}return f},C.apply(this,arguments)}var g="stpp.ttml.im1t",v=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,c=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,s={left:"start",center:"center",right:"end",start:"start",end:"end"};function i(f,h,o,u,b){var p=Object(W.findBox)(new Uint8Array(f),["mdat"]);if(p.length===0){b(new Error("Could not parse IMSC1 mdat"));return}var d=p[0],A=Object(K.utf8ArrayToStr)(new Uint8Array(f,d.start,d.end-d.start)),D=Object(N.toTimescaleFromScale)(h,1,o);try{u(l(A,D))}catch(S){b(S)}}function l(f,h){var o=new DOMParser,u=o.parseFromString(f,"text/xml"),b=u.getElementsByTagName("tt")[0];if(!b)throw new Error("Invalid ttml");var p={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},d=Object.keys(p).reduce(function(M,O){return M[O]=b.getAttribute("ttp:"+O)||p[O],M},{}),A=b.getAttribute("xml:space")!=="preserve",D=n(a(b,"styling","style")),S=n(a(b,"layout","region")),L=a(b,"body","[begin]");return[].map.call(L,function(M){var O=r(M,A);if(!O||!M.hasAttribute("begin"))return null;var j=m(M.getAttribute("begin"),d),G=m(M.getAttribute("dur"),d),X=m(M.getAttribute("end"),d);if(j===null)throw y(M);if(X===null){if(G===null)throw y(M);X=j+G}var te=new R.default(j-h,X-h,O);te.id=Object(e.generateCueId)(te.startTime,te.endTime,te.text);var fe=S[M.getAttribute("region")],ve=D[M.getAttribute("style")];te.position=10,te.size=80;var he=t(fe,ve),xe=he.textAlign;if(xe){var Se=s[xe];Se&&(te.lineAlign=Se),te.align=xe}return C(te,he),te}).filter(function(M){return M!==null})}function a(f,h,o){var u=f.getElementsByTagName(h)[0];return u?[].slice.call(u.querySelectorAll(o)):[]}function n(f){return f.reduce(function(h,o){var u=o.getAttribute("xml:id");return u&&(h[u]=o),h},{})}function r(f,h){return[].slice.call(f.childNodes).reduce(function(o,u,b){var p;return u.nodeName==="br"&&b?o+`
`:(p=u.childNodes)!==null&&p!==void 0&&p.length?r(u,h):h?o+u.textContent.trim().replace(/\s+/g," "):o+u.textContent},"")}function t(f,h){var o="http://www.w3.org/ns/ttml#styling",u=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return u.reduce(function(b,p){var d=E(h,o,p)||E(f,o,p);return d&&(b[p]=d),b},{})}function E(f,h,o){return f.hasAttributeNS(h,o)?f.getAttributeNS(h,o):null}function y(f){return new Error("Could not parse ttml timestamp "+f)}function m(f,h){if(!f)return null;var o=Object(P.parseTimeStamp)(f);return o===null&&(v.test(f)?o=T(f,h):c.test(f)&&(o=_(f,h))),o}function T(f,h){var o=v.exec(f),u=(o[4]|0)+(o[5]|0)/h.subFrameRate;return(o[1]|0)*3600+(o[2]|0)*60+(o[3]|0)+u/h.frameRate}function _(f,h){var o=c.exec(f),u=Number(o[1]),b=o[2];switch(b){case"h":return u*3600;case"m":return u*60;case"ms":return u*1e3;case"f":return u/h.frameRate;case"t":return u/h.tickRate}return u}},"./src/utils/logger.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"enableLogs",function(){return e}),I.d(H,"logger",function(){return C});var W=function(){},P={trace:W,debug:W,log:W,warn:W,info:W,error:W},R=P;function K(g){var v=self.console[g];return v?v.bind(self.console,"["+g+"] >"):W}function N(g){for(var v=arguments.length,c=new Array(v>1?v-1:0),s=1;s<v;s++)c[s-1]=arguments[s];c.forEach(function(i){R[i]=g[i]?g[i].bind(g):K(i)})}function e(g){if(self.console&&g===!0||typeof g=="object"){N(g,"debug","log","info","warn","error");try{R.log()}catch(v){R=P}}else R=P}var C=R},"./src/utils/mediakeys-helper.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"KeySystems",function(){return W}),I.d(H,"requestMediaKeySystemAccess",function(){return P});var W;(function(R){R.WIDEVINE="com.widevine.alpha",R.PLAYREADY="com.microsoft.playready"})(W||(W={}));var P=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"getMediaSource",function(){return W});function W(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"bin2str",function(){return N}),I.d(H,"readUint16",function(){return e}),I.d(H,"readUint32",function(){return C}),I.d(H,"writeUint32",function(){return g}),I.d(H,"findBox",function(){return v}),I.d(H,"parseSegmentIndex",function(){return c}),I.d(H,"parseInitSegment",function(){return s}),I.d(H,"getStartDTS",function(){return i}),I.d(H,"getDuration",function(){return l}),I.d(H,"computeRawDurationFromSamples",function(){return a}),I.d(H,"offsetStartDTS",function(){return n}),I.d(H,"segmentValidRange",function(){return r}),I.d(H,"appendUint8Array",function(){return t});var W=I("./src/utils/typed-array.ts"),P=I("./src/loader/fragment.ts"),R=Math.pow(2,32)-1,K=[].push;function N(E){return String.fromCharCode.apply(null,E)}function e(E,y){"data"in E&&(y+=E.start,E=E.data);var m=E[y]<<8|E[y+1];return m<0?65536+m:m}function C(E,y){"data"in E&&(y+=E.start,E=E.data);var m=E[y]<<24|E[y+1]<<16|E[y+2]<<8|E[y+3];return m<0?4294967296+m:m}function g(E,y,m){"data"in E&&(y+=E.start,E=E.data),E[y]=m>>24,E[y+1]=m>>16&255,E[y+2]=m>>8&255,E[y+3]=m&255}function v(E,y){var m=[];if(!y.length)return m;var T,_,f;"data"in E?(T=E.data,_=E.start,f=E.end):(T=E,_=0,f=T.byteLength);for(var h=_;h<f;){var o=C(T,h),u=N(T.subarray(h+4,h+8)),b=o>1?h+o:f;if(u===y[0])if(y.length===1)m.push({data:T,start:h+8,end:b});else{var p=v({data:T,start:h+8,end:b},y.slice(1));p.length&&K.apply(m,p)}h=b}return m}function c(E){var y=v(E,["moov"]),m=y[0],T=m?m.end:null,_=v(E,["sidx"]);if(!_||!_[0])return null;var f=[],h=_[0],o=h.data[0],u=o===0?8:16,b=C(h,u);u+=4;var p=0,d=0;o===0?u+=8:u+=16,u+=2;var A=h.end+d,D=e(h,u);u+=2;for(var S=0;S<D;S++){var L=u,M=C(h,L);L+=4;var O=M&2147483647,j=(M&2147483648)>>>31;if(j===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var G=C(h,L);L+=4,f.push({referenceSize:O,subsegmentDuration:G,info:{duration:G/b,start:A,end:A+O-1}}),A+=O,L+=4,u=L}return{earliestPresentationTime:p,timescale:b,version:o,referencesCount:D,references:f,moovEndOffset:T}}function s(E){for(var y=[],m=v(E,["moov","trak"]),T=0;T<m.length;T++){var _=m[T],f=v(_,["tkhd"])[0];if(f){var h=f.data[f.start],o=h===0?12:20,u=C(f,o),b=v(_,["mdia","mdhd"])[0];if(b){h=b.data[b.start],o=h===0?12:20;var p=C(b,o),d=v(_,["mdia","hdlr"])[0];if(d){var A=N(d.data.subarray(d.start+8,d.start+12)),D={soun:P.ElementaryStreamTypes.AUDIO,vide:P.ElementaryStreamTypes.VIDEO}[A];if(D){var S=v(_,["mdia","minf","stbl","stsd"])[0],L=void 0;S&&(L=N(S.data.subarray(S.start+12,S.start+16))),y[u]={timescale:p,type:D},y[D]={timescale:p,id:u,codec:L}}}}}}var M=v(E,["moov","mvex","trex"]);return M.forEach(function(O){var j=C(O,4),G=y[j];G&&(G.default={duration:C(O,12),flags:C(O,20)})}),y}function i(E,y){return v(y,["moof","traf"]).reduce(function(m,T){var _=v(T,["tfdt"])[0],f=_.data[_.start],h=v(T,["tfhd"]).reduce(function(o,u){var b=C(u,4),p=E[b];if(p){var d=C(_,4);f===1&&(d*=Math.pow(2,32),d+=C(_,8));var A=p.timescale||9e4,D=d/A;if(isFinite(D)&&(o===null||D<o))return D}return o},null);return h!==null&&isFinite(h)&&(m===null||h<m)?h:m},null)||0}function l(E,y){for(var m=0,T=0,_=0,f=v(E,["moof","traf"]),h=0;h<f.length;h++){var o=f[h],u=v(o,["tfhd"])[0],b=C(u,4),p=y[b];if(!p)continue;var d=p.default,A=C(u,0)|(d==null?void 0:d.flags),D=d==null?void 0:d.duration;A&8&&(A&2?D=C(u,12):D=C(u,8));for(var S=p.timescale||9e4,L=v(o,["trun"]),M=0;M<L.length;M++){if(D){var O=C(L[M],4);m=D*O}else m=a(L[M]);p.type===P.ElementaryStreamTypes.VIDEO?T+=m/S:p.type===P.ElementaryStreamTypes.AUDIO&&(_+=m/S)}}if(T===0&&_===0){var j=c(E);if(j!=null&&j.references)return j.references.reduce(function(G,X){return G+X.info.duration||0},0)}return T||_}function a(E){var y=C(E,0),m=8;y&1&&(m+=4),y&4&&(m+=4);for(var T=0,_=C(E,4),f=0;f<_;f++){if(y&256){var h=C(E,m);T+=h,m+=4}y&512&&(m+=4),y&1024&&(m+=4),y&2048&&(m+=4)}return T}function n(E,y,m){v(y,["moof","traf"]).forEach(function(T){v(T,["tfhd"]).forEach(function(_){var f=C(_,4),h=E[f];if(!h)return;var o=h.timescale||9e4;v(T,["tfdt"]).forEach(function(u){var b=u.data[u.start],p=C(u,4);if(b===0)g(u,4,p-m*o);else{p*=Math.pow(2,32),p+=C(u,8),p-=m*o,p=Math.max(p,0);var d=Math.floor(p/(R+1)),A=Math.floor(p%(R+1));g(u,4,d),g(u,8,A)}})})})}function r(E){var y={valid:null,remainder:null},m=v(E,["moof"]);if(m){if(m.length<2)return y.remainder=E,y}else return y;var T=m[m.length-1];return y.valid=Object(W.sliceUint8)(E,0,T.start-8),y.remainder=Object(W.sliceUint8)(E,T.start-8),y}function t(E,y){var m=new Uint8Array(E.length+y.length);return m.set(E),m.set(y,E.length),m}},"./src/utils/output-filter.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return W});var W=function(){function P(K,N){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=K,this.trackName=N}var R=P.prototype;return R.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},R.newCue=function(N,e,C){(this.startTime===null||this.startTime>N)&&(this.startTime=N),this.endTime=e,this.screen=C,this.timelineController.createCaptionsTrack(this.trackName)},R.reset=function(){this.cueRanges=[]},P}()},"./src/utils/texttrack-utils.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"sendAddTrackEvent",function(){return P}),I.d(H,"addCueToTrack",function(){return R}),I.d(H,"clearCurrentCues",function(){return K}),I.d(H,"removeCuesInRange",function(){return N}),I.d(H,"getCuesInRange",function(){return C});var W=I("./src/utils/logger.ts");function P(g,v){var c;try{c=new Event("addtrack")}catch(s){c=document.createEvent("Event"),c.initEvent("addtrack",!1,!1)}c.track=g,v.dispatchEvent(c)}function R(g,v){var c=g.mode;if(c==="disabled"&&(g.mode="hidden"),g.cues&&!g.cues.getCueById(v.id))try{if(g.addCue(v),!g.cues.getCueById(v.id))throw new Error("addCue is failed for: "+v)}catch(i){W.logger.debug("[texttrack-utils]: "+i);var s=new self.TextTrackCue(v.startTime,v.endTime,v.text);s.id=v.id,g.addCue(s)}c==="disabled"&&(g.mode=c)}function K(g){var v=g.mode;if(v==="disabled"&&(g.mode="hidden"),g.cues)for(var c=g.cues.length;c--;)g.removeCue(g.cues[c]);v==="disabled"&&(g.mode=v)}function N(g,v,c){var s=g.mode;if(s==="disabled"&&(g.mode="hidden"),g.cues&&g.cues.length>0)for(var i=C(g.cues,v,c),l=0;l<i.length;l++)g.removeCue(i[l]);s==="disabled"&&(g.mode=s)}function e(g,v){if(v<g[0].startTime)return 0;var c=g.length-1;if(v>g[c].endTime)return-1;for(var s=0,i=c;s<=i;){var l=Math.floor((i+s)/2);if(v<g[l].startTime)i=l-1;else if(v>g[l].startTime&&s<c)s=l+1;else return l}return g[s].startTime-v<v-g[i].startTime?s:i}function C(g,v,c){var s=[],i=e(g,v);if(i>-1)for(var l=i,a=g.length;l<a;l++){var n=g[l];if(n.startTime>=v&&n.endTime<=c)s.push(n);else if(n.startTime>c)return s}return s}},"./src/utils/time-ranges.ts":function(Q,H,I){"use strict";I.r(H);var W={toString:function(R){for(var K="",N=R.length,e=0;e<N;e++)K+="["+R.start(e).toFixed(3)+","+R.end(e).toFixed(3)+"]";return K}};H.default=W},"./src/utils/timescale-conversion.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"toTimescaleFromBase",function(){return P}),I.d(H,"toTimescaleFromScale",function(){return R}),I.d(H,"toMsFromMpegTsClock",function(){return K}),I.d(H,"toMpegTsClockFromTimescale",function(){return N});var W=9e4;function P(e,C,g,v){g===void 0&&(g=1),v===void 0&&(v=!1);var c=e*C*g;return v?Math.round(c):c}function R(e,C,g,v){return g===void 0&&(g=1),v===void 0&&(v=!1),P(e,C,1/g,v)}function K(e,C){return C===void 0&&(C=!1),P(e,1e3,1/W,C)}function N(e,C){return C===void 0&&(C=1),P(e,W,1/C)}},"./src/utils/typed-array.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"sliceUint8",function(){return W});function W(P,R,K){return Uint8Array.prototype.slice?P.slice(R,K):new Uint8Array(Array.prototype.slice.call(P,R,K))}},"./src/utils/vttcue.ts":function(Q,H,I){"use strict";I.r(H),H.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var W=["","lr","rl"],P=["start","middle","end","left","right"];function R(g,v){if(typeof v!="string")return!1;if(!Array.isArray(g))return!1;var c=v.toLowerCase();return~g.indexOf(c)?c:!1}function K(g){return R(W,g)}function N(g){return R(P,g)}function e(g){for(var v=arguments.length,c=new Array(v>1?v-1:0),s=1;s<v;s++)c[s-1]=arguments[s];for(var i=1;i<arguments.length;i++){var l=arguments[i];for(var a in l)g[a]=l[a]}return g}function C(g,v,c){var s=this,i={enumerable:!0};s.hasBeenReset=!1;var l="",a=!1,n=g,r=v,t=c,E=null,y="",m=!0,T="auto",_="start",f=50,h="middle",o=50,u="middle";Object.defineProperty(s,"id",e({},i,{get:function(){return l},set:function(p){l=""+p}})),Object.defineProperty(s,"pauseOnExit",e({},i,{get:function(){return a},set:function(p){a=!!p}})),Object.defineProperty(s,"startTime",e({},i,{get:function(){return n},set:function(p){if(typeof p!="number")throw new TypeError("Start time must be set to a number.");n=p,this.hasBeenReset=!0}})),Object.defineProperty(s,"endTime",e({},i,{get:function(){return r},set:function(p){if(typeof p!="number")throw new TypeError("End time must be set to a number.");r=p,this.hasBeenReset=!0}})),Object.defineProperty(s,"text",e({},i,{get:function(){return t},set:function(p){t=""+p,this.hasBeenReset=!0}})),Object.defineProperty(s,"region",e({},i,{get:function(){return E},set:function(p){E=p,this.hasBeenReset=!0}})),Object.defineProperty(s,"vertical",e({},i,{get:function(){return y},set:function(p){var d=K(p);if(d===!1)throw new SyntaxError("An invalid or illegal string was specified.");y=d,this.hasBeenReset=!0}})),Object.defineProperty(s,"snapToLines",e({},i,{get:function(){return m},set:function(p){m=!!p,this.hasBeenReset=!0}})),Object.defineProperty(s,"line",e({},i,{get:function(){return T},set:function(p){if(typeof p!="number"&&p!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");T=p,this.hasBeenReset=!0}})),Object.defineProperty(s,"lineAlign",e({},i,{get:function(){return _},set:function(p){var d=N(p);if(!d)throw new SyntaxError("An invalid or illegal string was specified.");_=d,this.hasBeenReset=!0}})),Object.defineProperty(s,"position",e({},i,{get:function(){return f},set:function(p){if(p<0||p>100)throw new Error("Position must be between 0 and 100.");f=p,this.hasBeenReset=!0}})),Object.defineProperty(s,"positionAlign",e({},i,{get:function(){return h},set:function(p){var d=N(p);if(!d)throw new SyntaxError("An invalid or illegal string was specified.");h=d,this.hasBeenReset=!0}})),Object.defineProperty(s,"size",e({},i,{get:function(){return o},set:function(p){if(p<0||p>100)throw new Error("Size must be between 0 and 100.");o=p,this.hasBeenReset=!0}})),Object.defineProperty(s,"align",e({},i,{get:function(){return u},set:function(p){var d=N(p);if(!d)throw new SyntaxError("An invalid or illegal string was specified.");u=d,this.hasBeenReset=!0}})),s.displayState=void 0}return C.prototype.getCueAsHTML=function(){var g=self.WebVTT;return g.convertCueToDOMTree(self,this.text)},C}()},"./src/utils/vttparser.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"parseTimeStamp",function(){return R}),I.d(H,"fixLineBreaks",function(){return v}),I.d(H,"VTTParser",function(){return c});var W=I("./src/utils/vttcue.ts"),P=function(){function s(){}var i=s.prototype;return i.decode=function(a,n){if(!a)return"";if(typeof a!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(a))},s}();function R(s){function i(a,n,r,t){return(a|0)*3600+(n|0)*60+(r|0)+parseFloat(t||0)}var l=s.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return l?parseFloat(l[2])>59?i(l[2],l[3],0,l[4]):i(l[1],l[2],l[3],l[4]):null}var K=function(){function s(){this.values=Object.create(null)}var i=s.prototype;return i.set=function(a,n){!this.get(a)&&n!==""&&(this.values[a]=n)},i.get=function(a,n,r){return r?this.has(a)?this.values[a]:n[r]:this.has(a)?this.values[a]:n},i.has=function(a){return a in this.values},i.alt=function(a,n,r){for(var t=0;t<r.length;++t)if(n===r[t]){this.set(a,n);break}},i.integer=function(a,n){/^-?\d+$/.test(n)&&this.set(a,parseInt(n,10))},i.percent=function(a,n){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(n)){var r=parseFloat(n);if(r>=0&&r<=100)return this.set(a,r),!0}return!1},s}();function N(s,i,l,a){var n=a?s.split(a):[s];for(var r in n){if(typeof n[r]!="string")continue;var t=n[r].split(l);if(t.length!==2)continue;var E=t[0],y=t[1];i(E,y)}}var e=new W.default(0,0,""),C=e.align==="middle"?"middle":"center";function g(s,i,l){var a=s;function n(){var E=R(s);if(E===null)throw new Error("Malformed timestamp: "+a);return s=s.replace(/^[^\sa-zA-Z-]+/,""),E}function r(E,y){var m=new K;N(E,function(f,h){var o;switch(f){case"region":for(var u=l.length-1;u>=0;u--)if(l[u].id===h){m.set(f,l[u].region);break}break;case"vertical":m.alt(f,h,["rl","lr"]);break;case"line":o=h.split(","),m.integer(f,o[0]),m.percent(f,o[0])&&m.set("snapToLines",!1),m.alt(f,o[0],["auto"]),o.length===2&&m.alt("lineAlign",o[1],["start",C,"end"]);break;case"position":o=h.split(","),m.percent(f,o[0]),o.length===2&&m.alt("positionAlign",o[1],["start",C,"end","line-left","line-right","auto"]);break;case"size":m.percent(f,h);break;case"align":m.alt(f,h,["start",C,"end","left","right"]);break}},/:/,/\s/),y.region=m.get("region",null),y.vertical=m.get("vertical","");var T=m.get("line","auto");T==="auto"&&e.line===-1&&(T=-1),y.line=T,y.lineAlign=m.get("lineAlign","start"),y.snapToLines=m.get("snapToLines",!0),y.size=m.get("size",100),y.align=m.get("align",C);var _=m.get("position","auto");_==="auto"&&e.position===50&&(_=y.align==="start"||y.align==="left"?0:y.align==="end"||y.align==="right"?100:50),y.position=_}function t(){s=s.replace(/^\s+/,"")}if(t(),i.startTime=n(),t(),s.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+a);s=s.substr(3),t(),i.endTime=n(),t(),r(s,i)}function v(s){return s.replace(/<br(?: \/)?>/gi,`
`)}var c=function(){function s(){this.state="INITIAL",this.buffer="",this.decoder=new P,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var i=s.prototype;return i.parse=function(a){var n=this;a&&(n.buffer+=n.decoder.decode(a,{stream:!0}));function r(){var _=n.buffer,f=0;for(_=v(_);f<_.length&&_[f]!=="\r"&&_[f]!==`
`;)++f;var h=_.substr(0,f);return _[f]==="\r"&&++f,_[f]===`
`&&++f,n.buffer=_.substr(f),h}function t(_){N(_,function(f,h){},/:/)}try{var E="";if(n.state==="INITIAL"){if(!/\r\n|\n/.test(n.buffer))return this;E=r();var y=E.match(/^()?WEBVTT([ \t].*)?$/);if(!y||!y[0])throw new Error("Malformed WebVTT signature.");n.state="HEADER"}for(var m=!1;n.buffer;){if(!/\r\n|\n/.test(n.buffer))return this;m?m=!1:E=r();switch(n.state){case"HEADER":/:/.test(E)?t(E):E||(n.state="ID");continue;case"NOTE":E||(n.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(E)){n.state="NOTE";break}if(!E)continue;if(n.cue=new W.default(0,0,""),n.state="CUE",E.indexOf("-->")===-1){n.cue.id=E;continue}case"CUE":if(!n.cue){n.state="BADCUE";continue}try{g(E,n.cue,n.regionList)}catch(_){n.cue=null,n.state="BADCUE";continue}n.state="CUETEXT";continue;case"CUETEXT":{var T=E.indexOf("-->")!==-1;if(!E||T&&(m=!0)){n.oncue&&n.cue&&n.oncue(n.cue),n.cue=null,n.state="ID";continue}if(n.cue===null)continue;n.cue.text&&(n.cue.text+=`
`),n.cue.text+=E}continue;case"BADCUE":E||(n.state="ID")}}}catch(_){n.state==="CUETEXT"&&n.cue&&n.oncue&&n.oncue(n.cue),n.cue=null,n.state=n.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},i.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(n){a.onparsingerror&&a.onparsingerror(n)}return a.onflush&&a.onflush(),this},s}()},"./src/utils/webvtt-parser.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"generateCueId",function(){return c}),I.d(H,"parseWebVTT",function(){return i});var W=I("./src/polyfills/number.ts"),P=I("./src/utils/vttparser.ts"),R=I("./src/demux/id3.ts"),K=I("./src/utils/timescale-conversion.ts"),N=I("./src/remux/mp4-remuxer.ts"),e=/\r\n|\n\r|\n|\r/g,C=function(a,n,r){return r===void 0&&(r=0),a.substr(r,n.length)===n},g=function(a){var n=parseInt(a.substr(-3)),r=parseInt(a.substr(-6,2)),t=parseInt(a.substr(-9,2)),E=a.length>9?parseInt(a.substr(0,a.indexOf(":"))):0;if(!Object(W.isFiniteNumber)(n)||!Object(W.isFiniteNumber)(r)||!Object(W.isFiniteNumber)(t)||!Object(W.isFiniteNumber)(E))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+a);return n+=1e3*r,n+=60*1e3*t,n+=60*60*1e3*E,n},v=function(a){for(var n=5381,r=a.length;r;)n=n*33^a.charCodeAt(--r);return(n>>>0).toString()};function c(l,a,n){return v(l.toString())+v(a.toString())+v(n)}var s=function(a,n,r){var t=a[n],E=a[t.prevCC];if(!E||!E.new&&t.new){a.ccOffset=a.presentationOffset=t.start,t.new=!1;return}for(;(y=E)!==null&&y!==void 0&&y.new;){var y;a.ccOffset+=t.start-E.start,t.new=!1,t=E,E=a[t.prevCC]}a.presentationOffset=r};function i(l,a,n,r,t,E,y,m){var T=new P.VTTParser,_=Object(R.utf8ArrayToStr)(new Uint8Array(l)).trim().replace(e,`
`).split(`
`),f=[],h=Object(K.toMpegTsClockFromTimescale)(a,n),o="00:00.000",u=0,b=0,p,d=!0,A=!1;T.oncue=function(D){var S=r[t],L=r.ccOffset,M=(u-h)/9e4;if(S!=null&&S.new&&(b!==void 0?L=r.ccOffset=S.start:s(r,t,M)),M&&(L=M-r.presentationOffset),A){var O=D.endTime-D.startTime,j=Object(N.normalizePts)((D.startTime+L-b)*9e4,E*9e4)/9e4;D.startTime=j,D.endTime=j+O}var G=D.text.trim();D.text=decodeURIComponent(encodeURIComponent(G)),D.id||(D.id=c(D.startTime,D.endTime,G)),D.endTime>0&&f.push(D)},T.onparsingerror=function(D){p=D},T.onflush=function(){if(p){m(p);return}y(f)},_.forEach(function(D){if(d)if(C(D,"X-TIMESTAMP-MAP=")){d=!1,A=!0,D.substr(16).split(",").forEach(function(S){C(S,"LOCAL:")?o=S.substr(6):C(S,"MPEGTS:")&&(u=parseInt(S.substr(7)))});try{b=g(o)/1e3}catch(S){A=!1,p=S}return}else D===""&&(d=!1);T.parse(D+`
`)}),T.flush()}},"./src/utils/xhr-loader.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/utils/logger.ts"),P=I("./src/loader/load-stats.ts"),R=/^age:\s*[\d.]+\s*$/m,K=function(){function N(C){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=C?C.xhrSetup:null,this.stats=new P.LoadStats,this.retryDelay=0}var e=N.prototype;return e.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},e.abortInternal=function(){var g=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),g&&(g.onreadystatechange=null,g.onprogress=null,g.readyState!==4&&(this.stats.aborted=!0,g.abort()))},e.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},e.load=function(g,v,c){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=g,this.config=v,this.callbacks=c,this.retryDelay=v.retryDelay,this.loadInternal()},e.loadInternal=function(){var g=this.config,v=this.context;if(!g)return;var c=this.loader=new self.XMLHttpRequest,s=this.stats;s.loading.first=0,s.loaded=0;var i=this.xhrSetup;try{if(i)try{i(c,v.url)}catch(n){c.open("GET",v.url,!0),i(c,v.url)}c.readyState||c.open("GET",v.url,!0);var l=this.context.headers;if(l)for(var a in l)c.setRequestHeader(a,l[a])}catch(n){this.callbacks.onError({code:c.status,text:n.message},v,c);return}v.rangeEnd&&c.setRequestHeader("Range","bytes="+v.rangeStart+"-"+(v.rangeEnd-1)),c.onreadystatechange=this.readystatechange.bind(this),c.onprogress=this.loadprogress.bind(this),c.responseType=v.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),g.timeout),c.send()},e.readystatechange=function(){var g=this.context,v=this.loader,c=this.stats;if(!g||!v)return;var s=v.readyState,i=this.config;if(c.aborted)return;if(s>=2)if(self.clearTimeout(this.requestTimeout),c.loading.first===0&&(c.loading.first=Math.max(self.performance.now(),c.loading.start)),s===4){v.onreadystatechange=null,v.onprogress=null;var l=v.status;if(l>=200&&l<300){c.loading.end=Math.max(self.performance.now(),c.loading.first);var a,n;if(g.responseType==="arraybuffer"?(a=v.response,n=a.byteLength):(a=v.responseText,n=a.length),c.loaded=c.total=n,!this.callbacks)return;var r=this.callbacks.onProgress;if(r&&r(c,g,a,v),!this.callbacks)return;var t={url:v.responseURL,data:a};this.callbacks.onSuccess(t,c,g,v)}else c.retry>=i.maxRetry||l>=400&&l<499?(W.logger.error(l+" while loading "+g.url),this.callbacks.onError({code:l,text:v.statusText},g,v)):(W.logger.warn(l+" while loading "+g.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,i.maxRetryDelay),c.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.timeout)},e.loadtimeout=function(){W.logger.warn("timeout while loading "+this.context.url);var g=this.callbacks;g&&(this.abortInternal(),g.onTimeout(this.stats,this.context,this.loader))},e.loadprogress=function(g){var v=this.stats;v.loaded=g.loaded,g.lengthComputable&&(v.total=g.total)},e.getCacheAge=function(){var g=null;if(this.loader&&R.test(this.loader.getAllResponseHeaders())){var v=this.loader.getResponseHeader("age");g=v?parseFloat(v):null}return g},N}();H.default=K}}).default})},vHTk:function(Ne,ne,U){Ne.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(Ne,ne,U){"use strict";U.d(ne,"a",function(){return Pe});var Q=U("rePB"),H=U("VTBJ"),I=U("KQm4"),W=U("U8pU"),P=U("ODXe"),R=U("q1tI"),K=U("TSYQ"),N=U.n(K),e=U("Gytx"),C=U.n(e),g=U("Kwbf"),v=U("t23M"),c=U("qx4F"),s=U("6eGT"),i=U("IBYe"),l=U("Ff2n"),a=U("c+Xe"),n=U("fyJ8"),r=U("biw7");function t(oe,me,be,we,pe){var ye=be[oe]||{},re=be[me]||{},Z,J;ye.fixed==="left"?Z=we.left[oe]:re.fixed==="right"&&(J=we.right[me]);var V=!1,Y=!1,q=!1,ee=!1,le=be[me+1],ge=be[oe-1];if(pe==="rtl"){if(Z!==void 0){var Oe=ge&&ge.fixed==="left";ee=!Oe}else if(J!==void 0){var Ke=le&&le.fixed==="right";q=!Ke}}else if(Z!==void 0){var ze=le&&le.fixed==="left";V=!ze}else if(J!==void 0){var ke=ge&&ge.fixed==="right";Y=!ke}return{fixLeft:Z,fixRight:J,lastFixLeft:V,firstFixRight:Y,lastFixRight:q,firstFixLeft:ee,isSticky:we.isSticky}}var E=U("sR1s");function y(oe){var me=oe.cells,be=oe.stickyOffsets,we=oe.flattenColumns,pe=oe.rowComponent,ye=oe.cellComponent,re=oe.onHeaderRow,Z=oe.index,J=R.useContext(r.a),V=J.prefixCls,Y=J.direction,q;re&&(q=re(me.map(function(le){return le.column}),Z));var ee=Object(E.a)(me.map(function(le){return le.column}));return R.createElement(pe,Object.assign({},q),me.map(function(le,ge){var Oe=le.column,Ke=t(le.colStart,le.colEnd,we,be,Y),ze;return Oe&&Oe.onHeaderCell&&(ze=le.column.onHeaderCell(Oe)),R.createElement(n.a,Object.assign({},le,{ellipsis:Oe.ellipsis,align:Oe.align,component:ye,prefixCls:V,key:ee[ge]},Ke,{additionalProps:ze,rowType:"header"}))}))}y.displayName="HeaderRow";var m=y;function T(oe){var me=[];function be(re,Z){var J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;me[J]=me[J]||[];var V=Z,Y=re.filter(Boolean).map(function(q){var ee={key:q.key,className:q.className||"",children:q.title,column:q,colStart:V},le=1,ge=q.children;return ge&&ge.length>0&&(le=be(ge,V,J+1).reduce(function(Oe,Ke){return Oe+Ke},0),ee.hasSubColumns=!0),"colSpan"in q&&(le=q.colSpan),"rowSpan"in q&&(ee.rowSpan=q.rowSpan),ee.colSpan=le,ee.colEnd=ee.colStart+le-1,me[J].push(ee),V+=le,le});return Y}be(oe,0);for(var we=me.length,pe=function(Z){me[Z].forEach(function(J){!("rowSpan"in J)&&!J.hasSubColumns&&(J.rowSpan=we-Z)})},ye=0;ye<we;ye+=1)pe(ye);return me}function _(oe){var me=oe.stickyOffsets,be=oe.columns,we=oe.flattenColumns,pe=oe.onHeaderRow,ye=R.useContext(r.a),re=ye.prefixCls,Z=ye.getComponent,J=R.useMemo(function(){return T(be)},[be]),V=Z(["header","wrapper"],"thead"),Y=Z(["header","row"],"tr"),q=Z(["header","cell"],"th");return R.createElement(V,{className:"".concat(re,"-thead")},J.map(function(ee,le){var ge=R.createElement(m,{key:le,flattenColumns:we,cells:ee,stickyOffsets:me,rowComponent:Y,cellComponent:q,onHeaderRow:pe,index:le});return ge}))}var f=_,h=U("hW8S");function o(oe){for(var me=oe.colWidths,be=oe.columns,we=oe.columCount,pe=[],ye=we||be.length,re=!1,Z=ye-1;Z>=0;Z-=1){var J=me[Z],V=be&&be[Z],Y=V&&V[h.a];(J||Y||re)&&(pe.unshift(R.createElement("col",Object.assign({key:Z,style:{width:J,minWidth:J}},Y))),re=!0)}return R.createElement("colgroup",null,pe)}var u=o;function b(oe,me){return Object(R.useMemo)(function(){for(var be=[],we=0;we<me;we+=1){var pe=oe[we];if(pe!==void 0)be[we]=pe;else return null}return be},[oe.join("_"),me])}var p=R.forwardRef(function(oe,me){var be=oe.noData,we=oe.columns,pe=oe.flattenColumns,ye=oe.colWidths,re=oe.columCount,Z=oe.stickyOffsets,J=oe.direction,V=oe.fixHeader,Y=oe.offsetHeader,q=oe.stickyClassName,ee=oe.onScroll,le=Object(l.a)(oe,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),ge=R.useContext(r.a),Oe=ge.prefixCls,Ke=ge.scrollbarSize,ze=ge.isSticky,ke=ze&&!V?0:Ke,Je=R.useRef(null),Qe=R.useCallback(function(st){Object(a.b)(me,st),Object(a.b)(Je,st)},[]);R.useEffect(function(){var st;function ut(Ue){var pt=Ue.currentTarget,Xe=Ue.deltaX;Xe&&(ee({currentTarget:pt,scrollLeft:pt.scrollLeft+Xe}),Ue.preventDefault())}return(st=Je.current)===null||st===void 0||st.addEventListener("wheel",ut),function(){var Ue;(Ue=Je.current)===null||Ue===void 0||Ue.removeEventListener("wheel",ut)}},[]);var Ge=pe[pe.length-1],at={fixed:Ge?Ge.fixed:null,onHeaderCell:function(){return{className:"".concat(Oe,"-cell-scrollbar")}}},nt=Object(R.useMemo)(function(){return ke?[].concat(Object(I.a)(we),[at]):we},[ke,we]),rt=Object(R.useMemo)(function(){return ke?[].concat(Object(I.a)(pe),[at]):pe},[ke,pe]),dt=Object(R.useMemo)(function(){var st=Z.right,ut=Z.left;return Object(H.a)(Object(H.a)({},Z),{},{left:J==="rtl"?[].concat(Object(I.a)(ut.map(function(Ue){return Ue+ke})),[0]):ut,right:J==="rtl"?st:[].concat(Object(I.a)(st.map(function(Ue){return Ue+ke})),[0]),isSticky:ze})},[ke,Z,ze]),et=b(ye,re);return R.createElement("div",{style:Object(H.a)({overflow:"hidden"},ze?{top:Y}:{}),ref:Qe,className:N()("".concat(Oe,"-header"),Object(Q.a)({},q,!!q))},R.createElement("table",{style:{tableLayout:"fixed",visibility:be||et?null:"hidden"}},R.createElement(u,{colWidths:et?[].concat(Object(I.a)(et),[ke]):[],columCount:re+1,columns:rt}),R.createElement(f,Object.assign({},le,{stickyOffsets:dt,columns:nt,flattenColumns:rt}))))});p.displayName="FixedHeader";var d=p,A=R.createContext(null),D=A;function S(oe){var me=oe.prefixCls,be=oe.children,we=oe.component,pe=oe.cellComponent,ye=oe.fixHeader,re=oe.fixColumn,Z=oe.horizonScroll,J=oe.className,V=oe.expanded,Y=oe.componentWidth,q=oe.colSpan,ee=R.useContext(r.a),le=ee.scrollbarSize;return R.useMemo(function(){var ge=be;return re&&(ge=R.createElement("div",{style:{width:Y-(ye?le:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(me,"-expanded-row-fixed")},ge)),R.createElement(we,{className:J,style:{display:V?null:"none"}},R.createElement(n.a,{component:pe,prefixCls:me,colSpan:q},ge))},[be,we,ye,Z,J,V,Y,q,le])}var L=S;function M(oe){var me=oe.className,be=oe.style,we=oe.record,pe=oe.index,ye=oe.rowKey,re=oe.getRowKey,Z=oe.rowExpandable,J=oe.expandedKeys,V=oe.onRow,Y=oe.indent,q=Y===void 0?0:Y,ee=oe.rowComponent,le=oe.cellComponent,ge=oe.childrenColumnName,Oe=R.useContext(r.a),Ke=Oe.prefixCls,ze=Oe.fixedInfoList,ke=R.useContext(D),Je=ke.fixHeader,Qe=ke.fixColumn,Ge=ke.horizonScroll,at=ke.componentWidth,nt=ke.flattenColumns,rt=ke.expandableType,dt=ke.expandRowByClick,et=ke.onTriggerExpand,st=ke.rowClassName,ut=ke.expandedRowClassName,Ue=ke.indentSize,pt=ke.expandIcon,Xe=ke.expandedRowRender,Ye=ke.expandIconColumnIndex,tt=R.useState(!1),vt=Object(P.a)(tt,2),Et=vt[0],bt=vt[1],Ot=J&&J.has(oe.recordKey);R.useEffect(function(){Ot&&bt(!0)},[Ot]);var Rt=rt==="row"&&(!Z||Z(we)),ct=rt==="nest",Tt=ge&&we&&we[ge],At=Rt||ct,_t;V&&(_t=V(we,pe));var Pt=function(x){if(dt&&At&&et(we,x),_t&&_t.onClick){for(var w,k=arguments.length,z=new Array(k>1?k-1:0),F=1;F<k;F++)z[F-1]=arguments[F];(w=_t).onClick.apply(w,[x].concat(z))}},It;typeof st=="string"?It=st:typeof st=="function"&&(It=st(we,pe,q));var Bt=Object(E.a)(nt),Wt=R.createElement(ee,Object.assign({},_t,{"data-row-key":ye,className:N()(me,"".concat(Ke,"-row"),"".concat(Ke,"-row-level-").concat(q),It,_t&&_t.className),style:Object(H.a)(Object(H.a)({},be),_t?_t.style:null),onClick:Pt}),nt.map(function(B,x){var w=B.render,k=B.dataIndex,z=B.className,F=Bt[x],ae=ze[x],Ce;x===(Ye||0)&&ct&&(Ce=R.createElement(R.Fragment,null,R.createElement("span",{style:{paddingLeft:"".concat(Ue*q,"px")},className:"".concat(Ke,"-row-indent indent-level-").concat(q)}),pt({prefixCls:Ke,expanded:Ot,expandable:Tt,record:we,onExpand:et})));var We;return B.onCell&&(We=B.onCell(we,pe)),R.createElement(n.a,Object.assign({className:z,ellipsis:B.ellipsis,align:B.align,component:le,prefixCls:Ke,key:F,record:we,index:pe,dataIndex:k,render:w,shouldCellUpdate:B.shouldCellUpdate},ae,{appendNode:Ce,additionalProps:We}))})),Mt;if(Rt&&(Et||Ot)){var Ft=Xe(we,pe,q+1,Ot),Ht=ut&&ut(we,pe,q);Mt=R.createElement(L,{expanded:Ot,className:N()("".concat(Ke,"-expanded-row"),"".concat(Ke,"-expanded-row-level-").concat(q+1),Ht),prefixCls:Ke,fixHeader:Je,fixColumn:Qe,horizonScroll:Ge,component:ee,componentWidth:at,cellComponent:le,colSpan:nt.length},Ft)}var Jt;return Tt&&Ot&&(Jt=(we[ge]||[]).map(function(B,x){var w=re(B,x);return R.createElement(M,Object.assign({},oe,{key:w,rowKey:w,record:B,recordKey:w,index:x,indent:q+1}))})),R.createElement(R.Fragment,null,Wt,Mt,Jt)}M.displayName="BodyRow";var O=M,j=R.createContext(null),G=j;function X(oe){var me=oe.columnKey,be=oe.onColumnResize,we=R.useRef();return R.useEffect(function(){we.current&&be(me,we.current.offsetWidth)},[]),R.createElement(v.a,{onResize:function(ye){var re=ye.offsetWidth;be(me,re)}},R.createElement("td",{ref:we,style:{padding:0,border:0,height:0}},R.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function te(oe){var me=oe.data,be=oe.getRowKey,we=oe.measureColumnWidth,pe=oe.expandedKeys,ye=oe.onRow,re=oe.rowExpandable,Z=oe.emptyNode,J=oe.childrenColumnName,V=R.useContext(G),Y=V.onColumnResize,q=R.useContext(r.a),ee=q.prefixCls,le=q.getComponent,ge=R.useContext(D),Oe=ge.fixHeader,Ke=ge.horizonScroll,ze=ge.flattenColumns,ke=ge.componentWidth;return R.useMemo(function(){var Je=le(["body","wrapper"],"tbody"),Qe=le(["body","row"],"tr"),Ge=le(["body","cell"],"td"),at;me.length?at=me.map(function(rt,dt){var et=be(rt,dt);return R.createElement(O,{key:et,rowKey:et,record:rt,recordKey:et,index:dt,rowComponent:Qe,cellComponent:Ge,expandedKeys:pe,onRow:ye,getRowKey:be,rowExpandable:re,childrenColumnName:J})}):at=R.createElement(L,{expanded:!0,className:"".concat(ee,"-placeholder"),prefixCls:ee,fixHeader:Oe,fixColumn:Ke,horizonScroll:Ke,component:Qe,componentWidth:ke,cellComponent:Ge,colSpan:ze.length},Z);var nt=Object(E.a)(ze);return R.createElement(Je,{className:"".concat(ee,"-tbody")},we&&R.createElement("tr",{"aria-hidden":"true",className:"".concat(ee,"-measure-row"),style:{height:0}},nt.map(function(rt){return R.createElement(X,{key:rt,columnKey:rt,onColumnResize:Y})})),at)},[me,ee,ye,we,pe,be,le,ke,Z,ze])}var fe=R.memo(te);fe.displayName="Body";var ve=fe,he=U("wRmb"),xe=U("xEkU"),Se=U.n(xe);function de(oe){var me=Object(R.useRef)(oe),be=Object(R.useState)({}),we=Object(P.a)(be,2),pe=we[1],ye=Object(R.useRef)(null),re=Object(R.useRef)([]);function Z(J){ye.current===null&&(re.current=[],ye.current=Se()(function(){re.current.forEach(function(V){me.current=V(me.current)}),ye.current=null,pe({})})),re.current.push(J)}return Object(R.useEffect)(function(){return function(){Se.a.cancel(ye.current)}},[]),[me.current,Z]}function ie(oe){var me=Object(R.useRef)(oe),be=Object(R.useRef)(null);function we(){window.clearTimeout(be.current)}function pe(re){me.current=re,we(),be.current=window.setTimeout(function(){me.current=null,be.current=null},100)}function ye(){return me.current}return Object(R.useEffect)(function(){return we},[]),[pe,ye]}function Le(oe,me,be){var we=Object(R.useMemo)(function(){for(var pe=[],ye=[],re=0,Z=0,J=0;J<me;J+=1)if(be==="rtl"){ye[J]=Z,Z+=oe[J]||0;var V=me-J-1;pe[V]=re,re+=oe[V]||0}else{pe[J]=re,re+=oe[J]||0;var Y=me-J-1;ye[Y]=Z,Z+=oe[Y]||0}return{left:pe,right:ye}},[oe,me,be]);return we}var Ve=Le;function Be(oe){var me=oe.className,be=oe.children;return R.createElement("div",{className:me},be)}var je=Be,Ee=U("n6Qo");function Te(oe){var me,be=oe.prefixCls,we=oe.record,pe=oe.onExpand,ye=oe.expanded,re=oe.expandable,Z="".concat(be,"-row-expand-icon");if(!re)return R.createElement("span",{className:N()(Z,"".concat(be,"-row-spaced"))});var J=function(Y){pe(we,Y),Y.stopPropagation()};return R.createElement("span",{className:N()(Z,(me={},Object(Q.a)(me,"".concat(be,"-row-expanded"),ye),Object(Q.a)(me,"".concat(be,"-row-collapsed"),!ye),me)),onClick:J})}function Re(oe,me,be){var we=[];function pe(ye){(ye||[]).forEach(function(re,Z){we.push(me(re,Z)),pe(re[be])})}return pe(oe),we}var Ie=U("zT1h"),$=U("y0+3"),se=function(me,be){var we,pe,ye=me.scrollBodyRef,re=me.onScroll,Z=me.offsetScroll,J=R.useContext(r.a),V=J.prefixCls,Y=((we=ye.current)===null||we===void 0?void 0:we.scrollWidth)||0,q=((pe=ye.current)===null||pe===void 0?void 0:pe.clientWidth)||0,ee=Y&&q*(q/Y),le=R.useRef(),ge=de({scrollLeft:0,isHiddenScrollBar:!1}),Oe=Object(P.a)(ge,2),Ke=Oe[0],ze=Oe[1],ke=R.useRef({delta:0,x:0}),Je=R.useState(!1),Qe=Object(P.a)(Je,2),Ge=Qe[0],at=Qe[1],nt=function(){at(!1)},rt=function(Ue){Ue.persist(),ke.current.delta=Ue.pageX-Ke.scrollLeft,ke.current.x=0,at(!0),Ue.preventDefault()},dt=function(Ue){var pt,Xe=Ue||((pt=window)===null||pt===void 0?void 0:pt.event),Ye=Xe.buttons;if(!Ge||Ye===0){Ge&&at(!1);return}var tt=ke.current.x+Ue.pageX-ke.current.x-ke.current.delta;tt<=0&&(tt=0),tt+ee>=q&&(tt=q-ee),re({scrollLeft:tt/q*(Y+2)}),ke.current.x=Ue.pageX},et=function(){var Ue=Object($.b)(ye.current).top,pt=Ue+ye.current.offsetHeight,Xe=document.documentElement.scrollTop+window.innerHeight;pt-Object(c.a)()<=Xe||Ue>=Xe-Z?ze(function(Ye){return Object(H.a)(Object(H.a)({},Ye),{},{isHiddenScrollBar:!0})}):ze(function(Ye){return Object(H.a)(Object(H.a)({},Ye),{},{isHiddenScrollBar:!1})})},st=function(Ue){ze(function(pt){return Object(H.a)(Object(H.a)({},pt),{},{scrollLeft:Ue/Y*q||0})})};return R.useImperativeHandle(be,function(){return{setScrollLeft:st}}),R.useEffect(function(){var ut=Object(Ie.a)(document.body,"mouseup",nt,!1),Ue=Object(Ie.a)(document.body,"mousemove",dt,!1);return et(),function(){ut.remove(),Ue.remove()}},[ee,Ge]),R.useEffect(function(){var ut=Object(Ie.a)(window,"scroll",et,!1),Ue=Object(Ie.a)(window,"resize",et,!1);return function(){ut.remove(),Ue.remove()}},[]),R.useEffect(function(){Ke.isHiddenScrollBar||ze(function(ut){var Ue,pt;return Object(H.a)(Object(H.a)({},ut),{},{scrollLeft:ye.current.scrollLeft/((Ue=ye.current)===null||Ue===void 0?void 0:Ue.scrollWidth)*((pt=ye.current)===null||pt===void 0?void 0:pt.clientWidth)})})},[Ke.isHiddenScrollBar]),Y<=q||!ee||Ke.isHiddenScrollBar?null:R.createElement("div",{style:{height:Object(c.a)(),width:q,bottom:Z},className:"".concat(V,"-sticky-scroll")},R.createElement("div",{onMouseDown:rt,ref:le,className:N()("".concat(V,"-sticky-scroll-bar"),Object(Q.a)({},"".concat(V,"-sticky-scroll-bar-active"),Ge)),style:{width:"".concat(ee,"px"),transform:"translate3d(".concat(Ke.scrollLeft,"px, 0, 0)")}}))},ue=R.forwardRef(se);function ce(oe,me){return R.useMemo(function(){var be=!!oe;return{isSticky:be,stickyClassName:be?"".concat(me,"-sticky-header"):"",offsetHeader:Object(W.a)(oe)==="object"&&oe.offsetHeader||0,offsetScroll:Object(W.a)(oe)==="object"&&oe.offsetScroll||0}},[oe,me])}var _e=[],De={},Pe="rc-table-internal-hook",Me=R.memo(function(oe){var me=oe.children;return me},function(oe,me){return C()(oe.props,me.props)?oe.pingLeft!==me.pingLeft||oe.pingRight!==me.pingRight:!1});function Fe(oe){var me,be=oe.prefixCls,we=oe.className,pe=oe.rowClassName,ye=oe.style,re=oe.data,Z=oe.rowKey,J=oe.scroll,V=oe.tableLayout,Y=oe.direction,q=oe.title,ee=oe.footer,le=oe.summary,ge=oe.id,Oe=oe.showHeader,Ke=oe.components,ze=oe.emptyText,ke=oe.onRow,Je=oe.onHeaderRow,Qe=oe.internalHooks,Ge=oe.transformColumns,at=oe.internalRefs,nt=oe.sticky,rt=re||_e,dt=!!rt.length,et=R.useState(0),st=Object(P.a)(et,2),ut=st[0],Ue=st[1];R.useEffect(function(){Ue(Object(c.a)())});var pt=R.useMemo(function(){return Object(E.c)(Ke,{})},[Ke]),Xe=R.useCallback(function(lt,ht){return Object(E.b)(pt,lt)||ht},[pt]),Ye=R.useMemo(function(){return typeof Z=="function"?Z:function(lt){var ht=lt&&lt[Z];return ht}},[Z]),tt=Object(h.c)(oe),vt=tt.expandIcon,Et=tt.expandedRowKeys,bt=tt.defaultExpandedRowKeys,Ot=tt.defaultExpandAllRows,Rt=tt.expandedRowRender,ct=tt.onExpand,Tt=tt.onExpandedRowsChange,At=tt.expandRowByClick,_t=tt.rowExpandable,Pt=tt.expandIconColumnIndex,It=tt.expandedRowClassName,Bt=tt.childrenColumnName,Wt=tt.indentSize,Mt=vt||Te,Ft=Bt||"children",Ht=R.useMemo(function(){return Rt?"row":oe.expandable&&Qe===Pe&&oe.expandable.__PARENT_RENDER_ICON__||rt.some(function(lt){return lt&&Object(W.a)(lt)==="object"&&lt[Ft]})?"nest":!1},[!!Rt,rt]),Jt=R.useState(function(){return bt||(Ot?Re(rt,Ye,Ft):[])}),B=Object(P.a)(Jt,2),x=B[0],w=B[1],k=R.useMemo(function(){return new Set(Et||x||[])},[Et,x]),z=R.useCallback(function(lt){var ht=Ye(lt,rt.indexOf(lt)),St,Dt=k.has(ht);Dt?(k.delete(ht),St=Object(I.a)(k)):St=[].concat(Object(I.a)(k),[ht]),w(St),ct&&ct(!Dt,lt),Tt&&Tt(St)},[Ye,k,rt,ct,Tt]),F=R.useState(0),ae=Object(P.a)(F,2),Ce=ae[0],We=ae[1],$e=Object(he.b)(Object(H.a)(Object(H.a)(Object(H.a)({},oe),tt),{},{expandable:!!Rt,expandedKeys:k,getRowKey:Ye,onTriggerExpand:z,expandIcon:Mt,expandIconColumnIndex:Pt,direction:Y}),Qe===Pe?Ge:null),Ae=Object(P.a)($e,2),Ze=Ae[0],qe=Ae[1],ft=R.useMemo(function(){return{columns:Ze,flattenColumns:qe}},[Ze,qe]),Lt=R.useRef(),Ut=R.useRef(),yt=R.useRef(),Nt=R.useState(!1),rr=Object(P.a)(Nt,2),Qt=rr[0],Kt=rr[1],jt=R.useState(!1),nr=Object(P.a)(jt,2),Zt=nr[0],lr=nr[1],Gt=de(new Map),ir=Object(P.a)(Gt,2),ur=ir[0],zt=ir[1],kt=Object(E.a)(qe),Vt=kt.map(function(lt){return ur.get(lt)}),ar=R.useMemo(function(){return Vt},[Vt.join("_")]),Yt=Ve(ar,qe.length,Y),gt=J&&Object(E.d)(J.y),it=J&&Object(E.d)(J.x),xt=it&&qe.some(function(lt){var ht=lt.fixed;return ht}),ot=R.useRef(),wt=ce(nt,be),mt=wt.isSticky,qt=wt.offsetHeader,Ct=wt.offsetScroll,sr=wt.stickyClassName,er,Xt,hr;gt&&(Xt={overflowY:"scroll",maxHeight:J.y}),it&&(er={overflowX:"auto"},gt||(Xt={overflowY:"hidden"}),hr={width:J.x===!0?"auto":J.x,minWidth:"100%"});var yr=R.useCallback(function(lt,ht){zt(function(St){var Dt=new Map(St);return Dt.set(lt,ht),Dt})},[]),Or=ie(null),_r=Object(P.a)(Or,2),Rr=_r[0],br=_r[1];function dr(lt,ht){if(!ht)return;typeof ht=="function"?ht(lt):ht.scrollLeft!==lt&&(ht.scrollLeft=lt)}var $t=function(ht){var St=ht.currentTarget,Dt=ht.scrollLeft,tr=typeof Dt=="number"?Dt:St.scrollLeft,Cr=St||De;if(!br()||br()===Cr){var vr;Rr(Cr),dr(tr,Ut.current),dr(tr,yt.current),dr(tr,(vr=ot.current)===null||vr===void 0?void 0:vr.setScrollLeft)}if(St){var Nr=St.scrollWidth,kr=St.clientWidth;Kt(tr>0),lr(tr<Nr-kr)}},cr=function(){yt.current&&$t({currentTarget:yt.current})},Ar=function(ht){var St=ht.width;cr(),We(Lt.current?Lt.current.offsetWidth:St)};R.useEffect(function(){return cr},[]),R.useEffect(function(){it&&cr()},[it]),R.useEffect(function(){Qe===Pe&&at&&(at.body.current=yt.current)});var Er=Xe(["table"],"table"),or=R.useMemo(function(){return V||(xt?J.x==="max-content"?"auto":"fixed":gt||qe.some(function(lt){var ht=lt.ellipsis;return ht})?"fixed":"auto")},[gt,xt,qe,V]),fr,pr={colWidths:ar,columCount:qe.length,stickyOffsets:Yt,onHeaderRow:Je,fixHeader:gt},Ir=R.useMemo(function(){return dt?null:typeof ze=="function"?ze():ze},[dt,ze]),Tr=R.createElement(ve,{data:rt,measureColumnWidth:gt||it||mt,expandedKeys:k,rowExpandable:_t,getRowKey:Ye,onRow:ke,emptyNode:Ir,childrenColumnName:Ft}),xr=R.createElement(u,{colWidths:qe.map(function(lt){var ht=lt.width;return ht}),columns:qe}),Sr=le&&R.createElement(Ee.b,null,le(rt)),wr=Xe(["body"]);if(gt||mt){var mr;typeof wr=="function"?(mr=wr(rt,{scrollbarSize:ut,ref:yt,onScroll:$t}),pr.colWidths=qe.map(function(lt,ht){var St=lt.width,Dt=ht===Ze.length-1?St-ut:St;return typeof Dt=="number"&&!Number.isNaN(Dt)?Dt:(Object(g.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):mr=R.createElement("div",{style:Object(H.a)(Object(H.a)({},er),Xt),onScroll:$t,ref:yt,className:N()("".concat(be,"-body"))},R.createElement(Er,{style:Object(H.a)(Object(H.a)({},hr),{},{tableLayout:or})},xr,Tr,Sr),mt&&R.createElement(ue,{ref:ot,offsetScroll:Ct,scrollBodyRef:yt,onScroll:$t})),fr=R.createElement(R.Fragment,null,Oe!==!1&&R.createElement(d,Object.assign({noData:!rt.length},pr,ft,{direction:Y,offsetHeader:qt,stickyClassName:sr,ref:Ut,onScroll:$t})),mr)}else fr=R.createElement("div",{style:Object(H.a)(Object(H.a)({},er),Xt),className:N()("".concat(be,"-content")),onScroll:$t,ref:yt},R.createElement(Er,{style:Object(H.a)(Object(H.a)({},hr),{},{tableLayout:or})},xr,Oe!==!1&&R.createElement(f,Object.assign({},pr,ft)),Tr,Sr));var Lr=Object(h.b)(oe),gr=R.createElement("div",Object.assign({className:N()(be,we,(me={},Object(Q.a)(me,"".concat(be,"-rtl"),Y==="rtl"),Object(Q.a)(me,"".concat(be,"-ping-left"),Qt),Object(Q.a)(me,"".concat(be,"-ping-right"),Zt),Object(Q.a)(me,"".concat(be,"-layout-fixed"),V==="fixed"),Object(Q.a)(me,"".concat(be,"-fixed-header"),gt),Object(Q.a)(me,"".concat(be,"-fixed-column"),xt),Object(Q.a)(me,"".concat(be,"-scroll-horizontal"),it),Object(Q.a)(me,"".concat(be,"-has-fix-left"),qe[0]&&qe[0].fixed),Object(Q.a)(me,"".concat(be,"-has-fix-right"),qe[qe.length-1]&&qe[qe.length-1].fixed==="right"),me)),style:ye,id:ge,ref:Lt},Lr),R.createElement(Me,{pingLeft:Qt,pingRight:Zt,props:Object(H.a)(Object(H.a)({},oe),{},{stickyOffsets:Yt,mergedExpandedKeys:k})},q&&R.createElement(je,{className:"".concat(be,"-title")},q(rt)),R.createElement("div",{className:"".concat(be,"-container")},fr),ee&&R.createElement(je,{className:"".concat(be,"-footer")},ee(rt))));it&&(gr=R.createElement(v.a,{onResize:Ar},gr));var Dr=R.useMemo(function(){return{prefixCls:be,getComponent:Xe,scrollbarSize:ut,direction:Y,fixedInfoList:qe.map(function(lt,ht){return t(ht,ht,qe,Yt,Y)}),isSticky:mt}},[be,Xe,ut,Y,qe,Yt,Y,mt]),Pr=R.useMemo(function(){return Object(H.a)(Object(H.a)({},ft),{},{tableLayout:or,rowClassName:pe,expandedRowClassName:It,componentWidth:Ce,fixHeader:gt,fixColumn:xt,horizonScroll:it,expandIcon:Mt,expandableType:Ht,expandRowByClick:At,expandedRowRender:Rt,onTriggerExpand:z,expandIconColumnIndex:Pt,indentSize:Wt})},[ft,or,pe,It,Ce,gt,xt,it,Mt,Ht,At,Rt,z,Pt,Wt]),Mr=R.useMemo(function(){return{onColumnResize:yr}},[yr]);return R.createElement(r.a.Provider,{value:Dr},R.createElement(D.Provider,{value:Pr},R.createElement(G.Provider,{value:Mr},gr)))}Fe.Column=i.a,Fe.ColumnGroup=s.a,Fe.Summary=Ee.a,Fe.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var He=ne.b=Fe},wRmb:function(Ne,ne,U){"use strict";U.d(ne,"a",function(){return C});var Q=U("rePB"),H=U("KQm4"),I=U("VTBJ"),W=U("Ff2n"),P=U("q1tI"),R=U.n(P),K=U("Kwbf"),N=U("Zm9Q"),e=U("hW8S");function C(i){return Object(N.a)(i).filter(function(l){return P.isValidElement(l)}).map(function(l){var a=l.key,n=l.props,r=n.children,t=Object(W.a)(n,["children"]),E=Object(I.a)({key:a},t);return r&&(E.children=C(r)),E})}function g(i){return i.reduce(function(l,a){var n=a.fixed,r=n===!0?"left":n,t=a.children;return t&&t.length>0?[].concat(Object(H.a)(l),Object(H.a)(g(t).map(function(E){return Object(I.a)({fixed:r},E)}))):[].concat(Object(H.a)(l),[Object(I.a)(Object(I.a)({},a),{},{fixed:r})])},[])}function v(i){for(var l=!0,a=0;a<i.length;a+=1){var n=i[a];if(l&&n.fixed!=="left")l=!1;else if(!l&&n.fixed==="left"){Object(K.a)(!1,"Index ".concat(a-1," of `columns` missing `fixed='left'` prop."));break}}for(var r=!0,t=i.length-1;t>=0;t-=1){var E=i[t];if(r&&E.fixed!=="right")r=!1;else if(!r&&E.fixed==="right"){Object(K.a)(!1,"Index ".concat(t+1," of `columns` missing `fixed='right'` prop."));break}}}function c(i){return i.map(function(l){var a=l.fixed,n=Object(W.a)(l,["fixed"]),r=a;return a==="left"?r="right":a==="right"&&(r="left"),Object(I.a)({fixed:r},n)})}function s(i,l){var a=i.prefixCls,n=i.columns,r=i.children,t=i.expandable,E=i.expandedKeys,y=i.getRowKey,m=i.onTriggerExpand,T=i.expandIcon,_=i.rowExpandable,f=i.expandIconColumnIndex,h=i.direction,o=i.expandRowByClick,u=P.useMemo(function(){return n||C(r)},[n,r]),b=P.useMemo(function(){if(t){var A,D=f||0,S=u[D],L=(A={},Object(Q.a)(A,e.a,{className:"".concat(a,"-expand-icon-col")}),Object(Q.a)(A,"title",""),Object(Q.a)(A,"fixed",S?S.fixed:null),Object(Q.a)(A,"className","".concat(a,"-row-expand-icon-cell")),Object(Q.a)(A,"render",function(j,G,X){var te=y(G,X),fe=E.has(te),ve=_?_(G):!0,he=T({prefixCls:a,expanded:fe,expandable:ve,record:G,onExpand:m});return o?P.createElement("span",{onClick:function(Se){return Se.stopPropagation()}},he):he}),A),M=u.slice();return D>=0&&M.splice(D,0,L),M}return u},[t,u,y,E,T,h]),p=P.useMemo(function(){var A=b;return l&&(A=l(A)),A.length||(A=[{render:function(){return null}}]),A},[l,b,h]),d=P.useMemo(function(){return h==="rtl"?c(g(p)):g(p)},[p,h]);return[p,d]}ne.b=s},wwSX:function(Ne,ne,U){Ne.exports=U.p+"static/b2.2c844a2a.svg"},"y0+3":function(Ne,ne,U){"use strict";U.d(ne,"a",function(){return g}),U.d(ne,"b",function(){return c});var Q=/margin|padding|width|height|max|min|offset/,H={left:!0,top:!0},I={cssFloat:1,styleFloat:1,float:1};function W(s){return s.nodeType===1?s.ownerDocument.defaultView.getComputedStyle(s,null):{}}function P(s,i,l){if(i=i.toLowerCase(),l==="auto"){if(i==="height")return s.offsetHeight;if(i==="width")return s.offsetWidth}return i in H||(H[i]=Q.test(i)),H[i]?parseFloat(l)||0:l}function R(s,i){var l=arguments.length,a=W(s);return i=I[i]?"cssFloat"in s.style?"cssFloat":"styleFloat":i,l===1?a:P(s,i,a[i]||s.style[i])}function K(s,i,l){var a=arguments.length;if(i=I[i]?"cssFloat"in s.style?"cssFloat":"styleFloat":i,a===3)return typeof l=="number"&&Q.test(i)&&(l="".concat(l,"px")),s.style[i]=l,l;for(var n in i)i.hasOwnProperty(n)&&K(s,n,i[n]);return W(s)}function N(s){return s===document.body?document.documentElement.clientWidth:s.offsetWidth}function e(s){return s===document.body?window.innerHeight||document.documentElement.clientHeight:s.offsetHeight}function C(){var s=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),i=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:s,height:i}}function g(){var s=document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight;return{width:s,height:i}}function v(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function c(s){var i=s.getBoundingClientRect(),l=document.documentElement;return{left:i.left+(window.pageXOffset||l.scrollLeft)-(l.clientLeft||document.body.clientLeft||0),top:i.top+(window.pageYOffset||l.scrollTop)-(l.clientTop||document.body.clientTop||0)}}},zlzj:function(Ne,ne,U){Ne.exports=U.p+"static/b3.30079151.svg"}}]);