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([[101,5,7,8,9],{"+92d":function(Le,se,U){Le.exports=U.p+"static/b1.8d46544a.svg"},"+ua5":function(Le,se,U){},"/cxE":function(Le,se,U){"use strict";U.d(se,"f",function(){return A}),U.d(se,"g",function(){return j}),U.d(se,"h",function(){return P}),U.d(se,"e",function(){return W}),U.d(se,"b",function(){return N}),U.d(se,"c",function(){return e}),U.d(se,"d",function(){return w}),U.d(se,"a",function(){return v});class ne{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(g){setTimeout(()=>{throw g.stack?new Error(g.message+`
`+g.stack):g},0)}}emit(g){this.listeners.forEach(c=>{c(g)})}onUnexpectedError(g){this.unexpectedErrorHandler(g),this.emit(g)}onUnexpectedExternalError(g){this.unexpectedErrorHandler(g)}}const B=new ne;function A(g){W(g)||B.onUnexpectedError(g);return}function j(g){W(g)||B.onUnexpectedExternalError(g);return}function P(g){if(g instanceof Error){let{name:c,message:s}=g;const i=g.stacktrace||g.stack;return{$isError:!0,name:c,message:s,stack:i}}return g}const S="Canceled";function W(g){return g instanceof Error&&g.name===S&&g.message===S}function N(){const g=new Error(S);return g.name=g.message,g}function e(g){return g?new Error(`Illegal argument: ${g}`):new Error("Illegal argument")}function w(g){return g?new Error(`Illegal state: ${g}`):new Error("Illegal state")}class v extends Error{constructor(g){super("NotSupported");g&&(this.message=g)}}},"24hK":function(Le,se,U){"use strict";U.d(se,"a",function(){return B});class ne{constructor(A){this.element=A,this.next=ne.Undefined,this.prev=ne.Undefined}}ne.Undefined=new ne(void 0);class B{constructor(){this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ne.Undefined}clear(){let A=this._first;for(;A!==ne.Undefined;){const j=A.next;A.prev=ne.Undefined,A.next=ne.Undefined,A=j}this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}unshift(A){return this._insert(A,!1)}push(A){return this._insert(A,!0)}_insert(A,j){const P=new ne(A);if(this._first===ne.Undefined)this._first=P,this._last=P;else if(j){const W=this._last;this._last=P,P.prev=W,W.next=P}else{const W=this._first;this._first=P,P.next=W,W.prev=P}this._size+=1;let S=!1;return()=>{S||(S=!0,this._remove(P))}}shift(){if(this._first===ne.Undefined)return;{const A=this._first.element;return this._remove(this._first),A}}pop(){if(this._last===ne.Undefined)return;{const A=this._last.element;return this._remove(this._last),A}}_remove(A){if(A.prev!==ne.Undefined&&A.next!==ne.Undefined){const j=A.prev;j.next=A.next,A.next.prev=j}else A.prev===ne.Undefined&&A.next===ne.Undefined?(this._first=ne.Undefined,this._last=ne.Undefined):A.next===ne.Undefined?(this._last=this._last.prev,this._last.next=ne.Undefined):A.prev===ne.Undefined&&(this._first=this._first.next,this._first.prev=ne.Undefined);this._size-=1}*[Symbol.iterator](){let A=this._first;for(;A!==ne.Undefined;)yield A.element,A=A.next}}},"3/fG":function(Le,se,U){"use strict";U.d(se,"a",function(){return B});function ne(A,j){let P;return j.length===0?P=A:P=A.replace(/\{(\d+)\}/g,function(S,W){const N=W[0];return typeof j[N]!="undefined"?j[N]:S}),P}function B(A,j,...P){return ne(j,P)}},"55Ip":function(Le,se,U){"use strict";U.d(se,"a",function(){return r});var ne=U("Ty5D"),B=U("dI71"),A=U("q1tI"),j=U.n(A),P=U("YS25"),S=U("17x9"),W=U.n(S),N=U("wx14"),e=U("zLVn"),w=U("9R94"),v=function(h){Object(B.a)(o,h);function o(){for(var b,p=arguments.length,d=new Array(p),O=0;O<p;O++)d[O]=arguments[O];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 j.a.createElement(ne.c,{history:this.history,children:this.props.children})},o}(j.a.Component),g=function(h){Object(B.a)(o,h);function o(){for(var b,p=arguments.length,d=new Array(p),O=0;O<p;O++)d[O]=arguments[O];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 j.a.createElement(ne.c,{history:this.history,children:this.props.children})},o}(j.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=j.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"]),O=d.target,L=Object(N.a)({},d,{onClick:function(I){try{p&&p(I)}catch(k){throw I.preventDefault(),k}!I.defaultPrevented&&I.button===0&&(!O||O==="_self")&&!a(I)&&(I.preventDefault(),b())}});return i!==l?L.ref=o||u:L.ref=u,j.a.createElement("a",L)}),r=l(function(h,o){var u=h.component,b=u===void 0?n:u,p=h.replace,d=h.to,O=h.innerRef,L=Object(e.a)(h,["component","replace","to","innerRef"]);return j.a.createElement(ne.e.Consumer,null,function(x){x||Object(w.a)(!1);var I=x.history,k=s(c(d,x.location),x.location),C=k?I.createHref(k):"",F=Object(N.a)({},L,{href:C,navigate:function(){var ee=c(d,x.location),ie=p?I.replace:I.push;ie(ee)}});return i!==l?F.ref=o||O:F.innerRef=O,j.a.createElement(b,F)})});if(!1)var t,E;var y=function(o){return o},m=j.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,O=h.activeStyle,L=h.className,x=h.exact,I=h.isActive,k=h.location,C=h.sensitive,F=h.strict,V=h.style,ee=h.to,ie=h.innerRef,pe=Object(e.a)(h,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return j.a.createElement(ne.e.Consumer,null,function(ve){ve||Object(w.a)(!1);var ye=k||ve.location,Ee=s(c(ee,ye),ye),Se=Ee.pathname,fe=Se&&Se.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),K=fe?Object(ne.f)(ye.pathname,{path:fe,exact:x,sensitive:C,strict:F}):null,R=!!(I?I(K,ye):K),D=R?T(L,d):L,H=R?Object(N.a)({},V,{},O):V,J=Object(N.a)({"aria-current":R&&b||null,className:D,style:H,to:Ee},pe);return y!==m?J.ref=o||ie:J.innerRef=ie,j.a.createElement(r,J)})});if(!1)var f},"5VLF":function(Le,se,U){"use strict";var ne,B;function A(j,P,S){var W=function(N,e){return j.js_beautify(N,e)};return W.js=j.js_beautify,W.css=P.css_beautify,W.html=S.html_beautify,W.js_beautify=j.js_beautify,W.css_beautify=P.css_beautify,W.html_beautify=S.html_beautify,W}!(ne=[U("6UM0"),U("TXwP"),U("psGv")],B=function(j,P,S){return A(j,P,S)}.apply(se,ne),B!==void 0&&(Le.exports=B))},"5Y4S":function(Le,se,U){"use strict";U.d(se,"a",function(){return A});var ne=U("MNsG");const B=ne.b.performance&&typeof ne.b.performance.now=="function";class A{constructor(j){this._highResolution=B&&j,this._startTime=this._now(),this._stopTime=-1}static create(j=!0){return new A(j)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?ne.b.performance.now():Date.now()}}},"6+eU":function(Le,se,U){"use strict";U.d(se,"a",function(){return m});var ne=U("wx14"),B=U("rePB"),A=U("VTBJ"),j=U("1OyB"),P=U("vuIU"),S=U("Ji7U"),W=U("LK+K"),N=U("q1tI"),e=U.n(N),w=U("TSYQ"),v=U.n(w),g=function(_){var f,h="".concat(_.rootPrefixCls,"-item"),o=v()(h,"".concat(h,"-").concat(_.page),(f={},Object(B.a)(f,"".concat(h,"-active"),_.active),Object(B.a)(f,_.className,!!_.className),Object(B.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=g,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(S.a)(f,T);var _=Object(W.a)(f);function f(){var h;Object(j.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,O=d.goButton,L=d.quickGo,x=d.rootPrefixCls,I=h.state.goInputText;if(O||I==="")return;if(p.relatedTarget&&(p.relatedTarget.className.indexOf("".concat(x,"-prev"))>=0||p.relatedTarget.className.indexOf("".concat(x,"-next"))>=0))return;h.setState({goInputText:""}),L(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 O=isNaN(Number(p))?0:Number(p),L=isNaN(Number(d))?0:Number(d);return O-L})}},{key:"render",value:function(){var o=this,u=this.props,b=u.pageSize,p=u.locale,d=u.rootPrefixCls,O=u.changeSize,L=u.quickGo,x=u.goButton,I=u.selectComponentClass,k=u.buildOptionText,C=u.selectPrefixCls,F=u.disabled,V=this.state.goInputText,ee="".concat(d,"-options"),ie=I,pe=null,ve=null,ye=null;if(!O&&!L)return null;var Ee=this.getPageSizeOptions();if(O&&ie){var Se=Ee.map(function(fe,K){return e.a.createElement(ie.Option,{key:K,value:fe.toString()},(k||o.buildOptionText)(fe))});pe=e.a.createElement(ie,{disabled:F,prefixCls:C,showSearch:!1,className:"".concat(ee,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(b||Ee[0]).toString(),onChange:this.changeSize,getPopupContainer:function(K){return K.parentNode}},Se)}return L&&(x&&(ye=typeof x=="boolean"?e.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:F,className:"".concat(ee,"-quick-jumper-button")},p.jump_to_confirm):e.a.createElement("span",{onClick:this.go,onKeyUp:this.go},x)),ve=e.a.createElement("div",{className:"".concat(ee,"-quick-jumper")},p.jump_to,e.a.createElement("input",{disabled:F,type:"text",value:V,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),p.page,ye)),e.a.createElement("li",{className:"".concat(ee)},pe,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(S.a)(f,T);var _=Object(W.a)(f);function f(h){var o;Object(j.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(O,L){var x=o.props.prefixCls,I=O||e.a.createElement("button",{type:"button","aria-label":L,className:"".concat(x,"-item-link")});return typeof O=="function"&&(I=e.a.createElement(O,Object(A.a)({},o.props))),I},o.savePaginationNode=function(O){o.paginationNode=O},o.isValid=function(O){return r(O)&&O!==o.state.current},o.shouldDisplayQuickJumper=function(){var O=o.props,L=O.showQuickJumper,x=O.pageSize,I=O.total;return I<=x?!1:L},o.handleKeyDown=function(O){(O.keyCode===s.ARROW_UP||O.keyCode===s.ARROW_DOWN)&&O.preventDefault()},o.handleKeyUp=function(O){var L=o.getValidValue(O),x=o.state.currentInputValue;L!==x&&o.setState({currentInputValue:L}),O.keyCode===s.ENTER?o.handleChange(L):O.keyCode===s.ARROW_UP?o.handleChange(L-1):O.keyCode===s.ARROW_DOWN&&o.handleChange(L+1)},o.changePageSize=function(O){var L=o.state.current,x=E(O,o.state,o.props);L=L>x?x:L,x===0&&(L=o.state.current),typeof O=="number"&&("pageSize"in o.props||o.setState({pageSize:O}),"current"in o.props||o.setState({current:L,currentInputValue:L})),o.props.onShowSizeChange(L,O),"onChange"in o.props&&o.props.onChange&&o.props.onChange(L,O)},o.handleChange=function(O){var L=o.props.disabled,x=O;if(o.isValid(x)&&!L){var I=E(void 0,o.state,o.props);x>I?x=I:x<1&&(x=1),"current"in o.props||o.setState({current:x,currentInputValue:x});var k=o.state.pageSize;return o.props.onChange(x,k),x}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(O,L){if(O.key==="Enter"||O.charCode===13){for(var x=arguments.length,I=new Array(x>2?x-2:0),k=2;k<x;k++)I[k-2]=arguments[k];L.apply(void 0,I)}},o.runIfEnterPrev=function(O){o.runIfEnter(O,o.prev)},o.runIfEnterNext=function(O){o.runIfEnter(O,o.next)},o.runIfEnterJumpPrev=function(O){o.runIfEnter(O,o.jumpPrev)},o.runIfEnterJumpNext=function(O){o.runIfEnter(O,o.jumpNext)},o.handleGoTO=function(O){(O.keyCode===s.ENTER||O.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")),O=!this.hasPrev();return Object(N.isValidElement)(d)?Object(N.cloneElement)(d,{disabled:O}):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")),O=!this.hasNext();return Object(N.isValidElement)(d)?Object(N.cloneElement)(d,{disabled:O}):d}},{key:"render",value:function(){var o=this,u=this.props,b=u.prefixCls,p=u.className,d=u.style,O=u.disabled,L=u.hideOnSinglePage,x=u.total,I=u.locale,k=u.showQuickJumper,C=u.showLessItems,F=u.showTitle,V=u.showTotal,ee=u.simple,ie=u.itemRender,pe=u.showPrevNextJumpers,ve=u.jumpPrevIcon,ye=u.jumpNextIcon,Ee=u.selectComponentClass,Se=u.selectPrefixCls,fe=u.pageSizeOptions,K=this.state,R=K.current,D=K.pageSize,H=K.currentInputValue;if(L===!0&&x<=D)return null;var J=E(void 0,this.state,this.props),M=[],ae=null,me=null,_e=null,q=null,oe=null,ue=k&&k.goButton,ce=C?1:2,be=R-1>0?R-1:0,Ce=R+1<J?R+1:J,Oe=Object.keys(this.props).reduce(function(Y,$){return($.substr(0,5)==="data-"||$.substr(0,5)==="aria-"||$==="role")&&(Y[$]=o.props[$]),Y},{});if(ee)return ue&&(typeof ue=="boolean"?oe=e.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},I.jump_to_confirm):oe=e.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},ue),oe=e.a.createElement("li",{title:F?"".concat(I.jump_to).concat(R,"/").concat(J):null,className:"".concat(b,"-simple-pager")},oe)),e.a.createElement("ul",Object(ne.a)({className:v()(b,"".concat(b,"-simple"),Object(B.a)({},"".concat(b,"-disabled"),O),p),style:d,ref:this.savePaginationNode},Oe),e.a.createElement("li",{title:F?I.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:v()("".concat(b,"-prev"),Object(B.a)({},"".concat(b,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(be)),e.a.createElement("li",{title:F?"".concat(R,"/").concat(J):null,className:"".concat(b,"-simple-pager")},e.a.createElement("input",{type:"text",value:H,disabled:O,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),e.a.createElement("span",{className:"".concat(b,"-slash")},"/"),J),e.a.createElement("li",{title:F?I.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:v()("".concat(b,"-next"),Object(B.a)({},"".concat(b,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Ce)),oe);if(J<=3+ce*2){var Ie={locale:I,rootPrefixCls:b,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:F,itemRender:ie};J||M.push(e.a.createElement(c,Object(ne.a)({},Ie,{key:"noPager",page:J,className:"".concat(b,"-disabled")})));for(var De=1;De<=J;De+=1){var Me=R===De;M.push(e.a.createElement(c,Object(ne.a)({},Ie,{key:De,page:De,active:Me})))}}else{var de=C?I.prev_3:I.prev_5,ge=C?I.next_3:I.next_5;pe&&(ae=e.a.createElement("li",{title:F?de:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:v()("".concat(b,"-jump-prev"),Object(B.a)({},"".concat(b,"-jump-prev-custom-icon"),!!ve))},ie(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(ve,"prev page"))),me=e.a.createElement("li",{title:F?ge:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:v()("".concat(b,"-jump-next"),Object(B.a)({},"".concat(b,"-jump-next-custom-icon"),!!ye))},ie(this.getJumpNextPage(),"jump-next",this.getItemIcon(ye,"next page")))),q=e.a.createElement(c,{locale:I,last:!0,rootPrefixCls:b,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:J,page:J,active:!1,showTitle:F,itemRender:ie}),_e=e.a.createElement(c,{locale:I,rootPrefixCls:b,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:F,itemRender:ie});var xe=Math.max(1,R-ce),we=Math.min(R+ce,J);R-1<=ce&&(we=1+ce*2),J-R<=ce&&(xe=J-ce*2);for(var Z=xe;Z<=we;Z+=1){var z=R===Z;M.push(e.a.createElement(c,{locale:I,rootPrefixCls:b,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Z,page:Z,active:z,showTitle:F,itemRender:ie}))}R-1>=ce*2&&R!==1+2&&(M[0]=Object(N.cloneElement)(M[0],{className:"".concat(b,"-item-after-jump-prev")}),M.unshift(ae)),J-R>=ce*2&&R!==J-2&&(M[M.length-1]=Object(N.cloneElement)(M[M.length-1],{className:"".concat(b,"-item-before-jump-next")}),M.push(me)),xe!==1&&M.unshift(_e),we!==J&&M.push(q)}var G=null;V&&(G=e.a.createElement("li",{className:"".concat(b,"-total-text")},V(x,[x===0?0:(R-1)*D+1,R*D>x?x:R*D])));var X=!this.hasPrev()||!J,Q=!this.hasNext()||!J;return e.a.createElement("ul",Object(ne.a)({className:v()(b,p,Object(B.a)({},"".concat(b,"-disabled"),O)),style:d,unselectable:"unselectable",ref:this.savePaginationNode},Oe),G,e.a.createElement("li",{title:F?I.prev_page:null,onClick:this.prev,tabIndex:X?null:0,onKeyPress:this.runIfEnterPrev,className:v()("".concat(b,"-prev"),Object(B.a)({},"".concat(b,"-disabled"),X)),"aria-disabled":X},this.renderPrev(be)),M,e.a.createElement("li",{title:F?I.next_page:null,onClick:this.next,tabIndex:Q?null:0,onKeyPress:this.runIfEnterNext,className:v()("".concat(b,"-next"),Object(B.a)({},"".concat(b,"-disabled"),Q)),"aria-disabled":Q},this.renderNext(Ce)),e.a.createElement(l,{disabled:O,locale:I,rootPrefixCls:b,selectComponentClass:Ee,selectPrefixCls:Se,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:R,pageSize:D,pageSizeOptions:fe,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(Le,se,U){"use strict";var ne=U("wCXF"),B=U("n6Qo");U.d(se,"b",function(){return B.a});var A=U("IBYe"),j=U("6eGT"),P=U("hW8S");U.d(se,"a",function(){return P.a}),se.c=ne.b},"6UM0":function(Le,se,U){var ne,B;(function(){var A;(function(){"use strict";var P=[function(e,w,v){var g=v(1).Beautifier,c=v(5).Options;function s(i,l){var a=new g(i,l);return a.beautify()}e.exports=s,e.exports.defaultOptions=function(){return new c}},function(e,w,v){var g=v(2).Output,c=v(3).Token,s=v(4),i=v(5).Options,l=v(7).Tokenizer,a=v(7).line_starters,n=v(7).positionable_operators,r=v(7).TOKEN;function t(C,F){return F.indexOf(C)!==-1}function E(C){return C.replace(/^\s+/g,"")}function y(C){for(var F={},V=0;V<C.length;V++)F[C[V].replace(/-/g,"_")]=C[V];return F}function m(C,F){return C&&C.type===r.RESERVED&&C.text===F}function T(C,F){return C&&C.type===r.RESERVED&&t(C.text,F)}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(C,F){if(F.multiline_frame||F.mode===u.ForInitializer||F.mode===u.Conditional)return;C.remove_indent(F.start_line_index)}function p(C){C=C.replace(s.allLineBreaks,`
`);for(var F=[],V=C.indexOf(`
`);V!==-1;)F.push(C.substring(0,V)),C=C.substring(V+1),V=C.indexOf(`
`);return C.length&&F.push(C),F}function d(C){return C===u.ArrayLiteral}function O(C){return t(C,[u.Expression,u.ForInitializer,u.Conditional])}function L(C,F){for(var V=0;V<C.length;V++){var ee=C[V].trim();if(ee.charAt(0)!==F)return!1}return!0}function x(C,F){for(var V=0,ee=C.length,ie;V<ee;V++)if(ie=C[V],ie&&ie.indexOf(F)!==0)return!1;return!0}function I(C,F){F=F||{},this._source_text=C||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new i(F)}I.prototype.create_flags=function(C,F){var V=0;C&&(V=C.indentation_level,!this._output.just_added_newline()&&C.line_indent_level>V&&(V=C.line_indent_level));var ee={mode:F,parent:C,last_token:C?C.last_token:new c(r.START_BLOCK,""),last_word:C?C.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:V,alignment:0,line_indent_level:C?C.line_indent_level:V,start_line_index:this._output.get_line_number(),ternary_depth:0};return ee},I.prototype._reset=function(C){var F=C.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new g(this._options,F),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(u.BlockStatement);var V=new l(C,this._options);return this._tokens=V.tokenize(),C},I.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var C,F=this._reset(this._source_text),V=this._options.eol;this._options.eol==="auto"&&(V=`
`,F&&s.lineBreak.test(F||"")&&(V=F.match(s.lineBreak)[0]));for(var ee=this._tokens.next();ee;)this.handle_token(ee),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ee,ee=this._tokens.next();return C=this._output.get_code(V),C},I.prototype.handle_token=function(C,F){C.type===r.START_EXPR?this.handle_start_expr(C):C.type===r.END_EXPR?this.handle_end_expr(C):C.type===r.START_BLOCK?this.handle_start_block(C):C.type===r.END_BLOCK?this.handle_end_block(C):C.type===r.WORD?this.handle_word(C):C.type===r.RESERVED?this.handle_word(C):C.type===r.SEMICOLON?this.handle_semicolon(C):C.type===r.STRING?this.handle_string(C):C.type===r.EQUALS?this.handle_equals(C):C.type===r.OPERATOR?this.handle_operator(C):C.type===r.COMMA?this.handle_comma(C):C.type===r.BLOCK_COMMENT?this.handle_block_comment(C,F):C.type===r.COMMENT?this.handle_comment(C,F):C.type===r.DOT?this.handle_dot(C):C.type===r.EOF?this.handle_eof(C):C.type===r.UNKNOWN?this.handle_unknown(C,F):this.handle_unknown(C,F)},I.prototype.handle_whitespace_and_comments=function(C,F){var V=C.newlines,ee=this._options.keep_array_indentation&&d(this._flags.mode);if(C.comments_before)for(var ie=C.comments_before.next();ie;)this.handle_whitespace_and_comments(ie,F),this.handle_token(ie,F),ie=C.comments_before.next();if(ee)for(var pe=0;pe<V;pe+=1)this.print_newline(pe>0,F);else if(this._options.max_preserve_newlines&&V>this._options.max_preserve_newlines&&(V=this._options.max_preserve_newlines),this._options.preserve_newlines&&V>1){this.print_newline(!1,F);for(var ve=1;ve<V;ve+=1)this.print_newline(!0,F)}};var k=["async","break","continue","return","throw","yield"];I.prototype.allow_wrap_or_preserved_newline=function(C,F){if(F=F===void 0?!1:F,this._output.just_added_newline())return;var V=this._options.preserve_newlines&&C.newlines||F,ee=t(this._flags.last_token.text,n)||t(C.text,n);if(ee){var ie=t(this._flags.last_token.text,n)&&t(this._options.operator_position,o)||t(C.text,n);V=V&&ie}if(V)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(T(this._flags.last_token,k))return;this._output.set_wrap_point()}},I.prototype.print_newline=function(C,F){if(!F&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==r.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var V=this._tokens.peek();this._flags.mode===u.Statement&&!(this._flags.if_block&&m(V,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(C)&&(this._flags.multiline_frame=!0)},I.prototype.print_token_line_indentation=function(C){this._output.just_added_newline()&&(this._options.keep_array_indentation&&C.newlines&&(C.text==="["||d(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(C.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},I.prototype.print_token=function(C){if(this._output.raw){this._output.add_raw_token(C);return}if(this._options.comma_first&&C.previous&&C.previous.type===r.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var F=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(F),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(C),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(C),this._output.non_breaking_space=!0,this._output.add_token(C.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},I.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},I.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))},I.prototype.set_mode=function(C){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,C),this._flags=this.create_flags(this._previous_flags,C),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},I.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))},I.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"]))},I.prototype.start_of_statement=function(C){var F=!1;return F=F||T(this._flags.last_token,["var","let","const"])&&C.type===r.WORD,F=F||m(this._flags.last_token,"do"),F=F||!(this._flags.parent.mode===u.ObjectLiteral&&this._flags.mode===u.Statement)&&T(this._flags.last_token,k)&&!C.newlines,F=F||m(this._flags.last_token,"else")&&!(m(C,"if")&&!C.comments_before),F=F||this._flags.last_token.type===r.END_EXPR&&(this._previous_flags.mode===u.ForInitializer||this._previous_flags.mode===u.Conditional),F=F||this._flags.last_token.type===r.WORD&&this._flags.mode===u.BlockStatement&&!this._flags.in_case&&!(C.text==="--"||C.text==="++")&&this._last_last_text!=="function"&&C.type!==r.WORD&&C.type!==r.RESERVED,F=F||this._flags.mode===u.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||T(this._flags.last_token,["get","set"])),F?(this.set_mode(u.Statement),this.indent(),this.handle_whitespace_and_comments(C,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C,T(C,["do","for","if","while"])),!0):!1},I.prototype.handle_start_expr=function(C){this.start_of_statement(C)||this.handle_whitespace_and_comments(C);var F=u.Expression;if(C.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(C),this.set_mode(F),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}F=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,F=u.ForInitializer):t(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,F=u.Conditional):t(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&C.whitespace_before===""?this._output.space_before_token=!1:(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(C);else if(this._flags.last_token.type===r.WORD){this._output.space_before_token=!1;var V=this._tokens.peek(-3);if(this._options.space_after_named_function&&V){var ee=this._tokens.peek(-4);T(V,["async","function"])||V.text==="*"&&T(ee,["async","function"])?this._output.space_before_token=!0:this._flags.mode===u.ObjectLiteral?(V.text==="{"||V.text===","||V.text==="*"&&(ee.text==="{"||ee.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(C);(this._flags.last_token.type===r.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(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(C,C.newlines),this.print_token(C),this.set_mode(F),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},I.prototype.handle_end_expr=function(C){for(;this._flags.mode===u.Statement;)this.restore_mode();this.handle_whitespace_and_comments(C),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(C,C.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(C),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)},I.prototype.handle_start_block=function(C){this.handle_whitespace_and_comments(C);var F=this._tokens.peek(),V=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):V&&(t(V.text,[":",","])&&t(F.type,[r.STRING,r.WORD,r.RESERVED])||t(F.text,["get","set","..."])&&t(V.type,[r.WORD,r.RESERVED]))?t(this._last_last_text,["class","interface"])&&!t(V.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 ee=!F.comments_before&&F.text==="}",ie=ee&&this._flags.last_word==="function"&&this._flags.last_token.type===r.END_EXPR;if(this._options.brace_preserve_inline){var pe=0,ve=null;this._flags.inline_frame=!0;do if(pe+=1,ve=this._tokens.peek(pe-1),ve.newlines){this._flags.inline_frame=!1;break}while(ve.type!==r.EOF&&!(ve.type===r.END_BLOCK&&ve.opened===C))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&C.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==r.OPERATOR&&(ie||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(C),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==r.OPERATOR&&this._flags.last_token.type!==r.START_EXPR&&(this._flags.last_token.type===r.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(C),this.indent(),!ee&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},I.prototype.handle_end_block=function(C){for(this.handle_whitespace_and_comments(C);this._flags.mode===u.Statement;)this.restore_mode();var F=this._flags.last_token.type===r.START_BLOCK;this._flags.inline_frame&&!F?this._output.space_before_token=!0:this._options.brace_style==="expand"?F||this.print_newline():F||(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(C)},I.prototype.handle_word=function(C){if(C.type===r.RESERVED){if(t(C.text,["set","get"])&&this._flags.mode!==u.ObjectLiteral)C.type=r.WORD;else if(C.text==="import"&&t(this._tokens.peek().text,["(","."]))C.type=r.WORD;else if(t(C.text,["as","from"])&&!this._flags.import_block)C.type=r.WORD;else if(this._flags.mode===u.ObjectLiteral){var F=this._tokens.peek();F.text===":"&&(C.type=r.WORD)}}if(this.start_of_statement(C)?T(this._flags.last_token,["var","let","const"])&&C.type===r.WORD&&(this._flags.declaration_statement=!0):C.newlines&&!O(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(C),this.print_newline()):this.handle_whitespace_and_comments(C),this._flags.do_block&&!this._flags.do_while)if(m(C,"while")){this._output.space_before_token=!0,this.print_token(C),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&m(C,"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(C,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(C),this._flags.in_case=!0;return}if((this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.EQUALS||this._flags.last_token.type===r.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C)),m(C,"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()&&!C.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,k)?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&&(O(this._flags.mode)||d(this._flags.mode))||this.print_newline(),this.print_token(C),this._flags.last_word=C.text;return}var V="NONE";if(this._flags.last_token.type===r.END_BLOCK?this._previous_flags.inline_frame?V="SPACE":T(C,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&C.newlines?V="NEWLINE":(V="SPACE",this._output.space_before_token=!0):V="NEWLINE":this._flags.last_token.type===r.SEMICOLON&&this._flags.mode===u.BlockStatement?V="NEWLINE":this._flags.last_token.type===r.SEMICOLON&&O(this._flags.mode)?V="SPACE":this._flags.last_token.type===r.STRING?V="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,["{",","]))?V="SPACE":this._flags.last_token.type===r.START_BLOCK?this._flags.inline_frame?V="SPACE":V="NEWLINE":this._flags.last_token.type===r.END_EXPR&&(this._output.space_before_token=!0,V="NEWLINE"),T(C,a)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?V="SPACE":V="NEWLINE"),T(C,["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"&&C.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ee=this._output.current_line;ee.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else V==="NEWLINE"?T(this._flags.last_token,_)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&T(C,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==r.END_EXPR?(this._flags.last_token.type!==r.START_EXPR||!T(C,["var","let","const"]))&&this._flags.last_token.text!==":"&&(m(C,"if")&&m(C.previous,"else")?this._output.space_before_token=!0:this.print_newline()):T(C,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():V==="SPACE"&&(this._output.space_before_token=!0);C.previous&&(C.previous.type===r.WORD||C.previous.type===r.RESERVED)&&(this._output.space_before_token=!0),this.print_token(C),this._flags.last_word=C.text,C.type===r.RESERVED&&(C.text==="do"?this._flags.do_block=!0:C.text==="if"?this._flags.if_block=!0:C.text==="import"?this._flags.import_block=!0:this._flags.import_block&&m(C,"from")&&(this._flags.import_block=!1))},I.prototype.handle_semicolon=function(C){this.start_of_statement(C)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(C);for(var F=this._tokens.peek();this._flags.mode===u.Statement&&!(this._flags.if_block&&m(F,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(C)},I.prototype.handle_string=function(C){C.text.startsWith("`")&&C.newlines===0&&C.whitespace_before===""&&(C.previous.text===")"||this._flags.last_token.type===r.WORD)||(this.start_of_statement(C)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(C),this._flags.last_token.type===r.RESERVED||this._flags.last_token.type===r.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.EQUALS||this._flags.last_token.type===r.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C):C.text.startsWith("`")&&this._flags.last_token.type===r.END_EXPR&&(C.previous.text==="]"||C.previous.text===")")&&C.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(C)},I.prototype.handle_equals=function(C){this.start_of_statement(C)||this.handle_whitespace_and_comments(C),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(C),this._output.space_before_token=!0},I.prototype.handle_comma=function(C){this.handle_whitespace_and_comments(C,!0),this.print_token(C),this._output.space_before_token=!0,this._flags.declaration_statement?(O(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(C)):this._flags.mode===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(C)},I.prototype.handle_operator=function(C){var F=C.text==="*"&&(T(this._flags.last_token,["function","yield"])||t(this._flags.last_token.type,[r.START_BLOCK,r.COMMA,r.END_BLOCK,r.SEMICOLON])),V=t(C.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(C)){var ee=!F;this.handle_whitespace_and_comments(C,ee)}if(C.text==="*"&&this._flags.last_token.type===r.DOT){this.print_token(C);return}if(C.text==="::"){this.print_token(C);return}if(this._flags.last_token.type===r.OPERATOR&&t(this._options.operator_position,o)&&this.allow_wrap_or_preserved_newline(C),C.text===":"&&this._flags.in_case){this.print_token(C),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==r.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var ie=!0,pe=!0,ve=!1;if(C.text===":"?this._flags.ternary_depth===0?ie=!1:(this._flags.ternary_depth-=1,ve=!0):C.text==="?"&&(this._flags.ternary_depth+=1),!V&&!F&&this._options.preserve_newlines&&t(C.text,n)){var ye=C.text===":",Ee=ye&&ve,Se=ye&&!ve;switch(this._options.operator_position){case h.before_newline:this._output.space_before_token=!Se,this.print_token(C),(!ye||Ee)&&this.allow_wrap_or_preserved_newline(C),this._output.space_before_token=!0;return;case h.after_newline:this._output.space_before_token=!0,!ye||Ee?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(C):this._output.space_before_token=!1,this.print_token(C),this._output.space_before_token=!0;return;case h.preserve_newline:Se||this.allow_wrap_or_preserved_newline(C),ie=!(this._output.just_added_newline()||Se),this._output.space_before_token=ie,this.print_token(C),this._output.space_before_token=!0;return}}if(F){this.allow_wrap_or_preserved_newline(C),ie=!1;var fe=this._tokens.peek();pe=fe&&t(fe.type,[r.WORD,r.RESERVED])}else if(C.text==="...")this.allow_wrap_or_preserved_newline(C),ie=this._flags.last_token.type===r.START_BLOCK,pe=!1;else if(t(C.text,["--","++","!","~"])||V){if((this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR)&&this.allow_wrap_or_preserved_newline(C),ie=!1,pe=!1,C.newlines&&(C.text==="--"||C.text==="++"||C.text==="~")){var K=T(this._flags.last_token,_)&&C.newlines;K&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(K,!0)}this._flags.last_token.text===";"&&O(this._flags.mode)&&(ie=!0),this._flags.last_token.type===r.RESERVED?ie=!0:this._flags.last_token.type===r.END_EXPR?ie=!(this._flags.last_token.text==="]"&&(C.text==="--"||C.text==="++")):this._flags.last_token.type===r.OPERATOR&&(ie=t(C.text,["--","-","++","+"])&&t(this._flags.last_token.text,["--","-","++","+"]),t(C.text,["+","-"])&&t(this._flags.last_token.text,["--","++"])&&(pe=!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||ie,this.print_token(C),this._output.space_before_token=pe},I.prototype.handle_block_comment=function(C,F){if(this._output.raw){this._output.add_raw_token(C),C.directives&&C.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(C.directives){this.print_newline(!1,F),this.print_token(C),C.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!s.newline.test(C.text)&&!C.newlines){this._output.space_before_token=!0,this.print_token(C),this._output.space_before_token=!0;return}else this.print_block_commment(C,F)},I.prototype.print_block_commment=function(C,F){var V=p(C.text),ee,ie=!1,pe=!1,ve=C.whitespace_before,ye=ve.length;if(this.print_newline(!1,F),this.print_token_line_indentation(C),this._output.add_token(V[0]),this.print_newline(!1,F),V.length>1){for(V=V.slice(1),ie=L(V,"*"),pe=x(V,ve),ie&&(this._flags.alignment=1),ee=0;ee<V.length;ee++)ie?(this.print_token_line_indentation(C),this._output.add_token(E(V[ee]))):pe&&V[ee]?(this.print_token_line_indentation(C),this._output.add_token(V[ee].substring(ye))):(this._output.current_line.set_indent(-1),this._output.add_token(V[ee])),this.print_newline(!1,F);this._flags.alignment=0}},I.prototype.handle_comment=function(C,F){C.newlines?this.print_newline(!1,F):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(C),this.print_newline(!1,F)},I.prototype.handle_dot=function(C){this.start_of_statement(C)||this.handle_whitespace_and_comments(C,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),T(this._flags.last_token,_)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(C,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(C)},I.prototype.handle_unknown=function(C,F){this.print_token(C),C.text[C.text.length-1]===`
`&&this.print_newline(!1,F)},I.prototype.handle_eof=function(C){for(;this._flags.mode===u.Statement;)this.restore_mode();this.handle_whitespace_and_comments(C)},e.exports.Beautifier=I},function(e){function w(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=[]}w.prototype.clone_empty=function(){var c=new w(this.__parent);return c.set_indent(this.__indent_count,this.__alignment_count),c},w.prototype.item=function(c){return c<0?this.__items[this.__items.length+c]:this.__items[c]},w.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},w.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))},w.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},w.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},w.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var 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},w.prototype.is_empty=function(){return this.__items.length===0},w.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},w.prototype.push=function(c){this.__items.push(c);var s=c.lastIndexOf(`
`);s!==-1?this.__character_count=c.length-s:this.__character_count+=c.length},w.prototype.pop=function(){var c=null;return this.is_empty()||(c=this.__items.pop(),this.__character_count-=c.length),c},w.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},w.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},w.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},w.prototype.toString=function(){var 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 v(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}v.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},v.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},v.prototype.__ensure_cache=function(c){for(;c>=this.__cache.length;)this.__add_column()},v.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 g(c,s){this.__indent_cache=new v(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 w(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}g.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},g.prototype.get_line_number=function(){return this.__lines.length},g.prototype.get_indent_string=function(c,s){return this.__indent_cache.get_indent_string(c,s)},g.prototype.get_indent_size=function(c,s){return this.__indent_cache.get_indent_size(c,s)},g.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},g.prototype.add_new_line=function(c){return this.is_empty()||!c&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},g.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},g.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},g.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)},g.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},g.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()},g.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(" "))},g.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()},g.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},g.prototype.just_added_newline=function(){return this.current_line.is_empty()},g.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},g.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 w(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},e.exports.Output=g},function(e){function w(v,g,c,s){this.type=v,this.text=g,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=w},function(e,w){var v="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",g="\\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}|["+v+c+"])",l="(?:\\\\u[0-9a-fA-F]{4}|["+g+c+s+"])*";w.identifier=new RegExp(i+l,"g"),w.identifierStart=new RegExp(i),w.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+g+c+s+"])+");var a=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;w.newline=/[\n\r\u2028\u2029]/,w.lineBreak=new RegExp(`\r
|`+w.newline.source),w.allLineBreaks=new RegExp(w.lineBreak.source,"g")},function(e,w,v){var g=v(6).Options,c=["before-newline","after-newline","preserve-newline"];function s(i){g.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 g,e.exports.Options=s},function(e){function w(c,s){this.raw_options=v(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"])}w.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},w.prototype._get_boolean=function(c,s){var i=this.raw_options[c],l=i===void 0?!!s:!!i;return l},w.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},w.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},w.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]},w.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},w.prototype._is_valid_selection=function(c,s){return c.length&&s.length&&!c.some(function(i){return s.indexOf(i)===-1})};function v(c,s){var i={};c=g(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 g(c){var s={},i;for(i in c){var l=i.replace(/-/g,"_");s[l]=c[i]}return s}e.exports.Options=w,e.exports.normalizeOpts=g,e.exports.mergeOpts=v},function(e,w,v){var g=v(8).InputScanner,c=v(9).Tokenizer,s=v(9).TOKEN,i=v(13).Directives,l=v(4),a=v(12).Pattern,n=v(14).TemplatablePattern;function r(L,x){return x.indexOf(L)!==-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(L,x){c.call(this,L,x),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var I=new a(this._input),k=new n(this._input).read_options(this._options);this.__patterns={template:k,identifier:k.starting_with(l.identifier).matching(l.identifierMatch),number:I.matching(y),punct:I.matching(h),comment:I.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:I.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:I.matching(/<!--/),html_comment_end:I.matching(/-->/),include:I.starting_with(/#include/).until_after(l.lineBreak),shebang:I.starting_with(/#!/).until_after(l.lineBreak),xml:I.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:k.until(/['\\\n\r\u2028\u2029]/),double_quote:k.until(/["\\\n\r\u2028\u2029]/),template_text:k.until(/[`\\$]/),template_expression:k.until(/[`}\\]/)}};d.prototype=new c,d.prototype._is_comment=function(L){return L.type===t.COMMENT||L.type===t.BLOCK_COMMENT||L.type===t.UNKNOWN},d.prototype._is_opening=function(L){return L.type===t.START_BLOCK||L.type===t.START_EXPR},d.prototype._is_closing=function(L,x){return(L.type===t.END_BLOCK||L.type===t.END_EXPR)&&x&&(L.text==="]"&&x.text==="["||L.text===")"&&x.text==="("||L.text==="}"&&x.text==="{")},d.prototype._reset=function(){p=!1},d.prototype._get_next_token=function(L,x){var I=null;this._readWhitespace();var k=this._input.peek();return k===null?this._create_token(t.EOF,""):(I=I||this._read_non_javascript(k),I=I||this._read_string(k),I=I||this._read_word(L),I=I||this._read_singles(k),I=I||this._read_comment(k),I=I||this._read_regexp(k,L),I=I||this._read_xml(k,L),I=I||this._read_punctuation(),I=I||this._create_token(t.UNKNOWN,this._input.next()),I)},d.prototype._read_word=function(L){var x;if(x=this.__patterns.identifier.read(),x!=="")return x=x.replace(l.allLineBreaks,`
`),!(L.type===t.DOT||L.type===t.RESERVED&&(L.text==="set"||L.text==="get"))&&b.test(x)?(x==="in"||x==="of")&&(L.type===t.WORD||L.type===t.STRING)?this._create_token(t.OPERATOR,x):this._create_token(t.RESERVED,x):this._create_token(t.WORD,x);if(x=this.__patterns.number.read(),x!=="")return this._create_token(t.WORD,x)},d.prototype._read_singles=function(L){var x=null;return L==="("||L==="["?x=this._create_token(t.START_EXPR,L):L===")"||L==="]"?x=this._create_token(t.END_EXPR,L):L==="{"?x=this._create_token(t.START_BLOCK,L):L==="}"?x=this._create_token(t.END_BLOCK,L):L===";"?x=this._create_token(t.SEMICOLON,L):L==="."&&T.test(this._input.peek(1))?x=this._create_token(t.DOT,L):L===","&&(x=this._create_token(t.COMMA,L)),x&&this._input.next(),x},d.prototype._read_punctuation=function(){var L=this.__patterns.punct.read();if(L!=="")return L==="="?this._create_token(t.EQUALS,L):L==="?."?this._create_token(t.DOT,L):this._create_token(t.OPERATOR,L)},d.prototype._read_non_javascript=function(L){var x="";if(L==="#"){if(this._is_first_token()&&(x=this.__patterns.shebang.read(),x))return this._create_token(t.UNKNOWN,x.trim()+`
`);if(x=this.__patterns.include.read(),x)return this._create_token(t.UNKNOWN,x.trim()+`
`);L=this._input.next();var I="#";if(this._input.hasNext()&&this._input.testChar(m)){do L=this._input.next(),I+=L;while(this._input.hasNext()&&L!=="#"&&L!=="=");return L==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(I+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(I+="{}",this._input.next(),this._input.next())),this._create_token(t.WORD,I)}this._input.back()}else if(L==="<"&&this._is_first_token()){if(x=this.__patterns.html_comment_start.read(),x){for(;this._input.hasNext()&&!this._input.testChar(l.newline);)x+=this._input.next();return p=!0,this._create_token(t.COMMENT,x)}}else if(p&&L==="-"&&(x=this.__patterns.html_comment_end.read(),x))return p=!1,this._create_token(t.COMMENT,x);return null},d.prototype._read_comment=function(L){var x=null;if(L==="/"){var I="";if(this._input.peek(1)==="*"){I=this.__patterns.block_comment.read();var k=E.get_directives(I);k&&k.ignore==="start"&&(I+=E.readIgnored(this._input)),I=I.replace(l.allLineBreaks,`
`),x=this._create_token(t.BLOCK_COMMENT,I),x.directives=k}else this._input.peek(1)==="/"&&(I=this.__patterns.comment.read(),x=this._create_token(t.COMMENT,I))}return x},d.prototype._read_string=function(L){if(L==="`"||L==="'"||L==='"'){var x=this._input.next();return this.has_char_escapes=!1,L==="`"?x+=this._read_string_recursive("`",!0,"${"):x+=this._read_string_recursive(L),this.has_char_escapes&&this._options.unescape_strings&&(x=O(x)),this._input.peek()===L&&(x+=this._input.next()),x=x.replace(l.allLineBreaks,`
`),this._create_token(t.STRING,x)}return null},d.prototype._allow_regexp_or_xml=function(L){return L.type===t.RESERVED&&r(L.text,["return","case","throw","else","do","typeof","yield"])||L.type===t.END_EXPR&&L.text===")"&&L.opened.previous.type===t.RESERVED&&r(L.opened.previous.text,["if","while","for"])||r(L.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(L,x){if(L==="/"&&this._allow_regexp_or_xml(x)){for(var I=this._input.next(),k=!1,C=!1;this._input.hasNext()&&(k||C||this._input.peek()!==L)&&!this._input.testChar(l.newline);)I+=this._input.peek(),k?k=!1:(k=this._input.peek()==="\\",this._input.peek()==="["?C=!0:this._input.peek()==="]"&&(C=!1)),this._input.next();return this._input.peek()===L&&(I+=this._input.next(),I+=this._input.read(l.identifier)),this._create_token(t.STRING,I)}return null},d.prototype._read_xml=function(L,x){if(this._options.e4x&&L==="<"&&this._allow_regexp_or_xml(x)){var I="",k=this.__patterns.xml.read_match();if(k){for(var C=k[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),F=C.indexOf("{")===0,V=0;k;){var ee=!!k[1],ie=k[2],pe=!!k[k.length-1]||ie.slice(0,8)==="![CDATA[";if(!pe&&(ie===C||F&&ie.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ee?--V:++V),I+=k[0],V<=0)break;k=this.__patterns.xml.read_match()}return k||(I+=this._input.match(/[\s\S]*/g)[0]),I=I.replace(l.allLineBreaks,`
`),this._create_token(t.STRING,I)}}return null};function O(L){for(var x="",I=0,k=new g(L),C=null;k.hasNext();)if(C=k.match(/([\s]|[^\\]|\\\\)+/g),C&&(x+=C[0]),k.peek()==="\\"){if(k.next(),k.peek()==="x")C=k.match(/x([0-9A-Fa-f]{2})/g);else if(k.peek()==="u")C=k.match(/u([0-9A-Fa-f]{4})/g);else{x+="\\",k.hasNext()&&(x+=k.next());continue}if(!C)return L;if(I=parseInt(C[1],16),I>126&&I<=255&&C[0].indexOf("x")===0)return L;if(I>=0&&I<32){x+="\\"+C[0];continue}else I===34||I===39||I===92?x+="\\"+String.fromCharCode(I):x+=String.fromCharCode(I)}return x}d.prototype._read_string_recursive=function(L,x,I){var k,C;L==="'"?C=this.__patterns.single_quote:L==='"'?C=this.__patterns.double_quote:L==="`"?C=this.__patterns.template_text:L==="}"&&(C=this.__patterns.template_expression);for(var F=C.read(),V="";this._input.hasNext();){if(V=this._input.next(),V===L||!x&&l.newline.test(V)){this._input.back();break}else V==="\\"&&this._input.hasNext()?(k=this._input.peek(),k==="x"||k==="u"?this.has_char_escapes=!0:k==="\r"&&this._input.peek(1)===`
`&&this._input.next(),V+=this._input.next()):I&&(I==="${"&&V==="$"&&this._input.peek()==="{"&&(V+=this._input.next()),I===V&&(L==="`"?V+=this._read_string_recursive("}",x,"`"):V+=this._read_string_recursive("`",x,"${"),this._input.hasNext()&&(V+=this._input.next())));V+=C.read(),F+=V}return F},e.exports.Tokenizer=d,e.exports.TOKEN=t,e.exports.positionable_operators=_.slice(),e.exports.line_starters=o.slice()},function(e){var w=RegExp.prototype.hasOwnProperty("sticky");function v(g){this.__input=g||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position<this.__input_length},v.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__input.charAt(this.__position),this.__position+=1),g},v.prototype.peek=function(g){var c=null;return g=g||0,g+=this.__position,g>=0&&g<this.__input_length&&(c=this.__input.charAt(g)),c},v.prototype.__match=function(g,c){g.lastIndex=c;var s=g.exec(this.__input);return s&&!(w&&g.sticky)&&(s.index!==c&&(s=null)),s},v.prototype.test=function(g,c){return c=c||0,c+=this.__position,c>=0&&c<this.__input_length?!!this.__match(g,c):!1},v.prototype.testChar=function(g,c){var s=this.peek(c);return g.lastIndex=0,s!==null&&g.test(s)},v.prototype.match=function(g){var c=this.__match(g,this.__position);return c?this.__position+=c[0].length:c=null,c},v.prototype.read=function(g,c,s){var i="",l;return g&&(l=this.match(g),l&&(i+=l[0])),c&&(l||!g)&&(i+=this.readUntil(c,s)),i},v.prototype.readUntil=function(g,c){var s="",i=this.__position;g.lastIndex=this.__position;var l=g.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},v.prototype.readUntilAfter=function(g){return this.readUntil(g,!0)},v.prototype.get_regexp=function(g,c){var s=null,i="g";return c&&w&&(i="y"),typeof g=="string"&&g!==""?s=new RegExp(g,i):g&&(s=new RegExp(g.source,i)),s},v.prototype.get_literal_regexp=function(g){return RegExp(g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},v.prototype.peekUntilAfter=function(g){var c=this.__position,s=this.readUntilAfter(g);return this.__position=c,s},v.prototype.lookBack=function(g){var c=this.__position-1;return c>=g.length&&this.__input.substring(c-g.length,c).toLowerCase()===g},e.exports.InputScanner=v},function(e,w,v){var g=v(8).InputScanner,c=v(3).Token,s=v(10).TokenStream,i=v(11).WhitespacePattern,l={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},a=function(n,r){this._input=new g(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 w(v){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=v}w.prototype.restart=function(){this.__position=0},w.prototype.isEmpty=function(){return this.__tokens_length===0},w.prototype.hasNext=function(){return this.__position<this.__tokens_length},w.prototype.next=function(){var v=null;return this.hasNext()&&(v=this.__tokens[this.__position],this.__position+=1),v},w.prototype.peek=function(v){var g=null;return v=v||0,v+=this.__position,v>=0&&v<this.__tokens_length&&(g=this.__tokens[v]),g},w.prototype.add=function(v){this.__parent_token&&(v.parent=this.__parent_token),this.__tokens.push(v),this.__tokens_length+=1},e.exports.TokenStream=w},function(e,w,v){var g=v(12).Pattern;function c(s,i){g.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 g,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 w(v,g){this._input=v,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,g&&(this._starting_pattern=this._input.get_regexp(g._starting_pattern,!0),this._match_pattern=this._input.get_regexp(g._match_pattern,!0),this._until_pattern=this._input.get_regexp(g._until_pattern),this._until_after=g._until_after)}w.prototype.read=function(){var v=this._input.read(this._starting_pattern);return(!this._starting_pattern||v)&&(v+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),v},w.prototype.read_match=function(){return this._input.match(this._match_pattern)},w.prototype.until_after=function(v){var g=this._create();return g._until_after=!0,g._until_pattern=this._input.get_regexp(v),g._update(),g},w.prototype.until=function(v){var g=this._create();return g._until_after=!1,g._until_pattern=this._input.get_regexp(v),g._update(),g},w.prototype.starting_with=function(v){var g=this._create();return g._starting_pattern=this._input.get_regexp(v,!0),g._update(),g},w.prototype.matching=function(v){var g=this._create();return g._match_pattern=this._input.get_regexp(v,!0),g._update(),g},w.prototype._create=function(){return new w(this._input,this)},w.prototype._update=function(){},e.exports.Pattern=w},function(e){function w(v,g){v=typeof v=="string"?v:v.source,g=typeof g=="string"?g:g.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+g,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+g,"g")}w.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var g={};this.__directive_pattern.lastIndex=0;for(var c=this.__directive_pattern.exec(v);c;)g[c[1]]=c[2],c=this.__directive_pattern.exec(v);return g},w.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=w},function(e,w,v){var g=v(12).Pattern,c={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function s(i,l){g.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 g(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 g,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}],S={};function W(e){var w=S[e];if(w!==void 0)return w.exports;var v=S[e]={exports:{}};return P[e](v,v.exports,W),v.exports}var N=W(0);A=N})();var j=A;!(ne=[],B=function(){return{js_beautify:j}}.apply(se,ne),B!==void 0&&(Le.exports=B))})()},"6eGT":function(Le,se,U){"use strict";function ne(B){return null}se.a=ne},"746U":function(Le,se,U){"use strict";U.d(se,"f",function(){return ne}),U.d(se,"l",function(){return B}),U.d(se,"k",function(){return A}),U.d(se,"j",function(){return j}),U.d(se,"g",function(){return P}),U.d(se,"m",function(){return S}),U.d(se,"h",function(){return W}),U.d(se,"n",function(){return N}),U.d(se,"c",function(){return e}),U.d(se,"a",function(){return w}),U.d(se,"i",function(){return v}),U.d(se,"o",function(){return g}),U.d(se,"e",function(){return i}),U.d(se,"d",function(){return l}),U.d(se,"p",function(){return a}),U.d(se,"b",function(){return n});function ne(r){return Array.isArray(r)}function B(r){return typeof r=="string"}function A(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)&&!(r instanceof RegExp)&&!(r instanceof Date)}function j(r){return typeof r=="number"&&!isNaN(r)}function P(r){return r===!0||r===!1}function S(r){return typeof r=="undefined"}function W(r){return!N(r)}function N(r){return S(r)||r===null}function e(r,t){if(!r)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function w(r){if(N(r))throw new Error("Assertion Failed: argument is undefined or null");return r}function v(r){return typeof r=="function"}function g(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(B(t)){if(typeof r!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(v(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(Le,se,U){"use strict";U.d(se,"e",function(){return W}),U.d(se,"c",function(){return e}),U.d(se,"d",function(){return w}),U.d(se,"a",function(){return g}),U.d(se,"f",function(){return c}),U.d(se,"b",function(){return s});var ne=U("KQm4"),B=U("VTBJ"),A=U("Ff2n"),j=U("Zm9Q"),P=U("Kwbf"),S=U("OZM5");function W(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(j.a)(a);return n.map(function(r){if(!Object(S.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(A.a)(E,["children"]),T=Object(B.a)({key:t},m),_=l(y);return _.length&&(T.children=_),T}).filter(function(r){return r})}return l(i)}function w(){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(S.h)(E?E.pos:"0",m),_=W(y.key,T),f=Object(B.a)(Object(B.a)({},y),{},{parent:E,pos:T,children:null,data:y,isStart:[].concat(Object(ne.a)(E?E.isStart:[]),[m===0]),isEnd:[].concat(Object(ne.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 v(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 W(E.key,y)};function r(t,E,y){var m=t?t.children:i,T=t?Object(S.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 g(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),v(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=W(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(B.a)(Object(B.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(Le,se,U){"use strict";U.d(se,"a",function(){return P}),U.d(se,"b",function(){return S}),U.d(se,"d",function(){return W}),U.d(se,"e",function(){return N}),U.d(se,"c",function(){return e});var ne=U("MI8n"),B=U("pmY6"),A=U("3/fG"),j=function(w,v,g,c){function s(i){return i instanceof g?i:new g(function(l){l(i)})}return new(g||(g=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(w,v||[])).next())})};class P extends B.a{constructor(w,v="",g="",c=!0,s){super();this._onDidChange=this._register(new ne.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=w,this._label=v,this._cssClass=g,this._enabled=c,this._actionCallback=s}get id(){return this._id}get label(){return this._label}set label(w){this._setLabel(w)}_setLabel(w){this._label!==w&&(this._label=w,this._onDidChange.fire({label:w}))}get tooltip(){return this._tooltip||""}set tooltip(w){this._setTooltip(w)}_setTooltip(w){this._tooltip!==w&&(this._tooltip=w,this._onDidChange.fire({tooltip:w}))}get class(){return this._cssClass}set class(w){this._setClass(w)}_setClass(w){this._cssClass!==w&&(this._cssClass=w,this._onDidChange.fire({class:w}))}get enabled(){return this._enabled}set enabled(w){this._setEnabled(w)}_setEnabled(w){this._enabled!==w&&(this._enabled=w,this._onDidChange.fire({enabled:w}))}get checked(){return this._checked}set checked(w){this._setChecked(w)}_setChecked(w){this._checked!==w&&(this._checked=w,this._onDidChange.fire({checked:w}))}run(w,v){return j(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(w))})}}class S extends B.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new ne.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new ne.b),this.onDidRun=this._onDidRun.event}run(w,v){return j(this,void 0,void 0,function*(){if(!w.enabled)return;this._onBeforeRun.fire({action:w});let g;try{yield this.runAction(w,v)}catch(c){g=c}this._onDidRun.fire({action:w,error:g})})}runAction(w,v){return j(this,void 0,void 0,function*(){yield w.run(v)})}}class W extends P{constructor(w){super(W.ID,w,w?"separator text":"separator");this.checked=!1,this.enabled=!1}}W.ID="vs.actions.separator";class N{constructor(w,v,g,c){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=w,this.label=v,this.class=c,this._actions=g}get actions(){return this._actions}dispose(){}run(){return j(this,void 0,void 0,function*(){})}}class e extends P{constructor(){super(e.ID,A.a("submenu.empty","(empty)"),void 0,!1)}}e.ID="vs.actions.empty"},"8hTe":function(Le,se,U){Le.exports={button:"button___1wy9m"}},"9Bee":function(Le,se,U){"use strict";var ne=U("DYRE"),B=U("zeV3"),A=U("+L6B"),j=U("2/Rp"),P=U("k1fw"),S=U("9og8"),W=U("tJVT"),N=U("WmNS"),e=U.n(N),w=U("q1tI"),v=U.n(w),g=U("vg9a"),c=U("DlQD"),s=U.n(c),i=U("rUJ1");function l(Z,z){var G=Z.match(/^(\s+)(?:```)/);if(G===null)return z;var X=G[1];return z.split(`
`).map(function(Q){var Y=Q.match(/^\s+/);if(Y===null)return Q;var $=Object(W.a)(Y,1),te=$[0];return te.length>=X.length?Q.slice(X.length):Q}).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(Z,z,G,X){if(z>=Z.length||Z[z].level<=G)return z;var Q=Z[z];X.push("<li><a href='#"+Q.anchor+"'>"+Q.text+"</a>"),z++;var Y=[];return z=m(Z,z,Q.level,Y),Y.length>0&&(X.push("<ul>"),Y.forEach(function($){X.push($)}),X.push("</ul>")),X.push("</li>"),z=m(Z,z,G,X),z}function T(){return m(a,0,0,n),n.push("</ul>"),n.join("")}var _={heading:function(z){var G=t.exec(z);if(G)return{type:"heading",raw:G[0],depth:G[1].length,text:G[2]}},fences:function(z){var G=this.rules.block.fences.exec(z);if(G){var X=G[0],Q=l(X,G[3]||""),Y=G[2]?G[2].trim():G[2];if(["latex","katex","math"].indexOf(Y)>=0){var $=o(),te=Q;Q=$,u[$]={type:"block",expression:te}}return{type:"code",raw:X,lang:Y,text:Q}}}},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(Z){return Z=Z.replace(f,function(z,G){var X=o();return u[X]={type:"inline",expression:G},X}),Z}var O=r.listitem;r.listitem=function(Z){return O(d(Z))};var L=r.paragraph;r.paragraph=function(Z){return L(d(Z))};var x=r.tablecell;r.tablecell=function(Z,z){return x(d(Z),z)},r.code=function(Z,z,G){var X=(z||"").match(/\S*/)[0];return X?["latex","katex","math"].indexOf(X)>=0?"<p class='editormd-tex'>".concat(Z,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(z,'">').concat(G?Z:Object(i.escape)(Z,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(G?Z:Object(i.escape)(Z,!0))+"</code></pre>"},r.heading=function(Z,z,G){var X=this.options.headerPrefix+G.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return a.push({anchor:X,level:z,text:Z}),"<h"+z+' id="'+X+'">'+Z+"</h"+z+">"},s.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),s.a.use({tokenizer:_,renderer:r});var I=s.a,k=U("SJMd"),C=U("ulZh"),F=U.n(C),V=U("m3rI"),ee=U("Oy/b"),ie=U("p5ED"),pe=U("ErOA"),ve=U("STEk");/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var ye=function(Z,z){return(ye=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(G,X){G.__proto__=X}||function(G,X){for(var Q in X)Object.prototype.hasOwnProperty.call(X,Q)&&(G[Q]=X[Q])})(Z,z)};function Ee(Z,z){if(typeof z!="function"&&z!==null)throw new TypeError("Class extends value "+String(z)+" is not a constructor or null");function G(){this.constructor=Z}ye(Z,z),Z.prototype=z===null?Object.create(z):(G.prototype=z.prototype,new G)}function Se(Z,z,G,X){return new(G||(G=Promise))(function(Q,Y){function $(le){try{re(X.next(le))}catch(he){Y(he)}}function te(le){try{re(X.throw(le))}catch(he){Y(he)}}function re(le){var he;le.done?Q(le.value):(he=le.value,he instanceof G?he:new G(function(Te){Te(he)})).then($,te)}re((X=X.apply(Z,z||[])).next())})}function fe(Z,z){var G,X,Q,Y,$={label:0,sent:function(){if(1&Q[0])throw Q[1];return Q[1]},trys:[],ops:[]};return Y={next:te(0),throw:te(1),return:te(2)},typeof Symbol=="function"&&(Y[Symbol.iterator]=function(){return this}),Y;function te(re){return function(le){return function(he){if(G)throw new TypeError("Generator is already executing.");for(;$;)try{if(G=1,X&&(Q=2&he[0]?X.return:he[0]?X.throw||((Q=X.return)&&Q.call(X),0):X.next)&&!(Q=Q.call(X,he[1])).done)return Q;switch(X=0,Q&&(he=[2&he[0],Q.value]),he[0]){case 0:case 1:Q=he;break;case 4:return $.label++,{value:he[1],done:!1};case 5:$.label++,X=he[1],he=[0];continue;case 7:he=$.ops.pop(),$.trys.pop();continue;default:if(!(Q=$.trys,(Q=Q.length>0&&Q[Q.length-1])||he[0]!==6&&he[0]!==2)){$=0;continue}if(he[0]===3&&(!Q||he[1]>Q[0]&&he[1]<Q[3])){$.label=he[1];break}if(he[0]===6&&$.label<Q[1]){$.label=Q[1],Q=he;break}if(Q&&$.label<Q[2]){$.label=Q[2],$.ops.push(he);break}Q[2]&&$.ops.pop(),$.trys.pop();continue}he=z.call(Z,$)}catch(Te){he=[6,Te],X=0}finally{G=Q=0}if(5&he[0])throw he[1];return{value:he[0]?he[1]:void 0,done:!0}}([re,le])}}}var K=function(){function Z(){}return Z.addKey=function(z){Z.key=z},Object.defineProperty(Z,"isLicensed",{get:function(){return!!Z.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Z.key)},enumerable:!1,configurable:!0}),Z}(),R=function(){function Z(){}return Z.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Z.setAttributes=function(z,G){for(var X=0,Q=G;X<Q.length;X++){var Y=Q[X],$=Y[0],te=Y[1];z.setAttribute($,te)}},Z.createRect=function(z,G,X){var Q=document.createElementNS("http://www.w3.org/2000/svg","rect");return Q.setAttribute("width",z.toString()),Q.setAttribute("height",G.toString()),X&&Z.setAttributes(Q,X),Q},Z.createLine=function(z,G,X,Q,Y){var $=document.createElementNS("http://www.w3.org/2000/svg","line");return $.setAttribute("x1",z.toString()),$.setAttribute("y1",G.toString()),$.setAttribute("x2",X.toString()),$.setAttribute("y2",Q.toString()),Y&&Z.setAttributes($,Y),$},Z.createPolygon=function(z,G){var X=document.createElementNS("http://www.w3.org/2000/svg","polygon");return X.setAttribute("points",z),G&&Z.setAttributes(X,G),X},Z.createCircle=function(z,G){var X=document.createElementNS("http://www.w3.org/2000/svg","circle");return X.setAttribute("cx",(z/2).toString()),X.setAttribute("cy",(z/2).toString()),X.setAttribute("r",z.toString()),G&&Z.setAttributes(X,G),X},Z.createEllipse=function(z,G,X){var Q=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return Q.setAttribute("cx",(z/2).toString()),Q.setAttribute("cy",(G/2).toString()),Q.setAttribute("rx",(z/2).toString()),Q.setAttribute("ry",(G/2).toString()),X&&Z.setAttributes(Q,X),Q},Z.createGroup=function(z){var G=document.createElementNS("http://www.w3.org/2000/svg","g");return z&&Z.setAttributes(G,z),G},Z.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Z.createMarker=function(z,G,X,Q,Y,$,te){var re=document.createElementNS("http://www.w3.org/2000/svg","marker");return Z.setAttributes(re,[["id",z],["orient",G],["markerWidth",X.toString()],["markerHeight",Q.toString()],["refX",Y.toString()],["refY",$.toString()]]),re.appendChild(te),re},Z.createText=function(z){var G=document.createElementNS("http://www.w3.org/2000/svg","text");return G.setAttribute("x","0"),G.setAttribute("y","0"),z&&Z.setAttributes(G,z),G},Z.createTSpan=function(z,G){var X=document.createElementNS("http://www.w3.org/2000/svg","tspan");return X.textContent=z,G&&Z.setAttributes(X,G),X},Z.createImage=function(z){var G=document.createElementNS("http://www.w3.org/2000/svg","image");return z&&Z.setAttributes(G,z),G},Z.createPoint=function(z,G){var X=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return X.x=z,X.y=G,X},Z.createPath=function(z,G){var X=document.createElementNS("http://www.w3.org/2000/svg","path");return X.setAttribute("d",z),G&&Z.setAttributes(X,G),X},Z.createElement=function(z,G){var X=document.createElementNS("http://www.w3.org/2000/svg",z);return G&&Z.setAttributes(X,G),X},Z.getHollowRectanglePath=function(z,G,X,Q,Y,$,te,re){return"M"+z+","+G+"V"+(G+Q)+"H"+(z+X)+"V"+G+"H"+Y+"V"+$+"H"+(Y+te)+"V"+($+re)+"H"+Y+"V"+G+"Z"},Z}(),D=function(){function Z(z){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+z+"_"}return Object.defineProperty(Z.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Z.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(Z.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),Z.prototype.addClass=function(z){return this.styleSheet===void 0&&this.addStyleSheet(),z.name=""+this.classNamePrefix+z.localName,this.classes.push(z),this.styleSheet.sheet.insertRule("."+z.name+" {"+z.style+"}",this.styleSheet.sheet.cssRules.length),z},Z.prototype.addRule=function(z){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(z),this.styleSheet.sheet.insertRule(z.selector+" {"+z.style+"}",this.styleSheet.sheet.cssRules.length)},Z.prototype.addStyleSheet=function(){var z;this.styleSheet=document.createElement("style"),((z=this.styleSheetRoot)!==null&&z!==void 0?z:document.head).appendChild(this.styleSheet),this.addRule(new H("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new H("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new H("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new J("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new J("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},Z.prototype.removeStyleSheet=function(){var z;this.styleSheet&&(((z=this.styleSheetRoot)!==null&&z!==void 0?z:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Z}(),H=function(Z,z){this.selector=Z,this.style=z},J=function(Z,z){this.localName=Z,this.style=z},M=function(){function Z(){this.blocks=[],this.display=""}return Z.prototype.addButtonBlock=function(z){z.className=this.blockClassName,z.buttonClassName=this.buttonClassName,z.buttonColorsClassName=this.buttonColorsClassName,z.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(z)},Z.prototype.addElementBlock=function(z){z.className===void 0&&(z.className=this.blockClassName),this.blocks.push(z)},Z.prototype.getUI=function(){var z=document.createElement("div");return z.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,z.style.display=this.display,this.blocks.forEach(function(G){return z.appendChild(G.getUI())}),z},Z}(),ae=function(){function Z(){}return Z.prototype.getUI=function(){var z=document.createElement("div");if(z.className=this.className,this.minWidth!==void 0&&(z.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":z.style.justifyContent="flex-start";break;case"center":z.style.justifyContent="center";break;case"end":z.style.justifyContent="flex-end"}return z.style.whiteSpace="nowrap",z},Z}(),me=function(Z){function z(){var G=Z!==null&&Z.apply(this,arguments)||this;return G.buttons=[],G}return Ee(z,Z),z.prototype.addButton=function(G){G.className=this.buttonClassName,G.colorsClassName=this.buttonColorsClassName,G.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(G)},z.prototype.getUI=function(){var G=Z.prototype.getUI.call(this);return this.buttons.forEach(function(X){return G.appendChild(X.getUI())}),G},z}(ae),_e=function(){function Z(z,G){this._isActive=!1,this._isHidden=!1,this._icon=z,this.title=G,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(Z.prototype,"icon",{get:function(){return this._icon},set:function(z){this._icon=z,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isActive",{get:function(){return this._isActive},set:function(z){this._isActive=z,this.adjustClassName()},enumerable:!1,configurable:!0}),Z.prototype.getUI=function(){var z=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 z.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},Z.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,"")))},Z.prototype.hide=function(){this._isHidden=!0},Z}(),q=function(Z){function z(){var G=Z!==null&&Z.apply(this,arguments)||this;return G.elements=[],G}return Ee(z,Z),z.prototype.addElement=function(G){this.elements.push(G)},z.prototype.getUI=function(){var G=Z.prototype.getUI.call(this);return this.elements.forEach(function(X){return G.appendChild(X)}),G},z}(ae),oe=function(){function Z(z,G){this.horizontal=z,this.vertical=G}return Object.defineProperty(Z.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),Z.prototype.getVerticalLength=function(z){return z/this.ratio},Z.prototype.getHorizontalLength=function(z){return z*this.ratio},Z}(),ue=function(){function Z(){}return Z.getIcon=function(z,G){if(z>0&&G>0){var X=new oe(z,G),Q=X.ratio>=1?20:X.getHorizontalLength(20),Y=X.ratio<1?20:X.getVerticalLength(20),$=document.createElementNS("http://www.w3.org/2000/svg","svg");$.setAttribute("xmlns","http://www.w3.org/2000/svg"),$.setAttribute("viewBox","0 0 24 24"),document.body.appendChild($);var te=R.createDefs();$.appendChild(te);var re=R.createElement("clipPath",[["id","text-bg-clip"]]);te.appendChild(re);var le=R.createPath(R.getHollowRectanglePath((24-Q)/2,(24-Y)/2,Q,Y,(24-Q)/2+2,(24-Y)/2+2,Q-4,Y-4));$.appendChild(le);var he=R.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);he.appendChild(R.createTSpan(z+":"+G)),$.appendChild(he);var Te=he.getBBox();R.setAttributes(he,[["x",((24-Te.width)/2).toString()],["y",((24-Te.height)/2-Te.y).toString()]]);var Re=R.createPath(R.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Te.width))/2,(24-Math.ceil(Te.height))/2,Math.ceil(Te.width),Math.ceil(Te.height)));return re.appendChild(Re),R.setAttributes(le,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild($),$.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>'},Z}(),ce=function(Z){function z(G,X,Q){var Y=Z.call(this,G,X)||this;return Y.isDropdownOpen=!1,Y.onClick=Y.dropdownButtonClicked,Y.dropdownButtons=Q,Y}return Ee(z,Z),z.prototype.setupDropdown=function(){var G=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(X){X.className=G.className,X.colorsClassName=G.colorsClassName,G.dropdownBlock.appendChild(X.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},z.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},z.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},z.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},z.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},z.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},z}(_e),be=function(){function Z(z,G){this.GRIP_SIZE=10,this.color=z,this.fillColor=G,this.visual=R.createGroup(),this.visual.appendChild(R.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(R.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Z.prototype.ownsTarget=function(z){return z===this.visual||z===this.visual.childNodes[0]||z===this.visual.childNodes[1]},Z.prototype.setCenter=function(z,G){this.visual.childNodes.forEach(function(X){return R.setAttributes(X,[["cx",z.toString()],["cy",G.toString()]])})},Z}(),Ce=function(){function Z(z,G,X,Q){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=z,this.canvasHeight=G,this.margin=X,this.container=Q,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(Z.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(z){this._aspectRatio=z,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(z){this._isGridVisible=z,this.gridContainer&&R.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(z){this._zoomFactor=z,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Z.prototype.open=function(){var z=this;this.cropShadeElement=R.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=R.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var G=0;G<this.numberOfGridLines;G++)this.horizontalGridLines.push(R.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(R.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(X){return z.gridContainer.appendChild(X)}),this.verticalGridLines.forEach(function(X){return z.gridContainer.appendChild(X)}),this.cropRectElement=R.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new be(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new be(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new be(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new be(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},Z.prototype.setCropRectangle=function(z){this.cropRect=z;var G=Object.assign({},this.cropRect);this.zoomFactor!==1&&(G.width=this.cropRect.width*this.zoomFactor,G.height=this.cropRect.height*this.zoomFactor,G.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-G.width/2,G.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-G.height/2),R.setAttributes(this.cropRectElement,[["x",G.x.toString()],["y",G.y.toString()],["width",G.width.toString()],["height",G.height.toString()]]);var X=G.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(Y,$){var te=G.y+X*($+1);R.setAttributes(Y,[["x1",""+G.x],["y1",""+te],["x2",""+(G.x+G.width)],["y2",""+te]])});var Q=G.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(Y,$){var te=G.x+Q*($+1);R.setAttributes(Y,[["x1",""+te],["y1",""+G.y],["x2",""+te],["y2",""+(G.y+G.height)]])}),R.setAttributes(this.cropShadeElement,[["d",R.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,G.x,G.y,G.width,G.height)]]),this.topLeftGrip.setCenter(G.x,G.y),this.topRightGrip.setCenter(G.x+G.width,G.y),this.bottomLeftGrip.setCenter(G.x,G.y+G.height),this.bottomRightGrip.setCenter(G.x+G.width,G.y+G.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},Z.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)},Z.prototype.clientToLocalCoordinates=function(z,G){var X=this.container.getBoundingClientRect();return{x:z-X.left+this.margin,y:G-X.top+this.margin}},Z.prototype.onPointerDown=function(z){this.container.setPointerCapture(z.pointerId),this.previousPoint=this.clientToLocalCoordinates(z.clientX,z.clientY),this.cropRectElement===z.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(z.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(z.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(z.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(z.target)&&(this.activeGrip=this.bottomRightGrip)},Z.prototype.onPointerMove=function(z){if(this.isMoving)this.move(this.clientToLocalCoordinates(z.clientX,z.clientY));else if(this.activeGrip){var G=this.clientToLocalCoordinates(z.clientX,z.clientY);this.resize(G)}z.preventDefault()},Z.prototype.onPointerUp=function(z){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(z.pointerId)},Z.prototype.move=function(z){var G=z.x-this.previousPoint.x,X=z.y-this.previousPoint.y;this.zoomFactor!==1&&(G=-G/this.zoomFactor,X=-X/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+G),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+X),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=z},Z.prototype.resize=function(z){var G=Object.assign({},this.cropRect),X=z.x-this.previousPoint.x,Q=z.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:G.x+X<this.margin&&(X=this.margin-G.x),G.x+=X,G.width=this.cropRect.x+this.cropRect.width-G.x;break;case this.bottomRightGrip:case this.topRightGrip:G.width+X>this.canvasWidth*this.zoomFactor&&(X=this.canvasWidth*this.zoomFactor-G.width),G.width+=X}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(G.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(X),G.height=this.aspectRatio.getVerticalLength(G.width)):(G.y+=Q,G.height=this.cropRect.y+this.cropRect.height-G.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?G.height=this.aspectRatio.getVerticalLength(G.width):G.height+=Q}G.width<10&&(G.x=this.cropRect.x,G.width=10),G.height<10&&(G.y=this.cropRect.y,G.height=10),this.previousPoint=z,G.x>=this.margin&&G.y>=this.margin&&G.x-this.margin+G.width<=this.canvasWidth&&G.y-this.margin+G.height<=this.canvasHeight&&(this.cropRect=G,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},Z.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var z=this.cropRect.x+this.cropRect.width/2,G=this.cropRect.y+this.cropRect.height/2,X=this.aspectRatio.getHorizontalLength(this.cropRect.height),Q=this.aspectRatio.getVerticalLength(this.cropRect.width);X/this.canvasWidth<Q/this.canvasHeight?this.cropRect.width=X:this.cropRect.height=Q,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=z-this.cropRect.width/2,this.cropRect.y=G-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)}},Z.prototype.getRescaledRect=function(z,G,X,Q,Y,$){var te=X/z,re=Q/G;return{x:(Y.x-$)*te+$,y:(Y.y-$)*re+$,width:Y.width*te,height:Y.height*re}},Z.prototype.scaleCanvas=function(z,G){var X=this.getRescaledRect(this.canvasWidth,this.canvasHeight,z,G,this.cropRect,this.margin);this.canvasWidth=z,this.canvasHeight=G,this.onCropChange&&this.onCropChange(X),this.setCropRectangle(X)},Z}(),Oe=function(){function Z(z){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=z,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(Z.prototype,"angle",{get:function(){return this._angle},set:function(z){this._angle=z,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),Z.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},Z.prototype.onPointerDown=function(z){this.controlContainer.setPointerCapture(z.pointerId),this.isDragging=!0,this.previousPoint={x:z.clientX,y:z.clientY}},Z.prototype.onPointerMove=function(z){this.isDragging&&(this.onAngleChange&&this.onAngleChange((z.clientX-this.previousPoint.x)/5),this.previousPoint.x=z.clientX)},Z.prototype.onPointerUp=function(z){this.isDragging&&this.onAngleChange&&this.onAngleChange((z.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(z.pointerId)},Z.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var z=this.angleLabelText.getBBox();R.setAttributes(this.angleLabelElement,[["x",((this.width-z.width)/2).toString()],["y",(this.height/2).toString()]])}},Z.prototype.positionScaleShape=function(){if(this.scaleShape){var z=this.scaleShape.transform.baseVal.getItem(0);z.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(z,0)}},Z.prototype.getVisual=function(){var z=document.createElementNS("http://www.w3.org/2000/svg","svg");z.setAttribute("xmlns","http://www.w3.org/2000/svg"),z.setAttribute("width",this.width+"px"),z.setAttribute("height",this.height+"px"),z.setAttribute("viewBox","0 0 "+this.width+" "+this.height),z.style.flexShrink="0",document.body.appendChild(z);for(var G="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,X=1;X<=this.width/5+10;X++){var Q=X%5==0?this.height/3:this.height/6;G+="h4v"+-Q+"h1v"+Q}G+="v1H0Z",this.scaleShape=R.createPath(G);var Y=R.createTransform();this.scaleShape.transform.baseVal.appendItem(Y),z.appendChild(this.scaleShape),this.angleLabelElement=R.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=R.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var $=R.createTSpan("");return $.innerHTML="&deg;",this.angleLabelElement.appendChild($),z.appendChild(this.angleLabelElement),document.body.removeChild(z),z},Z}(),Ie=function(){function Z(){this.naturalSize=!1,this.imageType="image/png"}return Z.prototype.rasterize=function(z,G,X,Q,Y,$,te){var re=this;return new Promise(function(le){var he=document.createElement("canvas");he.width=z.width.baseVal.value-2*Q,he.height=z.height.baseVal.value-2*Q;var Te=1,Re=1;re.naturalSize===!0?(Te=G.naturalWidth/(z.width.baseVal.value-2*Q)/$,Re=G.naturalHeight/(z.height.baseVal.value-2*Q)/te,he.width=G.naturalWidth/$,he.height=G.naturalHeight/te):re.width!==void 0&&re.height!==void 0&&(Te=re.width/X.width,Re=re.height/X.height,he.width*=Te,he.height*=Re);var Pe=he.getContext("2d");Pe.translate(he.width/2,he.height/2),Pe.rotate(Y*Math.PI/180),Pe.scale($,te),Pe.translate(-he.width/2,-he.height/2),Pe.drawImage(G,0,0,he.width,he.height);var Ae=document.createElement("canvas");Ae.width=X.width*Te,Ae.height=X.height*Re,Ae.getContext("2d").putImageData(Pe.getImageData((X.x-Q)*Te,(X.y-Q)*Re,X.width*Te,X.height*Re),0,0),le(Ae.toDataURL(re.imageType,re.imageQuality))})},Z}(),De=function(){function Z(z){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=Z.instanceCounter++,this.styles=new D(this.instanceNo),this.target=z,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(Z.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(z){this._zoomToCropEnabled=z,z?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(z){this._isGridVisible=z,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"gridLines",{get:function(){return this._gridLines},set:function(z){this._gridLines=z,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(z){this._rotationAngle=z,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"aspectRatio",{get:function(){var z;return(z=this._aspectRatio)!==null&&z!==void 0?z:this.aspectRatios[0]},set:function(z){this._aspectRatio=z},enumerable:!1,configurable:!0}),Z.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},Z.prototype.show=function(){this.showUI(),this.open()},Z.prototype.close=function(z){z===void 0&&(z=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),z||this.closeEventListeners.forEach(function(G){return G()}),this._isOpen=!1)},Z.prototype.addRenderEventListener=function(z){this.renderEventListeners.push(z)},Z.prototype.removeRenderEventListener=function(z){this.renderEventListeners.indexOf(z)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(z),1)},Z.prototype.addCloseEventListener=function(z){this.closeEventListeners.push(z)},Z.prototype.removeCloseEventListener=function(z){this.closeEventListeners.indexOf(z)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(z),1)},Z.prototype.setupResizeObserver=function(){var z=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){z.resize(z.target.clientWidth,z.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))},Z.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var z=1*this.target.clientWidth/this.target.clientHeight,G=this.contentDiv.clientWidth/z>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*z:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,X=G+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/z;this.resize(G,X)}},Z.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Z.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",R.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},Z.prototype.resize=function(z,G){this.imageWidth=Math.round(z),this.imageHeight=Math.round(G),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()},Z.prototype.setEditingTarget=function(){var z=document.createElement("canvas");z.width=this.target.naturalWidth,z.height=this.target.naturalHeight,z.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var G=z.toDataURL();R.setAttributes(this.editingTarget,[["href",G]]),this.setEditingTargetSize()},Z.prototype.setTopLeft=function(){var z=this.target.getBoundingClientRect(),G=this.editorCanvas.getBoundingClientRect();this.left=z.left-G.left-this.CANVAS_MARGIN,this.top=z.top-G.top-this.CANVAS_MARGIN},Z.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=R.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=R.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=R.createGroup(),this.editingTargetRotationScaleContainer=R.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var z=R.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(z);var G=R.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(G),this.editingTargetContainer=R.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)},Z.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},Z.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=R.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Ce(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()},Z.prototype.zoomToCrop=function(){if(this.cropRect){var z=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,G=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=z+"px "+G+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-z+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-G+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},Z.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)},Z.prototype.cropRectChanged=function(z){this.cropRect=z,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},Z.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},Z.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"},Z.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Z.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 z=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,G=this.target.offsetTop>z+this.CANVAS_MARGIN?this.target.offsetTop-(z+this.CANVAS_MARGIN):0;this.coverDiv.style.top=G+"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},Z.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},Z.prototype.addTopToolbar=function(){var z=this;this.topToolbar=new M,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 G=new me;G.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(G);var X=[];this.aspectRatios.forEach(function(Re){var Pe=new _e(ue.getIcon(Re.horizontal,Re.vertical),Re.horizontal===0&&Re.vertical===0?"FREE":Re.horizontal+":"+Re.vertical);Pe.onClick=function(){return z.ratioButtonClicked(Re)},X.push(Pe)}),this.aspectRatioButton=new ce(ue.getIcon(0,0),"Aspect ratio",X),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,G.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var Q=new _e('<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");Q.isActive=this.isGridVisible,Q.onClick=function(){z.isGridVisible=!z.isGridVisible,Q.isActive=z.isGridVisible},G.addButton(Q);var Y=new _e('<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(Y.isActive=this.zoomToCropEnabled,Y.onClick=function(){z.zoomToCropEnabled=!z.zoomToCropEnabled,Y.isActive=z.zoomToCropEnabled},G.addButton(Y),!K.isLicensed){var $=new q;this.topToolbar.addElementBlock($);var te=document.createElement("div");te.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var re=document.createElement("a");re.style.color="currentColor",re.href="https://markerjs.com/products/cropro",re.target="_blank",re.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>',te.appendChild(re),$.addElement(te)}var le=new me;le.minWidth=3*this.toolbarHeight+"px",le.contentAlign="end",this.topToolbar.addButtonBlock(le);var he=new _e('<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");he.onClick=this.startRenderAndClose,le.addButton(he),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(he.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Te=new _e('<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");Te.onClick=this.close,le.addButton(Te),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Te.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},Z.prototype.addBottomToolbar=function(){var z=this;this.bottomToolbar=new M,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 G=new me;G.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(G);var X=new _e('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");X.onClick=this.rotateLeftButtonClicked,G.addButton(X);var Q=new _e('<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");Q.onClick=this.rotateRightButtonClicked,G.addButton(Q);var Y=new q;Y.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(Y),this.straightener=new Oe("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(le){z.rotateBy(le),z.straightener.angle=z.rotationAngle},Y.addElement(this.straightener.getUI());var $=new me;$.minWidth=2*this.toolbarHeight+"px",$.contentAlign="end",this.bottomToolbar.addButtonBlock($);var te=new _e('<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");te.onClick=this.flipHorizontallyButtonClicked,$.addButton(te);var re=new _e('<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");re.onClick=this.flipVerticallyButtonClicked,$.addButton(re)},Z.prototype.ratioButtonClicked=function(z){this.aspectRatio=z,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},Z.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ue.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},Z.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new oe(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},Z.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Z.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},Z.prototype.restoreState=function(z){if(z){var G=this.cropLayer.getRescaledRect(z.width,z.height,this.imageWidth,this.imageHeight,z.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(G),this.cropRectChanged(G),this.flippedHorizontally=z.flippedHorizontally,this.flippedVertically=z.flippedVertically,this.applyFlip(),this.rotationAngle=z.rotationAngle,this.applyRotation()}},Z.prototype.clientToLocalCoordinates=function(z,G){var X=this.cropImage.getBoundingClientRect();return{x:z-X.left,y:G-X.top}},Z.prototype.onWindowResize=function(){this.positionUI()},Z.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var z=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=z+"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()},Z.prototype.rotateLeftButtonClicked=function(){var z=this.rotationAngle-90;this.rotationAngle%90!=0&&(z+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(z)},Z.prototype.rotateRightButtonClicked=function(){var z=this.rotationAngle+90;this.rotationAngle%90!=0&&(z-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(z)},Z.prototype.rotateTo=function(z){z=(z=z>180?z-360:z)<=-180?z+360:z,this.rotationAngle=z,this.applyRotation()},Z.prototype.rotateBy=function(z){this.rotateTo((this.rotationAngle+z)%360)},Z.prototype.applyRotation=function(){var z=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var G=this.editingTargetRotationContainer.transform.baseVal.getItem(0);G.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(G,0);var X=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/X.width,this.imageHeight/X.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=z},Z.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},Z.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},Z.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},Z.prototype.startRenderAndClose=function(){return Se(this,void 0,void 0,function(){var z,G;return fe(this,function(X){switch(X.label){case 0:return[4,this.render()];case 1:return z=X.sent(),G=this.getState(),this.renderEventListeners.forEach(function(Q){return Q(z,G)}),this.close(!0),[2]}})})},Z.prototype.render=function(){return Se(this,void 0,void 0,function(){var z;return fe(this,function(G){switch(G.label){case 0:return(z=new Ie).naturalSize=this.renderAtNaturalSize,z.imageType=this.renderImageType,z.imageQuality=this.renderImageQuality,z.width=this.renderWidth,z.height=this.renderHeight,this.unzoomFromCrop(),R.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,z.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 G.sent(),[4,z.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,G.sent()]}})})},Z.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new J("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 J("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new J("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var z=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new J("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*z)+`px;
height: `+(this.toolbarHeight-2*z)+`px;
padding: `+z+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new J("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new J("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new H("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new H("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new J("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 J("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new J("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 J("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*z)+`px;
padding: `+z+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new J("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},Z.instanceCounter=0,Z}(),Me=U("8hTe"),de=U.n(Me),ge=/<pre[^>]*>/g;function xe(Z){var z=document.createElement("div");return z.innerHTML=Z,z.childNodes.length===0?"":z.childNodes[0].nodeValue}var we=se.a=function(Z){var z=Z.value,G=z===void 0?"":z,X=Z.edit,Q=X===void 0?!1:X,Y=Z.className,$=Z.showTextOnly,te=Z.showLines,re=Z.replaces,le=Z.zoomImg,he=Z.hasMask,Te=Z.style,Re=Te===void 0?{}:Te,Pe=Z.stylesPrev,Ae=Pe===void 0?{}:Pe,Ge=String(G),Ne=Object(w.useRef)(),ke=Object(w.useRef)(),$e=Object(w.useState)(""),ze=Object(W.a)($e,2),He=ze[0],Ze=ze[1],We=Object(w.useState)("office"),Je=Object(W.a)(We,2),qe=Je[0],je=Je[1],tt=function(){var Ye=new De(ke.current);Ye.displayMode="popup",Ye.addRenderEventListener(function(){var Xe=Object(S.a)(e.a.mark(function Ke(at){var Ve;return e.a.wrap(function(nt){for(;;)switch(nt.prev=nt.next){case 0:return Ne.current.style.display="none",nt.next=3,Object(pe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:at}});case 3:Ve=nt.sent,Ve!=null&&Ve.id&&re(ke.current.getAttribute("src").replace(V.a.API_SERVER,""),"/api/attachments/".concat(Ve==null?void 0:Ve.id,"?type=").concat(Ve.content_type));case 5:case"end":return nt.stop()}},Ke)}));return function(Ke){return Xe.apply(this,arguments)}}()),Ye.show()},Ue=function(){var Ye=new ve.a(ke.current);Ye.settings.displayMode="popup",Ye.addEventListener("render",function(){var Xe=Object(S.a)(e.a.mark(function Ke(at){var Ve;return e.a.wrap(function(nt){for(;;)switch(nt.prev=nt.next){case 0:if(Ne.current.style.display="none",!ke.current){nt.next=6;break}return nt.next=4,Object(pe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:at.dataUrl}});case 4:Ve=nt.sent,Ve!=null&&Ve.id&&re(ke.current.getAttribute("src").replace(V.a.API_SERVER,""),"/api/attachments/".concat(Ve==null?void 0:Ve.id,"?type=").concat(Ve.content_type));case 6:case"end":return nt.stop()}},Ke)}));return function(Ke){return Xe.apply(this,arguments)}}()),Ye.show(),window.markerArea=Ye},Be=Object(w.useMemo)(function(){Ne.current&&(Ne.current.style.zIndex=-1);try{var rt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ye=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Xe=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Ge=Ge.replace(rt,"("+V.a.API_SERVER+"/api/attachments/").replace(Ye,'"'+V.a.API_SERVER+"/api/attachments/").replace(Xe,'"'+V.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(dt){}var Ke=I(Ge),at=b();if(Ge.match(/\[TOC\]/)&&(Ke=Ke.replace("<p>[TOC]</p>",T()),E()),Ke=Ke.replace(/(__special_katext_id_\d+__)/g,function(dt,nt){var yt=at[nt],xt=yt.type,_t=yt.expression;return Object(ee.renderToString)(xe(_t)||"",{displayMode:xt==="block",throwOnError:!1,output:"html"})}),Ke=Ke.replace(/▁/g,"\u2581\u2581\u2581"),p(),$){var Ve=document.createElement("div");return Ve.innerHTML=Ke,Ve.innerText}return setTimeout(function(){return lt()},500),Ke},[Ge]),Fe=Object(w.useRef)();y.WebkitLineClamp=te,te&&(Re=Object(P.a)(Object(P.a)({},Re),y));function it(rt){var Ye=rt.target;if(Ye.tagName.toUpperCase()==="IMG"){if(le){var Xe=Ye.getAttribute("src");Ze(Xe),je("image")}}else if(Ye.tagName.toUpperCase()==="A"){var Ke=Ye.getAttribute("href");if(Ke.indexOf("office")>-1)rt.preventDefault(),Ze(Ke),je("office");else if(Ke.indexOf("application/pdf")>-1)rt.preventDefault(),Ze(Ke),je("pdf");else if(Ke.indexOf("text/html")>-1)rt.preventDefault(),Ze(Ke),je("html");else if(Ke.startsWith("#")){rt.preventDefault();var at=document.getElementById(Ke.replace("#",""));at&&at.scrollIntoView(!0)}}}var lt=function(){var Ye,Xe=(Ye=Fe.current)===null||Ye===void 0?void 0:Ye.querySelectorAll("video");Xe==null||Xe.forEach(function(Ke){if(Ke.oncontextmenu=function(){return!1},Ke.src.indexOf(".m3u8")>-1&&!Ke.canPlayType("application/vnd.apple.mpegurl")){if(F.a.isSupported()){var at=new F.a;at.loadSource(Ke.src),at.attachMedia(Ke)}}})};Object(w.useEffect)(function(){if(Fe.current&&Be&&(Be.match(ge)&&window.PR.prettyPrint()),Fe.current)return Fe.current.addEventListener("click",it),function(){Fe.current.removeEventListener("click",it),p(),E()}},[Be,Fe.current,it]);var pt=function(Ye){if(!Q)return;Ye.target.nodeName==="IMG"?(Ne.current.style.zIndex=1,Ne.current.style.display="flex",Ne.current.style.width=Ye.target.clientWidth+"px",Ne.current.style.height=Ye.target.clientHeight+"px",Ne.current.style.top=Ye.target.offsetTop+"px",Ne.current.style.left=Ye.target.offsetLeft+"px",ke.current.src=Ye.target.getAttribute("src")):Ne.current.style.display="none"};return v.a.createElement("div",{style:{position:"relative"}},v.a.createElement("div",{ref:Fe,style:Object(P.a)({},Re),className:"".concat(Y||""," markdown-body ").concat(de.a.mdBody),onMouseOver:pt,dangerouslySetInnerHTML:{__html:Be}}),v.a.createElement("div",{ref:Ne,className:de.a.button},v.a.createElement(B.a,null,v.a.createElement(j.a,{onClick:function(){return tt()}},"\u88C1\u526A"),v.a.createElement(j.a,{onClick:function(){return Ue()}},"\u7F16\u8F91"))),v.a.createElement("img",{ref:ke,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),v.a.createElement(ie.a,{close:!0,data:He,type:He!=null&&He.length?qe:"",style:Object(P.a)({},Ae),onClose:function(){return Ze("")}}))}},BU3w:function(Le,se,U){"use strict";U.d(se,"a",function(){return S});var ne=U("MNnm"),B="rc-util-key";function A(W){if(W.attachTo)return W.attachTo;var N=document.querySelector("head");return N||document.body}function j(W){var N,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ne.a)())return null;var w=document.createElement("style");if((N=e.csp)===null||N===void 0?void 0:N.nonce){var v;w.nonce=(v=e.csp)===null||v===void 0?void 0:v.nonce}w.innerHTML=W;var g=A(e),c=g.firstChild;return e.prepend&&g.prepend?g.prepend(w):e.prepend&&c?g.insertBefore(w,c):g.appendChild(w),w}var P=new Map;function S(W,N){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},w=A(e);if(!P.has(w)){var v=j("",e),g=v.parentNode;P.set(w,g),g.removeChild(v)}var c=Array.from(P.get(w).children).find(function(n){return n.tagName==="STYLE"&&n[B]===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!==W&&(c.innerHTML=W),c}var a=j(W,e);return a[B]=N,a}},"C/vA":function(Le,se,U){"use strict";U.d(se,"a",function(){return ne});function ne(B){const A=this;let j=!1,P;return function(){return j||(j=!0,P=B.apply(A,arguments)),P}}},"Cg/j":function(Le,se,U){"use strict";U.d(se,"b",function(){return ne}),U.d(se,"a",function(){return B}),U.d(se,"c",function(){return j}),U.d(se,"d",function(){return P});var ne;(function(S){S.serviceIds=new Map,S.DI_TARGET="$di$target",S.DI_DEPENDENCIES="$di$dependencies";function W(N){return N[S.DI_DEPENDENCIES]||[]}S.getServiceDependencies=W})(ne||(ne={}));const B=j("instantiationService");function A(S,W,N,e){W[ne.DI_TARGET]===W?W[ne.DI_DEPENDENCIES].push({id:S,index:N,optional:e}):(W[ne.DI_DEPENDENCIES]=[{id:S,index:N,optional:e}],W[ne.DI_TARGET]=W)}function j(S){if(ne.serviceIds.has(S))return ne.serviceIds.get(S);const W=function(N,e,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");A(W,N,w,!1)};return W.toString=()=>S,ne.serviceIds.set(S,W),W}function P(S){return function(W,N,e){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");A(S,W,e,!0)}}},DlQD:function(Le,se,U){(function(ne,B){Le.exports=B()})(this,function(){"use strict";function ne(G,X){for(var Q=0;Q<X.length;Q++){var Y=X[Q];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(G,Y.key,Y)}}function B(G,X,Q){return X&&ne(G.prototype,X),Q&&ne(G,Q),G}function A(G,X){if(!G)return;if(typeof G=="string")return j(G,X);var Q=Object.prototype.toString.call(G).slice(8,-1);if(Q==="Object"&&G.constructor&&(Q=G.constructor.name),Q==="Map"||Q==="Set")return Array.from(G);if(Q==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Q))return j(G,X)}function j(G,X){(X==null||X>G.length)&&(X=G.length);for(var Q=0,Y=new Array(X);Q<X;Q++)Y[Q]=G[Q];return Y}function P(G,X){var Q;if(typeof Symbol=="undefined"||G[Symbol.iterator]==null){if(Array.isArray(G)||(Q=A(G))||X&&G&&typeof G.length=="number"){Q&&(G=Q);var Y=0;return function(){return Y>=G.length?{done:!0}:{done:!1,value:G[Y++]}}}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 Q=G[Symbol.iterator](),Q.next.bind(Q)}function S(G,X){return X={exports:{}},G(X,X.exports),X.exports}var W=S(function(G){function X(){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 Q(Y){G.exports.defaults=Y}G.exports={defaults:X(),getDefaults:X,changeDefaults:Q}}),N=W.defaults,e=W.getDefaults,w=W.changeDefaults,v=/[&<>"']/,g=/[&<>"']/g,c=/[<>"']|&(?!#?\w+;)/,s=/[<>"']|&(?!#?\w+;)/g,i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},l=function(X){return i[X]};function a(G,X){if(X){if(v.test(G))return G.replace(g,l)}else if(c.test(G))return G.replace(s,l);return G}var n=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function r(G){return G.replace(n,function(X,Q){return Q=Q.toLowerCase(),Q==="colon"?":":Q.charAt(0)==="#"?Q.charAt(1)==="x"?String.fromCharCode(parseInt(Q.substring(2),16)):String.fromCharCode(+Q.substring(1)):""})}var t=/(^|[^\[])\^/g;function E(G,X){G=G.source||G,X=X||"";var Q={replace:function($,te){return te=te.source||te,te=te.replace(t,"$1"),G=G.replace($,te),Q},getRegex:function(){return new RegExp(G,X)}};return Q}var y=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function T(G,X,Q){if(G){var Y;try{Y=decodeURIComponent(r(Q)).replace(y,"").toLowerCase()}catch($){return null}if(Y.indexOf("javascript:")===0||Y.indexOf("vbscript:")===0||Y.indexOf("data:")===0)return null}X&&!m.test(Q)&&(Q=u(X,Q));try{Q=encodeURI(Q).replace(/%25/g,"%")}catch($){return null}return Q}var _={},f=/^[^:]+:\/*[^/]*$/,h=/^([^:]+:)[\s\S]*$/,o=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(G,X){_[" "+G]||(f.test(G)?_[" "+G]=G+"/":_[" "+G]=O(G,"/",!0)),G=_[" "+G];var Q=G.indexOf(":")===-1;return X.substring(0,2)==="//"?Q?X:G.replace(h,"$1")+X:X.charAt(0)==="/"?Q?X:G.replace(o,"$1")+X:G+X}var b={exec:function(){}};function p(G){for(var X=1,Q,Y;X<arguments.length;X++){Q=arguments[X];for(Y in Q)Object.prototype.hasOwnProperty.call(Q,Y)&&(G[Y]=Q[Y])}return G}function d(G,X){var Q=G.replace(/\|/g,function(te,re,le){for(var he=!1,Te=re;--Te>=0&&le[Te]==="\\";)he=!he;return he?"|":" |"}),Y=Q.split(/ \|/),$=0;if(Y.length>X)Y.splice(X);else for(;Y.length<X;)Y.push("");for(;$<Y.length;$++)Y[$]=Y[$].trim().replace(/\\\|/g,"|");return Y}function O(G,X,Q){var Y=G.length;if(Y===0)return"";for(var $=0;$<Y;){var te=G.charAt(Y-$-1);if(te===X&&!Q)$++;else if(te!==X&&Q)$++;else break}return G.substr(0,Y-$)}function L(G,X){if(G.indexOf(X[1])===-1)return-1;for(var Q=G.length,Y=0,$=0;$<Q;$++)if(G[$]==="\\")$++;else if(G[$]===X[0])Y++;else if(G[$]===X[1]&&(Y--,Y<0))return $;return-1}function x(G){G&&G.sanitize&&!G.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var I={escape:a,unescape:r,edit:E,cleanUrl:T,resolveUrl:u,noopTest:b,merge:p,splitCells:d,rtrim:O,findClosingBracket:L,checkSanitizeDeprecation:x},k=W.defaults,C=I.rtrim,F=I.splitCells,V=I.escape,ee=I.findClosingBracket;function ie(G,X,Q){var Y=X.href,$=X.title?V(X.title):null,te=G[1].replace(/\\([\[\]])/g,"$1");return G[0].charAt(0)!=="!"?{type:"link",raw:Q,href:Y,title:$,text:te}:{type:"image",raw:Q,href:Y,title:$,text:V(te)}}function pe(G,X){var Q=G.match(/^(\s+)(?:```)/);if(Q===null)return X;var Y=Q[1];return X.split(`
`).map(function($){var te=$.match(/^\s+/);if(te===null)return $;var re=te[0];return re.length>=Y.length?$.slice(Y.length):$}).join(`
`)}var ve=function(){function G(Q){this.options=Q||k}var X=G.prototype;return X.space=function(Y){var $=this.rules.block.newline.exec(Y);if($)return $[0].length>1?{type:"space",raw:$[0]}:{raw:`
`}},X.code=function(Y,$){var te=this.rules.block.code.exec(Y);if(te){var re=$[$.length-1];if(re&&re.type==="paragraph")return{raw:te[0],text:te[0].trimRight()};var le=te[0].replace(/^ {4}/gm,"");return{type:"code",raw:te[0],codeBlockStyle:"indented",text:this.options.pedantic?le:C(le,`
`)}}},X.fences=function(Y){var $=this.rules.block.fences.exec(Y);if($){var te=$[0],re=pe(te,$[3]||"");return{type:"code",raw:te,lang:$[2]?$[2].trim():$[2],text:re}}},X.heading=function(Y){var $=this.rules.block.heading.exec(Y);if($)return{type:"heading",raw:$[0],depth:$[1].length,text:$[2]}},X.nptable=function(Y){var $=this.rules.block.nptable.exec(Y);if($){var te={type:"table",header:F($[1].replace(/^ *| *\| *$/g,"")),align:$[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:$[3]?$[3].replace(/\n$/,"").split(`
`):[],raw:$[0]};if(te.header.length===te.align.length){var re=te.align.length,le;for(le=0;le<re;le++)/^ *-+: *$/.test(te.align[le])?te.align[le]="right":/^ *:-+: *$/.test(te.align[le])?te.align[le]="center":/^ *:-+ *$/.test(te.align[le])?te.align[le]="left":te.align[le]=null;for(re=te.cells.length,le=0;le<re;le++)te.cells[le]=F(te.cells[le],te.header.length);return te}}},X.hr=function(Y){var $=this.rules.block.hr.exec(Y);if($)return{type:"hr",raw:$[0]}},X.blockquote=function(Y){var $=this.rules.block.blockquote.exec(Y);if($){var te=$[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:$[0],text:te}}},X.list=function(Y){var $=this.rules.block.list.exec(Y);if($){for(var te=$[0],re=$[2],le=re.length>1,he=re[re.length-1]===")",Te={type:"list",raw:te,ordered:le,start:le?+re.slice(0,-1):"",loose:!1,items:[]},Re=$[0].match(this.rules.block.item),Pe=!1,Ae,Ge,Ne,ke,$e,ze,He,Ze=Re.length,We=0;We<Ze;We++)Ae=Re[We],te=Ae,Ge=Ae.length,Ae=Ae.replace(/^ *([*+-]|\d+[.)]) */,""),~Ae.indexOf(`
`)&&(Ge-=Ae.length,Ae=this.options.pedantic?Ae.replace(/^ {1,4}/gm,""):Ae.replace(new RegExp("^ {1,"+Ge+"}","gm"),"")),We!==Ze-1&&(Ne=this.rules.block.bullet.exec(Re[We+1])[0],(le?Ne.length===1||!he&&Ne[Ne.length-1]===")":Ne.length>1||this.options.smartLists&&Ne!==re)&&(ke=Re.slice(We+1).join(`
`),Te.raw=Te.raw.substring(0,Te.raw.length-ke.length),We=Ze-1)),$e=Pe||/\n\n(?!\s*$)/.test(Ae),We!==Ze-1&&(Pe=Ae.charAt(Ae.length-1)===`
`,$e||($e=Pe)),$e&&(Te.loose=!0),ze=/^\[[ xX]\] /.test(Ae),He=void 0,ze&&(He=Ae[1]!==" ",Ae=Ae.replace(/^\[[ xX]\] +/,"")),Te.items.push({type:"list_item",raw:te,task:ze,checked:He,loose:$e,text:Ae});return Te}},X.html=function(Y){var $=this.rules.block.html.exec(Y);if($)return{type:this.options.sanitize?"paragraph":"html",raw:$[0],pre:!this.options.sanitizer&&($[1]==="pre"||$[1]==="script"||$[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer($[0]):V($[0]):$[0]}},X.def=function(Y){var $=this.rules.block.def.exec(Y);if($){$[3]&&($[3]=$[3].substring(1,$[3].length-1));var te=$[1].toLowerCase().replace(/\s+/g," ");return{tag:te,raw:$[0],href:$[2],title:$[3]}}},X.table=function(Y){var $=this.rules.block.table.exec(Y);if($){var te={type:"table",header:F($[1].replace(/^ *| *\| *$/g,"")),align:$[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:$[3]?$[3].replace(/\n$/,"").split(`
`):[]};if(te.header.length===te.align.length){te.raw=$[0];var re=te.align.length,le;for(le=0;le<re;le++)/^ *-+: *$/.test(te.align[le])?te.align[le]="right":/^ *:-+: *$/.test(te.align[le])?te.align[le]="center":/^ *:-+ *$/.test(te.align[le])?te.align[le]="left":te.align[le]=null;for(re=te.cells.length,le=0;le<re;le++)te.cells[le]=F(te.cells[le].replace(/^ *\| *| *\| *$/g,""),te.header.length);return te}}},X.lheading=function(Y){var $=this.rules.block.lheading.exec(Y);if($)return{type:"heading",raw:$[0],depth:$[2].charAt(0)==="="?1:2,text:$[1]}},X.paragraph=function(Y){var $=this.rules.block.paragraph.exec(Y);if($)return{type:"paragraph",raw:$[0],text:$[1].charAt($[1].length-1)===`
`?$[1].slice(0,-1):$[1]}},X.text=function(Y,$){var te=this.rules.block.text.exec(Y);if(te){var re=$[$.length-1];return re&&re.type==="text"?{raw:te[0],text:te[0]}:{type:"text",raw:te[0],text:te[0]}}},X.escape=function(Y){var $=this.rules.inline.escape.exec(Y);if($)return{type:"escape",raw:$[0],text:V($[1])}},X.tag=function(Y,$,te){var re=this.rules.inline.tag.exec(Y);if(re)return!$&&/^<a /i.test(re[0])?$=!0:$&&/^<\/a>/i.test(re[0])&&($=!1),!te&&/^<(pre|code|kbd|script)(\s|>)/i.test(re[0])?te=!0:te&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(re[0])&&(te=!1),{type:this.options.sanitize?"text":"html",raw:re[0],inLink:$,inRawBlock:te,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(re[0]):V(re[0]):re[0]}},X.link=function(Y){var $=this.rules.inline.link.exec(Y);if($){var te=ee($[2],"()");if(te>-1){var re=$[0].indexOf("!")===0?5:4,le=re+$[1].length+te;$[2]=$[2].substring(0,te),$[0]=$[0].substring(0,le).trim(),$[3]=""}var he=$[2],Te="";if(this.options.pedantic){var Re=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(he);Re?(he=Re[1],Te=Re[3]):Te=""}else Te=$[3]?$[3].slice(1,-1):"";he=he.trim().replace(/^<([\s\S]*)>$/,"$1");var Pe=ie($,{href:he&&he.replace(this.rules.inline._escapes,"$1"),title:Te&&Te.replace(this.rules.inline._escapes,"$1")},$[0]);return Pe}},X.reflink=function(Y,$){var te;if((te=this.rules.inline.reflink.exec(Y))||(te=this.rules.inline.nolink.exec(Y))){var re=(te[2]||te[1]).replace(/\s+/g," ");if(re=$[re.toLowerCase()],!re||!re.href){var le=te[0].charAt(0);return{type:"text",raw:le,text:le}}var he=ie(te,re,te[0]);return he}},X.strong=function(Y,$,te){te===void 0&&(te="");var re=this.rules.inline.strong.start.exec(Y);if(re&&(!re[1]||re[1]&&(te===""||this.rules.inline.punctuation.exec(te)))){$=$.slice(-1*Y.length);var le=re[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;le.lastIndex=0;for(var he;(re=le.exec($))!=null;)if(he=this.rules.inline.strong.middle.exec($.slice(0,re.index+3)),he)return{type:"strong",raw:Y.slice(0,he[0].length),text:Y.slice(2,he[0].length-2)}}},X.em=function(Y,$,te){te===void 0&&(te="");var re=this.rules.inline.em.start.exec(Y);if(re&&(!re[1]||re[1]&&(te===""||this.rules.inline.punctuation.exec(te)))){$=$.slice(-1*Y.length);var le=re[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;le.lastIndex=0;for(var he;(re=le.exec($))!=null;)if(he=this.rules.inline.em.middle.exec($.slice(0,re.index+2)),he)return{type:"em",raw:Y.slice(0,he[0].length),text:Y.slice(1,he[0].length-1)}}},X.codespan=function(Y){var $=this.rules.inline.code.exec(Y);if($){var te=$[2].replace(/\n/g," "),re=/[^ ]/.test(te),le=te.startsWith(" ")&&te.endsWith(" ");return re&&le&&(te=te.substring(1,te.length-1)),te=V(te,!0),{type:"codespan",raw:$[0],text:te}}},X.br=function(Y){var $=this.rules.inline.br.exec(Y);if($)return{type:"br",raw:$[0]}},X.del=function(Y){var $=this.rules.inline.del.exec(Y);if($)return{type:"del",raw:$[0],text:$[1]}},X.autolink=function(Y,$){var te=this.rules.inline.autolink.exec(Y);if(te){var re,le;return te[2]==="@"?(re=V(this.options.mangle?$(te[1]):te[1]),le="mailto:"+re):(re=V(te[1]),le=re),{type:"link",raw:te[0],text:re,href:le,tokens:[{type:"text",raw:re,text:re}]}}},X.url=function(Y,$){var te;if(te=this.rules.inline.url.exec(Y)){var re,le;if(te[2]==="@")re=V(this.options.mangle?$(te[0]):te[0]),le="mailto:"+re;else{var he;do he=te[0],te[0]=this.rules.inline._backpedal.exec(te[0])[0];while(he!==te[0]);re=V(te[0]),te[1]==="www."?le="http://"+re:le=re}return{type:"link",raw:te[0],text:re,href:le,tokens:[{type:"text",raw:re,text:re}]}}},X.inlineText=function(Y,$,te){var re=this.rules.inline.text.exec(Y);if(re){var le;return $?le=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(re[0]):V(re[0]):re[0]:le=V(this.options.smartypants?te(re[0]):re[0]),{type:"text",raw:re[0],text:le}}},G}(),ye=I.noopTest,Ee=I.edit,Se=I.merge,fe={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:ye,table:ye,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};fe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,fe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,fe.def=Ee(fe.def).replace("label",fe._label).replace("title",fe._title).getRegex(),fe.bullet=/(?:[*+-]|\d{1,9}[.)])/,fe.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,fe.item=Ee(fe.item,"gm").replace(/bull/g,fe.bullet).getRegex(),fe.list=Ee(fe.list).replace(/bull/g,fe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+fe.def.source+")").getRegex(),fe._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",fe._comment=/<!--(?!-?>)[\s\S]*?-->/,fe.html=Ee(fe.html,"i").replace("comment",fe._comment).replace("tag",fe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),fe.paragraph=Ee(fe._paragraph).replace("hr",fe.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",fe._tag).getRegex(),fe.blockquote=Ee(fe.blockquote).replace("paragraph",fe.paragraph).getRegex(),fe.normal=Se({},fe),fe.gfm=Se({},fe.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*|$)"}),fe.gfm.nptable=Ee(fe.gfm.nptable).replace("hr",fe.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",fe._tag).getRegex(),fe.gfm.table=Ee(fe.gfm.table).replace("hr",fe.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",fe._tag).getRegex(),fe.pedantic=Se({},fe.normal,{html:Ee(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",fe._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:ye,paragraph:Ee(fe.normal._paragraph).replace("hr",fe.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",fe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var K={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ye,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:ye,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};K._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",K.punctuation=Ee(K.punctuation).replace(/punctuation/g,K._punctuation).getRegex(),K._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",K._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",K.em.start=Ee(K.em.start).replace(/punctuation/g,K._punctuation).getRegex(),K.em.middle=Ee(K.em.middle).replace(/punctuation/g,K._punctuation).replace(/overlapSkip/g,K._overlapSkip).getRegex(),K.em.endAst=Ee(K.em.endAst,"g").replace(/punctuation/g,K._punctuation).getRegex(),K.em.endUnd=Ee(K.em.endUnd,"g").replace(/punctuation/g,K._punctuation).getRegex(),K.strong.start=Ee(K.strong.start).replace(/punctuation/g,K._punctuation).getRegex(),K.strong.middle=Ee(K.strong.middle).replace(/punctuation/g,K._punctuation).replace(/blockSkip/g,K._blockSkip).getRegex(),K.strong.endAst=Ee(K.strong.endAst,"g").replace(/punctuation/g,K._punctuation).getRegex(),K.strong.endUnd=Ee(K.strong.endUnd,"g").replace(/punctuation/g,K._punctuation).getRegex(),K.blockSkip=Ee(K._blockSkip,"g").getRegex(),K.overlapSkip=Ee(K._overlapSkip,"g").getRegex(),K._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,K._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,K._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])?)+(?![-_])/,K.autolink=Ee(K.autolink).replace("scheme",K._scheme).replace("email",K._email).getRegex(),K._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,K.tag=Ee(K.tag).replace("comment",fe._comment).replace("attribute",K._attribute).getRegex(),K._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,K._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,K._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,K.link=Ee(K.link).replace("label",K._label).replace("href",K._href).replace("title",K._title).getRegex(),K.reflink=Ee(K.reflink).replace("label",K._label).getRegex(),K.reflinkSearch=Ee(K.reflinkSearch,"g").replace("reflink",K.reflink).replace("nolink",K.nolink).getRegex(),K.normal=Se({},K),K.pedantic=Se({},K.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:Ee(/^!?\[(label)\]\((.*?)\)/).replace("label",K._label).getRegex(),reflink:Ee(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",K._label).getRegex()}),K.gfm=Se({},K.normal,{escape:Ee(K.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),K.gfm.url=Ee(K.gfm.url,"i").replace("email",K.gfm._extended_email).getRegex(),K.breaks=Se({},K.gfm,{br:Ee(K.br).replace("{2,}","*").getRegex(),text:Ee(K.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var R={block:fe,inline:K},D=W.defaults,H=R.block,J=R.inline;function M(G){return G.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 ae(G){var X="",Q,Y,$=G.length;for(Q=0;Q<$;Q++)Y=G.charCodeAt(Q),Math.random()>.5&&(Y="x"+Y.toString(16)),X+="&#"+Y+";";return X}var me=function(){function G(Q){this.tokens=[],this.tokens.links=Object.create(null),this.options=Q||D,this.options.tokenizer=this.options.tokenizer||new ve,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var Y={block:H.normal,inline:J.normal};this.options.pedantic?(Y.block=H.pedantic,Y.inline=J.pedantic):this.options.gfm&&(Y.block=H.gfm,this.options.breaks?Y.inline=J.breaks:Y.inline=J.gfm),this.tokenizer.rules=Y}G.lex=function(Y,$){var te=new G($);return te.lex(Y)};var X=G.prototype;return X.lex=function(Y){return Y=Y.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(Y,this.tokens,!0),this.inline(this.tokens),this.tokens},X.blockTokens=function(Y,$,te){$===void 0&&($=[]),te===void 0&&(te=!0),Y=Y.replace(/^ +$/gm,"");for(var re,le,he,Te;Y;){if(re=this.tokenizer.space(Y)){Y=Y.substring(re.raw.length),re.type&&$.push(re);continue}if(re=this.tokenizer.code(Y,$)){Y=Y.substring(re.raw.length),re.type?$.push(re):(Te=$[$.length-1],Te.raw+=`
`+re.raw,Te.text+=`
`+re.text);continue}if(re=this.tokenizer.fences(Y)){Y=Y.substring(re.raw.length),$.push(re);continue}if(re=this.tokenizer.heading(Y)){Y=Y.substring(re.raw.length),$.push(re);continue}if(re=this.tokenizer.nptable(Y)){Y=Y.substring(re.raw.length),$.push(re);continue}if(re=this.tokenizer.hr(Y)){Y=Y.substring(re.raw.length),$.push(re);continue}if(re=this.tokenizer.blockquote(Y)){Y=Y.substring(re.raw.length),re.tokens=this.blockTokens(re.text,[],te),$.push(re);continue}if(re=this.tokenizer.list(Y)){for(Y=Y.substring(re.raw.length),he=re.items.length,le=0;le<he;le++)re.items[le].tokens=this.blockTokens(re.items[le].text,[],!1);$.push(re);continue}if(re=this.tokenizer.html(Y)){Y=Y.substring(re.raw.length),$.push(re);continue}if(te&&(re=this.tokenizer.def(Y))){Y=Y.substring(re.raw.length),this.tokens.links[re.tag]||(this.tokens.links[re.tag]={href:re.href,title:re.title});continue}if(re=this.tokenizer.table(Y)){Y=Y.substring(re.raw.length),$.push(re);continue}if(re=this.tokenizer.lheading(Y)){Y=Y.substring(re.raw.length),$.push(re);continue}if(te&&(re=this.tokenizer.paragraph(Y))){Y=Y.substring(re.raw.length),$.push(re);continue}if(re=this.tokenizer.text(Y,$)){Y=Y.substring(re.raw.length),re.type?$.push(re):(Te=$[$.length-1],Te.raw+=`
`+re.raw,Te.text+=`
`+re.text);continue}if(Y){var Re="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(Re);break}else throw new Error(Re)}}return $},X.inline=function(Y){var $,te,re,le,he,Te,Re=Y.length;for($=0;$<Re;$++){Te=Y[$];switch(Te.type){case"paragraph":case"text":case"heading":{Te.tokens=[],this.inlineTokens(Te.text,Te.tokens);break}case"table":{for(Te.tokens={header:[],cells:[]},le=Te.header.length,te=0;te<le;te++)Te.tokens.header[te]=[],this.inlineTokens(Te.header[te],Te.tokens.header[te]);for(le=Te.cells.length,te=0;te<le;te++)for(he=Te.cells[te],Te.tokens.cells[te]=[],re=0;re<he.length;re++)Te.tokens.cells[te][re]=[],this.inlineTokens(he[re],Te.tokens.cells[te][re]);break}case"blockquote":{this.inline(Te.tokens);break}case"list":{for(le=Te.items.length,te=0;te<le;te++)this.inline(Te.items[te].tokens);break}}}return Y},X.inlineTokens=function(Y,$,te,re,le){$===void 0&&($=[]),te===void 0&&(te=!1),re===void 0&&(re=!1),le===void 0&&(le="");var he,Te=Y,Re;if(this.tokens.links){var Pe=Object.keys(this.tokens.links);if(Pe.length>0)for(;(Re=this.tokenizer.rules.inline.reflinkSearch.exec(Te))!=null;)Pe.includes(Re[0].slice(Re[0].lastIndexOf("[")+1,-1))&&(Te=Te.slice(0,Re.index)+"["+"a".repeat(Re[0].length-2)+"]"+Te.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Re=this.tokenizer.rules.inline.blockSkip.exec(Te))!=null;)Te=Te.slice(0,Re.index)+"["+"a".repeat(Re[0].length-2)+"]"+Te.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;Y;){if(he=this.tokenizer.escape(Y)){Y=Y.substring(he.raw.length),$.push(he);continue}if(he=this.tokenizer.tag(Y,te,re)){Y=Y.substring(he.raw.length),te=he.inLink,re=he.inRawBlock,$.push(he);continue}if(he=this.tokenizer.link(Y)){Y=Y.substring(he.raw.length),he.type==="link"&&(he.tokens=this.inlineTokens(he.text,[],!0,re)),$.push(he);continue}if(he=this.tokenizer.reflink(Y,this.tokens.links)){Y=Y.substring(he.raw.length),he.type==="link"&&(he.tokens=this.inlineTokens(he.text,[],!0,re)),$.push(he);continue}if(he=this.tokenizer.strong(Y,Te,le)){Y=Y.substring(he.raw.length),he.tokens=this.inlineTokens(he.text,[],te,re),$.push(he);continue}if(he=this.tokenizer.em(Y,Te,le)){Y=Y.substring(he.raw.length),he.tokens=this.inlineTokens(he.text,[],te,re),$.push(he);continue}if(he=this.tokenizer.codespan(Y)){Y=Y.substring(he.raw.length),$.push(he);continue}if(he=this.tokenizer.br(Y)){Y=Y.substring(he.raw.length),$.push(he);continue}if(he=this.tokenizer.del(Y)){Y=Y.substring(he.raw.length),he.tokens=this.inlineTokens(he.text,[],te,re),$.push(he);continue}if(he=this.tokenizer.autolink(Y,ae)){Y=Y.substring(he.raw.length),$.push(he);continue}if(!te&&(he=this.tokenizer.url(Y,ae))){Y=Y.substring(he.raw.length),$.push(he);continue}if(he=this.tokenizer.inlineText(Y,re,M)){Y=Y.substring(he.raw.length),le=he.raw.slice(-1),$.push(he);continue}if(Y){var Ae="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(Ae);break}else throw new Error(Ae)}}return $},B(G,null,[{key:"rules",get:function(){return{block:H,inline:J}}}]),G}(),_e=W.defaults,q=I.cleanUrl,oe=I.escape,ue=function(){function G(Q){this.options=Q||_e}var X=G.prototype;return X.code=function(Y,$,te){var re=($||"").match(/\S*/)[0];if(this.options.highlight){var le=this.options.highlight(Y,re);le!=null&&le!==Y&&(te=!0,Y=le)}return re?'<pre><code class="'+this.options.langPrefix+oe(re,!0)+'">'+(te?Y:oe(Y,!0))+`</code></pre>
`:"<pre><code>"+(te?Y:oe(Y,!0))+`</code></pre>
`},X.blockquote=function(Y){return`<blockquote>
`+Y+`</blockquote>
`},X.html=function(Y){return Y},X.heading=function(Y,$,te,re){return this.options.headerIds?"<h"+$+' id="'+this.options.headerPrefix+re.slug(te)+'">'+Y+"</h"+$+`>
`:"<h"+$+">"+Y+"</h"+$+`>
`},X.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},X.list=function(Y,$,te){var re=$?"ol":"ul",le=$&&te!==1?' start="'+te+'"':"";return"<"+re+le+`>
`+Y+"</"+re+`>
`},X.listitem=function(Y){return"<li>"+Y+`</li>
`},X.checkbox=function(Y){return"<input "+(Y?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},X.paragraph=function(Y){return"<p>"+Y+`</p>
`},X.table=function(Y,$){return $&&($="<tbody>"+$+"</tbody>"),`<table>
<thead>
`+Y+`</thead>
`+$+`</table>
`},X.tablerow=function(Y){return`<tr>
`+Y+`</tr>
`},X.tablecell=function(Y,$){var te=$.header?"th":"td",re=$.align?"<"+te+' align="'+$.align+'">':"<"+te+">";return re+Y+"</"+te+`>
`},X.strong=function(Y){return"<strong>"+Y+"</strong>"},X.em=function(Y){return"<em>"+Y+"</em>"},X.codespan=function(Y){return"<code>"+Y+"</code>"},X.br=function(){return this.options.xhtml?"<br/>":"<br>"},X.del=function(Y){return"<del>"+Y+"</del>"},X.link=function(Y,$,te){if(Y=q(this.options.sanitize,this.options.baseUrl,Y),Y===null)return te;var re='<a href="'+oe(Y)+'"';return $&&(re+=' title="'+$+'"'),re+=">"+te+"</a>",re},X.image=function(Y,$,te){if(Y=q(this.options.sanitize,this.options.baseUrl,Y),Y===null)return te;var re='<img src="'+Y+'" alt="'+te+'"';return $&&(re+=' title="'+$+'"'),re+=this.options.xhtml?"/>":">",re},X.text=function(Y){return Y},G}(),ce=function(){function G(){}var X=G.prototype;return X.strong=function(Y){return Y},X.em=function(Y){return Y},X.codespan=function(Y){return Y},X.del=function(Y){return Y},X.html=function(Y){return Y},X.text=function(Y){return Y},X.link=function(Y,$,te){return""+te},X.image=function(Y,$,te){return""+te},X.br=function(){return""},G}(),be=function(){function G(){this.seen={}}var X=G.prototype;return X.slug=function(Y){var $=Y.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty($)){var te=$;do this.seen[te]++,$=te+"-"+this.seen[te];while(this.seen.hasOwnProperty($))}return this.seen[$]=0,$},G}(),Ce=W.defaults,Oe=I.unescape,Ie=function(){function G(Q){this.options=Q||Ce,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 be}G.parse=function(Y,$){var te=new G($);return te.parse(Y)};var X=G.prototype;return X.parse=function(Y,$){$===void 0&&($=!0);var te="",re,le,he,Te,Re,Pe,Ae,Ge,Ne,ke,$e,ze,He,Ze,We,Je,qe,je,tt=Y.length;for(re=0;re<tt;re++){ke=Y[re];switch(ke.type){case"space":continue;case"hr":{te+=this.renderer.hr();continue}case"heading":{te+=this.renderer.heading(this.parseInline(ke.tokens),ke.depth,Oe(this.parseInline(ke.tokens,this.textRenderer)),this.slugger);continue}case"code":{te+=this.renderer.code(ke.text,ke.lang,ke.escaped);continue}case"table":{for(Ge="",Ae="",Te=ke.header.length,le=0;le<Te;le++)Ae+=this.renderer.tablecell(this.parseInline(ke.tokens.header[le]),{header:!0,align:ke.align[le]});for(Ge+=this.renderer.tablerow(Ae),Ne="",Te=ke.cells.length,le=0;le<Te;le++){for(Pe=ke.tokens.cells[le],Ae="",Re=Pe.length,he=0;he<Re;he++)Ae+=this.renderer.tablecell(this.parseInline(Pe[he]),{header:!1,align:ke.align[he]});Ne+=this.renderer.tablerow(Ae)}te+=this.renderer.table(Ge,Ne);continue}case"blockquote":{Ne=this.parse(ke.tokens),te+=this.renderer.blockquote(Ne);continue}case"list":{for($e=ke.ordered,ze=ke.start,He=ke.loose,Te=ke.items.length,Ne="",le=0;le<Te;le++)We=ke.items[le],Je=We.checked,qe=We.task,Ze="",We.task&&(je=this.renderer.checkbox(Je),He?We.tokens.length>0&&We.tokens[0].type==="text"?(We.tokens[0].text=je+" "+We.tokens[0].text,We.tokens[0].tokens&&We.tokens[0].tokens.length>0&&We.tokens[0].tokens[0].type==="text"&&(We.tokens[0].tokens[0].text=je+" "+We.tokens[0].tokens[0].text)):We.tokens.unshift({type:"text",text:je}):Ze+=je),Ze+=this.parse(We.tokens,He),Ne+=this.renderer.listitem(Ze,qe,Je);te+=this.renderer.list(Ne,$e,ze);continue}case"html":{te+=this.renderer.html(ke.text);continue}case"paragraph":{te+=this.renderer.paragraph(this.parseInline(ke.tokens));continue}case"text":{for(Ne=ke.tokens?this.parseInline(ke.tokens):ke.text;re+1<tt&&Y[re+1].type==="text";)ke=Y[++re],Ne+=`
`+(ke.tokens?this.parseInline(ke.tokens):ke.text);te+=$?this.renderer.paragraph(Ne):Ne;continue}default:{var Ue='Token with "'+ke.type+'" type was not found.';if(this.options.silent){console.error(Ue);return}else throw new Error(Ue)}}}return te},X.parseInline=function(Y,$){$=$||this.renderer;var te="",re,le,he=Y.length;for(re=0;re<he;re++){le=Y[re];switch(le.type){case"escape":{te+=$.text(le.text);break}case"html":{te+=$.html(le.text);break}case"link":{te+=$.link(le.href,le.title,this.parseInline(le.tokens,$));break}case"image":{te+=$.image(le.href,le.title,le.text);break}case"strong":{te+=$.strong(this.parseInline(le.tokens,$));break}case"em":{te+=$.em(this.parseInline(le.tokens,$));break}case"codespan":{te+=$.codespan(le.text);break}case"br":{te+=$.br();break}case"del":{te+=$.del(this.parseInline(le.tokens,$));break}case"text":{te+=$.text(le.text);break}default:{var Te='Token with "'+le.type+'" type was not found.';if(this.options.silent){console.error(Te);return}else throw new Error(Te)}}}return te},G}(),De=I.merge,Me=I.checkSanitizeDeprecation,de=I.escape,ge=W.getDefaults,xe=W.changeDefaults,we=W.defaults;function Z(G,X,Q){if(typeof G=="undefined"||G===null)throw new Error("marked(): input parameter is undefined or null");if(typeof G!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(G)+", string expected");if(typeof X=="function"&&(Q=X,X=null),X=De({},Z.defaults,X||{}),Me(X),Q){var Y=X.highlight,$;try{$=me.lex(G,X)}catch(he){return Q(he)}var te=function(Te){var Re;if(!Te)try{Re=Ie.parse($,X)}catch(Pe){Te=Pe}return X.highlight=Y,Te?Q(Te):Q(null,Re)};if(!Y||Y.length<3)return te();if(delete X.highlight,!$.length)return te();var re=0;Z.walkTokens($,function(he){he.type==="code"&&(re++,setTimeout(function(){Y(he.text,he.lang,function(Te,Re){if(Te)return te(Te);Re!=null&&Re!==he.text&&(he.text=Re,he.escaped=!0),re--,re===0&&te()})},0))}),re===0&&te();return}try{var le=me.lex(G,X);return X.walkTokens&&Z.walkTokens(le,X.walkTokens),Ie.parse(le,X)}catch(he){if(he.message+=`
Please report this to https://github.com/markedjs/marked.`,X.silent)return"<p>An error occurred:</p><pre>"+de(he.message+"",!0)+"</pre>";throw he}}Z.options=Z.setOptions=function(G){return De(Z.defaults,G),xe(Z.defaults),Z},Z.getDefaults=ge,Z.defaults=we,Z.use=function(G){var X=De({},G);if(G.renderer&&function(){var Y=Z.defaults.renderer||new ue,$=function(le){var he=Y[le];Y[le]=function(){for(var Te=arguments.length,Re=new Array(Te),Pe=0;Pe<Te;Pe++)Re[Pe]=arguments[Pe];var Ae=G.renderer[le].apply(Y,Re);return Ae===!1&&(Ae=he.apply(Y,Re)),Ae}};for(var te in G.renderer)$(te);X.renderer=Y}(),G.tokenizer&&function(){var Y=Z.defaults.tokenizer||new ve,$=function(le){var he=Y[le];Y[le]=function(){for(var Te=arguments.length,Re=new Array(Te),Pe=0;Pe<Te;Pe++)Re[Pe]=arguments[Pe];var Ae=G.tokenizer[le].apply(Y,Re);return Ae===!1&&(Ae=he.apply(Y,Re)),Ae}};for(var te in G.tokenizer)$(te);X.tokenizer=Y}(),G.walkTokens){var Q=Z.defaults.walkTokens;X.walkTokens=function(Y){G.walkTokens(Y),Q&&Q(Y)}}Z.setOptions(X)},Z.walkTokens=function(G,X){for(var Q=P(G),Y;!(Y=Q()).done;){var $=Y.value;X($);switch($.type){case"table":{for(var te=P($.tokens.header),re;!(re=te()).done;){var le=re.value;Z.walkTokens(le,X)}for(var he=P($.tokens.cells),Te;!(Te=he()).done;)for(var Re=Te.value,Pe=P(Re),Ae;!(Ae=Pe()).done;){var Ge=Ae.value;Z.walkTokens(Ge,X)}break}case"list":{Z.walkTokens($.items,X);break}default:$.tokens&&Z.walkTokens($.tokens,X)}}},Z.Parser=Ie,Z.parser=Ie.parse,Z.Renderer=ue,Z.TextRenderer=ce,Z.Lexer=me,Z.lexer=me.lex,Z.Tokenizer=ve,Z.Slugger=be,Z.parse=Z;var z=Z;return z})},F0VM:function(Le,se,U){Le.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(Le,se,U){"use strict";U.d(se,"a",function(){return ne});function ne(B,A){if(!B)throw new Error(A?`Assertion failed (${A})`:"Assertion Failed")}},IBYe:function(Le,se,U){"use strict";function ne(B){return null}se.a=ne},J66h:function(Le,se,U){(function(ne){var B,A;(function(j,P){Le.exports=P(j)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof ne!="undefined"?ne:this,function(j){"use strict";j=j||{};var P=j.Base64,S="2.6.4",W="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N=function(d){for(var O={},L=0,x=d.length;L<x;L++)O[d.charAt(L)]=L;return O}(W),e=String.fromCharCode,w=function(d){if(d.length<2){var O=d.charCodeAt(0);return O<128?d:O<2048?e(192|O>>>6)+e(128|O&63):e(224|O>>>12&15)+e(128|O>>>6&63)+e(128|O&63)}else{var O=65536+(d.charCodeAt(0)-55296)*1024+(d.charCodeAt(1)-56320);return e(240|O>>>18&7)+e(128|O>>>12&63)+e(128|O>>>6&63)+e(128|O&63)}},v=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,g=function(d){return d.replace(v,w)},c=function(d){var O=[0,2,1][d.length%3],L=d.charCodeAt(0)<<16|(d.length>1?d.charCodeAt(1):0)<<8|(d.length>2?d.charCodeAt(2):0),x=[W.charAt(L>>>18),W.charAt(L>>>12&63),O>=2?"=":W.charAt(L>>>6&63),O>=1?"=":W.charAt(L&63)];return x.join("")},s=j.btoa&&typeof j.btoa=="function"?function(d){return j.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(g(String(d)))},l=function(d){return d.replace(/[+\/]/g,function(O){return O=="+"?"-":"_"}).replace(/=/g,"")},a=function(d,O){return O?l(i(d)):i(d)},n=function(d){return a(d,!0)},r;j.Uint8Array&&(r=function(d,O){for(var L="",x=0,I=d.length;x<I;x+=3){var k=d[x],C=d[x+1],F=d[x+2],V=k<<16|C<<8|F;L+=W.charAt(V>>>18)+W.charAt(V>>>12&63)+(typeof C!="undefined"?W.charAt(V>>>6&63):"=")+(typeof F!="undefined"?W.charAt(V&63):"=")}return O?l(L):L});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 O=(7&d.charCodeAt(0))<<18|(63&d.charCodeAt(1))<<12|(63&d.charCodeAt(2))<<6|63&d.charCodeAt(3),L=O-65536;return e((L>>>10)+55296)+e((L&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 O=d.length,L=O%4,x=(O>0?N[d.charAt(0)]<<18:0)|(O>1?N[d.charAt(1)]<<12:0)|(O>2?N[d.charAt(2)]<<6:0)|(O>3?N[d.charAt(3)]:0),I=[e(x>>>16),e(x>>>8&255),e(x&255)];return I.length-=[0,0,2,1][L],I.join("")},T=j.atob&&typeof j.atob=="function"?function(d){return j.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(O){return O=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},o=function(d){return f(h(d))},u;j.Uint8Array&&(u=function(d){return Uint8Array.from(_(h(d)),function(O){return O.charCodeAt(0)})});var b=function(){var d=j.Base64;return j.Base64=P,d};if(j.Base64={VERSION:S,atob:_,btoa:s,fromBase64:o,toBase64:a,utob:g,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}};j.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 j.Meteor&&(Base64=j.Base64),Le.exports?Le.exports.Base64=j.Base64:!(B=[],A=function(){return j.Base64}.apply(se,B),A!==void 0&&(Le.exports=A)),{Base64:j.Base64}})}).call(this,U("IyRk"))},JYp7:function(Le,se,U){"use strict";U.d(se,"a",function(){return ne});var ne;(function(B){function A(t){return t&&typeof t=="object"&&typeof t[Symbol.iterator]=="function"}B.is=A;const j=Object.freeze([]);function P(){return j}B.empty=P;function*S(t){yield t}B.single=S;function W(t){return t||j}B.from=W;function N(t){return!t||t[Symbol.iterator]().next().done===!0}B.isEmpty=N;function e(t){return t[Symbol.iterator]().next().value}B.first=e;function w(t,E){for(const y of t)if(E(y))return!0;return!1}B.some=w;function v(t,E){for(const y of t)if(E(y))return y;return}B.find=v;function*g(t,E){for(const y of t)E(y)&&(yield y)}B.filter=g;function*c(t,E){let y=0;for(const m of t)yield E(m,y++)}B.map=c;function*s(...t){for(const E of t)for(const y of E)yield y}B.concat=s;function*i(t){for(const E of t)for(const y of E)yield y}B.concatNested=i;function l(t,E,y){let m=y;for(const T of t)m=E(m,T);return m}B.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]}B.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,B.empty()];y.push(_.value)}return[y,{[Symbol.iterator](){return m}}]}B.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}}B.equals=r})(ne||(ne={}))},LdHM:function(Le,se,U){"use strict";U.d(se,"b",function(){return t}),U.d(se,"a",function(){return y});var ne=U("1OyB"),B=U("vuIU"),A=U("Ji7U"),j=U("LK+K"),P=U("q1tI"),S=U("rePB"),W=U("Ff2n"),N=U("ODXe"),e=U("4IlW"),w=U("bX4T"),v=U("YrtM"),g=U("TSYQ"),c=U.n(g),s=U("+nKL"),i=U("8OUc"),l=function(F,V){var ee=F.prefixCls,ie=F.id,pe=F.flattenOptions,ve=F.childrenAsData,ye=F.values,Ee=F.searchValue,Se=F.multiple,fe=F.defaultActiveFirstOption,K=F.height,R=F.itemHeight,D=F.notFoundContent,H=F.open,J=F.menuItemSelectedIcon,M=F.virtual,ae=F.onSelect,me=F.onToggleOpen,_e=F.onActiveValue,q=F.onScroll,oe=F.onMouseEnter,ue="".concat(ee,"-item"),ce=Object(v.a)(function(){return pe},[H,pe],function(z,G){return G[0]&&z[1]!==G[1]}),be=P.useRef(null),Ce=function(G){G.preventDefault()},Oe=function(G){be.current&&be.current.scrollTo({index:G})},Ie=function(G){for(var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Q=ce.length,Y=0;Y<Q;Y+=1){var $=(G+Y*X+Q)%Q,te=ce[$],re=te.group,le=te.data;if(!re&&!le.disabled)return $}return-1},De=P.useState(function(){return Ie(0)}),Me=Object(N.a)(De,2),de=Me[0],ge=Me[1],xe=function(G){ge(G);var X=ce[G];if(!X){_e(null,-1);return}_e(X.data.value,G)};P.useEffect(function(){xe(fe!==!1?Ie(0):-1)},[ce.length,Ee]),P.useEffect(function(){var z=setTimeout(function(){if(!Se&&H&&ye.size===1){var G=Array.from(ye)[0],X=ce.findIndex(function(Q){var Y=Q.data;return Y.value===G});xe(X),Oe(X)}});return function(){return clearTimeout(z)}},[H]);var we=function(G){G!==void 0&&ae(G,{selected:!ye.has(G)}),Se||me(!1)};if(P.useImperativeHandle(V,function(){return{onKeyDown:function(G){var X=G.which;switch(X){case e.a.UP:case e.a.DOWN:{var Q=0;if(X===e.a.UP?Q=-1:X===e.a.DOWN&&(Q=1),Q!==0){var Y=Ie(de+Q,Q);Oe(Y),xe(Y)}break}case e.a.ENTER:{var $=ce[de];$&&!$.data.disabled?we($.data.value):we(void 0),H&&G.preventDefault();break}case e.a.ESC:me(!1)}},onKeyUp:function(){},scrollTo:function(G){Oe(G)}}}),ce.length===0)return P.createElement("div",{role:"listbox",id:"".concat(ie,"_list"),className:"".concat(ue,"-empty"),onMouseDown:Ce},D);function Z(z){var G=ce[z];if(!G)return null;var X=G.data||{},Q=X.value,Y=X.label,$=X.children,te=Object(w.a)(X,!0),re=ve?$:Y;return G?P.createElement("div",Object.assign({"aria-label":typeof re=="string"?re:null},te,{key:z,role:"option",id:"".concat(ie,"_list_").concat(z),"aria-selected":ye.has(Q)}),Q):null}return P.createElement(P.Fragment,null,P.createElement("div",{role:"listbox",id:"".concat(ie,"_list"),style:{height:0,width:0,overflow:"hidden"}},Z(de-1),Z(de),Z(de+1)),P.createElement(s.a,{itemKey:"key",ref:be,data:ce,height:K,itemHeight:R,fullHeight:!1,onMouseDown:Ce,onScroll:q,virtual:M,onMouseEnter:oe},function(z,G){var X,Q=z.group,Y=z.groupOption,$=z.data,te=$.label,re=$.key;if(Q)return P.createElement("div",{className:c()(ue,"".concat(ue,"-group"))},te!==void 0?te:re);var le=$.disabled,he=$.value,Te=$.title,Re=$.children,Pe=$.style,Ae=$.className,Ge=Object(W.a)($,["disabled","value","title","children","style","className"]),Ne=ye.has(he),ke="".concat(ue,"-option"),$e=c()(ue,ke,Ae,(X={},Object(S.a)(X,"".concat(ke,"-grouped"),Y),Object(S.a)(X,"".concat(ke,"-active"),de===G&&!le),Object(S.a)(X,"".concat(ke,"-disabled"),le),Object(S.a)(X,"".concat(ke,"-selected"),Ne),X)),ze=ve?Re:te,He=!J||typeof J=="function"||Ne;return P.createElement("div",Object.assign({},Ge,{"aria-selected":Ne,className:$e,title:Te,onMouseMove:function(){if(de===G||le)return;xe(G)},onClick:function(){le||we(he)},style:Pe}),P.createElement("div",{className:"".concat(ke,"-content")},ze||he),P.isValidElement(J)||Ne,He&&P.createElement(i.a,{className:"".concat(ue,"-option-state"),customizeIcon:J,customizeIconProps:{isSelected:Ne}},Ne?"\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 _(C){var F=C.key,V=C.props,ee=V.children,ie=V.value,pe=Object(W.a)(V,["children","value"]);return Object(m.a)({key:F,value:ie!==void 0?ie:F,children:ee},pe)}function f(C){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(T.a)(C).map(function(V,ee){if(!P.isValidElement(V)||!V.type)return null;var ie=V.type.isSelectOptGroup,pe=V.key,ve=V.props,ye=ve.children,Ee=Object(W.a)(ve,["children"]);return F||!ie?_(V):Object(m.a)(Object(m.a)({key:"__RC_SELECT_GRP__".concat(pe===null?ee:pe,"__"),label:pe},Ee),{},{options:f(ye)})}).filter(function(V){return V})}var h=U("2Qr1"),o=U("qNPg"),u=U("U8pU"),b=U("Kwbf"),p=U("WKfj");function d(C){var F=C.mode,V=C.options,ee=C.children,ie=C.backfill,pe=C.allowClear,ve=C.placeholder,ye=C.getInputElement,Ee=C.showSearch,Se=C.onSearch,fe=C.defaultOpen,K=C.autoFocus,R=C.labelInValue,D=C.value,H=C.inputValue,J=C.optionLabelProp,M=F==="multiple"||F==="tags",ae=Ee!==void 0?Ee:M||F==="combobox",me=V||f(ee);if(Object(b.a)(F!=="tags"||me.every(function(ue){return!ue.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),F==="tags"||F==="combobox"){var _e=me.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)(!_e,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(b.a)(F!=="combobox"||!J,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(b.a)(F==="combobox"||!ie,"`backfill` only works with `combobox` mode."),Object(b.a)(F==="combobox"||!ye,"`getInputElement` only work with `combobox` mode."),Object(b.b)(F!=="combobox"||!ye||!pe||!ve,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Se&&!ae&&F!=="combobox"&&F!=="tags"&&Object(b.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(b.b)(!fe||K,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),D!=null){var q=Object(p.d)(D);Object(b.a)(!R||q.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)(!M||Array.isArray(D),"`value` should be array when `mode` is `multiple` or `tags`")}if(ee){var oe=null;Object(T.a)(ee).some(function(ue){if(!P.isValidElement(ue)||!ue.type)return!1;var ce=ue.type;if(ce.isSelectOption)return!1;if(ce.isSelectOptGroup){var be=Object(T.a)(ue.props.children).every(function(Ce){return!P.isValidElement(Ce)||!ue.type||Ce.type.isSelectOption?!0:(oe=Ce.type,!1)});return!be}return oe=ce,!0}),oe&&Object(b.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(oe.displayName||oe.name||oe,"`.")),Object(b.a)(H===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var O=d,L=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:O,fillOptionsWithMissingValue:h.a}),x=function(C){Object(A.a)(V,C);var F=Object(j.a)(V);function V(){var ee;return Object(ne.a)(this,V),ee=F.apply(this,arguments),ee.selectRef=P.createRef(),ee.focus=function(){ee.selectRef.current.focus()},ee.blur=function(){ee.selectRef.current.blur()},ee}return Object(B.a)(V,[{key:"render",value:function(){return P.createElement(L,Object.assign({ref:this.selectRef},this.props))}}]),V}(P.Component);x.Option=t,x.OptGroup=y;var I=x,k=se.c=I},MI8n:function(Le,se,U){"use strict";U.d(se,"c",function(){return P}),U.d(se,"b",function(){return e}),U.d(se,"e",function(){return w}),U.d(se,"a",function(){return v}),U.d(se,"d",function(){return g}),U.d(se,"f",function(){return c});var ne=U("/cxE"),B=U("pmY6"),A=U("24hK"),j=U("5Y4S"),P;(function(s){s.None=()=>B.a.None;function i(d){return(O,L=null,x)=>{let I=!1,k;return k=d(C=>I?void 0:(k?k.dispose():I=!0,O.call(L,C)),null,x),I&&k.dispose(),k}}s.once=i;function l(d,O){return y((L,x=null,I)=>d(k=>L.call(x,O(k)),null,I))}s.map=l;function a(d,O){return y((L,x=null,I)=>d(k=>{O(k),L.call(x,k)},null,I))}s.forEach=a;function n(d,O){return y((L,x=null,I)=>d(k=>O(k)&&L.call(x,k),null,I))}s.filter=n;function r(d){return d}s.signal=r;function t(...d){return(O,L=null,x)=>Object(B.e)(...d.map(I=>I(k=>O.call(L,k),null,x)))}s.any=t;function E(d,O,L){let x=L;return l(d,I=>(x=O(x,I),x))}s.reduce=E;function y(d){let O;const L=new e({onFirstListenerAdd(){O=d(L.fire,L)},onLastListenerRemove(){O.dispose()}});return L.event}function m(d,O,L=100,x=!1,I){let k,C,F,V=0;const ee=new e({leakWarningThreshold:I,onFirstListenerAdd(){k=d(ie=>{V++,C=O(C,ie),x&&!F&&(ee.fire(C),C=void 0),clearTimeout(F),F=setTimeout(()=>{const pe=C;C=void 0,F=void 0,(!x||V>1)&&ee.fire(pe),V=0},L)})},onLastListenerRemove(){k.dispose()}});return ee.event}s.debounce=m;function T(d,O=(L,x)=>L===x){let L=!0,x;return n(d,I=>{const k=L||!O(I,x);return L=!1,x=I,k})}s.latch=T;function _(d,O){return[s.filter(d,O),s.filter(d,L=>!O(L))]}s.split=_;function f(d,O=!1,L=[]){let x=L.slice(),I=d(F=>{x?x.push(F):C.fire(F)});const k=()=>{x&&x.forEach(F=>C.fire(F)),x=null},C=new e({onFirstListenerAdd(){I||(I=d(F=>C.fire(F)))},onFirstListenerDidAdd(){x&&(O?setTimeout(k):k())},onLastListenerRemove(){I&&I.dispose(),I=null}});return C.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,O){return new h(E(this.event,d,O))}latch(){return new h(T(this.event))}debounce(d,O=100,L=!1,x){return new h(m(this.event,d,O,L,x))}on(d,O,L){return this.event(d,O,L)}once(d,O,L){return i(this.event)(d,O,L)}}function o(d){return new h(d)}s.chain=o;function u(d,O,L=x=>x){const x=(...F)=>C.fire(L(...F)),I=()=>d.on(O,x),k=()=>d.removeListener(O,x),C=new e({onFirstListenerAdd:I,onLastListenerRemove:k});return C.event}s.fromNodeEventEmitter=u;function b(d,O,L=x=>x){const x=(...F)=>C.fire(L(...F)),I=()=>d.addEventListener(O,x),k=()=>d.removeEventListener(O,x),C=new e({onFirstListenerAdd:I,onLastListenerRemove:k});return C.event}s.fromDOMEventEmitter=b;function p(d){return new Promise(O=>i(d)(O))}s.toPromise=p})(P||(P={}));class S{constructor(s){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${s}_${S._idPool++}`}start(s){this._stopWatch=new j.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}}}S._idPool=0;let W=-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=W;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=W>0?new N(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((i=this._options)===null||i===void 0?void 0:i._profName)?new S(this._options._profName):void 0}get event(){return this._event||(this._event=(s,i,l)=>{var a;this._listeners||(this._listeners=new A.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(B.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 B.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 A.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(ne.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 w extends e{constructor(s){super(s);this._isPaused=0,this._eventQueue=new A.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 v extends w{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 g{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=B.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(Le,se,U){"use strict";(function(ne,B){U.d(se,"b",function(){return l}),U.d(se,"i",function(){return t}),U.d(se,"f",function(){return E}),U.d(se,"d",function(){return y}),U.d(se,"g",function(){return m}),U.d(se,"h",function(){return T}),U.d(se,"c",function(){return _}),U.d(se,"k",function(){return f}),U.d(se,"j",function(){return h}),U.d(se,"a",function(){return o}),U.d(se,"e",function(){return p});var A;const j="en";let P=!1,S=!1,W=!1,N=!1,e=!1,w=!1,v=!1,g,c=j,s,i;const l=typeof self=="object"?self:typeof ne=="object"?ne:{};let a;typeof l.vscode!="undefined"&&typeof l.vscode.process!="undefined"?a=l.vscode.process:typeof B!="undefined"&&(a=B);const n=typeof((A=a==null?void 0:a.versions)===null||A===void 0?void 0:A.electron)=="string"&&a.type==="renderer";if(typeof navigator=="object"&&!n)i=navigator.userAgent,P=i.indexOf("Windows")>=0,S=i.indexOf("Macintosh")>=0,v=(i.indexOf("Macintosh")>=0||i.indexOf("iPad")>=0||i.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,W=i.indexOf("Linux")>=0,w=!0,g=navigator.language,c=g;else if(typeof a=="object"){P=a.platform==="win32",S=a.platform==="darwin",W=a.platform==="linux",N=W&&!!a.env.SNAP&&!!a.env.SNAP_REVISION,g=j,c=j;const d=a.env.VSCODE_NLS_CONFIG;if(d)try{const O=JSON.parse(d),L=O.availableLanguages["*"];g=O.locale,c=L||j,s=O._translationsConfigFile}catch(O){}e=!0}else console.error("Unable to resolve platform.");let r=0;S?r=1:P?r=3:W&&(r=2);const t=P,E=S,y=W,m=e,T=w,_=v,f=i,h=function(){if(l.setImmediate)return l.setImmediate.bind(l);if(typeof l.postMessage=="function"&&!l.importScripts){let L=[];l.addEventListener("message",I=>{if(I.data&&I.data.vscodeSetImmediateId)for(let k=0,C=L.length;k<C;k++){const F=L[k];if(F.id===I.data.vscodeSetImmediateId){L.splice(k,1),F.callback();return}}});let x=0;return I=>{const k=++x;L.push({id:k,callback:I}),l.postMessage({vscodeSetImmediateId:k},"*")}}if(typeof(a==null?void 0:a.nextTick)=="function")return a.nextTick.bind(a);const O=Promise.resolve();return L=>O.then(L)}(),o=S||v?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 O=new Uint16Array(d.buffer);u=O[0]===(2<<8)+1}return u}}).call(this,U("IyRk"),U("Q2Ig"))},N0LK:function(Le,se,U){"use strict";U.d(se,"C",function(){return ne}),U.d(se,"v",function(){return A}),U.d(se,"s",function(){return j}),U.d(se,"t",function(){return P}),U.d(se,"U",function(){return S}),U.d(se,"J",function(){return W}),U.d(se,"O",function(){return N}),U.d(se,"p",function(){return e}),U.d(se,"T",function(){return w}),U.d(se,"q",function(){return v}),U.d(se,"N",function(){return g}),U.d(se,"M",function(){return c}),U.d(se,"Q",function(){return s}),U.d(se,"u",function(){return i}),U.d(se,"x",function(){return l}),U.d(se,"I",function(){return a}),U.d(se,"f",function(){return n}),U.d(se,"h",function(){return r}),U.d(se,"g",function(){return t}),U.d(se,"i",function(){return E}),U.d(se,"G",function(){return y}),U.d(se,"H",function(){return m}),U.d(se,"r",function(){return T}),U.d(se,"R",function(){return _}),U.d(se,"d",function(){return f}),U.d(se,"e",function(){return h}),U.d(se,"E",function(){return o}),U.d(se,"F",function(){return u}),U.d(se,"j",function(){return b}),U.d(se,"z",function(){return p}),U.d(se,"K",function(){return O}),U.d(se,"L",function(){return L}),U.d(se,"m",function(){return I}),U.d(se,"k",function(){return C}),U.d(se,"A",function(){return V}),U.d(se,"a",function(){return ee}),U.d(se,"n",function(){return ie}),U.d(se,"l",function(){return pe}),U.d(se,"D",function(){return ve}),U.d(se,"B",function(){return ye}),U.d(se,"b",function(){return Ee}),U.d(se,"S",function(){return Se}),U.d(se,"o",function(){return fe}),U.d(se,"P",function(){return K}),U.d(se,"w",function(){return R}),U.d(se,"c",function(){return D}),U.d(se,"y",function(){return M});function ne(q){return!q||typeof q!="string"?!0:q.trim().length===0}const B=/{(\d+)}/g;function A(q,...oe){return oe.length===0?q:q.replace(B,function(ue,ce){const be=parseInt(ce,10);return isNaN(be)||be<0||be>=oe.length?ue:oe[be]})}function j(q){return q.replace(/[<>&]/g,function(oe){switch(oe){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return oe}})}function P(q){return q.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function S(q,oe=" "){const ue=W(q,oe);return N(ue,oe)}function W(q,oe){if(!q||!oe)return q;const ue=oe.length;if(ue===0||q.length===0)return q;let ce=0;for(;q.indexOf(oe,ce)===ce;)ce=ce+ue;return q.substring(ce)}function N(q,oe){if(!q||!oe)return q;const ue=oe.length,ce=q.length;if(ue===0||ce===0)return q;let be=ce,Ce=-1;for(;!(Ce=q.lastIndexOf(oe,be-1),Ce===-1||Ce+ue!==be);){if(Ce===0)return"";be=Ce}return q.substring(0,be)}function e(q){return q.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function w(q){return q.replace(/\*/g,"")}function v(q,oe,ue={}){if(!q)throw new Error("Cannot create regex from empty string");oe||(q=P(q)),ue.wholeWord&&(/\B/.test(q.charAt(0))||(q="\\b"+q),/\B/.test(q.charAt(q.length-1))||(q=q+"\\b"));let ce="";return ue.global&&(ce+="g"),ue.matchCase||(ce+="i"),ue.multiline&&(ce+="m"),ue.unicode&&(ce+="u"),new RegExp(q,ce)}function g(q){if(q.source==="^"||q.source==="^$"||q.source==="$"||q.source==="^\\s*$")return!1;const oe=q.exec("");return!!(oe&&q.lastIndex===0)}function c(q){return(q.global?"g":"")+(q.ignoreCase?"i":"")+(q.multiline?"m":"")+(q.unicode?"u":"")}function s(q){return q.split(/\r\n|\r|\n/)}function i(q){for(let oe=0,ue=q.length;oe<ue;oe++){const ce=q.charCodeAt(oe);if(ce!==32&&ce!==9)return oe}return-1}function l(q,oe=0,ue=q.length){for(let ce=oe;ce<ue;ce++){const be=q.charCodeAt(ce);if(be!==32&&be!==9)return q.substring(oe,ce)}return q.substring(oe,ue)}function a(q,oe=q.length-1){for(let ue=oe;ue>=0;ue--){const ce=q.charCodeAt(ue);if(ce!==32&&ce!==9)return ue}return-1}function n(q,oe){return q<oe?-1:q>oe?1:0}function r(q,oe,ue=0,ce=q.length,be=0,Ce=oe.length){for(;ue<ce&&be<Ce;ue++,be++){let De=q.charCodeAt(ue),Me=oe.charCodeAt(be);if(De<Me)return-1;if(De>Me)return 1}const Oe=ce-ue,Ie=Ce-be;return Oe<Ie?-1:Oe>Ie?1:0}function t(q,oe){return E(q,oe,0,q.length,0,oe.length)}function E(q,oe,ue=0,ce=q.length,be=0,Ce=oe.length){for(;ue<ce&&be<Ce;ue++,be++){let De=q.charCodeAt(ue),Me=oe.charCodeAt(be);if(De===Me)continue;if(De>=128||Me>=128)return r(q.toLowerCase(),oe.toLowerCase(),ue,ce,be,Ce);y(De)&&(De-=32),y(Me)&&(Me-=32);const de=De-Me;if(de===0)continue;return de}const Oe=ce-ue,Ie=Ce-be;return Oe<Ie?-1:Oe>Ie?1:0}function y(q){return q>=97&&q<=122}function m(q){return q>=65&&q<=90}function T(q,oe){return q.length===oe.length&&E(q,oe)===0}function _(q,oe){const ue=oe.length;return oe.length>q.length?!1:E(q,oe,0,ue)===0}function f(q,oe){let ue,ce=Math.min(q.length,oe.length);for(ue=0;ue<ce;ue++)if(q.charCodeAt(ue)!==oe.charCodeAt(ue))return ue;return ce}function h(q,oe){let ue,ce=Math.min(q.length,oe.length);const be=q.length-1,Ce=oe.length-1;for(ue=0;ue<ce;ue++)if(q.charCodeAt(be-ue)!==oe.charCodeAt(Ce-ue))return ue;return ce}function o(q){return 55296<=q&&q<=56319}function u(q){return 56320<=q&&q<=57343}function b(q,oe){return(q-55296<<10)+(oe-56320)+65536}function p(q,oe,ue){const ce=q.charCodeAt(ue);if(o(ce)&&ue+1<oe){const be=q.charCodeAt(ue+1);if(u(be))return b(ce,be)}return ce}function d(q,oe){const ue=q.charCodeAt(oe-1);if(u(ue)&&oe>1){const ce=q.charCodeAt(oe-2);if(o(ce))return b(ce,ue)}return ue}function O(q,oe){const ue=H.getInstance(),ce=oe,be=q.length,Ce=p(q,be,oe);oe+=Ce>=65536?2:1;let Oe=ue.getGraphemeBreakType(Ce);for(;oe<be;){const Ie=p(q,be,oe),De=ue.getGraphemeBreakType(Ie);if(D(Oe,De))break;oe+=Ie>=65536?2:1,Oe=De}return oe-ce}function L(q,oe){const ue=H.getInstance(),ce=oe,be=d(q,oe);oe-=be>=65536?2:1;let Ce=ue.getGraphemeBreakType(be);for(;oe>0;){const Oe=d(q,oe),Ie=ue.getGraphemeBreakType(Oe);if(D(Ie,Ce))break;oe-=Oe>=65536?2:1,Ce=Ie}return ce-oe}const x=/(?:[\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 I(q){return x.test(q)}const k=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function C(q){return k.test(q)}const F=/^[\t\n\r\x20-\x7E]*$/;function V(q){return F.test(q)}const ee=/[\u2028\u2029]/;function ie(q){return ee.test(q)}function pe(q){for(let oe=0,ue=q.length;oe<ue;oe++)if(ve(q.charCodeAt(oe)))return!0;return!1}function ve(q){return q=+q,q>=11904&&q<=55215||q>=63744&&q<=64255||q>=65281&&q<=65374}function ye(q){return q>=127462&&q<=127487||q===8986||q===8987||q===9200||q===9203||q>=9728&&q<=10175||q===11088||q===11093||q>=127744&&q<=128591||q>=128640&&q<=128764||q>=128992&&q<=129003||q>=129280&&q<=129535||q>=129648&&q<=129750}const Ee=String.fromCharCode(65279);function Se(q){return!!(q&&q.length>0&&q.charCodeAt(0)===65279)}function fe(q,oe=!1){return q?(oe&&(q=q.replace(/\\./g,"")),q.toLowerCase()!==q):!1}function K(q){const oe=90-65+1;return q=q%(2*oe),q<oe?String.fromCharCode(97+q):String.fromCharCode(65+q-oe)}function R(q){const oe=H.getInstance();return oe.getGraphemeBreakType(q)}function D(q,oe){return q===0?oe!==5&&oe!==7:q===2&&oe===3?!1:q===4||q===2||q===3||(oe===4||oe===2||oe===3)?!0:q===8&&(oe===8||oe===9||oe===11||oe===12)||((q===11||q===9)&&(oe===9||oe===10)||((q===12||q===10)&&oe===10||(oe===5||oe===13||(oe===7||(q===1||q===13&&oe===14)))))?!1:!(q===6&&oe===6)}class H{constructor(){this._data=J()}static getInstance(){return H._INSTANCE||(H._INSTANCE=new H),H._INSTANCE}getGraphemeBreakType(q){if(q<32)return q===10?3:q===13?2:4;if(q<127)return 0;const oe=this._data,ue=oe.length/3;let ce=1;for(;ce<=ue;)if(q<oe[3*ce])ce=2*ce;else if(q>oe[3*ce+1])ce=2*ce+1;else return oe[3*ce+2];return 0}}H._INSTANCE=null;function J(){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 M(q,oe){if(q===0)return 0;const ue=ae(q,oe);if(ue!==void 0)return ue;const ce=d(oe,q);return q-=me(ce),q}function ae(q,oe){let ue=d(oe,q);for(q-=me(ue);_e(ue)||ue===65039||ue===8419;){if(q===0)return;ue=d(oe,q),q-=me(ue)}if(!ye(ue))return;if(q>=0){const ce=d(oe,q);ce===8205&&(q-=me(ce))}return q}function me(q){return q>=65536?2:1}function _e(q){return 127995<=q&&q<=127999}},NvD2:function(Le,se,U){"use strict";U.d(se,"a",function(){return S});var ne=U("Kwbf");function B(W,N){var e=new Set;return W.forEach(function(w){N.has(w)||e.add(w)}),e}function A(W){var N=W||{},e=N.disabled,w=N.disableCheckbox,v=N.checkable;return!!(e||w)||v===!1}function j(W,N,e,w){for(var v=new Set(W),g=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;v.has(r)&&!w(t)&&y.filter(function(m){return!w(m.node)}).forEach(function(m){v.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(w(t)||!n.parent||i.has(n.parent.key))return;if(w(n.parent.node)){i.add(r.key);return}var E=!0,y=!1;(r.children||[]).filter(function(m){return!w(m.node)}).forEach(function(m){var T=m.key,_=v.has(T);E&&!_&&(E=!1),!y&&(_||g.has(T))&&(y=!0)}),E&&v.add(r.key),y&&g.add(r.key),i.add(r.key)})}return{checkedKeys:Array.from(v),halfCheckedKeys:Array.from(B(g,v))}}function P(W,N,e,w,v){for(var g=new Set(W),c=new Set(N),s=0;s<=w;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;!g.has(t)&&!c.has(t)&&!v(E)&&m.filter(function(T){return!v(T.node)}).forEach(function(T){g.delete(T.key)})})}c=new Set;for(var l=new Set,a=w;a>=0;a-=1){var n=e.get(a)||new Set;n.forEach(function(r){var t=r.parent,E=r.node;if(v(E)||!r.parent||l.has(r.parent.key))return;if(v(r.parent.node)){l.add(t.key);return}var y=!0,m=!1;(t.children||[]).filter(function(T){return!v(T.node)}).forEach(function(T){var _=T.key,f=g.has(_);y&&!f&&(y=!1),!m&&(f||c.has(_))&&(m=!0)}),y||g.delete(t.key),m&&c.add(t.key),l.add(t.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(B(c,g))}}function S(W,N,e,w){var v=[],g;w?g=w:g=A;var c=new Set(W.filter(function(a){var n=!!e[a];return n||v.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(ne.a)(!v.length,"Tree missing follow keys: ".concat(v.slice(0,100).map(function(a){return"'".concat(a,"'")}).join(", ")));var l;return N===!0?l=j(c,s,i,g):l=P(c,N.halfCheckedKeys,s,i,g),l}},OZM5:function(Le,se,U){"use strict";U.d(se,"b",function(){return w}),U.d(se,"a",function(){return v}),U.d(se,"k",function(){return g}),U.d(se,"h",function(){return c}),U.d(se,"i",function(){return s}),U.d(se,"g",function(){return i}),U.d(se,"c",function(){return l}),U.d(se,"d",function(){return a}),U.d(se,"j",function(){return t}),U.d(se,"e",function(){return E}),U.d(se,"f",function(){return y});var ne=U("KQm4"),B=U("U8pU"),A=U("Ff2n"),j=U("q1tI"),P=U.n(j),S=U("Kwbf"),W=U("WaYH"),N=.25,e=2;function w(m,T){var _=m.slice(),f=_.indexOf(T);return f>=0&&_.splice(f,1),_}function v(m,T){var _=m.slice();return _.indexOf(T)===-1&&_.push(T),_}function g(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(A.a)(u,["children"]),d=r(b,T);return P.a.createElement(W.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(B.a)(m)==="object")T={checkedKeys:m.checked||void 0,halfCheckedKeys:m.halfChecked||void 0};else return Object(S.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(ne.a)(_)}function y(m){var T={};return Object.keys(m).forEach(function(_){(_.startsWith("data-")||_.startsWith("aria-"))&&(T[_]=m[_])}),T}},"SA+Z":function(Le,se,U){var ne=U("wTVA"),B=U("EbDI"),A=U("ZhPi"),j=U("wkBT");function P(S){return ne(S)||B(S)||A(S)||j()}Le.exports=P,Le.exports.__esModule=!0,Le.exports.default=Le.exports},SJMd:function(Le,se){/**
* @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,ne,B,A=!1,j,P;window.PR_SHOULD_USE_CONTINUATION=!0;var S,W;(function(){var N=window,e=["break,continue,do,else,for,if,return,while"],w=[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"],v=[w,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],g=[v,"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=[v,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],s=[v,"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=[v,"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=[g,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",O="atn",L="atv",x="nocode",I="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(ae){for(var me=0,_e=!1,q=!1,oe=0,ue=ae.length;oe<ue;++oe){var ce=ae[oe];if(ce.ignoreCase)q=!0;else if(/[a-z]/i.test(ce.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){_e=!0,q=!1;break}}var be={b:8,t:9,n:10,v:11,f:12,r:13};function Ce(de){var ge=de.charCodeAt(0);if(ge!==92)return ge;var xe=de.charAt(1);return ge=be[xe],ge||("0"<=xe&&xe<="7"?parseInt(de.substring(1),8):xe==="u"||xe==="x"?parseInt(de.substring(2),16):de.charCodeAt(1))}function Oe(de){if(de<32)return(de<16?"\\x0":"\\x")+de.toString(16);var ge=String.fromCharCode(de);return ge==="\\"||ge==="-"||ge==="]"||ge==="^"?"\\"+ge:ge}function Ie(de){var ge=de.substring(1,de.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")),xe=[],we=ge[0]==="^",Z=["["];we&&Z.push("^");for(var z=we?1:0,G=ge.length;z<G;++z){var X=ge[z];if(/\\[bdsw]/i.test(X))Z.push(X);else{var Q=Ce(X),Y;z+2<G&&ge[z+1]==="-"?(Y=Ce(ge[z+2]),z+=2):Y=Q,xe.push([Q,Y]),Y<65||Q>122||(Y<65||Q>90||xe.push([Math.max(65,Q)|32,Math.min(Y,90)|32]),Y<97||Q>122||xe.push([Math.max(97,Q)&~32,Math.min(Y,122)&~32]))}}xe.sort(function(le,he){return le[0]-he[0]||he[1]-le[1]});for(var $=[],te=[],z=0;z<xe.length;++z){var re=xe[z];re[0]<=te[1]+1?te[1]=Math.max(te[1],re[1]):$.push(te=re)}for(var z=0;z<$.length;++z){var re=$[z];Z.push(Oe(re[0])),re[1]>re[0]&&(re[1]+1>re[0]&&Z.push("-"),Z.push(Oe(re[1])))}return Z.push("]"),Z.join("")}function De(de){for(var ge=de.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")),xe=ge.length,we=[],Z=0,z=0;Z<xe;++Z){var G=ge[Z];if(G==="(")++z;else if(G.charAt(0)==="\\"){var X=+G.substring(1);X&&(X<=z?we[X]=-1:ge[Z]=Oe(X))}}for(var Z=1;Z<we.length;++Z)we[Z]===-1&&(we[Z]=++me);for(var Z=0,z=0;Z<xe;++Z){var G=ge[Z];if(G==="(")++z,we[z]||(ge[Z]="(?:");else if(G.charAt(0)==="\\"){var X=+G.substring(1);X&&X<=z&&(ge[Z]="\\"+we[X])}}for(var Z=0;Z<xe;++Z)ge[Z]==="^"&&ge[Z+1]!=="^"&&(ge[Z]="");if(de.ignoreCase&&_e)for(var Z=0;Z<xe;++Z){var G=ge[Z],Q=G.charAt(0);G.length>=2&&Q==="["?ge[Z]=Ie(G):Q!=="\\"&&(ge[Z]=G.replace(/[a-zA-Z]/g,function(te){var re=te.charCodeAt(0);return"["+String.fromCharCode(re&~32,re|32)+"]"}))}return ge.join("")}for(var Me=[],oe=0,ue=ae.length;oe<ue;++oe){var ce=ae[oe];if(ce.global||ce.multiline)throw new Error(""+ce);Me.push("(?:"+De(ce)+")")}return new RegExp(Me.join("|"),q?"gi":"g")}function C(ae,me){var _e=/(?:^|\s)nocode(?:\s|$)/,q=[],oe=0,ue=[],ce=0;function be(Ce){var Oe=Ce.nodeType;if(Oe==1){if(_e.test(Ce.className))return;for(var Ie=Ce.firstChild;Ie;Ie=Ie.nextSibling)be(Ie);var De=Ce.nodeName.toLowerCase();(De==="br"||De==="li")&&(q[ce]=`
`,ue[ce<<1]=oe++,ue[ce++<<1|1]=Ce)}else if(Oe==3||Oe==4){var Me=Ce.nodeValue;Me.length&&(me?Me=Me.replace(/\r\n?/g,`
`):Me=Me.replace(/[ \t\r\n]+/g," "),q[ce]=Me,ue[ce<<1]=oe,oe+=Me.length,ue[ce++<<1|1]=Ce)}}return be(ae),{sourceCode:q.join("").replace(/\n$/,""),spans:ue}}function F(ae,me,_e,q,oe){if(!_e)return;var ue={sourceNode:ae,pre:1,langExtension:null,numberLines:null,sourceCode:_e,spans:null,basePos:me,decorations:null};q(ue),oe.push.apply(oe,ue.decorations)}var V=/\S/;function ee(ae){for(var me=void 0,_e=ae.firstChild;_e;_e=_e.nextSibling){var q=_e.nodeType;me=q===1?me?ae:_e:q===3&&V.test(_e.nodeValue)?ae:me}return me===ae?void 0:me}function ie(ae,me){var _e={},q;(function(){for(var ce=ae.concat(me),be=[],Ce={},Oe=0,Ie=ce.length;Oe<Ie;++Oe){var De=ce[Oe],Me=De[3];if(Me)for(var de=Me.length;--de>=0;)_e[Me.charAt(de)]=De;var ge=De[1],xe=""+ge;Ce.hasOwnProperty(xe)||(be.push(ge),Ce[xe]=null)}be.push(/[\0-\uffff]/),q=k(be)})();var oe=me.length,ue=function(ce){for(var be=ce.sourceCode,Ce=ce.basePos,Oe=ce.sourceNode,Ie=[Ce,u],De=0,Me=be.match(q)||[],de={},ge=0,xe=Me.length;ge<xe;++ge){var we=Me[ge],Z=de[we],z=void 0,G;if(typeof Z=="string")G=!1;else{var X=_e[we.charAt(0)];if(X)z=we.match(X[1]),Z=X[0];else{for(var Q=0;Q<oe;++Q)if(X=me[Q],z=we.match(X[1]),z){Z=X[0];break}z||(Z=u)}G=Z.length>=5&&Z.substring(0,5)==="lang-",G&&!(z&&typeof z[1]=="string")&&(G=!1,Z=d),G||(de[we]=Z)}var Y=De;if(De+=we.length,!G)Ie.push(Ce+Y,Z);else{var $=z[1],te=we.indexOf($),re=te+$.length;z[2]&&(re=we.length-z[2].length,te=re-$.length);var le=Z.substring(5);F(Oe,Ce+Y,we.substring(0,te),ue,Ie),F(Oe,Ce+Y+te,$,K(le,$),Ie),F(Oe,Ce+Y+re,we.substring(re),ue,Ie)}}ce.decorations=Ie};return ue}function pe(ae){var me=[],_e=[];ae.tripleQuotedStrings?me.push([m,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ae.multiLineStrings?me.push([m,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):me.push([m,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ae.verbatimStrings&&_e.push([m,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var q=ae.hashComments;q&&(ae.cStyleComments?(q>1?me.push([_,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):me.push([_,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),_e.push([m,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):me.push([_,/^#[^\r\n]*/,null,"#"])),ae.cStyleComments&&(_e.push([_,/^\/\/[^\r\n]*/,null]),_e.push([_,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var oe=ae.regexLiterals;if(oe){var ue=oe>1?"":`
\r`,ce=ue?".":"[\\S\\s]",be="/(?=[^/*"+ue+"])(?:[^/\\x5B\\x5C"+ue+"]|\\x5C"+ce+"|\\x5B(?:[^\\x5C\\x5D"+ue+"]|\\x5C"+ce+")*(?:\\x5D|$))+/";_e.push(["lang-regex",RegExp("^"+I+"("+be+")")])}var Ce=ae.types;Ce&&_e.push([f,Ce]);var Oe=(""+ae.keywords).replace(/^ | $/g,"");Oe.length&&_e.push([T,new RegExp("^(?:"+Oe.replace(/[\s,]+/g,"|")+")\\b"),null]),me.push([u,/^\s+/,null,` \r
\xA0`]);var Ie="^.[^\\s\\w.$@'\"`/\\\\]*";return ae.regexLiterals&&(Ie+="(?!s*/)"),_e.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(Ie),null]),ie(me,_e)}var ve=pe({keywords:E,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ye(ae,me,_e){for(var q=/(?:^|\s)nocode(?:\s|$)/,oe=/\r\n?|\n/,ue=ae.ownerDocument,ce=ue.createElement("li");ae.firstChild;)ce.appendChild(ae.firstChild);var be=[ce];function Ce(ge){var xe=ge.nodeType;if(xe==1&&!q.test(ge.className))if(ge.nodeName==="br")Oe(ge),ge.parentNode&&ge.parentNode.removeChild(ge);else for(var we=ge.firstChild;we;we=we.nextSibling)Ce(we);else if((xe==3||xe==4)&&_e){var Z=ge.nodeValue,z=Z.match(oe);if(z){var G=Z.substring(0,z.index);ge.nodeValue=G;var X=Z.substring(z.index+z[0].length);if(X){var Q=ge.parentNode;Q.insertBefore(ue.createTextNode(X),ge.nextSibling)}Oe(ge),G||ge.parentNode.removeChild(ge)}}}function Oe(ge){for(;!ge.nextSibling;)if(ge=ge.parentNode,!ge)return;function xe(z,G){var X=G?z.cloneNode(!1):z,Q=z.parentNode;if(Q){var Y=xe(Q,1),$=z.nextSibling;Y.appendChild(X);for(var te=$;te;te=$)$=te.nextSibling,Y.appendChild(te)}return X}for(var we=xe(ge.nextSibling,0),Z;(Z=we.parentNode)&&Z.nodeType===1;)we=Z;be.push(we)}for(var Ie=0;Ie<be.length;++Ie)Ce(be[Ie]);me===(me|0)&&be[0].setAttribute("value",me);var De=ue.createElement("ol");De.className="linenums";for(var Me=Math.max(0,me-1|0)||0,Ie=0,de=be.length;Ie<de;++Ie)ce=be[Ie],ce.className="L"+(Ie+Me)%10,ce.firstChild||ce.appendChild(ue.createTextNode("\xA0")),De.appendChild(ce);ae.appendChild(De)}function Ee(ae){var me=/\bMSIE\s(\d+)/.exec(navigator.userAgent);me=me&&+me[1]<=8;var _e=/\n/g,q=ae.sourceCode,oe=q.length,ue=0,ce=ae.spans,be=ce.length,Ce=0,Oe=ae.decorations,Ie=Oe.length,De=0;Oe[Ie]=oe;var Me,de;for(de=Me=0;de<Ie;)Oe[de]!==Oe[de+2]?(Oe[Me++]=Oe[de++],Oe[Me++]=Oe[de++]):de+=2;for(Ie=Me,de=Me=0;de<Ie;){for(var ge=Oe[de],xe=Oe[de+1],we=de+2;we+2<=Ie&&Oe[we+1]===xe;)we+=2;Oe[Me++]=ge,Oe[Me++]=xe,de=we}Ie=Oe.length=Me;var Z=ae.sourceNode,z="";Z&&(z=Z.style.display,Z.style.display="none");try{for(var G=null;Ce<be;){var X=ce[Ce],Q=ce[Ce+2]||oe,Y=Oe[De+2]||oe,we=Math.min(Q,Y),$=ce[Ce+1],te;if($.nodeType!==1&&(te=q.substring(ue,we))){me&&(te=te.replace(_e,"\r")),$.nodeValue=te;var re=$.ownerDocument,le=re.createElement("span");le.className=Oe[De+1];var he=$.parentNode;he.replaceChild(le,$),le.appendChild($),ue<Q&&(ce[Ce+1]=$=re.createTextNode(q.substring(we,Q)),he.insertBefore($,le.nextSibling))}ue=we,ue>=Q&&(Ce+=2),ue>=Y&&(De+=2)}}finally{Z&&(Z.style.display=z)}}var Se={};function fe(ae,me){for(var _e=me.length;--_e>=0;){var q=me[_e];Se.hasOwnProperty(q)?N.console&&console.warn("cannot override language handler %s",q):Se[q]=ae}}function K(ae,me){return ae&&Se.hasOwnProperty(ae)||(ae=/^\s*</.test(me)?"default-markup":"default-code"),Se[ae]}fe(ve,["default-code"]),fe(ie([],[[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"]),fe(ie([[u,/^[\s]+/,null,` \r
`],[L,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[b,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[O,/^(?!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"]),fe(ie([],[[L,/^[\s\S]+/]]),["uq.val"]),fe(pe({keywords:g,hashComments:!0,cStyleComments:!0,types:y}),["c","cc","cpp","cxx","cyc","m"]),fe(pe({keywords:"null,true,false"}),["json"]),fe(pe({keywords:s,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:y}),["cs"]),fe(pe({keywords:c,cStyleComments:!0}),["java"]),fe(pe({keywords:t,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),fe(pe({keywords:n,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),fe(pe({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),fe(pe({keywords:r,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),fe(pe({keywords:l,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),fe(pe({keywords:i,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),fe(ie([],[[m,/^[\s\S]+/]]),["regex"]);function R(ae){var me=ae.langExtension;try{var _e=C(ae.sourceNode,ae.pre),q=_e.sourceCode;ae.sourceCode=q,ae.spans=_e.spans,ae.basePos=0,K(me,q)(ae),Ee(ae)}catch(oe){N.console&&console.log(oe&&oe.stack||oe)}}function D(ae,me,_e){var q=_e||!1,oe=me||null,ue=document.createElement("div");ue.innerHTML="<pre>"+ae+"</pre>",ue=ue.firstChild,q&&ye(ue,q,!0);var ce={langExtension:oe,numberLines:q,sourceNode:ue,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return R(ce),ue.innerHTML}function H(ae,me){var _e=me||document.body,q=_e.ownerDocument||document;function oe(X){return _e.getElementsByTagName(X)}for(var ue=[oe("pre"),oe("code"),oe("xmp")],ce=[],be=0;be<ue.length;++be)for(var Ce=0,Oe=ue[be].length;Ce<Oe;++Ce)ce.push(ue[be][Ce]);ue=null;var Ie=Date;Ie.now||(Ie={now:function(){return+new Date}});var De=0,Me=/\blang(?:uage)?-([\w.]+)(?!\S)/,de=/\bprettyprint\b/,ge=/\bprettyprinted\b/,xe=/pre|xmp/i,we=/^code$/i,Z=/^(?:pre|code|xmp)$/i,z={};function G(){for(var X=N.PR_SHOULD_USE_CONTINUATION?Ie.now()+250:Infinity;De<ce.length&&Ie.now()<X;De++){for(var Q=ce[De],Y=z,$=Q;$=$.previousSibling;){var te=$.nodeType,re=(te===7||te===8)&&$.nodeValue;if(re?!/^\??prettify\b/.test(re):te!==3||/\S/.test($.nodeValue))break;if(re){Y={},re.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Ze,We,Je){Y[We]=Je});break}}var le=Q.className;if((Y!==z||de.test(le))&&!ge.test(le)){for(var he=!1,Te=Q.parentNode;Te;Te=Te.parentNode){var Re=Te.tagName;if(Z.test(Re)&&Te.className&&de.test(Te.className)){he=!0;break}}if(!he){Q.className+=" prettyprinted";var Pe=Y.lang;if(!Pe){Pe=le.match(Me);var Ae;!Pe&&(Ae=ee(Q))&&we.test(Ae.tagName)&&(Pe=Ae.className.match(Me)),Pe&&(Pe=Pe[1])}var Ge;if(xe.test(Q.tagName))Ge=1;else{var Ne=Q.currentStyle,ke=q.defaultView,$e=Ne?Ne.whiteSpace:ke&&ke.getComputedStyle?ke.getComputedStyle(Q,null).getPropertyValue("white-space"):0;Ge=$e&&$e.substring(0,3)==="pre"}var ze=Y.linenums;(ze=ze==="true"||+ze)||(ze=le.match(/\blinenums\b(?::(\d+))?/),ze=ze?ze[1]&&ze[1].length?+ze[1]:!0:!1),ze&&ye(Q,ze,Ge);var He={langExtension:Pe,sourceNode:Q,numberLines:ze,pre:Ge,sourceCode:null,basePos:null,spans:null,decorations:null};R(He)}}}De<ce.length?N.setTimeout(G,250):typeof ae=="function"&&ae()}G()}var J=N.PR={createSimpleLexer:ie,registerLangHandler:fe,sourceDecorator:pe,PR_ATTRIB_NAME:O,PR_ATTRIB_VALUE:L,PR_COMMENT:_,PR_DECLARATION:p,PR_KEYWORD:T,PR_LITERAL:h,PR_NOCODE:x,PR_PLAIN:u,PR_PUNCTUATION:o,PR_SOURCE:d,PR_STRING:m,PR_TAG:b,PR_TYPE:f,prettyPrintOne:A?N.prettyPrintOne=D:S=D,prettyPrint:W=A?N.prettyPrint=H:W=H},M=N.define;typeof M=="function"&&M.amd&&M("google-code-prettify",[],function(){return J})})()},STEk:function(Le,se,U){"use strict";U.d(se,"a",function(){return fe});/*! *****************************************************************************
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 ne=function(K,R){return(ne=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(D,H){D.__proto__=H}||function(D,H){for(var J in H)Object.prototype.hasOwnProperty.call(H,J)&&(D[J]=H[J])})(K,R)};function B(K,R){function D(){this.constructor=K}ne(K,R),K.prototype=R===null?Object.create(R):(D.prototype=R.prototype,new D)}function A(K,R,D,H){return new(D||(D=Promise))(function(J,M){function ae(q){try{_e(H.next(q))}catch(oe){M(oe)}}function me(q){try{_e(H.throw(q))}catch(oe){M(oe)}}function _e(q){var oe;q.done?J(q.value):(oe=q.value,oe instanceof D?oe:new D(function(ue){ue(oe)})).then(ae,me)}_e((H=H.apply(K,R||[])).next())})}function j(K,R){var D,H,J,M,ae={label:0,sent:function(){if(1&J[0])throw J[1];return J[1]},trys:[],ops:[]};return M={next:me(0),throw:me(1),return:me(2)},typeof Symbol=="function"&&(M[Symbol.iterator]=function(){return this}),M;function me(_e){return function(q){return function(oe){if(D)throw new TypeError("Generator is already executing.");for(;ae;)try{if(D=1,H&&(J=2&oe[0]?H.return:oe[0]?H.throw||((J=H.return)&&J.call(H),0):H.next)&&!(J=J.call(H,oe[1])).done)return J;switch(H=0,J&&(oe=[2&oe[0],J.value]),oe[0]){case 0:case 1:J=oe;break;case 4:return ae.label++,{value:oe[1],done:!1};case 5:ae.label++,H=oe[1],oe=[0];continue;case 7:oe=ae.ops.pop(),ae.trys.pop();continue;default:if(!(J=ae.trys,(J=J.length>0&&J[J.length-1])||oe[0]!==6&&oe[0]!==2)){ae=0;continue}if(oe[0]===3&&(!J||oe[1]>J[0]&&oe[1]<J[3])){ae.label=oe[1];break}if(oe[0]===6&&ae.label<J[1]){ae.label=J[1],J=oe;break}if(J&&ae.label<J[2]){ae.label=J[2],ae.ops.push(oe);break}J[2]&&ae.ops.pop(),ae.trys.pop();continue}oe=R.call(K,ae)}catch(ue){oe=[6,ue],H=0}finally{D=J=0}if(5&oe[0])throw oe[1];return{value:oe[0]?oe[1]:void 0,done:!0}}([_e,q])}}}function P(){for(var K=0,R=0,D=arguments.length;R<D;R++)K+=arguments[R].length;var H=Array(K),J=0;for(R=0;R<D;R++)for(var M=arguments[R],ae=0,me=M.length;ae<me;ae++,J++)H[J]=M[ae];return H}var S=function(){function K(){}return K.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},K.setAttributes=function(R,D){for(var H=0,J=D;H<J.length;H++){var M=J[H],ae=M[0],me=M[1];R.setAttribute(ae,me)}},K.createRect=function(R,D,H){var J=document.createElementNS("http://www.w3.org/2000/svg","rect");return J.setAttribute("width",R.toString()),J.setAttribute("height",D.toString()),H&&K.setAttributes(J,H),J},K.createLine=function(R,D,H,J,M){var ae=document.createElementNS("http://www.w3.org/2000/svg","line");return ae.setAttribute("x1",R.toString()),ae.setAttribute("y1",D.toString()),ae.setAttribute("x2",H.toString()),ae.setAttribute("y2",J.toString()),M&&K.setAttributes(ae,M),ae},K.createPolygon=function(R,D){var H=document.createElementNS("http://www.w3.org/2000/svg","polygon");return H.setAttribute("points",R),D&&K.setAttributes(H,D),H},K.createCircle=function(R,D){var H=document.createElementNS("http://www.w3.org/2000/svg","circle");return H.setAttribute("cx",(R/2).toString()),H.setAttribute("cy",(R/2).toString()),H.setAttribute("r",R.toString()),D&&K.setAttributes(H,D),H},K.createEllipse=function(R,D,H){var J=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return J.setAttribute("cx",(R/2).toString()),J.setAttribute("cy",(D/2).toString()),J.setAttribute("rx",(R/2).toString()),J.setAttribute("ry",(D/2).toString()),H&&K.setAttributes(J,H),J},K.createGroup=function(R){var D=document.createElementNS("http://www.w3.org/2000/svg","g");return R&&K.setAttributes(D,R),D},K.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},K.createMarker=function(R,D,H,J,M,ae,me){var _e=document.createElementNS("http://www.w3.org/2000/svg","marker");return K.setAttributes(_e,[["id",R],["orient",D],["markerWidth",H.toString()],["markerHeight",J.toString()],["refX",M.toString()],["refY",ae.toString()]]),_e.appendChild(me),_e},K.createText=function(R){var D=document.createElementNS("http://www.w3.org/2000/svg","text");return D.setAttribute("x","0"),D.setAttribute("y","0"),R&&K.setAttributes(D,R),D},K.createTSpan=function(R,D){var H=document.createElementNS("http://www.w3.org/2000/svg","tspan");return H.textContent=R,D&&K.setAttributes(H,D),H},K.createImage=function(R){var D=document.createElementNS("http://www.w3.org/2000/svg","image");return R&&K.setAttributes(D,R),D},K.createPoint=function(R,D){var H=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return H.x=R,H.y=D,H},K.createPath=function(R,D){var H=document.createElementNS("http://www.w3.org/2000/svg","path");return H.setAttribute("d",R),D&&K.setAttributes(H,D),H},K}(),W=function(){function K(){}return K.addKey=function(R){K.key=R},Object.defineProperty(K,"isLicensed",{get:function(){return!!K.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(K.key)},enumerable:!1,configurable:!0}),K}(),N=function(){function K(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return K.prototype.rasterize=function(R,D,H){var J=this;return new Promise(function(M){var ae=H!==void 0?H:document.createElement("canvas");R===null&&(J.markersOnly=!0,J.naturalSize=!1);var me=document.createElementNS("http://www.w3.org/2000/svg","svg");me.setAttribute("xmlns","http://www.w3.org/2000/svg"),me.setAttribute("width",D.width.baseVal.valueAsString),me.setAttribute("height",D.height.baseVal.valueAsString),me.setAttribute("viewBox","0 0 "+D.viewBox.baseVal.width.toString()+" "+D.viewBox.baseVal.height.toString()),me.innerHTML=D.innerHTML,J.naturalSize===!0?(me.width.baseVal.value=R.naturalWidth,me.height.baseVal.value=R.naturalHeight):J.width!==void 0&&J.height!==void 0&&(me.width.baseVal.value=J.width,me.height.baseVal.value=J.height),ae.width=me.width.baseVal.value,ae.height=me.height.baseVal.value;var _e=me.outerHTML,q=ae.getContext("2d");J.markersOnly!==!0&&q.drawImage(R,0,0,ae.width,ae.height);var oe=window.URL,ue=new Image(ae.width,ae.height);ue.setAttribute("crossOrigin","anonymous");var ce=new Blob([_e],{type:"image/svg+xml"}),be=oe.createObjectURL(ce);ue.onload=function(){q.drawImage(ue,0,0),oe.revokeObjectURL(be);var Ce=ae.toDataURL(J.imageType,J.imageQuality);M(Ce)},ue.src=be})},K}(),e=function(){},w=function(){function K(R){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+R+"_"}return Object.defineProperty(K.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(K.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(K.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),K.prototype.addClass=function(R){return this.styleSheet===void 0&&this.addStyleSheet(),R.name=""+this.classNamePrefix+R.localName,this.classes.push(R),this.styleSheet.sheet.insertRule("."+R.name+" {"+R.style+"}",this.styleSheet.sheet.cssRules.length),R},K.prototype.addRule=function(R){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(R),this.styleSheet.sheet.insertRule(R.selector+" {"+R.style+"}",this.styleSheet.sheet.cssRules.length)},K.prototype.addStyleSheet=function(){var R;this.styleSheet=document.createElement("style"),((R=this.styleSheetRoot)!==null&&R!==void 0?R:document.head).appendChild(this.styleSheet),this.addRule(new v("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new v("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new v("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new g("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new g("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},K.prototype.removeStyleSheet=function(){var R;this.styleSheet&&(((R=this.styleSheetRoot)!==null&&R!==void 0?R:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},K}(),v=function(K,R){this.selector=K,this.style=R},g=function(K,R){this.localName=K,this.style=R},c=function(){function K(R,D,H,J,M){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=R,this.displayMode=D,this.markerItems=H,this.uiStyleSettings=J,this.styles=M,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return K.prototype.show=function(R){var D=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=R,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var H=document.createElement("div");H.className=this.toolbarBlockStyleClass.name,H.style.whiteSpace="nowrap",this.uiContainer.appendChild(H),this.addActionButton(H,'<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(H,'<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(H,'<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(H,'<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(H,'<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(H,'<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(H,'<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(H,'<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(M){var ae=document.createElement("div");ae.className=""+D.toolbarButtonStyleClass.name,ae.setAttribute("data-type-name",M.typeName),ae.innerHTML=M.icon,ae.addEventListener("click",function(){D.markerToolbarButtonClicked(ae,M)}),D.buttons.push(ae),D.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 J=document.createElement("div");J.className=this.toolbarBlockStyleClass.name,J.style.whiteSpace="nowrap",J.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(J),this.addActionButton(J,'<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(J,'<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()},K.prototype.addButtonClickListener=function(R){this.buttonClickListeners.push(R)},K.prototype.removeButtonClickListener=function(R){this.buttonClickListeners.indexOf(R)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(R),1)},K.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},K.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var R=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var D=0;D<this.markerButtons.length;D++)D<R||D===R&&this.markerButtons.length-1===R?this.markerButtonBlock.appendChild(this.markerButtons[D]):(D===R&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[D]))}},K.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")},K.prototype.resetButtonStyles=function(){var R=this;this.buttons.forEach(function(D){D.className=D.className.replace(R.uiStyleSettings.toolbarButtonStyleColorsClassName?R.uiStyleSettings.toolbarButtonStyleColorsClassName:R.toolbarButtonStyleColorsClass.name,"").trim(),D.className=D.className.replace(R.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?R.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:R.toolbarActiveButtonStyleColorsClass.name,"").trim(),D.className+=" "+(R.uiStyleSettings.toolbarButtonStyleColorsClassName?R.uiStyleSettings.toolbarButtonStyleColorsClassName:R.toolbarButtonStyleColorsClass.name)})},K.prototype.addActionButton=function(R,D,H){var J=this,M=document.createElement("div");switch(M.className=""+this.toolbarButtonStyleClass.name,M.innerHTML=D,M.setAttribute("data-action",H),M.addEventListener("click",function(){J.actionToolbarButtonClicked(M,H)}),H){case"select":M.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":M.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":M.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":M.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":M.style.fill=this.uiStyleSettings.closeButtonColor}R.appendChild(M),this.buttons.push(M)},K.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new g("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 g("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new g("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new g("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 g("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var R=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new g("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*R)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*R)+`px;
padding: `+R+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new g("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new g("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new v("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new v("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},K.prototype.markerToolbarButtonClicked=function(R,D){this.setActiveButton(R),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(H){return H("marker",D)}),this.markerButtonOverflowBlock.style.display="none"},K.prototype.actionToolbarButtonClicked=function(R,D){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(H){return H("action",D)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},K.prototype.setActiveButton=function(R){this.resetButtonStyles(),R.className=R.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),R.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},K.prototype.setActiveMarkerButton=function(R){var D=this.markerButtons.find(function(H){return H.getAttribute("data-type-name")===R});D&&this.setActiveButton(D)},K.prototype.setCurrentMarker=function(R){var D=this;this.currentMarker=R,this.buttons.filter(function(H){return/delete|notes/.test(H.getAttribute("data-action"))}).forEach(function(H){D.currentMarker===void 0?(H.style.fillOpacity="0.4",H.style.pointerEvents="none"):(H.style.fillOpacity="1",H.style.pointerEvents="all")})},K}(),s=function(){function K(R,D,H,J){this.panels=[],this.panelButtons=[],this.markerjsContainer=R,this.displayMode=D,this.uiStyleSettings=H,this.styles=J,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return K.prototype.addStyles=function(){var R;this.toolboxStyleClass=this.styles.addClass(new g("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 g("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var D=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new g("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new g("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new g("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 g("toolbox-panel-row_colors",`
background-color: `+((R=this.uiStyleSettings.toolboxBackgroundColor)!==null&&R!==void 0?R:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new g("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*D)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*D)+`px;
padding: `+D+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new g("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new g("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new v("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new v("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},K.prototype.show=function(R){var D;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=R,this.uiContainer.className=this.toolboxStyleClass.name+" "+((D=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&D!==void 0?D:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},K.prototype.setPanelButtons=function(R){var D,H,J=this;this.panels=R,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((D=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&D!==void 0?D:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((H=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&H!==void 0?H:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(M){var ae;M.uiStyleSettings=J.uiStyleSettings;var me=document.createElement("div");me.className=J.toolboxButtonStyleClass.name+" "+((ae=J.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ae!==void 0?ae:J.toolboxButtonStyleColorsClass.name),me.innerHTML=M.icon,me.title=M.title,me.addEventListener("click",function(){J.panelButtonClick(M)}),J.panelButtons.push(me),J.buttonRow.appendChild(me)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},K.prototype.panelButtonClick=function(R){var D=this,H=-1;if(R!==this.activePanel){H=this.panels.indexOf(R),this.panelRow.innerHTML="";var J=R.getUi();J.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(J),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=R}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){D.displayMode==="inline"?D.panelRow.style.display="none":D.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(M,ae){var me,_e;M.className=D.toolboxButtonStyleClass.name+" "+(ae===H?""+((me=D.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&me!==void 0?me:D.toolboxActiveButtonStyleColorsClass.name):""+((_e=D.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&_e!==void 0?_e:D.toolboxButtonStyleColorsClass.name))})},K}(),i=function(K,R){this.title=K,this.icon=R},l=function(K){function R(D,H,J,M){var ae=K.call(this,D,M||'<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=H,ae.currentColor=J,ae.setCurrentColor=ae.setCurrentColor.bind(ae),ae.getColorBox=ae.getColorBox.bind(ae),ae}return B(R,K),R.prototype.getUi=function(){var D=this,H=document.createElement("div");return H.style.overflow="hidden",H.style.whiteSpace="nowrap",this.colors.forEach(function(J){var M=D.getColorBox(J);H.appendChild(M),D.colorBoxes.push(M)}),H},R.prototype.getColorBox=function(D){var H=this,J=this.uiStyleSettings.toolbarHeight/4,M=this.uiStyleSettings.toolbarHeight-J,ae=document.createElement("div");ae.style.display="inline-block",ae.style.boxSizing="content-box",ae.style.width=M-2+"px",ae.style.height=M-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=(M+2)/2+"px",ae.style.borderColor=D===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ae.addEventListener("click",function(){H.setCurrentColor(D,ae)});var me=document.createElement("div");return me.style.display="inline-block",me.style.width=M-2+"px",me.style.height=M-2+"px",me.style.backgroundColor=D,me.style.borderRadius=M/2+"px",D==="transparent"&&(me.style.fill=this.uiStyleSettings.toolboxAccentColor,me.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(me),ae},R.prototype.setCurrentColor=function(D,H){var J=this;this.currentColor=D,this.colorBoxes.forEach(function(M){M.style.borderColor=M===H?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(D)},R}(i),a=function(){function K(R,D,H){this._state="new",this._isSelected=!1,this._container=R,this._overlayContainer=D,this.globalSettings=H,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(K.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),K.prototype.ownsTarget=function(R){return!1},Object.defineProperty(K.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),K.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},K.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},K.prototype.pointerDown=function(R,D){},K.prototype.dblClick=function(R,D){},K.prototype.manipulate=function(R){},K.prototype.pointerUp=function(R){this.stateChanged()},K.prototype.dispose=function(){},K.prototype.addMarkerVisualToContainer=function(R){this.container.childNodes.length>0?this.container.insertBefore(R,this.container.childNodes[0]):this.container.appendChild(R)},K.prototype.getState=function(){return{typeName:K.typeName,state:this.state,notes:this.notes}},K.prototype.restoreState=function(R){this._state=R.state,this.notes=R.notes},K.prototype.scale=function(R,D){},K.prototype.colorChanged=function(R){this.onColorChanged&&this.onColorChanged(R),this.stateChanged()},K.prototype.fillColorChanged=function(R){this.onFillColorChanged&&this.onFillColorChanged(R),this.stateChanged()},K.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var R=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),R.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(R)&&this.onStateChanged(this)}},K.typeName="MarkerBase",K}(),n=function(){function K(){this.findGripByVisual=this.findGripByVisual.bind(this)}return K.prototype.findGripByVisual=function(R){return this.topLeft.ownsTarget(R)?this.topLeft:this.topCenter.ownsTarget(R)?this.topCenter:this.topRight.ownsTarget(R)?this.topRight:this.centerLeft.ownsTarget(R)?this.centerLeft:this.centerRight.ownsTarget(R)?this.centerRight:this.bottomLeft.ownsTarget(R)?this.bottomLeft:this.bottomCenter.ownsTarget(R)?this.bottomCenter:this.bottomRight.ownsTarget(R)?this.bottomRight:void 0},K}(),r=function(){function K(){this.GRIP_SIZE=10,this.visual=S.createGroup(),this.visual.appendChild(S.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(S.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return K.prototype.ownsTarget=function(R){return R===this.visual||R===this.visual.childNodes[0]||R===this.visual.childNodes[1]},K}(),t=function(){function K(){}return K.toITransformMatrix=function(R){return{a:R.a,b:R.b,c:R.c,d:R.d,e:R.e,f:R.f}},K.toSVGMatrix=function(R,D){return R.a=D.a,R.b=D.b,R.c=D.c,R.d=D.d,R.e=D.e,R.f=D.f,R},K}(),E=function(K){function R(D,H,J){var M=K.call(this,D,H,J)||this;return M.left=0,M.top=0,M.width=0,M.height=0,M.defaultSize={x:50,y:20},M.offsetX=0,M.offsetY=0,M.rotationAngle=0,M.CB_DISTANCE=10,M._suppressMarkerCreateEvent=!1,M.container.transform.baseVal.appendItem(S.createTransform()),M.setupControlBox(),M}return B(R,K),Object.defineProperty(R.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(R.prototype,"visual",{get:function(){return this._visual},set:function(D){this._visual=D;var H=S.createTransform();this._visual.transform.baseVal.appendItem(H)},enumerable:!1,configurable:!0}),R.prototype.ownsTarget=function(D){return!!K.prototype.ownsTarget.call(this,D)||!!(this.controlGrips.findGripByVisual(D)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(D))},R.prototype.pointerDown=function(D,H){K.prototype.pointerDown.call(this,D,H),this.state==="new"&&(this.left=D.x,this.top=D.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var J=this.unrotatePoint(D);if(this.manipulationStartX=J.x,this.manipulationStartY=J.y,this.offsetX=J.x-this.left,this.offsetY=J.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(H),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(H)){this.activeGrip=this.rotatorGrip;var M=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=M.x-this.width/2,this.top=M.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"},R.prototype.pointerUp=function(D){var H=this.state;K.prototype.pointerUp.call(this,D),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(D),this._state="select",H==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},R.prototype.moveVisual=function(D){this.visual.style.transform="translate("+D.x+"px, "+D.y+"px)"},R.prototype.manipulate=function(D){var H=this.unrotatePoint(D);this.state==="creating"?this.resize(D):this.state==="move"?(this.left=this.manipulationStartLeft+(H.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(H.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(H):this.state==="rotate"&&this.rotate(D)},R.prototype.resize=function(D){var H=this.manipulationStartLeft,J=this.manipulationStartWidth,M=this.manipulationStartTop,ae=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:H=this.manipulationStartLeft+D.x-this.manipulationStartX,J=this.manipulationStartWidth+this.manipulationStartLeft-H;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:J=this.manipulationStartWidth+D.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:M=this.manipulationStartTop+D.y-this.manipulationStartY,ae=this.manipulationStartHeight+this.manipulationStartTop-M;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ae=this.manipulationStartHeight+D.y-this.manipulationStartY}J>=0?(this.left=H,this.width=J):(this.left=H+J,this.width=-J),ae>=0?(this.top=M,this.height=ae):(this.top=M+ae,this.height=-ae),this.setSize()},R.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},R.prototype.rotate=function(D){if(Math.abs(D.x-this.centerX)>.1){var H=Math.sign(D.x-this.centerX);this.rotationAngle=180*Math.atan((D.y-this.centerY)/(D.x-this.centerX))/Math.PI+90*H,this.applyRotation()}},R.prototype.applyRotation=function(){var D=this.container.transform.baseVal.getItem(0);D.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(D,0)},R.prototype.rotatePoint=function(D){if(this.rotationAngle===0)return D;var H=this.container.getCTM(),J=S.createPoint(D.x,D.y);return{x:(J=J.matrixTransform(H)).x,y:J.y}},R.prototype.unrotatePoint=function(D){if(this.rotationAngle===0)return D;var H=this.container.getCTM();H=H.inverse();var J=S.createPoint(D.x,D.y);return{x:(J=J.matrixTransform(H)).x,y:J.y}},R.prototype.select=function(){K.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},R.prototype.deselect=function(){K.prototype.deselect.call(this),this.controlBox.style.display="none"},R.prototype.setupControlBox=function(){this.controlBox=S.createGroup();var D=S.createTransform();D.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(D),this.container.appendChild(this.controlBox),this.controlRect=S.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=S.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 n,this.addControlGrips(),this.controlBox.style.display="none"},R.prototype.adjustControlBox=function(){var D=this.controlBox.transform.baseVal.getItem(0);D.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(D,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},R.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},R.prototype.createGrip=function(){var D=new r;return D.visual.transform.baseVal.appendItem(S.createTransform()),this.controlBox.appendChild(D.visual),D},R.prototype.positionGrips=function(){var D=this.controlGrips.topLeft.GRIP_SIZE,H=-D/2,J=H,M=(this.width+this.CB_DISTANCE)/2-D/2,ae=(this.height+this.CB_DISTANCE)/2-D/2,me=this.height+this.CB_DISTANCE-D/2,_e=this.width+this.CB_DISTANCE-D/2;this.positionGrip(this.controlGrips.topLeft.visual,H,J),this.positionGrip(this.controlGrips.topCenter.visual,M,J),this.positionGrip(this.controlGrips.topRight.visual,_e,J),this.positionGrip(this.controlGrips.centerLeft.visual,H,ae),this.positionGrip(this.controlGrips.centerRight.visual,_e,ae),this.positionGrip(this.controlGrips.bottomLeft.visual,H,me),this.positionGrip(this.controlGrips.bottomCenter.visual,M,me),this.positionGrip(this.controlGrips.bottomRight.visual,_e,me),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,M,J-3*this.CB_DISTANCE)},R.prototype.positionGrip=function(D,H,J){var M=D.transform.baseVal.getItem(0);M.setTranslate(H,J),D.transform.baseVal.replaceItem(M,0)},R.prototype.hideControlBox=function(){this.controlBox.style.display="none"},R.prototype.showControlBox=function(){this.controlBox.style.display=""},R.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:t.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:t.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},K.prototype.getState.call(this))},R.prototype.restoreState=function(D){K.prototype.restoreState.call(this,D);var H=D;this.left=H.left,this.top=H.top,this.width=H.width,this.height=H.height,this.rotationAngle=H.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(t.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,H.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(t.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,H.containerTransformMatrix))},R.prototype.scale=function(D,H){K.prototype.scale.call(this,D,H);var J=this.rotatePoint({x:this.left,y:this.top}),M=this.unrotatePoint({x:J.x*D,y:J.y*H});this.left=M.x,this.top=M.y,this.width=this.width*D,this.height=this.height*H,this.adjustControlBox()},R}(a),y=function(K){function R(D,H,J){var M=K.call(this,D,H,J)||this;return M.fillColor="transparent",M.strokeColor="transparent",M.strokeWidth=0,M.strokeDasharray="",M.opacity=1,M.setStrokeColor=M.setStrokeColor.bind(M),M.setFillColor=M.setFillColor.bind(M),M.setStrokeWidth=M.setStrokeWidth.bind(M),M.setStrokeDasharray=M.setStrokeDasharray.bind(M),M.createVisual=M.createVisual.bind(M),M}return B(R,K),R.prototype.ownsTarget=function(D){return!(!K.prototype.ownsTarget.call(this,D)&&D!==this.visual)},R.prototype.createVisual=function(){this.visual=S.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},R.prototype.pointerDown=function(D,H){K.prototype.pointerDown.call(this,D,H),this.state==="new"&&(this.createVisual(),this.moveVisual(D),this._state="creating")},R.prototype.manipulate=function(D){K.prototype.manipulate.call(this,D)},R.prototype.resize=function(D){K.prototype.resize.call(this,D),this.setSize()},R.prototype.setSize=function(){K.prototype.setSize.call(this),S.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},R.prototype.pointerUp=function(D){K.prototype.pointerUp.call(this,D),this.setSize()},R.prototype.setStrokeColor=function(D){this.strokeColor=D,this.visual&&S.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(D),this.stateChanged()},R.prototype.setFillColor=function(D){this.fillColor=D,this.visual&&S.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},R.prototype.setStrokeWidth=function(D){this.strokeWidth=D,this.visual&&S.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},R.prototype.setStrokeDasharray=function(D){this.strokeDasharray=D,this.visual&&S.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},R.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},K.prototype.getState.call(this))},R.prototype.restoreState=function(D){var H=D;this.fillColor=H.fillColor,this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.opacity=H.opacity,this.createVisual(),K.prototype.restoreState.call(this,D),this.setSize()},R.prototype.scale=function(D,H){K.prototype.scale.call(this,D,H),this.setSize()},R.title="Rectangle marker",R}(E),m=function(K){function R(D,H,J,M){var ae=K.call(this,D,M||'<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=H,ae.currentWidth=J,ae.setCurrentWidth=ae.setCurrentWidth.bind(ae),ae}return B(R,K),R.prototype.getUi=function(){var D=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2",this.widths.forEach(function(J){var M=document.createElement("div");M.style.display="flex",M.style.flexGrow="2",M.style.alignItems="center",M.style.justifyContent="space-between",M.style.padding="5px",M.style.borderWidth="2px",M.style.borderStyle="solid",M.style.borderColor=J===D.currentWidth?D.uiStyleSettings.toolboxAccentColor:"transparent",M.addEventListener("click",function(){D.setCurrentWidth(J,M)}),H.appendChild(M);var ae=document.createElement("div");ae.innerText=J.toString(),ae.style.marginRight="5px",M.appendChild(ae);var me=document.createElement("div");me.style.minHeight="20px",me.style.flexGrow="2",me.style.display="flex",me.style.alignItems="center";var _e=document.createElement("hr");_e.style.minWidth="20px",_e.style.border="0px",_e.style.borderTop=J+"px solid "+D.uiStyleSettings.toolboxColor,_e.style.flexGrow="2",me.appendChild(_e),M.appendChild(me),D.widthBoxes.push(M)}),H},R.prototype.setCurrentWidth=function(D,H){var J=this;this.currentWidth=D,this.widthBoxes.forEach(function(M){M.style.borderColor=M===H?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},R}(i),T=function(K){function R(D,H,J,M){var ae=K.call(this,D,M||'<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=H,ae.currentStyle=J,ae.setCurrentStyle=ae.setCurrentStyle.bind(ae),ae}return B(R,K),R.prototype.getUi=function(){var D=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2",this.styles.forEach(function(J){var M=document.createElement("div");M.style.display="flex",M.style.alignItems="center",M.style.justifyContent="space-between",M.style.padding="5px",M.style.borderWidth="2px",M.style.borderStyle="solid",M.style.overflow="hidden",M.style.maxWidth=100/D.styles.length-5+"%",M.style.borderColor=J===D.currentStyle?D.uiStyleSettings.toolboxAccentColor:"transparent",M.addEventListener("click",function(){D.setCurrentStyle(J,M)}),H.appendChild(M);var ae=document.createElement("div");ae.style.minHeight="20px",ae.style.flexGrow="2",ae.style.overflow="hidden";var me=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+D.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(J!==""?'stroke-dasharray="'+J+'"':"")+` />
</svg>`;ae.innerHTML=me,M.appendChild(ae),D.styleBoxes.push(M)}),H},R.prototype.setCurrentStyle=function(D,H){var J=this;this.currentStyle=D,this.styleBoxes.forEach(function(M){M.style.borderColor=M===H?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},R}(i),_=function(K){function R(D,H,J){var M=K.call(this,D,H,J)||this;return M.strokeColor=J.defaultColor,M.strokeWidth=J.defaultStrokeWidth,M.strokeDasharray=J.defaultStrokeDasharray,M.strokePanel=new l("Line color",J.defaultColorSet,J.defaultColor),M.strokePanel.onColorChanged=M.setStrokeColor,M.strokeWidthPanel=new m("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),M.strokeWidthPanel.onWidthChanged=M.setStrokeWidth,M.strokeStylePanel=new T("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),M.strokeStylePanel.onStyleChanged=M.setStrokeDasharray,M}return B(R,K),Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var D=K.prototype.getState.call(this);return D.typeName=R.typeName,D},R.typeName="FrameMarker",R.title="Frame marker",R.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',R}(y),f=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},h=function(K){function R(D,H,J){var M=K.call(this,D,H,J)||this;return M.x1=0,M.y1=0,M.x2=0,M.y2=0,M.defaultLength=50,M.manipulationStartX=0,M.manipulationStartY=0,M.manipulationStartX1=0,M.manipulationStartY1=0,M.manipulationStartX2=0,M.manipulationStartY2=0,M.setupControlBox(),M}return B(R,K),R.prototype.ownsTarget=function(D){return!!K.prototype.ownsTarget.call(this,D)||!(!this.grip1.ownsTarget(D)&&!this.grip2.ownsTarget(D))},R.prototype.pointerDown=function(D,H){K.prototype.pointerDown.call(this,D,H),this.manipulationStartX=D.x,this.manipulationStartY=D.y,this.state==="new"&&(this.x1=D.x,this.y1=D.y,this.x2=D.x,this.y2=D.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(H)?this.activeGrip=this.grip1:this.grip2.ownsTarget(H)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},R.prototype.pointerUp=function(D){var H=this.state;K.prototype.pointerUp.call(this,D),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(D),this._state="select",H==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},R.prototype.adjustVisual=function(){},R.prototype.manipulate=function(D){this.state==="creating"?this.resize(D):this.state==="move"?(this.x1=this.manipulationStartX1+D.x-this.manipulationStartX,this.y1=this.manipulationStartY1+D.y-this.manipulationStartY,this.x2=this.manipulationStartX2+D.x-this.manipulationStartX,this.y2=this.manipulationStartY2+D.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(D)},R.prototype.resize=function(D){switch(this.activeGrip){case this.grip1:this.x1=D.x,this.y1=D.y;break;case this.grip2:case void 0:this.x2=D.x,this.y2=D.y}this.adjustVisual(),this.adjustControlBox()},R.prototype.select=function(){K.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},R.prototype.deselect=function(){K.prototype.deselect.call(this),this.controlBox.style.display="none"},R.prototype.setupControlBox=function(){this.controlBox=S.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},R.prototype.adjustControlBox=function(){this.positionGrips()},R.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},R.prototype.createGrip=function(){var D=new r;return D.visual.transform.baseVal.appendItem(S.createTransform()),this.controlBox.appendChild(D.visual),D},R.prototype.positionGrips=function(){var D=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-D/2,this.y1-D/2),this.positionGrip(this.grip2.visual,this.x2-D/2,this.y2-D/2)},R.prototype.positionGrip=function(D,H,J){var M=D.transform.baseVal.getItem(0);M.setTranslate(H,J),D.transform.baseVal.replaceItem(M,0)},R.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},K.prototype.getState.call(this))},R.prototype.restoreState=function(D){K.prototype.restoreState.call(this,D);var H=D;this.x1=H.x1,this.y1=H.y1,this.x2=H.x2,this.y2=H.y2},R.prototype.scale=function(D,H){K.prototype.scale.call(this,D,H),this.x1=this.x1*D,this.y1=this.y1*H,this.x2=this.x2*D,this.y2=this.y2*H,this.adjustVisual(),this.adjustControlBox()},R}(a),o=function(K){function R(D,H,J){var M=K.call(this,D,H,J)||this;return M.strokeColor="transparent",M.strokeWidth=0,M.strokeDasharray="",M.setStrokeColor=M.setStrokeColor.bind(M),M.setStrokeWidth=M.setStrokeWidth.bind(M),M.setStrokeDasharray=M.setStrokeDasharray.bind(M),M.strokeColor=J.defaultColor,M.strokeWidth=J.defaultStrokeWidth,M.strokeDasharray=J.defaultStrokeDasharray,M.strokePanel=new l("Line color",J.defaultColorSet,J.defaultColor),M.strokePanel.onColorChanged=M.setStrokeColor,M.strokeWidthPanel=new m("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),M.strokeWidthPanel.onWidthChanged=M.setStrokeWidth,M.strokeStylePanel=new T("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),M.strokeStylePanel.onStyleChanged=M.setStrokeDasharray,M}return B(R,K),R.prototype.ownsTarget=function(D){return!(!K.prototype.ownsTarget.call(this,D)&&D!==this.visual&&D!==this.selectorLine&&D!==this.visibleLine)},R.prototype.createVisual=function(){this.visual=S.createGroup(),this.selectorLine=S.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=S.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},R.prototype.pointerDown=function(D,H){K.prototype.pointerDown.call(this,D,H),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},R.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),S.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),S.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),S.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},R.prototype.setStrokeColor=function(D){this.strokeColor=D,this.adjustVisual(),this.colorChanged(D)},R.prototype.setStrokeWidth=function(D){this.strokeWidth=D,this.adjustVisual()},R.prototype.setStrokeDasharray=function(D){this.strokeDasharray=D,this.adjustVisual(),this.stateChanged()},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var D=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},K.prototype.getState.call(this));return D.typeName=R.typeName,D},R.prototype.restoreState=function(D){K.prototype.restoreState.call(this,D);var H=D;this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.createVisual(),this.adjustVisual()},R.typeName="LineMarker",R.title="Line marker",R.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',R}(h),u=function(K){function R(D,H,J,M){var ae=K.call(this,D,M||'<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=H,ae.currentFont=J,ae.setCurrentFont=ae.setCurrentFont.bind(ae),ae}return B(R,K),R.prototype.getUi=function(){var D=this,H=document.createElement("div");return H.style.overflow="hidden",H.style.flexGrow="2",this.fonts.forEach(function(J){var M=document.createElement("div");M.style.display="inline-block",M.style.alignItems="center",M.style.justifyContent="space-between",M.style.padding="5px",M.style.borderWidth="2px",M.style.borderStyle="solid",M.style.overflow="hidden",M.style.maxWidth=100/D.fonts.length-5+"%",M.style.borderColor=J===D.currentFont?D.uiStyleSettings.toolboxAccentColor:"transparent",M.addEventListener("click",function(){D.setCurrentFont(J,M)}),H.appendChild(M);var ae=document.createElement("div");ae.style.display="flex",ae.style.minHeight="20px",ae.style.flexGrow="2",ae.style.fontFamily=J,ae.style.overflow="hidden";var me=document.createElement("div");me.style.whiteSpace="nowrap",me.style.overflow="hidden",me.style.textOverflow="ellipsis",me.innerHTML="The quick brown fox jumps over the lazy dog",ae.appendChild(me),M.appendChild(ae),D.fontBoxes.push(M)}),H},R.prototype.setCurrentFont=function(D,H){var J=this;this.currentFont=D,this.fontBoxes.forEach(function(M){M.style.borderColor=M===H?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},R}(i),b=function(K){function R(D,H,J){var M=K.call(this,D,H,J)||this;return M.color="transparent",M.padding=5,M.DEFAULT_TEXT="your text here",M.text=M.DEFAULT_TEXT,M.isMoved=!1,M.color=J.defaultColor,M.fontFamily=J.defaultFontFamily,M.defaultSize={x:100,y:30},M.setColor=M.setColor.bind(M),M.setFont=M.setFont.bind(M),M.renderText=M.renderText.bind(M),M.sizeText=M.sizeText.bind(M),M.textEditDivClicked=M.textEditDivClicked.bind(M),M.showTextEditor=M.showTextEditor.bind(M),M.setSize=M.setSize.bind(M),M.positionTextEditor=M.positionTextEditor.bind(M),M.colorPanel=new l("Color",J.defaultColorSet,J.defaultColor),M.colorPanel.onColorChanged=M.setColor,M.fontFamilyPanel=new u("Font",J.defaultFontFamilies,J.defaultFontFamily),M.fontFamilyPanel.onFontChanged=M.setFont,M}return B(R,K),R.prototype.ownsTarget=function(D){if(K.prototype.ownsTarget.call(this,D)||D===this.visual||D===this.textElement||D===this.bgRectangle)return!0;var H=!1;return this.textElement.childNodes.forEach(function(J){J===D&&(H=!0)}),H},R.prototype.createVisual=function(){this.visual=S.createGroup(),this.bgRectangle=S.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=S.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(S.createTransform()),this.textElement.transform.baseVal.appendItem(S.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},R.prototype.pointerDown=function(D,H){K.prototype.pointerDown.call(this,D,H),this.isMoved=!1,this.pointerDownPoint=D,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(D),this._state="creating")},R.prototype.renderText=function(){var D=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(H){D.textElement.appendChild(S.createTSpan(H.trim()===""?" ":H.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},R.prototype.getTextScale=function(){var D=this.textElement.getBBox(),H=1;if(D.width>0&&D.height>0){var J=(1*this.width-this.width*this.padding*2/100)/D.width,M=(1*this.height-this.height*this.padding*2/100)/D.height;H=Math.min(J,M)}return H},R.prototype.getTextPosition=function(D){var H=this.textElement.getBBox(),J=0,M=0;return H.width>0&&H.height>0&&(J=(this.width-H.width*D)/2,M=this.height/2-H.height*D/2),{x:J,y:M}},R.prototype.sizeText=function(){var D=this.textElement.getBBox(),H=this.getTextScale(),J=this.getTextPosition(H);J.y-=D.y*H,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+J.x+"px, "+J.y+"px) scale("+H+", "+H+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(J.x,J.y),this.textElement.transform.baseVal.getItem(1).setScale(H,H))},R.prototype.manipulate=function(D){K.prototype.manipulate.call(this,D),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(D.x-this.pointerDownPoint.x)>5||Math.abs(D.y-this.pointerDownPoint.y)>5)},R.prototype.resize=function(D){K.prototype.resize.call(this,D),this.isMoved=!0,this.setSize(),this.sizeText()},R.prototype.setSize=function(){K.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(S.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),S.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},R.prototype.pointerUp=function(D){var H=this.state;H==="creating"&&(this._suppressMarkerCreateEvent=!0),K.prototype.pointerUp.call(this,D),this.setSize(),(H==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},R.prototype.showTextEditor=function(){var D=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(H){H.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var H=Number.parseFloat(D.textEditor.style.fontSize);D.textEditor.clientWidth>=Number.parseInt(D.textEditor.style.maxWidth)&&H>.9;)H-=.1,D.textEditor.style.fontSize=Math.max(H,.9)+"em"}),this.textEditor.addEventListener("keyup",function(H){H.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(H){if(H.clipboardData){var J=H.clipboardData.getData("text"),M=window.getSelection();if(!M.rangeCount)return!1;M.deleteFromDocument(),M.getRangeAt(0).insertNode(document.createTextNode(J)),H.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){D.textEditDivClicked(D.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},R.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var D=this.getTextScale(),H=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),J=this.textElement.getBBox(),M={x:J.width*D,y:J.height*D};H.x-=M.x/2,H.y-=M.y/2,this.textEditor.style.top=H.y+"px",this.textEditor.style.left=H.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-H.x+"px",this.textEditor.style.fontSize=Math.max(16*D,12)+"px",this.textElement.style.display="none"}},R.prototype.textEditDivClicked=function(D){this.text=D.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},R.prototype.select=function(){K.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},R.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),K.prototype.deselect.call(this)},R.prototype.dblClick=function(D,H){K.prototype.dblClick.call(this,D,H),this.showTextEditor()},R.prototype.setColor=function(D){this.textElement&&S.setAttributes(this.textElement,[["fill",D]]),this.color=D,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(D)},R.prototype.setFont=function(D){this.textElement&&S.setAttributes(this.textElement,[["font-family",D]]),this.fontFamily=D,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},R.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},R.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var D=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},K.prototype.getState.call(this));return D.typeName=R.typeName,D},R.prototype.restoreState=function(D){var H=D;this.color=H.color,this.fontFamily=H.fontFamily,this.padding=H.padding,this.text=H.text,this.createVisual(),K.prototype.restoreState.call(this,D),this.setSize()},R.prototype.scale=function(D,H){K.prototype.scale.call(this,D,H),this.setSize(),this.sizeText(),this.positionTextEditor()},R.typeName="TextMarker",R.title="Text marker",R.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',R}(E),p=function(K){function R(D,H,J){var M=K.call(this,D,H,J)||this;return M.color="transparent",M.lineWidth=3,M.drawing=!1,M.pixelRatio=1,M.color=J.defaultColor,M.lineWidth=J.defaultStrokeWidth,M.pixelRatio=J.freehandPixelRatio,M.setColor=M.setColor.bind(M),M.addCanvas=M.addCanvas.bind(M),M.finishCreation=M.finishCreation.bind(M),M.setLineWidth=M.setLineWidth.bind(M),M.colorPanel=new l("Color",J.defaultColorSet,J.defaultColor),M.colorPanel.onColorChanged=M.setColor,M.lineWidthPanel=new m("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),M.lineWidthPanel.onWidthChanged=M.setLineWidth,M}return B(R,K),R.prototype.ownsTarget=function(D){return!(!K.prototype.ownsTarget.call(this,D)&&D!==this.visual&&D!==this.drawingImage)},R.prototype.createVisual=function(){this.visual=S.createGroup(),this.drawingImage=S.createImage(),this.visual.appendChild(this.drawingImage);var D=S.createTransform();this.visual.transform.baseVal.appendItem(D),this.addMarkerVisualToContainer(this.visual)},R.prototype.pointerDown=function(D,H){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(D.x,D.y),this.drawing=!0):K.prototype.pointerDown.call(this,D,H)},R.prototype.manipulate=function(D){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(D.x,D.y),this.canvasContext.stroke()):K.prototype.manipulate.call(this,D)},R.prototype.resize=function(D){K.prototype.resize.call(this,D),S.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),S.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},R.prototype.pointerUp=function(D){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):K.prototype.pointerUp.call(this,D)},R.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},R.prototype.select=function(){this.state==="creating"&&this.finishCreation(),K.prototype.select.call(this)},R.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),K.prototype.deselect.call(this)},R.prototype.finishCreation=function(){for(var D=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),H=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],J=H[0],M=H[1],ae=H[2],me=H[3],_e=!1,q=0;q<this.canvasElement.height;q++)for(var oe=0;oe<this.canvasElement.width;oe++)D.data[q*this.canvasElement.width*4+4*oe+3]>0&&(_e=!0,q<M&&(M=q),oe<J&&(J=oe),q>me&&(me=q),oe>ae&&(ae=oe));if(_e){this.left=J/this.pixelRatio,this.top=M/this.pixelRatio,this.width=(ae-J)/this.pixelRatio,this.height=(me-M)/this.pixelRatio;var ue=document.createElement("canvas");ue.width=ae-J,ue.height=me-M,ue.getContext("2d").putImageData(this.canvasContext.getImageData(J,M,ae-J,me-M),0,0),this.drawingImgUrl=ue.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},R.prototype.setDrawingImage=function(){S.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),S.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},R.prototype.setColor=function(D){this.color=D,this.colorChanged(D)},R.prototype.setLineWidth=function(D){this.lineWidth=D},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var D=Object.assign({drawingImgUrl:this.drawingImgUrl},K.prototype.getState.call(this));return D.typeName=R.typeName,D},R.prototype.restoreState=function(D){this.createVisual(),K.prototype.restoreState.call(this,D),this.drawingImgUrl=D.drawingImgUrl,this.setDrawingImage()},R.prototype.scale=function(D,H){K.prototype.scale.call(this,D,H),this.setDrawingImage()},R.typeName="FreehandMarker",R.title="Freehand marker",R.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',R}(E),d=function(K){function R(D,H,J){var M=K.call(this,D,J||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return M.typeBoxes=[],M.currentType=H,M.setCurrentType=M.setCurrentType.bind(M),M}return B(R,K),R.prototype.getUi=function(){var D=this,H=document.createElement("div");H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2";for(var J=function(me){var _e="both";switch(me){case 0:_e="both";break;case 1:_e="start";break;case 2:_e="end";break;case 3:_e="none"}var q=document.createElement("div");if(q.style.display="flex",q.style.flexGrow="2",q.style.alignItems="center",q.style.justifyContent="space-between",q.style.padding="5px",q.style.borderWidth="2px",q.style.borderStyle="solid",q.style.borderColor=_e===M.currentType?M.uiStyleSettings.toolboxAccentColor:"transparent",q.addEventListener("click",function(){D.setCurrentType(_e,q)}),H.appendChild(q),_e==="both"||_e==="start"){var oe=document.createElement("div");oe.style.display="flex",oe.style.alignItems="center",oe.style.minHeight="20px",oe.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="`+(M.uiStyleSettings!==void 0?M.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,oe.style.marginLeft="5px",q.appendChild(oe)}var ue=document.createElement("div");ue.style.display="flex",ue.style.alignItems="center",ue.style.minHeight="20px",ue.style.flexGrow="2";var ce=document.createElement("hr");if(ce.style.minWidth="20px",ce.style.border="0px",ce.style.borderTop="3px solid "+(M.uiStyleSettings!==void 0?M.uiStyleSettings.toolboxColor:"#eeeeee"),ce.style.flexGrow="2",ue.appendChild(ce),q.appendChild(ue),_e==="both"||_e==="end"){var be=document.createElement("div");be.style.display="flex",be.style.alignItems="center",be.style.minHeight="20px",be.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="`+(M.uiStyleSettings!==void 0?M.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,be.style.marginRight="5px",q.appendChild(be)}M.typeBoxes.push(q)},M=this,ae=0;ae<4;ae++)J(ae);return H},R.prototype.setCurrentType=function(D,H){var J=this;this.currentType=D,this.typeBoxes.forEach(function(M){M.style.borderColor=M===H?J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},R}(i),O=function(K){function R(D,H,J){var M=K.call(this,D,H,J)||this;return M.arrowType="end",M.arrowBaseHeight=10,M.arrowBaseWidth=10,M.getArrowPoints=M.getArrowPoints.bind(M),M.setArrowType=M.setArrowType.bind(M),M.arrowTypePanel=new d("Arrow type","end"),M.arrowTypePanel.onArrowTypeChanged=M.setArrowType,M}return B(R,K),R.prototype.ownsTarget=function(D){return!(!K.prototype.ownsTarget.call(this,D)&&D!==this.arrow1&&D!==this.arrow2)},R.prototype.getArrowPoints=function(D,H){var J=this.arrowBaseWidth+2*this.strokeWidth,M=this.arrowBaseHeight+2*this.strokeWidth;return D-J/2+","+(H+M/2)+" "+D+","+(H-M/2)+" "+(D+J/2)+","+(H+M/2)},R.prototype.createTips=function(){this.arrow1=S.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(S.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=S.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(S.createTransform()),this.visual.appendChild(this.arrow2)},R.prototype.pointerDown=function(D,H){K.prototype.pointerDown.call(this,D,H),this.state==="creating"&&this.createTips()},R.prototype.adjustVisual=function(){if(K.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",S.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),S.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var D=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),H=this.arrow1.transform.baseVal.getItem(0);H.setRotate(D,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(H,0);var J=this.arrow2.transform.baseVal.getItem(0);J.setRotate(D+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(J,0)}},R.prototype.setArrowType=function(D){this.arrowType=D,this.adjustVisual(),this.stateChanged()},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var D=Object.assign({arrowType:this.arrowType},K.prototype.getState.call(this));return D.typeName=R.typeName,D},R.prototype.restoreState=function(D){K.prototype.restoreState.call(this,D);var H=D;this.arrowType=H.arrowType,this.createTips(),this.adjustVisual()},R.typeName="ArrowMarker",R.title="Arrow marker",R.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',R}(o),L=function(K){function R(D,H,J){var M=K.call(this,D,H,J)||this;return M.fillColor=J.defaultFillColor,M.strokeWidth=0,M.fillPanel=new l("Color",J.defaultColorSet,J.defaultFillColor),M.fillPanel.onColorChanged=M.setFillColor,M}return B(R,K),Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var D=K.prototype.getState.call(this);return D.typeName=R.typeName,D},R.typeName="CoverMarker",R.title="Cover marker",R.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',R}(y),x=function(K){function R(D,H,J,M){var ae=K.call(this,D,M||'<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=H,ae.currentOpacity=J,ae.setCurrentOpacity=ae.setCurrentOpacity.bind(ae),ae}return B(R,K),R.prototype.getUi=function(){var D=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2",H.style.justifyContent="space-between",this.opacities.forEach(function(J){var M=document.createElement("div");M.style.display="flex",M.style.alignItems="center",M.style.justifyContent="center",M.style.padding="5px",M.style.borderWidth="2px",M.style.borderStyle="solid",M.style.borderColor=J===D.currentOpacity?D.uiStyleSettings.toolboxAccentColor:"transparent",M.addEventListener("click",function(){D.setCurrentOpacity(J,M)}),H.appendChild(M);var ae=document.createElement("div");ae.innerText=100*J+"%",M.appendChild(ae),D.opacityBoxes.push(M)}),H},R.prototype.setCurrentOpacity=function(D,H){var J=this;this.currentOpacity=D,this.opacityBoxes.forEach(function(M){M.style.borderColor=M===H?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},R}(i),I=function(K){function R(D,H,J){var M=K.call(this,D,H,J)||this;return M.setOpacity=M.setOpacity.bind(M),M.fillColor=J.defaultHighlightColor,M.strokeWidth=0,M.opacity=J.defaultHighlightOpacity,M.fillPanel=new l("Color",J.defaultColorSet,M.fillColor),M.fillPanel.onColorChanged=M.setFillColor,M.opacityPanel=new x("Opacity",J.defaultOpacitySteps,M.opacity),M.opacityPanel.onOpacityChanged=M.setOpacity,M}return B(R,K),R.prototype.setOpacity=function(D){this.opacity=D,this.visual&&S.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var D=K.prototype.getState.call(this);return D.typeName=R.typeName,D},R.typeName="HighlightMarker",R.title="Highlight marker",R.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',R}(L),k='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',C=function(K){function R(D,H,J){var M=K.call(this,D,H,J)||this;return M.bgColor="transparent",M.tipPosition={x:0,y:0},M.tipBase1Position={x:0,y:0},M.tipBase2Position={x:0,y:0},M.tipMoving=!1,M.color=J.defaultStrokeColor,M.bgColor=J.defaultFillColor,M.fontFamily=J.defaultFontFamily,M.defaultSize={x:100,y:30},M.setBgColor=M.setBgColor.bind(M),M.getTipPoints=M.getTipPoints.bind(M),M.positionTip=M.positionTip.bind(M),M.setTipPoints=M.setTipPoints.bind(M),M.colorPanel=new l("Text color",J.defaultColorSet,M.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>'),M.colorPanel.onColorChanged=M.setColor,M.bgColorPanel=new l("Fill color",J.defaultColorSet,M.bgColor,k),M.bgColorPanel.onColorChanged=M.setBgColor,M.fontFamilyPanel=new u("Font",J.defaultFontFamilies,J.defaultFontFamily),M.fontFamilyPanel.onFontChanged=M.setFont,M.tipGrip=new r,M.tipGrip.visual.transform.baseVal.appendItem(S.createTransform()),M.controlBox.appendChild(M.tipGrip.visual),M}return B(R,K),R.prototype.ownsTarget=function(D){return K.prototype.ownsTarget.call(this,D)||this.tipGrip.ownsTarget(D)||this.tip===D},R.prototype.createTip=function(){S.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=S.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},R.prototype.pointerDown=function(D,H){this.state==="new"&&K.prototype.pointerDown.call(this,D,H),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(H)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):K.prototype.pointerDown.call(this,D,H)},R.prototype.pointerUp=function(D){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,K.prototype.pointerUp.call(this,D);else{var H=this.state==="creating";K.prototype.pointerUp.call(this,D),this.setTipPoints(H),this.positionTip()}},R.prototype.manipulate=function(D){if(this.tipMoving){var H=this.unrotatePoint(D);this.tipPosition={x:H.x-this.manipulationStartLeft,y:H.y-this.manipulationStartTop},this.positionTip()}else K.prototype.manipulate.call(this,D)},R.prototype.setBgColor=function(D){this.bgRectangle&&this.tip&&(S.setAttributes(this.bgRectangle,[["fill",D]]),S.setAttributes(this.tip,[["fill",D]])),this.bgColor=D,this.fillColorChanged(D)},R.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},R.prototype.setTipPoints=function(D){D===void 0&&(D=!1);var H=Math.min(this.height/2,15),J=this.height/5;D&&(this.tipPosition={x:H+J/2,y:this.height+20});var M=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?M<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(J=this.width/5,H=Math.min(this.width/2,15),this.tipBase1Position={x:H,y:0},this.tipBase2Position={x:H+J,y:0}):(this.tipBase1Position={x:0,y:H},this.tipBase2Position={x:0,y:H+J}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?M<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(J=this.width/5,H=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-H-J,y:0},this.tipBase2Position={x:this.width-H,y:0}):(this.tipBase1Position={x:this.width,y:H},this.tipBase2Position={x:this.width,y:H+J}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?M<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(J=this.width/5,H=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-H-J,y:this.height},this.tipBase2Position={x:this.width-H,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-H-J},this.tipBase2Position={x:this.width,y:this.height-H}):M<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(J=this.width/5,H=Math.min(this.width/2,15),this.tipBase1Position={x:H,y:this.height},this.tipBase2Position={x:H+J,y:this.height}):(this.tipBase1Position={x:0,y:this.height-H},this.tipBase2Position={x:0,y:this.height-H-J})},R.prototype.resize=function(D){K.prototype.resize.call(this,D),this.positionTip()},R.prototype.positionTip=function(){S.setAttributes(this.tip,[["points",this.getTipPoints()]]);var D=this.tipGrip.visual.transform.baseVal.getItem(0);D.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(D,0)},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),R.prototype.select=function(){this.positionTip(),K.prototype.select.call(this)},R.prototype.getState=function(){var D=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},K.prototype.getState.call(this));return D.typeName=R.typeName,D},R.prototype.restoreState=function(D){var H=D;this.bgColor=H.bgColor,this.tipPosition=H.tipPosition,K.prototype.restoreState.call(this,D),this.createTip(),this.setTipPoints()},R.prototype.scale=function(D,H){K.prototype.scale.call(this,D,H),this.tipPosition={x:this.tipPosition.x*D,y:this.tipPosition.y*H},this.positionTip()},R.typeName="CalloutMarker",R.title="Callout marker",R.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',R}(b),F=function(K){function R(D,H,J){var M=K.call(this,D,H,J)||this;return M.fillColor="transparent",M.strokeColor="transparent",M.strokeWidth=0,M.strokeDasharray="",M.opacity=1,M.strokeColor=J.defaultColor,M.strokeWidth=J.defaultStrokeWidth,M.strokeDasharray=J.defaultStrokeDasharray,M.fillColor=J.defaultFillColor,M.setStrokeColor=M.setStrokeColor.bind(M),M.setFillColor=M.setFillColor.bind(M),M.setStrokeWidth=M.setStrokeWidth.bind(M),M.setStrokeDasharray=M.setStrokeDasharray.bind(M),M.setOpacity=M.setOpacity.bind(M),M.createVisual=M.createVisual.bind(M),M.strokePanel=new l("Line color",P(J.defaultColorSet,["transparent"]),J.defaultColor),M.strokePanel.onColorChanged=M.setStrokeColor,M.fillPanel=new l("Fill color",P(J.defaultColorSet,["transparent"]),M.fillColor,k),M.fillPanel.onColorChanged=M.setFillColor,M.strokeWidthPanel=new m("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),M.strokeWidthPanel.onWidthChanged=M.setStrokeWidth,M.strokeStylePanel=new T("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),M.strokeStylePanel.onStyleChanged=M.setStrokeDasharray,M.opacityPanel=new x("Opacity",J.defaultOpacitySteps,M.opacity),M.opacityPanel.onOpacityChanged=M.setOpacity,M}return B(R,K),R.prototype.ownsTarget=function(D){return!(!K.prototype.ownsTarget.call(this,D)&&D!==this.visual)},R.prototype.createVisual=function(){this.visual=S.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},R.prototype.pointerDown=function(D,H){K.prototype.pointerDown.call(this,D,H),this.state==="new"&&(this.createVisual(),this.moveVisual(D),this._state="creating")},R.prototype.manipulate=function(D){K.prototype.manipulate.call(this,D)},R.prototype.resize=function(D){K.prototype.resize.call(this,D),this.setSize()},R.prototype.setSize=function(){K.prototype.setSize.call(this),S.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},R.prototype.pointerUp=function(D){K.prototype.pointerUp.call(this,D),this.setSize()},R.prototype.setStrokeColor=function(D){this.strokeColor=D,this.visual&&S.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(D),this.stateChanged()},R.prototype.setFillColor=function(D){this.fillColor=D,this.visual&&S.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(D),this.stateChanged()},R.prototype.setStrokeWidth=function(D){this.strokeWidth=D,this.visual&&S.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},R.prototype.setStrokeDasharray=function(D){this.strokeDasharray=D,this.visual&&S.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},R.prototype.setOpacity=function(D){this.opacity=D,this.visual&&S.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var D=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},K.prototype.getState.call(this));return D.typeName=R.typeName,D},R.prototype.restoreState=function(D){var H=D;this.fillColor=H.fillColor,this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.opacity=H.opacity,this.createVisual(),K.prototype.restoreState.call(this,D),this.setSize()},R.prototype.scale=function(D,H){K.prototype.scale.call(this,D,H),this.setSize()},R.typeName="EllipseMarker",R.title="Ellipse marker",R.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',R}(E),V=function(K){function R(D,H,J){return K.call(this,D,H,J)||this}return B(R,K),Object.defineProperty(R.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),R.prototype.ownsTarget=function(D){return!(!K.prototype.ownsTarget.call(this,D)&&D!==this.tip1&&D!==this.tip2)},R.prototype.createTips=function(){this.tip1=S.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(S.createTransform()),this.visual.appendChild(this.tip1),this.tip2=S.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(S.createTransform()),this.visual.appendChild(this.tip2)},R.prototype.pointerDown=function(D,H){K.prototype.pointerDown.call(this,D,H),this.state==="creating"&&this.createTips()},R.prototype.adjustVisual=function(){if(K.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(S.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()]]),S.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 D=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),H=this.tip1.transform.baseVal.getItem(0);H.setRotate(D,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(H,0);var J=this.tip2.transform.baseVal.getItem(0);J.setRotate(D+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(J,0)}},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var D=K.prototype.getState.call(this);return D.typeName=R.typeName,D},R.prototype.restoreState=function(D){K.prototype.restoreState.call(this,D),this.createTips(),this.adjustVisual()},R.typeName="MeasurementMarker",R.title="Measurement marker",R.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',R}(o),ee=function(K){function R(D,H,J){var M=K.call(this,D,H,J)||this;return M.strokePanel.colors=J.defaultColorSet,M.fillColor="transparent",M}return B(R,K),Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var D=K.prototype.getState.call(this);return D.typeName=R.typeName,D},R.typeName="EllipseFrameMarker",R.title="Ellipse frame marker",R.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',R}(F),ie=function(){function K(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(K.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),K.prototype.addUndoStep=function(R){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(R)||(this.undoStack.push(R),JSON.stringify(this.lastRedoStep)!==JSON.stringify(R)&&this.redoStack.splice(0,this.redoStack.length))},K.prototype.replaceLastUndoStep=function(R){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=R)},K.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},K.prototype.undo=function(){if(this.undoStack.length>1){var R=this.undoStack.pop();return R!==void 0&&this.redoStack.push(R),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},K.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},K}(),pe=function(K){function R(D,H,J){var M=K.call(this,D,H,J)||this;return M.strokeColor="transparent",M.strokeWidth=0,M.strokeDasharray="",M.curveX=0,M.curveY=0,M.manipulationStartCurveX=0,M.manipulationStartCurveY=0,M.setStrokeColor=M.setStrokeColor.bind(M),M.setStrokeWidth=M.setStrokeWidth.bind(M),M.setStrokeDasharray=M.setStrokeDasharray.bind(M),M.positionGrips=M.positionGrips.bind(M),M.addControlGrips=M.addControlGrips.bind(M),M.adjustVisual=M.adjustVisual.bind(M),M.setupControlBox=M.setupControlBox.bind(M),M.resize=M.resize.bind(M),M.strokeColor=J.defaultColor,M.strokeWidth=J.defaultStrokeWidth,M.strokeDasharray=J.defaultStrokeDasharray,M.strokePanel=new l("Line color",J.defaultColorSet,J.defaultColor),M.strokePanel.onColorChanged=M.setStrokeColor,M.strokeWidthPanel=new m("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),M.strokeWidthPanel.onWidthChanged=M.setStrokeWidth,M.strokeStylePanel=new T("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),M.strokeStylePanel.onStyleChanged=M.setStrokeDasharray,M}return B(R,K),R.prototype.ownsTarget=function(D){return!(!K.prototype.ownsTarget.call(this,D)&&D!==this.visual&&D!==this.selectorCurve&&D!==this.visibleCurve&&!this.curveGrip.ownsTarget(D))},R.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},R.prototype.createVisual=function(){this.visual=S.createGroup(),this.selectorCurve=S.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=S.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},R.prototype.pointerDown=function(D,H){K.prototype.pointerDown.call(this,D,H),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=D.x,this.curveY=D.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(H)&&(this.activeGrip=this.curveGrip,this._state="resize")},R.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),S.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),S.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),S.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},R.prototype.setupControlBox=function(){K.prototype.setupControlBox.call(this),this.curveControlLine1=S.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=S.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},R.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,K.prototype.addControlGrips.call(this)},R.prototype.positionGrips=function(){K.prototype.positionGrips.call(this);var D=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-D/2,this.curveY-D/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},R.prototype.manipulate=function(D){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+D.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+D.y-this.manipulationStartY),K.prototype.manipulate.call(this,D)},R.prototype.resize=function(D){this.activeGrip===this.curveGrip&&(this.curveX=D.x,this.curveY=D.y),K.prototype.resize.call(this,D),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},R.prototype.setStrokeColor=function(D){this.strokeColor=D,this.adjustVisual(),this.colorChanged(D)},R.prototype.setStrokeWidth=function(D){this.strokeWidth=D,this.adjustVisual()},R.prototype.setStrokeDasharray=function(D){this.strokeDasharray=D,this.adjustVisual()},R.prototype.scale=function(D,H){this.curveX=this.curveX*D,this.curveY=this.curveY*H,K.prototype.scale.call(this,D,H)},Object.defineProperty(R.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),R.prototype.getState=function(){var D=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},K.prototype.getState.call(this));return D.typeName=R.typeName,D},R.prototype.restoreState=function(D){K.prototype.restoreState.call(this,D);var H=D;this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.curveX=H.curveX,this.curveY=H.curveY,this.createVisual(),this.adjustVisual()},R.typeName="CurveMarker",R.title="Curve marker",R.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',R}(h),ve=function(){function K(R,D){D===void 0&&(D=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=R,this.cancelable=D}return Object.defineProperty(K.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),K.prototype.preventDefault=function(){this._defaultPrevented=!0},K}(),ye=function(K){function R(D,H,J){var M=K.call(this,D,!1)||this;return M.dataUrl=H,M.state=J,M}return B(R,K),R}(ve),Ee=function(K){function R(D,H,J){J===void 0&&(J=!1);var M=K.call(this,D,J)||this;return M.marker=H,M}return B(R,K),R}(ve),Se=function(){function K(){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 K.prototype.addEventListener=function(R,D){this[R].push(D)},K.prototype.removeEventListener=function(R,D){var H=this[R].indexOf(D);H>-1&&this[R].splice(H,1)},K}(),fe=function(){function K(R){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new f,this._isOpen=!1,this.undoRedoManager=new ie,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 Se,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=K.instanceCounter++,this.styles=new w(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=R,this.targetRoot=document.body,this.width=R.clientWidth,this.height=R.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(K.prototype,"ALL_MARKER_TYPES",{get:function(){return[_,p,O,b,ee,F,I,C,V,L,o,pe]},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[_,p,O,b,F,I,C]},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"BASIC_MARKER_TYPES",{get:function(){return[_,p,O,b,I]},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(R){var D=this;this._availableMarkerTypes.splice(0),R.forEach(function(H){if(typeof H=="string"){var J=D.ALL_MARKER_TYPES.find(function(M){return M.typeName===H});J!==void 0&&D._availableMarkerTypes.push(J)}else D._availableMarkerTypes.push(H)})},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(R){this._zoomLevel=R,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),K.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),W.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},K.prototype.show=function(){var R=this;this.styles.styleSheetRoot===void 0&&e.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=e.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(D){return D(new ve(R))})},K.prototype.render=function(){return A(this,void 0,void 0,function(){var R;return j(this,function(D){switch(D.label){case 0:return this.setCurrentMarker(),(R=new N).naturalSize=this.renderAtNaturalSize,R.imageType=this.renderImageType,R.imageQuality=this.renderImageQuality,R.markersOnly=this.renderMarkersOnly,R.width=this.renderWidth,R.height=this.renderHeight,[4,R.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return D.sent(),[4,R.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,D.sent()]}})})},K.prototype.close=function(R){var D=this;if(R===void 0&&(R=!1),this.isOpen){var H=!1;R||this.eventListeners.beforeclose.forEach(function(J){var M=new ve(D,!0);J(M),M.defaultPrevented&&(H=!0)}),H||(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(J){return J(new ve(D))}),this.detachEvents(),this._isOpen=!1)}},K.prototype.addMarkersToToolbar=function(){for(var R,D=[],H=0;H<arguments.length;H++)D[H]=arguments[H];(R=this._availableMarkerTypes).push.apply(R,D)},K.prototype.addRenderEventListener=function(R){this.addEventListener("render",function(D){R(D.dataUrl,D.state)})},K.prototype.removeRenderEventListener=function(R){},K.prototype.addCloseEventListener=function(R){this.addEventListener("close",function(){R()})},K.prototype.removeCloseEventListener=function(R){},K.prototype.setupResizeObserver=function(){var R=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){R.resize(R.target.clientWidth,R.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return R.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},K.prototype.onPopupTargetResize=function(){var R=1*this.target.clientWidth/this.target.clientHeight,D=this.editorCanvas.clientWidth/R>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*R:this.editorCanvas.clientWidth,H=D<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/R;this.resize(D,H)},K.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},K.prototype.resize=function(R,D){this._isResizing=!0;var H=R/this.imageWidth,J=D/this.imageHeight;this.imageWidth=Math.round(R),this.imageHeight=Math.round(D),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(H,J),this._isResizing=!1},K.prototype.scaleMarkers=function(R,D){var H,J=this;this._currentMarker&&this._currentMarker instanceof b?this._currentMarker.scale(R,D):(H=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(M){M!==J._currentMarker&&M.scale(R,D)}),H!==void 0&&this.setCurrentMarker(H)},K.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"},K.prototype.setTopLeft=function(){var R=this.editingTarget.getBoundingClientRect(),D=this.editorCanvas.getBoundingClientRect();this.left=R.left-D.left,this.top=R.top-D.top},K.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)},K.prototype.addDefs=function(){for(var R,D=[],H=0;H<arguments.length;H++)D[H]=arguments[H];this.defs=S.createDefs(),this.addDefsToImage(),(R=this.defs).append.apply(R,D)},K.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},K.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)},K.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},K.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},K.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)},K.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},K.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)},K.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var R=document.createElement("a");R.href="https://markerjs.com/",R.target="_blank",R.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',R.title="Powered by marker.js",R.style.display="grid",R.style.alignItems="center",R.style.justifyItems="center",R.style.padding="3px",R.style.width="20px",R.style.height="20px",this.logoUI.appendChild(R),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},K.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")},K.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"},K.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},K.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var R=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=R+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new c(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 s(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},K.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},K.prototype.removeMarker=function(R){this.markerImage.removeChild(R.container),this.markers.indexOf(R)>-1&&this.markers.splice(this.markers.indexOf(R),1),R.dispose()},K.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())},K.prototype.toolbarButtonClicked=function(R,D){if(R==="marker"&&D!==void 0)this.createNewMarker(D);else if(R==="action")switch(D){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()}},K.prototype.deleteSelectedMarker=function(){var R=this;if(this._currentMarker!==void 0){var D=!1;if(this.eventListeners.markerbeforedelete.forEach(function(J){var M=new Ee(R,R._currentMarker,!0);J(M),M.defaultPrevented&&(D=!0)}),!D){var H=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(J){return J(new Ee(R,H))})}}},K.prototype.clear=function(){var R=this,D=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ae){var me=new Ee(R,void 0,!0);ae(me),me.defaultPrevented&&(D=!0)}),!D)){this.setCurrentMarker();for(var H=function(ae){var me=J.markers[ae];J.setCurrentMarker(J.markers[ae]),J._currentMarker.dispose(),J.markerImage.removeChild(J._currentMarker.container),J.markers.splice(J.markers.indexOf(J._currentMarker),1),J.eventListeners.markerdelete.forEach(function(_e){return _e(new Ee(R,me))})},J=this,M=this.markers.length-1;M>=0;M--)H(M);this.addUndoStep()}},Object.defineProperty(K.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),K.prototype.showNotesEditor=function(){var R;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(R=this._currentMarker.notes)!==null&&R!==void 0?R:"",this.overlayContainer.appendChild(this.notesArea))},K.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)},K.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},K.prototype.addUndoStep=function(){var R=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var D=this.getState(),H=this.undoRedoManager.getLastUndoStep();if(!H||H.width===D.width&&H.height===D.height){var J=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(D),J<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(M){return M(new ve(R))})}else this.undoRedoManager.replaceLastUndoStep(D),this.eventListeners.statechange.forEach(function(M){return M(new ve(R))})}},K.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},K.prototype.undoStep=function(){var R=this,D=this.undoRedoManager.undo();D!==void 0&&(this.restoreState(D),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(H){return H(new ve(R))}))},K.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},K.prototype.redoStep=function(){var R=this,D=this.undoRedoManager.redo();D!==void 0&&(this.restoreState(D),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(H){return H(new ve(R))}))},K.prototype.stepZoom=function(){var R=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=R<this.zoomSteps.length-1?this.zoomSteps[R+1]:this.zoomSteps[0]},K.prototype.panTo=function(R){this.contentDiv.scrollBy({left:this.prevPanPoint.x-R.x,top:this.prevPanPoint.y-R.y}),this.prevPanPoint=R},K.prototype.startRenderAndClose=function(){return A(this,void 0,void 0,function(){var R,D,H=this;return j(this,function(J){switch(J.label){case 0:return[4,this.render()];case 1:return R=J.sent(),D=this.getState(),this.eventListeners.render.forEach(function(M){return M(new ye(H,R,D))}),this.close(!0),[2]}})})},K.prototype.getState=function(R){R===!0&&this.setCurrentMarker();var D={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(H){return D.markers.push(H.getState())}),D},K.prototype.restoreState=function(R){var D=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);R.markers.forEach(function(H){var J=D._availableMarkerTypes.find(function(ae){return ae.typeName===H.typeName});if(J!==void 0){var M=D.addNewMarker(J);M.restoreState(H),D.markers.push(M)}}),R.width&&R.height&&(R.width!==this.imageWidth||R.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/R.width,this.imageHeight/R.height),this.eventListeners.restorestate.forEach(function(H){return H(new ve(D))})},K.prototype.addNewMarker=function(R){var D=S.createGroup();return this.markerImage.appendChild(D),new R(D,this.overlayContainer,this.settings)},K.prototype.createNewMarker=function(R){var D,H=this;(D=typeof R=="string"?this._availableMarkerTypes.find(function(J){return J.typeName===R}):R)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(D),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(D.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(J){return J(new Ee(H,H._currentMarker))}))},K.prototype.markerCreated=function(R){var D=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(R),this.setCurrentMarker(R),R instanceof p&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(p):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(H){return H(new Ee(D,D._currentMarker))})},K.prototype.colorChanged=function(R){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=R,this.settings.defaultStrokeColor=R)},K.prototype.fillColorChanged=function(R){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=R)},K.prototype.markerStateChanged=function(R){var D=this;this.eventListeners.markerchange.forEach(function(H){return H(new Ee(D,R))})},K.prototype.setCurrentMarker=function(R){var D=this;this._currentMarker!==R&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(H){return H(new Ee(D,D._currentMarker))})),this._currentMarker=R,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(H){return H(new Ee(D,D._currentMarker))}))},K.prototype.onPointerDown=function(R){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||R.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var D=this.markers.find(function(H){return H.ownsTarget(R.target)});D!==void 0?(this.setCurrentMarker(D),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(R.clientX,R.clientY),R.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:R.clientX,y:R.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(R.clientX,R.clientY))},K.prototype.onDblClick=function(R){if(this._isFocused||this.focus(),this.mode==="select"){var D=this.markers.find(function(H){return H.ownsTarget(R.target)});D!==void 0&&D!==this._currentMarker&&this.setCurrentMarker(D),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(R.clientX,R.clientY),R.target):this.setCurrentMarker()}},K.prototype.onPointerMove=function(R){this.touchPoints!==1&&R.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||R.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(R.clientX,R.clientY)):this.zoomLevel>1&&this.panTo({x:R.clientX,y:R.clientY}))},K.prototype.onPointerUp=function(R){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(R.clientX,R.clientY)),this.isDragging=!1,this.addUndoStep()},K.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},K.prototype.onKeyUp=function(R){this._currentMarker===void 0||this.notesArea!==void 0||R.key!=="Delete"&&R.key!=="Backspace"||this.deleteSelectedMarker()},K.prototype.clientToLocalCoordinates=function(R,D){var H=this.markerImage.getBoundingClientRect();return{x:(R-H.left)/this.zoomLevel,y:(D-H.top)/this.zoomLevel}},K.prototype.onWindowResize=function(){this.positionUI()},K.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var R=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=R+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},K.prototype.addLicenseKey=function(R){W.addKey(R)},K.prototype.addEventListener=function(R,D){this.eventListeners.addEventListener(R,D)},K.prototype.removeEventListener=function(R,D){this.eventListeners.removeEventListener(R,D)},K.prototype.renderState=function(R){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(R),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(K.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),K.prototype.focus=function(){var R=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(D){return D(new ve(R))}))},K.prototype.blur=function(){var R=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(D){return D(new ve(R))}))},K.instanceCounter=0,K}()},T8No:function(Le,se,U){"use strict";U.d(se,"a",function(){return W}),U.d(se,"e",function(){return N}),U.d(se,"c",function(){return o}),U.d(se,"b",function(){return u}),U.d(se,"d",function(){return b}),U.d(se,"f",function(){return O});var ne=U("MNsG"),B=U("N0LK"),A=U("Cg/j");let j=ne.k||"";const P=new Map;P.set("false",!1),P.set("true",!0),P.set("isMac",ne.f),P.set("isLinux",ne.d),P.set("isWindows",ne.i),P.set("isWeb",ne.h),P.set("isMacNative",ne.f&&!ne.h),P.set("isEdge",j.indexOf("Edg/")>=0),P.set("isFirefox",j.indexOf("Firefox")>=0),P.set("isChrome",j.indexOf("Chrome")>=0),P.set("isSafari",j.indexOf("Safari")>=0);const S=Object.prototype.hasOwnProperty;class W{static has(x){return g.create(x)}static equals(x,I){return c.create(x,I)}static regex(x,I){return m.create(x,I)}static not(x){return a.create(x)}static and(...x){return f.create(x,null)}static or(...x){return h.create(x,null,!0)}static deserialize(x,I=!1){return x?this._deserializeOrExpression(x,I):void 0}static _deserializeOrExpression(x,I){let k=x.split("||");return h.create(k.map(C=>this._deserializeAndExpression(C,I)),null,!0)}static _deserializeAndExpression(x,I){let k=x.split("&&");return f.create(k.map(C=>this._deserializeOne(C,I)),null)}static _deserializeOne(x,I){if(x=x.trim(),x.indexOf("!=")>=0){let k=x.split("!=");return l.create(k[0].trim(),this._deserializeValue(k[1],I))}if(x.indexOf("==")>=0){let k=x.split("==");return c.create(k[0].trim(),this._deserializeValue(k[1],I))}if(x.indexOf("=~")>=0){let k=x.split("=~");return m.create(k[0].trim(),this._deserializeRegexValue(k[1],I))}if(x.indexOf(" in ")>=0){let k=x.split(" in ");return s.create(k[0].trim(),k[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(x)){const k=x.split(">=");return t.create(k[0].trim(),k[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(x)){const k=x.split(">");return r.create(k[0].trim(),k[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(x)){const k=x.split("<=");return y.create(k[0].trim(),k[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(x)){const k=x.split("<");return E.create(k[0].trim(),k[1].trim())}return/^\!\s*/.test(x)?a.create(x.substr(1).trim()):g.create(x)}static _deserializeValue(x,I){if(x=x.trim(),x==="true")return!0;if(x==="false")return!1;let k=/^'([^']*)'$/.exec(x);return k?k[1].trim():x}static _deserializeRegexValue(x,I){if(Object(B.C)(x)){if(I)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let k=x.indexOf("/"),C=x.lastIndexOf("/");if(k===C||k<0){if(I)throw new Error(`bad regexp-value '${x}', missing /-enclosure`);return console.warn(`bad regexp-value '${x}', missing /-enclosure`),null}let F=x.slice(k+1,C),V=x[C+1]==="i"?"i":"";try{return new RegExp(F,V)}catch(ee){if(I)throw new Error(`bad regexp-value '${x}', parse error: ${ee}`);return console.warn(`bad regexp-value '${x}', parse error: ${ee}`),null}}}function N(x,I){const k=x?x.substituteConstants():void 0,C=I?I.substituteConstants():void 0;return!k&&!C?!0:!k||!C?!1:k.equals(C)}function e(x,I){return x.cmp(I)}class w{constructor(){this.type=0}cmp(x){return this.type-x.type}equals(x){return x.type===this.type}substituteConstants(){return this}evaluate(x){return!1}serialize(){return"false"}keys(){return[]}negate(){return v.INSTANCE}}w.INSTANCE=new w;class v{constructor(){this.type=1}cmp(x){return this.type-x.type}equals(x){return x.type===this.type}substituteConstants(){return this}evaluate(x){return!0}serialize(){return"true"}keys(){return[]}negate(){return w.INSTANCE}}v.INSTANCE=new v;class g{constructor(x,I){this.key=x,this.negated=I,this.type=2}static create(x,I=null){const k=P.get(x);return typeof k=="boolean"?k?v.INSTANCE:w.INSTANCE:new g(x,I)}cmp(x){return x.type!==this.type?this.type-x.type:p(this.key,x.key)}equals(x){return x.type===this.type?this.key===x.key:!1}substituteConstants(){const x=P.get(this.key);return typeof x=="boolean"?x?v.INSTANCE:w.INSTANCE:this}evaluate(x){return!!x.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(x,I,k){this.key=x,this.value=I,this.negated=k,this.type=4}static create(x,I,k=null){if(typeof I=="boolean")return I?g.create(x,k):a.create(x,k);const C=P.get(x);if(typeof C=="boolean"){const F=C?"true":"false";return I===F?v.INSTANCE:w.INSTANCE}return new c(x,I,k)}cmp(x){return x.type!==this.type?this.type-x.type:d(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){const x=P.get(this.key);if(typeof x=="boolean"){const I=x?"true":"false";return this.value===I?v.INSTANCE:w.INSTANCE}return this}evaluate(x){return x.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(x,I){this.key=x,this.valueKey=I,this.type=10,this.negated=null}static create(x,I){return new s(x,I)}cmp(x){return x.type!==this.type?this.type-x.type:d(this.key,this.valueKey,x.key,x.valueKey)}equals(x){return x.type===this.type?this.key===x.key&&this.valueKey===x.valueKey:!1}substituteConstants(){return this}evaluate(x){const I=x.getValue(this.valueKey),k=x.getValue(this.key);return Array.isArray(I)?I.indexOf(k)>=0:typeof k=="string"&&typeof I=="object"&&I!==null?S.call(I,k):!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(x){this._actual=x,this.type=11}static create(x){return new i(x)}cmp(x){return x.type!==this.type?this.type-x.type:this._actual.cmp(x._actual)}equals(x){return x.type===this.type?this._actual.equals(x._actual):!1}substituteConstants(){return this}evaluate(x){return!this._actual.evaluate(x)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class l{constructor(x,I,k){this.key=x,this.value=I,this.negated=k,this.type=5}static create(x,I,k=null){if(typeof I=="boolean")return I?a.create(x,k):g.create(x,k);const C=P.get(x);if(typeof C=="boolean"){const F=C?"true":"false";return I===F?w.INSTANCE:v.INSTANCE}return new l(x,I,k)}cmp(x){return x.type!==this.type?this.type-x.type:d(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){const x=P.get(this.key);if(typeof x=="boolean"){const I=x?"true":"false";return this.value===I?w.INSTANCE:v.INSTANCE}return this}evaluate(x){return x.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(x,I){this.key=x,this.negated=I,this.type=3}static create(x,I=null){const k=P.get(x);return typeof k=="boolean"?k?w.INSTANCE:v.INSTANCE:new a(x,I)}cmp(x){return x.type!==this.type?this.type-x.type:p(this.key,x.key)}equals(x){return x.type===this.type?this.key===x.key:!1}substituteConstants(){const x=P.get(this.key);return typeof x=="boolean"?x?w.INSTANCE:v.INSTANCE:this}evaluate(x){return!x.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=g.create(this.key,this)),this.negated}}function n(x,I){if(typeof x=="string"){const k=parseFloat(x);isNaN(k)||(x=k)}return typeof x=="string"||typeof x=="number"?I(x):w.INSTANCE}class r{constructor(x,I,k){this.key=x,this.value=I,this.negated=k,this.type=12}static create(x,I,k=null){return n(I,C=>new r(x,C,k))}cmp(x){return x.type!==this.type?this.type-x.type:d(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.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(x,I,k){this.key=x,this.value=I,this.negated=k,this.type=13}static create(x,I,k=null){return n(I,C=>new t(x,C,k))}cmp(x){return x.type!==this.type?this.type-x.type:d(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.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(x,I,k){this.key=x,this.value=I,this.negated=k,this.type=14}static create(x,I,k=null){return n(I,C=>new E(x,C,k))}cmp(x){return x.type!==this.type?this.type-x.type:d(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.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(x,I,k){this.key=x,this.value=I,this.negated=k,this.type=15}static create(x,I,k=null){return n(I,C=>new y(x,C,k))}cmp(x){return x.type!==this.type?this.type-x.type:d(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.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(x,I){this.key=x,this.regexp=I,this.type=7,this.negated=null}static create(x,I){return new m(x,I)}cmp(x){if(x.type!==this.type)return this.type-x.type;if(this.key<x.key)return-1;if(this.key>x.key)return 1;const I=this.regexp?this.regexp.source:"",k=x.regexp?x.regexp.source:"";return I<k?-1:I>k?1:0}equals(x){if(x.type===this.type){const I=this.regexp?this.regexp.source:"",k=x.regexp?x.regexp.source:"";return this.key===x.key&&I===k}return!1}substituteConstants(){return this}evaluate(x){let I=x.getValue(this.key);return this.regexp?this.regexp.test(I):!1}serialize(){const x=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${x}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=T.create(this)),this.negated}}class T{constructor(x){this._actual=x,this.type=8}static create(x){return new T(x)}cmp(x){return x.type!==this.type?this.type-x.type:this._actual.cmp(x._actual)}equals(x){return x.type===this.type?this._actual.equals(x._actual):!1}substituteConstants(){return this}evaluate(x){return!this._actual.evaluate(x)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function _(x){let I=null;for(let k=0,C=x.length;k<C;k++){const F=x[k].substituteConstants();if(x[k]!==F&&I===null){I=[];for(let V=0;V<k;V++)I[V]=x[V]}I!==null&&(I[k]=F)}return I===null?x:I}class f{constructor(x,I){this.expr=x,this.negated=I,this.type=6}static create(x,I){return f._normalizeArr(x,I)}cmp(x){if(x.type!==this.type)return this.type-x.type;if(this.expr.length<x.expr.length)return-1;if(this.expr.length>x.expr.length)return 1;for(let I=0,k=this.expr.length;I<k;I++){const C=e(this.expr[I],x.expr[I]);if(C!==0)return C}return 0}equals(x){if(x.type===this.type){if(this.expr.length!==x.expr.length)return!1;for(let I=0,k=this.expr.length;I<k;I++)if(!this.expr[I].equals(x.expr[I]))return!1;return!0}return!1}substituteConstants(){const x=_(this.expr);return x===this.expr?this:f.create(x,this.negated)}evaluate(x){for(let I=0,k=this.expr.length;I<k;I++)if(!this.expr[I].evaluate(x))return!1;return!0}static _normalizeArr(x,I){const k=[];let C=!1;for(const F of x){if(!F)continue;if(F.type===1){C=!0;continue}if(F.type===0)return w.INSTANCE;if(F.type===6){k.push(...F.expr);continue}k.push(F)}if(k.length===0&&C)return v.INSTANCE;if(k.length===0)return;if(k.length===1)return k[0];k.sort(e);for(let F=1;F<k.length;F++)k[F-1].equals(k[F])&&(k.splice(F,1),F--);if(k.length===1)return k[0];for(;k.length>1;){const F=k[k.length-1];if(F.type!==9)break;k.pop();const V=k.pop(),ee=k.length===0,ie=h.create(F.expr.map(pe=>f.create([pe,V],null)),null,ee);ie&&(k.push(ie),k.sort(e))}return k.length===1?k[0]:new f(k,I)}serialize(){return this.expr.map(x=>x.serialize()).join(" && ")}keys(){const x=[];for(let I of this.expr)x.push(...I.keys());return x}negate(){if(!this.negated){const x=[];for(let I of this.expr)x.push(I.negate());this.negated=h.create(x,this,!0)}return this.negated}}class h{constructor(x,I){this.expr=x,this.negated=I,this.type=9}static create(x,I,k){return h._normalizeArr(x,I,k)}cmp(x){if(x.type!==this.type)return this.type-x.type;if(this.expr.length<x.expr.length)return-1;if(this.expr.length>x.expr.length)return 1;for(let I=0,k=this.expr.length;I<k;I++){const C=e(this.expr[I],x.expr[I]);if(C!==0)return C}return 0}equals(x){if(x.type===this.type){if(this.expr.length!==x.expr.length)return!1;for(let I=0,k=this.expr.length;I<k;I++)if(!this.expr[I].equals(x.expr[I]))return!1;return!0}return!1}substituteConstants(){const x=_(this.expr);return x===this.expr?this:h.create(x,this.negated,!1)}evaluate(x){for(let I=0,k=this.expr.length;I<k;I++)if(this.expr[I].evaluate(x))return!0;return!1}static _normalizeArr(x,I,k){let C=[],F=!1;if(x){for(let V=0,ee=x.length;V<ee;V++){const ie=x[V];if(!ie)continue;if(ie.type===0){F=!0;continue}if(ie.type===1)return v.INSTANCE;if(ie.type===9){C=C.concat(ie.expr);continue}C.push(ie)}if(C.length===0&&F)return w.INSTANCE;C.sort(e)}if(C.length===0)return;if(C.length===1)return C[0];for(let V=1;V<C.length;V++)C[V-1].equals(C[V])&&(C.splice(V,1),V--);if(C.length===1)return C[0];if(k){for(let V=0;V<C.length;V++)for(let ee=V+1;ee<C.length;ee++)O(C[V],C[ee])&&(C.splice(ee,1),ee--);if(C.length===1)return C[0]}return new h(C,I)}serialize(){return this.expr.map(x=>x.serialize()).join(" || ")}keys(){const x=[];for(let I of this.expr)x.push(...I.keys());return x}negate(){if(!this.negated){let x=[];for(let I of this.expr)x.push(I.negate());for(;x.length>1;){const I=x.shift(),k=x.shift(),C=[];for(const V of L(I))for(const ee of L(k))C.push(f.create([V,ee],null));const F=x.length===0;x.unshift(h.create(C,null,F))}this.negated=x[0]}return this.negated}}class o extends g{constructor(x,I,k){super(x,null);this._defaultValue=I,typeof k=="object"?o._info.push(Object.assign(Object.assign({},k),{key:x})):k!==!0&&o._info.push({key:x,description:k,type:I!=null?typeof I:void 0})}static all(){return o._info.values()}bindTo(x){return x.createKey(this.key,this._defaultValue)}getValue(x){return x.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(x){return c.create(this.key,x)}}o._info=[];const u=Object(A.c)("contextKeyService"),b="setContext";function p(x,I){return x<I?-1:x>I?1:0}function d(x,I,k,C){return x<k?-1:x>k?1:I<C?-1:I>C?1:0}function O(x,I){if(I.type===6&&x.type!==9&&x.type!==6){for(const F of I.expr)if(x.equals(F))return!0}const k=x.negate(),C=L(k).concat(L(I));C.sort(e);for(let F=0;F<C.length;F++){const V=C[F],ee=V.negate();for(let ie=F+1;ie<C.length;ie++){const pe=C[ie];if(ee.equals(pe))return!0}}return!1}function L(x){return x.type===9?x.expr:[x]}},TXwP:function(Le,se,U){var ne,B;(function(){var A;(function(){"use strict";var P=[,,function(e){function w(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=[]}w.prototype.clone_empty=function(){var c=new w(this.__parent);return c.set_indent(this.__indent_count,this.__alignment_count),c},w.prototype.item=function(c){return c<0?this.__items[this.__items.length+c]:this.__items[c]},w.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},w.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))},w.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},w.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},w.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var 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},w.prototype.is_empty=function(){return this.__items.length===0},w.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},w.prototype.push=function(c){this.__items.push(c);var s=c.lastIndexOf(`
`);s!==-1?this.__character_count=c.length-s:this.__character_count+=c.length},w.prototype.pop=function(){var c=null;return this.is_empty()||(c=this.__items.pop(),this.__character_count-=c.length),c},w.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},w.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},w.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},w.prototype.toString=function(){var 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 v(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}v.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},v.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},v.prototype.__ensure_cache=function(c){for(;c>=this.__cache.length;)this.__add_column()},v.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 g(c,s){this.__indent_cache=new v(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 w(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}g.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},g.prototype.get_line_number=function(){return this.__lines.length},g.prototype.get_indent_string=function(c,s){return this.__indent_cache.get_indent_string(c,s)},g.prototype.get_indent_size=function(c,s){return this.__indent_cache.get_indent_size(c,s)},g.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},g.prototype.add_new_line=function(c){return this.is_empty()||!c&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},g.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},g.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},g.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)},g.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},g.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()},g.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(" "))},g.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()},g.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},g.prototype.just_added_newline=function(){return this.current_line.is_empty()},g.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},g.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 w(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},e.exports.Output=g},,,,function(e){function w(c,s){this.raw_options=v(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"])}w.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},w.prototype._get_boolean=function(c,s){var i=this.raw_options[c],l=i===void 0?!!s:!!i;return l},w.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},w.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},w.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]},w.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},w.prototype._is_valid_selection=function(c,s){return c.length&&s.length&&!c.some(function(i){return s.indexOf(i)===-1})};function v(c,s){var i={};c=g(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 g(c){var s={},i;for(i in c){var l=i.replace(/-/g,"_");s[l]=c[i]}return s}e.exports.Options=w,e.exports.normalizeOpts=g,e.exports.mergeOpts=v},,function(e){var w=RegExp.prototype.hasOwnProperty("sticky");function v(g){this.__input=g||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position<this.__input_length},v.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__input.charAt(this.__position),this.__position+=1),g},v.prototype.peek=function(g){var c=null;return g=g||0,g+=this.__position,g>=0&&g<this.__input_length&&(c=this.__input.charAt(g)),c},v.prototype.__match=function(g,c){g.lastIndex=c;var s=g.exec(this.__input);return s&&!(w&&g.sticky)&&(s.index!==c&&(s=null)),s},v.prototype.test=function(g,c){return c=c||0,c+=this.__position,c>=0&&c<this.__input_length?!!this.__match(g,c):!1},v.prototype.testChar=function(g,c){var s=this.peek(c);return g.lastIndex=0,s!==null&&g.test(s)},v.prototype.match=function(g){var c=this.__match(g,this.__position);return c?this.__position+=c[0].length:c=null,c},v.prototype.read=function(g,c,s){var i="",l;return g&&(l=this.match(g),l&&(i+=l[0])),c&&(l||!g)&&(i+=this.readUntil(c,s)),i},v.prototype.readUntil=function(g,c){var s="",i=this.__position;g.lastIndex=this.__position;var l=g.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},v.prototype.readUntilAfter=function(g){return this.readUntil(g,!0)},v.prototype.get_regexp=function(g,c){var s=null,i="g";return c&&w&&(i="y"),typeof g=="string"&&g!==""?s=new RegExp(g,i):g&&(s=new RegExp(g.source,i)),s},v.prototype.get_literal_regexp=function(g){return RegExp(g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},v.prototype.peekUntilAfter=function(g){var c=this.__position,s=this.readUntilAfter(g);return this.__position=c,s},v.prototype.lookBack=function(g){var c=this.__position-1;return c>=g.length&&this.__input.substring(c-g.length,c).toLowerCase()===g},e.exports.InputScanner=v},,,,,function(e){function w(v,g){v=typeof v=="string"?v:v.source,g=typeof g=="string"?g:g.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+g,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+g,"g")}w.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var g={};this.__directive_pattern.lastIndex=0;for(var c=this.__directive_pattern.exec(v);c;)g[c[1]]=c[2],c=this.__directive_pattern.exec(v);return g},w.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=w},,function(e,w,v){var g=v(16).Beautifier,c=v(17).Options;function s(i,l){var a=new g(i,l);return a.beautify()}e.exports=s,e.exports.defaultOptions=function(){return new c}},function(e,w,v){var g=v(17).Options,c=v(2).Output,s=v(8).InputScanner,i=v(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 g(_),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,O=!1,L=this._ch,x=!1,I,k,C;I=this._input.read(t),k=I!=="",C=L,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),L=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var F=this._input.read(E),V=l.get_directives(F);V&&V.ignore==="start"&&(F+=l.readIgnored(this._input)),this.print_string(F),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(y)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(k),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ee=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ee.match(/[ :]$/)&&(ee=this.eatString(": ").replace(/\s$/,""),this.print_string(ee),this._output.space_before_token=!0),ee=ee.replace(/\s$/,""),ee==="extend"?p=!0:ee==="import"&&(d=!0),ee in this.NESTED_AT_RULE?(this._nestedLevel+=1,ee in this.CONDITIONAL_GROUP_RULE&&(b=!0)):!o&&h===0&&ee.indexOf(":")!==-1&&(u=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(k),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)):(C==="("?this._output.space_before_token=!1:C!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),C==="{"&&this._output.trim(!0),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 ie=0;ie<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;ie++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[ie])){x=!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 pe=C==='"'||C==="'";this.preserveSingleSpace(pe||k),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")x=!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(k||ve),this.print_string(this._ch),u&&C==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),O=!0):(this.eatWhitespace(),h++,this.indent())}else if(this._ch===")")h&&(h--,this.outdent()),O&&this._input.peek()===";"&&this._options.selector_separator_newline&&(O=!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||O)&&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(k),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 ye=C==='"'||C==="'";this.preserveSingleSpace(ye||k),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&x&&this._output.add_new_line()}var Ee=this._output.get_code(_);return Ee},e.exports.Beautifier=m},function(e,w,v){var g=v(6).Options;function c(s){g.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 g,e.exports.Options=c}],S={};function W(e){var w=S[e];if(w!==void 0)return w.exports;var v=S[e]={exports:{}};return P[e](v,v.exports,W),v.exports}var N=W(15);A=N})();var j=A;!(ne=[],B=function(){return{css_beautify:j}}.apply(se,ne),B!==void 0&&(Le.exports=B))})()},Vhoy:function(Le,se,U){"use strict";U.d(se,"d",function(){return j}),U.d(se,"e",function(){return P}),U.d(se,"c",function(){return S}),U.d(se,"b",function(){return W}),U.d(se,"a",function(){return N});var ne=U("MI8n");class B{constructor(){this._icons=new Map,this._onDidRegister=new ne.b}add(e){const w=this._icons.get(e.id);w?e.description?w.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 A=new B,j=A;function P(e,w){return new W(e,w)}function S(e){return e?e.replace(/\$\((.*?)\)/g,(w,v)=>` ${v} `).trim():""}class W{constructor(e,w,v){this.id=e,this.definition=w,this.description=v,A.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 w=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function v(s){if(s instanceof W)return["codicon","codicon-"+s.id];const i=w.exec(s.id);if(!i)return v(W.error);let[,l,a]=i;const n=["codicon","codicon-"+l];return a&&n.push("codicon-modifier-"+a.substr(1)),n}e.asClassNameArray=v;function g(s){return v(s).join(" ")}e.asClassName=g;function c(s){return"."+v(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"})}(W||(W={}))},WaYH:function(Le,se,U){"use strict";var ne=U("rePB"),B=U("Ff2n"),A=U("VTBJ"),j=U("1OyB"),P=U("vuIU"),S=U("JX7q"),W=U("Ji7U"),N=U("LK+K"),e=U("q1tI"),w=U("TSYQ"),v=U.n(w),g=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:v()(u,(d={},Object(ne.a)(d,"".concat(u,"-start"),h[p+1]),Object(ne.a)(d,"".concat(u,"-end"),o[p+1]),Object(ne.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(W.a)(_,m);var T=Object(N.a)(_);function _(){var f;return Object(j.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(S.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(S.a)(f))},f.onDragOver=function(h){var o=f.props.context.onNodeDragOver;h.preventDefault(),h.stopPropagation(),o(h,Object(S.a)(f))},f.onDragLeave=function(h){var o=f.props.context.onNodeDragLeave;h.stopPropagation(),o(h,Object(S.a)(f))},f.onDragEnd=function(h){var o=f.props.context.onNodeDragEnd;h.stopPropagation(),f.setState({dragNodeHighlight:!1}),o(h,Object(S.a)(f))},f.onDrop=function(h){var o=f.props.context.onNodeDrop;h.preventDefault(),h.stopPropagation(),f.setState({dragNodeHighlight:!1}),o(h,Object(S.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,O=p.onNodeLoad;if(u)return;d&&o&&!f.isLeaf()&&(!f.hasChildren()&&!b&&O(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,O=u||d;if(f.isLeaf())return e.createElement("span",{className:v()("".concat(p,"-switcher"),"".concat(p,"-switcher-noop"))},typeof O=="function"?O(Object(A.a)(Object(A.a)({},f.props),{},{isLeaf:!0})):O);var L=v()("".concat(p,"-switcher"),"".concat(p,"-switcher_").concat(o?a:n));return e.createElement("span",{onClick:f.onExpand,className:L},typeof O=="function"?O(Object(A.a)(Object(A.a)({},f.props),{},{isLeaf:!1})):O)},f.renderCheckbox=function(){var h=f.props,o=h.checked,u=h.halfChecked,b=h.disableCheckbox,p=f.props.context.prefixCls,d=f.isDisabled(),O=f.isCheckable();if(!O)return null;var L=typeof O!="boolean"?O:null;return e.createElement("span",{className:v()("".concat(p,"-checkbox"),o&&"".concat(p,"-checkbox-checked"),!o&&u&&"".concat(p,"-checkbox-indeterminate"),(d||b)&&"".concat(p,"-checkbox-disabled")),onClick:f.onCheck},L)},f.renderIcon=function(){var h=f.props.loading,o=f.props.context.prefixCls;return e.createElement("span",{className:v()("".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,O=o.data,L=f.props.context,x=L.prefixCls,I=L.showIcon,k=L.icon,C=L.draggable,F=L.loadData,V=L.titleRender,ee=f.isDisabled(),ie="".concat(x,"-node-content-wrapper"),pe;if(I){var ve=p||k;pe=ve?e.createElement("span",{className:v()("".concat(x,"-iconEle"),"".concat(x,"-icon__customize"))},typeof ve=="function"?ve(f.props):ve):f.renderIcon()}else F&&d&&(pe=f.renderIcon());var ye;typeof u=="function"?ye=u(O):V?ye=V(O):ye=u;var Ee=e.createElement("span",{className:"".concat(x,"-title")},ye);return e.createElement("span",{ref:f.setSelectHandle,title:typeof u=="string"?u:"",className:v()("".concat(ie),"".concat(ie,"-").concat(f.getNodeState()||"normal"),!ee&&(b||h)&&"".concat(x,"-node-selected"),!ee&&C&&"draggable"),draggable:!ee&&C||void 0,"aria-grabbed":!ee&&C||void 0,onMouseEnter:f.onMouseEnter,onMouseLeave:f.onMouseLeave,onContextMenu:f.onContextMenu,onClick:f.onSelectorClick,onDoubleClick:f.onSelectorDoubleClick,onDragStart:C?f.onDragStart:void 0},pe,Ee)},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,O=o.dragOverGapTop,L=o.dragOverGapBottom,x=o.isLeaf,I=o.isStart,k=o.isEnd,C=o.expanded,F=o.selected,V=o.checked,ee=o.halfChecked,ie=o.loading,pe=o.domRef,ve=o.active,ye=o.onMouseMove,Ee=Object(B.a)(o,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Se=this.props.context,fe=Se.prefixCls,K=Se.filterTreeNode,R=Se.draggable,D=Se.keyEntities,H=this.isDisabled(),J=Object(c.f)(Ee),M=D[u]||{},ae=M.level,me=k[k.length-1];return e.createElement("div",Object.assign({ref:pe,className:v()(b,"".concat(fe,"-treenode"),(h={},Object(ne.a)(h,"".concat(fe,"-treenode-disabled"),H),Object(ne.a)(h,"".concat(fe,"-treenode-switcher-").concat(C?"open":"close"),!x),Object(ne.a)(h,"".concat(fe,"-treenode-checkbox-checked"),V),Object(ne.a)(h,"".concat(fe,"-treenode-checkbox-indeterminate"),ee),Object(ne.a)(h,"".concat(fe,"-treenode-selected"),F),Object(ne.a)(h,"".concat(fe,"-treenode-loading"),ie),Object(ne.a)(h,"".concat(fe,"-treenode-active"),ve),Object(ne.a)(h,"".concat(fe,"-treenode-leaf-last"),me),Object(ne.a)(h,"drag-over",!H&&d),Object(ne.a)(h,"drag-over-gap-top",!H&&O),Object(ne.a)(h,"drag-over-gap-bottom",!H&&L),Object(ne.a)(h,"filter-node",K&&K(Object(l.b)(this.props))),h)),style:p,onDragEnter:R?this.onDragEnter:void 0,onDragOver:R?this.onDragOver:void 0,onDragLeave:R?this.onDragLeave:void 0,onDrop:R?this.onDrop:void 0,onDragEnd:R?this.onDragEnd:void 0,onMouseMove:ye},J),e.createElement(i,{prefixCls:fe,level:ae,isStart:I,isEnd:k}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),_}(e.Component),E=function(T){return e.createElement(g.a.Consumer,null,function(_){return e.createElement(t,Object.assign({},T,{context:_}))})};E.displayName="TreeNode",E.defaultProps={title:r},E.isTreeNode=1;var y=se.a=E},ZW9T:function(Le,se,U){"use strict";U.d(se,"a",function(){return k});var ne=U("k1fw"),B=U("oBTY"),A=U("miYZ"),j=U("tsqr"),P=U("rAM+"),S=U("tJVT"),W=U("PpiC"),N=U("q1tI"),e=U.n(N),w=U("bdgK"),v=U("9og8"),g=U("WmNS"),c=U.n(g),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(F,V){return V.map(function(ee){return{label:ee,kind:F.languages.CompletionItemKind.Keyword,insertText:ee}})},y=function(F){return Object.keys(t.tables).map(function(V){return{label:V,kind:F.languages.CompletionItemKind.Variable,insertText:V}})},m=function(F,V){var ee=t.tables[F];return ee?ee.map(function(ie){return{label:ie,kind:V.languages.CompletionItemKind.Field,insertText:ie}}):[]};function T(C,F,V,ee,ie){var pe=F.getWordUntilPosition(V),ve={startLineNumber:V.lineNumber,endLineNumber:V.lineNumber,startColumn:pe.startColumn,endColumn:pe.endColumn},ye=ee.map(function(Ee){return{label:Ee,kind:C.languages.CompletionItemKind.Keyword,insertText:Ee,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ve}});return ie.map(function(Ee){ye.push(Object(ne.a)(Object(ne.a)({},Ee),{},{range:ve}))}),ye}var _=function(C){t.languages.map(function(ie){return C.languages.registerDocumentFormattingEditProvider(ie,{provideDocumentFormattingEdits:function(ve,ye,Ee){return Object(v.a)(c.a.mark(function Se(){var fe;return c.a.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return fe=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}),R.abrupt("return",[{range:ve.getFullModelRange(),text:fe}]);case 2:case"end":return R.stop()}},Se)}))()}}),ie});var F=l.quickKey.map(function(ie){return{label:ie.label,kind:C.languages.CompletionItemKind.Method,insertText:ie.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),V=a.quickKey.map(function(ie){return{label:ie.label,kind:C.languages.CompletionItemKind.Method,insertText:ie.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ee=i.quickKey.map(function(ie){return{label:ie.label,kind:C.languages.CompletionItemKind.Method,insertText:ie.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet}});C.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(pe,ve){var ye=pe.getWordUntilPosition(ve),Ee={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:ye.startColumn,endColumn:ye.endColumn},Se=pe.getLineContent(ve.lineNumber).substring(ye.startColumn-2,ye.endColumn);return{suggestions:[].concat(Object(B.a)(l.keywords.map(function(fe){return{label:fe,kind:C.languages.CompletionItemKind.Function,documentation:fe,insertText:fe,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ee}})),Object(B.a)(l.quickKey.map(function(fe){return{label:fe.label,kind:C.languages.CompletionItemKind.Function,documentation:fe.content,insertText:Se.startsWith("#")?fe.content.replace(/#/,""):fe.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ee}})))}}}),C.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(pe,ve){var ye=pe.getWordUntilPosition(ve),Ee={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:ye.startColumn,endColumn:ye.endColumn};return{suggestions:Object(B.a)(s.keywords.map(function(Se){return{label:Se,kind:C.languages.CompletionItemKind.Function,documentation:Se,insertText:Se,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ee}}))}}}),C.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(pe,ve){var ye=pe.getWordUntilPosition(ve),Ee={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:ye.startColumn,endColumn:ye.endColumn},Se=pe.getLineContent(ve.lineNumber).substring(ye.startColumn-2,ye.endColumn);return{suggestions:[].concat(Object(B.a)(i.keywords.map(function(fe){return{label:fe,kind:C.languages.CompletionItemKind.Function,documentation:fe,insertText:fe,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ee}})),Object(B.a)(i.quickKey.map(function(fe){return{label:fe.label,kind:C.languages.CompletionItemKind.Function,documentation:fe.content,insertText:Se.startsWith("#")?fe.content.replace(/#/,""):fe.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ee}})))}}}),C.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(pe,ve){var ye=pe.getWordUntilPosition(ve),Ee={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:ye.startColumn,endColumn:ye.endColumn},Se=pe.getLineContent(ve.lineNumber).substring(ye.startColumn-2,ye.endColumn);return{suggestions:[].concat(Object(B.a)(a.keywords.map(function(fe){return{label:fe,kind:C.languages.CompletionItemKind.Function,documentation:fe,insertText:fe,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ee}})),Object(B.a)(a.quickKey.map(function(fe){return{label:fe.label,kind:C.languages.CompletionItemKind.Function,documentation:fe.content,insertText:Se.startsWith("#")?fe.content.replace(/#/,""):fe.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ee}})))}}})},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(C){return/^\d+$/.test(C)?"".concat(C,"px"):C}function p(){}var d=!1,O={"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 L(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],F=C;if(Array.isArray(C)){for(var V=0;V<C.length;V++){var ee=O[C[V]];if(ee)return ee}return F[0]}return O[F]||F}var x=null,I=se.b=function(C){var F=C.width,V=F===void 0?"100%":F,ee=C.height,ie=ee===void 0?"100%":ee,pe=C.value,ve=C.language,ye=ve===void 0?"javascript":ve,Ee=C.style,Se=Ee===void 0?{}:Ee,fe=C.options,K=fe===void 0?{}:fe,R=C.overrideServices,D=R===void 0?{}:R,H=C.theme,J=H===void 0?"vs-dark":H,M=C.onEditBlur,ae=C.onSave,me=C.autoHeight,_e=me===void 0?!1:me,q=C.forbidCopy,oe=q===void 0?!1:q,ue=C.onChange,ce=ue===void 0?p:ue,be=C.editorDidMount,Ce=be===void 0?p:be,Oe=C.onFocus,Ie=Oe===void 0?p:Oe,De=C.filename,Me=De===void 0?"educoder.txt":De,de=C.errorLine,ge=C.errorContent,xe=ge===void 0?"":ge,we=Object(W.a)(C,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),Z=Object(N.useRef)(),z=Object(N.useRef)({}),G=Object(N.useRef)(),X=Object(N.useRef)(),Q=Object(N.useRef)(!1),Y=Object(N.useRef)(),$=Object(N.useState)(!1),te=Object(S.a)($,2),re=te[0],le=te[1];function he(){var Ue;return Z.current&&(Ue=new w.default(function(Be){var Fe=Object(P.a)(Be),it;try{for(Fe.s();!(it=Fe.n()).done;){var lt=it.value;(lt.target.offsetHeight>0||lt.target.offsetWidth>0)&&z.current.instance.layout()}}catch(pt){Fe.e(pt)}finally{Fe.f()}}),Ue.observe(Z.current)),Ue}function Te(){j.b.warn(decodeURIComponent(f))}var Re=function(){var Be=z.current.instance;if(pe!=null&&Be&&re){var Fe=Be.getModel();Fe&&pe!==Fe.getValue()&&(d=!0,Fe.setValue(pe),Be.layout(),d=!1)}};Object(N.useEffect)(function(){X.current&&clearTimeout(X.current),X.current=setTimeout(function(){Re()},500)},[pe,re,z.current]),Object(N.useEffect)(function(){if(de&&z.current&&z.current.instance){var Ue=z.current.instance;Ue.changeViewZones(function(Fe){var it=document.createElement("div");it.style.padding="10px 20px",it.style.width="calc(100% - 20px)",it.className="my-error-line-wrp",it.innerHTML=xe,Fe.addZone({afterLineNumber:de||11,heightInLines:3,domNode:it})});var Be={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}};Ue.addOverlayWidget(Be),Ue.revealPositionInCenter({lineNumber:20,column:1})}},[de,z.current,re]);function Pe(){var Ue=z.current.instance;if(Ue){var Be=Ue.getSelection(),Fe=z.current.pastePos||{},it=new x.Range(Fe.startLineNumber||Be.endLineNumber,Fe.startColumn||Be.endColumn,Fe.endLineNumber||Be.endLineNumber,Fe.endColumn||Be.endColumn);setTimeout(function(){Ue.executeEdits("",[{range:it,text:""}])},300)}}function Ae(Ue){(window.navigator.platform.match("Mac")?Ue.metaKey:Ue.ctrlKey)&&Ue.keyCode==83&&(Ue.preventDefault(),ae())}var Ge=function(){if(_e&&z.current.instance){var Be=z.current.instance.getContentHeight();je(Be<ie?ie:Be)}else je(ie)};function Ne(Ue){var Be=document.createEvent("MouseEvents");Be.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Ue.dispatchEvent(Be)}function ke(Ue,Be){var Fe=window.URL||window.webkitURL||window,it=new Blob([Be]),lt=document.createElementNS("http://www.w3.org/1999/xhtml","a");lt.href=Fe.createObjectURL(it),lt.download=Ue,Ne(lt)}Object(N.useEffect)(function(){Ge()},[Ge]),Object(N.useEffect)(function(){Z.current&&!re&&Promise.all([U.e(18),U.e(29)]).then(U.t.bind(null,"M/lh",7)).then(function(Ue){try{x=Ue,z.current.instance=x.editor.create(Z.current,{value:pe,language:L(ye),theme:J,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},D);var Be=z.current.instance,Fe=h.d._menuItems,it=Object(B.a)(Fe).find(function(Xe){return Xe[0]._debugName=="EditorContext"}),lt=it[1],pt=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],rt=function(Ke,at){var Ve=Ke._first;do{var dt,nt,yt=at.includes((dt=Ve.element)===null||dt===void 0||((nt=dt.command)===null||nt===void 0)?void 0:nt.id);yt&&Ke._remove(Ve)}while(Ve=Ve.next)};if(Ce(Be,x),setTimeout(function(){Ge(),z.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){ke(Me||"educoder.txt",Be.getValue())}}),Be.getDomNode().addEventListener("input",function(){G.current.autoFormat&&Be.getAction("editor.action.formatDocument").run()})},500),z.current.subscription=Be.onDidChangeModelContent(function(Xe){Q.current?clearTimeout(Y.current):(Ge(),ce(Be.getValue(),Xe)),Y.current=setTimeout(function(){Q.current=!1},500)}),window.Monaco||_(x,L(ye)),oe&&(rt(lt,pt),Z.current.classList.add("noCopyPaste"),Be.onKeyDown(function(Xe){var Ke=Xe.keyCode,at=Xe.ctrlKey,Ve=Xe.metaKey;(Ke===33||Ke===52)&&(Ve||at)&&(Te(),Xe.preventDefault())})),window.Monaco=x,M&&Be.onDidBlurEditorWidget(function(){M(Be.getValue())}),Ie&&Be.onDidFocusEditorText(function(){Ie(Be.getValue())}),oe){Be.addCommand(x.KeyMod.CtrlCmd|x.KeyCode.KEY_V,function(){return Te(),null}),Be.onDidPaste(function(Xe){z.current.pastePos=Xe});try{window.addEventListener("paste",Pe)}catch(Xe){}}var Ye=he();return le(!0),function(){var Xe=z.current.instance;Xe.dispose();var Ke=Xe.getModel();Ke&&Ke.dispose(),z.current.subscription&&z.current.subscription.dispose(),oe&&window.removeEventListener("paste",Pe),Ye.unobserve(Z.current)}}catch(Xe){}})},[]),Object(N.useEffect)(function(){var Ue=z.current.instance;if(Ue&&re)return document.addEventListener("keydown",Ae,!1),function(){document.removeEventListener("keydown",Ae)}},[ae,re]),Object(N.useEffect)(function(){var Ue=z.current.instance;if(Ue&&re){var Be=L(ye);x.editor.setModelLanguage(Ue.getModel(),Be),console.log("language:",ye,Ue.getModel(),Be)}},[ye,re]),Object(N.useEffect)(function(){var Ue=z.current.instance;Ue&&re&&x.editor.setTheme(J)},[J,re]),Object(N.useEffect)(function(){var Ue=z.current.instance;G.current=K,Ue&&re&&(Ue.updateOptions(Object(ne.a)({},K)),setTimeout(function(){Ue.getModel().updateOptions(Object(ne.a)({},K))},200))},[JSON.stringify(K),re]),Object(N.useEffect)(function(){var Ue=z.current.instance;Ue&&re&&Ue.layout()},[V,ie,re]);var $e=Object(N.useState)(b(V)),ze=Object(S.a)($e,2),He=ze[0],Ze=ze[1],We=Object(N.useState)(b(ie)),Je=Object(S.a)(We,2),qe=Je[0],je=Je[1],tt=Object(ne.a)(Object(ne.a)({},Se),{},{width:He,height:qe});return e.a.createElement("div",{className:"my-monaco-editor",ref:Z,style:tt})};function k(C){var F=C.width,V=F===void 0?"100%":F,ee=C.height,ie=ee===void 0?"100%":ee,pe=C.original,ve=C.modified,ye=C.language,Ee=C.options,Se=Ee===void 0?{}:Ee,fe=Object(N.useRef)(),K=Object(N.useState)(null),R=Object(S.a)(K,2),D=R[0],H=R[1];function J(_e){var q;return fe.current&&(q=new w.default(function(oe){var ue=Object(P.a)(oe),ce;try{for(ue.s();!(ce=ue.n()).done;){var be=ce.value;(be.target.offsetHeight>0||be.target.offsetWidth>0)&&_e.layout()}}catch(Ce){ue.e(Ce)}finally{ue.f()}}),q.observe(fe.current)),q}Object(N.useEffect)(function(){fe.current&&Promise.all([U.e(18),U.e(29)]).then(U.t.bind(null,"M/lh",7)).then(function(_e){x=_e;var q=x.editor.createDiffEditor(fe.current,Object(ne.a)(Object(ne.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}));H(q);var oe=J(q);return function(){q.dispose();var ue=q.getModel();ue&&ue.dispose(),oe.unobserve(fe.current)}})},[]),Object(N.useEffect)(function(){D&&D.setModel({original:x.editor.createModel(pe,ye),modified:x.editor.createModel(ve,ye)})},[pe,ve,ye,D]);var M=b(V),ae=b(ie),me={width:M,height:ae};return e.a.createElement("div",{className:"my-diff-editor",ref:fe,style:me})}},bTeP:function(Le,se,U){Le.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(Le,se,U){"use strict";var ne=U("q1tI"),B=U.n(ne),A=ne.createContext(null);se.a=A},deN7:function(Le,se,U){"use strict";var ne=U("/zsF"),B=U("PArb"),A=U("14J3"),j=U("BMrR"),P=U("jCWc"),S=U("kPKH"),W=U("+L6B"),N=U("2/Rp"),e=U("miYZ"),w=U("tsqr"),v=U("9og8"),g=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"),O=U("Ty5D"),L=U("9Bee"),x=U("XYT7"),I=U("RCxd"),k=U("/MfK"),C=E.a.Option,F={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,enableSplitViewResizing:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1},V;(function(ie){ie[ie.SET_PATH=0]="SET_PATH",ie[ie.GET_PASSED_CONTENT=1]="GET_PASSED_CONTENT"})(V||(V={}));function ee(ie,pe){switch(pe.type){case V.SET_PATH:return Object(r.a)(Object(r.a)({},ie),{},{selectedPath:pe.payload});case V.GET_PASSED_CONTENT:return Object(r.a)(Object(r.a)({},ie),{},{passedContent:pe.payload});default:throw new Error}}se.a=function(ie){var pe=ie.language,ve=ie.dispatch,ye=ie.shixunWorkReport,Ee=ie.v,Se=ie.languages,fe=ie.onPathChange,K=ie.autoHeight,R=ie.diff_code_count,D=ie.data,H=Object(T.useState)(Se==null?void 0:Se[0]),J=Object(n.a)(H,2),M=J[0],ae=J[1],me=ye!="shixunWorkReport"&&Object(O.i)();return Object(T.useEffect)(function(){ae(Se==null?void 0:Se[0])},[]),Object(T.useEffect)(function(){var _e;ae(Se==null||((_e=Se.filter(function(q){return q.language===(M==null?void 0:M.language)}))===null||_e===void 0)?void 0:_e[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:pe,style:{marginLeft:10},onChange:function(q){var oe;ae(Se==null||((oe=Se.filter(function(ue){return ue.language===q.target.value}))===null||oe===void 0)?void 0:oe[0])}},Se==null?void 0:Se.map(function(_e){return _.a.createElement(a.a,{value:_e==null?void 0:_e.language},_e==null?void 0:_e.language)}))),Object(u.c)()&&ye!="shixunWorkReport"&&_.a.createElement("span",null,_.a.createElement("span",null,"\u5F97\u5206 ",M==null?void 0:M.score,"/",M==null?void 0:M.total_score),_.a.createElement(N.a,{style:{margin:"0px 10px"},onClick:function(){var q=M==null?void 0:M.score;i.a.confirm({title:"\u8C03\u5206",content:_.a.createElement("div",null,_.a.createElement("p",null,"\u5F97\u5206\uFF1A",M==null?void 0:M.score,"/",M==null?void 0:M.total_score),_.a.createElement("p",null,"\u8C03\u5206\uFF1A",_.a.createElement(c.a,{min:0,max:M==null?void 0:M.total_score,defaultValue:M==null?void 0:M.score,onChange:function(ue){q=ue}}))),okText:"\u786E\u8BA4",onOk:function(){var oe=Object(v.a)(m.a.mark(function ce(){var be;return m.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:return Oe.next=2,Object(d.a)("/api/courses/".concat(me==null?void 0:me.coursesId,"/homework_commons/update_hack_score"),{method:"put",body:{course_id:me==null?void 0:me.coursesId,hack_user_code_id:M==null?void 0:M.hack_user_id,score:q}});case 2:be=Oe.sent,be.status===0&&(w.b.success("\u8C03\u5206\u6210\u529F"),ve({type:"shixunHomeworks/setActionTabs",payload:{}}),ve({type:"shixunHomeworks/getShixunWorkReports",payload:Object(r.a)({},me)}));case 4:case"end":return Oe.stop()}},ce)}));function ue(){return oe.apply(this,arguments)}return ue}(),cancelText:"\u53D6\u6D88"})},type:"primary"},"\u8C03\u5206"),Object(u.c)()&&ye!="shixunWorkReport"&&_.a.createElement(N.a,{onClick:function(){ve({type:"shixunHomeworks/setActionTabs",payload:{key:"\u66F4\u6539\u70B9\u8BC4",selectArrs:{myshixun_identifier:ye.user_id,type:"1",language:M==null?void 0:M.language,v:Ee,data:Object(r.a)({},ye)}}})}},"\u70B9\u8BC4\u4EE3\u7801"))),_.a.createElement(f.b,{height:300,language:M==null?void 0:M.language,value:b.Base64.decode(M==null?void 0:M.code),autoHeight:K,theme:"default",options:F}),((M==null?void 0:M.comment)||(M==null?void 0:M.hidden_comment))&&_.a.createElement("div",null,_.a.createElement(j.a,{align:"middle",style:{borderTop:"1px solid #eee"}},_.a.createElement(S.a,{flex:1},_.a.createElement("h1",{className:o.a.title},"\u70B9\u8BC4\u5185\u5BB9")),_.a.createElement(S.a,{className:"pr30"},Object(u.c)()&&_.a.createElement(N.a,{onClick:Object(v.a)(m.a.mark(function _e(){return m.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:i.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",icon:_.a.createElement(I.a,null),content:"\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F",onOk:function(){return Object(v.a)(m.a.mark(function ce(){var be;return m.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:return Oe.next=2,Object(x.m)({comment_id:M==null?void 0:M.comment_id,homeworkId:me.homeworkId,type:"hack"});case 2:be=Oe.sent,be.status===0&&(w.b.success("\u5220\u9664\u6210\u529F"),ve({type:"shixunHomeworks/getShixunWorkReports",payload:Object(r.a)({},me)}));case 4:case"end":return Oe.stop()}},ce)}))()}});case 1:case"end":return oe.stop()}},_e)}))},_.a.createElement(k.a,null),"\u5220\u9664"))),_.a.createElement(B.a,{style:{margin:0}}),(M==null?void 0:M.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(L.a,{value:M==null?void 0:M.comment})),(M==null?void 0:M.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(L.a,{value:M==null?void 0:M.hidden_comment}))))}},dmUQ:function(Le,se,U){"use strict";var ne=U("Ff2n"),B=U("rePB"),A=U("1OyB"),j=U("vuIU"),P=U("Ji7U"),S=U("md7G"),W=U("foSv"),N=U("q1tI"),e=U.n(N),w=U("TSYQ"),v=U.n(w),g=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(B.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(W.a)(o),d;if(u){var O=Object(W.a)(this).constructor;d=Reflect.construct(p,arguments,O)}else d=p.apply(this,arguments);return Object(S.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(A.a)(this,b),d=u.call(this,p),d.onKeyDown=function(x){var I=d.props,k=I.onKeyDown,C=I.onPressEnter;if(x.keyCode===g.a.UP){var F=d.getRatio(x);d.up(x,F,null),d.stop()}else if(x.keyCode===g.a.DOWN){var V=d.getRatio(x);d.down(x,V,null),d.stop()}else x.keyCode===g.a.ENTER&&C&&C(x);if(d.recordCursorPosition(),d.lastKeyCode=x.keyCode,k){for(var ee=arguments.length,ie=new Array(ee>1?ee-1:0),pe=1;pe<ee;pe++)ie[pe-1]=arguments[pe];k.apply(void 0,[x].concat(ie))}},d.onKeyUp=function(x){var I=d.props.onKeyUp;if(d.stop(),d.recordCursorPosition(),I){for(var k=arguments.length,C=new Array(k>1?k-1:0),F=1;F<k;F++)C[F-1]=arguments[F];I.apply(void 0,[x].concat(C))}},d.onChange=function(x){var I=d.props.onChange;d.state.focused&&(d.inputting=!0),d.rawInput=d.props.parser(d.getValueFromEvent(x)),d.setState({inputValue:d.rawInput}),I(d.toNumber(d.rawInput))},d.onMouseUp=function(){var x=d.props.onMouseUp;d.recordCursorPosition(),x&&x.apply(void 0,arguments)},d.onFocus=function(){var x;d.setState({focused:!0}),(x=d.props).onFocus.apply(x,arguments)},d.onBlur=function(){var x=d.props.onBlur;d.inputting=!1,d.setState({focused:!1});var I=d.getCurrentValidValue(d.state.inputValue),k=d.setValue(I,a);if(x){var C=d.input.value,F=d.getInputDisplayValue({focus:!1,value:k});d.input.value=F&&Number(F),x.apply(void 0,arguments),d.input.value=C}},d.getRatio=function(x){var I=1;return x.metaKey||x.ctrlKey?I=.1:x.shiftKey&&(I=10),I},d.getFullNum=function(x){return isNaN(x)?x:/e/i.test(String(x))?Number(x).toFixed(18).replace(/\.?0+$/,""):x},d.getPrecision=function(x){if(m(d.props.precision))return d.props.precision;var I=String(x);if(I.indexOf("e-")>=0)return parseInt(I.slice(I.indexOf("e-")+2),10);var k=0;return I.indexOf(".")>=0&&(k=I.length-I.indexOf(".")-1),k},d.getInputDisplayValue=function(x){var I=x||d.state,k=I.focused,C=I.inputValue,F=I.value,V;k?V=C:V=d.toPrecisionAsStep(F),V==null&&(V="");var ee=d.formatWrapper(V);return m(d.props.decimalSeparator)&&(ee=ee.toString().replace(".",d.props.decimalSeparator)),ee},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(x){}},d.restoreByAfter=function(x){if(x===void 0)return!1;var I=d.input.value,k=I.lastIndexOf(x);if(k===-1)return!1;var C=d.cursorBefore.length;return d.lastKeyCode===g.a.DELETE&&d.cursorBefore.charAt(C-1)===x[0]?(d.fixCaret(C,C),!0):k+x.length===I.length?(d.fixCaret(k,k),!0):!1},d.partRestoreByAfter=function(x){return x===void 0?!1:Array.prototype.some.call(x,function(I,k){var C=x.substring(k);return d.restoreByAfter(C)})},d.isNotCompleteNumber=function(x){return isNaN(x)||x===""||x===null||x&&x.toString().indexOf(".")===x.toString().length-1},d.stop=function(){d.autoStepTimer&&clearTimeout(d.autoStepTimer)},d.down=function(x,I,k){d.pressingUpOrDown=!0,d.step("down",x,I,k)},d.up=function(x,I,k){d.pressingUpOrDown=!0,d.step("up",x,I,k)},d.saveInput=function(x){d.input=x};var O=p.value;O===void 0&&(O=p.defaultValue),d.state={focused:p.autoFocus};var L=d.getValidValue(d.toNumber(O));return d.state=s(s({},d.state),{},{inputValue:d.toPrecisionAsStep(L),value:L}),d}return Object(j.a)(b,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(d){var O=this.props,L=O.value,x=O.onChange,I=O.max,k=O.min,C=this.state.focused;if(d){if(!T(d.value,L)||!T(d.max,I)||!T(d.min,k)){var F=C?L:this.getValidValue(L),V;this.pressingUpOrDown?V=F:this.inputting?V=this.rawInput:V=this.toPrecisionAsStep(F),this.setState({value:F,inputValue:V})}var ee="value"in this.props?L:this.state.value;"max"in this.props&&d.max!==I&&typeof ee=="number"&&ee>I&&x&&x(I),"min"in this.props&&d.min!==k&&typeof ee=="number"&&ee<k&&x&&x(k)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ie=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===g.a.BACKSPACE?ie=this.cursorStart-1:this.lastKeyCode===g.a.DELETE&&(ie=this.cursorStart):ie=this.input.value.length,this.fixCaret(ie,ie)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case g.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case g.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(pe){}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 O=d;return O===""?O="":this.isNotCompleteNumber(parseFloat(O))?O=this.state.value:O=this.getValidValue(O),this.toNumber(O)}},{key:"getValueFromEvent",value:function(d){var O=d.target.value.trim().replace(/。/g,".");return m(this.props.decimalSeparator)&&(O=O.replace(this.props.decimalSeparator,".")),O}},{key:"getValidValue",value:function(d){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,x=parseFloat(d);return isNaN(x)?d:(x<O&&(x=O),x>L&&(x=L),x)}},{key:"setValue",value:function(d,O){var L=this.props.precision,x=this.isNotCompleteNumber(parseFloat(d))?null:parseFloat(d),I=this.state.value,k=I===void 0?null:I,C=this.state.inputValue,F=C===void 0?null:C,V=typeof x=="number"?x.toFixed(L):"".concat(x),ee=x!==k||V!=="".concat(F);return"value"in this.props?(F=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:F},O)):this.setState({value:x,inputValue:this.toPrecisionAsStep(d)},O),ee&&this.props.onChange(x),x}},{key:"getMaxPrecision",value:function(d){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,L=this.props,x=L.precision,I=L.step;if(m(x))return x;var k=this.getPrecision(O),C=this.getPrecision(I),F=this.getPrecision(d);return d?Math.max(F,k+C):k+C}},{key:"getPrecisionFactor",value:function(d){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,L=this.getMaxPrecision(d,O);return Math.pow(10,L)}},{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 O=Math.abs(this.getMaxPrecision(d));return isNaN(O)?d.toString():Number(d).toFixed(O)}},{key:"toNumber",value:function(d){var O=this.props.precision,L=this.state.focused,x=d&&d.length>16&&L;return this.isNotCompleteNumber(d)||x?d:m(O)?Math.round(d*Math.pow(10,O))/Math.pow(10,O):Number(d)}},{key:"upStep",value:function(d,O){var L=this.props.step,x=this.getPrecisionFactor(d,O),I=Math.abs(this.getMaxPrecision(d,O)),k=((x*d+x*L*O)/x).toFixed(I);return this.toNumber(k)}},{key:"downStep",value:function(d,O){var L=this.props.step,x=this.getPrecisionFactor(d,O),I=Math.abs(this.getMaxPrecision(d,O)),k=((x*d-x*L*O)/x).toFixed(I);return this.toNumber(k)}},{key:"step",value:function(d,O){var L=this,x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,I=arguments.length>3?arguments[3]:void 0;this.stop(),O&&(O.persist(),O.preventDefault());var k=this.props;if(k.disabled)return;var C=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(C))return;var F=this["".concat(d,"Step")](C,x),V=F>k.max||F<k.min;if(F>k.max?F=k.max:F<k.min&&(F=k.min),this.setValue(F,null),this.setState({focused:!0},function(){L.pressingUpOrDown=!1}),V)return;this.autoStepTimer=setTimeout(function(){L[d](O,x,!0)},I?t:E)}},{key:"fixCaret",value:function(d,O){if(d===void 0||O===void 0||!this.input||!this.input.value)return;try{var L=this.input.selectionStart,x=this.input.selectionEnd;(d!==L||O!==x)&&this.input.setSelectionRange(d,O)}catch(I){}}},{key:"render",value:function(){var d,O=this.props,L=O.prefixCls,x=O.disabled,I=O.readOnly,k=O.useTouch,C=O.autoComplete,F=O.upHandler,V=O.downHandler,ee=O.className,ie=O.max,pe=O.min,ve=O.style,ye=O.title,Ee=O.onMouseEnter,Se=O.onMouseLeave,fe=O.onMouseOver,K=O.onMouseOut,R=O.required,D=O.onClick,H=O.tabIndex,J=O.type,M=O.placeholder,ae=O.id,me=O.inputMode,_e=O.pattern,q=O.step,oe=O.maxLength,ue=O.autoFocus,ce=O.name,be=O.onPaste,Ce=O.onInput,Oe=Object(ne.a)(O,["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"]),Ie=this.state,De=Ie.value,Me=Ie.focused,de=v()(L,(d={},Object(B.a)(d,ee,!!ee),Object(B.a)(d,"".concat(L,"-disabled"),x),Object(B.a)(d,"".concat(L,"-focused"),Me),d)),ge={};Object.keys(Oe).forEach(function(re){(re.substr(0,5)==="data-"||re.substr(0,5)==="aria-"||re==="role")&&(ge[re]=Oe[re])});var xe=!I&&!x,we=this.getInputDisplayValue(null),Z=(De||De===0)&&(isNaN(De)||Number(De)>=ie),z=(De||De===0)&&(isNaN(De)||Number(De)<=pe),G=Z||x||I,X=z||x||I,Q=v()("".concat(L,"-handler"),"".concat(L,"-handler-up"),Object(B.a)({},"".concat(L,"-handler-up-disabled"),G)),Y=v()("".concat(L,"-handler"),"".concat(L,"-handler-down"),Object(B.a)({},"".concat(L,"-handler-down-disabled"),X)),$=k?{onTouchStart:G?a:this.up,onTouchEnd:this.stop}:{onMouseDown:G?a:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},te=k?{onTouchStart:X?a:this.down,onTouchEnd:this.stop}:{onMouseDown:X?a:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return e.a.createElement("div",{className:de,style:ve,title:ye,onMouseEnter:Ee,onMouseLeave:Se,onMouseOver:fe,onMouseOut:K,onFocus:function(){return null},onBlur:function(){return null}},e.a.createElement("div",{className:"".concat(L,"-handler-wrap")},e.a.createElement("span",Object.assign({unselectable:"on"},$,{role:"button","aria-label":"Increase Value","aria-disabled":G,className:Q}),F||e.a.createElement("span",{unselectable:"on",className:"".concat(L,"-handler-up-inner"),onClick:n})),e.a.createElement("span",Object.assign({unselectable:"on"},te,{role:"button","aria-label":"Decrease Value","aria-disabled":X,className:Y}),V||e.a.createElement("span",{unselectable:"on",className:"".concat(L,"-handler-down-inner"),onClick:n}))),e.a.createElement("div",{className:"".concat(L,"-input-wrap")},e.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":pe,"aria-valuemax":ie,"aria-valuenow":De,required:R,type:J,placeholder:M,onPaste:be,onClick:D,onMouseUp:this.onMouseUp,className:"".concat(L,"-input"),tabIndex:H,autoComplete:C,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:xe?this.onKeyDown:a,onKeyUp:xe?this.onKeyUp:a,autoFocus:ue,maxLength:oe,readOnly:I,disabled:x,max:ie,min:pe,step:q,name:ce,title:ye,id:ae,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(we),pattern:_e,inputMode:me,onInput:Ce},ge))))}}]),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=se.a=f},fjLI:function(Le,se,U){"use strict";U.d(se,"f",function(){return c}),U.d(se,"b",function(){return s}),U.d(se,"a",function(){return i}),U.d(se,"d",function(){return l}),U.d(se,"e",function(){return a}),U.d(se,"c",function(){return n});var ne=U("8HAY"),B=U("Vhoy"),A=U("MI8n"),j=U("JYp7"),P=U("pmY6"),S=U("24hK"),W=U("nnTU"),N=U("T8No"),e=U("Cg/j"),w=U("t9D7"),v=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},g=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 A.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:r=>r===s.CommandPalette}}addCommand(r){return this.addCommands(j.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(j.a.single({id:r,item:t}))}appendMenuItems(r){const t=new Set,E=new S.a;for(const{id:y,item:m}of r){let T=this._menuItems.get(y);T||(T=new S.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 ne.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 ne.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,w.d.isThemeIcon(t.icon)&&(this.class=B.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=v([g(3,N.b),g(4,W.b)],n)},fyJ8:function(Le,se,U){"use strict";var ne=U("rePB"),B=U("VTBJ"),A=U("Ff2n"),j=U("U8pU"),P=U("q1tI"),S=U.n(P),W=U("TSYQ"),N=U.n(W),e=U("c+Xe"),w=U("sR1s");function v(l){return l&&Object(j.a)(l)==="object"&&!Array.isArray(l)&&!P.isValidElement(l)}function g(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,O=l.lastFixLeft,L=l.firstFixRight,x=l.lastFixRight,I=l.appendNode,k=l.additionalProps,C=k===void 0?{}:k,F=l.ellipsis,V=l.align,ee=l.rowType,ie=l.isSticky,pe="".concat(r,"-cell"),ve,ye;if(_)ye=_;else{var Ee=Object(w.b)(E,m);if(ye=Ee,T){var Se=T(Ee,E,y);v(Se)?(ye=Se.children,ve=Se.props):ye=Se}}Object(j.a)(ye)==="object"&&!Array.isArray(ye)&&!P.isValidElement(ye)&&(ye=null),F&&(O||L)&&(ye=P.createElement("span",{className:"".concat(pe,"-content")},ye));var fe=ve||{},K=fe.colSpan,R=fe.rowSpan,D=fe.style,H=fe.className,J=Object(A.a)(fe,["colSpan","rowSpan","style","className"]),M=K!==void 0?K:o,ae=R!==void 0?R:u;if(M===0||ae===0)return null;var me={},_e=typeof b=="number",q=typeof p=="number";_e&&(me.position="sticky",me.left=b),q&&(me.position="sticky",me.right=p);var oe={};V&&(oe.textAlign=V);var ue,ce=F===!0?{showTitle:!0}:F;ce&&(ce.showTitle||ee==="header")&&(typeof ye=="string"||typeof ye=="number"?ue=ye.toString():P.isValidElement(ye)&&typeof ye.props.children=="string"&&(ue=ye.props.children));var be=Object(B.a)(Object(B.a)(Object(B.a)({title:ue},J),C),{},{colSpan:M&&M!==1?M:null,rowSpan:ae&&ae!==1?ae:null,className:N()(pe,t,(n={},Object(ne.a)(n,"".concat(pe,"-fix-left"),_e),Object(ne.a)(n,"".concat(pe,"-fix-left-first"),d),Object(ne.a)(n,"".concat(pe,"-fix-left-last"),O),Object(ne.a)(n,"".concat(pe,"-fix-right"),q),Object(ne.a)(n,"".concat(pe,"-fix-right-first"),L),Object(ne.a)(n,"".concat(pe,"-fix-right-last"),x),Object(ne.a)(n,"".concat(pe,"-ellipsis"),F),Object(ne.a)(n,"".concat(pe,"-with-append"),I),Object(ne.a)(n,"".concat(pe,"-fix-sticky"),(_e||q)&&ie),n),C.className,H),style:Object(B.a)(Object(B.a)(Object(B.a)(Object(B.a)({},C.style),oe),me),D),ref:g(h)?a:null});return P.createElement(h,Object.assign({},be),I,ye)}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});se.a=i},hW8S:function(Le,se,U){"use strict";U.d(se,"a",function(){return j}),U.d(se,"c",function(){return P}),U.d(se,"b",function(){return S});var ne=U("VTBJ"),B=U("Ff2n"),A=U("Kwbf"),j="RC_TABLE_INTERNAL_COL_DEFINE";function P(W){var N=W.expandable,e=Object(B.a)(W,["expandable"]);return"expandable"in W?Object(ne.a)(Object(ne.a)({},e),N):e}function S(W){return Object.keys(W).reduce(function(N,e){return(e.substr(0,5)==="data-"||e.substr(0,5)==="aria-")&&(N[e]=W[e]),N},{})}},ic2d:function(Le,se,U){"use strict";U.d(se,"a",function(){return j});var ne=U("FWmy"),B=U("746U");class A{constructor(){this.data=new Map}add(P,S){ne.a(B.l(P)),ne.a(B.k(S)),ne.a(!this.data.has(P),"There is already an extension with this id"),this.data.set(P,S)}as(P){return this.data.get(P)||null}}const j=new A},mauG:function(Le,se,U){"use strict";U.r(se);var ne=U("DjyN"),B=U("NUBc"),A=U("g9YV"),j=U("wCAj"),P=U("2qtc"),S=U("kLXV"),W=U("miYZ"),N=U("tsqr"),e=U("7Kak"),w=U("9yH6"),v=U("sRBo"),g=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"),O=U("m3rI"),L=U("deN7"),x=U("J66h"),I=U.n(x),k=U("mgmH"),C=U("sZk2"),F=U.n(C),V=U("+92d"),ee=U.n(V),ie=U("wwSX"),pe=U.n(ie),ve=U("zlzj"),ye=U.n(ve),Ee=[ee.a,pe.a,ye.a],Se=function(K){var R,D,H,J,M,ae=K.user,me=Object(m.useState)(Object(r.a)(Object(r.a)({},Object(_.i)()),{},{page:1,per_page:10,rank_type:2,course_group:Object(o.t)()?[ae.userInfo.course.course_group_id]:[]})),_e=Object(t.a)(me,2),q=_e[0],oe=_e[1],ue=Object(m.useState)([]),ce=Object(t.a)(ue,2),be=ce[0],Ce=ce[1],Oe=Object(m.useState)([]),Ie=Object(t.a)(Oe,2),De=Ie[0],Me=Ie[1],de=Object(m.useState)([]),ge=Object(t.a)(de,2),xe=ge[0],we=ge[1];Object(m.useEffect)(function(){var G;ae!=null&&(G=ae.userInfo)!==null&&G!==void 0&&G.course&&(Object(o.t)()&&(q.course_group=Object(o.t)()?[ae.userInfo.course.course_group_id]:[],oe(Object(r.a)({},q))),Z(1))},[ae==null?void 0:ae.userInfo]);function Z(G){return z.apply(this,arguments)}function z(){return z=Object(n.a)(y.a.mark(function G(X){var Q,Y,$;return y.a.wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return re.next=2,Object(p.a)("/api/courses/question_rank_list.json",{method:"get",params:Object(r.a)(Object(r.a)({},q),{},{id:q.coursesId,identifier:q.homeworkId})});case 2:Q=re.sent,Ce(Q),Object(o.t)()?(X===1&&Me([Q==null||((Y=Q.course_group)===null||Y===void 0||(($=Y[0])===null||$===void 0))?void 0:$.id]),Q!=null&&Q.my_rank?we([Q==null?void 0:Q.my_rank].concat(Object(c.a)(Q==null?void 0:Q.rank_list))):we(Object(c.a)(Q==null?void 0:Q.rank_list))):we(Object(c.a)(Q==null?void 0:Q.rank_list));case 5:case"end":return re.stop()}},G)})),z.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(q.coursesId,"/program_homework/").concat(q.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 G(){var X;return y.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(p.a)("/api/problems/".concat(q.homeworkId,"/start.json"),{method:"get"});case 2:X=Y.sent,X&&(window.open("/myproblems/".concat(X==null?void 0:X.identifier,"?type=1")),localStorage.setItem("program_homework",[q.coursesId,q.categoryId]));case 4:case"end":return Y.stop()}},G)}))},"\u67E5\u770B\u9898\u76EE"),Object(o.c)()&&T.a.createElement(a.a,{onClick:function(){Object(k.u)(Object(r.a)(Object(r.a)({},q),{},{id:q.coursesId,identifier:q.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:F.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(g.a.Group,{className:b.a.checkboxgroup,value:De,onChange:function(X){if(q.type===1)Me([]),q.course_group=[],q.page=1,oe(Object(r.a)({},q)),Z();else if(q.type===2){var Q;Me(["\u5168\u90E8"].concat()),q.course_group=be==null||((Q=be.course_group)===null||Q===void 0)?void 0:Q.map(function(Y){return Y.id}),q.page=1,oe(Object(r.a)({},q)),Z()}else Me(Object(c.a)(X.filter(function(Y){return Y!="\u5168\u90E8"}))),q.course_group=X.filter(function(Y){return Y!="\u5168\u90E8"}),q.page=1,oe(Object(r.a)({},q)),Z()}},T.a.createElement(g.a,{value:"\u5168\u90E8",onChange:function(X){X.target.checked?q.type=2:q.type=1}},"\u5168\u90E8\u5206\u73ED"),be==null||((R=be.course_group)===null||R===void 0)?void 0:R.map(function(G,X){return T.a.createElement(g.a,{onChange:function(Y){q.type=3},value:G.id},G==null?void 0:G.name)}))),Object(o.t)()&&T.a.createElement(w.a.Group,{style:{flex:1,display:"flex",alignItems:"center"},onChange:function(X){X.target.value==="\u5168\u90E8"?(q.course_group=[],q.page=1,oe(Object(r.a)({},q)),Z()):(q.course_group=[X.target.value],q.page=1,oe(Object(r.a)({},q)),Z())},defaultValue:ae.userInfo.course.course_group_id},T.a.createElement(w.a,{value:"\u5168\u90E8"},"\u5168\u90E8\u5206\u73ED"),be==null||((D=be.course_group)===null||D===void 0)?void 0:D.map(function(G,X){return T.a.createElement(w.a,{value:G.id},G.name)}))),(be==null||((H=be.all_language)===null||H===void 0)?void 0:H.length)>1&&T.a.createElement("div",{style:{marginTop:10}},T.a.createElement("label",null,"\u7F16\u8BD1\u8BED\u8A00\uFF1A"),T.a.createElement(w.a.Group,{className:b.a.checkboxgroup,style:{width:"90%"},onChange:function(X){q.language=encodeURIComponent(X.target.value),q.page=1,oe(Object(r.a)({},q)),Z()},defaultValue:be==null||((J=be.all_language)===null||J===void 0)?void 0:J[0]},be==null||((M=be.all_language)===null||M===void 0)?void 0:M.map(function(G,X){return T.a.createElement(w.a,{value:G},G)}))),T.a.createElement(j.a,{style:{marginTop:10},pagination:!1,dataSource:xe,rowClassName:function(X,Q){return Q===0&&Object(o.t)()&&b.a.tables},columns:[{title:"\u6392\u884C",dataIndex:"rank",render:function(X,Q,Y){return X<4?T.a.createElement("img",{src:Ee[X-1]}):X}},{title:"\u7528\u6237",dataIndex:"user_name",key:"user_name",render:function(X,Q,Y){return T.a.createElement("div",null,T.a.createElement("img",{style:{width:30,height:30,borderRadius:"50%",marginRight:10},src:O.a.IMG_SERVER+"/images/"+(Q==null?void 0:Q.image_url)}),X)}},{title:"\u5B66\u53F7",dataIndex:"student_id",key:"student_id",render:function(X){return X||"- -"}},{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"},(be==null?void 0:be.open_code)&&{title:"\u64CD\u4F5C",dataIndex:"passed_rate",key:"passed_rate",render:function(X,Q){return T.a.createElement("div",{style:{cursor:"pointer",color:"rgb(22, 93, 255)"},onClick:Object(n.a)(y.a.mark(function Y(){var $;return y.a.wrap(function(re){for(;;)switch(re.prev=re.next){case 0:if(!((Q==null?void 0:Q.code)==="-")){re.next=3;break}return N.b.info("\u6682\u65E0\u4EE3\u7801"),re.abrupt("return");case 3:return re.next=5,Object(p.a)("/api/courses/view_code.json",{method:"get",params:Object(r.a)(Object(r.a)({},q),{},{id:q.coursesId,homework_common_id:q.homeworkId,hack_user_code_id:Q==null?void 0:Q.hack_user_code_id})});case 5:$=re.sent,S.a.warning({icon:null,title:"\u67E5\u770B\u4EE3\u7801",content:T.a.createElement(L.a,{languages:[{language:Q.language,code:$.code}],v:Q,shixunWorkReport:"shixunWorkReport",dispatch:"dispatch",autoHeight:!1,language:Q.language,game_id:Q.id,data:x.Base64.decode($.code),diff_code_count:Q.diff_code_count})});case 7:case"end":return re.stop()}},Y)}))},"\u67E5\u770B\u4EE3\u7801")}}].filter(function(G){return!!G})}),T.a.createElement("div",{style:{width:"100%",textAlign:"center",marginTop:10}},T.a.createElement(B.a,{current:q.page,pageSize:q.per_page,total:be==null?void 0:be.count,hideOnSinglePage:!0,onChange:function(X,Q){q.page=X,q.per_page=Q,oe(Object(r.a)({},q)),Z()}}))))};se.default=Object(h.a)(function(fe){var K=fe.user;return{user:K}})(Se)},mgmH:function(Le,se,U){"use strict";U.d(se,"d",function(){return c}),U.d(se,"b",function(){return s}),U.d(se,"e",function(){return i}),U.d(se,"c",function(){return l}),U.d(se,"n",function(){return a}),U.d(se,"g",function(){return n}),U.d(se,"h",function(){return r}),U.d(se,"j",function(){return E}),U.d(se,"a",function(){return y}),U.d(se,"l",function(){return m}),U.d(se,"f",function(){return T}),U.d(se,"k",function(){return _}),U.d(se,"m",function(){return f}),U.d(se,"i",function(){return h}),U.d(se,"o",function(){return o}),U.d(se,"t",function(){return u}),U.d(se,"s",function(){return b}),U.d(se,"p",function(){return p}),U.d(se,"q",function(){return d}),U.d(se,"r",function(){return O}),U.d(se,"v",function(){return L}),U.d(se,"u",function(){return x});var ne=U("miYZ"),B=U("tsqr"),A=U("k1fw"),j=U("9og8"),P=U("WmNS"),S=U.n(P),W=U("oUNq"),N=U("9kvl"),e=U("1vsH"),w=U("m3rI"),v=function(){Object(N.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..."}})},g=function(){Object(N.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}})},c=function(){var I=Object(j.a)(S.a.mark(function k(C){var F;return S.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return v(),ee.next=3,Object(W.t)(Object(A.a)({},C));case 3:if(F=ee.sent,!(F.status===0)){ee.next=7;break}return ee.next=7,Object(e.w)("",Object(e.Y)({url:w.a.API_SERVER+"/api/courses/".concat(C.coursesId,"/export_couser_info.json"),query:C}));case 7:g();case 8:case"end":return ee.stop()}},k)}));return function(C){return I.apply(this,arguments)}}(),s=function(){var I=Object(j.a)(S.a.mark(function k(C){var F;return S.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return ee.next=2,Object(W.r)(Object(A.a)({},C));case 2:if(F=ee.sent,!(F.status===0)){ee.next=8;break}B.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),N.d.push("/classrooms/".concat(C.coursesId,"/exportlist/course_member_act_score")),ee.next=13;break;case 8:if(!(F.status===-2)){ee.next=12;break}return ee.abrupt("return",F);case 12:F.status===-3&&(Object(N.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),N.d.push("/classrooms/".concat(C.coursesId,"/exportlist/course_member_act_score")));case 13:case"end":return ee.stop()}},k)}));return function(C){return I.apply(this,arguments)}}(),i=function(){var I=Object(j.a)(S.a.mark(function k(C){var F;return S.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return ee.next=2,Object(W.u)(Object(A.a)({},C));case 2:if(F=ee.sent,!(F.status===0)){ee.next=8;break}B.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),N.d.push("/classrooms/".concat(C.coursesId,"/exportlist/course_total_score")),ee.next=13;break;case 8:if(!(F.status===-2)){ee.next=12;break}return ee.abrupt("return",F);case 12:F.status===-3&&(Object(N.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),N.d.push("/classrooms/".concat(C.coursesId,"/exportlist/course_total_score")));case 13:case"end":return ee.stop()}},k)}));return function(C){return I.apply(this,arguments)}}(),l=function(){var I=Object(j.a)(S.a.mark(function k(C){var F;return S.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return ee.next=2,Object(W.s)(Object(A.a)({},C));case 2:if(F=ee.sent,!(F.status===0)){ee.next=8;break}B.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),N.d.push("/classrooms/".concat(C.coursesId,"/exportlist/course_total_exercise_and_other")),ee.next=13;break;case 8:if(!(F.status===-2)){ee.next=12;break}return ee.abrupt("return",F);case 12:F.status===-3&&(Object(N.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),N.d.push("/classrooms/".concat(C.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return ee.stop()}},k)}));return function(C){return I.apply(this,arguments)}}(),a=function(){var I=Object(j.a)(S.a.mark(function k(C){var F;return S.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return ee.next=2,Object(W.z)(Object(A.a)({},C));case 2:if(F=ee.sent,!(F.status===0)){ee.next=8;break}B.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),N.d.push("/classrooms/".concat(C.coursesId,"/exportlist/course_total_exercise_and_other")),ee.next=13;break;case 8:if(!(F.status===-2)){ee.next=12;break}return ee.abrupt("return",F);case 12:F.status===-3&&(Object(N.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),N.d.push("/classrooms/".concat(C.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return ee.stop()}},k)}));return function(C){return I.apply(this,arguments)}}(),n=function(){var I=Object(j.a)(S.a.mark(function k(C){var F;return S.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return ee.next=2,Object(W.v)(Object(A.a)({},C));case 2:if(F=ee.sent,!(F.status===0)){ee.next=8;break}B.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),N.d.push("/classrooms/".concat(C.coursesId,"/exportlist/course_total_homework")),ee.next=13;break;case 8:if(!(F.status===-2)){ee.next=12;break}return ee.abrupt("return",F);case 12:F.status===-3&&(Object(N.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),N.d.push("/classrooms/".concat(C.coursesId,"/exportlist/course_total_homework")));case 13:case"end":return ee.stop()}},k)}));return function(C){return I.apply(this,arguments)}}(),r=function(){var I=Object(j.a)(S.a.mark(function k(C,F){var V;return S.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return ie.next=2,Object(W.x)(Object(A.a)({},C));case 2:V=ie.sent,V.status===0?(B.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),N.d.push("/classrooms/".concat(C.coursesId,"/exportlist/").concat(F))):V.status===-3&&(Object(N.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),N.d.push("/classrooms/".concat(C.coursesId,"/exportlist/").concat(F)));case 4:case"end":return ie.stop()}},k)}));return function(C,F){return I.apply(this,arguments)}}(),t=function(){var I=Object(j.a)(S.a.mark(function k(C){var F;return S.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return v(),ee.next=3,Object(W.w)(Object(A.a)({},C));case 3:if(F=ee.sent,!(F.status===0)){ee.next=7;break}return ee.next=7,Object(e.w)("",Object(e.Y)({url:w.a.API_SERVER+"/api/homework_commons/".concat(C.categoryId,"/works_list.zip"),query:C}));case 7:g();case 8:case"end":return ee.stop()}},k)}));return function(C){return I.apply(this,arguments)}}(),E=function(){var I=Object(j.a)(S.a.mark(function k(C){var F;return S.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return v(),ee.next=3,Object(W.A)(Object(A.a)({},C));case 3:if(F=ee.sent,!(F.status===0)){ee.next=7;break}return ee.next=7,Object(e.w)("",Object(e.Y)({url:w.a.API_SERVER+"/api/polls/".concat(C.categoryId,"/commit_result.xlsx"),query:C}));case 7:g();case 8:case"end":return ee.stop()}},k)}));return function(C){return I.apply(this,arguments)}}(),y=function(){var I=Object(j.a)(S.a.mark(function k(C){return S.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,Object(e.v)("",Object(e.Y)({url:w.a.API_SERVER+"/api/courses/".concat(C.coursesId,"/attendances/export_xlsx_data.xlsx"),query:C}));case 2:case"end":return V.stop()}},k)}));return function(C){return I.apply(this,arguments)}}(),m=function(){var I=Object(j.a)(S.a.mark(function k(C){return S.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,Object(e.v)("",Object(e.Y)({url:w.a.API_SERVER+"/api/courses/".concat(C.coursesId,"/video_study_statics.xlsx"),query:C}));case 2:case"end":return V.stop()}},k)}));return function(C){return I.apply(this,arguments)}}(),T=function(){var I=Object(j.a)(S.a.mark(function k(C){return S.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,Object(e.v)("",Object(e.Y)({url:w.a.API_SERVER+"/api/courses/".concat(C.coursesId,"/export_course_students_info.xlsx"),query:C}));case 2:case"end":return V.stop()}},k)}));return function(C){return I.apply(this,arguments)}}(),_=function(){var I=Object(j.a)(S.a.mark(function k(C){return S.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,Object(e.v)("",Object(e.Y)({url:w.a.API_SERVER+"/api/item_banks/export.xlsx",query:C}));case 2:case"end":return V.stop()}},k)}));return function(C){return I.apply(this,arguments)}}(),f=function(){var I=Object(j.a)(S.a.mark(function k(C){return S.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,Object(e.v)("",Object(e.Y)({url:w.a.API_SERVER+"/api/competitions/region_reports.xlsx",query:C}));case 2:case"end":return V.stop()}},k)}));return function(C){return I.apply(this,arguments)}}(),h=function(){var I=Object(j.a)(S.a.mark(function k(C){var F;return S.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return ee.next=2,Object(W.y)(Object(A.a)({},C));case 2:F=ee.sent,F.status===0?(B.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),N.d.push("/classrooms/".concat(C.coursesId,"/exportlist/exercise_score"))):F.status===-3&&(Object(N.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),N.d.push("/classrooms/".concat(C.coursesId,"/exportlist/exercise_score")));case 4:case"end":return ee.stop()}},k)}));return function(C){return I.apply(this,arguments)}}(),o=function(){var I=Object(j.a)(S.a.mark(function k(C){return S.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return console.log("----------","\u8C03\u7528\u4E0B\u8F7D"),V.next=3,Object(e.v)("",Object(e.Y)({url:w.a.API_SERVER+"/api/export_records/".concat(C.id,".xlsx"),query:C}));case 3:case"end":return V.stop()}},k)}));return function(C){return I.apply(this,arguments)}}(),u=function(){var I=Object(j.a)(S.a.mark(function k(C){return S.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,Object(e.v)("",Object(e.Y)({url:w.a.API_SERVER+"/api/ec_major_schools/0/ec_years.xlsx",query:C}));case 2:case"end":return V.stop()}},k)}));return function(C){return I.apply(this,arguments)}}(),b=function(){var I=Object(j.a)(S.a.mark(function k(C){return S.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,Object(e.v)("",Object(e.Y)({url:w.a.API_SERVER+"/api/ec_years/".concat(C==null?void 0:C.ec_year_id,"/ec_training_objectives.xlsx"),query:C}));case 2:case"end":return V.stop()}},k)}));return function(C){return I.apply(this,arguments)}}(),p=function(){var I=Object(j.a)(S.a.mark(function k(C){return S.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,Object(e.v)(C==null?void 0:C.name,Object(e.Y)({url:w.a.API_SERVER+"/api/attachments/get_ecs_attachment.docx",query:C}));case 2:case"end":return V.stop()}},k)}));return function(C){return I.apply(this,arguments)}}(),d=function(){var I=Object(j.a)(S.a.mark(function k(C){return S.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,Object(e.v)("",Object(e.Y)({url:w.a.API_SERVER+"/api/ec_years/".concat(C==null?void 0:C.ec_year_id,"/ec_courses.xlsx"),query:C}));case 2:case"end":return V.stop()}},k)}));return function(C){return I.apply(this,arguments)}}(),O=function(){var I=Object(j.a)(S.a.mark(function k(C){return S.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,Object(e.v)("",Object(e.Y)({url:w.a.API_SERVER+"/api/ec_years/".concat(C==null?void 0:C.ec_year_id,"/ec_graduation_requirements.xlsx"),query:C}));case 2:case"end":return V.stop()}},k)}));return function(C){return I.apply(this,arguments)}}(),L=function(){var I=Object(j.a)(S.a.mark(function k(C){return S.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,Object(e.v)("",Object(e.Y)({url:w.a.API_SERVER+"/api/courses/rank_list.xlsx",query:C}));case 2:case"end":return V.stop()}},k)}));return function(C){return I.apply(this,arguments)}}(),x=function(){var I=Object(j.a)(S.a.mark(function k(C){return S.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,Object(e.v)("",Object(e.Y)({url:w.a.API_SERVER+"/api/courses/question_rank_list.xlsx",query:C}));case 2:case"end":return V.stop()}},k)}));return function(C){return I.apply(this,arguments)}}()},n6Qo:function(Le,se,U){"use strict";U.d(se,"a",function(){return N});var ne=U("q1tI"),B=U("biw7"),A=U("fyJ8");function j(e){var w=e.className,v=e.index,g=e.children,c=e.colSpan,s=e.rowSpan,i=ne.useContext(B.a),l=i.prefixCls,a=i.fixedInfoList,n=a[v];return ne.createElement(A.a,Object.assign({className:w,index:v,component:"td",prefixCls:l,record:null,dataIndex:null,render:function(){return{children:g,props:{colSpan:c,rowSpan:s}}}},n))}function P(e){return ne.createElement("tr",Object.assign({},e))}function S(e){var w=e.children,v=ne.useContext(B.a),g=v.prefixCls;return ne.createElement("tfoot",{className:"".concat(g,"-summary")},w)}var W=se.b=S,N={Cell:j,Row:P}},nEHx:function(Le,se,U){"use strict";U.d(se,"a",function(){return ne});var ne;(function(B){B.DARK="dark",B.LIGHT="light",B.HIGH_CONTRAST="hc"})(ne||(ne={}))},nnTU:function(Le,se,U){"use strict";U.d(se,"b",function(){return W}),U.d(se,"a",function(){return N});var ne=U("MI8n"),B=U("JYp7"),A=U("pmY6"),j=U("24hK"),P=U("746U"),S=U("Cg/j");const W=Object(S.c)("commandService"),N=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ne.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,w){if(!e)throw new Error("invalid command");if(typeof e=="string"){if(!w)throw new Error("invalid command");return this.registerCommand({id:e,handler:w})}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:v}=e;let g=this._commands.get(v);g||(g=new j.a,this._commands.set(v,g));let c=g.unshift(e),s=Object(A.i)(()=>{c();const i=this._commands.get(v);(i==null?void 0:i.isEmpty())&&this._commands.delete(v)});return this._onDidRegisterCommand.fire(v),s}registerCommandAlias(e,w){return N.registerCommand(e,(v,...g)=>v.get(W).executeCommand(w,...g))}getCommand(e){const w=this._commands.get(e);return!w||w.isEmpty()?void 0:B.a.first(w)}getCommands(){const e=new Map;for(const w of this._commands.keys()){const v=this.getCommand(w);v&&e.set(w,v)}return e}};N.registerCommand("noop",()=>{})},p5ED:function(Le,se,U){"use strict";var ne=U("+L6B"),B=U("2/Rp"),A=U("5Dmo"),j=U("3S7+"),P=U("k1fw"),S=U("9og8"),W=U("tJVT"),N=U("WmNS"),e=U.n(N),w=U("q1tI"),v=U.n(w),g=U("vHTk"),c=U.n(g),s=U("yEEn"),i=U("ZW9T"),l=U("1vsH"),a=U("V0Rq"),n=U("m3rI");se.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,O=r.monacoEditor,L=r.className,x=r.style,I=r.close,k=r.onClose,C=r.hasMask,F=r.disabledDownload,V=Object(w.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ee=Object(W.a)(V,2),ie=ee[0],pe=ee[1],ve=Object(w.useState)(""),ye=Object(W.a)(ve,2),Ee=ye[0],Se=ye[1],fe=Object(w.useState)(),K=Object(W.a)(fe,2),R=K[0],D=K[1],H=window.ENV==="build"?"/react/build":"",J=n.a.PROXY_SERVER||location.origin,M,ae=1024*1024,me=10*ae,_e=Object(w.useRef)();(t=u)!==null&&t!==void 0&&t.startsWith("/api")&&p!=="txt"&&(u=(n.a.API_SERVER||location.origin)+u),p==="office"&&(M=Object(l.T)(u).filesize,M>me&&(p="other")),d&&O&&(O.filename=d),Object(w.useEffect)(function(){var ce,be,Ce=(ce=document.cookie)===null||ce===void 0||((be=ce.replace(/\s/g,""))===null||be===void 0)?void 0:be.split(";");Ce==null||Ce.map(function(Oe){var Ie=Oe.split("=");Ie[0]==="_educoder_session"&&Se(Ie[1])})},[]),Object(w.useEffect)(function(){p==="office"&&q()},[p,u]);var q=function(){var ce=Object(S.a)(e.a.mark(function be(){var Ce,Oe,Ie;return e.a.wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:return console.log("data:",u),Ce=u,u.startsWith("http")||(Ce=location.origin+Ce),Oe=new URL(Ce).pathname.split("/").pop(),Me.next=6,Object(a.V)({attachment_id:Oe});case 6:Ie=Me.sent,D(Ie);case 8:case"end":return Me.stop()}},be)}));return function(){return ce.apply(this,arguments)}}(),oe=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 v.a.createElement("div",{style:Object(P.a)({},x||{}),className:"".concat(C&&c.a.bgBlack," ").concat(p?c.a.wrp:"hide")},I&&v.a.createElement("div",{className:c.a.close,ref:_e},!F&&v.a.createElement(j.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return _e.current}},v.a.createElement("span",{onClick:ue},v.a.createElement("i",{className:"icon-quxiaozhiding"}))),v.a.createElement(j.a,{title:"\u5173\u95ED",getPopupContainer:function(){return _e.current}},v.a.createElement("span",{className:"",onClick:k},v.a.createElement("i",{className:"icon-guanbi1"})))),v.a.createElement("div",{className:"".concat(c.a[L]," ").concat(L," ").concat(c.a.monaco," ").concat(p==="txt"?"show":"hide")},p==="txt"&&v.a.createElement(i.b,O)),p==="audio"&&v.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"&&v.a.createElement(v.a.Fragment,null,((m=u)===null||m===void 0?void 0:m.indexOf("http"))>-1?v.a.createElement("video",{controls:!0,src:"".concat(u),autoPlay:!0}):v.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(u),autoPlay:!0})),p==="office"&&R&&v.a.createElement("iframe",{src:"".concat(H,"/office.html?key=").concat(R.key,"&url=").concat(J+R.url,"&callbackUrl=").concat(J+R.callbackUrl,"&fileType=").concat(R.fileType,"&title=").concat(R.title,"&model=").concat(o,"&officeServer=").concat(n.a.OFFICE_SERVER,"&disabledDownload=").concat(!!F)}),p==="html"&&v.a.createElement("iframe",{src:u+"&disposition=inline"}),p==="pdf"&&v.a.createElement("iframe",{src:"".concat(H,"/js/pdfview/index.html?url=").concat(u,"&disabledDownload=").concat(!!F)}),p==="image"&&v.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"&&v.a.createElement("div",null,v.a.createElement(B.a,{type:"primary",size:"large",onClick:oe},v.a.createElement(s.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),p==="download"&&v.a.createElement(B.a,{type:"primary",size:"large",onClick:oe},v.a.createElement(s.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},pmY6:function(Le,se,U){"use strict";U.d(se,"h",function(){return w}),U.d(se,"g",function(){return g}),U.d(se,"f",function(){return c}),U.d(se,"e",function(){return s}),U.d(se,"i",function(){return i}),U.d(se,"b",function(){return l}),U.d(se,"a",function(){return a}),U.d(se,"d",function(){return n}),U.d(se,"c",function(){return r});var ne=U("C/vA"),B=U("JYp7");const A=!1;let j=null;function P(t){j=t}if(A){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 S(t){return j==null||j.trackDisposable(t),t}function W(t){j==null||j.markAsDisposed(t)}function N(t,E){j==null||j.setParent(t,E)}function e(t,E){if(!j)return;for(const y of t)j.setParent(y,E)}function w(t){return j==null||j.markAsSingleton(t),t}class v extends Error{constructor(t){super(`Encountered errors while disposing of store. Errors: [${t.join(", ")}]`);this.errors=t}}function g(t){return typeof t.dispose=="function"&&t.dispose.length===0}function c(t){if(B.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 v(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=S({dispose:Object(ne.a)(()=>{W(E),t()})});return E}class l{constructor(){this._toDispose=new Set,this._isDisposed=!1,S(this)}dispose(){if(this._isDisposed)return;W(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,S(this),N(this._store,this)}dispose(){W(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,S(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,W(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(Le,se,U){var ne,B;(function(){var A;(function(){"use strict";var W=[,,function(v){function g(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=[]}g.prototype.clone_empty=function(){var i=new g(this.__parent);return i.set_indent(this.__indent_count,this.__alignment_count),i},g.prototype.item=function(i){return i<0?this.__items[this.__items.length+i]:this.__items[i]},g.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},g.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))},g.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)},g.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},g.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},g.prototype.is_empty=function(){return this.__items.length===0},g.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},g.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},g.prototype.pop=function(){var i=null;return this.is_empty()||(i=this.__items.pop(),this.__character_count-=i.length),i},g.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},g.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},g.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},g.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 g(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 g(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},v.exports.Output=s},function(v){function g(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}v.exports.Token=g},,,function(v){function g(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"])}g.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},g.prototype._get_boolean=function(i,l){var a=this.raw_options[i],n=a===void 0?!!l:!!a;return n},g.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},g.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},g.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]},g.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},g.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}v.exports.Options=g,v.exports.normalizeOpts=s,v.exports.mergeOpts=c},,function(v){var g=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&&!(g&&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&&g&&(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},v.exports.InputScanner=c},function(v,g,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()},v.exports.Tokenizer=r,v.exports.TOKEN=n},function(v){function g(c){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=c}g.prototype.restart=function(){this.__position=0},g.prototype.isEmpty=function(){return this.__tokens_length===0},g.prototype.hasNext=function(){return this.__position<this.__tokens_length},g.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__tokens[this.__position],this.__position+=1),c},g.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},g.prototype.add=function(c){this.__parent_token&&(c.parent=this.__parent_token),this.__tokens.push(c),this.__tokens_length+=1},v.exports.TokenStream=g},function(v,g,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},v.exports.WhitespacePattern=i},function(v){function g(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)}g.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},g.prototype.read_match=function(){return this._input.match(this._match_pattern)},g.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},g.prototype.until=function(c){var s=this._create();return s._until_after=!1,s._until_pattern=this._input.get_regexp(c),s._update(),s},g.prototype.starting_with=function(c){var s=this._create();return s._starting_pattern=this._input.get_regexp(c,!0),s._update(),s},g.prototype.matching=function(c){var s=this._create();return s._match_pattern=this._input.get_regexp(c,!0),s._update(),s},g.prototype._create=function(){return new g(this._input,this)},g.prototype._update=function(){},v.exports.Pattern=g},function(v){function g(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")}g.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},g.prototype.readIgnored=function(c){return c.readUntilAfter(this.__directives_end_ignore_pattern)},v.exports.Directives=g},function(v,g,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},v.exports.TemplatablePattern=l},,,,function(v,g,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()}v.exports=l,v.exports.defaultOptions=function(){return new i}},function(v,g,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,O=null;return p.closed?(b==="script"?d="text/javascript":b==="style"&&(d="text/css"),d=E(p)||d,d.search("text/css")>-1?O="css":d.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?O="javascript":d.search(/(text|application|dojo)\/(x-)?(html)/)>-1?O="html":d.search(/test\/null/)>-1&&(O="null"),O):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,O){this._source_text=b||"",p=p||{},this._js_beautify=d,this._css_beautify=O,this._tag_stack=null;var L=new s(p,"html");this._options=L,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],O={text:"",type:""},L=new h,x=new t(this._options,d),I=new l(b,this._options).tokenize();this._tag_stack=new _(x);for(var k=null,C=I.next();C.type!==a.EOF;)C.type===a.TAG_OPEN||C.type===a.COMMENT?(k=this._handle_tag_open(x,C,L,O),L=k):C.type===a.ATTRIBUTE||C.type===a.EQUALS||C.type===a.VALUE||C.type===a.TEXT&&!L.tag_complete?k=this._handle_inside_tag(x,C,L,I):C.type===a.TAG_CLOSE?k=this._handle_tag_close(x,C,L):C.type===a.TEXT?k=this._handle_text(x,C,L):x.add_raw_token(C),O=k,C=I.next();var F=x._output.get_code(p);return F},f.prototype._handle_tag_close=function(b,p,d){var O={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(),O},f.prototype._handle_inside_tag=function(b,p,d,O){var L=d.has_wrapped_attrs,x={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),L=L||p.newlines!==0),this._is_wrap_attributes_force)){var I=d.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&d.attr_count===1){var k=!0,C=0,F;do{if(F=O.peek(C),F.type===a.ATTRIBUTE){k=!1;break}C+=1}while(C<4&&F.type!==a.EOF&&F.type!==a.TAG_CLOSE);I=!k}I&&(b.print_newline(!1),L=!0)}b.print_token(p),L=L||b.previous_token_wrapped(),d.has_wrapped_attrs=L}return x},f.prototype._handle_text=function(b,p,d){var O={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)),O},f.prototype._print_custom_beatifier_text=function(b,p,d){var O=this;if(p.text!==""){var L=p.text,x,I=1,k="",C="";d.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?x=this._js_beautify:d.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?x=this._css_beautify:d.custom_beautifier_name==="html"&&(x=function(ve,ye){var Ee=new f(ve,ye,O._js_beautify,O._css_beautify);return Ee.beautify()}),this._options.indent_scripts==="keep"?I=0:this._options.indent_scripts==="separate"&&(I=-b.indent_level);var F=b.get_full_indent(I);if(L=L.replace(/\n[ \t]*$/,""),d.custom_beautifier_name!=="html"&&L[0]==="<"&&L.match(/^(<!--|<!\[CDATA\[)/)){var V=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(L);if(!V){b.add_raw_token(p);return}k=F+V[1]+`
`,L=V[4],V[5]&&(C=F+V[5]),L=L.replace(/\n[ \t]*$/,""),(V[2]||V[3].indexOf(`
`)!==-1)&&(V=V[3].match(/[ \t]+$/),V&&(p.whitespace_before=V[0]))}if(L)if(x){var ee=function(){this.eol=`
`};ee.prototype=this._options.raw_options;var ie=new ee;L=x(F+L,ie)}else{var pe=p.whitespace_before;pe&&(L=L.replace(new RegExp(`
(`+pe+")?","g"),`
`)),L=F+L.replace(/\n/g,`
`+F)}k&&(L?L=k+L+`
`+C:L=k+C),b.print_newline(!1),L&&(p.text=L,p.whitespace_before="",p.newlines=0,b.add_raw_token(p),b.print_newline(!0))}},f.prototype._handle_tag_open=function(b,p,d,O){var L=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),L.start_tag_token=this._tag_stack.try_pop(L.tag_name)):(b.traverse_whitespace(p),this._set_tag_position(b,p,L,d,O),L.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)&&(L.alignment_size=p.text.length+1),!L.tag_complete&&!L.is_unformatted&&(b.alignment_size=L.alignment_size),L};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 O=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(O=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(O)))}};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,O,L){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 x=b.current_line_has_match(/{{#if/);x||b.print_newline(!1)}d.tag_name==="!--"&&L.type===a.TAG_CLOSE&&O.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 I=!1;I=d.start_tag_token&&d.start_tag_token.multiline_content,I=I||!d.is_inline_element&&!(O.is_inline_element||O.is_unformatted)&&!(L.type===a.TAG_CLOSE&&d.start_tag_token===O)&&L.type!=="TK_CONTENT",(d.is_content_unformatted||d.is_unformatted)&&(I=!1),I&&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)&&(L.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},v.exports.Beautifier=f},function(v,g,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,v.exports.Options=i},function(v,g,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)},v.exports.Tokenizer=E,v.exports.TOKEN=r}],N={};function e(v){var g=N[v];if(g!==void 0)return g.exports;var c=N[v]={exports:{}};return W[v](c,c.exports,e),c.exports}var w=e(18);A=w})();var j=A;if(!0)!(ne=[U,U("6UM0"),U("TXwP")],B=function(W){var N=U("6UM0"),e=U("TXwP");return{html_beautify:function(w,v){return j(w,v,N.js_beautify,e.css_beautify)}}}.apply(se,ne),B!==void 0&&(Le.exports=B));else var P,S})()},"rAM+":function(Le,se,U){"use strict";U.d(se,"a",function(){return B});var ne=U("Qw5x");function B(A,j){var P;if(typeof Symbol=="undefined"||A[Symbol.iterator]==null){if(Array.isArray(A)||(P=Object(ne.a)(A))||j&&A&&typeof A.length=="number"){P&&(A=P);var S=0,W=function(){};return{s:W,n:function(){return S>=A.length?{done:!0}:{done:!1,value:A[S++]}},e:function(g){throw g},f:W}}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,w;return{s:function(){P=A[Symbol.iterator]()},n:function(){var g=P.next();return N=g.done,g},e:function(g){e=!0,w=g},f:function(){try{!N&&P.return!=null&&P.return()}finally{if(e)throw w}}}}},rUJ1:function(Le,se){const U=/[&<>"']/,ne=/[&<>"']/g,B=/[<>"']|&(?!#?\w+;)/,A=/[<>"']|&(?!#?\w+;)/g,j={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},P=_=>j[_];function S(_,f){if(f){if(U.test(_))return _.replace(ne,P)}else if(B.test(_))return _.replace(A,P);return _}const W=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function N(_){return _.replace(W,(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 w(_,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 v=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function c(_,f,h){if(_){let o;try{o=decodeURIComponent(N(h)).replace(v,"").toLowerCase()}catch(u){return null}if(o.indexOf("javascript:")===0||o.indexOf("vbscript:")===0||o.indexOf("data:")===0)return null}f&&!g.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 O=!1,L=p;for(;--L>=0&&d[L]==="\\";)O=!O;return O?"|":" |"}),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")}Le.exports={escape:S,unescape:N,edit:w,cleanUrl:c,resolveUrl:n,noopTest:r,merge:t,splitCells:E,rtrim:y,findClosingBracket:m,checkSanitizeDeprecation:T}},sR1s:function(Le,se,U){"use strict";U.d(se,"b",function(){return j}),U.d(se,"a",function(){return P}),U.d(se,"c",function(){return S}),U.d(se,"d",function(){return W});var ne=U("U8pU"),B="RC_TABLE_KEY";function A(N){return N==null?[]:Array.isArray(N)?N:[N]}function j(N,e){if(!e&&typeof e!="number")return N;for(var w=A(e),v=N,g=0;g<w.length;g+=1){if(!v)return null;var c=w[g];v=v[c]}return v}function P(N){var e=[],w={};return N.forEach(function(v){for(var g=v||{},c=g.key,s=g.dataIndex,i=c||A(s).join("-")||B;w[i];)i="".concat(i,"_next");w[i]=!0,e.push(i)}),e}function S(){var N={};function e(c,s){s&&Object.keys(s).forEach(function(i){var l=s[i];l&&Object(ne.a)(l)==="object"?(c[i]=c[i]||{},e(c[i],l)):c[i]=l})}for(var w=arguments.length,v=new Array(w),g=0;g<w;g++)v[g]=arguments[g];return v.forEach(function(c){e(N,c)}),N}function W(N){return N!=null}},sZk2:function(Le,se,U){Le.exports=U.p+"static/paix.41effcff.svg"},sboe:function(Le,se,U){"use strict";U.d(se,"a",function(){return A});var ne=U("q1tI"),B=U.n(ne),A=ne.createContext(null)},t23M:function(Le,se,U){"use strict";var ne=U("VTBJ"),B=U("1OyB"),A=U("vuIU"),j=U("Ji7U"),P=U("LK+K"),S=U("q1tI"),W=U.n(S),N=U("m+aA"),e=U("Zm9Q"),w=U("Kwbf"),v=U("c+Xe"),g=U("bdgK"),c="rc-observer-key",s=function(i){Object(j.a)(a,i);var l=Object(P.a)(a);function a(){var n;return Object(B.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(ne.a)(Object(ne.a)({},u),{},{offsetWidth:_,offsetHeight:f}))})}},n.setChildNode=function(r){n.childNode=r},n}return Object(A.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 g.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(w.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(t.length===0)return Object(w.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var E=t[0];if(S.isValidElement(E)&&Object(v.c)(E)){var y=E.ref;t[0]=S.cloneElement(E,{ref:Object(v.a)(y,this.setChildNode)})}return t.length===1?t[0]:t.map(function(m,T){return!S.isValidElement(m)||"key"in m&&m.key!==null?m:S.cloneElement(m,{key:"".concat(c,"-").concat(T)})})}}]),a}(S.Component);s.displayName="ResizeObserver",se.a=s},t9D7:function(Le,se,U){"use strict";U.d(se,"b",function(){return W}),U.d(se,"g",function(){return e}),U.d(se,"d",function(){return w}),U.d(se,"e",function(){return v}),U.d(se,"a",function(){return g}),U.d(se,"f",function(){return i}),U.d(se,"c",function(){return l});var ne=U("Vhoy"),B=U("MI8n"),A=U("pmY6"),j=U("Cg/j"),P=U("ic2d"),S=U("nEHx");const W=Object(j.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 w;(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(`^\\$\\((${ne.a.iconNameExpression}(?:${ne.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=ne.a.asClassNameArray,a.asClassName=ne.a.asClassName,a.asCSSSelector=ne.a.asCSSSelector})(w||(w={}));function v(a){switch(a){case S.a.DARK:return"vs-dark";case S.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const g={ThemingContribution:"base.contributions.theming"};class c{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new B.b}onColorThemeChange(a){return this.themingParticipants.push(a),this.onThemingParticipantAddedEmitter.fire(a),Object(A.i)(()=>{const n=this.themingParticipants.indexOf(a);this.themingParticipants.splice(n,1)})}getThemingParticipants(){return this.themingParticipants}}let s=new c;P.a.add(g.ThemingContribution,s);function i(a){return s.onColorThemeChange(a)}class l extends A.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(Le,se,U){typeof window!="undefined"&&function(B,A){Le.exports=A()}(this,function(){return function(ne){var B={};function A(j){if(B[j])return B[j].exports;var P=B[j]={i:j,l:!1,exports:{}};return ne[j].call(P.exports,P,P.exports,A),P.l=!0,P.exports}return A.m=ne,A.c=B,A.d=function(j,P,S){A.o(j,P)||Object.defineProperty(j,P,{enumerable:!0,get:S})},A.r=function(j){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(j,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(j,"__esModule",{value:!0})},A.t=function(j,P){if(P&1&&(j=A(j)),P&8)return j;if(P&4&&typeof j=="object"&&j&&j.__esModule)return j;var S=Object.create(null);if(A.r(S),Object.defineProperty(S,"default",{enumerable:!0,value:j}),P&2&&typeof j!="string")for(var W in j)A.d(S,W,function(N){return j[N]}.bind(null,W));return S},A.n=function(j){var P=j&&j.__esModule?function(){return j.default}:function(){return j};return A.d(P,"a",P),P},A.o=function(j,P){return Object.prototype.hasOwnProperty.call(j,P)},A.p="/dist/",A(A.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ne,B,A){"use strict";var j=Object.prototype.hasOwnProperty,P="~";function S(){}Object.create&&(S.prototype=Object.create(null),new S().__proto__||(P=!1));function W(v,g,c){this.fn=v,this.context=g,this.once=c||!1}function N(v,g,c,s,i){if(typeof c!="function")throw new TypeError("The listener must be a function");var l=new W(c,s||v,i),a=P?P+g:g;return v._events[a]?v._events[a].fn?v._events[a]=[v._events[a],l]:v._events[a].push(l):(v._events[a]=l,v._eventsCount++),v}function e(v,g){--v._eventsCount===0?v._events=new S:delete v._events[g]}function w(){this._events=new S,this._eventsCount=0}w.prototype.eventNames=function(){var g=[],c,s;if(this._eventsCount===0)return g;for(s in c=this._events)j.call(c,s)&&g.push(P?s.slice(1):s);return Object.getOwnPropertySymbols?g.concat(Object.getOwnPropertySymbols(c)):g},w.prototype.listeners=function(g){var c=P?P+g:g,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},w.prototype.listenerCount=function(g){var c=P?P+g:g,s=this._events[c];return s?s.fn?1:s.length:0},w.prototype.emit=function(g,c,s,i,l,a){var n=P?P+g:g;if(!this._events[n])return!1;var r=this._events[n],t=arguments.length,E,y;if(r.fn){r.once&&this.removeListener(g,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(g,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},w.prototype.on=function(g,c,s){return N(this,g,c,s,!1)},w.prototype.once=function(g,c,s){return N(this,g,c,s,!0)},w.prototype.removeListener=function(g,c,s,i){var l=P?P+g:g;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},w.prototype.removeAllListeners=function(g){var c;return g?(c=P?P+g:g,this._events[c]&&e(this,c)):(this._events=new S,this._eventsCount=0),this},w.prototype.off=w.prototype.removeListener,w.prototype.addListener=w.prototype.on,w.prefixed=P,w.EventEmitter=w,ne.exports=w},"./node_modules/url-toolkit/src/url-toolkit.js":function(ne,B,A){(function(j){var P=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,S=/^([^\/?#]*)([^]*)$/,W=/(?:\/|^)\.(?=\/)/g,N=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,e={buildAbsoluteURL:function(w,v,g){if(g=g||{},w=w.trim(),v=v.trim(),!v){if(!g.alwaysNormalize)return w;var c=e.parseURL(w);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(v);if(!s)throw new Error("Error trying to parse relative URL.");if(s.scheme)return g.alwaysNormalize?(s.path=e.normalizePath(s.path),e.buildURLFromParts(s)):v;var i=e.parseURL(w);if(!i)throw new Error("Error trying to parse base URL.");if(!i.netLoc&&i.path&&i.path[0]!=="/"){var l=S.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=g.alwaysNormalize?e.normalizePath(s.path):s.path),e.buildURLFromParts(a)},parseURL:function(w){var v=P.exec(w);return v?{scheme:v[1]||"",netLoc:v[2]||"",path:v[3]||"",params:v[4]||"",query:v[5]||"",fragment:v[6]||""}:null},normalizePath:function(w){for(w=w.split("").reverse().join("").replace(W,"");w.length!==(w=w.replace(N,"")).length;);return w.split("").reverse().join("")},buildURLFromParts:function(w){return w.scheme+w.netLoc+w.path+w.params+w.query+w.fragment}};ne.exports=e})(this)},"./node_modules/webworkify-webpack/index.js":function(ne,B,A){function j(g){var c={};function s(l){if(c[l])return c[l].exports;var a=c[l]={i:l,l:!1,exports:{}};return g[l].call(a.exports,a,a.exports,s),a.l=!0,a.exports}s.m=g,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|/|@]+",S="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+P+").*?\\)";function W(g){return(g+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function N(g){return!isNaN(1*g)}function e(g,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)"+W(n)+S,"g"),t;t=r.exec(l);){if(t[3]==="dll-reference")continue;i[s].push(t[3])}for(r=new RegExp("\\("+W(n)+'\\("(dll-reference\\s('+P+'))"\\)\\)'+S,"g");t=r.exec(l);)g[t[2]]||(i[s].push(t[1]),g[t[2]]=A(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 w(g){var c=Object.keys(g);return c.reduce(function(s,i){return s||g[i].length>0},!1)}function v(g,c){for(var s={main:[c]},i={main:[]},l={main:{}};w(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]||!g[r][E])continue;l[r][E]=!0,i[r]=i[r]||[],i[r].push(E);for(var y=e(g,g[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}ne.exports=function(g,c){c=c||{};var s={main:A.m},i=c.all?{main:Object.keys(s.main)}:v(s,g),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+" = ("+j.toString().replace("ENTRY_MODULE",JSON.stringify(y))+")({"+i[E].map(function(m){return""+JSON.stringify(m)+": "+s[E][m].toString()}).join(",")+`});
`}),l=l+"new (("+j.toString().replace("ENTRY_MODULE",JSON.stringify(g))+")({"+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(ne,B,A){"use strict";A.r(B),A.d(B,"hlsDefaultConfig",function(){return T}),A.d(B,"mergeConfig",function(){return f}),A.d(B,"enableStreamingMode",function(){return h});var j=A("./src/controller/abr-controller.ts"),P=A("./src/controller/audio-stream-controller.ts"),S=A("./src/controller/audio-track-controller.ts"),W=A("./src/controller/subtitle-stream-controller.ts"),N=A("./src/controller/subtitle-track-controller.ts"),e=A("./src/controller/buffer-controller.ts"),w=A("./src/controller/timeline-controller.ts"),v=A("./src/controller/cap-level-controller.ts"),g=A("./src/controller/fps-controller.ts"),c=A("./src/controller/eme-controller.ts"),s=A("./src/controller/cmcd-controller.ts"),i=A("./src/utils/xhr-loader.ts"),l=A("./src/utils/fetch-loader.ts"),a=A("./src/utils/cues.ts"),n=A("./src/utils/mediakeys-helper.ts"),r=A("./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:j.default,bufferController:e.default,capLevelController:v.default,fpsController:g.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:n.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},_()),{},{subtitleStreamController:W.SubtitleStreamController,subtitleTrackController:N.default,timelineController:w.TimelineController,audioStreamController:P.default,audioTrackController:S.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(ne,B,A){"use strict";A.r(B);var j=A("./src/polyfills/number.ts"),P=A("./src/utils/ewma-bandwidth-estimator.ts"),S=A("./src/events.ts"),W=A("./src/utils/buffer-helper.ts"),N=A("./src/errors.ts"),e=A("./src/types/loader.ts"),w=A("./src/utils/logger.ts");function v(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 g(s,i,l){return i&&v(s.prototype,i),l&&v(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(S.Events.FRAG_LOADING,this.onFragLoading,this),a.on(S.Events.FRAG_LOADED,this.onFragLoaded,this),a.on(S.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.on(S.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.on(S.Events.ERROR,this.onError,this)},i.unregisterListeners=function(){var a=this.hls;a.off(S.Events.FRAG_LOADING,this.onFragLoading,this),a.off(S.Events.FRAG_LOADED,this.onFragLoaded,this),a.off(S.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.off(S.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.off(S.Events.ERROR,this.onError,this)},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){w.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,O=y.currentTime,L=(W.BufferHelper.bufferInfo(y,O,E.maxBufferHole).end-O)/f;if(L>=2*T/f||d<=L)return;var x=Number.POSITIVE_INFINITY,I;for(I=a.level-1;I>o;I--){var k=h[I].maxBitrate;if(x=T*k/(8*.8*p),x<L)break}if(x>=d)return;var C=this.bwEstimator.getEstimate();w.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 "+I+`
Current BW estimate: `+(Object(j.isFiniteNumber)(C)?(C/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+d.toFixed(3)+` s
Estimated load time for the next fragment: `+x.toFixed(3)+` s
Time to underbuffer: `+L.toFixed(3)+" s"),r.nextLoadLevel=I,this.bwEstimator.sample(_,m.loaded),this.clearTimer(),a.loader&&(this.fragCurrent=this.partCurrent=null,a.loader.abort()),r.trigger(S.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(j.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(S.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=(W.BufferHelper.bufferInfo(m,_,E.maxBufferHole).end-_)/f,u=this.findBestLevel(h,y,t,o,E.abrBandWidthFactor,E.abrBandWidthUpFactor);if(u>=0)return u;w.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 O=this.bitrateTestDelay;if(O){var L=T?Math.min(T,E.maxLoadingDelay):E.maxLoadingDelay;b=L-O,w.logger.trace("bitrate test took "+Math.round(1e3*O)+"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 O=h[d];if(!O||b&&O.codecSet!==b)continue;var L=O.details,x=(_?L==null?void 0:L.partTarget:L==null?void 0:L.averagetargetduration)||p,I=void 0;d<=f?I=E*a:I=y*a;var k=h[d].maxBitrate,C=k*x/I;if(w.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+d+"/"+Math.round(I)+"/"+k+"/"+x+"/"+t+"/"+C),I>k&&(!C||u&&!this.bitrateTestDelay||C<t))return d}return-1},g(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}();B.default=c},"./src/controller/audio-stream-controller.ts":function(ne,B,A){"use strict";A.r(B);var j=A("./src/polyfills/number.ts"),P=A("./src/controller/base-stream-controller.ts"),S=A("./src/events.ts"),W=A("./src/utils/buffer-helper.ts"),N=A("./src/controller/fragment-tracker.ts"),e=A("./src/types/level.ts"),w=A("./src/types/loader.ts"),v=A("./src/loader/fragment.ts"),g=A("./src/demux/chunk-cache.ts"),c=A("./src/demux/transmuxer-interface.ts"),s=A("./src/types/transmuxer.ts"),i=A("./src/controller/fragment-finders.ts"),l=A("./src/utils/discontinuities.ts"),a=A("./src/errors.ts"),n=A("./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(S.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.on(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(S.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(S.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.on(S.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),o.on(S.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),o.on(S.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.on(S.Events.ERROR,this.onError,this),o.on(S.Events.BUFFER_RESET,this.onBufferReset,this),o.on(S.Events.BUFFER_CREATED,this.onBufferCreated,this),o.on(S.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),o.on(S.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),o.on(S.Events.FRAG_BUFFERED,this.onFragBuffered,this)},f._unregisterListeners=function(){var o=this.hls;o.off(S.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.off(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(S.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(S.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.off(S.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),o.off(S.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),o.off(S.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.off(S.Events.ERROR,this.onError,this),o.off(S.Events.BUFFER_RESET,this.onBufferReset,this),o.off(S.Events.BUFFER_CREATED,this.onBufferCreated,this),o.off(S.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),o.off(S.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),o.off(S.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 O=b.cc;this.initPTS[b.cc]=d,this.log("InitPTS for cc: "+O+" found from main: "+d),this.videoTrackCC=O,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,O=performance.now(),L=this.retryDate;(!L||O>=L||(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 x=this.waitingData;if(x){var I=x.frag,k=x.part,C=x.cache,F=x.complete;if(this.initPTS[I.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.FRAG_LOADING;var V=C.flush(),ee={frag:I,part:k,payload:V,networkDetails:null};this._handleFragmentLoadProgress(ee),F&&T.prototype._handleFragmentLoadComplete.call(this,ee)}else if(this.videoTrackCC!==this.waitingVideoCC)n.logger.log("Waiting fragment cc ("+I.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ie=this.getLoadPosition(),pe=W.BufferHelper.bufferInfo(this.mediaBuffer,ie,this.config.maxBufferHole),ve=Object(i.fragmentWithinToleranceTest)(pe.end,this.config.maxFragLookUpTolerance,I);ve<0&&(n.logger.log("Waiting fragment cc ("+I.cc+") @ "+I.start+" cancelled because another fragment at "+pe.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,O=this.trackId,L=b.config;if(!p||!p[O])return;if(!d&&(this.startFragRequested||!L.startFragPrefetch))return;var x=p[O],I=x.details;if(!I||I.live&&this.levelLastLoaded!==O||this.waitForCdnTuneIn(I)){this.state=P.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,v.ElementaryStreamTypes.AUDIO,w.PlaylistLevelType.AUDIO));var k=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,w.PlaylistLevelType.AUDIO);if(k===null)return;var C=k.len,F=this.getMaxBufferLength(),V=this.audioSwitch;if(C>=F&&!V)return;if(!V&&this._streamEnded(k,I)){b.trigger(S.Events.BUFFER_EOS,{type:"audio"}),this.state=P.State.ENDED;return}var ee=I.fragments,ie=ee[0].start,pe=k.end;if(V){var ve=this.getLoadPosition();pe=ve,I.PTSKnown&&ve<ie&&((k.end>ie||k.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),d.currentTime=ie+.05))}var ye=this.getNextFragment(pe,I);if(!ye){this.bufferFlushed=!0;return}((o=ye.decryptdata)===null||o===void 0?void 0:o.keyFormat)==="identity"&&!((u=ye.decryptdata)!==null&&u!==void 0&&u.key)?this.loadKey(ye,I):this.loadFragment(ye,I,pe)},f.getMaxBufferLength=function(){var o=T.prototype.getMaxBufferLength.call(this),u=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,w.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,O=u.id;if(!p){this.warn("Audio tracks were reset while loading level "+O);return}this.log("Track "+O+" loaded ["+d.startSN+","+d.endSN+"],duration:"+d.totalduration);var L=p[O],x=0;if(d.live||(b=L.details)!==null&&b!==void 0&&b.live){var I=this.mainDetails;if(d.fragments[0]||(d.deltaUpdateFailed=!0),d.deltaUpdateFailed||!I)return;!L.details&&d.hasProgramDateTime&&I.hasProgramDateTime?(Object(l.alignMediaPlaylistByPDT)(d,I),x=d.fragments[0].start):x=this.alignPlaylists(d,L.details)}L.details=d,this.levelLastLoaded=O,!this.startFragRequested&&(this.mainDetails||!d.live)&&this.setStartPosition(L.details,x),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,O=this.config,L=this.trackId,x=this.levels;if(!x){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 I=x[L];console.assert(I,"Audio track is defined on fragment load progress");var k=I.details;console.assert(k,"Audio track details are defined on fragment load progress");var C=O.defaultAudioCodec||I.audioCodec||"mp4a.40.2",F=this.transmuxer;F||(F=this.transmuxer=new c.default(this.hls,w.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var V=this.initPTS[b.cc],ee=(u=b.initSegment)===null||u===void 0?void 0:u.data;if(V!==void 0){var ie=!1,pe=p?p.index:-1,ve=pe!==-1,ye=new s.ChunkMetadata(b.level,b.sn,b.stats.chunkCount,d.byteLength,pe,ve);F.push(d,ee,C,"",b,p,k.totalduration,ie,ye,V)}else{n.logger.log("Unknown video PTS for cc "+b.cc+", waiting for video PTS before demuxing audio frag "+b.sn+" of ["+k.startSN+" ,"+k.endSN+"],track "+L);var Ee=this.waitingData=this.waitingData||{frag:b,part:p,cache:new g.default,complete:!1},Se=Ee.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!==w.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(S.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(w.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,w.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===v.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},f._handleTransmuxComplete=function(o){var u,b="audio",p=this.hls,d=o.remuxResult,O=o.chunkMeta,L=this.getCurrentContext(O);if(!L){this.warn("The loading context changed while buffering fragment "+O.sn+" of level "+O.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(O.level);return}var x=L.frag,I=L.part,k=d.audio,C=d.text,F=d.id3,V=d.initSegment;if(this.fragContextChanged(x))return;if(this.state=P.State.PARSING,this.audioSwitch&&k&&this.completeAudioSwitch(),V!=null&&V.tracks&&(this._bufferInitSegment(V.tracks,x,O),p.trigger(S.Events.FRAG_PARSING_INIT_SEGMENT,{frag:x,id:b,tracks:V.tracks})),k){var ee=k.startPTS,ie=k.endPTS,pe=k.startDTS,ve=k.endDTS;I&&(I.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:ee,endPTS:ie,startDTS:pe,endDTS:ve}),x.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,ee,ie,pe,ve),this.bufferFragmentData(k,x,I,O)}if(F!=null&&(u=F.samples)!==null&&u!==void 0&&u.length){var ye=r({frag:x,id:b},F);p.trigger(S.Events.FRAG_PARSING_METADATA,ye)}if(C){var Ee=r({frag:x,id:b},C);p.trigger(S.Events.FRAG_PARSING_USERDATA,Ee)}},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(S.Events.BUFFER_CODECS,o);var d=p.initSegment;if(d!=null&&d.byteLength){var O={type:"audio",frag:u,part:null,chunkMeta:b,parent:u.type,data:d};this.hls.trigger(S.Events.BUFFER_APPENDING,O)}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(j.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(S.Events.AUDIO_TRACK_SWITCHED,{id:b})},_}(P.default);B.default=m},"./src/controller/audio-track-controller.ts":function(ne,B,A){"use strict";A.r(B);var j=A("./src/events.ts"),P=A("./src/errors.ts"),S=A("./src/controller/base-playlist-controller.ts"),W=A("./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 w(c,s){c.prototype=Object.create(s.prototype),c.prototype.constructor=c,v(c,s)}function v(c,s){return v=Object.setPrototypeOf||function(l,a){return l.__proto__=a,l},v(c,s)}var g=function(c){w(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(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(j.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(j.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.on(j.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.on(j.Events.ERROR,this.onError,this)},i.unregisterListeners=function(){var a=this.hls;a.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(j.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(j.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.off(j.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.off(j.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(j.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===W.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(j.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(j.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(j.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}(S.default);B.default=g},"./src/controller/base-playlist-controller.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"default",function(){return e});var j=A("./src/polyfills/number.ts"),P=A("./src/types/level.ts"),S=A("./src/controller/level-helper.ts"),W=A("./src/utils/logger.ts"),N=A("./src/errors.ts"),e=function(){function w(g,c){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=W.logger.log.bind(W.logger,c+":"),this.warn=W.logger.warn.bind(W.logger,c+":"),this.hls=g}var v=w.prototype;return v.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},v.onError=function(c,s){s.fatal&&s.type===N.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},v.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},v.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},v.stopLoad=function(){this.canLoad=!1,this.clearTimer()},v.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(j.isFiniteNumber)(r))return new P.HlsUrlParameters(r,Object(j.isFiniteNumber)(t)?t:void 0,P.HlsSkip.No)}}},v.loadPlaylist=function(c){},v.shouldLoadTrack=function(c){return this.canLoad&&c&&!!c.url&&(!c.details||c.details.live)},v.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(S.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 O=Math.floor(d/a.targetduration);if(E+=O,y!==void 0){var L=Math.round(d%a.targetduration/a.partTarget);y+=L}this.log("CDN Tune-in age: "+a.ageHeader+"s last advanced "+b.toFixed(2)+"s goal: "+d+" skip sn "+O+" 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 x=Object(S.computeReloadInterval)(a,n);E!==void 0&&a.canBlockReload&&(x-=a.partTarget||1),this.log("reload live playlist "+c+" in "+Math.round(x)+" ms"),this.timer=self.setTimeout(function(){return l.loadPlaylist(t)},x)}else this.clearTimer()},v.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)},v.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},w}()},"./src/controller/base-stream-controller.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"State",function(){return _}),A.d(B,"default",function(){return f});var j=A("./src/polyfills/number.ts"),P=A("./src/task-loop.ts"),S=A("./src/controller/fragment-tracker.ts"),W=A("./src/utils/buffer-helper.ts"),N=A("./src/utils/logger.ts"),e=A("./src/events.ts"),w=A("./src/errors.ts"),v=A("./src/types/transmuxer.ts"),g=A("./src/utils/mp4-tools.ts"),c=A("./src/utils/discontinuities.ts"),s=A("./src/controller/fragment-finders.ts"),i=A("./src/controller/level-helper.ts"),l=A("./src/loader/fragment-loader.ts"),a=A("./src/crypt/decrypter.ts"),n=A("./src/utils/time-ranges.ts"),r=A("./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 O;return O=h.call(this)||this,O.hls=void 0,O.fragPrevious=null,O.fragCurrent=null,O.fragmentTracker=void 0,O.transmuxer=null,O._state=_.STOPPED,O.media=void 0,O.mediaBuffer=void 0,O.config=void 0,O.bitrateTest=!1,O.lastCurrentTime=0,O.nextLoadPosition=0,O.startPosition=0,O.loadedmetadata=!1,O.fragLoadError=0,O.retryDate=0,O.levels=null,O.fragmentLoader=void 0,O.levelLastLoaded=null,O.startFragRequested=!1,O.decrypter=void 0,O.initPTS=[],O.onvseeking=null,O.onvended=null,O.logPrefix="",O.log=void 0,O.warn=void 0,O.logPrefix=d,O.log=N.logger.log.bind(N.logger,d+":"),O.warn=N.logger.warn.bind(N.logger,d+":"),O.hls=b,O.fragmentLoader=new l.default(b.config),O.fragmentTracker=p,O.config=b.config,O.decrypter=new a.default(b,b.config),b.on(e.Events.KEY_LOADED,O.onKeyLoaded,y(O)),O}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 O=this.fragCurrent,L=this.fragmentTracker;if(!d.live&&O&&O.sn===d.endSN&&!p.nextStart){var x=L.getState(O);return x===S.FragmentState.PARTIAL||x===S.FragmentState.OK}return!1},u.onMediaAttached=function(p,d){var O=this.media=this.mediaBuffer=d.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),O.addEventListener("seeking",this.onvseeking),O.addEventListener("ended",this.onvended);var L=this.config;this.levels&&L.autoStartLoad&&this.state===_.STOPPED&&this.startLoad(L.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,O=this.media,L=this.mediaBuffer,x=this.state,I=O?O.currentTime:0,k=W.BufferHelper.bufferInfo(L||O,I,p.maxBufferHole);if(this.log("media seeking to "+(Object(j.isFiniteNumber)(I)?I.toFixed(3):I)+", state: "+x),x===_.ENDED)this.resetLoadingState();else if(d&&!k.len){var C=p.maxFragLookUpTolerance,F=d.start-C,V=d.start+d.duration+C,ee=I>V;(I<F||ee)&&(ee&&d.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),d.loader.abort()),this.resetLoadingState())}O&&(this.lastCurrentTime=I),!this.loadedmetadata&&!k.len&&(this.nextLoadPosition=this.startPosition=I),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 O=this.levels[d.frag.level].details;O&&this.loadFragment(d.frag,O,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,O){this._loadFragForPlayback(p,d,O)},u._loadFragForPlayback=function(p,d,O){var L=this,x=function(k){if(L.fragContextChanged(p)){L.warn("Fragment "+p.sn+(k.part?" p: "+k.part.index:"")+" of level "+p.level+" was dropped during download."),L.fragmentTracker.removeFragment(p);return}p.stats.chunkCount++,L._handleFragmentLoadProgress(k)};this._doFragLoad(p,d,O,x).then(function(I){if(!I)return;L.fragLoadError=0;var k=L.state;if(L.fragContextChanged(p)){(k===_.FRAG_LOADING||k===_.BACKTRACKING||!L.fragCurrent&&k===_.PARSING)&&(L.fragmentTracker.removeFragment(p),L.state=_.IDLE);return}if("payload"in I&&(L.log("Loaded fragment "+p.sn+" of level "+p.level),L.hls.trigger(e.Events.FRAG_LOADED,I),L.state===_.BACKTRACKING)){L.fragmentTracker.backtrack(p,I),L.resetFragmentLoading(p);return}L._handleFragmentLoadComplete(I)}).catch(function(I){L.warn(I),L.resetFragmentLoading(p)})},u.flushMainBuffer=function(p,d,O){if(O===void 0&&(O=null),!(p-d))return;var L={startOffset:p,endOffset:d,type:O};this.fragLoadError=0,this.hls.trigger(e.Events.BUFFER_FLUSHING,L)},u._loadInitSegment=function(p){var d=this;this._doFragLoad(p).then(function(O){if(!O||d.fragContextChanged(p)||!d.levels)throw new Error("init load aborted");return O}).then(function(O){var L=d.hls,x=O.payload,I=p.decryptdata;if(x&&x.byteLength>0&&I&&I.key&&I.iv&&I.method==="AES-128"){var k=self.performance.now();return d.decrypter.webCryptoDecrypt(new Uint8Array(x),I.key.buffer,I.iv.buffer).then(function(C){var F=self.performance.now();return L.trigger(e.Events.FRAG_DECRYPTED,{frag:p,payload:C,stats:{tstart:k,tdecrypt:F}}),O.payload=C,O})}return O}).then(function(O){var L=d.fragCurrent,x=d.hls,I=d.levels;if(!I)throw new Error("init load aborted, missing levels");var k=I[p.level].details;console.assert(k,"Level details are defined when init segment is loaded");var C=p.stats;d.state=_.IDLE,d.fragLoadError=0,p.data=new Uint8Array(O.payload),C.parsing.start=C.buffering.start=self.performance.now(),C.parsing.end=C.buffering.end=self.performance.now(),O.frag===L&&x.trigger(e.Events.FRAG_BUFFERED,{stats:C,frag:L,part:null,id:p.type}),d.tick()}).catch(function(O){d.warn(O),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 O=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(W.BufferHelper.getBuffered(O))),this.state=_.IDLE,this.tick()},u._handleFragmentLoadComplete=function(p){var d=this.transmuxer;if(!d)return;var O=p.frag,L=p.part,x=p.partsLoaded,I=!x||x.length===0||x.some(function(C){return!C}),k=new v.ChunkMetadata(O.level,O.sn,O.stats.chunkCount+1,0,L?L.index:-1,!I);d.flush(k)},u._handleFragmentLoadProgress=function(p){},u._doFragLoad=function(p,d,O,L){var x=this;if(O===void 0&&(O=null),!this.levels)throw new Error("frag load aborted, missing levels");if(O=Math.max(p.start,O||0),this.config.lowLatencyMode&&d){var I=d.partList;if(I&&L){O>p.end&&d.fragmentHint&&(p=d.fragmentHint);var k=this.getNextPart(I,p,O);if(k>-1){var C=I[k];return this.log("Loading part sn: "+p.sn+" p: "+C.index+" cc: "+p.cc+" of playlist ["+d.startSN+"-"+d.endSN+"] parts [0-"+k+"-"+(I.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+p.level+", target: "+parseFloat(O.toFixed(3))),this.nextLoadPosition=C.start+C.duration,this.state=_.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:p,part:I[k],targetBufferTime:O}),this.doFragPartsLoad(p,I,k,L).catch(function(F){return x.handleFragLoadError(F)})}else if(!p.url||this.loadedEndOfParts(I,O))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(O.toFixed(3))),Object(j.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:O}),this.fragmentLoader.load(p,L).catch(function(F){return x.handleFragLoadError(F)})},u.doFragPartsLoad=function(p,d,O,L){var x=this;return new Promise(function(I,k){var C=[],F=function V(ee){var ie=d[ee];x.fragmentLoader.loadPart(p,ie,L).then(function(pe){C[ie.index]=pe;var ve=pe.part;x.hls.trigger(e.Events.FRAG_LOADED,pe);var ye=d[ee+1];if(ye&&ye.fragment===p)V(ee+1);else return I({frag:p,part:ve,partsLoaded:C})}).catch(k)};F(O)})},u.handleFragLoadError=function(p){var d=p.data;return d&&d.details===w.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 O=d.frag,L=d.part,x=d.level,I=self.performance.now();O.stats.parsing.end=I,L&&(L.stats.parsing.end=I),this.updateLevelTiming(O,L,x,p.partial)},u.getCurrentContext=function(p){var d=this.levels,O=p.level,L=p.sn,x=p.part;if(!d||!d[O])return this.warn("Levels object was unset while buffering fragment "+L+" of level "+O+". The current chunk will not be buffered."),null;var I=d[O],k=x>-1?Object(i.getPartWith)(I,L,x):null,C=k?k.fragment:Object(i.getFragmentWithSN)(I,L,this.fragCurrent);return C?{frag:C,part:k,level:I}:null},u.bufferFragmentData=function(p,d,O,L){if(!p||this.state!==_.PARSING)return;var x=p.data1,I=p.data2,k=x;if(x&&I&&(k=Object(g.appendUint8Array)(x,I)),!k||!k.length)return;var C={type:p.type,frag:d,part:O,chunkMeta:L,parent:d.type,data:k};this.hls.trigger(e.Events.BUFFER_APPENDING,C),p.dropped&&p.independent&&!O&&this.flushBufferGap(d)},u.flushBufferGap=function(p){var d=this.media;if(!d)return;if(!W.BufferHelper.isBuffered(d,d.currentTime)){this.flushMainBuffer(0,p.start);return}var O=d.currentTime,L=W.BufferHelper.bufferInfo(d,O,0),x=p.duration,I=Math.min(this.config.maxFragLookUpTolerance*2,x*.25),k=Math.max(Math.min(p.start-I,L.end-I),O+I);p.start-k>I&&this.flushMainBuffer(k,p.start)},u.getFwdBufferInfo=function(p,d){var O=this.config,L=this.getLoadPosition();if(!Object(j.isFiniteNumber)(L))return null;var x=W.BufferHelper.bufferInfo(p,L,O.maxBufferHole);if(x.len===0&&x.nextStart!==void 0){var I=this.fragmentTracker.getBufferedFrag(L,d);if(I&&x.nextStart<I.end)return W.BufferHelper.bufferInfo(p,L,Math.max(x.nextStart,O.maxBufferHole))}return x},u.getMaxBufferLength=function(p){var d=this.config,O;return p?O=Math.max(8*d.maxBufferSize/p,d.maxBufferLength):O=d.maxBufferLength,Math.min(O,d.maxMaxBufferLength)},u.reduceMaxBufferLength=function(p){var d=this.config,O=p||d.maxBufferLength;return d.maxMaxBufferLength>=O?(d.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+d.maxMaxBufferLength+"s"),!0):!1},u.getNextFragment=function(p,d){var O,L,x=d.fragments,I=x.length;if(!I)return null;var k=this.config,C=x[0].start,F;if(d.live){var V=k.initialLiveManifestSize;if(I<V)return this.warn("Not enough fragments to start playback (have: "+I+", need: "+V+")"),null;!d.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(F=this.getInitialLiveFragment(d,x),this.startPosition=F?this.hls.liveSyncPosition||F.start:p)}else p<=C&&(F=x[0]);if(!F){var ee=k.lowLatencyMode?d.partEnd:d.fragmentEnd;F=this.getFragmentAtPosition(p,ee,d)}return(O=F)!==null&&O!==void 0&&O.initSegment&&!((L=F)!==null&&L!==void 0&&L.initSegment.data)&&!this.bitrateTest&&(F=F.initSegment),F},u.getNextPart=function(p,d,O){for(var L=-1,x=!1,I=!0,k=0,C=p.length;k<C;k++){var F=p[k];if(I=I&&!F.independent,L>-1&&O<F.start)break;var V=F.loaded;!V&&(x||F.independent||I)&&F.fragment===d&&(L=k),x=V}return L},u.loadedEndOfParts=function(p,d){var O=p[p.length-1];return O&&d>O.start&&O.loaded},u.getInitialLiveFragment=function(p,d){var O=this.fragPrevious,L=null;if(O){if(p.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+O.programDateTime),L=Object(s.findFragmentByPDT)(d,O.endProgramDateTime,this.config.maxFragLookUpTolerance)),!L){var x=O.sn+1;if(x>=p.startSN&&x<=p.endSN){var I=d[x-p.startSN];O.cc===I.cc&&(L=I,this.log("Live playlist, switching playlist, load frag with next SN: "+L.sn))}L||(L=Object(s.findFragWithCC)(d,O.cc),L&&this.log("Live playlist, switching playlist, load frag with same CC: "+L.sn))}}else{var k=this.hls.liveSyncPosition;k!==null&&(L=this.getFragmentAtPosition(k,this.bitrateTest?p.fragmentEnd:p.edge,p))}return L},u.getFragmentAtPosition=function(p,d,O){var L=this.config,x=this.fragPrevious,I=O.fragments,k=O.endSN,C=O.fragmentHint,F=L.maxFragLookUpTolerance,V=!!(L.lowLatencyMode&&O.partList&&C);V&&C&&!this.bitrateTest&&(I=I.concat(C),k=C.sn);var ee;if(p<d){var ie=p>d-F?0:F;ee=Object(s.findFragmentByPTS)(x,I,p,ie)}else ee=I[I.length-1];if(ee){var pe=ee.sn-O.startSN,ve=x&&ee.level===x.level,ye=I[pe+1],Ee=this.fragmentTracker.getState(ee);if(Ee===S.FragmentState.BACKTRACKED){ee=null;for(var Se=pe;I[Se]&&this.fragmentTracker.getState(I[Se])===S.FragmentState.BACKTRACKED;)x?ee=I[Se--]:ee=I[--Se];ee||(ee=ye)}else x&&ee.sn===x.sn&&!V&&(ve&&(ee.sn<k&&this.fragmentTracker.getState(ye)!==S.FragmentState.OK?(this.log("SN "+ee.sn+" just loaded, load next one: "+ye.sn),ee=ye):ee=null))}return ee},u.synchronizeToLiveEdge=function(p){var d=this.config,O=this.media;if(!O)return;var L=this.hls.liveSyncPosition,x=O.currentTime,I=p.fragments[0].start,k=p.edge,C=x>=I-d.maxFragLookUpTolerance&&x<=k;if(L!==null&&O.duration>L&&(x<L||!C)){var F=d.liveMaxLatencyDuration!==void 0?d.liveMaxLatencyDuration:d.liveMaxLatencyDurationCount*p.targetduration;(!C&&O.readyState<4||x<k-F)&&(this.loadedmetadata||(this.nextLoadPosition=L),O.readyState&&(this.warn("Playback: "+x.toFixed(3)+" is located too far from the end of live sliding playlist: "+k+", reset currentTime to : "+L.toFixed(3)),O.currentTime=L))}},u.alignPlaylists=function(p,d){var O=this.levels,L=this.levelLastLoaded,x=this.fragPrevious,I=L!==null?O[L]:null,k=p.fragments.length;if(!k)return this.warn("No fragments in live playlist"),0;var C=p.fragments[0].start,F=!d,V=p.alignedSliding&&Object(j.isFiniteNumber)(C);if(F||!V&&!C){Object(c.alignStream)(x,I,p);var ee=p.fragments[0].start;return this.log("Live playlist sliding: "+ee.toFixed(2)+" start-sn: "+(d?d.startSN:"na")+"->"+p.startSN+" prev-sn: "+(x?x.sn:"na")+" fragments: "+k),ee}return C},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 O=this.startPosition;if(O<d&&(O=-1),O===-1||this.lastCurrentTime===-1){var L=p.startTimeOffset;Object(j.isFiniteNumber)(L)?(O=d+L,L<0&&(O+=p.totalduration),O=Math.min(Math.max(d,O),d+p.totalduration),this.log("Start time offset "+L+" found in playlist, adjust startPosition to "+O),this.startPosition=O):p.live?O=this.hls.liveSyncPosition||d:this.startPosition=O=0,this.lastCurrentTime=O}this.nextLoadPosition=O},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 O=d.frag;if(!O||O.type!==p)return;var L=this.fragCurrent;console.assert(L&&O.sn===L.sn&&O.level===L.level&&O.urlId===L.urlId,"Frag load error must match current frag to retry");var x=this.config;if(this.fragLoadError+1<=x.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(O.level))return;var I=Math.min(Math.pow(2,this.fragLoadError)*x.fragLoadingRetryDelay,x.fragLoadingMaxRetryTimeout);this.warn("Fragment "+O.sn+" of "+p+" "+O.level+" failed to load, retrying in "+I+"ms"),this.retryDate=self.performance.now()+I,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,O){if(!p)return;var L=W.BufferHelper.getBuffered(p);this.fragmentTracker.detectEvictedFragments(d,L,O),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,O,L){var x=this,I=O.details;console.assert(!!I,"level.details must be defined");var k=Object.keys(p.elementaryStreams).reduce(function(C,F){var V=p.elementaryStreams[F];if(V){var ee=V.endPTS-V.startPTS;if(ee<=0)return x.warn("Could not parse fragment "+p.sn+" "+F+" duration reliably ("+ee+") resetting transmuxer to fallback to playlist timing"),x.resetTransmuxer(),C||!1;var ie=L?0:Object(i.updateFragPTSDTS)(I,p,V.startPTS,V.endPTS,V.startDTS,V.endDTS);return x.hls.trigger(e.Events.LEVEL_PTS_UPDATED,{details:I,level:O,drift:ie,type:F,frag:p,start:V.startPTS,end:V.endPTS}),!0}return C},!1);k?(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(ne,B,A){"use strict";A.r(B),A.d(B,"default",function(){return s});var j=A("./src/polyfills/number.ts"),P=A("./src/events.ts"),S=A("./src/utils/logger.ts"),W=A("./src/errors.ts"),N=A("./src/utils/buffer-helper.ts"),e=A("./src/utils/mediasource-helper.ts"),w=A("./src/loader/fragment.ts"),v=A("./src/controller/buffer-operation-queue.ts"),g=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;S.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(){S.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){S.logger.log("[buffer-controller]: Media source ended")},this.hls=a,this._initSourceBuffer(),this.registerListeners()}var 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 v.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,S.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},l.onMediaAttaching=function(n,r){var t=this.media=r.media;if(t&&g){var E=this.mediaSource=new g;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(S.logger.log("[buffer-controller]: media source detaching"),r.readyState==="open")try{r.endOfStream()}catch(E){S.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()):S.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(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){S.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&&(S.logger.log("[buffer-controller]: changing "+n+" sourceBuffer type to "+r),T.changeType(r)),E.shiftAndExecuteNext(n)},onStart:function(){},onComplete:function(){},onError:function(T){S.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 O=m.audio,L=_==="audio"&&o.id===1&&(O==null?void 0:O.container)==="audio/mpeg",x={execute:function(){if(u.executeStart=self.performance.now(),L){var k=t.sourceBuffer[_];if(k){var C=f.start-k.timestampOffset;Math.abs(C)>=.1&&(S.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+f.start+" (delta: "+C+") sn: "+f.sn+")"),k.timestampOffset=f.start)}}t.appendExecutor(T,_)},onStart:function(){},onComplete:function(){var k=self.performance.now();u.executeEnd=u.end=k,p.first===0&&(p.first=k),d&&d.first===0&&(d.first=k);var C=t.sourceBuffer,F={};for(var V in C)F[V]=N.BufferHelper.getBuffered(C[V]);t.appendError=0,t.hls.trigger(P.Events.BUFFER_APPENDED,{type:_,frag:f,part:h,chunkMeta:o,parent:f.type,timeRanges:F})},onError:function(k){S.logger.error("[buffer-controller]: Error encountered while trying to append to the "+_+" SourceBuffer",k);var C={type:W.ErrorTypes.MEDIA_ERROR,parent:f.type,details:W.ErrorDetails.BUFFER_APPEND_ERROR,err:k,fatal:!1};k.code===DOMException.QUOTA_EXCEEDED_ERR?C.details=W.ErrorDetails.BUFFER_FULL_ERROR:(t.appendError++,C.details=W.ErrorDetails.BUFFER_APPEND_ERROR,t.appendError>E.config.appendErrorMaxRetry&&(S.logger.error("[buffer-controller]: Failed "+E.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),C.fatal=!0)),E.trigger(P.Events.ERROR,C)}};y.append(x,_)},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){S.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[w.ElementaryStreamTypes.AUDIOVIDEO]?m.push("audiovideo"):(T[w.ElementaryStreamTypes.AUDIO]&&m.push("audio"),T[w.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&&S.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,S.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(j.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(j.isFiniteNumber)(E.duration)?E.duration:0;n.live&&r.config.liveDurationInfinity?(S.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),E.duration=Infinity,this.updateSeekableRange(n)):(y>T&&y>m||!Object(j.isFiniteNumber)(m))&&(S.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:W.ErrorTypes.MEDIA_ERROR,details:W.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;S.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){S.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+o.message),this.hls.trigger(P.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.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){S.logger.error("[buffer-controller]: "+n+" SourceBuffer error",r),this.hls.trigger(P.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.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||!_){S.logger.warn("[buffer-controller]: Attempting to remove from the "+n+" SourceBuffer, but it does not exist"),m.shiftAndExecuteNext(n);return}var f=Object(j.isFiniteNumber)(E.duration)?E.duration:Infinity,h=Object(j.isFiniteNumber)(y.duration)?y.duration:Infinity,o=Math.max(0,r),u=Math.min(t,f,h);u>o?(S.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){S.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){S.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(ne,B,A){"use strict";A.r(B),A.d(B,"default",function(){return P});var j=A("./src/utils/logger.ts"),P=function(){function S(N){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=N}var W=S.prototype;return W.append=function(e,w){var v=this.queues[w];v.push(e),v.length===1&&this.buffers[w]&&this.executeNext(w)},W.insertAbort=function(e,w){var v=this.queues[w];v.unshift(e),this.executeNext(w)},W.appendBlocker=function(e){var w,v=new Promise(function(c){w=c}),g={execute:w,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(g,e),v},W.executeNext=function(e){var w=this.buffers,v=this.queues,g=w[e],c=v[e];if(c.length){var s=c[0];try{s.execute()}catch(i){j.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),s.onError(i),(!g||!g.updating)&&(c.shift(),this.executeNext(e))}}},W.shiftAndExecuteNext=function(e){this.queues[e].shift(),this.executeNext(e)},W.current=function(e){return this.queues[e][0]},S}()},"./src/controller/cap-level-controller.ts":function(ne,B,A){"use strict";A.r(B);var j=A("./src/events.ts");function P(N,e){for(var w=0;w<e.length;w++){var v=e[w];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(N,v.key,v)}}function S(N,e,w){return e&&P(N.prototype,e),w&&P(N,w),N}var W=function(){function N(w){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=w,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var e=N.prototype;return e.setStreamController=function(v){this.streamController=v},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 v=this.hls;v.on(j.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.on(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.on(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.unregisterListener=function(){var v=this.hls;v.off(j.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.off(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.off(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.onFpsDropLevelCapping=function(v,g){N.isLevelAllowed(g.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(g.droppedLevel)},e.onMediaAttaching=function(v,g){this.media=g.media instanceof HTMLVideoElement?g.media:null},e.onManifestParsed=function(v,g){var c=this.hls;this.restrictedLevels=[],this.firstLevel=g.firstLevel,c.config.capLevelToPlayerSize&&g.video&&this.startCapping()},e.onBufferCodecs=function(v,g){var c=this.hls;c.config.capLevelToPlayerSize&&g.video&&this.startCapping()},e.onMediaDetaching=function(){this.stopCapping()},e.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var v=this.hls.levels;if(v.length){var g=this.hls;g.autoLevelCapping=this.getMaxLevel(v.length-1),g.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=g.autoLevelCapping}}},e.getMaxLevel=function(v){var g=this,c=this.hls.levels;if(!c.length)return-1;var s=c.filter(function(i,l){return N.isLevelAllowed(l,g.restrictedLevels)&&l<=v});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 v=this.media,g={width:0,height:0};if(v){var c=v.getBoundingClientRect();g.width=c.width,g.height=c.height,!g.width&&!g.height&&(g.width=c.right-c.left||v.width||0,g.height=c.bottom-c.top||v.height||0)}return this.clientRect=g,g},N.isLevelAllowed=function(v,g){return g===void 0&&(g=[]),g.indexOf(v)===-1},N.getMaxLevelByMediaSize=function(v,g,c){if(!v||!v.length)return-1;for(var s=function(r,t){return t?r.width!==t.width||r.height!==t.height:!0},i=v.length-1,l=0;l<v.length;l+=1){var a=v[l];if((a.width>=g||a.height>=c)&&s(a,v[l+1])){i=l;break}}return i},S(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 v=1;try{v=self.devicePixelRatio}catch(g){}return v}}]),N}();B.default=W},"./src/controller/cmcd-controller.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"default",function(){return s});var j=A("./src/events.ts"),P=A("./src/types/cmcd.ts"),S=A("./src/utils/buffer-helper.ts"),W=A("./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 w(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=v(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 v(i,l){if(!i)return;if(typeof i=="string")return g(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 g(i,l)}function g(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){W.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){W.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(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(j.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.on(j.Events.BUFFER_CREATED,this.onBufferCreated,this)},l.unregisterListeners=function(){var n=this.hls;n.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(j.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.off(j.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=w(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=S.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(L){return!Number.isNaN(L)&&L!=null&&L!==""&&L!==!1},E=function(L){return Math.round(L)},y=function(L){return E(L/100)*100},m=function(L){return encodeURIComponent(L)},T={br:E,d:E,bl:y,dl:y,mtp:y,nor:m,rtp:y,tb:E},_=Object.keys(n||{}).sort(),f=w(_),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(ne,B,A){"use strict";A.r(B);var j=A("./src/events.ts"),P=A("./src/errors.ts"),S=A("./src/utils/logger.ts"),W=A("./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 w=3,v=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]},g=function(i,l,a,n){switch(i){case W.KeySystems.WIDEVINE:return v(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(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(j.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this)},i._unregisterListeners=function(){this.hls.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(j.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this)},i.getLicenseServerUrl=function(a){switch(a){case W.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=g(a,n,r,this._drmSystemOptions);S.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){S.logger.error('Failed to obtain key-system "'+a+'" access:',m)})},i._onMediaKeySystemAccessObtained=function(a,n){var r=this;S.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,S.logger.log('Media-keys created for key-system "'+a+'"'),r._onMediaKeysCreated(),y});return E.catch(function(y){S.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;S.logger.log("New key-system session "+a.sessionId),a.addEventListener("message",function(r){n._onKeySessionMessage(a,r.message)},!1)},i._onKeySessionMessage=function(a,n){S.logger.log("Got EME message event, creating license request"),this._requestLicense(n,function(r){S.logger.log("Received license data (length: "+(r&&r.byteLength)+"), updating key-session"),a.update(r)})},i.onMediaEncrypted=function(a){var n=this;if(S.logger.log('Media is encrypted using "'+a.initDataType+'" init data type'),!this.mediaKeysPromise){S.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(j.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){S.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(j.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}S.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){S.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(j.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(t.mediaKeysSessionInitialized){S.logger.warn("Key-Session already initialized but requested again");return}var E=t.mediaKeysSession;if(!E){S.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(j.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!n){S.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(j.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}S.logger.log('Generating key-session request for "'+a+'" init data type'),t.mediaKeysSessionInitialized=!0,E.generateRequest(a,n).then(function(){S.logger.debug("Key-session generation succeeded")}).catch(function(y){S.logger.error("Error generating key-session request:",y),r.hls.trigger(j.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){S.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,S.logger.log("License request succeeded");var E=a.response,y=this._licenseResponseCallback;if(y)try{E=y.call(this.hls,a,n)}catch(T){S.logger.error(T)}t(E)}else{if(S.logger.error("License Request XHR failed ("+n+"). Status: "+a.status+" ("+a.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>w){this.hls.trigger(j.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var m=w-this._requestLicenseFailureCount+1;S.logger.warn("Retrying license request, "+m+" attempts left"),this._requestLicense(r,t)}break}},i._generateLicenseRequestChallenge=function(a,n){switch(a.mediaKeySystemDomain){case W.KeySystems.WIDEVINE:return n}throw new Error("unsupported key-system: "+a.mediaKeySystemDomain)},i._requestLicense=function(a,n){S.logger.log("Requesting content license for key-system");var r=this._mediaKeysList[0];if(!r){S.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(j.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);S.logger.log("Sending license request to URL: "+t);var y=this._generateLicenseRequestChallenge(r,a);E.send(y)}catch(m){S.logger.error("Failure requesting DRM license: "+m),this.hls.trigger(j.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(W.KeySystems.WIDEVINE,r,t)},e(s,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),s}();B.default=c},"./src/controller/fps-controller.ts":function(ne,B,A){"use strict";A.r(B);var j=A("./src/events.ts"),P=A("./src/utils/logger.ts"),S=function(){function W(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=W.prototype;return N.setStreamController=function(w){this.streamController=w},N.registerListeners=function(){this.hls.on(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},N.unregisterListeners=function(){this.hls.off(j.Events.MEDIA_ATTACHING,this.onMediaAttaching)},N.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},N.onMediaAttaching=function(w,v){var g=this.hls.config;if(g.capLevelOnFPSDrop){var c=v.media instanceof self.HTMLVideoElement?v.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),g.fpsDroppedMonitoringPeriod)}},N.checkFPS=function(w,v,g){var c=performance.now();if(v){if(this.lastTime){var s=c-this.lastTime,i=g-this.lastDroppedFrames,l=v-this.lastDecodedFrames,a=1e3*i/s,n=this.hls;if(n.trigger(j.Events.FPS_DROP,{currentDropped:i,currentDecoded:l,totalDroppedFrames:g}),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(j.Events.FPS_DROP_LEVEL_CAPPING,{level:r,droppedLevel:n.currentLevel}),n.autoLevelCapping=r,this.streamController.nextLevelSwitch())}}this.lastTime=c,this.lastDroppedFrames=g,this.lastDecodedFrames=v}},N.checkFPSInterval=function(){var w=this.media;if(w)if(this.isVideoPlaybackQualityAvailable){var v=w.getVideoPlaybackQuality();this.checkFPS(w,v.totalVideoFrames,v.droppedVideoFrames)}else this.checkFPS(w,w.webkitDecodedFrameCount,w.webkitDroppedFrameCount)},W}();B.default=S},"./src/controller/fragment-finders.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"findFragmentByPDT",function(){return S}),A.d(B,"findFragmentByPTS",function(){return W}),A.d(B,"fragmentWithinToleranceTest",function(){return N}),A.d(B,"pdtWithinToleranceTest",function(){return e}),A.d(B,"findFragWithCC",function(){return w});var j=A("./src/polyfills/number.ts"),P=A("./src/utils/binary-search.ts");function S(v,g,c){if(g===null||!Array.isArray(v)||!v.length||!Object(j.isFiniteNumber)(g))return null;var s=v[0].programDateTime;if(g<(s||0))return null;var i=v[v.length-1].endProgramDateTime;if(g>=(i||0))return null;c=c||0;for(var l=0;l<v.length;++l){var a=v[l];if(e(g,c,a))return a}return null}function W(v,g,c,s){c===void 0&&(c=0),s===void 0&&(s=0);var i=null;if(v?i=g[v.sn-g[0].sn+1]||null:c===0&&g[0].start===0&&(i=g[0]),i&&N(c,s,i)===0)return i;var l=P.default.search(g,N.bind(null,c,s));return l||i}function N(v,g,c){v===void 0&&(v=0),g===void 0&&(g=0);var s=Math.min(g,c.duration+(c.deltaPTS?c.deltaPTS:0));return c.start+c.duration-s<=v?1:c.start-s>v&&c.start?-1:0}function e(v,g,c){var s=Math.min(g,c.duration+(c.deltaPTS?c.deltaPTS:0))*1e3,i=c.endProgramDateTime||0;return i-s>v}function w(v,g){return P.default.search(v,function(c){return c.cc<g?1:c.cc>g?-1:0})}},"./src/controller/fragment-tracker.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"FragmentState",function(){return S}),A.d(B,"FragmentTracker",function(){return W});var j=A("./src/events.ts"),P=A("./src/types/loader.ts"),S;(function(w){w.NOT_LOADED="NOT_LOADED",w.BACKTRACKED="BACKTRACKED",w.APPENDING="APPENDING",w.PARTIAL="PARTIAL",w.OK="OK"})(S||(S={}));var W=function(){function w(g){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=g,this._registerListeners()}var v=w.prototype;return v._registerListeners=function(){var c=this.hls;c.on(j.Events.BUFFER_APPENDED,this.onBufferAppended,this),c.on(j.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.on(j.Events.FRAG_LOADED,this.onFragLoaded,this)},v._unregisterListeners=function(){var c=this.hls;c.off(j.Events.BUFFER_APPENDED,this.onBufferAppended,this),c.off(j.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.off(j.Events.FRAG_LOADED,this.onFragLoaded,this)},v.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},v.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)},v.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},v.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})})},v.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)},v.fragBuffered=function(c){var s=e(c),i=this.fragments[s];i&&(i.backtrack=i.loaded=null,i.buffered=!0)},v.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},v.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},v.getState=function(c){var s=e(c),i=this.fragments[s];return i?i.buffered?N(i)?S.PARTIAL:S.OK:i.backtrack?S.BACKTRACKED:S.APPENDING:S.NOT_LOADED},v.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},v.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},v.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},v.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)}},v.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)})},v.onFragBuffered=function(c,s){this.detectPartialFragments(s)},v.hasFragment=function(c){var s=e(c);return!!this.fragments[s]},v.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)}})},v.removeFragment=function(c){var s=e(c);c.stats.loaded=0,c.clearElementaryStreamInfo(),delete this.fragments[s]},v.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},w}();function N(w){var v,g;return w.buffered&&(((v=w.range.video)===null||v===void 0?void 0:v.partial)||((g=w.range.audio)===null||g===void 0?void 0:g.partial))}function e(w){return w.type+"_"+w.level+"_"+w.urlId+"_"+w.sn}},"./src/controller/gap-controller.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"STALL_MINIMUM_DURATION_MS",function(){return N}),A.d(B,"MAX_START_GAP_JUMP",function(){return e}),A.d(B,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return w}),A.d(B,"SKIP_BUFFER_RANGE_START",function(){return v}),A.d(B,"default",function(){return g});var j=A("./src/utils/buffer-helper.ts"),P=A("./src/errors.ts"),S=A("./src/events.ts"),W=A("./src/utils/logger.ts"),N=250,e=2,w=.1,v=.05,g=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;W.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||!j.BufferHelper.getBuffered(n).length)return;var _=j.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,O=d==null||((b=d.details)===null||b===void 0)?void 0:b.live,L=O?d.details.targetduration*2:e;if(p>0&&p<=L){this._trySkipBufferHole(null);return}}var x=self.performance.now();if(r===null){this.stalled=x;return}var I=x-r;!E&&I>=N&&this._reportStall(_.len);var k=j.BufferHelper.bufferInfo(n,t,a.maxBufferHole);this._tryFixBufferStall(k,I)},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&&(W.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,W.logger.warn("Playback stalling at @"+n.currentTime+" due to low buffer (buffer="+l+")"),a.trigger(S.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=j.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+v,r.currentTime+w);return W.logger.warn("skipping hole, adjusting currentTime from "+t+" to "+_),this.moved=!0,this.stalled=null,r.currentTime=_,l&&n.trigger(S.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;W.logger.warn("Nudging 'currentTime' from "+r+" to "+E),n.currentTime=E,a.trigger(S.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else W.logger.error("Playhead still not moving while enough data buffered @"+r+" after "+l.nudgeMaxRetry+" nudges"),a.trigger(S.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},c}()},"./src/controller/id3-track-controller.ts":function(ne,B,A){"use strict";A.r(B);var j=A("./src/events.ts"),P=A("./src/utils/texttrack-utils.ts"),S=A("./src/demux/id3.ts"),W=.25,N=function(){function e(v){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=v,this._registerListeners()}var w=e.prototype;return w.destroy=function(){this._unregisterListeners()},w._registerListeners=function(){var g=this.hls;g.on(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.on(j.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),g.on(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w._unregisterListeners=function(){var g=this.hls;g.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.off(j.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),g.off(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w.onMediaAttached=function(g,c){this.media=c.media},w.onMediaDetaching=function(){if(!this.id3Track)return;Object(P.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},w.getID3Track=function(g){if(!this.media)return;for(var c=0;c<g.length;c++){var s=g[c];if(s.kind==="metadata"&&s.label==="id3")return Object(P.sendAddTrackEvent)(s,this.media),s}return this.media.addTextTrack("metadata","id3")},w.onFragParsingMetadata=function(g,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=S.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+W);for(var y=0;y<n.length;y++){var m=n[y];if(!S.isTimeStampFrame(m)){var T=new l(r,t,"");T.value=m,this.id3Track.addCue(T)}}}}},w.onBufferFlushing=function(g,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}();B.default=N},"./src/controller/latency-controller.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"default",function(){return e});var j=A("./src/errors.ts"),P=A("./src/events.ts"),S=A("./src/utils/logger.ts");function W(w,v){for(var g=0;g<v.length;g++){var c=v[g];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(w,c.key,c)}}function N(w,v,g){return v&&W(w.prototype,v),g&&W(w,g),w}var e=function(){function w(g){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=g,this.config=g.config,this.registerListeners()}var v=w.prototype;return v.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},v.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)},v.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)},v.onMediaAttached=function(c,s){this.media=s.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},v.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},v.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},v.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)},v.onError=function(c,s){if(s.details!==j.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,S.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},v.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)},v.estimateLiveEdge=function(){var c=this.levelDetails;return c===null?null:c.edge+c.age},v.computeLatency=function(){var c=this.estimateLiveEdge();return c===null?null:c-this.currentTime},N(w,[{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}}]),w}()},"./src/controller/level-controller.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"default",function(){return a});var j=A("./src/types/level.ts"),P=A("./src/events.ts"),S=A("./src/errors.ts"),W=A("./src/utils/codecs.ts"),N=A("./src/controller/level-helper.ts"),e=A("./src/controller/base-playlist-controller.ts"),w=A("./src/types/loader.ts");function v(){return v=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},v.apply(this,arguments)}function g(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&&g(n.prototype,r),t&&g(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(I){var k=I.attrs;b=b||!!(I.width&&I.height),p=p||!!I.videoCodec,d=d||!!I.audioCodec,l&&I.audioCodec&&I.audioCodec.indexOf("mp4a.40.34")!==-1&&(I.audioCodec=void 0);var C=I.bitrate+"-"+I.attrs.RESOLUTION+"-"+I.attrs.CODECS;u=o[C],u?u.url.push(I.url):(u=new j.Level(I),o[C]=u,T.push(u)),k&&(k.AUDIO&&Object(N.addGroupId)(u,"audio",k.AUDIO),k.SUBTITLES&&Object(N.addGroupId)(u,"text",k.SUBTITLES))}),(b||p)&&d&&(T=T.filter(function(I){var k=I.videoCodec,C=I.width,F=I.height;return!!k||!!(C&&F)})),T=T.filter(function(I){var k=I.audioCodec,C=I.videoCodec;return(!k||Object(W.isCodecSupportedInMp4)(k,"audio"))&&(!C||Object(W.isCodecSupportedInMp4)(C,"video"))}),m.audioTracks&&(_=m.audioTracks.filter(function(I){return!I.audioCodec||Object(W.isCodecSupportedInMp4)(I.audioCodec,"audio")}),Object(N.assignTrackIdsByGroup)(_)),m.subtitles&&(f=m.subtitles,Object(N.assignTrackIdsByGroup)(f)),T.length>0){h=T[0].bitrate,T.sort(function(I,k){return I.bitrate-k.bitrate}),this._levels=T;for(var O=0;O<T.length;O++)if(T[O].bitrate===h){this._firstLevel=O,this.log("manifest loaded, "+T.length+" level(s) found, first bitrate: "+h);break}var L=d&&!p,x={levels:T,audioTracks:_,subtitleTracks:f,firstLevel:this._firstLevel,stats:m.stats,audio:d,video:p,altAudio:!L&&_.some(function(I){return!!I.url})};this.hls.trigger(P.Events.MANIFEST_PARSED,x),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(P.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.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===w.PlaylistContextType.AUDIO_TRACK&&_.audioGroupIds&&T.groupId===_.audioGroupIds[_.urlId]||T.type===w.PlaylistContextType.SUBTITLE_TRACK&&_.textGroupIds&&T.groupId===_.textGroupIds[_.urlId])){this.redundantFailover(this.currentLevelIndex);return}var f=!1,h=!0,o;switch(m.details){case S.ErrorDetails.FRAG_LOAD_ERROR:case S.ErrorDetails.FRAG_LOAD_TIMEOUT:case S.ErrorDetails.KEY_LOAD_ERROR:case S.ErrorDetails.KEY_LOAD_TIMEOUT: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 S.ErrorDetails.LEVEL_LOAD_ERROR:case S.ErrorDetails.LEVEL_LOAD_TIMEOUT:T&&(T.deliveryDirectives&&(h=!1),o=T.level),f=!0;break;case S.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===w.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:S.ErrorTypes.OTHER_ERROR,details:S.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=v({},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(ne,B,A){"use strict";A.r(B),A.d(B,"addGroupId",function(){return S}),A.d(B,"assignTrackIdsByGroup",function(){return W}),A.d(B,"updatePTS",function(){return N}),A.d(B,"updateFragPTSDTS",function(){return w}),A.d(B,"mergeDetails",function(){return v}),A.d(B,"mapPartIntersection",function(){return g}),A.d(B,"mapFragmentIntersection",function(){return c}),A.d(B,"adjustSliding",function(){return s}),A.d(B,"addSliding",function(){return i}),A.d(B,"computeReloadInterval",function(){return l}),A.d(B,"getFragmentWithSN",function(){return a}),A.d(B,"getPartWith",function(){return n});var j=A("./src/polyfills/number.ts"),P=A("./src/utils/logger.ts");function S(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 W(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(j.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 w(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(j.isFiniteNumber)(o)){var b=Math.abs(o-E);Object(j.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 O,L=d-r.startSN,x=r.fragments;for(x[L]=t,O=L;O>0;O--)e(x[O],x[O-1]);for(O=L;O<x.length-1;O++)e(x[O],x[O+1]);return r.fragmentHint&&e(x[x.length-1],r.fragmentHint),r.PTSKnown=r.alignedSliding=!0,p}function v(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(O,L){O.relurl&&(_=O.cc-L.cc),Object(j.isFiniteNumber)(O.startPTS)&&Object(j.isFiniteNumber)(O.endPTS)&&(L.start=L.startPTS=O.startPTS,L.startDTS=O.startDTS,L.appendedPTS=O.appendedPTS,L.maxStartPTS=O.maxStartPTS,L.endPTS=O.endPTS,L.endDTS=O.endDTS,L.minEndPTS=O.minEndPTS,L.duration=O.endPTS-O.startPTS,L.duration&&(f=L),t.PTSKnown=t.alignedSliding=!0),L.elementaryStreams=O.elementaryStreams,L.loader=O.loader,L.stats=O.stats,L.urlId=O.urlId,O.initSegment&&(L.initSegment=O.initSegment,E=O.initSegment)}),E){var h=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments;h.forEach(function(O){var L;(!O.initSegment||O.initSegment.relurl===((L=E)===null||L===void 0?void 0:L.relurl))&&(O.initSegment=E)})}if(t.skippedSegments&&(t.deltaUpdateFailed=t.fragments.some(function(O){return!O}),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),g(r.partList,t.partList,function(O,L){L.elementaryStreams=O.elementaryStreams,L.stats=O.stats}),f?w(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 g(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(ne,B,A){"use strict";A.r(B),A.d(B,"default",function(){return y});var j=A("./src/polyfills/number.ts"),P=A("./src/controller/base-stream-controller.ts"),S=A("./src/is-supported.ts"),W=A("./src/events.ts"),N=A("./src/utils/buffer-helper.ts"),e=A("./src/controller/fragment-tracker.ts"),w=A("./src/types/loader.ts"),v=A("./src/loader/fragment.ts"),g=A("./src/demux/transmuxer-interface.ts"),c=A("./src/types/transmuxer.ts"),s=A("./src/controller/gap-controller.ts"),i=A("./src/errors.ts"),l=A("./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(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),h.on(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.on(W.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),h.on(W.Events.ERROR,this.onError,this),h.on(W.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.on(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),h.on(W.Events.BUFFER_CREATED,this.onBufferCreated,this),h.on(W.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.on(W.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),h.on(W.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_._unregisterListeners=function(){var h=this.hls;h.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.off(W.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),h.off(W.Events.ERROR,this.onError,this),h.off(W.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.off(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),h.off(W.Events.BUFFER_CREATED,this.onBufferCreated,this),h.off(W.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.off(W.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),h.off(W.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(),O=this.retryDate;(!O||d>=O||(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,O=u.config,L=u.nextLoadLevel;if(b===null||!d&&(this.startFragRequested||!O.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!p||!p[L])return;var x=p[L];this.level=u.nextLoadLevel=L;var I=x.details;if(!I||this.state===P.State.WAITING_LEVEL||I.live&&this.levelLastLoaded!==L){this.state=P.State.WAITING_LEVEL;return}var k=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:d,w.PlaylistLevelType.MAIN);if(k===null)return;var C=k.len,F=this.getMaxBufferLength(x.maxBitrate);if(C>=F)return;if(this._streamEnded(k,I)){var V={};this.altAudio&&(V.type="video"),this.hls.trigger(W.Events.BUFFER_EOS,V),this.state=P.State.ENDED;return}var ee=k.end,ie=this.getNextFragment(ee,I);if(this.couldBacktrack&&!this.fragPrevious&&ie&&ie.sn!=="initSegment"){var pe=ie.sn-I.startSN;pe>1&&(ie=I.fragments[pe-1],this.fragmentTracker.removeFragment(ie))}if(ie&&this.fragmentTracker.getState(ie)===e.FragmentState.OK&&this.nextLoadPosition>ee){var ve=this.audioOnly&&!this.altAudio?v.ElementaryStreamTypes.AUDIO:v.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(d,ve,w.PlaylistLevelType.MAIN),ie=this.getNextFragment(this.nextLoadPosition,I)}if(!ie)return;ie.initSegment&&!ie.initSegment.data&&!this.bitrateTest&&(ie=ie.initSegment),((h=ie.decryptdata)===null||h===void 0?void 0:h.keyFormat)==="identity"&&!((o=ie.decryptdata)!==null&&o!==void 0&&o.key)?this.loadKey(ie,I):this.loadFragment(ie,I,ee)},_.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,w.PlaylistLevelType.MAIN);return o&&"fragment"in o?o.fragment:o},_.getBufferedFrag=function(h){return this.fragmentTracker.getBufferedFrag(h,w.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],O=this.fragLastKbps;O&&this.fragCurrent?u=this.fragCurrent.duration*d.maxBitrate/(1e3*O)+1:u=0}else u=0;var L=this.getBufferedFrag(o.currentTime+u);if(L){var x=this.followingBufferedFrag(L);if(x){this.abortCurrentFrag();var I=x.maxStartPTS?x.maxStartPTS:x.start,k=x.duration,C=Math.max(L.end,I+Math.min(Math.max(k-this.config.maxFragLookUpTolerance,k*.5),k*.75));this.flushMainBuffer(C,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(j.isFiniteNumber)(o)&&this.log("Media seeked to "+o.toFixed(3)),this.tick()},_.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(W.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(S.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,O=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:"+O);var L=this.fragCurrent;L&&(this.state===P.State.FRAG_LOADING||this.state===P.State.FRAG_LOADING_WAITING_RETRY)&&(L.level!==o.level&&L.loader&&(this.state=P.State.IDLE,L.loader.abort()));var x=b[p],I=0;if(d.live||(u=x.details)!==null&&u!==void 0&&u.live){if(d.fragments[0]||(d.deltaUpdateFailed=!0),d.deltaUpdateFailed)return;I=this.alignPlaylists(d,x.details)}if(x.details=d,this.levelLastLoaded=p,this.hls.trigger(W.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,I),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 O=d[u.level],L=O.details;if(!L){this.warn("Dropping fragment "+u.sn+" of level "+u.level+" after level details were reset");return}var x=O.videoCodec,I=L.PTSKnown||!L.live,k=(o=u.initSegment)===null||o===void 0?void 0:o.data,C=this._getAudioCodec(O),F=this.transmuxer=this.transmuxer||new g.default(this.hls,w.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),V=b?b.index:-1,ee=V!==-1,ie=new c.ChunkMetadata(u.level,u.sn,u.stats.chunkCount,p.byteLength,V,ee),pe=this.initPTS[u.cc];F.push(p,k,C,x,u,b,L.totalduration,I,ie,pe)},_.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 O=this.hls;u&&O.trigger(W.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),O.trigger(W.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 O in u){var L=u[O];if(L.id==="main"){if(p=O,b=L,O==="video"){var x=u[O];x&&(this.videoBuffer=x.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!==w.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(w.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,w.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!==v.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var b=(u===v.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(b,u,w.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(W.Events.FRAG_LOADED,u)})},_._handleTransmuxComplete=function(h){var o,u="main",b=this.hls,p=h.remuxResult,d=h.chunkMeta,O=this.getCurrentContext(d);if(!O){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 L=O.frag,x=O.part,I=O.level,k=p.video,C=p.text,F=p.id3,V=p.initSegment,ee=this.altAudio?void 0:p.audio;if(this.fragContextChanged(L))return;if(this.state=P.State.PARSING,V){V.tracks&&(this._bufferInitSegment(I,V.tracks,L,d),b.trigger(W.Events.FRAG_PARSING_INIT_SEGMENT,{frag:L,id:u,tracks:V.tracks}));var ie=V.initPTS,pe=V.timescale;Object(j.isFiniteNumber)(ie)&&(this.initPTS[L.cc]=ie,b.trigger(W.Events.INIT_PTS_FOUND,{frag:L,id:u,initPTS:ie,timescale:pe}))}if(k&&p.independent!==!1){if(I.details){var ve=k.startPTS,ye=k.endPTS,Ee=k.startDTS,Se=k.endDTS;if(x)x.elementaryStreams[k.type]={startPTS:ve,endPTS:ye,startDTS:Ee,endDTS:Se};else if(k.firstKeyFrame&&k.independent&&(this.couldBacktrack=!0),k.dropped&&k.independent){var fe=this.getLoadPosition()+this.config.maxBufferHole;if(fe<ve){this.backtrack(L);return}L.setElementaryStreamInfo(k.type,L.start,ye,L.start,Se,!0)}L.setElementaryStreamInfo(k.type,ve,ye,Ee,Se),this.bufferFragmentData(k,L,x,d)}}else if(p.independent===!1){this.backtrack(L);return}if(ee){var K=ee.startPTS,R=ee.endPTS,D=ee.startDTS,H=ee.endDTS;x&&(x.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:K,endPTS:R,startDTS:D,endDTS:H}),L.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,K,R,D,H),this.bufferFragmentData(ee,L,x,d)}if(F!=null&&(o=F.samples)!==null&&o!==void 0&&o.length){var J={frag:L,id:u,samples:F.samples};b.trigger(W.Events.FRAG_PARSING_METADATA,J)}if(C){var M={frag:L,id:u,samples:C.samples};b.trigger(W.Events.FRAG_PARSING_USERDATA,M)}},_._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,O=o.video,L=o.audiovideo;if(d){var x=h.audioCodec,I=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(x&&(x.indexOf("mp4a.40.5")!==-1?x="mp4a.40.2":x="mp4a.40.5"),d.metadata.channelCount!==1&&I.indexOf("firefox")===-1&&(x="mp4a.40.5")),I.indexOf("android")!==-1&&d.container!=="audio/mpeg"&&(x="mp4a.40.2",this.log("Android: force audio codec to "+x)),h.audioCodec&&h.audioCodec!==x&&this.log('Swapping manifest audio codec "'+h.audioCodec+'" for "'+x+'"'),d.levelCodec=x,d.id="main",this.log("Init audio buffer, container:"+d.container+", codecs[selected/level/parsed]=["+(x||"")+"/"+(h.audioCodec||"")+"/"+d.codec+"]")}O&&(O.levelCodec=h.videoCodec,O.id="main",this.log("Init video buffer, container:"+O.container+", codecs[level/parsed]=["+(h.videoCodec||"")+"/"+O.codec+"]")),L&&this.log("Init audiovideo buffer, container:"+L.container+", codecs[level/parsed]=["+(h.attrs.CODECS||"")+"/"+L.codec+"]"),this.hls.trigger(W.Events.BUFFER_CODECS,o),Object.keys(o).forEach(function(k){var C=o[k],F=C.initSegment;F!=null&&F.byteLength&&p.hls.trigger(W.Events.BUFFER_APPENDING,{type:k,data:F,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(W.Events.FRAG_CHANGED,{frag:o}),(!b||b.level!==p)&&this.hls.trigger(W.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(ne,B,A){"use strict";A.r(B),A.d(B,"SubtitleStreamController",function(){return r});var j=A("./src/events.ts"),P=A("./src/utils/logger.ts"),S=A("./src/utils/buffer-helper.ts"),W=A("./src/controller/fragment-finders.ts"),N=A("./src/utils/discontinuities.ts"),e=A("./src/controller/level-helper.ts"),w=A("./src/controller/fragment-tracker.ts"),v=A("./src/controller/base-stream-controller.ts"),g=A("./src/types/loader.ts"),c=A("./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(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.on(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.on(j.Events.ERROR,this.onError,this),T.on(j.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),T.on(j.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),T.on(j.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),T.on(j.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),T.on(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},y._unregisterListeners=function(){var T=this.hls;T.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.off(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.off(j.Events.ERROR,this.onError,this),T.off(j.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),T.off(j.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),T.off(j.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),T.off(j.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),T.off(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},y.startLoad=function(){this.stopLoad(),this.state=v.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=v.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(O){for(var L=0;L<O.length;){if(O[L].end<=d){O.shift();continue}else if(O[L].start<d)O[L].start=d;else break;L++}}),this.fragmentTracker.removeFragmentsInRange(f,d,g.PlaylistLevelType.SUBTITLE)}},y.onError=function(T,_){var f,h=_.frag;if(!h||h.type!==g.PlaylistLevelType.SUBTITLE)return;(f=this.fragCurrent)!==null&&f!==void 0&&f.loader&&this.fragCurrent.loader.abort(),this.state=v.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 O=d.fragments[0];if(!p.details)h.hasProgramDateTime&&d.hasProgramDateTime?Object(N.alignMediaPlaylistByPDT)(h,d):O&&Object(e.addSliding)(h,O.start);else{var L=this.alignPlaylists(h,p.details);L===0&&O&&Object(e.addSliding)(h,O.start)}}if(p.details=h,this.levelLastLoaded=o,this.tick(),h.live&&!this.fragCurrent&&this.media&&this.state===v.State.IDLE){var x=Object(W.findFragmentByPTS)(null,h.fragments,this.media.currentTime,0);x||(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(j.Events.FRAG_DECRYPTED,{frag:_,payload:b,stats:{tstart:u,tdecrypt:p}})})}},y.doTick=function(){if(!this.media){this.state=v.State.IDLE;return}if(this.state===v.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=S.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,b.currentTime-o,u.maxBufferHole),d=p.end,O=p.len,L=this.getMaxBufferLength()+o;if(O>L)return;console.assert(h,"Subtitle track details are defined on idle subtitle stream controller tick");var x=h.fragments,I=x.length,k=h.edge,C,F=this.fragPrevious;if(d<k){var V=u.maxFragLookUpTolerance;F&&h.hasProgramDateTime&&(C=Object(W.findFragmentByPDT)(x,F.endProgramDateTime,V)),C||(C=Object(W.findFragmentByPTS)(F,x,d,V),!C&&F&&F.start<x[0].start&&(C=x[0]))}else C=x[I-1];(T=C)!==null&&T!==void 0&&T.encrypted?(P.logger.log("Loading key for "+C.sn),this.state=v.State.KEY_LOADING,this.hls.trigger(j.Events.KEY_LOADING,{frag:C})):C&&this.fragmentTracker.getState(C)===w.FragmentState.NOT_LOADED&&this.loadFragment(C,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}(v.default)},"./src/controller/subtitle-track-controller.ts":function(ne,B,A){"use strict";A.r(B);var j=A("./src/events.ts"),P=A("./src/utils/texttrack-utils.ts"),S=A("./src/controller/base-playlist-controller.ts"),W=A("./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 w(s,i){s.prototype=Object.create(i.prototype),s.prototype.constructor=s,v(s,i)}function v(s,i){return v=Object.setPrototypeOf||function(a,n){return a.__proto__=n,a},v(s,i)}var g=function(s){w(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(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(j.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(j.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.on(j.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.on(j.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){var n=this.hls;n.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(j.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(j.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.off(j.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.off(j.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(j.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===W.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(j.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(j.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(j.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}(S.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}B.default=g},"./src/controller/timeline-controller.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"TimelineController",function(){return c});var j=A("./src/polyfills/number.ts"),P=A("./src/events.ts"),S=A("./src/utils/cea-608-parser.ts"),W=A("./src/utils/output-filter.ts"),N=A("./src/utils/webvtt-parser.ts"),e=A("./src/utils/texttrack-utils.ts"),w=A("./src/utils/imsc1-ttml-parser.ts"),v=A("./src/types/loader.ts"),g=A("./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 W.default(this,"textTrack1"),E=new W.default(this,"textTrack2"),y=new W.default(this,"textTrack3"),m=new W.default(this,"textTrack4");this.cea608Parser1=new S.default(1,t,E),this.cea608Parser2=new S.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===w.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===v.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===v.PlaylistLevelType.SUBTITLE)if(m.byteLength){if(!Object(j.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===w.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(w.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){g.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),g.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(w.parseIMSC1)(E,this.initPTS[t.cc],this.timescale[t.cc],function(){m.textCodec=w.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===v.PlaylistLevelType.SUBTITLE){if(!Object(j.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(ne,B,A){"use strict";A.r(B),A.d(B,"default",function(){return j});var j=function(){function P(W,N){this.subtle=void 0,this.aesIV=void 0,this.subtle=W,this.aesIV=N}var S=P.prototype;return S.decrypt=function(N,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,N)},P}()},"./src/crypt/aes-decryptor.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"removePadding",function(){return P}),A.d(B,"default",function(){return S});var j=A("./src/utils/typed-array.ts");function P(W){var N=W.byteLength,e=N&&new DataView(W.buffer).getUint8(N-1);return e?Object(j.sliceUint8)(W,0,N-e):W}var S=function(){function W(){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=W.prototype;return N.uint8ArrayToUint32Array_=function(w){for(var v=new DataView(w),g=new Uint32Array(4),c=0;c<4;c++)g[c]=v.getUint32(c*4);return g},N.initTable=function(){var w=this.sBox,v=this.invSBox,g=this.subMix,c=g[0],s=g[1],i=g[2],l=g[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,w[m]=f,v[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(w){for(var v=this.uint8ArrayToUint32Array_(w),g=!0,c=0;c<v.length&&g;)g=v[c]===this.key[c],c++;if(g)return;this.key=v;var s=this.keySize=v.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]=v[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(w){return w<<24|(w&65280)<<8|(w&16711680)>>8|w>>>24},N.decrypt=function(w,v,g){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_(g),y=E[0],m=E[1],T=E[2],_=E[3],f=new Int32Array(w),h=new Int32Array(f.length),o,u,b,p,d,O,L,x,I,k,C,F,V,ee,ie=this.networkToHostOrderSwap;v<f.length;){for(I=ie(f[v]),k=ie(f[v+1]),C=ie(f[v+2]),F=ie(f[v+3]),d=I^s[0],O=F^s[1],L=C^s[2],x=k^s[3],V=4,ee=1;ee<c;ee++)o=a[d>>>24]^n[O>>16&255]^r[L>>8&255]^t[x&255]^s[V],u=a[O>>>24]^n[L>>16&255]^r[x>>8&255]^t[d&255]^s[V+1],b=a[L>>>24]^n[x>>16&255]^r[d>>8&255]^t[O&255]^s[V+2],p=a[x>>>24]^n[d>>16&255]^r[O>>8&255]^t[L&255]^s[V+3],d=o,O=u,L=b,x=p,V=V+4;o=i[d>>>24]<<24^i[O>>16&255]<<16^i[L>>8&255]<<8^i[x&255]^s[V],u=i[O>>>24]<<24^i[L>>16&255]<<16^i[x>>8&255]<<8^i[d&255]^s[V+1],b=i[L>>>24]<<24^i[x>>16&255]<<16^i[d>>8&255]<<8^i[O&255]^s[V+2],p=i[x>>>24]<<24^i[d>>16&255]<<16^i[O>>8&255]<<8^i[L&255]^s[V+3],h[v]=ie(o^y),h[v+1]=ie(p^m),h[v+2]=ie(b^T),h[v+3]=ie(u^_),y=I,m=k,T=C,_=F,v=v+4}return h.buffer},W}()},"./src/crypt/decrypter.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"default",function(){return v});var j=A("./src/crypt/aes-crypto.ts"),P=A("./src/crypt/fast-aes-key.ts"),S=A("./src/crypt/aes-decryptor.ts"),W=A("./src/utils/logger.ts"),N=A("./src/utils/mp4-tools.ts"),e=A("./src/utils/typed-array.ts"),w=16,v=function(){function g(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=g.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(S.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 S.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 j.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 W.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%w;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;W.logger.log("[decrypter.ts]: "+i),this.logEnabled=!1},g}()},"./src/crypt/fast-aes-key.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"default",function(){return j});var j=function(){function P(W,N){this.subtle=void 0,this.key=void 0,this.subtle=W,this.key=N}var S=P.prototype;return S.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},P}()},"./src/demux/aacdemuxer.ts":function(ne,B,A){"use strict";A.r(B);var j=A("./src/demux/base-audio-demuxer.ts"),P=A("./src/demux/adts.ts"),S=A("./src/utils/logger.ts"),W=A("./src/demux/id3.ts");function N(v,g){v.prototype=Object.create(g.prototype),v.prototype.constructor=v,e(v,g)}function e(v,g){return e=Object.setPrototypeOf||function(s,i){return s.__proto__=i,s},e(v,g)}var w=function(v){N(g,v);function g(s,i){var l;return l=v.call(this)||this,l.observer=void 0,l.config=void 0,l.observer=s,l.config=i,l}var c=g.prototype;return c.resetInitSegment=function(i,l,a){v.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}},g.probe=function(i){if(!i)return!1;for(var l=W.getID3Data(i,0)||[],a=l.length,n=i.length;a<n;a++)if(P.probe(i,a))return S.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},g}(j.default);w.minProbeByteLength=9,B.default=w},"./src/demux/adts.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"getAudioConfig",function(){return W}),A.d(B,"isHeaderPattern",function(){return N}),A.d(B,"getHeaderLength",function(){return e}),A.d(B,"getFullFrameLength",function(){return w}),A.d(B,"canGetFrameLength",function(){return v}),A.d(B,"isHeader",function(){return g}),A.d(B,"canParse",function(){return c}),A.d(B,"probe",function(){return s}),A.d(B,"initTrackConfig",function(){return i}),A.d(B,"getFrameDuration",function(){return l}),A.d(B,"parseFrameHeader",function(){return a}),A.d(B,"appendFrame",function(){return n});var j=A("./src/utils/logger.ts"),P=A("./src/errors.ts"),S=A("./src/events.ts");function W(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(S.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,j.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 w(r,t){return(r[t+3]&3)<<11|r[t+4]<<3|(r[t+5]&224)>>>5}function v(r,t){return t+5<r.length}function g(r,t){return t+1<r.length&&N(r,t)}function c(r,t){return v(r,t)&&N(r,t)&&w(r,t)<=r.length-t}function s(r,t){if(g(r,t)){var E=e(r,t);if(t+E>=r.length)return!1;var y=w(r,t);if(y<=E)return!1;var m=t+y;return m===r.length||g(r,m)}return!1}function i(r,t,E,y,m){if(!r.samplerate){var T=W(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,j.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),_=w(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(ne,B,A){"use strict";A.r(B),A.d(B,"initPTSFn",function(){return w});var j=A("./src/polyfills/number.ts"),P=A("./src/demux/id3.ts"),S=A("./src/demux/dummy-demuxed-track.ts"),W=A("./src/utils/mp4-tools.ts"),N=A("./src/utils/typed-array.ts"),e=function(){function v(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var g=v.prototype;return g.resetInitSegment=function(s,i,l){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},g.resetTimeStamp=function(){},g.resetContiguity=function(){},g.canParse=function(s,i){return!1},g.appendFrame=function(s,i,l){},g.demux=function(s,i){this.cachedData&&(s=Object(W.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=w(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(W.appendUint8Array)(this.cachedData,_):this.cachedData=_}}return{audioTrack:t,avcTrack:Object(S.dummyTrack)(),id3Track:E,textTrack:Object(S.dummyTrack)()}},g.demuxSampleAes=function(s,i,l){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},g.flush=function(s){var i=this.cachedData;return i&&(this.cachedData=null,this.demux(i,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(S.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(S.dummyTrack)()}},g.destroy=function(){},v}(),w=function(g,c){return Object(j.isFiniteNumber)(g)?g*90:c*9e4};B.default=e},"./src/demux/chunk-cache.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"default",function(){return j});var j=function(){function S(){this.chunks=[],this.dataLength=0}var W=S.prototype;return W.push=function(e){this.chunks.push(e),this.dataLength+=e.length},W.flush=function(){var e=this.chunks,w=this.dataLength,v;if(e.length)e.length===1?v=e[0]:v=P(e,w);else return new Uint8Array(0);return this.reset(),v},W.reset=function(){this.chunks.length=0,this.dataLength=0},S}();function P(S,W){for(var N=new Uint8Array(W),e=0,w=0;w<S.length;w++){var v=S[w];N.set(v,e),e+=v.length}return N}},"./src/demux/dummy-demuxed-track.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"dummyTrack",function(){return j});function j(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ne,B,A){"use strict";A.r(B);var j=A("./src/utils/logger.ts"),P=function(){function S(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 W=S.prototype;return W.loadWord=function(){var e=this.data,w=this.bytesAvailable,v=e.byteLength-w,g=new Uint8Array(4),c=Math.min(4,w);if(c===0)throw new Error("no bytes available");g.set(e.subarray(v,v+c)),this.word=new DataView(g.buffer).getUint32(0),this.bitsAvailable=c*8,this.bytesAvailable-=c},W.skipBits=function(e){var w;this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,w=e>>3,e-=w>>3,this.bytesAvailable-=w,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)},W.readBits=function(e){var w=Math.min(this.bitsAvailable,e),v=this.word>>>32-w;return e>32&&j.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=w,this.bitsAvailable>0?this.word<<=w:this.bytesAvailable>0&&this.loadWord(),w=e-w,w>0&&this.bitsAvailable?v<<w|this.readBits(w):v},W.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()},W.skipUEG=function(){this.skipBits(1+this.skipLZ())},W.skipEG=function(){this.skipBits(1+this.skipLZ())},W.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},W.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},W.readBoolean=function(){return this.readBits(1)===1},W.readUByte=function(){return this.readBits(8)},W.readUShort=function(){return this.readBits(16)},W.readUInt=function(){return this.readBits(32)},W.skipScalingList=function(e){for(var w=8,v=8,g,c=0;c<e;c++)v!==0&&(g=this.readEG(),v=(w+g+256)%256),w=v===0?w:v},W.readSPS=function(){var e=0,w=0,v=0,g=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(),w=n(),v=n(),g=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-w*2),height:(2-u)*(o+1)*16-(u?2:4)*(v+g),pixelRatio:b}},W.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},S}();B.default=P},"./src/demux/id3.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"isHeader",function(){return j}),A.d(B,"isFooter",function(){return P}),A.d(B,"getID3Data",function(){return S}),A.d(B,"canParse",function(){return N}),A.d(B,"getTimeStamp",function(){return e}),A.d(B,"isTimeStampFrame",function(){return w}),A.d(B,"getID3Frames",function(){return g}),A.d(B,"decodeFrame",function(){return c}),A.d(B,"utf8ArrayToStr",function(){return n}),A.d(B,"testables",function(){return r});var j=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)))},S=function(m,T){for(var _=T,f=0;j(m,T);){f+=10;var h=W(m,T+6);f+=h,P(m,T+10)&&(f+=10),T+=f}return f>0?m.subarray(_,_+f):void 0},W=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 j(m,T)&&W(m,T+6)+10<=m.length-T},e=function(m){for(var T=g(m),_=0;_<T.length;_++){var f=T[_];if(w(f))return a(f)}return},w=function(m){return m&&m.key==="PRIV"&&m.info==="com.apple.streaming.transportStreamTimestamp"},v=function(m){var T=String.fromCharCode(m[0],m[1],m[2],m[3]),_=W(m,4),f=10;return{type:T,size:_,data:m.subarray(f,f+_)}},g=function(m){for(var T=0,_=[];j(m,T);){var f=W(m,T+6);T+=10;for(var h=T+f;T+8<h;){var o=v(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="",O=0;O<o;){if(u=m[O++],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[O++],d+=String.fromCharCode((u&31)<<6|b&63);break;case 14:b=m[O++],p=m[O++],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(ne,B,A){"use strict";A.r(B);var j=A("./src/demux/base-audio-demuxer.ts"),P=A("./src/demux/id3.ts"),S=A("./src/utils/logger.ts"),W=A("./src/demux/mpegaudio.ts");function N(v,g){v.prototype=Object.create(g.prototype),v.prototype.constructor=v,e(v,g)}function e(v,g){return e=Object.setPrototypeOf||function(s,i){return s.__proto__=i,s},e(v,g)}var w=function(v){N(g,v);function g(){return v.apply(this,arguments)||this}var c=g.prototype;return c.resetInitSegment=function(i,l,a){v.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}},g.probe=function(i){if(!i)return!1;for(var l=P.getID3Data(i,0)||[],a=l.length,n=i.length;a<n;a++)if(W.probe(i,a))return S.logger.log("MPEG Audio sync word found !"),!0;return!1},c.canParse=function(i,l){return W.canParse(i,l)},c.appendFrame=function(i,l,a){return this.initPTS===null?void 0:W.appendFrame(i,l,a,this.initPTS,this.frameIndex)},g}(j.default);w.minProbeByteLength=4,B.default=w},"./src/demux/mp4demuxer.ts":function(ne,B,A){"use strict";A.r(B);var j=A("./src/utils/mp4-tools.ts"),P=A("./src/demux/dummy-demuxed-track.ts"),S=function(){function W(e,w){this.remainderData=null,this.config=void 0,this.config=w}var N=W.prototype;return N.resetTimeStamp=function(){},N.resetInitSegment=function(){},N.resetContiguity=function(){},W.probe=function(w){return Object(j.findBox)({data:w,start:0,end:Math.min(w.length,16384)},["moof"]).length>0},N.demux=function(w){var v=w,g=Object(P.dummyTrack)();if(this.config.progressive){this.remainderData&&(v=Object(j.appendUint8Array)(this.remainderData,w));var c=Object(j.segmentValidRange)(v);this.remainderData=c.remainder,g.samples=c.valid||new Uint8Array}else g.samples=v;return{audioTrack:Object(P.dummyTrack)(),avcTrack:g,id3Track:Object(P.dummyTrack)(),textTrack:Object(P.dummyTrack)()}},N.flush=function(){var w=Object(P.dummyTrack)();return w.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(P.dummyTrack)(),avcTrack:w,id3Track:Object(P.dummyTrack)(),textTrack:Object(P.dummyTrack)()}},N.demuxSampleAes=function(w,v,g){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},N.destroy=function(){},W}();S.minProbeByteLength=1024,B.default=S},"./src/demux/mpegaudio.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"appendFrame",function(){return e}),A.d(B,"parseHeader",function(){return w}),A.d(B,"isHeaderPattern",function(){return v}),A.d(B,"isHeader",function(){return g}),A.d(B,"canParse",function(){return c}),A.d(B,"probe",function(){return s});var j=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],S=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],W=[[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=w(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 w(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=S[_*3+t],h=y===3?1:2,o=W[a][n],u=N[n],b=o*8*u,p=Math.floor(o*T/f+E)*u;if(j===null){var d=navigator.userAgent||"",O=d.match(/Chrome\/(\d+)/i);j=O?parseInt(O[1]):0}var L=!!j&&j<=87;return L&&n===2&&T>=224e3&&y===0&&(i[l+3]=i[l+3]|128),{sampleRate:f,channelCount:h,frameLength:p,samplesPerFrame:b}}}function v(i,l){return i[l]===255&&(i[l+1]&224)===224&&(i[l+1]&6)!==0}function g(i,l){return l+1<i.length&&v(i,l)}function c(i,l){var a=4;return v(i,l)&&a<=i.length-l}function s(i,l){if(l+1<i.length&&v(i,l)){var a=4,n=w(i,l),r=a;n!=null&&n.frameLength&&(r=n.frameLength);var t=l+r;return t===i.length||g(i,t)}return!1}},"./src/demux/sample-aes.ts":function(ne,B,A){"use strict";A.r(B);var j=A("./src/crypt/decrypter.ts"),P=A("./src/demux/tsdemuxer.ts"),S=function(){function W(e,w,v){this.keyData=void 0,this.decrypter=void 0,this.keyData=v,this.decrypter=new j.default(e,w,{removePKCS7Padding:!1})}var N=W.prototype;return N.decryptBuffer=function(w,v){this.decrypter.decrypt(w,this.keyData.key.buffer,this.keyData.iv.buffer,v)},N.decryptAacSample=function(w,v,g,c){var s=w[v].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(w,v+1,g)})},N.decryptAacSamples=function(w,v,g){for(;;v++){if(v>=w.length){g();return}if(w[v].unit.length<32)continue;var c=this.decrypter.isSync();if(this.decryptAacSample(w,v,g,c),!c)return}},N.getAvcEncryptedData=function(w){for(var v=Math.floor((w.length-48)/160)*16+16,g=new Int8Array(v),c=0,s=32;s<=w.length-16;s+=160,c+=16)g.set(w.subarray(s,s+16),c);return g},N.getAvcDecryptedUnit=function(w,v){for(var g=new Uint8Array(v),c=0,s=32;s<=w.length-16;s+=160,c+=16)w.set(g.subarray(c,c+16),s);return w},N.decryptAvcSample=function(w,v,g,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(w,v,g+1,c)})},N.decryptAvcSamples=function(w,v,g,c){if(w instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;v++,g=0){if(v>=w.length){c();return}for(var s=w[v].units;!(g>=s.length);g++){var i=s[g];if(i.data.length<=48||i.type!==1&&i.type!==5)continue;var l=this.decrypter.isSync();if(this.decryptAvcSample(w,v,g,c,i,l),!l)return}}},W}();B.default=S},"./src/demux/transmuxer-interface.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"default",function(){return s});var j=A("./node_modules/webworkify-webpack/index.js"),P=A.n(j),S=A("./src/events.ts"),W=A("./src/demux/transmuxer.ts"),N=A("./src/utils/logger.ts"),e=A("./src/errors.ts"),w=A("./src/utils/mediasource-helper.ts"),v=A("./node_modules/eventemitter3/index.js"),g=A.n(v),c=Object(w.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 v.EventEmitter,this.observer.on(S.Events.FRAG_DECRYPTED,m),this.observer.on(S.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=j("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),f.addEventListener("message",this.onwmsg),f.onerror=function(h){a.trigger(S.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 W.default(this.observer,T,y,_,n),this.worker=null}}else this.transmuxer=new W.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,O=this.frag,L=!(O&&y.cc===O.cc),x=!(O&&f.level===O.level),I=O?f.sn-O.sn:-1,k=this.part?f.part-this.part.index:1,C=!x&&(I===1||I===0&&k===1),F=self.performance.now();(x||I||y.stats.parsing.start===0)&&(y.stats.parsing.start=F),m&&(k||!C)&&(m.stats.parsing.start=F);var V=new W.TransmuxState(L,C,_,x,p);if(!C||L){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: `+L+`
trackSwitch: `+x+`
contiguous: `+C+`
accurateTimeOffset: `+_+`
timeOffset: `+p);var ee=new W.TransmuxConfig(t,E,r,T,h);this.configureTransmuxer(ee)}if(this.frag=y,this.part=m,b)b.postMessage({cmd:"demux",data:n,decryptdata:d,chunkMeta:f,state:V},n instanceof ArrayBuffer?[n]:[]);else if(u){var ie=u.push(n,d,f,V);Object(W.isPromise)(ie)?ie.then(function(pe){o.handleTransmuxComplete(pe)}):this.handleTransmuxComplete(ie)}},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(W.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(ne,B,A){"use strict";A.r(B),A.d(B,"default",function(){return e});var j=A("./src/demux/transmuxer.ts"),P=A("./src/events.ts"),S=A("./src/utils/logger.ts"),W=A("./node_modules/eventemitter3/index.js"),N=A.n(W);function e(s){var i=new W.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 j.default(i,n.typeSupported,r,n.vendor,n.id),Object(S.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(j.isPromise)(t)?t.then(function(m){w(s,m)}):w(s,t);break}case"flush":{var E=n.chunkMeta,y=s.transmuxer.flush(E);Object(j.isPromise)(y)?y.then(function(m){g(s,m,E)}):g(s,y,E);break}default:break}})}function w(s,i){if(c(i.remuxResult))return;var l=[],a=i.remuxResult,n=a.audio,r=a.video;n&&v(l,n),r&&v(l,r),s.postMessage({event:"transmuxComplete",data:i},l)}function v(s,i){i.data1&&s.push(i.data1.buffer),i.data2&&s.push(i.data2.buffer)}function g(s,i,l){i.forEach(function(a){w(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(ne,B,A){"use strict";A.r(B),A.d(B,"default",function(){return r}),A.d(B,"isPromise",function(){return y}),A.d(B,"TransmuxConfig",function(){return m}),A.d(B,"TransmuxState",function(){return T});var j=A("./src/events.ts"),P=A("./src/errors.ts"),S=A("./src/crypt/decrypter.ts"),W=A("./src/demux/aacdemuxer.ts"),N=A("./src/demux/mp4demuxer.ts"),e=A("./src/demux/tsdemuxer.ts"),w=A("./src/demux/mp3demuxer.ts"),v=A("./src/remux/mp4-remuxer.ts"),g=A("./src/remux/passthrough-remuxer.ts"),c=A("./src/demux/chunk-cache.ts"),s=A("./src/utils/mp4-tools.ts"),i=A("./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:v.default},{demux:N.default,remux:g.default},{demux:W.default,remux:v.default},{demux:w.default,remux:v.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,O=b.transmuxing;O.executeStart=l();var L=new Uint8Array(o),x=this.cache,I=this.config,k=this.currentTransmuxState,C=this.transmuxConfig;p&&(this.currentTransmuxState=p);var F=t(L,u);if(F&&F.method==="AES-128"){var V=this.getDecrypter();if(I.enableSoftwareAES){var ee=V.softwareDecrypt(L,F.key.buffer,F.iv.buffer);if(!ee)return O.executeEnd=l(),E(b);L=new Uint8Array(ee)}else return this.decryptionPromise=V.webCryptoDecrypt(L,F.key.buffer,F.iv.buffer).then(function(me){var _e=d.push(me,null,b);return d.decryptionPromise=null,_e}),this.decryptionPromise}var ie=p||k,pe=ie.contiguous,ve=ie.discontinuity,ye=ie.trackSwitch,Ee=ie.accurateTimeOffset,Se=ie.timeOffset,fe=C.audioCodec,K=C.videoCodec,R=C.defaultInitPts,D=C.duration,H=C.initSegmentData;if((ve||ye)&&this.resetInitSegment(H,fe,K,D),ve&&this.resetInitialTimestamp(R),pe||this.resetContiguity(),this.needsProbing(L,ve,ye)){if(x.dataLength){var J=x.flush();L=Object(s.appendUint8Array)(J,L)}this.configureTransmuxer(L,C)}var M=this.transmux(L,F,Se,Ee,b),ae=this.currentTransmuxState;return ae.contiguous=!0,ae.discontinuity=!1,ae.trackSwitch=!1,O.executeEnd=l(),M},f.flush=function(o){var u=this,b=o.transmuxing;b.executeStart=l();var p=this.decrypter,d=this.cache,O=this.currentTransmuxState,L=this.decryptionPromise;if(L)return L.then(function(){return u.flush(o)});var x=[],I=O.timeOffset;if(p){var k=p.flush();k&&x.push(this.push(k,null,o))}var C=d.dataLength;d.reset();var F=this.demuxer,V=this.remuxer;if(!F||!V)return C>=n&&this.observer.emit(j.Events.ERROR,j.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 ee=F.flush(I);return y(ee)?ee.then(function(ie){return u.flushRemux(x,ie,o),x}):(this.flushRemux(x,ee,o),x)},f.flushRemux=function(o,u,b){var p=u.audioTrack,d=u.avcTrack,O=u.id3Track,L=u.textTrack,x=this.currentTransmuxState,I=x.accurateTimeOffset,k=x.timeOffset;i.logger.log("[transmuxer.ts]: Flushed fragment "+b.sn+(b.part>-1?" p: "+b.part:"")+" of level "+b.level);var C=this.remuxer.remux(p,d,O,L,k,I,!0,this.id);o.push({remuxResult:C,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,O=this.remuxer;if(!d||!O)return;d.resetInitSegment(u,b,p),O.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 O;return u&&u.method==="SAMPLE-AES"?O=this.transmuxSampleAes(o,u,b,p,d):O=this.transmuxUnencrypted(o,b,p,d),O},f.transmuxUnencrypted=function(o,u,b,p){var d=this.demuxer.demux(o,u,!1,!this.config.progressive),O=d.audioTrack,L=d.avcTrack,x=d.id3Track,I=d.textTrack,k=this.remuxer.remux(O,L,x,I,u,b,!1,this.id);return{remuxResult:k,chunkMeta:p}},f.transmuxSampleAes=function(o,u,b,p,d){var O=this;return this.demuxer.demuxSampleAes(o,u,b).then(function(L){var x=O.remuxer.remux(L.audioTrack,L.avcTrack,L.id3Track,L.textTrack,b,p,!1,O.id);return{remuxResult:x,chunkMeta:d}})},f.configureTransmuxer=function(o,u){for(var b=this.config,p=this.observer,d=this.typeSupported,O=this.vendor,L=u.audioCodec,x=u.defaultInitPts,I=u.duration,k=u.initSegmentData,C=u.videoCodec,F,V=0,ee=a.length;V<ee;V++)if(a[V].demux.probe(o)){F=a[V];break}F||(i.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),F={demux:N.default,remux:g.default});var ie=this.demuxer,pe=this.remuxer,ve=F.remux,ye=F.demux;(!pe||!(pe instanceof ve))&&(this.remuxer=new ve(p,b,d,O)),(!ie||!(ie instanceof ye))&&(this.demuxer=new ye(p,b,d),this.probe=ye.probe),this.resetInitSegment(k,L,C,I),this.resetInitialTimestamp(x)},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 S.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(ne,B,A){"use strict";A.r(B),A.d(B,"discardEPB",function(){return E});var j=A("./src/demux/adts.ts"),P=A("./src/demux/mpegaudio.ts"),S=A("./src/demux/exp-golomb.ts"),W=A("./src/demux/id3.ts"),N=A("./src/demux/sample-aes.ts"),e=A("./src/events.ts"),w=A("./src/utils/mp4-tools.ts"),v=A("./src/utils/logger.ts"),g=A("./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&&v.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,O=b.pid,L=b.pesData,x=p.pid,I=d.pid,k=p.pesData,C=d.pesData,F=!1,V=this.pmtParsed,ee=this._pmtId,ie=_.length;if(this.remainderData&&(_=Object(w.appendUint8Array)(this.remainderData,_),ie=_.length,this.remainderData=null),ie<188&&!o)return this.remainderData=_,{audioTrack:p,avcTrack:b,id3Track:d,textTrack:this._txtTrack};var pe=Math.max(0,y.syncOffset(_));ie-=(ie+pe)%188,ie<_.byteLength&&!o&&(this.remainderData=new Uint8Array(_.buffer,ie,_.buffer.byteLength-ie));for(var ve=pe;ve<ie;ve+=188)if(_[ve]===71){var ye=!!(_[ve+1]&64),Ee=((_[ve+1]&31)<<8)+_[ve+2],Se=(_[ve+3]&48)>>4,fe=void 0;if(Se>1){if(fe=ve+5+_[ve+4],fe===ve+188)continue}else fe=ve+4;switch(Ee){case O:ye&&(L&&(u=n(L))&&this.parseAVCPES(u,!1),L={data:[],size:0}),L&&(L.data.push(_.subarray(fe,ve+188)),L.size+=ve+188-fe);break;case x:ye&&(k&&(u=n(k))&&(p.isAAC?this.parseAACPES(u):this.parseMPEGPES(u)),k={data:[],size:0}),k&&(k.data.push(_.subarray(fe,ve+188)),k.size+=ve+188-fe);break;case I:ye&&(C&&(u=n(C))&&this.parseID3PES(u),C={data:[],size:0}),C&&(C.data.push(_.subarray(fe,ve+188)),C.size+=ve+188-fe);break;case 0:ye&&(fe+=_[fe]+1),ee=this._pmtId=l(_,fe);break;case ee:{ye&&(fe+=_[fe]+1);var K=a(_,fe,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,h);O=K.avc,O>0&&(b.pid=O),x=K.audio,x>0&&(p.pid=x,p.isAAC=K.isAAC),I=K.id3,I>0&&(d.pid=I),F&&!V&&(v.logger.log("reparse from beginning"),F=!1,ve=pe-188),V=this.pmtParsed=!0;break}case 17:case 8191:break;default:F=!0;break}}else this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});b.pesData=L,p.pesData=k,d.pesData=C;var R={audioTrack:p,avcTrack:b,id3Track:d,textTrack:this._txtTrack};return o&&this.extractRemainingSamples(R),R},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&&v.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,O=!1;_.data=null,p&&u.length&&!o.audFound&&(r(p,o),p=this.avcSample=i(!1,_.pts,_.dts,"")),u.forEach(function(L){switch(L.type){case 1:{d=!0,p||(p=h.avcSample=i(!0,_.pts,_.dts,"")),b&&(p.debug+="NDR "),p.frame=!0;var x=L.data;if(O&&x.length>4){var I=new S.default(x).readSliceType();(I===2||I===4||I===7||I===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 k=new S.default(E(L.data));k.readUByte();for(var C=0,F=0,V=!1,ee=0;!V&&k.bytesAvailable>1;){C=0;do ee=k.readUByte(),C+=ee;while(ee===255);F=0;do ee=k.readUByte(),F+=ee;while(ee===255);if(C===4&&k.bytesAvailable!==0){V=!0;var ie=k.readUByte();if(ie===181){var pe=k.readUShort();if(pe===49){var ve=k.readUInt();if(ve===1195456820){var ye=k.readUByte();if(ye===3){for(var Ee=k.readUByte(),Se=k.readUByte(),fe=31&Ee,K=[Ee,Se],R=0;R<fe;R++)K.push(k.readUByte()),K.push(k.readUByte()),K.push(k.readUByte());t(h._txtTrack.samples,{type:3,pts:_.pts,bytes:K})}}}}}else if(C===5&&k.bytesAvailable!==0){if(V=!0,F>16){for(var D=[],H=0;H<16;H++)D.push(k.readUByte().toString(16)),(H===3||H===5||H===7||H===9)&&D.push("-");for(var J=F-16,M=new Uint8Array(J),ae=0;ae<J;ae++)M[ae]=k.readUByte();t(h._txtTrack.samples,{pts:_.pts,payloadType:C,uuid:D.join(""),userData:Object(W.utf8ArrayToStr)(M),userDataBytes:M})}}else if(F<k.bytesAvailable)for(var me=0;me<F;me++)k.readUByte()}break}case 7:if(d=!0,O=!0,b&&p&&(p.debug+="SPS "),!o.sps){var _e=new S.default(L.data),q=_e.readSPS();o.width=q.width,o.height=q.height,o.pixelRatio=q.pixelRatio,o.sps=[L.data],o.duration=h._duration;for(var oe=L.data.subarray(1,4),ue="avc1.",ce=0;ce<3;ce++){var be=oe[ce].toString(16);be.length<2&&(be="0"+be),ue+=be}o.codec=ue}break;case 8:d=!0,b&&p&&(p.debug+="PPS "),o.pps||(o.pps=[L.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 "+L.type+" ");break}if(p&&d){var Ce=p.units;Ce.push(L)}}),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,O,L,x=-1,I=0;for(o===-1&&(x=0,I=_[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(x>=0){var k={data:_.subarray(x,p-o-1),type:I};b.push(k)}else{var C=this.getLastNalUnit();if(C&&(u&&p<=4-u&&(C.state&&(C.data=C.data.subarray(0,C.data.byteLength-u))),O=p-o-1,O>0)){var F=new Uint8Array(C.data.byteLength+O);F.set(C.data,0),F.set(_.subarray(0,O),C.data.byteLength),C.data=F,C.state=0}}p<f?(L=_[p]&31,x=p,I=L,o=0):o=-1}else o=0}if(x>=0&&o>=0){var V={data:_.subarray(x,f),type:I,state:o};b.push(V)}if(b.length===0){var ee=this.getLastNalUnit();if(ee){var ie=new Uint8Array(ee.data.byteLength+_.byteLength);ie.set(ee.data,0),ie.set(_,ee.data.byteLength),ee.data=ie}}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 O,L;for(O=f,L=u.length;O<L-1&&!j.isHeader(u,O);O++);if(O!==f){var x,I;if(O<L-1?(x="AAC PES did not start with ADTS header,offset:"+O,I=!1):(x="no ADTS header found in AAC PES",I=!0),v.logger.warn("parsing error:"+x),this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:I,reason:x}),I)return}j.initTrackConfig(h,this.observer,u,O,this.audioCodec);var k;if(_.pts!==void 0)k=_.pts;else if(o){var C=j.getFrameDuration(h.samplerate);k=o.sample.pts+C}else{v.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var F=0;O<L;)if(j.isHeader(u,O)){if(O+5<L){var V=j.appendFrame(h,u,O,k,F);if(V)if(V.missing)this.aacOverFlow=V;else{O+=V.length,F++;continue}}break}else O++},m.parseMPEGPES=function(_){var f=_.data,h=f.length,o=0,u=0,b=_.pts;if(b===void 0){v.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){v.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(!_){v.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(!_){v.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):v.logger.log("MPEG audio found, not supported in this browser");break;case 36:v.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&&(v.logger.warn(Math.round((h-o)/9e4)+"s delta between PTS and DTS, align them"),h=o)):o=h),f=T[8];var O=f+9;if(y.size<=O)return null;y.size-=O;for(var L=new Uint8Array(y.size),x=0,I=u.length;x<I;x++){T=u[x];var k=T.byteLength;if(O)if(O>k){O-=k;continue}else T=T.subarray(O),k-=O,O=0;L.set(T,m),m+=k}return _&&(_-=f+3),{data:L,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&&v.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}B.default=s},"./src/errors.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"ErrorTypes",function(){return j}),A.d(B,"ErrorDetails",function(){return P});var j;(function(S){S.NETWORK_ERROR="networkError",S.MEDIA_ERROR="mediaError",S.KEY_SYSTEM_ERROR="keySystemError",S.MUX_ERROR="muxError",S.OTHER_ERROR="otherError"})(j||(j={}));var P;(function(S){S.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",S.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",S.KEY_SYSTEM_NO_SESSION="keySystemNoSession",S.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",S.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",S.MANIFEST_LOAD_ERROR="manifestLoadError",S.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",S.MANIFEST_PARSING_ERROR="manifestParsingError",S.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",S.LEVEL_EMPTY_ERROR="levelEmptyError",S.LEVEL_LOAD_ERROR="levelLoadError",S.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",S.LEVEL_SWITCH_ERROR="levelSwitchError",S.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",S.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",S.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",S.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",S.FRAG_LOAD_ERROR="fragLoadError",S.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",S.FRAG_DECRYPT_ERROR="fragDecryptError",S.FRAG_PARSING_ERROR="fragParsingError",S.REMUX_ALLOC_ERROR="remuxAllocError",S.KEY_LOAD_ERROR="keyLoadError",S.KEY_LOAD_TIMEOUT="keyLoadTimeOut",S.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",S.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",S.BUFFER_APPEND_ERROR="bufferAppendError",S.BUFFER_APPENDING_ERROR="bufferAppendingError",S.BUFFER_STALLED_ERROR="bufferStalledError",S.BUFFER_FULL_ERROR="bufferFullError",S.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",S.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",S.INTERNAL_EXCEPTION="internalException",S.INTERNAL_ABORTED="aborted",S.UNKNOWN="unknown"})(P||(P={}))},"./src/events.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"Events",function(){return j});var j;(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"})(j||(j={}))},"./src/hls.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"default",function(){return y});var j=A("./node_modules/url-toolkit/src/url-toolkit.js"),P=A.n(j),S=A("./src/loader/playlist-loader.ts"),W=A("./src/loader/key-loader.ts"),N=A("./src/controller/id3-track-controller.ts"),e=A("./src/controller/latency-controller.ts"),w=A("./src/controller/level-controller.ts"),v=A("./src/controller/fragment-tracker.ts"),g=A("./src/controller/stream-controller.ts"),c=A("./src/is-supported.ts"),s=A("./src/utils/logger.ts"),i=A("./src/config.ts"),l=A("./node_modules/eventemitter3/index.js"),a=A.n(l),n=A("./src/events.ts"),r=A("./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),O=this.capLevelController=new u(this),L=new b(this),x=new S.default(this),I=new W.default(this),k=new N.default(this),C=this.levelController=new w.default(this),F=new v.FragmentTracker(this),V=this.streamController=new g.default(this,F);O.setStreamController(V),L.setStreamController(V);var ee=[C,V];this.networkControllers=ee;var ie=[x,I,p,d,O,L,k,F];this.audioTrackController=this.createController(f.audioTrackController,null,ee),this.createController(f.audioStreamController,F,ee),this.subtitleTrackController=this.createController(f.subtitleTrackController,null,ee),this.createController(f.subtitleStreamController,F,ee),this.createController(f.timelineController,null,ie),this.emeController=this.createController(f.emeController,null,ie),this.cmcdController=this.createController(f.cmcdController,null,ie),this.latencyController=this.createController(e.default,null,ie),this.coreComponents=ie}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=j.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(ne,B,A){"use strict";A.r(B),A.d(B,"isSupported",function(){return S}),A.d(B,"changeTypeSupported",function(){return W});var j=A("./src/utils/mediasource-helper.ts");function P(){return self.SourceBuffer||self.WebKitSourceBuffer}function S(){var N=Object(j.getMediaSource)();if(!N)return!1;var e=P(),w=N&&typeof N.isTypeSupported=="function"&&N.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),v=!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function";return!!w&&!!v}function W(){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(ne,B,A){"use strict";A.r(B),A.d(B,"default",function(){return s}),A.d(B,"LoadError",function(){return l});var j=A("./src/polyfills/number.ts"),P=A("./src/errors.ts");function S(a,n){a.prototype=Object.create(n.prototype),a.prototype.constructor=a,v(a,n)}function W(a){var n=typeof Map=="function"?new Map:void 0;return W=function(t){if(t===null||!w(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,g(this).constructor)}return E.prototype=Object.create(t.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),v(E,t)},W(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&&v(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 w(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function v(a,n){return v=Object.setPrototypeOf||function(t,E){return t.__proto__=E,t},v(a,n)}function g(a){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},g(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(O,L,x,I){y.resetLoader(t,u),h({frag:t,part:null,payload:O.data,networkDetails:I})},onError:function(O,L,x){y.resetLoader(t,u),o(new l({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:O,networkDetails:x}))},onAbort:function(O,L,x){y.resetLoader(t,u),o(new l({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,networkDetails:x}))},onTimeout:function(O,L,x){y.resetLoader(t,u),o(new l({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,networkDetails:x}))},onProgress:function(O,L,x,I){E&&E({frag:t,part:null,payload:x,networkDetails:I})}})})},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(O,L,x,I){m.resetLoader(t,u),m.updateStatsFromPart(t,E);var k={frag:t,part:E,payload:O.data,networkDetails:I};y(k),h(k)},onError:function(O,L,x){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:O,networkDetails:x}))},onAbort:function(O,L,x){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:x}))},onTimeout:function(O,L,x){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:x}))}})})},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(j.isFiniteNumber)(E)&&Object(j.isFiniteNumber)(y)&&(t.rangeStart=E,t.rangeEnd=y),t}var l=function(a){S(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}(W(Error))},"./src/loader/fragment.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"ElementaryStreamTypes",function(){return s}),A.d(B,"BaseSegment",function(){return i}),A.d(B,"Fragment",function(){return l}),A.d(B,"Part",function(){return a});var j=A("./src/polyfills/number.ts"),P=A("./node_modules/url-toolkit/src/url-toolkit.js"),S=A.n(P),W=A("./src/utils/logger.ts"),N=A("./src/loader/level-key.ts"),e=A("./src/loader/load-stats.ts");function w(n,r){n.prototype=Object.create(r.prototype),n.prototype.constructor=n,v(n,r)}function v(n,r){return v=Object.setPrototypeOf||function(E,y){return E.__proto__=y,E},v(n,r)}function g(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&&g(n.prototype,r),t&&g(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){w(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&&W.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(j.isFiniteNumber)(this.programDateTime))return null;var y=Object(j.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){w(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(ne,B,A){"use strict";A.r(B),A.d(B,"default",function(){return W});var j=A("./src/events.ts"),P=A("./src/errors.ts"),S=A("./src/utils/logger.ts"),W=function(){function N(w){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=w,this._registerListeners()}var e=N.prototype;return e._registerListeners=function(){this.hls.on(j.Events.KEY_LOADING,this.onKeyLoading,this)},e._unregisterListeners=function(){this.hls.off(j.Events.KEY_LOADING,this.onKeyLoading)},e.destroy=function(){this._unregisterListeners();for(var v in this.loaders){var g=this.loaders[v];g&&g.destroy()}this.loaders={}},e.onKeyLoading=function(v,g){var c=g.frag,s=c.type,i=this.loaders[s];if(!c.decryptdata){S.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&&(S.logger.warn("abort previous key loader for type:"+s),i.abort()),!l){S.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(j.Events.KEY_LOADED,{frag:c}))},e.loadsuccess=function(v,g,c){var s=c.frag;if(!s.decryptdata){S.logger.error("after key load, decryptdata unset");return}this.decryptkey=s.decryptdata.key=new Uint8Array(v.data),s.loader=null,delete this.loaders[s.type],this.hls.trigger(j.Events.KEY_LOADED,{frag:s})},e.loaderror=function(v,g){var c=g.frag,s=c.loader;s&&s.abort(),delete this.loaders[c.type],this.hls.trigger(j.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:c,response:v})},e.loadtimeout=function(v,g){var c=g.frag,s=c.loader;s&&s.abort(),delete this.loaders[c.type],this.hls.trigger(j.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:c})},N}()},"./src/loader/level-details.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"LevelDetails",function(){return N});var j=A("./src/polyfills/number.ts");function P(e,w){for(var v=0;v<w.length;v++){var g=w[v];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(e,g.key,g)}}function S(e,w,v){return w&&P(e.prototype,w),v&&P(e,v),e}var W=10,N=function(){function e(v){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=v}var w=e.prototype;return w.reloaded=function(g){if(!g){this.advanced=!0,this.updated=!0;return}var c=this.lastPartSn-g.lastPartSn,s=this.lastPartIndex-g.lastPartIndex;this.updated=this.endSN!==g.endSN||!!s||!!c,this.advanced=this.endSN>g.endSN||c>0||c===0&&s>0,this.updated||this.advanced?this.misses=Math.floor(g.misses*.6):this.misses=g.misses+1,this.availabilityDelay=g.availabilityDelay},S(e,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(j.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||W}},{key:"drift",get:function(){var g=this.driftEndTime-this.driftStartTime;if(g>0){var c=this.driftEnd-this.driftStart;return c*1e3/g}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var g;return(g=this.fragments)!==null&&g!==void 0&&g.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 g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),e}()},"./src/loader/level-key.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"LevelKey",function(){return N});var j=A("./node_modules/url-toolkit/src/url-toolkit.js"),P=A.n(j);function S(e,w){for(var v=0;v<w.length;v++){var g=w[v];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(e,g.key,g)}}function W(e,w,v){return w&&S(e.prototype,w),v&&S(e,v),e}var N=function(){e.fromURL=function(v,g){return new e(v,g)},e.fromURI=function(v){return new e(v)};function e(w,v){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,v?this._uri=Object(j.buildAbsoluteURL)(w,v,{alwaysNormalize:!0}):this._uri=w}return W(e,[{key:"uri",get:function(){return this._uri}}]),e}()},"./src/loader/load-stats.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"LoadStats",function(){return j});var j=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(ne,B,A){"use strict";A.r(B),A.d(B,"default",function(){return r});var j=A("./src/polyfills/number.ts"),P=A("./node_modules/url-toolkit/src/url-toolkit.js"),S=A.n(P),W=A("./src/loader/fragment.ts"),N=A("./src/loader/level-details.ts"),e=A("./src/loader/level-key.ts"),w=A("./src/utils/attr-list.ts"),v=A("./src/utils/logger.ts"),g=A("./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 w.AttrList(p[1]),O={attrs:d,bitrate:d.decimalInteger("AVERAGE-BANDWIDTH")||d.decimalInteger("BANDWIDTH"),name:d.NAME,url:T.resolve(p[2],h)},L=d.decimalResolution("RESOLUTION");L&&(O.width=L.width,O.height=L.height),t((d.CODECS||"").split(/[ ,]+/).filter(function(I){return I}),O),O.videoCodec&&O.videoCodec.indexOf("avc1")!==-1&&(O.videoCodec=T.convertAVC1ToAVCOTI(O.videoCodec)),o.push(O)}else if(p[3]){var x=new w.AttrList(p[3]);x["DATA-ID"]&&(b=!0,u[x["DATA-ID"]]=x)}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 O=new w.AttrList(b[1]);if(O.TYPE===o){var L={attrs:O,bitrate:0,id:d++,groupId:O["GROUP-ID"],instreamId:O["INSTREAM-ID"],name:O.NAME||O.LANGUAGE||"",type:o,default:O.bool("DEFAULT"),autoselect:O.bool("AUTOSELECT"),forced:O.bool("FORCED"),lang:O.LANGUAGE,url:O.URI?T.resolve(O.URI,h):""};if(u.length){var x=T.findGroup(u,L.groupId)||u[0];E(L,x,"audioCodec"),E(L,x,"textCodec")}p.push(L)}}return p},T.parseLevelPlaylist=function(f,h,o,u,b){var p=new N.LevelDetails(h),d=p.fragments,O=null,L=0,x=0,I=0,k=0,C=null,F=new W.Fragment(u,h),V,ee,ie,pe=-1,ve=!1;for(i.lastIndex=0,p.m3u8=f;(V=i.exec(f))!==null;){ve&&(ve=!1,F=new W.Fragment(u,h),F.start=I,F.sn=L,F.cc=k,F.level=o,O&&(F.initSegment=O,F.rawProgramDateTime=O.rawProgramDateTime));var ye=V[1];if(ye){F.duration=parseFloat(ye);var Ee=(" "+V[2]).slice(1);F.title=Ee||null,F.tagList.push(Ee?["INF",ye,Ee]:["INF",ye])}else if(V[3])Object(j.isFiniteNumber)(F.duration)&&(F.start=I,ie&&(F.levelkey=ie),F.sn=L,F.level=o,F.cc=k,F.urlId=b,d.push(F),F.relurl=(" "+V[3]).slice(1),m(F,C),C=F,I+=F.duration,L++,x=0,ve=!0);else if(V[4]){var Se=(" "+V[4]).slice(1);C?F.setByteRange(Se,C):F.setByteRange(Se)}else if(V[5])F.rawProgramDateTime=(" "+V[5]).slice(1),F.tagList.push(["PROGRAM-DATE-TIME",F.rawProgramDateTime]),pe===-1&&(pe=d.length);else{if(V=V[0].match(l),!V){v.logger.warn("No matches on slow regex match for level playlist!");continue}for(ee=1;ee<V.length&&!(typeof V[ee]!="undefined");ee++);var fe=(" "+V[ee]).slice(1),K=(" "+V[ee+1]).slice(1),R=V[ee+2]?(" "+V[ee+2]).slice(1):"";switch(fe){case"PLAYLIST-TYPE":p.type=K.toUpperCase();break;case"MEDIA-SEQUENCE":L=p.startSN=parseInt(K);break;case"SKIP":{var D=new w.AttrList(K),H=D.decimalInteger("SKIPPED-SEGMENTS");if(Object(j.isFiniteNumber)(H)){p.skippedSegments=H;for(var J=H;J--;)d.unshift(null);L+=H}var M=D.enumeratedString("RECENTLY-REMOVED-DATERANGES");M&&(p.recentlyRemovedDateranges=M.split(" "));break}case"TARGETDURATION":p.targetduration=parseFloat(K);break;case"VERSION":p.version=parseInt(K);break;case"EXTM3U":break;case"ENDLIST":p.live=!1;break;case"#":(K||R)&&F.tagList.push(R?[K,R]:[K]);break;case"DIS":k++;case"GAP":F.tagList.push([fe]);break;case"BITRATE":F.tagList.push([fe,K]);break;case"DISCONTINUITY-SEQ":k=parseInt(K);break;case"KEY":{var ae,me=new w.AttrList(K),_e=me.enumeratedString("METHOD"),q=me.URI,oe=me.hexadecimalInteger("IV"),ue=me.enumeratedString("KEYFORMATVERSIONS"),ce=me.enumeratedString("KEYID"),be=(ae=me.enumeratedString("KEYFORMAT"))!=null?ae:"identity",Ce=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Ce.indexOf(be)>-1){v.logger.warn("Keyformat "+be+" is not supported from the manifest");continue}else if(be!=="identity")continue;_e&&(ie=e.LevelKey.fromURL(h,q),q&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(_e)>=0&&(ie.method=_e,ie.keyFormat=be,ce&&(ie.keyID=ce),ue&&(ie.keyFormatVersions=ue),ie.iv=oe));break}case"START":{var Oe=new w.AttrList(K),Ie=Oe.decimalFloatingPoint("TIME-OFFSET");Object(j.isFiniteNumber)(Ie)&&(p.startTimeOffset=Ie);break}case"MAP":{var De=new w.AttrList(K);F.relurl=De.URI,De.BYTERANGE&&F.setByteRange(De.BYTERANGE),F.level=o,F.sn="initSegment",ie&&(F.levelkey=ie),F.initSegment=null,O=F,ve=!0;break}case"SERVER-CONTROL":{var Me=new w.AttrList(K);p.canBlockReload=Me.bool("CAN-BLOCK-RELOAD"),p.canSkipUntil=Me.optionalFloat("CAN-SKIP-UNTIL",0),p.canSkipDateRanges=p.canSkipUntil>0&&Me.bool("CAN-SKIP-DATERANGES"),p.partHoldBack=Me.optionalFloat("PART-HOLD-BACK",0),p.holdBack=Me.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var de=new w.AttrList(K);p.partTarget=de.decimalFloatingPoint("PART-TARGET");break}case"PART":{var ge=p.partList;ge||(ge=p.partList=[]);var xe=x>0?ge[ge.length-1]:void 0,we=x++,Z=new W.Part(new w.AttrList(K),F,h,we,xe);ge.push(Z),F.duration+=Z.duration;break}case"PRELOAD-HINT":{var z=new w.AttrList(K);p.preloadHint=z;break}case"RENDITION-REPORT":{var G=new w.AttrList(K);p.renditionReports=p.renditionReports||[],p.renditionReports.push(G);break}default:v.logger.warn("line parsed but not handled: "+V);break}}}C&&!C.relurl?(d.pop(),I-=C.duration,p.partList&&(p.fragmentHint=C)):p.partList&&(m(F,C),F.cc=k,p.fragmentHint=F);var X=d.length,Q=d[0],Y=d[X-1];if(I+=p.skippedSegments*p.targetduration,I>0&&X&&Y){p.averagetargetduration=I/X;var $=Y.sn;p.endSN=$!=="initSegment"?$:0,Q&&(p.startCC=Q.cc,Q.initSegment||p.fragments.every(function(te){return te.relurl&&n(te.relurl)})&&(v.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),F=new W.Fragment(u,h),F.relurl=Y.relurl,F.level=o,F.sn="initSegment",Q.initSegment=F,p.needSidxRanges=!0))}else p.endSN=0,p.startCC=0;return p.fragmentHint&&(I+=p.fragmentHint.duration),p.totalduration=I,p.endCC=k,pe>0&&y(d,pe),p},T}();function t(T,_){["video","audio","text"].forEach(function(f){var h=T.filter(function(u){return Object(g.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(j.isFiniteNumber)(T.programDateTime)||(T.programDateTime=null,T.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ne,B,A){"use strict";A.r(B);var j=A("./src/polyfills/number.ts"),P=A("./src/events.ts"),S=A("./src/errors.ts"),W=A("./src/utils/logger.ts"),N=A("./src/utils/mp4-tools.ts"),e=A("./src/loader/m3u8-parser.ts"),w=A("./src/types/loader.ts"),v=A("./src/utils/attr-list.ts");function g(i){var l=i.type;switch(l){case w.PlaylistContextType.AUDIO_TRACK:return w.PlaylistLevelType.AUDIO;case w.PlaylistContextType.SUBTITLE_TRACK:return w.PlaylistLevelType.SUBTITLE;default:return w.PlaylistLevelType.MAIN}}function c(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:w.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:w.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:w.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:w.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){W.logger.trace("[playlist-loader]: playlist request ongoing");return}W.logger.log("[playlist-loader]: aborting previous loader for type: "+n.type),E.abort()}var m,T,_,f;switch(n.type){case w.PlaylistContextType.MANIFEST:m=t.manifestLoadingMaxRetry,T=t.manifestLoadingTimeOut,_=t.manifestLoadingRetryDelay,f=t.manifestLoadingMaxRetryTimeout;break;case w.PlaylistContextType.LEVEL:case w.PlaylistContextType.AUDIO_TRACK:case w.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===w.PlaylistContextType.LEVEL&&n.level!==null?h=this.hls.levels[n.level].details:n.type===w.PlaylistContextType.AUDIO_TRACK&&n.id!==null?h=this.hls.audioTracks[n.id].details:n.type===w.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(L){return{id:L.attrs.AUDIO,audioCodec:L.audioCodec}}),u=f.map(function(L){return{id:L.attrs.SUBTITLES,textCodec:L.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 O=b.some(function(L){return!L.url});!O&&f[0].audioCodec&&!f[0].attrs.AUDIO&&(W.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 v.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(j.isFiniteNumber)(m)?m:0,o=Object(j.isFiniteNumber)(T)?T:h,u=g(t),b=e.default.parseLevelPlaylist(n.data,f,o,u,h);if(!b.fragments.length){y.trigger(P.Events.ERROR,{type:S.ErrorTypes.NETWORK_ERROR,details:S.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(_===w.PlaylistContextType.MANIFEST){var p={attrs:new v.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,O=(d=b.fragments[0].initSegment)===null||d===void 0?void 0:d.url;this.load({url:O,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:S.ErrorTypes.NETWORK_ERROR,details:S.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:r.type===w.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),W.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=S.ErrorDetails.UNKNOWN,m=!1,T=this.getInternalLoader(n);switch(n.type){case w.PlaylistContextType.MANIFEST:y=t?S.ErrorDetails.MANIFEST_LOAD_TIMEOUT:S.ErrorDetails.MANIFEST_LOAD_ERROR,m=!0;break;case w.PlaylistContextType.LEVEL:y=t?S.ErrorDetails.LEVEL_LOAD_TIMEOUT:S.ErrorDetails.LEVEL_LOAD_ERROR,m=!1;break;case w.PlaylistContextType.AUDIO_TRACK:y=t?S.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:S.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,m=!1;break;case w.PlaylistContextType.SUBTITLE_TRACK:y=t?S.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:S.ErrorDetails.SUBTITLE_LOAD_ERROR,m=!1;break}T&&this.resetInternalLoader(n.type);var _={type:S.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 w.PlaylistContextType.MANIFEST:case w.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 w.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 w.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}();B.default=s},"./src/polyfills/number.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"isFiniteNumber",function(){return j}),A.d(B,"MAX_SAFE_INTEGER",function(){return P});var j=Number.isFinite||function(S){return typeof S=="number"&&isFinite(S)},P=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ne,B,A){"use strict";A.r(B);var j=function(){function P(){}return P.getSilentFrame=function(W,N){switch(W){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}();B.default=j},"./src/remux/mp4-generator.ts":function(ne,B,A){"use strict";A.r(B);var j=Math.pow(2,32)-1,P=function(){function S(){}return S.init=function(){S.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var N;for(N in S.types)S.types.hasOwnProperty(N)&&(S.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]),w=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);S.HDLR_TYPES={video:e,audio:w};var v=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),g=new Uint8Array([0,0,0,0,0,0,0,0]);S.STTS=S.STSC=S.STCO=g,S.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),S.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),S.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),S.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var c=new Uint8Array([105,115,111,109]),s=new Uint8Array([97,118,99,49]),i=new Uint8Array([0,0,0,1]);S.FTYP=S.box(S.types.ftyp,c,i,c,s),S.DINF=S.box(S.types.dinf,S.box(S.types.dref,v))},S.box=function(N){for(var e=8,w=arguments.length,v=new Array(w>1?w-1:0),g=1;g<w;g++)v[g-1]=arguments[g];for(var c=v.length,s=c;c--;)e+=v[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(v[c],e),e+=v[c].byteLength;return i},S.hdlr=function(N){return S.box(S.types.hdlr,S.HDLR_TYPES[N])},S.mdat=function(N){return S.box(S.types.mdat,N)},S.mdhd=function(N,e){e*=N;var w=Math.floor(e/(j+1)),v=Math.floor(e%(j+1));return S.box(S.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,N>>24&255,N>>16&255,N>>8&255,N&255,w>>24,w>>16&255,w>>8&255,w&255,v>>24,v>>16&255,v>>8&255,v&255,85,196,0,0]))},S.mdia=function(N){return S.box(S.types.mdia,S.mdhd(N.timescale,N.duration),S.hdlr(N.type),S.minf(N))},S.mfhd=function(N){return S.box(S.types.mfhd,new Uint8Array([0,0,0,0,N>>24,N>>16&255,N>>8&255,N&255]))},S.minf=function(N){return N.type==="audio"?S.box(S.types.minf,S.box(S.types.smhd,S.SMHD),S.DINF,S.stbl(N)):S.box(S.types.minf,S.box(S.types.vmhd,S.VMHD),S.DINF,S.stbl(N))},S.moof=function(N,e,w){return S.box(S.types.moof,S.mfhd(N),S.traf(w,e))},S.moov=function(N){for(var e=N.length,w=[];e--;)w[e]=S.trak(N[e]);return S.box.apply(null,[S.types.moov,S.mvhd(N[0].timescale,N[0].duration)].concat(w).concat(S.mvex(N)))},S.mvex=function(N){for(var e=N.length,w=[];e--;)w[e]=S.trex(N[e]);return S.box.apply(null,[S.types.mvex].concat(w))},S.mvhd=function(N,e){e*=N;var w=Math.floor(e/(j+1)),v=Math.floor(e%(j+1)),g=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,w>>24,w>>16&255,w>>8&255,w&255,v>>24,v>>16&255,v>>8&255,v&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return S.box(S.types.mvhd,g)},S.sdtp=function(N){var e=N.samples||[],w=new Uint8Array(4+e.length),v,g;for(v=0;v<e.length;v++)g=e[v].flags,w[v+4]=g.dependsOn<<4|g.isDependedOn<<2|g.hasRedundancy;return S.box(S.types.sdtp,w)},S.stbl=function(N){return S.box(S.types.stbl,S.stsd(N),S.box(S.types.stts,S.STTS),S.box(S.types.stsc,S.STSC),S.box(S.types.stsz,S.STSZ),S.box(S.types.stco,S.STCO))},S.avc1=function(N){var e=[],w=[],v,g,c;for(v=0;v<N.sps.length;v++)g=N.sps[v],c=g.byteLength,e.push(c>>>8&255),e.push(c&255),e=e.concat(Array.prototype.slice.call(g));for(v=0;v<N.pps.length;v++)g=N.pps[v],c=g.byteLength,w.push(c>>>8&255),w.push(c&255),w=w.concat(Array.prototype.slice.call(g));var s=S.box(S.types.avcC,new Uint8Array([1,e[3],e[4],e[5],252|3,224|N.sps.length].concat(e).concat([N.pps.length]).concat(w))),i=N.width,l=N.height,a=N.pixelRatio[0],n=N.pixelRatio[1];return S.box(S.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,S.box(S.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),S.box(S.types.pasp,new Uint8Array([a>>24,a>>16&255,a>>8&255,a&255,n>>24,n>>16&255,n>>8&255,n&255])))},S.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]))},S.mp4a=function(N){var e=N.samplerate;return S.box(S.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,N.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]),S.box(S.types.esds,S.esds(N)))},S.mp3=function(N){var e=N.samplerate;return S.box(S.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,N.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]))},S.stsd=function(N){return N.type==="audio"?!N.isAAC&&N.codec==="mp3"?S.box(S.types.stsd,S.STSD,S.mp3(N)):S.box(S.types.stsd,S.STSD,S.mp4a(N)):S.box(S.types.stsd,S.STSD,S.avc1(N))},S.tkhd=function(N){var e=N.id,w=N.duration*N.timescale,v=N.width,g=N.height,c=Math.floor(w/(j+1)),s=Math.floor(w%(j+1));return S.box(S.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,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,v>>8&255,v&255,0,0,g>>8&255,g&255,0,0]))},S.traf=function(N,e){var w=S.sdtp(N),v=N.id,g=Math.floor(e/(j+1)),c=Math.floor(e%(j+1));return S.box(S.types.traf,S.box(S.types.tfhd,new Uint8Array([0,0,0,0,v>>24,v>>16&255,v>>8&255,v&255])),S.box(S.types.tfdt,new Uint8Array([1,0,0,0,g>>24,g>>16&255,g>>8&255,g&255,c>>24,c>>16&255,c>>8&255,c&255])),S.trun(N,w.length+16+20+8+16+8+8),w)},S.trak=function(N){return N.duration=N.duration||4294967295,S.box(S.types.trak,S.tkhd(N),S.mdia(N))},S.trex=function(N){var e=N.id;return S.box(S.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]))},S.trun=function(N,e){var w=N.samples||[],v=w.length,g=12+16*v,c=new Uint8Array(g),s,i,l,a,n,r;for(e+=8+g,c.set([0,0,15,1,v>>>24&255,v>>>16&255,v>>>8&255,v&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255],0),s=0;s<v;s++)i=w[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 S.box(S.types.trun,c)},S.initSegment=function(N){S.types||S.init();var e=S.moov(N),w=new Uint8Array(S.FTYP.byteLength+e.byteLength);return w.set(S.FTYP),w.set(e,S.FTYP.byteLength),w},S}();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,B.default=P},"./src/remux/mp4-remuxer.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"default",function(){return r}),A.d(B,"normalizePts",function(){return t});var j=A("./src/polyfills/number.ts"),P=A("./src/remux/aac-helper.ts"),S=A("./src/remux/mp4-generator.ts"),W=A("./src/events.ts"),N=A("./src/errors.ts"),e=A("./src/utils/logger.ts"),w=A("./src/types/loader.ts"),v=A("./src/utils/timescale-conversion.ts");function g(){return g=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},g.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,O,L){var x,I,k,C,F,V,ee=p,ie=p,pe=h.pid>-1,ve=o.pid>-1,ye=o.samples.length,Ee=h.samples.length>0,Se=ye>1,fe=(!pe||Ee)&&(!ve||Se)||this.ISGenerated||O;if(fe){this.ISGenerated||(k=this.generateIS(h,o,p));var K=this.isVideoContiguous,R=-1;if(Se&&(R=E(o.samples),!K&&this.config.forceKeyFrameOnDiscontinuity))if(V=!0,R>0){e.logger.warn("[mp4-remuxer]: Dropped "+R+" out of "+ye+" video samples due to a missing keyframe");var D=this.getVideoStartPts(o.samples);o.samples=o.samples.slice(R),o.dropped+=R,ie+=(o.samples[0].pts-D)/(o.timescale||9e4)}else R===-1&&(e.logger.warn("[mp4-remuxer]: No keyframe found out of "+ye+" video samples"),V=!1);if(this.ISGenerated){if(Ee&&Se){var H=this.getVideoStartPts(o.samples),J=t(h.samples[0].pts,H)-H,M=J/o.inputTimeScale;ee+=Math.max(0,M),ie+=Math.max(0,-M)}if(Ee){if(h.samplerate||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),k=this.generateIS(h,o,p)),I=this.remuxAudio(h,ee,this.isAudioContiguous,d,ve||Se||L===w.PlaylistLevelType.AUDIO?ie:void 0),Se){var ae=I?I.endPTS-I.startPTS:0;o.inputTimeScale||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),k=this.generateIS(h,o,p)),x=this.remuxVideo(o,ie,K,ae)}}else Se&&(x=this.remuxVideo(o,ie,K,0));x&&(x.firstKeyFrame=R,x.independent=R!==-1)}}return this.ISGenerated&&(u.samples.length&&(F=this.remuxID3(u,p)),b.samples.length&&(C=this.remuxText(b,p))),{audio:I,video:x,initSegment:k,independent:V,text:C,id3:F}},_.generateIS=function(h,o,u){var b=h.samples,p=o.samples,d=this.typeSupported,O={},L=!Object(j.isFiniteNumber)(this._initPTS),x="audio/mp4",I,k,C;if(L&&(I=k=Infinity),h.config&&b.length&&(h.timescale=h.samplerate,h.isAAC||(d.mpeg?(x="audio/mpeg",h.codec=""):d.mp3&&(h.codec="mp3")),O.audio={id:"audio",container:x,codec:h.codec,initSegment:!h.isAAC&&d.mpeg?new Uint8Array(0):S.default.initSegment([h]),metadata:{channelCount:h.channelCount}},L&&(C=h.inputTimeScale,I=k=b[0].pts-Math.round(C*u))),o.sps&&o.pps&&p.length&&(o.timescale=o.inputTimeScale,O.video={id:"main",container:"video/mp4",codec:o.codec,initSegment:S.default.initSegment([o]),metadata:{width:o.width,height:o.height}},L)){C=o.inputTimeScale;var F=this.getVideoStartPts(p),V=Math.round(C*u);k=Math.min(k,t(p[0].dts,F)-V),I=Math.min(I,F-V)}if(Object.keys(O).length)return this.ISGenerated=!0,L&&(this._initPTS=I,this._initDTS=k),{tracks:O,initPTS:I,timescale:C}},_.remuxVideo=function(h,o,u,b){var p=h.inputTimeScale,d=h.samples,O=[],L=d.length,x=this._initPTS,I=this.nextAvcDts,k=8,C,F,V,ee=Number.POSITIVE_INFINITY,ie=Number.NEGATIVE_INFINITY,pe=0,ve=!1;if(!u||I===null){var ye=o*p,Ee=d[0].pts-t(d[0].dts,d[0].pts);I=ye-Ee}for(var Se=0;Se<L;Se++){var fe=d[Se];if(fe.pts=t(fe.pts-x,I),fe.dts=t(fe.dts-x,I),fe.dts>fe.pts){var K=9e4*.2;pe=Math.max(Math.min(pe,fe.pts-fe.dts),-1*K)}fe.dts<d[Se>0?Se-1:Se].dts&&(ve=!0)}ve&&d.sort(function(Ge,Ne){var ke=Ge.dts-Ne.dts,$e=Ge.pts-Ne.pts;return ke||$e}),F=d[0].dts,V=d[d.length-1].dts;var R=Math.round((V-F)/(L-1));if(pe<0){if(pe<R*-2){e.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(v.toMsFromMpegTsClock)(-R,!0)+" ms");for(var D=pe,H=0;H<L;H++)d[H].dts=D=Math.max(D,d[H].pts-R),d[H].pts=Math.max(D,d[H].pts)}else{e.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(v.toMsFromMpegTsClock)(pe,!0)+" ms to overcome this issue");for(var J=0;J<L;J++)d[J].dts=d[J].dts+pe}F=d[0].dts}if(u){var M=F-I,ae=M>R,me=M<-1;if(ae||me){ae?e.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(M,!0)+" ms ("+M+"dts) hole between fragments detected, filling it"):e.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(-M,!0)+" ms ("+M+"dts) overlapping between fragments detected"),F=I;var _e=d[0].pts-M;d[0].dts=F,d[0].pts=_e,e.logger.log("Video: First PTS/DTS adjusted: "+Object(v.toMsFromMpegTsClock)(_e,!0)+"/"+Object(v.toMsFromMpegTsClock)(F,!0)+", delta: "+Object(v.toMsFromMpegTsClock)(M,!0)+" ms")}}n&&(F=Math.max(0,F));for(var q=0,oe=0,ue=0;ue<L;ue++){for(var ce=d[ue],be=ce.units,Ce=be.length,Oe=0,Ie=0;Ie<Ce;Ie++)Oe+=be[Ie].data.length;oe+=Oe,q+=Ce,ce.length=Oe,ce.dts=Math.max(ce.dts,F),ce.pts=Math.max(ce.pts,ce.dts,0),ee=Math.min(ce.pts,ee),ie=Math.max(ce.pts,ie)}V=d[L-1].dts;var De=oe+4*q+8,Me;try{Me=new Uint8Array(De)}catch(Ge){this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:N.ErrorTypes.MUX_ERROR,details:N.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:De,reason:"fail allocating video mdat "+De});return}var de=new DataView(Me.buffer);de.setUint32(0,De),Me.set(S.default.types.mdat,4);for(var ge=0;ge<L;ge++){for(var xe=d[ge],we=xe.units,Z=0,z=0,G=we.length;z<G;z++){var X=we[z],Q=X.data,Y=X.data.byteLength;de.setUint32(k,Y),k+=4,Me.set(Q,k),k+=Y,Z+=4+Y}if(ge<L-1)C=d[ge+1].dts-xe.dts;else{var $=this.config,te=xe.dts-d[ge>0?ge-1:ge].dts;if($.stretchShortVideoTrack&&this.nextAudioPts!==null){var re=Math.floor($.maxBufferHole*p),le=(b?ee+b*p:this.nextAudioPts)-xe.pts;le>re?(C=le-te,C<0&&(C=te),e.logger.log("[mp4-remuxer]: It is approximately "+le/90+" ms to the next segment; using duration "+C/90+" ms for the last video frame.")):C=te}else C=te}var he=Math.round(xe.pts-xe.dts);O.push(new y(xe.key,C,Z,he))}if(O.length&&l&&l<70){var Te=O[0].flags;Te.dependsOn=2,Te.isNonSync=0}console.assert(C!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=I=V+C,this.isVideoContiguous=!0;var Re=S.default.moof(h.sequenceNumber++,F,g({},h,{samples:O})),Pe="video",Ae={data1:Re,data2:Me,startPTS:ee/p,endPTS:(ie+C)/p,startDTS:F/p,endDTS:I/p,type:Pe,hasAudio:!1,hasVideo:!0,nb:O.length,dropped:h.dropped};return h.samples=[],h.dropped=0,console.assert(Me.length,"MDAT length must not be zero"),Ae},_.remuxAudio=function(h,o,u,b,p){var d=h.inputTimeScale,O=h.samplerate?h.samplerate:d,L=d/O,x=h.isAAC?s:i,I=x*L,k=this._initPTS,C=!h.isAAC&&this.typeSupported.mpeg,F=[],V=h.samples,ee=C?0:8,ie=this.nextAudioPts||-1,pe=o*d;if(this.isAudioContiguous=u=u||V.length&&ie>0&&(b&&Math.abs(pe-ie)<9e3||Math.abs(t(V[0].pts-k,pe)-ie)<20*I),V.forEach(function(Q){Q.pts=t(Q.pts-k,pe)}),!u||ie<0){if(V=V.filter(function(Q){return Q.pts>=0}),!V.length)return;p===0?ie=0:b?ie=Math.max(0,pe):ie=V[0].pts}if(h.isAAC)for(var ve=p!==void 0,ye=this.config.maxAudioFramesDrift,Ee=0,Se=ie;Ee<V.length;Ee++){var fe=V[Ee],K=fe.pts,R=K-Se,D=Math.abs(1e3*R/d);if(R<=-ye*I&&ve)Ee===0&&(e.logger.warn("Audio frame @ "+(K/d).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*R/d)+" ms."),this.nextAudioPts=ie=Se=K);else if(R>=ye*I&&D<c&&ve){var H=Math.round(R/I);Se=K-H*I,Se<0&&(H--,Se+=I),Ee===0&&(this.nextAudioPts=ie=Se),e.logger.warn("[mp4-remuxer]: Injecting "+H+" audio frame @ "+(Se/d).toFixed(3)+"s due to "+Math.round(1e3*R/d)+" ms gap.");for(var J=0;J<H;J++){var M=Math.max(Se,0),ae=P.default.getSilentFrame(h.manifestCodec||h.codec,h.channelCount);ae||(e.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ae=fe.unit.subarray()),V.splice(Ee,0,{unit:ae,pts:M}),Se+=I,Ee++}}fe.pts=Se,Se+=I}for(var me=null,_e=null,q,oe=0,ue=V.length;ue--;)oe+=V[ue].unit.byteLength;for(var ce=0,be=V.length;ce<be;ce++){var Ce=V[ce],Oe=Ce.unit,Ie=Ce.pts;if(_e!==null){var De=F[ce-1];De.duration=Math.round((Ie-_e)/L)}else if(u&&h.isAAC&&(Ie=ie),me=Ie,oe>0){oe+=ee;try{q=new Uint8Array(oe)}catch(Q){this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:N.ErrorTypes.MUX_ERROR,details:N.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:oe,reason:"fail allocating audio mdat "+oe});return}if(!C){var Me=new DataView(q.buffer);Me.setUint32(0,oe),q.set(S.default.types.mdat,4)}}else return;q.set(Oe,ee);var de=Oe.byteLength;ee+=de,F.push(new y(!0,x,de,0)),_e=Ie}var ge=F.length;if(!ge)return;var xe=F[F.length-1];this.nextAudioPts=ie=_e+L*xe.duration;var we=C?new Uint8Array(0):S.default.moof(h.sequenceNumber++,me/L,g({},h,{samples:F}));h.samples=[];var Z=me/d,z=ie/d,G="audio",X={data1:we,data2:q,startPTS:Z,endPTS:z,startDTS:Z,endDTS:z,type:G,hasAudio:!0,hasVideo:!1,nb:ge};return this.isAudioContiguous=!0,console.assert(q.length,"MDAT length must not be zero"),X},_.remuxEmptyAudio=function(h,o,u,b){var p=h.inputTimeScale,d=h.samplerate?h.samplerate:p,O=p/d,L=this.nextAudioPts,x=(L!==null?L:b.startDTS*p)+this._initDTS,I=b.endDTS*p+this._initDTS,k=O*s,C=Math.ceil((I-x)/k),F=P.default.getSilentFrame(h.manifestCodec||h.codec,h.channelCount);if(e.logger.warn("[mp4-remuxer]: remux empty Audio"),!F){e.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var V=[],ee=0;ee<C;ee++){var ie=x+ee*k;V.push({unit:F,pts:ie,dts:ie})}return h.samples=V,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,O=0;O<u;O++){var L=h.samples[O];L.pts=t(L.pts-p,o*b)/b,L.dts=t(L.dts-d,o*b)/b}var x=h.samples;return h.samples=[],{samples:x}},_.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 O=h.samples[d];O.pts=t(O.pts-p,o*b)/b}h.samples.sort(function(x,I){return x.pts-I.pts});var L=h.samples;return h.samples=[],{samples:L}},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(ne,B,A){"use strict";A.r(B);var j=A("./src/polyfills/number.ts"),P=A("./src/utils/mp4-tools.ts"),S=A("./src/loader/fragment.ts"),W=A("./src/utils/logger.ts"),N=function(){function v(){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 g=v.prototype;return g.destroy=function(){},g.resetTimeStamp=function(s){this.initPTS=s,this.lastEndDTS=null},g.resetNextTimestamp=function(){this.lastEndDTS=null},g.resetInitSegment=function(s,i,l){this.audioCodec=i,this.videoCodec=l,this.generateInitSegment(s),this.emitInitSegment=!0},g.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=w(a.audio,S.ElementaryStreamTypes.AUDIO)),l||(l=w(a.video,S.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"}:W.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=n},g.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(j.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 W.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),E;this.emitInitSegment&&(m.tracks=this.initTracks,this.emitInitSegment=!1),Object(j.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:(W.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},v}(),e=function(g,c,s){return Object(P.getStartDTS)(g,c)-s};function w(v,g){var c=v==null?void 0:v.codec;return c&&c.length>4?c:c==="hvc1"?"hvc1.1.c.L120.90":c==="av01"?"av01.0.04M.08":c==="avc1"||g===S.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}B.default=N},"./src/task-loop.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"default",function(){return j});var j=function(){function P(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var S=P.prototype;return S.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},S.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},S.onHandlerDestroyed=function(){},S.hasInterval=function(){return!!this._tickInterval},S.hasNextTick=function(){return!!this._tickTimer},S.setInterval=function(N){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,N),!0)},S.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},S.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},S.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},S.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},S.doTick=function(){},P}()},"./src/types/cmcd.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"CMCDVersion",function(){return j}),A.d(B,"CMCDObjectType",function(){return P}),A.d(B,"CMCDStreamingFormat",function(){return S}),A.d(B,"CMCDStreamType",function(){return W});var j=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 S;(function(N){N.DASH="d",N.HLS="h",N.SMOOTH="s",N.OTHER="o"})(S||(S={}));var W;(function(N){N.VOD="v",N.LIVE="l"})(W||(W={}))},"./src/types/level.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"HlsSkip",function(){return S}),A.d(B,"getSkipValue",function(){return W}),A.d(B,"HlsUrlParameters",function(){return N}),A.d(B,"Level",function(){return e});function j(w,v){for(var g=0;g<v.length;g++){var c=v[g];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(w,c.key,c)}}function P(w,v,g){return v&&j(w.prototype,v),g&&j(w,g),w}var S;(function(w){w.No="",w.Yes="YES",w.v2="v2"})(S||(S={}));function W(w,v){var g=w.canSkipUntil,c=w.canSkipDateRanges,s=w.endSN,i=v!==void 0?v-s:0;return g&&i<g?c?S.v2:S.Yes:S.No}var N=function(){function w(g,c,s){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=g,this.part=c,this.skip=s}var v=w.prototype;return v.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()},w}(),e=function(){function w(v){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=[v.url],this.attrs=v.attrs,this.bitrate=v.bitrate,v.details&&(this.details=v.details),this.id=v.id||0,this.name=v.name,this.width=v.width||0,this.height=v.height||0,this.audioCodec=v.audioCodec,this.videoCodec=v.videoCodec,this.unknownCodecs=v.unknownCodecs,this.codecSet=[v.videoCodec,v.audioCodec].filter(function(g){return g}).join(",").replace(/\.[^.,]+/g,"")}return P(w,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(g){var c=g%this.url.length;this._urlId!==c&&(this.details=void 0,this._urlId=c)}}]),w}()},"./src/types/loader.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"PlaylistContextType",function(){return j}),A.d(B,"PlaylistLevelType",function(){return P});var j;(function(S){S.MANIFEST="manifest",S.LEVEL="level",S.AUDIO_TRACK="audioTrack",S.SUBTITLE_TRACK="subtitleTrack"})(j||(j={}));var P;(function(S){S.MAIN="main",S.AUDIO="audio",S.SUBTITLE="subtitle"})(P||(P={}))},"./src/types/transmuxer.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"ChunkMetadata",function(){return j});var j=function(W,N,e,w,v,g){w===void 0&&(w=0),v===void 0&&(v=-1),g===void 0&&(g=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=P(),this.buffering={audio:P(),video:P(),audiovideo:P()},this.level=W,this.sn=N,this.id=e,this.size=w,this.part=v,this.partial=g};function P(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"AttrList",function(){return S});var j=/^(\d+)x(\d+)$/,P=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,S=function(){function W(e){typeof e=="string"&&(e=W.parseAttrList(e));for(var w in e)e.hasOwnProperty(w)&&(this[w]=e[w])}var N=W.prototype;return N.decimalInteger=function(w){var v=parseInt(this[w],10);return v>Number.MAX_SAFE_INTEGER?Infinity:v},N.hexadecimalInteger=function(w){if(this[w]){var v=(this[w]||"0x").slice(2);v=(v.length&1?"0":"")+v;for(var g=new Uint8Array(v.length/2),c=0;c<v.length/2;c++)g[c]=parseInt(v.slice(c*2,c*2+2),16);return g}else return null},N.hexadecimalIntegerAsNumber=function(w){var v=parseInt(this[w],16);return v>Number.MAX_SAFE_INTEGER?Infinity:v},N.decimalFloatingPoint=function(w){return parseFloat(this[w])},N.optionalFloat=function(w,v){var g=this[w];return g?parseFloat(g):v},N.enumeratedString=function(w){return this[w]},N.bool=function(w){return this[w]==="YES"},N.decimalResolution=function(w){var v=j.exec(this[w]);return v===null?void 0:{width:parseInt(v[1],10),height:parseInt(v[2],10)}},W.parseAttrList=function(w){var v,g={},c='"';for(P.lastIndex=0;(v=P.exec(w))!==null;){var s=v[2];s.indexOf(c)===0&&s.lastIndexOf(c)===s.length-1&&(s=s.slice(1,-1)),g[v[1]]=s}return g},W}()},"./src/utils/binary-search.ts":function(ne,B,A){"use strict";A.r(B);var j={search:function(S,W){for(var N=0,e=S.length-1,w=null,v=null;N<=e;){w=(N+e)/2|0,v=S[w];var g=W(v);if(g>0)N=w+1;else if(g<0)e=w-1;else return v}return null}};B.default=j},"./src/utils/buffer-helper.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"BufferHelper",function(){return S});var j=A("./src/utils/logger.ts"),P={length:0,start:function(){return 0},end:function(){return 0}},S=function(){function W(){}return W.isBuffered=function(e,w){try{if(e){for(var v=W.getBuffered(e),g=0;g<v.length;g++)if(w>=v.start(g)&&w<=v.end(g))return!0}}catch(c){}return!1},W.bufferInfo=function(e,w,v){try{if(e){var g=W.getBuffered(e),c=[],s;for(s=0;s<g.length;s++)c.push({start:g.start(s),end:g.end(s)});return this.bufferedInfo(c,w,v)}}catch(i){}return{len:0,start:w,end:w,nextStart:void 0}},W.bufferedInfo=function(e,w,v){w=Math.max(0,w),e.sort(function(m,T){var _=m.start-T.start;return _||T.end-m.end});var g=[];if(v)for(var c=0;c<e.length;c++){var s=g.length;if(s){var i=g[s-1].end;e[c].start-i<v?e[c].end>i&&(g[s-1].end=e[c].end):g.push(e[c])}else g.push(e[c])}else g=e;for(var l=0,a,n=w,r=w,t=0;t<g.length;t++){var E=g[t].start,y=g[t].end;if(w+v>=E&&w<y)n=E,r=y,l=r-w;else if(w+v<E){a=E;break}}return{len:l,start:n||0,end:r||0,nextStart:a}},W.getBuffered=function(e){try{return e.buffered}catch(w){return j.logger.log("failed to get media.buffered",w),P}},W}()},"./src/utils/cea-608-parser.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"Row",function(){return r}),A.d(B,"CaptionScreen",function(){return t});var j=A("./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},S=function(h){var o=h;return P.hasOwnProperty(h)&&(o=P[h]),String.fromCharCode(o)},W=15,N=100,e={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},w={17:2,18:4,21:6,22:8,23:10,19:13,20:15},v={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},g={25:2,26:4,29:6,30:8,31:10,27:13,28:15},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&&j.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,O){this.uchar=void 0,this.penState=void 0,this.uchar=o||" ",this.penState=new a(u,b,p,d,O)}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=S(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<W;u++)this.rows.push(new r(o));this.logger=o,this.currRow=W-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var h=f.prototype;return h.reset=function(){for(var u=0;u<W;u++)this.rows[u].clear();this.currRow=W-1},h.equals=function(u){for(var b=!0,p=0;p<W;p++)if(!this.rows[p].equals(u.rows[p])){b=!1;break}return b},h.copy=function(u){for(var b=0;b<W;b++)this.rows[b].copy(u.rows[b])},h.isEmpty=function(){for(var u=!0,b=0;b<W;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<W;p++)this.rows[p].clear();var d=this.currRow+1-this.nrRollUpRows,O=this.lastOutputScreen;if(O){var L=O.rows[d].cueStartTime,x=this.logger.time;if(L&&x!==null&&L<x)for(var I=0;I<this.nrRollUpRows;I++)this.rows[b-this.nrRollUpRows+I+1].copy(O.rows[d+I])}}this.currRow=b;var k=this.rows[this.currRow];if(u.indent!==null){var C=u.indent,F=Math.max(C-1,0);k.setCursor(u.indent),u.color=k.chars[F].penState.foreground}var V={foreground:u.color,underline:u.underline,italics:u.italics,background:"black",flash:!1};this.setPen(V)},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,O=0;O<W;O++){var L=this.rows[O].getTextString();L&&(d=O+1,u?b.push("Row "+d+": '"+L+"'"):b.push(L.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[W-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[W-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,O,L=!1;this.logger.time=u;for(var x=0;x<b.length;x+=2){if(d=b[x]&127,O=b[x+1]&127,d===0&&O===0)continue;if(this.logger.log(s.DATA,"["+l([b[x],b[x+1]])+"] -> ("+l([d,O])+")"),p=this.parseCmd(d,O),p||(p=this.parseMidrow(d,O)),p||(p=this.parsePAC(d,O)),p||(p=this.parseBackgroundAttributes(d,O)),!p&&(L=this.parseChars(d,O),L)){var I=this.currentChannel;if(I&&I>0){var k=this.channels[I];k.insertChars(L)}else this.logger.log(s.WARNING,"No channel found yet. TEXT-MODE?")}!p&&!L&&this.logger.log(s.WARNING,"Couldn't parse cleaned data "+l([d,O])+" orig: "+l([b[x],b[x+1]]))}},h.parseCmd=function(u,b){var p=this.cmdHistory,d=(u===20||u===28||u===21||u===29)&&b>=32&&b<=47,O=(u===23||u===31)&&b>=33&&b<=35;if(!(d||O))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 L=u===20||u===21||u===23?1:2,x=this.channels[L];return u===20||u===21||u===28||u===29?b===32?x.ccRCL():b===33?x.ccBS():b===34?x.ccAOF():b===35?x.ccAON():b===36?x.ccDER():b===37?x.ccRU(2):b===38?x.ccRU(3):b===39?x.ccRU(4):b===40?x.ccFON():b===41?x.ccRDC():b===42?x.ccTR():b===43?x.ccRTD():b===44?x.ccEDM():b===45?x.ccCR():b===46?x.ccENM():b===47&&x.ccEOC():x.ccTO(b-32),m(u,b,p),this.currentChannel=L,!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,O=(u>=17&&u<=23||u>=25&&u<=31)&&b>=64&&b<=127,L=(u===16||u===24)&&b>=64&&b<=95;if(!(O||L))return!1;if(T(u,b,d))return m(null,null,d),!0;var x=u<=23?1:2;b>=64&&b<=95?p=x===1?e[u]:v[u]:p=x===1?w[u]:g[u];var I=this.channels[x];return I?(I.setPAC(this.interpretPAC(p,b)),m(u,b,d),this.currentChannel=x,!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,O=null;if(u>=25?(p=2,O=u-8):(p=1,O=u),O>=17&&O<=19){var L;O===17?L=b+80:O===18?L=b+112:L=b+144,this.logger.log(s.INFO,"Special char '"+S(L)+"' in channel "+p),d=[L]}else u>=32&&u<=127&&(d=b===0?[u]:[u,b]);if(d){var x=l(d);this.logger.log(s.DEBUG,"Char codes = "+x.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 O,L={};u===16||u===24?(O=Math.floor((b-32)/2),L.background=c[O],b%2===1&&(L.background=L.background+"_semi")):b===45?L.background="transparent":(L.foreground="black",b===47&&(L.underline=!0));var x=u<=23?1:2,I=this.channels[x];return I.setBkgData(L),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}}B.default=y},"./src/utils/codecs.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"isCodecType",function(){return P}),A.d(B,"isCodecSupportedInMp4",function(){return S});var j={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(W,N){var e=j[N];return!!e&&e[W.slice(0,4)]===!0}function S(W,N){return MediaSource.isTypeSupported((N||"video")+'/mp4;codecs="'+W+'"')}},"./src/utils/cues.ts":function(ne,B,A){"use strict";A.r(B);var j=A("./src/utils/vttparser.ts"),P=A("./src/utils/webvtt-parser.ts"),S=A("./src/utils/texttrack-utils.ts"),W=/\s/,N={newCue:function(w,v,g,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++)W.test(i.chars[y].uchar)&&a?n++:(r+=i.chars[y].uchar,a=!1);i.cueStartTime=v,v===g&&(g+=1e-4),n>=16?n--:n++;var m=Object(j.fixLineBreaks)(r.trim()),T=Object(P.generateCueId)(v,g,m);(!w||!w.cues||!w.cues.getCueById(T))&&(l=new t(v,g,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 w&&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(S.addCueToTrack)(w,_)})),s}};B.default=N},"./src/utils/discontinuities.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"findFirstFragWithCC",function(){return W}),A.d(B,"shouldAlignOnDiscontinuities",function(){return N}),A.d(B,"findDiscontinuousReferenceFrag",function(){return e}),A.d(B,"adjustSlidingStart",function(){return v}),A.d(B,"alignStream",function(){return g}),A.d(B,"alignPDT",function(){return s}),A.d(B,"alignFragmentByPDTDelta",function(){return i}),A.d(B,"alignMediaPlaylistByPDT",function(){return l});var j=A("./src/polyfills/number.ts"),P=A("./src/utils/logger.ts"),S=A("./src/controller/level-helper.ts");function W(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=W(r,t[0].cc);if(!E||E&&!E.startPTS){P.logger.log("No frag in previous level to align on");return}return E}function w(a,n){if(a){var r=a.start+n;a.start=a.startPTS=r,a.endPTS=r+a.duration}}function v(a,n){for(var r=n.fragments,t=0,E=r.length;t<E;t++)w(r[t],a);n.fragmentHint&&w(n.fragmentHint,a),n.alignedSliding=!0}function g(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(S.adjustSliding)(n.details,r)}function c(a,n,r){if(N(a,r,n)){var t=e(r.details,n);t&&Object(j.isFiniteNumber)(t.start)&&(P.logger.log("Adjusting PTS using last level due to CC increase within current level "+n.url),v(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(j.isFiniteNumber)(E)&&(P.logger.log("Adjusting PTS using programDateTime delta "+(t-r)+"ms, sliding:"+E.toFixed(3)+" "+a.url+" "),v(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(ne,B,A){"use strict";A.r(B);var j=A("./src/utils/ewma.ts"),P=function(){function S(N,e,w){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=w,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new j.default(N),this.fast_=new j.default(e)}var W=S.prototype;return W.update=function(e,w){var v=this.slow_,g=this.fast_;this.slow_.halfLife!==e&&(this.slow_=new j.default(e,v.getEstimate(),v.getTotalWeight())),this.fast_.halfLife!==w&&(this.fast_=new j.default(w,g.getEstimate(),g.getTotalWeight()))},W.sample=function(e,w){e=Math.max(e,this.minDelayMs_);var v=8*w,g=e/1e3,c=v/g;this.fast_.sample(g,c),this.slow_.sample(g,c)},W.canEstimate=function(){var e=this.fast_;return e&&e.getTotalWeight()>=this.minWeight_},W.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},W.destroy=function(){},S}();B.default=P},"./src/utils/ewma.ts":function(ne,B,A){"use strict";A.r(B);var j=function(){function P(W,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=W,this.alpha_=W?Math.exp(Math.log(.5)/W):0,this.estimate_=N,this.totalWeight_=e}var S=P.prototype;return S.sample=function(N,e){var w=Math.pow(this.alpha_,N);this.estimate_=e*(1-w)+w*this.estimate_,this.totalWeight_+=N},S.getTotalWeight=function(){return this.totalWeight_},S.getEstimate=function(){if(this.alpha_){var N=1-Math.pow(this.alpha_,this.totalWeight_);if(N)return this.estimate_/N}return this.estimate_},P}();B.default=j},"./src/utils/fetch-loader.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"fetchSupported",function(){return i});var j=A("./src/polyfills/number.ts"),P=A("./src/loader/load-stats.ts"),S=A("./src/demux/chunk-cache.ts");function W(t,E){t.prototype=Object.create(E.prototype),t.prototype.constructor=t,g(t,E)}function N(t){var E=typeof Map=="function"?new Map:void 0;return N=function(m){if(m===null||!v(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}}),g(T,m)},N(t)}function e(t,E,y){return w()?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&&g(u,f.prototype),u},e.apply(null,arguments)}function w(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function v(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function g(t,E){return g=Object.setPrototypeOf||function(m,T){return m.__proto__=T,m},g(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 O=d.status,L=d.statusText;throw new r(L||"fetch, bad network response",O,d)}return h.loading.first=Math.max(self.performance.now(),h.loading.start),h.total=parseInt(d.headers.get("Content-Length")||"0"),u&&Object(j.isFiniteNumber)(T.highWaterMark)?f.loadProgressively(d,h,m,T.highWaterMark,u):b?d.arrayBuffer():d.text()}).then(function(d){var O=f.response;self.clearTimeout(f.requestTimeout),h.loading.end=Math.max(self.performance.now(),h.loading.first),h.loaded=h.total=d[p];var L={url:O.url,data:d};u&&!Object(j.isFiniteNumber)(T.highWaterMark)&&u(h,m,d,O),_.onSuccess(L,h,m,O)}).catch(function(d){if(self.clearTimeout(f.requestTimeout),h.aborted)return;var O=d.code||0;_.onError({code:O,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 S.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 O=d.value,L=O.length;return T.loaded+=L,L<f||o.dataLength?(o.push(O),o.dataLength>=f&&h(T,_,o.flush(),m)):h(T,_,O,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){W(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));B.default=l},"./src/utils/imsc1-ttml-parser.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"IMSC1_CODEC",function(){return v}),A.d(B,"parseIMSC1",function(){return i});var j=A("./src/utils/mp4-tools.ts"),P=A("./src/utils/vttparser.ts"),S=A("./src/utils/vttcue.ts"),W=A("./src/demux/id3.ts"),N=A("./src/utils/timescale-conversion.ts"),e=A("./src/utils/webvtt-parser.ts");function w(){return w=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},w.apply(this,arguments)}var v="stpp.ttml.im1t",g=/^(\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(j.findBox)(new Uint8Array(f),["mdat"]);if(p.length===0){b(new Error("Could not parse IMSC1 mdat"));return}var d=p[0],O=Object(W.utf8ArrayToStr)(new Uint8Array(f,d.start,d.end-d.start)),L=Object(N.toTimescaleFromScale)(h,1,o);try{u(l(O,L))}catch(x){b(x)}}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(k,C){return k[C]=b.getAttribute("ttp:"+C)||p[C],k},{}),O=b.getAttribute("xml:space")!=="preserve",L=n(a(b,"styling","style")),x=n(a(b,"layout","region")),I=a(b,"body","[begin]");return[].map.call(I,function(k){var C=r(k,O);if(!C||!k.hasAttribute("begin"))return null;var F=m(k.getAttribute("begin"),d),V=m(k.getAttribute("dur"),d),ee=m(k.getAttribute("end"),d);if(F===null)throw y(k);if(ee===null){if(V===null)throw y(k);ee=F+V}var ie=new S.default(F-h,ee-h,C);ie.id=Object(e.generateCueId)(ie.startTime,ie.endTime,ie.text);var pe=x[k.getAttribute("region")],ve=L[k.getAttribute("style")];ie.position=10,ie.size=80;var ye=t(pe,ve),Ee=ye.textAlign;if(Ee){var Se=s[Ee];Se&&(ie.lineAlign=Se),ie.align=Ee}return w(ie,ye),ie}).filter(function(k){return k!==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&&(g.test(f)?o=T(f,h):c.test(f)&&(o=_(f,h))),o}function T(f,h){var o=g.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(ne,B,A){"use strict";A.r(B),A.d(B,"enableLogs",function(){return e}),A.d(B,"logger",function(){return w});var j=function(){},P={trace:j,debug:j,log:j,warn:j,info:j,error:j},S=P;function W(v){var g=self.console[v];return g?g.bind(self.console,"["+v+"] >"):j}function N(v){for(var g=arguments.length,c=new Array(g>1?g-1:0),s=1;s<g;s++)c[s-1]=arguments[s];c.forEach(function(i){S[i]=v[i]?v[i].bind(v):W(i)})}function e(v){if(self.console&&v===!0||typeof v=="object"){N(v,"debug","log","info","warn","error");try{S.log()}catch(g){S=P}}else S=P}var w=S},"./src/utils/mediakeys-helper.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"KeySystems",function(){return j}),A.d(B,"requestMediaKeySystemAccess",function(){return P});var j;(function(S){S.WIDEVINE="com.widevine.alpha",S.PLAYREADY="com.microsoft.playready"})(j||(j={}));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(ne,B,A){"use strict";A.r(B),A.d(B,"getMediaSource",function(){return j});function j(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"bin2str",function(){return N}),A.d(B,"readUint16",function(){return e}),A.d(B,"readUint32",function(){return w}),A.d(B,"writeUint32",function(){return v}),A.d(B,"findBox",function(){return g}),A.d(B,"parseSegmentIndex",function(){return c}),A.d(B,"parseInitSegment",function(){return s}),A.d(B,"getStartDTS",function(){return i}),A.d(B,"getDuration",function(){return l}),A.d(B,"computeRawDurationFromSamples",function(){return a}),A.d(B,"offsetStartDTS",function(){return n}),A.d(B,"segmentValidRange",function(){return r}),A.d(B,"appendUint8Array",function(){return t});var j=A("./src/utils/typed-array.ts"),P=A("./src/loader/fragment.ts"),S=Math.pow(2,32)-1,W=[].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 w(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 v(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 g(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=w(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=g({data:T,start:h+8,end:b},y.slice(1));p.length&&W.apply(m,p)}h=b}return m}function c(E){var y=g(E,["moov"]),m=y[0],T=m?m.end:null,_=g(E,["sidx"]);if(!_||!_[0])return null;var f=[],h=_[0],o=h.data[0],u=o===0?8:16,b=w(h,u);u+=4;var p=0,d=0;o===0?u+=8:u+=16,u+=2;var O=h.end+d,L=e(h,u);u+=2;for(var x=0;x<L;x++){var I=u,k=w(h,I);I+=4;var C=k&2147483647,F=(k&2147483648)>>>31;if(F===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var V=w(h,I);I+=4,f.push({referenceSize:C,subsegmentDuration:V,info:{duration:V/b,start:O,end:O+C-1}}),O+=C,I+=4,u=I}return{earliestPresentationTime:p,timescale:b,version:o,referencesCount:L,references:f,moovEndOffset:T}}function s(E){for(var y=[],m=g(E,["moov","trak"]),T=0;T<m.length;T++){var _=m[T],f=g(_,["tkhd"])[0];if(f){var h=f.data[f.start],o=h===0?12:20,u=w(f,o),b=g(_,["mdia","mdhd"])[0];if(b){h=b.data[b.start],o=h===0?12:20;var p=w(b,o),d=g(_,["mdia","hdlr"])[0];if(d){var O=N(d.data.subarray(d.start+8,d.start+12)),L={soun:P.ElementaryStreamTypes.AUDIO,vide:P.ElementaryStreamTypes.VIDEO}[O];if(L){var x=g(_,["mdia","minf","stbl","stsd"])[0],I=void 0;x&&(I=N(x.data.subarray(x.start+12,x.start+16))),y[u]={timescale:p,type:L},y[L]={timescale:p,id:u,codec:I}}}}}}var k=g(E,["moov","mvex","trex"]);return k.forEach(function(C){var F=w(C,4),V=y[F];V&&(V.default={duration:w(C,12),flags:w(C,20)})}),y}function i(E,y){return g(y,["moof","traf"]).reduce(function(m,T){var _=g(T,["tfdt"])[0],f=_.data[_.start],h=g(T,["tfhd"]).reduce(function(o,u){var b=w(u,4),p=E[b];if(p){var d=w(_,4);f===1&&(d*=Math.pow(2,32),d+=w(_,8));var O=p.timescale||9e4,L=d/O;if(isFinite(L)&&(o===null||L<o))return L}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=g(E,["moof","traf"]),h=0;h<f.length;h++){var o=f[h],u=g(o,["tfhd"])[0],b=w(u,4),p=y[b];if(!p)continue;var d=p.default,O=w(u,0)|(d==null?void 0:d.flags),L=d==null?void 0:d.duration;O&8&&(O&2?L=w(u,12):L=w(u,8));for(var x=p.timescale||9e4,I=g(o,["trun"]),k=0;k<I.length;k++){if(L){var C=w(I[k],4);m=L*C}else m=a(I[k]);p.type===P.ElementaryStreamTypes.VIDEO?T+=m/x:p.type===P.ElementaryStreamTypes.AUDIO&&(_+=m/x)}}if(T===0&&_===0){var F=c(E);if(F!=null&&F.references)return F.references.reduce(function(V,ee){return V+ee.info.duration||0},0)}return T||_}function a(E){var y=w(E,0),m=8;y&1&&(m+=4),y&4&&(m+=4);for(var T=0,_=w(E,4),f=0;f<_;f++){if(y&256){var h=w(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){g(y,["moof","traf"]).forEach(function(T){g(T,["tfhd"]).forEach(function(_){var f=w(_,4),h=E[f];if(!h)return;var o=h.timescale||9e4;g(T,["tfdt"]).forEach(function(u){var b=u.data[u.start],p=w(u,4);if(b===0)v(u,4,p-m*o);else{p*=Math.pow(2,32),p+=w(u,8),p-=m*o,p=Math.max(p,0);var d=Math.floor(p/(S+1)),O=Math.floor(p%(S+1));v(u,4,d),v(u,8,O)}})})})}function r(E){var y={valid:null,remainder:null},m=g(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(j.sliceUint8)(E,0,T.start-8),y.remainder=Object(j.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(ne,B,A){"use strict";A.r(B),A.d(B,"default",function(){return j});var j=function(){function P(W,N){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=W,this.trackName=N}var S=P.prototype;return S.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},S.newCue=function(N,e,w){(this.startTime===null||this.startTime>N)&&(this.startTime=N),this.endTime=e,this.screen=w,this.timelineController.createCaptionsTrack(this.trackName)},S.reset=function(){this.cueRanges=[]},P}()},"./src/utils/texttrack-utils.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"sendAddTrackEvent",function(){return P}),A.d(B,"addCueToTrack",function(){return S}),A.d(B,"clearCurrentCues",function(){return W}),A.d(B,"removeCuesInRange",function(){return N}),A.d(B,"getCuesInRange",function(){return w});var j=A("./src/utils/logger.ts");function P(v,g){var c;try{c=new Event("addtrack")}catch(s){c=document.createEvent("Event"),c.initEvent("addtrack",!1,!1)}c.track=v,g.dispatchEvent(c)}function S(v,g){var c=v.mode;if(c==="disabled"&&(v.mode="hidden"),v.cues&&!v.cues.getCueById(g.id))try{if(v.addCue(g),!v.cues.getCueById(g.id))throw new Error("addCue is failed for: "+g)}catch(i){j.logger.debug("[texttrack-utils]: "+i);var s=new self.TextTrackCue(g.startTime,g.endTime,g.text);s.id=g.id,v.addCue(s)}c==="disabled"&&(v.mode=c)}function W(v){var g=v.mode;if(g==="disabled"&&(v.mode="hidden"),v.cues)for(var c=v.cues.length;c--;)v.removeCue(v.cues[c]);g==="disabled"&&(v.mode=g)}function N(v,g,c){var s=v.mode;if(s==="disabled"&&(v.mode="hidden"),v.cues&&v.cues.length>0)for(var i=w(v.cues,g,c),l=0;l<i.length;l++)v.removeCue(i[l]);s==="disabled"&&(v.mode=s)}function e(v,g){if(g<v[0].startTime)return 0;var c=v.length-1;if(g>v[c].endTime)return-1;for(var s=0,i=c;s<=i;){var l=Math.floor((i+s)/2);if(g<v[l].startTime)i=l-1;else if(g>v[l].startTime&&s<c)s=l+1;else return l}return v[s].startTime-g<g-v[i].startTime?s:i}function w(v,g,c){var s=[],i=e(v,g);if(i>-1)for(var l=i,a=v.length;l<a;l++){var n=v[l];if(n.startTime>=g&&n.endTime<=c)s.push(n);else if(n.startTime>c)return s}return s}},"./src/utils/time-ranges.ts":function(ne,B,A){"use strict";A.r(B);var j={toString:function(S){for(var W="",N=S.length,e=0;e<N;e++)W+="["+S.start(e).toFixed(3)+","+S.end(e).toFixed(3)+"]";return W}};B.default=j},"./src/utils/timescale-conversion.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"toTimescaleFromBase",function(){return P}),A.d(B,"toTimescaleFromScale",function(){return S}),A.d(B,"toMsFromMpegTsClock",function(){return W}),A.d(B,"toMpegTsClockFromTimescale",function(){return N});var j=9e4;function P(e,w,v,g){v===void 0&&(v=1),g===void 0&&(g=!1);var c=e*w*v;return g?Math.round(c):c}function S(e,w,v,g){return v===void 0&&(v=1),g===void 0&&(g=!1),P(e,w,1/v,g)}function W(e,w){return w===void 0&&(w=!1),P(e,1e3,1/j,w)}function N(e,w){return w===void 0&&(w=1),P(e,j,1/w)}},"./src/utils/typed-array.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"sliceUint8",function(){return j});function j(P,S,W){return Uint8Array.prototype.slice?P.slice(S,W):new Uint8Array(Array.prototype.slice.call(P,S,W))}},"./src/utils/vttcue.ts":function(ne,B,A){"use strict";A.r(B),B.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var j=["","lr","rl"],P=["start","middle","end","left","right"];function S(v,g){if(typeof g!="string")return!1;if(!Array.isArray(v))return!1;var c=g.toLowerCase();return~v.indexOf(c)?c:!1}function W(v){return S(j,v)}function N(v){return S(P,v)}function e(v){for(var g=arguments.length,c=new Array(g>1?g-1:0),s=1;s<g;s++)c[s-1]=arguments[s];for(var i=1;i<arguments.length;i++){var l=arguments[i];for(var a in l)v[a]=l[a]}return v}function w(v,g,c){var s=this,i={enumerable:!0};s.hasBeenReset=!1;var l="",a=!1,n=v,r=g,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=W(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 w.prototype.getCueAsHTML=function(){var v=self.WebVTT;return v.convertCueToDOMTree(self,this.text)},w}()},"./src/utils/vttparser.ts":function(ne,B,A){"use strict";A.r(B),A.d(B,"parseTimeStamp",function(){return S}),A.d(B,"fixLineBreaks",function(){return g}),A.d(B,"VTTParser",function(){return c});var j=A("./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 S(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 W=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 j.default(0,0,""),w=e.align==="middle"?"middle":"center";function v(s,i,l){var a=s;function n(){var E=S(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 W;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",w,"end"]);break;case"position":o=h.split(","),m.percent(f,o[0]),o.length===2&&m.alt("positionAlign",o[1],["start",w,"end","line-left","line-right","auto"]);break;case"size":m.percent(f,h);break;case"align":m.alt(f,h,["start",w,"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",w);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 g(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(_=g(_);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 j.default(0,0,""),n.state="CUE",E.indexOf("-->")===-1){n.cue.id=E;continue}case"CUE":if(!n.cue){n.state="BADCUE";continue}try{v(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(ne,B,A){"use strict";A.r(B),A.d(B,"generateCueId",function(){return c}),A.d(B,"parseWebVTT",function(){return i});var j=A("./src/polyfills/number.ts"),P=A("./src/utils/vttparser.ts"),S=A("./src/demux/id3.ts"),W=A("./src/utils/timescale-conversion.ts"),N=A("./src/remux/mp4-remuxer.ts"),e=/\r\n|\n\r|\n|\r/g,w=function(a,n,r){return r===void 0&&(r=0),a.substr(r,n.length)===n},v=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(j.isFiniteNumber)(n)||!Object(j.isFiniteNumber)(r)||!Object(j.isFiniteNumber)(t)||!Object(j.isFiniteNumber)(E))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+a);return n+=1e3*r,n+=60*1e3*t,n+=60*60*1e3*E,n},g=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 g(l.toString())+g(a.toString())+g(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(S.utf8ArrayToStr)(new Uint8Array(l)).trim().replace(e,`
`).split(`
`),f=[],h=Object(W.toMpegTsClockFromTimescale)(a,n),o="00:00.000",u=0,b=0,p,d=!0,O=!1;T.oncue=function(L){var x=r[t],I=r.ccOffset,k=(u-h)/9e4;if(x!=null&&x.new&&(b!==void 0?I=r.ccOffset=x.start:s(r,t,k)),k&&(I=k-r.presentationOffset),O){var C=L.endTime-L.startTime,F=Object(N.normalizePts)((L.startTime+I-b)*9e4,E*9e4)/9e4;L.startTime=F,L.endTime=F+C}var V=L.text.trim();L.text=decodeURIComponent(encodeURIComponent(V)),L.id||(L.id=c(L.startTime,L.endTime,V)),L.endTime>0&&f.push(L)},T.onparsingerror=function(L){p=L},T.onflush=function(){if(p){m(p);return}y(f)},_.forEach(function(L){if(d)if(w(L,"X-TIMESTAMP-MAP=")){d=!1,O=!0,L.substr(16).split(",").forEach(function(x){w(x,"LOCAL:")?o=x.substr(6):w(x,"MPEGTS:")&&(u=parseInt(x.substr(7)))});try{b=v(o)/1e3}catch(x){O=!1,p=x}return}else L===""&&(d=!1);T.parse(L+`
`)}),T.flush()}},"./src/utils/xhr-loader.ts":function(ne,B,A){"use strict";A.r(B);var j=A("./src/utils/logger.ts"),P=A("./src/loader/load-stats.ts"),S=/^age:\s*[\d.]+\s*$/m,W=function(){function N(w){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=w?w.xhrSetup:null,this.stats=new 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 v=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),v&&(v.onreadystatechange=null,v.onprogress=null,v.readyState!==4&&(this.stats.aborted=!0,v.abort()))},e.abort=function(){var v;this.abortInternal(),(v=this.callbacks)!==null&&v!==void 0&&v.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},e.load=function(v,g,c){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=v,this.config=g,this.callbacks=c,this.retryDelay=g.retryDelay,this.loadInternal()},e.loadInternal=function(){var v=this.config,g=this.context;if(!v)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,g.url)}catch(n){c.open("GET",g.url,!0),i(c,g.url)}c.readyState||c.open("GET",g.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},g,c);return}g.rangeEnd&&c.setRequestHeader("Range","bytes="+g.rangeStart+"-"+(g.rangeEnd-1)),c.onreadystatechange=this.readystatechange.bind(this),c.onprogress=this.loadprogress.bind(this),c.responseType=g.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),v.timeout),c.send()},e.readystatechange=function(){var v=this.context,g=this.loader,c=this.stats;if(!v||!g)return;var s=g.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){g.onreadystatechange=null,g.onprogress=null;var l=g.status;if(l>=200&&l<300){c.loading.end=Math.max(self.performance.now(),c.loading.first);var a,n;if(v.responseType==="arraybuffer"?(a=g.response,n=a.byteLength):(a=g.responseText,n=a.length),c.loaded=c.total=n,!this.callbacks)return;var r=this.callbacks.onProgress;if(r&&r(c,v,a,g),!this.callbacks)return;var t={url:g.responseURL,data:a};this.callbacks.onSuccess(t,c,v,g)}else c.retry>=i.maxRetry||l>=400&&l<499?(j.logger.error(l+" while loading "+v.url),this.callbacks.onError({code:l,text:g.statusText},v,g)):(j.logger.warn(l+" while loading "+v.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(){j.logger.warn("timeout while loading "+this.context.url);var v=this.callbacks;v&&(this.abortInternal(),v.onTimeout(this.stats,this.context,this.loader))},e.loadprogress=function(v){var g=this.stats;g.loaded=v.loaded,v.lengthComputable&&(g.total=v.total)},e.getCacheAge=function(){var v=null;if(this.loader&&S.test(this.loader.getAllResponseHeaders())){var g=this.loader.getResponseHeader("age");v=g?parseFloat(g):null}return v},N}();B.default=W}}).default})},vHTk:function(Le,se,U){Le.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(Le,se,U){"use strict";U.d(se,"a",function(){return Oe});var ne=U("rePB"),B=U("VTBJ"),A=U("KQm4"),j=U("U8pU"),P=U("ODXe"),S=U("q1tI"),W=U("TSYQ"),N=U.n(W),e=U("Gytx"),w=U.n(e),v=U("Kwbf"),g=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(de,ge,xe,we,Z){var z=xe[de]||{},G=xe[ge]||{},X,Q;z.fixed==="left"?X=we.left[de]:G.fixed==="right"&&(Q=we.right[ge]);var Y=!1,$=!1,te=!1,re=!1,le=xe[ge+1],he=xe[de-1];if(Z==="rtl"){if(X!==void 0){var Te=he&&he.fixed==="left";re=!Te}else if(Q!==void 0){var Re=le&&le.fixed==="right";te=!Re}}else if(X!==void 0){var Pe=le&&le.fixed==="left";Y=!Pe}else if(Q!==void 0){var Ae=he&&he.fixed==="right";$=!Ae}return{fixLeft:X,fixRight:Q,lastFixLeft:Y,firstFixRight:$,lastFixRight:te,firstFixLeft:re,isSticky:we.isSticky}}var E=U("sR1s");function y(de){var ge=de.cells,xe=de.stickyOffsets,we=de.flattenColumns,Z=de.rowComponent,z=de.cellComponent,G=de.onHeaderRow,X=de.index,Q=S.useContext(r.a),Y=Q.prefixCls,$=Q.direction,te;G&&(te=G(ge.map(function(le){return le.column}),X));var re=Object(E.a)(ge.map(function(le){return le.column}));return S.createElement(Z,Object.assign({},te),ge.map(function(le,he){var Te=le.column,Re=t(le.colStart,le.colEnd,we,xe,$),Pe;return Te&&Te.onHeaderCell&&(Pe=le.column.onHeaderCell(Te)),S.createElement(n.a,Object.assign({},le,{ellipsis:Te.ellipsis,align:Te.align,component:z,prefixCls:Y,key:re[he]},Re,{additionalProps:Pe,rowType:"header"}))}))}y.displayName="HeaderRow";var m=y;function T(de){var ge=[];function xe(G,X){var Q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;ge[Q]=ge[Q]||[];var Y=X,$=G.filter(Boolean).map(function(te){var re={key:te.key,className:te.className||"",children:te.title,column:te,colStart:Y},le=1,he=te.children;return he&&he.length>0&&(le=xe(he,Y,Q+1).reduce(function(Te,Re){return Te+Re},0),re.hasSubColumns=!0),"colSpan"in te&&(le=te.colSpan),"rowSpan"in te&&(re.rowSpan=te.rowSpan),re.colSpan=le,re.colEnd=re.colStart+le-1,ge[Q].push(re),Y+=le,le});return $}xe(de,0);for(var we=ge.length,Z=function(X){ge[X].forEach(function(Q){!("rowSpan"in Q)&&!Q.hasSubColumns&&(Q.rowSpan=we-X)})},z=0;z<we;z+=1)Z(z);return ge}function _(de){var ge=de.stickyOffsets,xe=de.columns,we=de.flattenColumns,Z=de.onHeaderRow,z=S.useContext(r.a),G=z.prefixCls,X=z.getComponent,Q=S.useMemo(function(){return T(xe)},[xe]),Y=X(["header","wrapper"],"thead"),$=X(["header","row"],"tr"),te=X(["header","cell"],"th");return S.createElement(Y,{className:"".concat(G,"-thead")},Q.map(function(re,le){var he=S.createElement(m,{key:le,flattenColumns:we,cells:re,stickyOffsets:ge,rowComponent:$,cellComponent:te,onHeaderRow:Z,index:le});return he}))}var f=_,h=U("hW8S");function o(de){for(var ge=de.colWidths,xe=de.columns,we=de.columCount,Z=[],z=we||xe.length,G=!1,X=z-1;X>=0;X-=1){var Q=ge[X],Y=xe&&xe[X],$=Y&&Y[h.a];(Q||$||G)&&(Z.unshift(S.createElement("col",Object.assign({key:X,style:{width:Q,minWidth:Q}},$))),G=!0)}return S.createElement("colgroup",null,Z)}var u=o;function b(de,ge){return Object(S.useMemo)(function(){for(var xe=[],we=0;we<ge;we+=1){var Z=de[we];if(Z!==void 0)xe[we]=Z;else return null}return xe},[de.join("_"),ge])}var p=S.forwardRef(function(de,ge){var xe=de.noData,we=de.columns,Z=de.flattenColumns,z=de.colWidths,G=de.columCount,X=de.stickyOffsets,Q=de.direction,Y=de.fixHeader,$=de.offsetHeader,te=de.stickyClassName,re=de.onScroll,le=Object(l.a)(de,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),he=S.useContext(r.a),Te=he.prefixCls,Re=he.scrollbarSize,Pe=he.isSticky,Ae=Pe&&!Y?0:Re,Ge=S.useRef(null),Ne=S.useCallback(function(Je){Object(a.b)(ge,Je),Object(a.b)(Ge,Je)},[]);S.useEffect(function(){var Je;function qe(je){var tt=je.currentTarget,Ue=je.deltaX;Ue&&(re({currentTarget:tt,scrollLeft:tt.scrollLeft+Ue}),je.preventDefault())}return(Je=Ge.current)===null||Je===void 0||Je.addEventListener("wheel",qe),function(){var je;(je=Ge.current)===null||je===void 0||je.removeEventListener("wheel",qe)}},[]);var ke=Z[Z.length-1],$e={fixed:ke?ke.fixed:null,onHeaderCell:function(){return{className:"".concat(Te,"-cell-scrollbar")}}},ze=Object(S.useMemo)(function(){return Ae?[].concat(Object(A.a)(we),[$e]):we},[Ae,we]),He=Object(S.useMemo)(function(){return Ae?[].concat(Object(A.a)(Z),[$e]):Z},[Ae,Z]),Ze=Object(S.useMemo)(function(){var Je=X.right,qe=X.left;return Object(B.a)(Object(B.a)({},X),{},{left:Q==="rtl"?[].concat(Object(A.a)(qe.map(function(je){return je+Ae})),[0]):qe,right:Q==="rtl"?Je:[].concat(Object(A.a)(Je.map(function(je){return je+Ae})),[0]),isSticky:Pe})},[Ae,X,Pe]),We=b(z,G);return S.createElement("div",{style:Object(B.a)({overflow:"hidden"},Pe?{top:$}:{}),ref:Ne,className:N()("".concat(Te,"-header"),Object(ne.a)({},te,!!te))},S.createElement("table",{style:{tableLayout:"fixed",visibility:xe||We?null:"hidden"}},S.createElement(u,{colWidths:We?[].concat(Object(A.a)(We),[Ae]):[],columCount:G+1,columns:He}),S.createElement(f,Object.assign({},le,{stickyOffsets:Ze,columns:ze,flattenColumns:He}))))});p.displayName="FixedHeader";var d=p,O=S.createContext(null),L=O;function x(de){var ge=de.prefixCls,xe=de.children,we=de.component,Z=de.cellComponent,z=de.fixHeader,G=de.fixColumn,X=de.horizonScroll,Q=de.className,Y=de.expanded,$=de.componentWidth,te=de.colSpan,re=S.useContext(r.a),le=re.scrollbarSize;return S.useMemo(function(){var he=xe;return G&&(he=S.createElement("div",{style:{width:$-(z?le:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(ge,"-expanded-row-fixed")},he)),S.createElement(we,{className:Q,style:{display:Y?null:"none"}},S.createElement(n.a,{component:Z,prefixCls:ge,colSpan:te},he))},[xe,we,z,X,Q,Y,$,te,le])}var I=x;function k(de){var ge=de.className,xe=de.style,we=de.record,Z=de.index,z=de.rowKey,G=de.getRowKey,X=de.rowExpandable,Q=de.expandedKeys,Y=de.onRow,$=de.indent,te=$===void 0?0:$,re=de.rowComponent,le=de.cellComponent,he=de.childrenColumnName,Te=S.useContext(r.a),Re=Te.prefixCls,Pe=Te.fixedInfoList,Ae=S.useContext(L),Ge=Ae.fixHeader,Ne=Ae.fixColumn,ke=Ae.horizonScroll,$e=Ae.componentWidth,ze=Ae.flattenColumns,He=Ae.expandableType,Ze=Ae.expandRowByClick,We=Ae.onTriggerExpand,Je=Ae.rowClassName,qe=Ae.expandedRowClassName,je=Ae.indentSize,tt=Ae.expandIcon,Ue=Ae.expandedRowRender,Be=Ae.expandIconColumnIndex,Fe=S.useState(!1),it=Object(P.a)(Fe,2),lt=it[0],pt=it[1],rt=Q&&Q.has(de.recordKey);S.useEffect(function(){rt&&pt(!0)},[rt]);var Ye=He==="row"&&(!X||X(we)),Xe=He==="nest",Ke=he&&we&&we[he],at=Ye||Xe,Ve;Y&&(Ve=Y(we,Z));var dt=function(ct){if(Ze&&at&&We(we,ct),Ve&&Ve.onClick){for(var mt,ht=arguments.length,bt=new Array(ht>1?ht-1:0),Et=1;Et<ht;Et++)bt[Et-1]=arguments[Et];(mt=Ve).onClick.apply(mt,[ct].concat(bt))}},nt;typeof Je=="string"?nt=Je:typeof Je=="function"&&(nt=Je(we,Z,te));var yt=Object(E.a)(ze),xt=S.createElement(re,Object.assign({},Ve,{"data-row-key":z,className:N()(ge,"".concat(Re,"-row"),"".concat(Re,"-row-level-").concat(te),nt,Ve&&Ve.className),style:Object(B.a)(Object(B.a)({},xe),Ve?Ve.style:null),onClick:dt}),ze.map(function(ut,ct){var mt=ut.render,ht=ut.dataIndex,bt=ut.className,Et=yt[ct],Dt=Pe[ct],Ct;ct===(Be||0)&&Xe&&(Ct=S.createElement(S.Fragment,null,S.createElement("span",{style:{paddingLeft:"".concat(je*te,"px")},className:"".concat(Re,"-row-indent indent-level-").concat(te)}),tt({prefixCls:Re,expanded:rt,expandable:Ke,record:we,onExpand:We})));var Pt;return ut.onCell&&(Pt=ut.onCell(we,Z)),S.createElement(n.a,Object.assign({className:bt,ellipsis:ut.ellipsis,align:ut.align,component:le,prefixCls:Re,key:Et,record:we,index:Z,dataIndex:ht,render:mt,shouldCellUpdate:ut.shouldCellUpdate},Dt,{appendNode:Ct,additionalProps:Pt}))})),_t;if(Ye&&(lt||rt)){var wt=Ue(we,Z,te+1,rt),It=qe&&qe(we,Z,te);_t=S.createElement(I,{expanded:rt,className:N()("".concat(Re,"-expanded-row"),"".concat(Re,"-expanded-row-level-").concat(te+1),It),prefixCls:Re,fixHeader:Ge,fixColumn:Ne,horizonScroll:ke,component:re,componentWidth:$e,cellComponent:le,colSpan:ze.length},wt)}var Lt;return Ke&&rt&&(Lt=(we[he]||[]).map(function(ut,ct){var mt=G(ut,ct);return S.createElement(k,Object.assign({},de,{key:mt,rowKey:mt,record:ut,recordKey:mt,index:ct,indent:te+1}))})),S.createElement(S.Fragment,null,xt,_t,Lt)}k.displayName="BodyRow";var C=k,F=S.createContext(null),V=F;function ee(de){var ge=de.columnKey,xe=de.onColumnResize,we=S.useRef();return S.useEffect(function(){we.current&&xe(ge,we.current.offsetWidth)},[]),S.createElement(g.a,{onResize:function(z){var G=z.offsetWidth;xe(ge,G)}},S.createElement("td",{ref:we,style:{padding:0,border:0,height:0}},S.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function ie(de){var ge=de.data,xe=de.getRowKey,we=de.measureColumnWidth,Z=de.expandedKeys,z=de.onRow,G=de.rowExpandable,X=de.emptyNode,Q=de.childrenColumnName,Y=S.useContext(V),$=Y.onColumnResize,te=S.useContext(r.a),re=te.prefixCls,le=te.getComponent,he=S.useContext(L),Te=he.fixHeader,Re=he.horizonScroll,Pe=he.flattenColumns,Ae=he.componentWidth;return S.useMemo(function(){var Ge=le(["body","wrapper"],"tbody"),Ne=le(["body","row"],"tr"),ke=le(["body","cell"],"td"),$e;ge.length?$e=ge.map(function(He,Ze){var We=xe(He,Ze);return S.createElement(C,{key:We,rowKey:We,record:He,recordKey:We,index:Ze,rowComponent:Ne,cellComponent:ke,expandedKeys:Z,onRow:z,getRowKey:xe,rowExpandable:G,childrenColumnName:Q})}):$e=S.createElement(I,{expanded:!0,className:"".concat(re,"-placeholder"),prefixCls:re,fixHeader:Te,fixColumn:Re,horizonScroll:Re,component:Ne,componentWidth:Ae,cellComponent:ke,colSpan:Pe.length},X);var ze=Object(E.a)(Pe);return S.createElement(Ge,{className:"".concat(re,"-tbody")},we&&S.createElement("tr",{"aria-hidden":"true",className:"".concat(re,"-measure-row"),style:{height:0}},ze.map(function(He){return S.createElement(ee,{key:He,columnKey:He,onColumnResize:$})})),$e)},[ge,re,z,we,Z,xe,le,Ae,X,Pe])}var pe=S.memo(ie);pe.displayName="Body";var ve=pe,ye=U("wRmb"),Ee=U("xEkU"),Se=U.n(Ee);function fe(de){var ge=Object(S.useRef)(de),xe=Object(S.useState)({}),we=Object(P.a)(xe,2),Z=we[1],z=Object(S.useRef)(null),G=Object(S.useRef)([]);function X(Q){z.current===null&&(G.current=[],z.current=Se()(function(){G.current.forEach(function(Y){ge.current=Y(ge.current)}),z.current=null,Z({})})),G.current.push(Q)}return Object(S.useEffect)(function(){return function(){Se.a.cancel(z.current)}},[]),[ge.current,X]}function K(de){var ge=Object(S.useRef)(de),xe=Object(S.useRef)(null);function we(){window.clearTimeout(xe.current)}function Z(G){ge.current=G,we(),xe.current=window.setTimeout(function(){ge.current=null,xe.current=null},100)}function z(){return ge.current}return Object(S.useEffect)(function(){return we},[]),[Z,z]}function R(de,ge,xe){var we=Object(S.useMemo)(function(){for(var Z=[],z=[],G=0,X=0,Q=0;Q<ge;Q+=1)if(xe==="rtl"){z[Q]=X,X+=de[Q]||0;var Y=ge-Q-1;Z[Y]=G,G+=de[Y]||0}else{Z[Q]=G,G+=de[Q]||0;var $=ge-Q-1;z[$]=X,X+=de[$]||0}return{left:Z,right:z}},[de,ge,xe]);return we}var D=R;function H(de){var ge=de.className,xe=de.children;return S.createElement("div",{className:ge},xe)}var J=H,M=U("n6Qo");function ae(de){var ge,xe=de.prefixCls,we=de.record,Z=de.onExpand,z=de.expanded,G=de.expandable,X="".concat(xe,"-row-expand-icon");if(!G)return S.createElement("span",{className:N()(X,"".concat(xe,"-row-spaced"))});var Q=function($){Z(we,$),$.stopPropagation()};return S.createElement("span",{className:N()(X,(ge={},Object(ne.a)(ge,"".concat(xe,"-row-expanded"),z),Object(ne.a)(ge,"".concat(xe,"-row-collapsed"),!z),ge)),onClick:Q})}function me(de,ge,xe){var we=[];function Z(z){(z||[]).forEach(function(G,X){we.push(ge(G,X)),Z(G[xe])})}return Z(de),we}var _e=U("zT1h"),q=U("y0+3"),oe=function(ge,xe){var we,Z,z=ge.scrollBodyRef,G=ge.onScroll,X=ge.offsetScroll,Q=S.useContext(r.a),Y=Q.prefixCls,$=((we=z.current)===null||we===void 0?void 0:we.scrollWidth)||0,te=((Z=z.current)===null||Z===void 0?void 0:Z.clientWidth)||0,re=$&&te*(te/$),le=S.useRef(),he=fe({scrollLeft:0,isHiddenScrollBar:!1}),Te=Object(P.a)(he,2),Re=Te[0],Pe=Te[1],Ae=S.useRef({delta:0,x:0}),Ge=S.useState(!1),Ne=Object(P.a)(Ge,2),ke=Ne[0],$e=Ne[1],ze=function(){$e(!1)},He=function(je){je.persist(),Ae.current.delta=je.pageX-Re.scrollLeft,Ae.current.x=0,$e(!0),je.preventDefault()},Ze=function(je){var tt,Ue=je||((tt=window)===null||tt===void 0?void 0:tt.event),Be=Ue.buttons;if(!ke||Be===0){ke&&$e(!1);return}var Fe=Ae.current.x+je.pageX-Ae.current.x-Ae.current.delta;Fe<=0&&(Fe=0),Fe+re>=te&&(Fe=te-re),G({scrollLeft:Fe/te*($+2)}),Ae.current.x=je.pageX},We=function(){var je=Object(q.b)(z.current).top,tt=je+z.current.offsetHeight,Ue=document.documentElement.scrollTop+window.innerHeight;tt-Object(c.a)()<=Ue||je>=Ue-X?Pe(function(Be){return Object(B.a)(Object(B.a)({},Be),{},{isHiddenScrollBar:!0})}):Pe(function(Be){return Object(B.a)(Object(B.a)({},Be),{},{isHiddenScrollBar:!1})})},Je=function(je){Pe(function(tt){return Object(B.a)(Object(B.a)({},tt),{},{scrollLeft:je/$*te||0})})};return S.useImperativeHandle(xe,function(){return{setScrollLeft:Je}}),S.useEffect(function(){var qe=Object(_e.a)(document.body,"mouseup",ze,!1),je=Object(_e.a)(document.body,"mousemove",Ze,!1);return We(),function(){qe.remove(),je.remove()}},[re,ke]),S.useEffect(function(){var qe=Object(_e.a)(window,"scroll",We,!1),je=Object(_e.a)(window,"resize",We,!1);return function(){qe.remove(),je.remove()}},[]),S.useEffect(function(){Re.isHiddenScrollBar||Pe(function(qe){var je,tt;return Object(B.a)(Object(B.a)({},qe),{},{scrollLeft:z.current.scrollLeft/((je=z.current)===null||je===void 0?void 0:je.scrollWidth)*((tt=z.current)===null||tt===void 0?void 0:tt.clientWidth)})})},[Re.isHiddenScrollBar]),$<=te||!re||Re.isHiddenScrollBar?null:S.createElement("div",{style:{height:Object(c.a)(),width:te,bottom:X},className:"".concat(Y,"-sticky-scroll")},S.createElement("div",{onMouseDown:He,ref:le,className:N()("".concat(Y,"-sticky-scroll-bar"),Object(ne.a)({},"".concat(Y,"-sticky-scroll-bar-active"),ke)),style:{width:"".concat(re,"px"),transform:"translate3d(".concat(Re.scrollLeft,"px, 0, 0)")}}))},ue=S.forwardRef(oe);function ce(de,ge){return S.useMemo(function(){var xe=!!de;return{isSticky:xe,stickyClassName:xe?"".concat(ge,"-sticky-header"):"",offsetHeader:Object(j.a)(de)==="object"&&de.offsetHeader||0,offsetScroll:Object(j.a)(de)==="object"&&de.offsetScroll||0}},[de,ge])}var be=[],Ce={},Oe="rc-table-internal-hook",Ie=S.memo(function(de){var ge=de.children;return ge},function(de,ge){return w()(de.props,ge.props)?de.pingLeft!==ge.pingLeft||de.pingRight!==ge.pingRight:!1});function De(de){var ge,xe=de.prefixCls,we=de.className,Z=de.rowClassName,z=de.style,G=de.data,X=de.rowKey,Q=de.scroll,Y=de.tableLayout,$=de.direction,te=de.title,re=de.footer,le=de.summary,he=de.id,Te=de.showHeader,Re=de.components,Pe=de.emptyText,Ae=de.onRow,Ge=de.onHeaderRow,Ne=de.internalHooks,ke=de.transformColumns,$e=de.internalRefs,ze=de.sticky,He=G||be,Ze=!!He.length,We=S.useState(0),Je=Object(P.a)(We,2),qe=Je[0],je=Je[1];S.useEffect(function(){je(Object(c.a)())});var tt=S.useMemo(function(){return Object(E.c)(Re,{})},[Re]),Ue=S.useCallback(function(Qe,et){return Object(E.b)(tt,Qe)||et},[tt]),Be=S.useMemo(function(){return typeof X=="function"?X:function(Qe){var et=Qe&&Qe[X];return et}},[X]),Fe=Object(h.c)(de),it=Fe.expandIcon,lt=Fe.expandedRowKeys,pt=Fe.defaultExpandedRowKeys,rt=Fe.defaultExpandAllRows,Ye=Fe.expandedRowRender,Xe=Fe.onExpand,Ke=Fe.onExpandedRowsChange,at=Fe.expandRowByClick,Ve=Fe.rowExpandable,dt=Fe.expandIconColumnIndex,nt=Fe.expandedRowClassName,yt=Fe.childrenColumnName,xt=Fe.indentSize,_t=it||ae,wt=yt||"children",It=S.useMemo(function(){return Ye?"row":de.expandable&&Ne===Oe&&de.expandable.__PARENT_RENDER_ICON__||He.some(function(Qe){return Qe&&Object(j.a)(Qe)==="object"&&Qe[wt]})?"nest":!1},[!!Ye,He]),Lt=S.useState(function(){return pt||(rt?me(He,Be,wt):[])}),ut=Object(P.a)(Lt,2),ct=ut[0],mt=ut[1],ht=S.useMemo(function(){return new Set(lt||ct||[])},[lt,ct]),bt=S.useCallback(function(Qe){var et=Be(Qe,He.indexOf(Qe)),ot,ft=ht.has(et);ft?(ht.delete(et),ot=Object(A.a)(ht)):ot=[].concat(Object(A.a)(ht),[et]),mt(ot),Xe&&Xe(!ft,Qe),Ke&&Ke(ot)},[Be,ht,He,Xe,Ke]),Et=S.useState(0),Dt=Object(P.a)(Et,2),Ct=Dt[0],Pt=Dt[1],mr=Object(ye.b)(Object(B.a)(Object(B.a)(Object(B.a)({},de),Fe),{},{expandable:!!Ye,expandedKeys:ht,getRowKey:Be,onTriggerExpand:bt,expandIcon:_t,expandIconColumnIndex:dt,direction:$}),Ne===Oe?ke:null),Jt=Object(P.a)(mr,2),Ft=Jt[0],st=Jt[1],Mt=S.useMemo(function(){return{columns:Ft,flattenColumns:st}},[Ft,st]),jt=S.useRef(),Qt=S.useRef(),Tt=S.useRef(),gr=S.useState(!1),Zt=Object(P.a)(gr,2),qt=Zt[0],vr=Zt[1],yr=S.useState(!1),er=Object(P.a)(yr,2),tr=er[0],_r=er[1],br=fe(new Map),rr=Object(P.a)(br,2),Er=rr[0],Tr=rr[1],xr=Object(E.a)(st),nr=xr.map(function(Qe){return Er.get(Qe)}),ir=S.useMemo(function(){return nr},[nr.join("_")]),kt=D(ir,st.length,$),gt=Q&&Object(E.d)(Q.y),vt=Q&&Object(E.d)(Q.x),Ot=vt&&st.some(function(Qe){var et=Qe.fixed;return et}),ar=S.useRef(),Nt=ce(ze,xe),Rt=Nt.isSticky,Sr=Nt.offsetHeader,wr=Nt.offsetScroll,Cr=Nt.stickyClassName,Wt,Ut,Ht;gt&&(Ut={overflowY:"scroll",maxHeight:Q.y}),vt&&(Wt={overflowX:"auto"},gt||(Ut={overflowY:"hidden"}),Ht={width:Q.x===!0?"auto":Q.x,minWidth:"100%"});var sr=S.useCallback(function(Qe,et){Tr(function(ot){var ft=new Map(ot);return ft.set(Qe,et),ft})},[]),Or=K(null),or=Object(P.a)(Or,2),Rr=or[0],lr=or[1];function Kt(Qe,et){if(!et)return;typeof et=="function"?et(Qe):et.scrollLeft!==Qe&&(et.scrollLeft=Qe)}var St=function(et){var ot=et.currentTarget,ft=et.scrollLeft,At=typeof ft=="number"?ft:ot.scrollLeft,pr=ot||Ce;if(!lr()||lr()===pr){var $t;Rr(pr),Kt(At,Qt.current),Kt(At,Tt.current),Kt(At,($t=ar.current)===null||$t===void 0?void 0:$t.setScrollLeft)}if(ot){var kr=ot.scrollWidth,Nr=ot.clientWidth;vr(At>0),_r(At<kr-Nr)}},Gt=function(){Tt.current&&St({currentTarget:Tt.current})},Ar=function(et){var ot=et.width;Gt(),Pt(jt.current?jt.current.offsetWidth:ot)};S.useEffect(function(){return Gt},[]),S.useEffect(function(){vt&&Gt()},[vt]),S.useEffect(function(){Ne===Oe&&$e&&($e.body.current=Tt.current)});var ur=Ue(["table"],"table"),Bt=S.useMemo(function(){return Y||(Ot?Q.x==="max-content"?"auto":"fixed":gt||st.some(function(Qe){var et=Qe.ellipsis;return et})?"fixed":"auto")},[gt,Ot,st,Y]),zt,Vt={colWidths:ir,columCount:st.length,stickyOffsets:kt,onHeaderRow:Ge,fixHeader:gt},Ir=S.useMemo(function(){return Ze?null:typeof Pe=="function"?Pe():Pe},[Ze,Pe]),hr=S.createElement(ve,{data:He,measureColumnWidth:gt||vt||Rt,expandedKeys:ht,rowExpandable:Ve,getRowKey:Be,onRow:Ae,emptyNode:Ir,childrenColumnName:wt}),dr=S.createElement(u,{colWidths:st.map(function(Qe){var et=Qe.width;return et}),columns:st}),cr=le&&S.createElement(M.b,null,le(He)),fr=Ue(["body"]);if(gt||Rt){var Yt;typeof fr=="function"?(Yt=fr(He,{scrollbarSize:qe,ref:Tt,onScroll:St}),Vt.colWidths=st.map(function(Qe,et){var ot=Qe.width,ft=et===Ft.length-1?ot-qe:ot;return typeof ft=="number"&&!Number.isNaN(ft)?ft:(Object(v.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):Yt=S.createElement("div",{style:Object(B.a)(Object(B.a)({},Wt),Ut),onScroll:St,ref:Tt,className:N()("".concat(xe,"-body"))},S.createElement(ur,{style:Object(B.a)(Object(B.a)({},Ht),{},{tableLayout:Bt})},dr,hr,cr),Rt&&S.createElement(ue,{ref:ar,offsetScroll:wr,scrollBodyRef:Tt,onScroll:St})),zt=S.createElement(S.Fragment,null,Te!==!1&&S.createElement(d,Object.assign({noData:!He.length},Vt,Mt,{direction:$,offsetHeader:Sr,stickyClassName:Cr,ref:Qt,onScroll:St})),Yt)}else zt=S.createElement("div",{style:Object(B.a)(Object(B.a)({},Wt),Ut),className:N()("".concat(xe,"-content")),onScroll:St,ref:Tt},S.createElement(ur,{style:Object(B.a)(Object(B.a)({},Ht),{},{tableLayout:Bt})},dr,Te!==!1&&S.createElement(f,Object.assign({},Vt,Mt)),hr,cr));var Lr=Object(h.b)(de),Xt=S.createElement("div",Object.assign({className:N()(xe,we,(ge={},Object(ne.a)(ge,"".concat(xe,"-rtl"),$==="rtl"),Object(ne.a)(ge,"".concat(xe,"-ping-left"),qt),Object(ne.a)(ge,"".concat(xe,"-ping-right"),tr),Object(ne.a)(ge,"".concat(xe,"-layout-fixed"),Y==="fixed"),Object(ne.a)(ge,"".concat(xe,"-fixed-header"),gt),Object(ne.a)(ge,"".concat(xe,"-fixed-column"),Ot),Object(ne.a)(ge,"".concat(xe,"-scroll-horizontal"),vt),Object(ne.a)(ge,"".concat(xe,"-has-fix-left"),st[0]&&st[0].fixed),Object(ne.a)(ge,"".concat(xe,"-has-fix-right"),st[st.length-1]&&st[st.length-1].fixed==="right"),ge)),style:z,id:he,ref:jt},Lr),S.createElement(Ie,{pingLeft:qt,pingRight:tr,props:Object(B.a)(Object(B.a)({},de),{},{stickyOffsets:kt,mergedExpandedKeys:ht})},te&&S.createElement(J,{className:"".concat(xe,"-title")},te(He)),S.createElement("div",{className:"".concat(xe,"-container")},zt),re&&S.createElement(J,{className:"".concat(xe,"-footer")},re(He))));vt&&(Xt=S.createElement(g.a,{onResize:Ar},Xt));var Dr=S.useMemo(function(){return{prefixCls:xe,getComponent:Ue,scrollbarSize:qe,direction:$,fixedInfoList:st.map(function(Qe,et){return t(et,et,st,kt,$)}),isSticky:Rt}},[xe,Ue,qe,$,st,kt,$,Rt]),Pr=S.useMemo(function(){return Object(B.a)(Object(B.a)({},Mt),{},{tableLayout:Bt,rowClassName:Z,expandedRowClassName:nt,componentWidth:Ct,fixHeader:gt,fixColumn:Ot,horizonScroll:vt,expandIcon:_t,expandableType:It,expandRowByClick:at,expandedRowRender:Ye,onTriggerExpand:bt,expandIconColumnIndex:dt,indentSize:xt})},[Mt,Bt,Z,nt,Ct,gt,Ot,vt,_t,It,at,Ye,bt,dt,xt]),Mr=S.useMemo(function(){return{onColumnResize:sr}},[sr]);return S.createElement(r.a.Provider,{value:Dr},S.createElement(L.Provider,{value:Pr},S.createElement(V.Provider,{value:Mr},Xt)))}De.Column=i.a,De.ColumnGroup=s.a,De.Summary=M.a,De.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var Me=se.b=De},wRmb:function(Le,se,U){"use strict";U.d(se,"a",function(){return w});var ne=U("rePB"),B=U("KQm4"),A=U("VTBJ"),j=U("Ff2n"),P=U("q1tI"),S=U.n(P),W=U("Kwbf"),N=U("Zm9Q"),e=U("hW8S");function w(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(j.a)(n,["children"]),E=Object(A.a)({key:a},t);return r&&(E.children=w(r)),E})}function v(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(B.a)(l),Object(B.a)(v(t).map(function(E){return Object(A.a)({fixed:r},E)}))):[].concat(Object(B.a)(l),[Object(A.a)(Object(A.a)({},a),{},{fixed:r})])},[])}function g(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(W.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(W.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(j.a)(l,["fixed"]),r=a;return a==="left"?r="right":a==="right"&&(r="left"),Object(A.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||w(r)},[n,r]),b=P.useMemo(function(){if(t){var O,L=f||0,x=u[L],I=(O={},Object(ne.a)(O,e.a,{className:"".concat(a,"-expand-icon-col")}),Object(ne.a)(O,"title",""),Object(ne.a)(O,"fixed",x?x.fixed:null),Object(ne.a)(O,"className","".concat(a,"-row-expand-icon-cell")),Object(ne.a)(O,"render",function(F,V,ee){var ie=y(V,ee),pe=E.has(ie),ve=_?_(V):!0,ye=T({prefixCls:a,expanded:pe,expandable:ve,record:V,onExpand:m});return o?P.createElement("span",{onClick:function(Se){return Se.stopPropagation()}},ye):ye}),O),k=u.slice();return L>=0&&k.splice(L,0,I),k}return u},[t,u,y,E,T,h]),p=P.useMemo(function(){var O=b;return l&&(O=l(O)),O.length||(O=[{render:function(){return null}}]),O},[l,b,h]),d=P.useMemo(function(){return h==="rtl"?c(v(p)):v(p)},[p,h]);return[p,d]}se.b=s},wwSX:function(Le,se,U){Le.exports=U.p+"static/b2.2c844a2a.svg"},"y0+3":function(Le,se,U){"use strict";U.d(se,"a",function(){return v}),U.d(se,"b",function(){return c});var ne=/margin|padding|width|height|max|min|offset/,B={left:!0,top:!0},A={cssFloat:1,styleFloat:1,float:1};function j(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 B||(B[i]=ne.test(i)),B[i]?parseFloat(l)||0:l}function S(s,i){var l=arguments.length,a=j(s);return i=A[i]?"cssFloat"in s.style?"cssFloat":"styleFloat":i,l===1?a:P(s,i,a[i]||s.style[i])}function W(s,i,l){var a=arguments.length;if(i=A[i]?"cssFloat"in s.style?"cssFloat":"styleFloat":i,a===3)return typeof l=="number"&&ne.test(i)&&(l="".concat(l,"px")),s.style[i]=l,l;for(var n in i)i.hasOwnProperty(n)&&W(s,n,i[n]);return j(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 w(){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 v(){var s=document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight;return{width:s,height:i}}function g(){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(Le,se,U){Le.exports=U.p+"static/b3.30079151.svg"}}]);